19 stdenv.mkDerivation rec {
23 src = fetchFromGitHub {
24 name = "qcad-${version}-src";
28 hash = "sha256-lTe/XCW/qUARfIpcps1RMjubLiIR7cvYMZ0XgebaDrk=";
32 # Patch directory lookup, remove __DATE__ and executable name
33 ./application-dir.patch
37 if ! [ -d src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version} ]; then
38 mkdir src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version}
40 src/3rdparty/qt-labs-qtscriptgenerator-5.14.0/qt-labs-qtscriptgenerator-5.14.0.pro \
41 src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version}/qt-labs-qtscriptgenerator-${qtbase.version}.pro
61 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
66 "MUPARSER_DIR=${muparser}"
68 "BOOST_DIR=${boost.dev}"
69 "QMAKE_CXXFLAGS=-std=c++14"
72 qtWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [
73 "--prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib"
74 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
75 "--prefix DYLD_LIBRARY_PATH : ${placeholder "out"}/lib"
80 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
81 install -Dm555 release/qcad-bin $out/bin/qcad
82 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
83 install -Dm555 release/QCAD.app/Contents/MacOS/QCAD $out/bin/qcad
86 install -Dm555 -t $out/lib release/libspatialindexnavel${stdenv.hostPlatform.extensions.sharedLibrary}
87 install -Dm555 -t $out/lib release/libqcadcore${stdenv.hostPlatform.extensions.sharedLibrary}
88 install -Dm555 -t $out/lib release/libqcadentity${stdenv.hostPlatform.extensions.sharedLibrary}
89 install -Dm555 -t $out/lib release/libqcadgrid${stdenv.hostPlatform.extensions.sharedLibrary}
90 install -Dm555 -t $out/lib release/libqcadsnap${stdenv.hostPlatform.extensions.sharedLibrary}
91 install -Dm555 -t $out/lib release/libqcadoperations${stdenv.hostPlatform.extensions.sharedLibrary}
92 install -Dm555 -t $out/lib release/libqcadstemmer${stdenv.hostPlatform.extensions.sharedLibrary}
93 install -Dm555 -t $out/lib release/libqcadspatialindex${stdenv.hostPlatform.extensions.sharedLibrary}
94 install -Dm555 -t $out/lib release/libqcadgui${stdenv.hostPlatform.extensions.sharedLibrary}
95 install -Dm555 -t $out/lib release/libqcadecmaapi${stdenv.hostPlatform.extensions.sharedLibrary}
97 install -Dm444 -t $out/share/applications qcad.desktop
98 install -Dm644 -t $out/share/pixmaps scripts/qcad_icon.png
100 cp -r scripts $out/lib
101 cp -r plugins $out/lib/plugins
102 cp -r patterns $out/lib/patterns
103 cp -r fonts $out/lib/fonts
104 cp -r libraries $out/lib/libraries
105 cp -r linetypes $out/lib/linetypes
108 # workaround to fix the library browser:
109 rm -r $out/lib/plugins/sqldrivers
110 ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/sqldrivers
112 rm -r $out/lib/plugins/printsupport
113 ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/printsupport
115 rm -r $out/lib/plugins/imageformats
116 ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/imageformats
118 install -Dm644 scripts/qcad_icon.svg $out/share/icons/hicolor/scalable/apps/qcad.svg
120 installManPage qcad.1
126 description = "2D CAD package based on Qt";
127 homepage = "https://qcad.org";
128 license = lib.licenses.gpl3Only;
129 mainProgram = "qcad";
130 maintainers = with lib.maintainers; [ yvesf ];
131 platforms = qtbase.meta.platforms;