2022-01-03 16:56:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, mkDerivation
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2022-01-03 16:56:52 +00:00
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, qmake
|
|
|
|
, qttools
|
|
|
|
, boost
|
2020-09-25 04:45:31 +00:00
|
|
|
, libGLU
|
2020-04-24 23:36:52 +00:00
|
|
|
, muparser
|
2020-09-25 04:45:31 +00:00
|
|
|
, qtbase
|
|
|
|
, qtscript
|
|
|
|
, qtsvg
|
|
|
|
, qtxmlpatterns
|
2022-01-03 16:56:52 +00:00
|
|
|
, qtmacextras
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "qcad";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "3.27.6.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-02-10 20:34:41 +00:00
|
|
|
name = "qcad-${version}-src";
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "qcad";
|
|
|
|
repo = "qcad";
|
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-PGGm7XhjGngj2oD8NNh8aQOKRgcdx9qiQu/4ZYBceG8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-03-19 17:17:44 +00:00
|
|
|
# Patch directory lookup, remove __DATE__ and executable name
|
2020-04-24 23:36:52 +00:00
|
|
|
./application-dir.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
if ! [ -d src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version} ]; then
|
|
|
|
mkdir src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version}
|
|
|
|
cp \
|
|
|
|
src/3rdparty/qt-labs-qtscriptgenerator-5.14.0/qt-labs-qtscriptgenerator-5.14.0.pro \
|
|
|
|
src/3rdparty/qt-labs-qtscriptgenerator-${qtbase.version}/qt-labs-qtscriptgenerator-${qtbase.version}.pro
|
|
|
|
fi
|
2021-04-08 16:26:57 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
pkg-config
|
|
|
|
qmake
|
|
|
|
qttools
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
libGLU
|
|
|
|
muparser
|
|
|
|
qtbase
|
|
|
|
qtscript
|
|
|
|
qtsvg
|
|
|
|
qtxmlpatterns
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
qtmacextras
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
qmakeFlags = [
|
|
|
|
"MUPARSER_DIR=${muparser}"
|
|
|
|
"INSTALLROOT=$(out)"
|
|
|
|
"BOOST_DIR=${boost.dev}"
|
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
qtWrapperArgs =
|
|
|
|
lib.optionals stdenv.isLinux [ "--prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib" ]
|
|
|
|
++
|
|
|
|
lib.optionals stdenv.isDarwin [ "--prefix DYLD_LIBRARY_PATH : ${placeholder "out"}/lib" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
|
|
|
install -Dm555 release/qcad-bin $out/bin/qcad
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
install -Dm555 release/QCAD.app/Contents/MacOS/QCAD $out/bin/qcad
|
|
|
|
mkdir -p $out/lib
|
|
|
|
'' +
|
|
|
|
''
|
|
|
|
install -Dm555 -t $out/lib release/libspatialindexnavel${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadcore${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadentity${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadgrid${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadsnap${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadoperations${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadstemmer${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadspatialindex${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadgui${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
install -Dm555 -t $out/lib release/libqcadecmaapi${stdenv.hostPlatform.extensions.sharedLibrary}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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 16:26:57 +00: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-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# workaround to fix the library browser:
|
|
|
|
rm -r $out/lib/plugins/sqldrivers
|
|
|
|
ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/sqldrivers
|
|
|
|
|
2021-04-08 16:26:57 +00: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-24 23:36:52 +00:00
|
|
|
install -Dm644 scripts/qcad_icon.svg $out/share/icons/hicolor/scalable/apps/qcad.svg
|
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
installManPage qcad.1
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
runHook postInstall
|
2021-04-08 16:26:57 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "2D CAD package based on Qt";
|
|
|
|
homepage = "https://qcad.org";
|
2021-03-19 17:17:44 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ yvesf ];
|
2020-09-25 04:45:31 +00:00
|
|
|
platforms = qtbase.meta.platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|