From 4faea1c2836a70171d9156cc9dd29b45636d3457 Mon Sep 17 00:00:00 2001 From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> Date: Sat, 25 Nov 2023 09:48:09 +0000 Subject: [PATCH 1/2] augeas: 1.12.0 -> 1.14.1; fix darwin build use github source, enable tests, split output --- pkgs/tools/system/augeas/bootstrap.diff | 15 +++++++ pkgs/tools/system/augeas/default.nix | 56 +++++++++++++++++++++---- 2 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 pkgs/tools/system/augeas/bootstrap.diff diff --git a/pkgs/tools/system/augeas/bootstrap.diff b/pkgs/tools/system/augeas/bootstrap.diff new file mode 100644 index 000000000000..3740134c5478 --- /dev/null +++ b/pkgs/tools/system/augeas/bootstrap.diff @@ -0,0 +1,15 @@ +diff --git a/bootstrap b/bootstrap +index a84eb39..cac656d 100755 +--- a/bootstrap ++++ b/bootstrap +@@ -53,9 +53,6 @@ case ${GNULIB_SRCDIR--} in + echo "$0: getting gnulib files..." + git submodule update || exit $? + GNULIB_SRCDIR=.gnulib +- else +- echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR" +- exit 1 + fi + ;; + esac + diff --git a/pkgs/tools/system/augeas/default.nix b/pkgs/tools/system/augeas/default.nix index bea2edd553d4..e30de64f5ad1 100644 --- a/pkgs/tools/system/augeas/default.nix +++ b/pkgs/tools/system/augeas/default.nix @@ -1,23 +1,65 @@ -{ lib, stdenv, fetchurl, pkg-config, readline, libxml2 }: +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, bison +, flex +, perl # for pod2man +, pkg-config +, readline +, libxml2 +}: stdenv.mkDerivation rec { pname = "augeas"; - version = "1.12.0"; + version = "1.14.1"; - src = fetchurl { - url = "http://download.augeas.net/${pname}-${version}.tar.gz"; - sha256 = "11ybhb13wkkilsn7b416a1dn61m1xrq0lbdpkhp5w61jrk4l469j"; + src = fetchFromGitHub { + owner = "hercules-team"; + repo = "augeas"; + rev = "release-${version}"; + fetchSubmodules = true; + hash = "sha256-U5tm3LDUeI/idHtL2Zy33BigkyvHunXPjToDC59G9VE="; }; - nativeBuildInputs = [ pkg-config ]; + + patches = [ + # already have the submodules so don't fail when .git doesn't exist. + ./bootstrap.diff + ]; + + postPatch = '' + ./bootstrap --gnulib-srcdir=.gnulib + ''; + + nativeBuildInputs = [ + autoreconfHook + bison + flex + perl + pkg-config + ]; + buildInputs = [ readline libxml2 ]; enableParallelBuilding = true; + doCheck = true; + + checkPhase = '' + runHook preCheck + patchShebangs --build gnulib/tests tests + make -j $NIX_BUILD_CORES check + runHook postCheck + ''; + + outputs = [ "out" "dev" ]; + meta = with lib; { description = "Configuration editing tool"; license = licenses.lgpl21Only; homepage = "https://augeas.net/"; - changelog = "https://augeas.net/news.html"; + changelog = "https://github.com/hercules-team/augeas/releases/tag/release-${version}"; + mainProgram = "augtool"; maintainers = with maintainers; [ offline ]; platforms = platforms.unix; }; From 998308f5fddb9c6b9a8098aa6a5eba3ca1b3d8e7 Mon Sep 17 00:00:00 2001 From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> Date: Sat, 25 Nov 2023 11:50:06 +0000 Subject: [PATCH 2/2] python311Packages.augeas: 1.1.0 -> 1.2.0 https://github.com/hercules-team/python-augeas/releases/tag/v1.2.0 --- .../python-modules/augeas/default.nix | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/augeas/default.nix b/pkgs/development/python-modules/augeas/default.nix index 6b70f3675268..4872a4ac18d9 100644 --- a/pkgs/development/python-modules/augeas/default.nix +++ b/pkgs/development/python-modules/augeas/default.nix @@ -1,30 +1,36 @@ -{ stdenv, lib, buildPythonPackage, fetchFromGitHub, augeas, cffi }: +{ lib +, stdenv +, fetchFromGitHub +, buildPythonPackage +, unittestCheckHook +, pkg-config +, augeas +, cffi +, pkgs # for libxml2 +}: buildPythonPackage rec { pname = "augeas"; - version = "1.1.0"; + version = "1.2.0"; src = fetchFromGitHub { owner = "hercules-team"; repo = "python-augeas"; rev = "v${version}"; - sha256 = "12q52ilcx059rn544x3712xq6myn99niz131l0fs3xx67456pajh"; + hash = "sha256-Lq8ckra3sqN38zo1d5JsEq6U5TtLKRmqysoWNwR9J9A="; }; - # TODO: not very nice! - postPatch = - let libname = "libaugeas${stdenv.hostPlatform.extensions.sharedLibrary}"; - in - '' - substituteInPlace augeas/ffi.py \ - --replace 'ffi.dlopen("augeas")' \ - 'ffi.dlopen("${lib.makeLibraryPath [augeas]}/${libname}")' - ''; + nativeBuildInputs = [ pkg-config ]; - propagatedBuildInputs = [ cffi augeas ]; + buildInputs = [ augeas pkgs.libxml2 ]; - doCheck = false; + propagatedBuildInputs = [ cffi ]; + + nativeCheckInputs = [ unittestCheckHook ]; + + pythonImportsCheck = [ "augeas" ]; meta = with lib; { + changelog = "https://github.com/hercules-team/python-augeas/releases/tag/v${version}"; description = "Pure python bindings for augeas"; homepage = "https://github.com/hercules-team/python-augeas"; license = licenses.lgpl2Plus;