2020-04-07 22:46:50 +01:00
|
|
|
{ boost
|
|
|
|
, fetchFromGitHub
|
2020-09-20 16:24:42 +01:00
|
|
|
, libGLU
|
2020-04-07 22:46:50 +01:00
|
|
|
, mkDerivationWith
|
|
|
|
, muparser
|
2021-01-17 02:09:27 +00:00
|
|
|
, pkg-config
|
2020-09-20 16:24:42 +01:00
|
|
|
, qtbase
|
2020-04-07 22:46:50 +01:00
|
|
|
, qmake
|
2020-09-20 16:24:42 +01:00
|
|
|
, qtscript
|
|
|
|
, qtsvg
|
|
|
|
, qtxmlpatterns
|
|
|
|
, qttools
|
2021-04-08 01:31:05 +01:00
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, installShellFiles
|
2020-04-07 22:46:50 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivationWith stdenv.mkDerivation rec {
|
|
|
|
pname = "qcad";
|
2021-10-29 06:33:36 +01:00
|
|
|
version = "3.26.4.10";
|
2020-04-07 22:46:50 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qcad";
|
|
|
|
repo = "qcad";
|
|
|
|
rev = "v${version}";
|
2021-10-29 06:33:36 +01:00
|
|
|
sha256 = "sha256-dWpItV18lYjdwUsn2wwA//AUHU5ICGfmih2cJWihvn0=";
|
2020-04-07 22:46:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-03-17 23:19:39 +00:00
|
|
|
# Patch directory lookup, remove __DATE__ and executable name
|
2020-04-07 22:46:50 +01:00
|
|
|
./application-dir.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-09-20 16:24:42 +01:00
|
|
|
if ! [ -d src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version} ]; then
|
|
|
|
mkdir src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version}
|
2020-08-25 22:00:03 +01:00
|
|
|
cp \
|
|
|
|
src/3rdparty/qt-labs-qtscriptgenerator-5.14.0/qt-labs-qtscriptgenerator-5.14.0.pro \
|
2020-09-20 16:24:42 +01:00
|
|
|
src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version}/qt-labs-qtscriptgenerator-${qtbase.version}.pro
|
2020-08-25 22:00:03 +01:00
|
|
|
fi
|
2021-04-08 01:31:05 +01:00
|
|
|
'';
|
2020-04-07 22:46:50 +01:00
|
|
|
|
|
|
|
qmakeFlags = [
|
|
|
|
"MUPARSER_DIR=${muparser}"
|
|
|
|
"INSTALLROOT=$(out)"
|
|
|
|
"BOOST_DIR=${boost.dev}"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm555 -t $out/bin release/qcad-bin
|
|
|
|
install -Dm555 -t $out/lib release/libspatialindexnavel.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadcore.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadentity.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadgrid.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadsnap.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadoperations.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadstemmer.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadspatialindex.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadgui.so
|
|
|
|
install -Dm555 -t $out/lib release/libqcadecmaapi.so
|
|
|
|
|
|
|
|
install -Dm444 -t $out/share/applications qcad.desktop
|
|
|
|
install -Dm644 -t $out/share/pixmaps scripts/qcad_icon.png
|
|
|
|
|
|
|
|
cp -r scripts $out/lib
|
|
|
|
cp -r plugins $out/lib/plugins
|
|
|
|
cp -r patterns $out/lib/patterns
|
2021-04-08 01:31:05 +01:00
|
|
|
cp -r fonts $out/lib/fonts
|
|
|
|
cp -r libraries $out/lib/libraries
|
|
|
|
cp -r linetypes $out/lib/linetypes
|
|
|
|
cp -r ts $out/lib/ts
|
2020-04-07 22:46:50 +01:00
|
|
|
|
2020-09-19 20:48:38 +01:00
|
|
|
# workaround to fix the library browser:
|
|
|
|
rm -r $out/lib/plugins/sqldrivers
|
2020-09-20 16:24:42 +01:00
|
|
|
ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/sqldrivers
|
2020-09-19 20:48:38 +01:00
|
|
|
|
2021-04-08 01:31:05 +01:00
|
|
|
rm -r $out/lib/plugins/printsupport
|
|
|
|
ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/printsupport
|
|
|
|
|
|
|
|
rm -r $out/lib/plugins/imageformats
|
|
|
|
ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/imageformats
|
|
|
|
|
2020-04-07 22:46:50 +01:00
|
|
|
install -Dm644 scripts/qcad_icon.svg $out/share/icons/hicolor/scalable/apps/qcad.svg
|
|
|
|
|
2021-04-08 01:31:05 +01:00
|
|
|
installManPage qcad.1
|
|
|
|
|
2020-04-07 22:46:50 +01:00
|
|
|
runHook postInstall
|
2021-04-08 01:31:05 +01:00
|
|
|
'';
|
2020-04-07 22:46:50 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
muparser
|
|
|
|
libGLU
|
2020-09-20 16:24:42 +01:00
|
|
|
qtbase
|
|
|
|
qtscript
|
|
|
|
qtsvg
|
|
|
|
qtxmlpatterns
|
2020-04-07 22:46:50 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2020-09-20 16:24:42 +01:00
|
|
|
qmake
|
|
|
|
qttools
|
2021-04-08 01:31:05 +01:00
|
|
|
installShellFiles
|
2020-04-07 22:46:50 +01:00
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-07 22:46:50 +01:00
|
|
|
description = "2D CAD package based on Qt";
|
|
|
|
homepage = "https://qcad.org";
|
2021-03-17 23:19:39 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-07 22:46:50 +01:00
|
|
|
maintainers = with maintainers; [ yvesf ];
|
2020-09-20 16:24:42 +01:00
|
|
|
platforms = qtbase.meta.platforms;
|
2020-04-07 22:46:50 +01:00
|
|
|
};
|
|
|
|
}
|