diff --git a/pkgs/applications/misc/liberasurecode/default.nix b/pkgs/by-name/li/liberasurecode/package.nix similarity index 52% rename from pkgs/applications/misc/liberasurecode/default.nix rename to pkgs/by-name/li/liberasurecode/package.nix index f94496d0b125..1f4cb055cc99 100644 --- a/pkgs/applications/misc/liberasurecode/default.nix +++ b/pkgs/by-name/li/liberasurecode/package.nix @@ -1,34 +1,44 @@ -{ lib -, stdenv -, fetchFromGitHub -, autoreconfHook -, doxygen -, installShellFiles -, zlib +{ + lib, + stdenv, + autoreconfHook, + doxygen, + fetchFromGitHub, + installShellFiles, + testers, + zlib, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "liberasurecode"; - version = "1.6.3"; + version = "1.6.4"; - outputs = [ "out" "dev" "doc" ]; + outputs = [ + "out" + "dev" + "doc" + ]; src = fetchFromGitHub { owner = "openstack"; - repo = pname; - rev = version; - sha256 = "sha256-HCp+FQ9nq4twk6FtfKhzT80wXXJbvG+clrDO2/9ATpU="; + repo = "liberasurecode"; + rev = "refs/tags/${finalAttrs.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 = [ autoreconfHook doxygen installShellFiles ]; + nativeBuildInputs = [ + autoreconfHook + doxygen + installShellFiles + ]; buildInputs = [ zlib ]; @@ -47,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" ]; }; -} +}) diff --git a/pkgs/development/python-modules/pyeclib/default.nix b/pkgs/development/python-modules/pyeclib/default.nix index 70fb7aeb5975..0ada1b1306bd 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" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3fd48693159e..688bfe22cfc2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19923,8 +19923,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 { };