From 288a708031cbe396847c89ee4213596242a12520 Mon Sep 17 00:00:00 2001 From: Izumi Raine <63145238+IzumiRaine@users.noreply.github.com> Date: Wed, 14 Sep 2022 17:48:47 +0200 Subject: [PATCH] gptfdisk 1.0.9: add patch to fix UUID generation --- pkgs/tools/system/gptfdisk/default.nix | 7 +++++++ pkgs/tools/system/gptfdisk/uuid.patch | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/tools/system/gptfdisk/uuid.patch diff --git a/pkgs/tools/system/gptfdisk/default.nix b/pkgs/tools/system/gptfdisk/default.nix index b470b9cea709..871d309d5304 100644 --- a/pkgs/tools/system/gptfdisk/default.nix +++ b/pkgs/tools/system/gptfdisk/default.nix @@ -11,6 +11,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-2v6tJpP6646Ll4MrI0B/btWzIZvBeE9ILdhVd04tUMI="; }; + patches = [ + # fix UUID generation (from upstream but not yet released): + # https://sourceforge.net/p/gptfdisk/code/ci/6a8416cbd12d55f882bb751993b94f72d338d96f/ + # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1853985.html + ./uuid.patch + ]; + postPatch = '' patchShebangs gdisk_test.sh '' + lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/tools/system/gptfdisk/uuid.patch b/pkgs/tools/system/gptfdisk/uuid.patch new file mode 100644 index 000000000000..110c3d106b43 --- /dev/null +++ b/pkgs/tools/system/gptfdisk/uuid.patch @@ -0,0 +1,11 @@ +--- a/guid.cc ++++ b/guid.cc +@@ -141,7 +141,7 @@ void GUIDData::Zero(void) { + void GUIDData::Randomize(void) { + int i, uuidGenerated = 0; + +-#ifdef _UUID_UUID_H ++#if defined (_UUID_UUID_H) || defined (_UL_LIBUUID_UUID_H) + uuid_generate(uuidData); + ReverseBytes(&uuidData[0], 4); + ReverseBytes(&uuidData[4], 2);