From a4966eecb99e8f732fe91aecc1d991ad16e5e41a Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 4 Dec 2022 18:31:26 +0000 Subject: [PATCH 1/2] libredwg: 0.12.4 -> 0.12.5 --- .../libraries/libredwg/default.nix | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libredwg/default.nix b/pkgs/development/libraries/libredwg/default.nix index ad7a7e5473e9..e21e43caa920 100644 --- a/pkgs/development/libraries/libredwg/default.nix +++ b/pkgs/development/libraries/libredwg/default.nix @@ -1,21 +1,41 @@ -{ 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 + ''; + nativeBuildInputs = [ autoreconfHook pkg-config texinfo ] ++ lib.optional enablePython swig; From c0e332492fdbfd81a220d2755ba0ab67542e96b2 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Mon, 5 Dec 2022 00:46:24 +0000 Subject: [PATCH 2/2] python3Packages.libredwg: fix build on darwin --- pkgs/development/libraries/libredwg/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/libredwg/default.nix b/pkgs/development/libraries/libredwg/default.nix index e21e43caa920..a3b43e9377e1 100644 --- a/pkgs/development/libraries/libredwg/default.nix +++ b/pkgs/development/libraries/libredwg/default.nix @@ -36,6 +36,11 @@ stdenv.mkDerivation rec { 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;