From 78ef5f9c14785d99a9670c65c2735610735a0bc4 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 22 Oct 2014 08:15:30 +0200 Subject: [PATCH] nixpart: Move all 0.4 dependencies into one dir. Once nixpart 1.0 is released we then only need to delete one single directory rather than searching for needles in a haystack, that is, all of . Also, it keeps my sanity at an almost healthy level. Signed-off-by: aszlig --- nixos/tests/partition.nix | 2 +- pkgs/tools/filesystems/nixpart/0.4.nix | 29 ------- .../filesystems/nixpart/0.4/blivet.nix} | 8 +- .../filesystems/nixpart/0.4/cryptsetup.nix | 28 +++++++ .../tools/filesystems/nixpart/0.4/default.nix | 76 +++++++++++++++++ .../filesystems/nixpart/0.4/dmraid.nix} | 0 .../filesystems/nixpart/0.4/lvm2.nix} | 0 .../nixpart/0.4/multipath-tools.nix | 34 ++++++++ .../nixpart/0.4/parted.nix} | 0 .../tools/filesystems/nixpart/0.4/pyblock.nix | 29 +++++++ .../filesystems/nixpart/0.4/pykickstart.nix | 30 +++++++ .../filesystems/nixpart/0.4/pyparted.nix | 42 ++++++++++ pkgs/top-level/all-packages.nix | 24 ------ pkgs/top-level/python-packages.nix | 82 +------------------ 14 files changed, 243 insertions(+), 141 deletions(-) delete mode 100644 pkgs/tools/filesystems/nixpart/0.4.nix rename pkgs/{development/python-modules/blivet/0.17.nix => tools/filesystems/nixpart/0.4/blivet.nix} (87%) create mode 100644 pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix create mode 100644 pkgs/tools/filesystems/nixpart/0.4/default.nix rename pkgs/{os-specific/linux/dmraid/rc15.nix => tools/filesystems/nixpart/0.4/dmraid.nix} (100%) rename pkgs/{os-specific/linux/lvm2/2.02.106.nix => tools/filesystems/nixpart/0.4/lvm2.nix} (100%) create mode 100644 pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix rename pkgs/tools/{misc/parted/3.1.nix => filesystems/nixpart/0.4/parted.nix} (100%) create mode 100644 pkgs/tools/filesystems/nixpart/0.4/pyblock.nix create mode 100644 pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix create mode 100644 pkgs/tools/filesystems/nixpart/0.4/pyparted.nix diff --git a/nixos/tests/partition.nix b/nixos/tests/partition.nix index 9a4246e04210..5e94b263d5b8 100644 --- a/nixos/tests/partition.nix +++ b/nixos/tests/partition.nix @@ -68,7 +68,7 @@ in { machine = { config, pkgs, ... }: { environment.systemPackages = [ pkgs.pythonPackages.nixpart0 - pkgs.file pkgs.btrfsProgs pkgs.xfsprogs pkgs.lvm2_2_02_106 + pkgs.file pkgs.btrfsProgs pkgs.xfsprogs pkgs.lvm2 ]; virtualisation.emptyDiskImages = [ 4096 4096 ]; }; diff --git a/pkgs/tools/filesystems/nixpart/0.4.nix b/pkgs/tools/filesystems/nixpart/0.4.nix deleted file mode 100644 index 633f04320c37..000000000000 --- a/pkgs/tools/filesystems/nixpart/0.4.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv, fetchurl, buildPythonPackage, blivet -# Propagated to blivet -, useNixUdev ? null, udevSoMajor ? null -}: - -let - blivetOverrides = stdenv.lib.filterAttrs (k: v: v != null) { - inherit useNixUdev udevSoMajor; - }; -in buildPythonPackage rec { - name = "nixpart-${version}"; - version = "0.4.1"; - - src = fetchurl { - url = "https://github.com/aszlig/nixpart/archive/v${version}.tar.gz"; - sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp"; - }; - - propagatedBuildInputs = [ (blivet.override blivetOverrides) ]; - - doCheck = false; - - meta = { - description = "NixOS storage manager/partitioner"; - license = stdenv.lib.licenses.gpl2Plus; - maintainers = [ stdenv.lib.maintainers.aszlig ]; - platforms = stdenv.lib.platforms.linux; - }; -} diff --git a/pkgs/development/python-modules/blivet/0.17.nix b/pkgs/tools/filesystems/nixpart/0.4/blivet.nix similarity index 87% rename from pkgs/development/python-modules/blivet/0.17.nix rename to pkgs/tools/filesystems/nixpart/0.4/blivet.nix index c1b36bf909de..44333b519cbe 100644 --- a/pkgs/development/python-modules/blivet/0.17.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/blivet.nix @@ -7,11 +7,7 @@ assert useNixUdev -> udev != null; -let - pyenable = { enablePython = true; }; - selinuxWithPython = libselinux.override pyenable; - cryptsetupWithPython = cryptsetup.override pyenable; -in buildPythonPackage rec { +buildPythonPackage rec { name = "blivet-${version}"; version = "0.17-1"; @@ -43,7 +39,7 @@ in buildPythonPackage rec { ''); propagatedBuildInputs = [ - pykickstart pyparted pyblock selinuxWithPython cryptsetupWithPython + pykickstart pyparted pyblock libselinux cryptsetup ] ++ stdenv.lib.optional useNixUdev udev; # tests are currently _heavily_ broken upstream diff --git a/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix b/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix new file mode 100644 index 000000000000..c612512b8cc9 --- /dev/null +++ b/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchurl, devicemapper, libgcrypt, libuuid, pkgconfig, popt +, enablePython ? true, python ? null +}: + +assert enablePython -> python != null; + +stdenv.mkDerivation rec { + name = "cryptsetup-1.6.3"; + + src = fetchurl { + url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2"; + sha256 = "1n1qk5chyjspbiianrdb55fhb4wl0vfyqz2br05vfb24v4qlgbx2"; + }; + + configureFlags = [ "--enable-cryptsetup-reencrypt" ] + ++ stdenv.lib.optional enablePython "--enable-python"; + + buildInputs = [ devicemapper libgcrypt libuuid pkgconfig popt ] + ++ stdenv.lib.optional enablePython python; + + meta = { + homepage = http://code.google.com/p/cryptsetup/; + description = "LUKS for dm-crypt"; + license = stdenv.lib.licenses.gpl2; + maintainers = with stdenv.lib.maintainers; [ viric chaoflow ]; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/pkgs/tools/filesystems/nixpart/0.4/default.nix b/pkgs/tools/filesystems/nixpart/0.4/default.nix new file mode 100644 index 000000000000..9ea2f9bfdc77 --- /dev/null +++ b/pkgs/tools/filesystems/nixpart/0.4/default.nix @@ -0,0 +1,76 @@ +{ stdenv, fetchurl, python, buildPythonPackage +# Propagated to blivet +, useNixUdev ? true, udevSoMajor ? null +# Propagated dependencies +, pkgs, urlgrabber +}: + +let + blivet = import ./blivet.nix { + inherit stdenv fetchurl buildPythonPackage; + inherit pykickstart pyparted pyblock cryptsetup multipath_tools; + inherit useNixUdev udevSoMajor; + inherit (pkgs) lsof utillinux udev; + libselinux = pkgs.libselinux.override { enablePython = true; }; + }; + + cryptsetup = import ./cryptsetup.nix { + inherit stdenv fetchurl python; + inherit (pkgs) pkgconfig libgcrypt libuuid popt; + devicemapper = lvm2; + }; + + dmraid = import ./dmraid.nix { + inherit stdenv fetchurl; + devicemapper = lvm2; + }; + + lvm2 = import ./lvm2.nix { + inherit stdenv fetchurl; + inherit (pkgs) pkgconfig utillinux udev coreutils; + }; + + multipath_tools = import ./multipath-tools.nix { + inherit stdenv fetchurl lvm2; + inherit (pkgs) readline udev libaio gzip; + }; + + parted = import ./parted.nix { + inherit stdenv fetchurl; + inherit (pkgs) utillinux readline libuuid gettext check; + devicemapper = lvm2; + }; + + pyblock = import ./pyblock.nix { + inherit stdenv fetchurl python lvm2 dmraid; + }; + + pykickstart = import ./pykickstart.nix { + inherit stdenv fetchurl python buildPythonPackage urlgrabber; + }; + + pyparted = import ./pyparted.nix { + inherit stdenv fetchurl python buildPythonPackage parted; + inherit (pkgs) pkgconfig e2fsprogs; + }; + +in buildPythonPackage rec { + name = "nixpart-${version}"; + version = "0.4.1"; + + src = fetchurl { + url = "https://github.com/aszlig/nixpart/archive/v${version}.tar.gz"; + sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp"; + }; + + propagatedBuildInputs = [ blivet ]; + + doCheck = false; + + meta = { + description = "NixOS storage manager/partitioner"; + license = stdenv.lib.licenses.gpl2Plus; + maintainers = [ stdenv.lib.maintainers.aszlig ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/dmraid/rc15.nix b/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix similarity index 100% rename from pkgs/os-specific/linux/dmraid/rc15.nix rename to pkgs/tools/filesystems/nixpart/0.4/dmraid.nix diff --git a/pkgs/os-specific/linux/lvm2/2.02.106.nix b/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix similarity index 100% rename from pkgs/os-specific/linux/lvm2/2.02.106.nix rename to pkgs/tools/filesystems/nixpart/0.4/lvm2.nix diff --git a/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix new file mode 100644 index 000000000000..90722d74ace1 --- /dev/null +++ b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, lvm2, libaio, gzip, readline, udev }: + +stdenv.mkDerivation rec { + name = "multipath-tools-0.4.9"; + + src = fetchurl { + url = "http://christophe.varoqui.free.fr/multipath-tools/${name}.tar.bz2"; + sha256 = "04n7kazp1zrlqfza32phmqla0xkcq4zwn176qff5ida4a60whi4d"; + }; + + sourceRoot = "."; + + buildInputs = [ lvm2 libaio readline ]; + + preBuild = + '' + makeFlagsArray=(GZIP="${gzip}/bin/gzip -9 -c" prefix=$out mandir=$out/share/man/man8 man5dir=$out/share/man/man5 LIB=lib) + + substituteInPlace multipath/Makefile --replace /etc $out/etc + substituteInPlace kpartx/Makefile --replace /etc $out/etc + + substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx + substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup + + substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id + substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id + ''; + + meta = { + description = "Tools for the Linux multipathing driver"; + homepage = http://christophe.varoqui.free.fr/; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/tools/misc/parted/3.1.nix b/pkgs/tools/filesystems/nixpart/0.4/parted.nix similarity index 100% rename from pkgs/tools/misc/parted/3.1.nix rename to pkgs/tools/filesystems/nixpart/0.4/parted.nix diff --git a/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix b/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix new file mode 100644 index 000000000000..2ce126d7169f --- /dev/null +++ b/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, python, lvm2, dmraid }: + +stdenv.mkDerivation rec { + name = "pyblock-${version}"; + version = "0.53"; + + src = fetchurl rec { + url = "http://pkgs.fedoraproject.org/repo/pkgs/python-pyblock/" + + "${name}.tar.bz2/${md5}/${name}.tar.bz2"; + md5 = "f6d33a8362dee358517d0a9e2ebdd044"; + }; + + postPatch = '' + sed -i -e 's|/usr/include/python|${python}/include/python|' \ + -e 's/-Werror *//' -e 's|/usr/|'"$out"'/|' Makefile + ''; + + buildInputs = [ python lvm2 dmraid ]; + + makeFlags = [ + "USESELINUX=0" + "SITELIB=$(out)/lib/${python.libPrefix}/site-packages" + ]; + + meta = { + description = "Interface for working with block devices"; + license = stdenv.lib.licenses.gpl2Plus; + }; +} diff --git a/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix b/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix new file mode 100644 index 000000000000..7bc3f54c2363 --- /dev/null +++ b/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix @@ -0,0 +1,30 @@ +{ stdenv, python, buildPythonPackage, fetchurl, urlgrabber }: + +buildPythonPackage rec { + name = "pykickstart-${version}"; + version = "1.99.39"; + + src = fetchurl rec { + url = "http://pkgs.fedoraproject.org/repo/pkgs/pykickstart/" + + "${name}.tar.gz/${md5}/${name}.tar.gz"; + md5 = "d249f60aa89b1b4facd63f776925116d"; + }; + + postPatch = '' + sed -i -e "s/for tst in tstList/for tst in sorted(tstList, \ + key=lambda m: m.__name__)/" tests/baseclass.py + ''; + + propagatedBuildInputs = [ urlgrabber ]; + + checkPhase = '' + export PYTHONPATH="$PYTHONPATH:." + ${python}/bin/${python.executable} tests/baseclass.py -vv + ''; + + meta = { + homepage = "http://fedoraproject.org/wiki/Pykickstart"; + description = "Read and write Fedora kickstart files"; + license = stdenv.lib.licenses.gpl2Plus; + }; +} diff --git a/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix b/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix new file mode 100644 index 000000000000..67f318c863e1 --- /dev/null +++ b/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchurl, pkgconfig, python, buildPythonPackage, parted, e2fsprogs }: + +buildPythonPackage rec { + name = "pyparted-${version}"; + version = "3.10"; + + src = fetchurl { + url = "https://fedorahosted.org/releases/p/y/pyparted/${name}.tar.gz"; + sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv"; + }; + + postPatch = '' + sed -i -e 's|/sbin/mke2fs|${e2fsprogs}&|' tests/baseclass.py + sed -i -e ' + s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path| + ' tests/test__ped_ped.py + '' + stdenv.lib.optionalString stdenv.isi686 '' + # remove some integers in this test case which overflow on 32bit systems + sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \ + tests/test__ped_ped.py + ''; + + preConfigure = '' + PATH="${parted}/sbin:$PATH" + ''; + + buildInputs = [ pkgconfig ]; + + propagatedBuildInputs = [ parted ]; + + checkPhase = '' + patchShebangs Makefile + make test PYTHON=${python.executable} + ''; + + meta = { + homepage = "https://fedorahosted.org/pyparted/"; + description = "Python interface for libparted"; + license = stdenv.lib.licenses.gpl2Plus; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e290a7334f9f..0c165cb4ee49 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1937,12 +1937,6 @@ let parted = callPackage ../tools/misc/parted { hurd = null; }; - # Needed for blivet 0.17 and nixpart 0.4 - parted_3_1 = callPackage ../tools/misc/parted/3.1.nix { - hurd = null; - devicemapper = lvm2_2_02_106; - }; - pitivi = callPackage ../applications/video/pitivi { gst = gst_all_1; clutter-gtk = clutter_gtk; @@ -7665,11 +7659,6 @@ let cryptsetup = callPackage ../os-specific/linux/cryptsetup { }; - # Needed for nixpart 0.4 and blivet 0.17 - cryptsetup_oldlvm2 = callPackage ../os-specific/linux/cryptsetup { - devicemapper = lvm2_2_02_106; - }; - cramfsswap = callPackage ../os-specific/linux/cramfsswap { }; darwin = let @@ -7717,11 +7706,6 @@ let devicemapper = devicemapper.override {enable_dmeventd = true;}; }; - # Needed for nixpart 0.4 and blivet 0.17 - dmraid_rc15 = callPackage ../os-specific/linux/dmraid/rc15.nix { - devicemapper = lvm2_2_02_106; - }; - drbd = callPackage ../os-specific/linux/drbd { }; dstat = callPackage ../os-specific/linux/dstat { @@ -8152,9 +8136,6 @@ let lvm2 = callPackage ../os-specific/linux/lvm2 { }; - # Needed for nixpart 0.4 and blivet 0.17 - lvm2_2_02_106 = callPackage ../os-specific/linux/lvm2/2.02.106.nix { }; - mdadm = callPackage ../os-specific/linux/mdadm { }; mingetty = callPackage ../os-specific/linux/mingetty { }; @@ -8168,11 +8149,6 @@ let multipath_tools = callPackage ../os-specific/linux/multipath-tools { }; - # Needed for nixpart 0.4 and blivet 0.17 - multipath_tools_oldlvm2 = callPackage ../os-specific/linux/multipath-tools { - lvm2 = lvm2_2_02_106; - }; - musl = callPackage ../os-specific/linux/musl { }; nettools = callPackage ../os-specific/linux/net-tools { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7445c8b61bd4..616fb9675443 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -65,13 +65,6 @@ let blivet = callPackage ../development/python-modules/blivet { }; - blivet_0_17 = callPackage ../development/python-modules/blivet/0.17.nix { - pyblock = self.pyblock_0_53; - pyparted = self.pyparted_3_10; - multipath_tools = pkgs.multipath_tools_oldlvm2; - cryptsetup = pkgs.cryptsetup_oldlvm2; - }; - dbus = callPackage ../development/python-modules/dbus { dbus = pkgs.dbus; }; @@ -130,9 +123,7 @@ let # This is used for NixOps to make sure we won't break it with the next major # version of nixpart. - nixpart0 = callPackage ../tools/filesystems/nixpart/0.4.nix { - blivet = self.blivet_0_17; - }; + nixpart0 = callPackage ../tools/filesystems/nixpart/0.4 { }; pitz = callPackage ../applications/misc/pitz { }; @@ -6526,34 +6517,6 @@ let }; }; - # pyblock 0.53 with old LVM, needed for blivet 0.17 and nixpart 0.4 - pyblock_0_53 = stdenv.mkDerivation rec { - name = "pyblock-${version}"; - version = "0.53"; - - src = pkgs.fetchurl rec { - url = "http://pkgs.fedoraproject.org/repo/pkgs/python-pyblock/" - + "${name}.tar.bz2/${md5}/${name}.tar.bz2"; - md5 = "f6d33a8362dee358517d0a9e2ebdd044"; - }; - - postPatch = '' - sed -i -e 's|/usr/include/python|${python}/include/python|' \ - -e 's/-Werror *//' -e 's|/usr/|'"$out"'/|' Makefile - ''; - - buildInputs = with self; [ python pkgs.lvm2_2_02_106 pkgs.dmraid_rc15 ]; - - makeFlags = [ - "USESELINUX=0" - "SITELIB=$(out)/lib/${python.libPrefix}/site-packages" - ]; - - meta = { - description = "Interface for working with block devices"; - license = stdenv.lib.licenses.gpl2Plus; - }; - }; pycapnp = buildPythonPackage rec { name = "pycapnp-0.4.4"; @@ -6937,49 +6900,6 @@ let }; }; - # Needed for blivet 0.17 and nixpart 0.4 - pyparted_3_10 = buildPythonPackage rec { - name = "pyparted-${version}"; - version = "3.10"; - disabled = isPyPy; - - src = pkgs.fetchurl { - url = "https://fedorahosted.org/releases/p/y/pyparted/${name}.tar.gz"; - sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv"; - }; - - postPatch = '' - sed -i -e 's|/sbin/mke2fs|${pkgs.e2fsprogs}&|' tests/baseclass.py - sed -i -e ' - s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path| - ' tests/test__ped_ped.py - '' + optionalString stdenv.isi686 '' - # remove some integers in this test case which overflow on 32bit systems - sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \ - tests/test__ped_ped.py - ''; - - preConfigure = '' - PATH="${pkgs.parted}/sbin:$PATH" - ''; - - buildInputs = with self; [ pkgs.pkgconfig ]; - - propagatedBuildInputs = with self; [ pkgs.parted_3_1 ]; - - checkPhase = '' - patchShebangs Makefile - make test PYTHON=${python.executable} - ''; - - meta = { - homepage = "https://fedorahosted.org/pyparted/"; - description = "Python interface for libparted"; - license = stdenv.lib.licenses.gpl2Plus; - platforms = stdenv.lib.platforms.linux; - }; - }; - pyptlib = buildPythonPackage (rec { name = "pyptlib-${version}";