diff --git a/pkgs/development/python-modules/btrfsutil/default.nix b/pkgs/development/python-modules/btrfsutil/default.nix new file mode 100644 index 000000000000..d529ec09c705 --- /dev/null +++ b/pkgs/development/python-modules/btrfsutil/default.nix @@ -0,0 +1,26 @@ +{ lib +, buildPythonPackage +, btrfs-progs +}: +buildPythonPackage { + pname = "btrfsutil"; + inherit (btrfs-progs) version src; + format = "setuptools"; + + buildInputs = [ btrfs-progs ]; + + preConfigure = '' + cd libbtrfsutil/python + ''; + + # No tests + doCheck = false; + pythonImportsCheck = [ "btrfsutil" ]; + + meta = with lib; { + description = "Library for managing Btrfs filesystems"; + homepage = "https://btrfs.wiki.kernel.org/"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ raskin lopsided98 ]; + }; +} diff --git a/pkgs/tools/filesystems/btrfs-progs/default.nix b/pkgs/tools/filesystems/btrfs-progs/default.nix index ee1bea9c29ef..e01ee2a8cf47 100644 --- a/pkgs/tools/filesystems/btrfs-progs/default.nix +++ b/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -1,11 +1,10 @@ { lib, stdenv, fetchurl -, pkg-config, python3, sphinx +, pkg-config, sphinx , zstd , acl, attr, e2fsprogs, libuuid, lzo, udev, zlib , runCommand, btrfs-progs , gitUpdater , udevSupport ? true -, enablePython ? true }: stdenv.mkDerivation rec { @@ -19,13 +18,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config - ] ++ lib.optionals enablePython [ - python3 python3.pkgs.setuptools ] ++ [ sphinx ]; - buildInputs = [ acl attr e2fsprogs libuuid lzo python3 udev zlib zstd ]; + buildInputs = [ acl attr e2fsprogs libuuid lzo udev zlib zstd ]; # gcc bug with -O1 on ARM with gcc 4.8 # This should be fine on all platforms so apply universally @@ -35,18 +32,17 @@ stdenv.mkDerivation rec { install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs ''; - configureFlags = lib.optionals stdenv.hostPlatform.isMusl [ - "--disable-backtrace" - ] ++ lib.optionals (!enablePython) [ + configureFlags = [ + # Built separately, see python3Packages.btrfsutil "--disable-python" + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ + "--disable-backtrace" ] ++ lib.optionals (!udevSupport) [ "--disable-libudev" ]; makeFlags = [ "udevruledir=$(out)/lib/udev/rules.d" ]; - installFlags = lib.optionals enablePython [ "install_python" ]; - enableParallelBuilding = true; passthru.tests = { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0ae0f7f102ab..0c9581df4966 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1430,7 +1430,7 @@ self: super: with self; { btrfs = callPackage ../development/python-modules/btrfs { }; - btrfsutil = toPythonModule (pkgs.btrfs-progs.override { python3 = self.python; }); + btrfsutil = callPackage ../development/python-modules/btrfsutil { }; btsocket = callPackage ../development/python-modules/btsocket { };