about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pycdio/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pycdio/default.nix')
-rw-r--r--pkgs/development/python-modules/pycdio/default.nix67
1 files changed, 36 insertions, 31 deletions
diff --git a/pkgs/development/python-modules/pycdio/default.nix b/pkgs/development/python-modules/pycdio/default.nix
index e8f0323b2f92e..2b2e635961963 100644
--- a/pkgs/development/python-modules/pycdio/default.nix
+++ b/pkgs/development/python-modules/pycdio/default.nix
@@ -1,47 +1,52 @@
-{ lib, stdenv
-, buildPythonPackage
-, fetchPypi
-, setuptools
-, nose
-, pkgs
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  setuptools,
+  pkg-config,
+  swig,
+  libcdio,
+  libiconv,
+  pytestCheckHook,
 }:
 
 buildPythonPackage rec {
   pname = "pycdio";
-  version = "2.1.1";
-  format = "setuptools";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "61734db8c554b7b1a2cb2da2e2c15d3f9f5973a57cfb06f8854c38029004a9f8";
+  version = "2.1.1-unstable-2024-02-26";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "rocky";
+    repo = "pycdio";
+    rev = "806c6a2eeeeb546055ce2ac9a0ae6a14ea53ae35"; # no tag for this version (yet)
+    hash = "sha256-bOm82mBUIaw4BGHj3Y24Fv5+RfAew+Ma1u4QENXoRiU=";
   };
 
-  prePatch = ''
-    substituteInPlace setup.py \
-      --replace 'library_dirs=library_dirs' 'library_dirs=[dir.decode("utf-8") for dir in library_dirs]' \
-      --replace 'include_dirs=include_dirs' 'include_dirs=[dir.decode("utf-8") for dir in include_dirs]' \
-      --replace 'runtime_library_dirs=runtime_lib_dirs' 'runtime_library_dirs=[dir.decode("utf-8") for dir in runtime_lib_dirs]'
-  '';
-
   preConfigure = ''
     patchShebangs .
   '';
 
-  nativeBuildInputs = [ nose pkgs.pkg-config pkgs.swig ];
-  buildInputs = [ setuptools pkgs.libcdio ]
-    ++ lib.optional stdenv.isDarwin pkgs.libiconv;
+  build-system = [ setuptools ];
 
-  # Run tests using nosetests but first need to install the binaries
-  # to the root source directory where they can be found.
-  checkPhase = ''
-    ./setup.py install_lib -d .
-    nosetests
-  '';
+  nativeBuildInputs = [
+    pkg-config
+    swig
+  ];
 
-  meta = with lib; {
+  buildInputs = [
+    libcdio
+    libiconv
+  ];
+
+  nativeCheckInputs = [ pytestCheckHook ];
+
+  pytestFlagsArray = [ "test/test-*.py" ];
+
+  meta = {
     homepage = "https://www.gnu.org/software/libcdio/";
+    changelog = "https://github.com/rocky/pycdio/blob/${src.rev}/ChangeLog";
     description = "Wrapper around libcdio (CD Input and Control library)";
-    license = licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ sigmanificient ];
   };
-
 }