about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Gerbet <thomas@gerbet.me>2022-12-07 14:54:19 +0100
committerGitHub <noreply@github.com>2022-12-07 14:54:19 +0100
commit69e6247f3b471c65edb4bc8c8d31954ec19208c3 (patch)
treeb9de19f56dda7961345c5cedc67f39421b5194f6
parentbab85700b963dadb47fcb31e54a0bca38b516827 (diff)
parentc0e332492fdbfd81a220d2755ba0ab67542e96b2 (diff)
Merge pull request #204548 from risicle/ris-libredwg-0.12.5
libredwg: 0.12.4 -> 0.12.5
-rw-r--r--pkgs/development/libraries/libredwg/default.nix33
1 files changed, 29 insertions, 4 deletions
diff --git a/pkgs/development/libraries/libredwg/default.nix b/pkgs/development/libraries/libredwg/default.nix
index ad7a7e5473e90..a3b43e9377e1f 100644
--- a/pkgs/development/libraries/libredwg/default.nix
+++ b/pkgs/development/libraries/libredwg/default.nix
@@ -1,21 +1,46 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, texinfo, pcre2
-, enablePython ? false, python ? null, swig, libxml2, ncurses
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, writeShellScript
+, pkg-config
+, texinfo
+, pcre2
+, swig
+, libxml2
+, ncurses
+, enablePython ? false
+, python ? null
 }:
 let
   isPython3 = enablePython && python.pythonAtLeast "3";
 in
 stdenv.mkDerivation rec {
   pname = "libredwg";
-  version = "0.12.4";
+  version = "0.12.5";
 
   src = fetchFromGitHub {
     owner = "LibreDWG";
     repo = pname;
     rev = version;
-    sha256 = "sha256-CZZ5/uCls2tY3PKmD+hBBvp7d7KX8nZuCPf03sa4iXc=";
+    sha256 = "sha256-s9aiOKSM7+3LJNE+jRrEMcL1QKRWrlTKbwO7oL9VhuE=";
     fetchSubmodules = true;
   };
 
+  postPatch = let
+    printVersion = writeShellScript "print-version" ''
+      echo ${lib.escapeShellArg version}
+    '';
+  in ''
+    # avoid git dependency
+    cp ${printVersion} build-aux/git-version-gen
+  '';
+
+  preConfigure = lib.optionalString (stdenv.isDarwin && enablePython) ''
+    # prevent configure picking up stack_size from distutils.sysconfig
+    export PYTHON_EXTRA_LDFLAGS=" "
+  '';
+
   nativeBuildInputs = [ autoreconfHook pkg-config texinfo ]
     ++ lib.optional enablePython swig;