From c494fc51dc44a192d07aec9c67e4a44eca11160a Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Wed, 13 May 2020 20:43:02 +0100 Subject: [PATCH 1/6] python2Packages.nixpart0/cryptsetup: patch for glibc >= 2.28 --- pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix | 11 ++++++++++- pkgs/tools/filesystems/nixpart/0.4/default.nix | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix b/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix index 3feed238880..88a1716a0e1 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, lvm2, libgcrypt, libuuid, pkgconfig, popt +{ stdenv, fetchurl, fetchpatch, lvm2, libgcrypt, libuuid, pkgconfig, popt , enablePython ? true, python ? null }: @@ -12,6 +12,15 @@ stdenv.mkDerivation rec { sha256 = "1n1qk5chyjspbiianrdb55fhb4wl0vfyqz2br05vfb24v4qlgbx2"; }; + patches = [ + # Fix build with glibc >= 2.28 + # https://github.com/NixOS/nixpkgs/issues/86403 + (fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryptsetup/files/cryptsetup-1.7.1-sysmacros.patch?id=d72316f97ebcc7fe622b21574442a9ac59b9115f"; + sha256 = "0xbhazgl44bimqhcrhajk016w9wi7bkrgwyfq13xmrvyrllqvgdx"; + }) + ]; + configureFlags = [ "--enable-cryptsetup-reencrypt" ] ++ stdenv.lib.optional enablePython "--enable-python"; diff --git a/pkgs/tools/filesystems/nixpart/0.4/default.nix b/pkgs/tools/filesystems/nixpart/0.4/default.nix index 5d7a9dd14ec..68122eaaf08 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/default.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/default.nix @@ -18,7 +18,7 @@ let cryptsetup = import ./cryptsetup.nix { inherit stdenv fetchurl python; - inherit (pkgs) pkgconfig libgcrypt libuuid popt lvm2; + inherit (pkgs) fetchpatch pkgconfig libgcrypt libuuid popt lvm2; }; dmraid = import ./dmraid.nix { From 0776d9043c6a7335db46f2fde96ef9a08387ef7c Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Wed, 13 May 2020 20:45:10 +0100 Subject: [PATCH 2/6] python2Packages.nixpart0/lvm2: patch for glibc >= 2.28 --- pkgs/tools/filesystems/nixpart/0.4/default.nix | 2 +- pkgs/tools/filesystems/nixpart/0.4/lvm2.nix | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/nixpart/0.4/default.nix b/pkgs/tools/filesystems/nixpart/0.4/default.nix index 68122eaaf08..ce1b4455117 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/default.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/default.nix @@ -27,7 +27,7 @@ let lvm2 = import ./lvm2.nix { inherit stdenv fetchurl; - inherit (pkgs) pkgconfig utillinux systemd coreutils; + inherit (pkgs) fetchpatch pkgconfig utillinux systemd coreutils; }; multipath_tools = import ./multipath-tools.nix { diff --git a/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix b/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix index c8c748b4c45..fc0005a14d4 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, systemd, utillinux, coreutils }: +{ stdenv, fetchurl, fetchpatch, pkgconfig, systemd, utillinux, coreutils }: let v = "2.02.106"; @@ -12,6 +12,18 @@ stdenv.mkDerivation { sha256 = "0nr833bl0q4zq52drjxmmpf7bs6kqxwa5kahwwxm9411khkxz0vc"; }; + patches = [ + # Fix build with glibc >= 2.28 + # https://github.com/NixOS/nixpkgs/issues/86403 + (fetchpatch { + url = "https://github.com/lvmteam/lvm2/commit/92d5a8441007f578e000b492cecf67d6b8a87405.patch"; + sha256 = "1yqd6jng0b370k53vks1shg57yhfyribhpmv19km5zsjqf0qqx2d"; + excludes = [ + "libdm/libdm-stats.c" + ]; + }) + ]; + configureFlags = [ "--disable-readline" "--enable-udev_rules" From eb696ef672716567c8e1c22675ac4b53352e8dfb Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Wed, 13 May 2020 20:45:58 +0100 Subject: [PATCH 3/6] python2Packages.nixpart0/multipath_tools: patch for glibc >= 2.28 --- pkgs/tools/filesystems/nixpart/0.4/default.nix | 2 +- .../filesystems/nixpart/0.4/multipath-tools.nix | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/nixpart/0.4/default.nix b/pkgs/tools/filesystems/nixpart/0.4/default.nix index ce1b4455117..6512c21a861 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/default.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/default.nix @@ -32,7 +32,7 @@ let multipath_tools = import ./multipath-tools.nix { inherit stdenv fetchurl lvm2; - inherit (pkgs) readline systemd libaio gzip; + inherit (pkgs) fetchpatch readline systemd libaio gzip; }; parted = import ./parted.nix { diff --git a/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix index b3b18579334..14f179386cf 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix @@ -1,6 +1,6 @@ # FIXME: unify with pkgs/os-specific/linux/multipath-tools/default.nix. -{ stdenv, fetchurl, lvm2, libaio, gzip, readline, systemd }: +{ stdenv, fetchurl, fetchpatch, lvm2, libaio, gzip, readline, systemd }: stdenv.mkDerivation rec { name = "multipath-tools-0.4.9"; @@ -10,6 +10,18 @@ stdenv.mkDerivation rec { sha256 = "04n7kazp1zrlqfza32phmqla0xkcq4zwn176qff5ida4a60whi4d"; }; + patches = [ + # Fix build with glibc >= 2.28 + # https://github.com/NixOS/nixpkgs/issues/86403 + (fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/multipath-tools/files/multipath-tools-0.6.4-sysmacros.patch?id=eb22b954c177b5c1e2b6ed5c7cdd02f40f40d757"; + sha256 = "1an0cgmz7g03c4qjimhpm9fcf2iswws18lwqxi688k87qm3xb5qd"; + excludes = [ + "libmultipath/util.c" + ]; + }) + ]; + sourceRoot = "."; buildInputs = [ lvm2 libaio readline gzip ]; From 64f4073f8d068fe0f226287c2c1045e08e3e7333 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Wed, 13 May 2020 20:46:16 +0100 Subject: [PATCH 4/6] python2Packages.nixpart0/parted: patch for glibc >= 2.28 --- pkgs/tools/filesystems/nixpart/0.4/default.nix | 2 +- pkgs/tools/filesystems/nixpart/0.4/parted.nix | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/nixpart/0.4/default.nix b/pkgs/tools/filesystems/nixpart/0.4/default.nix index 6512c21a861..1f672701d38 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/default.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/default.nix @@ -37,7 +37,7 @@ let parted = import ./parted.nix { inherit stdenv fetchurl; - inherit (pkgs) utillinux readline libuuid gettext check lvm2; + inherit (pkgs) fetchpatch utillinux readline libuuid gettext check lvm2; }; pyblock = import ./pyblock.nix { diff --git a/pkgs/tools/filesystems/nixpart/0.4/parted.nix b/pkgs/tools/filesystems/nixpart/0.4/parted.nix index 2a0ffe326dc..16f3a57ea14 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/parted.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/parted.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, lvm2, libuuid, gettext, readline +{ stdenv, fetchurl, fetchpatch, lvm2, libuuid, gettext, readline , utillinux, check, enableStatic ? false }: stdenv.mkDerivation rec { @@ -9,6 +9,15 @@ stdenv.mkDerivation rec { sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y"; }; + patches = [ + # Fix build with glibc >= 2.28 + # https://github.com/NixOS/nixpkgs/issues/86403 + (fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-block/parted/files/parted-3.2-sysmacros.patch?id=8e2414f551c14166f259f9a25a594aec7a5b9ea0"; + sha256 = "0fdgifjbri7n28hv74zksac05gw72p2czzvyar0jp62b9dnql3mp"; + }) + ]; + buildInputs = [ libuuid ] ++ stdenv.lib.optional (readline != null) readline ++ stdenv.lib.optional (gettext != null) gettext From 912e1e87c0509d6f75acb33a9c21423eb6bffba6 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Wed, 13 May 2020 21:37:22 +0100 Subject: [PATCH 5/6] python2Packages.nixpart0/pyblock: patch for glibc >= 2.28 --- .../nixpart/0.4/pyblock-sysmacros.h.patch | 12 ++++++++++++ pkgs/tools/filesystems/nixpart/0.4/pyblock.nix | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch diff --git a/pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch b/pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch new file mode 100644 index 00000000000..b8ab7bd53b2 --- /dev/null +++ b/pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch @@ -0,0 +1,12 @@ +diff --git a/dm.c b/dm.c +index 5daa0e5..d5b84c8 100644 +--- a/dm.c ++++ b/dm.c +@@ -19,6 +19,7 @@ + #define _GNU_SOURCE + #include + #include ++#include + #include + #include + #include diff --git a/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix b/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix index 2abab905737..f087edd853d 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix @@ -11,6 +11,12 @@ stdenv.mkDerivation rec { sha256 = "f6cef88969300a6564498557eeea1d8da58acceae238077852ff261a2cb1d815"; }; + patches = [ + # Fix build with glibc >= 2.28 + # https://github.com/NixOS/nixpkgs/issues/86403 + ./pyblock-sysmacros.h.patch + ]; + postPatch = '' sed -i -e 's|/usr/include/python|${python}/include/python|' \ -e 's/-Werror *//' -e 's|/usr/|'"$out"'/|' Makefile From 05f1bcce4949fe2a6fc9472051f39a002cbab133 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Thu, 14 May 2020 22:04:18 +0100 Subject: [PATCH 6/6] python2Packages.nixpart0/multipath_tools: fixup path to internal libraries --- pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix index 14f179386cf..ffed57e6345 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix @@ -38,6 +38,11 @@ stdenv.mkDerivation rec { substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${systemd.lib}/lib/udev/scsi_id substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${systemd.lib}/lib/udev/scsi_id + + sed -i -re ' + s,^( *#define +DEFAULT_MULTIPATHDIR\>).*,\1 "'"$out/lib/multipath"'", + ' libmultipath/defaults.h + ''; meta = {