From 7fc4e0e7c6ba59580b413492374e7525fd7e3073 Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Sun, 1 Sep 2024 21:33:10 +0200 Subject: [PATCH 1/5] liberasurecode: format with nixfmt-rfc-style --- .../misc/liberasurecode/default.nix | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/misc/liberasurecode/default.nix b/pkgs/applications/misc/liberasurecode/default.nix index f94496d0b125e..e501324ecee58 100644 --- a/pkgs/applications/misc/liberasurecode/default.nix +++ b/pkgs/applications/misc/liberasurecode/default.nix @@ -1,17 +1,22 @@ -{ lib -, stdenv -, fetchFromGitHub -, autoreconfHook -, doxygen -, installShellFiles -, zlib +{ + lib, + stdenv, + autoreconfHook, + doxygen, + fetchFromGitHub, + installShellFiles, + zlib, }: stdenv.mkDerivation rec { pname = "liberasurecode"; version = "1.6.3"; - outputs = [ "out" "dev" "doc" ]; + outputs = [ + "out" + "dev" + "doc" + ]; src = fetchFromGitHub { owner = "openstack"; @@ -28,7 +33,11 @@ stdenv.mkDerivation rec { --replace "-Werror" "" ''; - nativeBuildInputs = [ autoreconfHook doxygen installShellFiles ]; + nativeBuildInputs = [ + autoreconfHook + doxygen + installShellFiles + ]; buildInputs = [ zlib ]; From c3bda7ebcb79fabc637461755654b3451878c39c Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Sun, 1 Sep 2024 21:33:56 +0200 Subject: [PATCH 2/5] liberasurecode: migrate to pkgs/by-name --- .../default.nix => by-name/li/liberasurecode/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/misc/liberasurecode/default.nix => by-name/li/liberasurecode/package.nix} (100%) diff --git a/pkgs/applications/misc/liberasurecode/default.nix b/pkgs/by-name/li/liberasurecode/package.nix similarity index 100% rename from pkgs/applications/misc/liberasurecode/default.nix rename to pkgs/by-name/li/liberasurecode/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 322d2cf6b7669..d5fb30beb1d85 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19925,8 +19925,6 @@ with pkgs; libesmtp = callPackage ../development/libraries/libesmtp { }; - liberasurecode = callPackage ../applications/misc/liberasurecode { }; - example-robot-data = callPackage ../development/libraries/example-robot-data { }; exiv2 = callPackage ../development/libraries/exiv2 { }; From 5eeb24425935bb2422910ca2627960004a3ee48b Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Sun, 1 Sep 2024 21:31:46 +0200 Subject: [PATCH 3/5] liberasurecode: 1.6.3 -> 1.6.4 https://github.com/openstack/liberasurecode/compare/1.6.3...1.6.4 --- pkgs/by-name/li/liberasurecode/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/li/liberasurecode/package.nix b/pkgs/by-name/li/liberasurecode/package.nix index e501324ecee58..e2ae9d380f835 100644 --- a/pkgs/by-name/li/liberasurecode/package.nix +++ b/pkgs/by-name/li/liberasurecode/package.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { pname = "liberasurecode"; - version = "1.6.3"; + version = "1.6.4"; outputs = [ "out" @@ -20,17 +20,17 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "openstack"; - repo = pname; - rev = version; - sha256 = "sha256-HCp+FQ9nq4twk6FtfKhzT80wXXJbvG+clrDO2/9ATpU="; + repo = "liberasurecode"; + rev = "refs/tags/${version}"; + hash = "sha256-KYXlRjUudWhFbhyv9V1fmqwBw3/vTBfusxafaNG+Q40="; }; postPatch = '' substituteInPlace doc/doxygen.cfg.in \ - --replace "GENERATE_MAN = NO" "GENERATE_MAN = YES" + --replace-fail "GENERATE_MAN = NO" "GENERATE_MAN = YES" substituteInPlace Makefile.am src/Makefile.am \ - --replace "-Werror" "" + --replace-fail "-Werror" "" ''; nativeBuildInputs = [ From f510a49e54ed793cbe7a258e19b7ae5595c326b8 Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Sun, 1 Sep 2024 21:39:14 +0200 Subject: [PATCH 4/5] liberasurecode: add passthru.tests.pkg-config, meta.pkgConfigModules --- pkgs/by-name/li/liberasurecode/package.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/li/liberasurecode/package.nix b/pkgs/by-name/li/liberasurecode/package.nix index e2ae9d380f835..1f4cb055cc99f 100644 --- a/pkgs/by-name/li/liberasurecode/package.nix +++ b/pkgs/by-name/li/liberasurecode/package.nix @@ -5,10 +5,11 @@ doxygen, fetchFromGitHub, installShellFiles, + testers, zlib, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "liberasurecode"; version = "1.6.4"; @@ -21,7 +22,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "openstack"; repo = "liberasurecode"; - rev = "refs/tags/${version}"; + rev = "refs/tags/${finalAttrs.version}"; hash = "sha256-KYXlRjUudWhFbhyv9V1fmqwBw3/vTBfusxafaNG+Q40="; }; @@ -56,10 +57,15 @@ stdenv.mkDerivation rec { checkTarget = "test"; + passthru.tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + }; + meta = with lib; { description = "Erasure Code API library written in C with pluggable Erasure Code backends"; homepage = "https://github.com/openstack/liberasurecode"; license = licenses.bsd2; maintainers = teams.openstack.members; + pkgConfigModules = [ "erasurecode-1" ]; }; -} +}) From 9d60285f79704e3aaa1565ef2202fee001926673 Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Sun, 1 Sep 2024 21:49:44 +0200 Subject: [PATCH 5/5] python311Packages.pyeclib: unstable-2022-03-11 -> 1.6.1 https://github.com/openstack/pyeclib/compare/b50040969a03f7566ffcb468336e875d21486113...1.6.1 --- .../python-modules/pyeclib/default.nix | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/pyeclib/default.nix b/pkgs/development/python-modules/pyeclib/default.nix index 70fb7aeb59754..0ada1b1306bdd 100644 --- a/pkgs/development/python-modules/pyeclib/default.nix +++ b/pkgs/development/python-modules/pyeclib/default.nix @@ -2,32 +2,41 @@ lib, stdenv, buildPythonPackage, + distutils, fetchFromGitHub, liberasurecode, + pytestCheckHook, + setuptools, six, }: buildPythonPackage rec { pname = "pyeclib"; - version = "unstable-2022-03-11"; - format = "setuptools"; + version = "1.6.1"; + pyproject = true; src = fetchFromGitHub { owner = "openstack"; repo = "pyeclib"; - rev = "b50040969a03f7566ffcb468336e875d21486113"; - hash = "sha256-nYYjocStC0q/MC6pum3J4hlXiu/R5xODwIE97Ho3iEY="; + rev = "refs/tags/${version}"; + hash = "sha256-pa3majZ68+DQGtgGCpZVRshof+w9jvpxreo4dkckLXk="; }; postPatch = '' # patch dlopen call substituteInPlace src/c/pyeclib_c/pyeclib_c.c \ - --replace "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so" + --replace-fail "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so" + # python's platform.platform() doesn't return "Darwin" (anymore?) substituteInPlace setup.py \ - --replace '"Darwin"' '"macOS"' + --replace-fail '"Darwin"' '"macOS"' ''; + build-system = [ + distutils + setuptools + ]; + preBuild = let ldLibraryPathEnvName = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; @@ -37,9 +46,12 @@ buildPythonPackage rec { export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [ liberasurecode ]}" ''; - buildInputs = [ liberasurecode ]; + dependencies = [ liberasurecode ]; - nativeCheckInputs = [ six ]; + nativeCheckInputs = [ + pytestCheckHook + six + ]; pythonImportsCheck = [ "pyeclib" ];