17 isPython3 = enablePython && python.pythonAtLeast "3";
19 stdenv.mkDerivation rec {
23 src = fetchFromGitHub {
27 hash = "sha256-FlBHwNsqVSBE8dTDewoKkCbs8Jd/4d69MPpEFzg6Ruc=";
28 fetchSubmodules = true;
33 printVersion = writeShellScript "print-version" ''
34 echo -n ${lib.escapeShellArg version}
38 # avoid git dependency
39 cp ${printVersion} build-aux/git-version-gen
42 preConfigure = lib.optionalString (stdenv.hostPlatform.isDarwin && enablePython) ''
43 # prevent configure picking up stack_size from distutils.sysconfig
44 export PYTHON_EXTRA_LDFLAGS=" "
51 ] ++ lib.optional enablePython swig;
55 ++ lib.optionals enablePython [ python ]
56 # configurePhase fails with python 3 when ncurses is missing
57 ++ lib.optional isPython3 ncurses;
59 # prevent python tests from running when not building with python
60 configureFlags = lib.optional (!enablePython) "--disable-python";
63 doCheck = !stdenv.hostPlatform.isLinux;
65 # the "xmlsuite" test requires the libxml2 c library as well as the python module
66 nativeCheckInputs = lib.optionals enablePython [
72 description = "Free implementation of the DWG file format";
73 homepage = "https://savannah.gnu.org/projects/libredwg/";
74 maintainers = with maintainers; [ tweber ];
75 license = licenses.gpl3Plus;
76 platforms = platforms.all;