2020-01-08 22:56:46 +00:00
|
|
|
{ boost
|
|
|
|
, fetchFromGitHub
|
2020-01-10 10:52:11 +00:00
|
|
|
, fetchpatch
|
2020-01-08 22:56:46 +00:00
|
|
|
, installShellFiles
|
|
|
|
, mkDerivationWith
|
|
|
|
, muparser
|
|
|
|
, pkgconfig
|
|
|
|
, qmake
|
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, runtimeShell
|
|
|
|
, gcc8Stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
stdenv = gcc8Stdenv;
|
|
|
|
in
|
|
|
|
|
2020-01-10 10:52:11 +00:00
|
|
|
# Doesn't build with gcc9
|
2020-01-08 22:56:46 +00:00
|
|
|
mkDerivationWith stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "librecad";
|
2019-09-19 04:42:23 +01:00
|
|
|
version = "2.2.0-rc1";
|
2012-01-03 21:14:14 +00:00
|
|
|
|
2019-09-19 04:42:23 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LibreCAD";
|
|
|
|
repo = "LibreCAD";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0kwj838hqzbw95gl4x6scli9gj3gs72hdmrrkzwq5rjxam18k3f3";
|
2012-01-03 21:14:14 +00:00
|
|
|
};
|
|
|
|
|
2020-01-08 22:56:46 +00:00
|
|
|
patches = [
|
|
|
|
./fix_qt_5_11_build.patch
|
2020-01-10 10:52:11 +00:00
|
|
|
(
|
|
|
|
fetchpatch {
|
|
|
|
# Fix missing app name and icon on Wayland.
|
|
|
|
url = "https://github.com/LibreCAD/LibreCAD/commit/a17f8281093403f0c7c36996232665ed21906688.patch";
|
|
|
|
sha256 = "1x46psh4bcx2hxck4l83ki43g1252vb033i2x94h4rpai9hww4d5";
|
|
|
|
}
|
|
|
|
)
|
2020-01-08 22:56:46 +00:00
|
|
|
];
|
2019-09-19 04:42:23 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scripts/postprocess-unix.sh \
|
|
|
|
--replace /bin/sh ${runtimeShell}
|
|
|
|
|
|
|
|
substituteInPlace librecad/src/lib/engine/rs_system.cpp \
|
|
|
|
--replace /usr/share $out/share
|
|
|
|
|
|
|
|
substituteInPlace librecad/src/main/qc_applicationwindow.cpp \
|
|
|
|
--replace __DATE__ 0
|
2012-01-03 21:14:14 +00:00
|
|
|
'';
|
|
|
|
|
2019-09-19 04:42:23 +01:00
|
|
|
qmakeFlags = [
|
|
|
|
"MUPARSER_DIR=${muparser}"
|
|
|
|
"BOOST_DIR=${boost.dev}"
|
|
|
|
];
|
2012-01-03 21:14:14 +00:00
|
|
|
|
2012-11-28 10:25:08 +00:00
|
|
|
installPhase = ''
|
2019-09-19 04:42:23 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm555 -t $out/bin unix/{librecad,ttf2lff}
|
|
|
|
install -Dm444 -t $out/share/applications desktop/librecad.desktop
|
|
|
|
install -Dm644 -t $out/share/pixmaps librecad/res/main/librecad.png
|
|
|
|
install -Dm444 desktop/librecad.sharedmimeinfo $out/share/mime/packages/librecad.xml
|
|
|
|
install -Dm444 desktop/graphics_icons_and_splash/Icon\ LibreCAD/Icon_Librecad.svg \
|
2019-04-22 08:44:07 +01:00
|
|
|
$out/share/icons/hicolor/scalable/apps/librecad.svg
|
2019-09-19 04:42:23 +01:00
|
|
|
|
|
|
|
installManPage desktop/librecad.?
|
|
|
|
|
2012-11-28 10:25:08 +00:00
|
|
|
cp -R unix/resources $out/share/librecad
|
2019-09-19 04:42:23 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2012-11-28 10:25:08 +00:00
|
|
|
'';
|
2012-01-03 21:14:14 +00:00
|
|
|
|
2020-01-08 22:56:46 +00:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
muparser
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
];
|
2019-09-19 04:42:23 +01:00
|
|
|
|
2020-01-08 22:56:46 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
pkgconfig
|
|
|
|
qmake
|
|
|
|
qttools
|
|
|
|
];
|
2015-10-21 13:43:52 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2012-01-03 21:14:14 +00:00
|
|
|
|
2020-01-08 22:56:46 +00:00
|
|
|
meta = with stdenv.lib; {
|
2019-09-19 04:42:23 +01:00
|
|
|
description = "2D CAD package based on Qt";
|
|
|
|
homepage = "https://librecad.org";
|
|
|
|
license = licenses.gpl2;
|
2020-01-08 22:56:46 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
kiwi
|
|
|
|
viric
|
|
|
|
];
|
2019-09-19 04:42:23 +01:00
|
|
|
platforms = platforms.linux;
|
2012-01-03 21:14:14 +00:00
|
|
|
};
|
|
|
|
}
|