1 { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, texinfo, pcre2
2 , enablePython ? false, python ? null, swig, libxml2, ncurses
5 isPython3 = enablePython && python.pythonAtLeast "3";
7 stdenv.mkDerivation rec {
11 src = fetchFromGitHub {
15 sha256 = "sha256-CZZ5/uCls2tY3PKmD+hBBvp7d7KX8nZuCPf03sa4iXc=";
16 fetchSubmodules = true;
19 nativeBuildInputs = [ autoreconfHook pkg-config texinfo ]
20 ++ lib.optional enablePython swig;
22 buildInputs = [ pcre2 ]
23 ++ lib.optionals enablePython [ python ]
24 # configurePhase fails with python 3 when ncurses is missing
25 ++ lib.optional isPython3 ncurses
28 # prevent python tests from running when not building with python
29 configureFlags = lib.optional (!enablePython) "--disable-python";
33 # the "xmlsuite" test requires the libxml2 c library as well as the python module
34 checkInputs = lib.optionals enablePython [ libxml2 libxml2.dev ];
37 broken = stdenv.isDarwin && stdenv.isAarch64;
38 description = "Free implementation of the DWG file format";
39 homepage = "https://savannah.gnu.org/projects/libredwg/";
40 maintainers = with maintainers; [ tweber ];
41 license = licenses.gpl3Plus;
42 platforms = platforms.all;