tailscale: build derpprobe (#364918)
[NixPkgs.git] / pkgs / applications / misc / librecad / default.nix
blob7d41c040db8e2bf0ddf30b10131a9b29e28c935b
2   lib,
3   boost,
4   fetchFromGitHub,
5   installShellFiles,
6   mkDerivation,
7   muparser,
8   pkg-config,
9   qmake,
10   qtbase,
11   qtsvg,
12   qttools,
13   runtimeShell,
16 mkDerivation rec {
17   pname = "librecad";
18   version = "2.2.0.2";
20   src = fetchFromGitHub {
21     owner = "LibreCAD";
22     repo = "LibreCAD";
23     rev = version;
24     sha256 = "sha256-Vj6nvOfmhzou2hhmujm47a7aKBzmgchDb/BbwCb3/hI=";
25   };
27   buildInputs = [
28     boost
29     muparser
30     qtbase
31     qtsvg
32   ];
34   nativeBuildInputs = [
35     installShellFiles
36     pkg-config
37     qmake
38     qttools
39   ];
41   qmakeFlags = [
42     "MUPARSER_DIR=${muparser}"
43     "BOOST_DIR=${boost.dev}"
44   ];
46   postPatch = ''
47     substituteInPlace scripts/postprocess-unix.sh \
48       --replace /bin/sh ${runtimeShell}
50     substituteInPlace librecad/src/main/qc_applicationwindow.cpp \
51       --replace __DATE__ 0
52   '';
54   installPhase = ''
55     runHook preInstall
57     install -Dm555 -t $out/bin                unix/{librecad,ttf2lff}
58     install -Dm444 -t $out/share/applications desktop/librecad.desktop
59     install -Dm644 -t $out/share/pixmaps      librecad/res/main/librecad.png
60     install -Dm444 desktop/librecad.sharedmimeinfo $out/share/mime/packages/librecad.xml
61     install -Dm444 desktop/graphics_icons_and_splash/Icon\ LibreCAD/Icon_Librecad.svg \
62       $out/share/icons/hicolor/scalable/apps/librecad.svg
64     installManPage desktop/librecad.?
66     cp -R unix/resources $out/share/librecad
68     runHook postInstall
69   '';
71   meta = with lib; {
72     description = "2D CAD package based on Qt";
73     homepage = "https://librecad.org";
74     license = licenses.gpl2Only;
75     maintainers = [ ];
76     platforms = platforms.linux;
77   };