about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2022-10-16 12:19:32 +0200
committerehmry <ehmry@posteo.net>2022-10-16 10:13:28 -0500
commit3ec8d0d5586257ddde2f3c528a1bef6932fd3c6a (patch)
tree05747ca1867aa5f560f9f7c206ced77ddc4e5575
parent7a3a8cb2355af243ed710816dfefcab8ce68dce4 (diff)
gptfdisk: fix runtime problems with popt 1.19
-rw-r--r--pkgs/tools/system/gptfdisk/default.nix5
-rw-r--r--pkgs/tools/system/gptfdisk/popt-1-19.patch13
2 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/tools/system/gptfdisk/default.nix b/pkgs/tools/system/gptfdisk/default.nix
index 871d309d53040..436aec4c552f7 100644
--- a/pkgs/tools/system/gptfdisk/default.nix
+++ b/pkgs/tools/system/gptfdisk/default.nix
@@ -12,6 +12,11 @@ stdenv.mkDerivation rec {
   };
 
   patches = [
+    # issues with popt 1.19 (from upstream but not yet released):
+    # https://sourceforge.net/p/gptfdisk/code/ci/5d5e76d369a412bfb3d2cebb5fc0a7509cef878d/
+    # https://github.com/rpm-software-management/popt/issues/80
+    ./popt-1-19.patch
+
     # 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
diff --git a/pkgs/tools/system/gptfdisk/popt-1-19.patch b/pkgs/tools/system/gptfdisk/popt-1-19.patch
new file mode 100644
index 0000000000000..ae971362cdd5d
--- /dev/null
+++ b/pkgs/tools/system/gptfdisk/popt-1-19.patch
@@ -0,0 +1,13 @@
+diff --git a/gptcl.cc b/gptcl.cc
+index 34c9421..0d578eb 100644
+--- a/gptcl.cc
++++ b/gptcl.cc
+@@ -155,7 +155,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
+    } // while
+ 
+    // Assume first non-option argument is the device filename....
+-   device = (char*) poptGetArg(poptCon);
++   device = strdup((char*) poptGetArg(poptCon));
+    poptResetContext(poptCon);
+ 
+    if (device != NULL) {