diff options
author | Yves Fischer <yvesf+git@xapek.org> | 2020-04-07 23:46:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 21:46:50 +0000 |
commit | 25c3d0da53ffae6201e6333f763074d02b2d00e4 (patch) | |
tree | 5f57f63a11cc3162f60a2c459ffab333c452bc55 /pkgs/applications/misc/qcad | |
parent | 388635f82f1f3f38c8c71bbd89e7fe42246d7601 (diff) |
qcad: init at 3.24.2.1 (#81209)
Co-authored-by: zimbatm <zimbatm@zimbatm.com>
Diffstat (limited to 'pkgs/applications/misc/qcad')
-rw-r--r-- | pkgs/applications/misc/qcad/application-dir.patch | 35 | ||||
-rw-r--r-- | pkgs/applications/misc/qcad/default.nix | 92 |
2 files changed, 127 insertions, 0 deletions
diff --git a/pkgs/applications/misc/qcad/application-dir.patch b/pkgs/applications/misc/qcad/application-dir.patch new file mode 100644 index 0000000000000..84782e1e7178f --- /dev/null +++ b/pkgs/applications/misc/qcad/application-dir.patch @@ -0,0 +1,35 @@ +diff --git a/src/core/RS.cpp b/src/core/RS.cpp +index d8a135d6f..659795dbb 100644 +--- a/src/core/RS.cpp ++++ b/src/core/RS.cpp +@@ -151,7 +151,7 @@ QStringList RS::getDirectoryList(const QString& subDirectory) { + dirList.append(appDir + "/../../../" + subDirectory); + dirList.append(QDir::currentPath() + "/" + subDirectory); + #else +- dirList.append(appDir + "/" + subDirectory); ++ dirList.append(appDir + "/../lib/" + subDirectory); + #endif + + /* +diff --git a/src/core/RSettings.cpp b/src/core/RSettings.cpp +index c6c31cbf5..c51b59ce6 100644 +--- a/src/core/RSettings.cpp ++++ b/src/core/RSettings.cpp +@@ -367,6 +367,8 @@ QString RSettings::getApplicationPath() { + ret.cdUp(); + } + ++ ret.cd("../lib"); ++ + return ret.path(); + } + +@@ -1268,7 +1270,7 @@ QString RSettings::getRevisionString() { + } + + QString RSettings::getReleaseDate() { +- return __DATE__; ++ return ""; + } + + int RSettings::getSnapRange() { diff --git a/pkgs/applications/misc/qcad/default.nix b/pkgs/applications/misc/qcad/default.nix new file mode 100644 index 0000000000000..4f046e34b1892 --- /dev/null +++ b/pkgs/applications/misc/qcad/default.nix @@ -0,0 +1,92 @@ +{ boost +, fetchFromGitHub +, mkDerivationWith +, muparser +, pkgconfig +, qmake +, qt5 +, stdenv +, libGLU +}: + +mkDerivationWith stdenv.mkDerivation rec { + pname = "qcad"; + version = "3.24.2.1"; + + src = fetchFromGitHub { + owner = "qcad"; + repo = "qcad"; + rev = "v${version}"; + sha256 = "1g295gljq051x09f4d8k586bkg3vs8z22dn3rxj6xrm6803z8zw2"; + }; + + patches = [ + ./application-dir.patch + ]; + + postPatch = '' + mkdir src/3rdparty/qt-labs-qtscriptgenerator-${qt5.qtbase.version} + cp \ + src/3rdparty/qt-labs-qtscriptgenerator-5.12.3/qt-labs-qtscriptgenerator-5.12.3.pro \ + src/3rdparty/qt-labs-qtscriptgenerator-${qt5.qtbase.version}/qt-labs-qtscriptgenerator-${qt5.qtbase.version}.pro + ''; + + 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 + + install -Dm644 scripts/qcad_icon.svg $out/share/icons/hicolor/scalable/apps/qcad.svg + + runHook postInstall + ''; + + buildInputs = [ + boost + muparser + libGLU + qt5.qtbase + qt5.qtscript + qt5.qtsvg + qt5.qtxmlpatterns + ]; + + nativeBuildInputs = [ + pkgconfig + qt5.qmake + qt5.qttools + ]; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "2D CAD package based on Qt"; + homepage = "https://qcad.org"; + license = licenses.gpl3; + maintainers = with maintainers; [ yvesf ]; + platforms = qt5.qtbase.meta.platforms; + }; +} |