From 7676ff5973edf14292d4de94a5c5353a5ebb5fae Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 22 Oct 2014 07:14:48 +0200 Subject: [PATCH] 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 --- nixos/tests/partition.nix | 2 +- 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 | 79 +++++++++++++++++++++++- 6 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 pkgs/os-specific/linux/dmraid/rc15.nix create mode 100644 pkgs/os-specific/linux/lvm2/2.02.106.nix create mode 100644 pkgs/tools/misc/parted/3.1.nix diff --git a/nixos/tests/partition.nix b/nixos/tests/partition.nix index 5e94b263d5b..9a4246e0421 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 + pkgs.file pkgs.btrfsProgs pkgs.xfsprogs pkgs.lvm2_2_02_106 ]; virtualisation.emptyDiskImages = [ 4096 4096 ]; }; diff --git a/pkgs/os-specific/linux/dmraid/rc15.nix b/pkgs/os-specific/linux/dmraid/rc15.nix new file mode 100644 index 00000000000..35efa8533ab --- /dev/null +++ b/pkgs/os-specific/linux/dmraid/rc15.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, devicemapper }: + +stdenv.mkDerivation rec { + name = "dmraid-1.0.0.rc15"; + + src = fetchurl { + url = "http://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2"; + sha256 = "01bcaq0sc329ghgj7f182xws7jgjpdc41bvris8fsiprnxc7511h"; + }; + + preConfigure = "cd */"; + + buildInputs = [ devicemapper ]; + + meta = { + description = "Old-style RAID configuration utility"; + longDescritipn = '' + Old RAID configuration utility (still under development, though). + It is fully compatible with modern kernels and mdadm recognizes + its volumes. May be needed for rescuing an older system or nuking + the metadata when reformatting. + ''; + maintainers = [ stdenv.lib.maintainers.raskin ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/lvm2/2.02.106.nix b/pkgs/os-specific/linux/lvm2/2.02.106.nix new file mode 100644 index 00000000000..9e2b0c90079 --- /dev/null +++ b/pkgs/os-specific/linux/lvm2/2.02.106.nix @@ -0,0 +1,58 @@ +{ stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils }: + +let + v = "2.02.106"; +in + +stdenv.mkDerivation { + name = "lvm2-${v}"; + + src = fetchurl { + url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${v}.tgz"; + sha256 = "0nr833bl0q4zq52drjxmmpf7bs6kqxwa5kahwwxm9411khkxz0vc"; + }; + + configureFlags = + "--disable-readline --enable-udev_rules --enable-udev_sync --enable-pkgconfig --enable-applib"; + + buildInputs = [ pkgconfig udev ]; + + preConfigure = + '' + substituteInPlace scripts/lvmdump.sh \ + --replace /usr/bin/tr ${coreutils}/bin/tr + substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \ + --replace /usr/sbin/lvm $out/sbin/lvm \ + --replace /usr/bin/udevadm ${udev}/bin/udevadm + + sed -i /DEFAULT_SYS_DIR/d Makefile.in + sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in + ''; + + enableParallelBuilding = true; + + #patches = [ ./purity.patch ]; + + # To prevent make install from failing. + preInstall = "installFlags=\"OWNER= GROUP= confdir=$out/etc\""; + + # Install systemd stuff. + #installTargets = "install install_systemd_generators install_systemd_units install_tmpfiles_configuration"; + + postInstall = + '' + substituteInPlace $out/lib/udev/rules.d/13-dm-disk.rules \ + --replace $out/sbin/blkid ${utillinux}/sbin/blkid + + # Systemd stuff + mkdir -p $out/etc/systemd/system $out/lib/systemd/system-generators + cp scripts/blk_availability_systemd_red_hat.service $out/etc/systemd/system + cp scripts/lvm2_activation_generator_systemd_red_hat $out/lib/systemd/system-generators + ''; + + meta = { + homepage = http://sourceware.org/lvm2/; + descriptions = "Tools to support Logical Volume Management (LVM) on Linux"; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/tools/misc/parted/3.1.nix b/pkgs/tools/misc/parted/3.1.nix new file mode 100644 index 00000000000..01b9f391a44 --- /dev/null +++ b/pkgs/tools/misc/parted/3.1.nix @@ -0,0 +1,57 @@ +{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline +, utillinux, check, enableStatic ? false, hurd ? null }: + +stdenv.mkDerivation rec { + name = "parted-3.1"; + + src = fetchurl { + url = "mirror://gnu/parted/${name}.tar.xz"; + sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y"; + }; + + buildInputs = [ libuuid ] + ++ stdenv.lib.optional (readline != null) readline + ++ stdenv.lib.optional (gettext != null) gettext + ++ stdenv.lib.optional (devicemapper != null) devicemapper + ++ stdenv.lib.optional (hurd != null) hurd + ++ stdenv.lib.optional doCheck check; + + configureFlags = + (if (readline != null) + then [ "--with-readline" ] + else [ "--without-readline" ]) + ++ stdenv.lib.optional (devicemapper == null) "--disable-device-mapper" + ++ stdenv.lib.optional enableStatic "--enable-static"; + + doCheck = true; + + preCheck = + stdenv.lib.optionalString doCheck + # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'. + "export PATH=\"${utillinux}/sbin:$PATH\""; + + meta = { + description = "Create, destroy, resize, check, and copy partitions"; + + longDescription = '' + GNU Parted is an industrial-strength package for creating, destroying, + resizing, checking and copying partitions, and the file systems on + them. This is useful for creating space for new operating systems, + reorganising disk usage, copying data on hard disks and disk imaging. + + It contains a library, libparted, and a command-line frontend, parted, + which also serves as a sample implementation and script backend. + ''; + + homepage = http://www.gnu.org/software/parted/; + license = stdenv.lib.licenses.gpl3Plus; + + maintainers = [ + # Add your name here! + stdenv.lib.maintainers.ludo + ]; + + # GNU Parted requires libuuid, which is part of util-linux-ng. + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0c165cb4ee4..e290a7334f9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1937,6 +1937,12 @@ 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; @@ -7659,6 +7665,11 @@ 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 @@ -7706,6 +7717,11 @@ 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 { @@ -8136,6 +8152,9 @@ 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 { }; @@ -8149,6 +8168,11 @@ 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 fea5f8d6e5b..7445c8b61bd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -65,7 +65,12 @@ let blivet = callPackage ../development/python-modules/blivet { }; - blivet_0_17 = callPackage ../development/python-modules/blivet/0.17.nix { }; + 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; @@ -6521,6 +6526,35 @@ 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"; disabled = isPyPy || isPy3k; @@ -6903,6 +6937,49 @@ 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}";