git.iko.soy/typeable/nixpkgs
on master help sign in
nixpart: Bring back requirements for version 0.4.

Quite a mess but at least the mdraid tests succeed now. However, the lvm2 tests are still failing, so we need to bring back a few more old crap :-( Signed-off-by: aszlig <aszlig@redmoonstudios.org>

commit7676ff5973edf14292d4de94a5c5353a5ebb5fae authoraszlig <aszlig@redmoonstudios.org> dateWed 22 Oct 2014, 07:14 (12 years ago) parent9d2e514
6 files changed+244−2
nixos/tests/partition.nix+1−1 pkgs/os-specific/linux/dmraid/rc15.nix+26 pkgs/os-specific/linux/lvm2/2.02.106.nix+58 pkgs/tools/misc/parted/3.1.nix+57 pkgs/top-level/all-packages.nix+24 pkgs/top-level/python-packages.nix+78−1
nixos/tests/partition.nix+1−1
@@ -68,7 +68,7 @@ in {
6868 machine = { config, pkgs, ... }: {
6969 environment.systemPackages = [
7070 pkgs.pythonPackages.nixpart0
71− pkgs.file pkgs.btrfsProgs pkgs.xfsprogs pkgs.lvm2
71+ pkgs.file pkgs.btrfsProgs pkgs.xfsprogs pkgs.lvm2_2_02_106
7272 ];
7373 virtualisation.emptyDiskImages = [ 4096 4096 ];
7474 };
pkgs/os-specific/linux/dmraid/rc15.nixnew file+26
@@ -0,0 +1,26 @@
1+{ stdenv, fetchurl, devicemapper }:
2+
3+stdenv.mkDerivation rec {
4+ name = "dmraid-1.0.0.rc15";
5+
6+ src = fetchurl {
7+ url = "http://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2";
8+ sha256 = "01bcaq0sc329ghgj7f182xws7jgjpdc41bvris8fsiprnxc7511h";
9+ };
10+
11+ preConfigure = "cd */";
12+
13+ buildInputs = [ devicemapper ];
14+
15+ meta = {
16+ description = "Old-style RAID configuration utility";
17+ longDescritipn = ''
18+ Old RAID configuration utility (still under development, though).
19+ It is fully compatible with modern kernels and mdadm recognizes
20+ its volumes. May be needed for rescuing an older system or nuking
21+ the metadata when reformatting.
22+ '';
23+ maintainers = [ stdenv.lib.maintainers.raskin ];
24+ platforms = stdenv.lib.platforms.linux;
25+ };
26+}
pkgs/os-specific/linux/lvm2/2.02.106.nixnew file+58
@@ -0,0 +1,58 @@
1+{ stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils }:
2+
3+let
4+ v = "2.02.106";
5+in
6+
7+stdenv.mkDerivation {
8+ name = "lvm2-${v}";
9+
10+ src = fetchurl {
11+ url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${v}.tgz";
12+ sha256 = "0nr833bl0q4zq52drjxmmpf7bs6kqxwa5kahwwxm9411khkxz0vc";
13+ };
14+
15+ configureFlags =
16+ "--disable-readline --enable-udev_rules --enable-udev_sync --enable-pkgconfig --enable-applib";
17+
18+ buildInputs = [ pkgconfig udev ];
19+
20+ preConfigure =
21+ ''
22+ substituteInPlace scripts/lvmdump.sh \
23+ --replace /usr/bin/tr ${coreutils}/bin/tr
24+ substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \
25+ --replace /usr/sbin/lvm $out/sbin/lvm \
26+ --replace /usr/bin/udevadm ${udev}/bin/udevadm
27+
28+ sed -i /DEFAULT_SYS_DIR/d Makefile.in
29+ sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in
30+ '';
31+
32+ enableParallelBuilding = true;
33+
34+ #patches = [ ./purity.patch ];
35+
36+ # To prevent make install from failing.
37+ preInstall = "installFlags=\"OWNER= GROUP= confdir=$out/etc\"";
38+
39+ # Install systemd stuff.
40+ #installTargets = "install install_systemd_generators install_systemd_units install_tmpfiles_configuration";
41+
42+ postInstall =
43+ ''
44+ substituteInPlace $out/lib/udev/rules.d/13-dm-disk.rules \
45+ --replace $out/sbin/blkid ${utillinux}/sbin/blkid
46+
47+ # Systemd stuff
48+ mkdir -p $out/etc/systemd/system $out/lib/systemd/system-generators
49+ cp scripts/blk_availability_systemd_red_hat.service $out/etc/systemd/system
50+ cp scripts/lvm2_activation_generator_systemd_red_hat $out/lib/systemd/system-generators
51+ '';
52+
53+ meta = {
54+ homepage = http://sourceware.org/lvm2/;
55+ descriptions = "Tools to support Logical Volume Management (LVM) on Linux";
56+ platforms = stdenv.lib.platforms.linux;
57+ };
58+}
pkgs/tools/misc/parted/3.1.nixnew file+57
@@ -0,0 +1,57 @@
1+{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline
2+, utillinux, check, enableStatic ? false, hurd ? null }:
3+
4+stdenv.mkDerivation rec {
5+ name = "parted-3.1";
6+
7+ src = fetchurl {
8+ url = "mirror://gnu/parted/${name}.tar.xz";
9+ sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y";
10+ };
11+
12+ buildInputs = [ libuuid ]
13+ ++ stdenv.lib.optional (readline != null) readline
14+ ++ stdenv.lib.optional (gettext != null) gettext
15+ ++ stdenv.lib.optional (devicemapper != null) devicemapper
16+ ++ stdenv.lib.optional (hurd != null) hurd
17+ ++ stdenv.lib.optional doCheck check;
18+
19+ configureFlags =
20+ (if (readline != null)
21+ then [ "--with-readline" ]
22+ else [ "--without-readline" ])
23+ ++ stdenv.lib.optional (devicemapper == null) "--disable-device-mapper"
24+ ++ stdenv.lib.optional enableStatic "--enable-static";
25+
26+ doCheck = true;
27+
28+ preCheck =
29+ stdenv.lib.optionalString doCheck
30+ # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'.
31+ "export PATH=\"${utillinux}/sbin:$PATH\"";
32+
33+ meta = {
34+ description = "Create, destroy, resize, check, and copy partitions";
35+
36+ longDescription = ''
37+ GNU Parted is an industrial-strength package for creating, destroying,
38+ resizing, checking and copying partitions, and the file systems on
39+ them. This is useful for creating space for new operating systems,
40+ reorganising disk usage, copying data on hard disks and disk imaging.
41+
42+ It contains a library, libparted, and a command-line frontend, parted,
43+ which also serves as a sample implementation and script backend.
44+ '';
45+
46+ homepage = http://www.gnu.org/software/parted/;
47+ license = stdenv.lib.licenses.gpl3Plus;
48+
49+ maintainers = [
50+ # Add your name here!
51+ stdenv.lib.maintainers.ludo
52+ ];
53+
54+ # GNU Parted requires libuuid, which is part of util-linux-ng.
55+ platforms = stdenv.lib.platforms.linux;
56+ };
57+}
pkgs/top-level/all-packages.nix+24
@@ -1937,6 +1937,12 @@ let
19371937
19381938 parted = callPackage ../tools/misc/parted { hurd = null; };
19391939
1940+ # Needed for blivet 0.17 and nixpart 0.4
1941+ parted_3_1 = callPackage ../tools/misc/parted/3.1.nix {
1942+ hurd = null;
1943+ devicemapper = lvm2_2_02_106;
1944+ };
1945+
19401946 pitivi = callPackage ../applications/video/pitivi {
19411947 gst = gst_all_1;
19421948 clutter-gtk = clutter_gtk;
@@ -7659,6 +7665,11 @@ let
76597665
76607666 cryptsetup = callPackage ../os-specific/linux/cryptsetup { };
76617667
7668+ # Needed for nixpart 0.4 and blivet 0.17
7669+ cryptsetup_oldlvm2 = callPackage ../os-specific/linux/cryptsetup {
7670+ devicemapper = lvm2_2_02_106;
7671+ };
7672+
76627673 cramfsswap = callPackage ../os-specific/linux/cramfsswap { };
76637674
76647675 darwin = let
@@ -7706,6 +7717,11 @@ let
77067717 devicemapper = devicemapper.override {enable_dmeventd = true;};
77077718 };
77087719
7720+ # Needed for nixpart 0.4 and blivet 0.17
7721+ dmraid_rc15 = callPackage ../os-specific/linux/dmraid/rc15.nix {
7722+ devicemapper = lvm2_2_02_106;
7723+ };
7724+
77097725 drbd = callPackage ../os-specific/linux/drbd { };
77107726
77117727 dstat = callPackage ../os-specific/linux/dstat {
@@ -8136,6 +8152,9 @@ let
81368152
81378153 lvm2 = callPackage ../os-specific/linux/lvm2 { };
81388154
8155+ # Needed for nixpart 0.4 and blivet 0.17
8156+ lvm2_2_02_106 = callPackage ../os-specific/linux/lvm2/2.02.106.nix { };
8157+
81398158 mdadm = callPackage ../os-specific/linux/mdadm { };
81408159
81418160 mingetty = callPackage ../os-specific/linux/mingetty { };
@@ -8149,6 +8168,11 @@ let
81498168
81508169 multipath_tools = callPackage ../os-specific/linux/multipath-tools { };
81518170
8171+ # Needed for nixpart 0.4 and blivet 0.17
8172+ multipath_tools_oldlvm2 = callPackage ../os-specific/linux/multipath-tools {
8173+ lvm2 = lvm2_2_02_106;
8174+ };
8175+
81528176 musl = callPackage ../os-specific/linux/musl { };
81538177
81548178 nettools = callPackage ../os-specific/linux/net-tools { };
pkgs/top-level/python-packages.nix+78−1
@@ -65,7 +65,12 @@ let
6565
6666 blivet = callPackage ../development/python-modules/blivet { };
6767
68− blivet_0_17 = callPackage ../development/python-modules/blivet/0.17.nix { };
68+ blivet_0_17 = callPackage ../development/python-modules/blivet/0.17.nix {
69+ pyblock = self.pyblock_0_53;
70+ pyparted = self.pyparted_3_10;
71+ multipath_tools = pkgs.multipath_tools_oldlvm2;
72+ cryptsetup = pkgs.cryptsetup_oldlvm2;
73+ };
6974
7075 dbus = callPackage ../development/python-modules/dbus {
7176 dbus = pkgs.dbus;
@@ -6521,6 +6526,35 @@ let
65216526 };
65226527 };
65236528
6529+ # pyblock 0.53 with old LVM, needed for blivet 0.17 and nixpart 0.4
6530+ pyblock_0_53 = stdenv.mkDerivation rec {
6531+ name = "pyblock-${version}";
6532+ version = "0.53";
6533+
6534+ src = pkgs.fetchurl rec {
6535+ url = "http://pkgs.fedoraproject.org/repo/pkgs/python-pyblock/"
6536+ + "${name}.tar.bz2/${md5}/${name}.tar.bz2";
6537+ md5 = "f6d33a8362dee358517d0a9e2ebdd044";
6538+ };
6539+
6540+ postPatch = ''
6541+ sed -i -e 's|/usr/include/python|${python}/include/python|' \
6542+ -e 's/-Werror *//' -e 's|/usr/|'"$out"'/|' Makefile
6543+ '';
6544+
6545+ buildInputs = with self; [ python pkgs.lvm2_2_02_106 pkgs.dmraid_rc15 ];
6546+
6547+ makeFlags = [
6548+ "USESELINUX=0"
6549+ "SITELIB=$(out)/lib/${python.libPrefix}/site-packages"
6550+ ];
6551+
6552+ meta = {
6553+ description = "Interface for working with block devices";
6554+ license = stdenv.lib.licenses.gpl2Plus;
6555+ };
6556+ };
6557+
65246558 pycapnp = buildPythonPackage rec {
65256559 name = "pycapnp-0.4.4";
65266560 disabled = isPyPy || isPy3k;
@@ -6903,6 +6937,49 @@ let
69036937 };
69046938 };
69056939
6940+ # Needed for blivet 0.17 and nixpart 0.4
6941+ pyparted_3_10 = buildPythonPackage rec {
6942+ name = "pyparted-${version}";
6943+ version = "3.10";
6944+ disabled = isPyPy;
6945+
6946+ src = pkgs.fetchurl {
6947+ url = "https://fedorahosted.org/releases/p/y/pyparted/${name}.tar.gz";
6948+ sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv";
6949+ };
6950+
6951+ postPatch = ''
6952+ sed -i -e 's|/sbin/mke2fs|${pkgs.e2fsprogs}&|' tests/baseclass.py
6953+ sed -i -e '
6954+ s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path|
6955+ ' tests/test__ped_ped.py
6956+ '' + optionalString stdenv.isi686 ''
6957+ # remove some integers in this test case which overflow on 32bit systems
6958+ sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \
6959+ tests/test__ped_ped.py
6960+ '';
6961+
6962+ preConfigure = ''
6963+ PATH="${pkgs.parted}/sbin:$PATH"
6964+ '';
6965+
6966+ buildInputs = with self; [ pkgs.pkgconfig ];
6967+
6968+ propagatedBuildInputs = with self; [ pkgs.parted_3_1 ];
6969+
6970+ checkPhase = ''
6971+ patchShebangs Makefile
6972+ make test PYTHON=${python.executable}
6973+ '';
6974+
6975+ meta = {
6976+ homepage = "https://fedorahosted.org/pyparted/";
6977+ description = "Python interface for libparted";
6978+ license = stdenv.lib.licenses.gpl2Plus;
6979+ platforms = stdenv.lib.platforms.linux;
6980+ };
6981+ };
6982+
69066983
69076984 pyptlib = buildPythonPackage (rec {
69086985 name = "pyptlib-${version}";