biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / qelectrotech / default.nix
blob705618bd2f01c57efac2f16cb3d6ec4897bfd036
1 { lib
2 , stdenv
3 , mkDerivation
4 , fetchzip
5 , installShellFiles
6 , pkg-config
7 , qmake
8 , qtbase
9 , kcoreaddons
10 , kwidgetsaddons
13 mkDerivation rec {
14   pname = "qelectrotech";
15   version = "0.8.0";
17   src = fetchzip {
18     url = "https://git.tuxfamily.org/qet/qet.git/snapshot/qet-${version}.tar.gz";
19     sha256 = "sha256-op2vnMPF9bNnHGphWFB/HEeoThE6tX+9UvX8LWVwkzI=";
20   };
22   postPatch = ''
23     substituteInPlace qelectrotech.pro \
24       --replace 'GIT_COMMIT_SHA="\\\"$(shell git -C \""$$_PRO_FILE_PWD_"\" rev-parse --verify HEAD)\\\""' \
25                 'GIT_COMMIT_SHA="\\\"${version}\\\""' \
26       --replace "COMPIL_PREFIX              = '/usr/local/'" \
27                 "COMPIL_PREFIX              = '$out/'" \
28       --replace "INSTALL_PREFIX             = '/usr/local/'" \
29                 "INSTALL_PREFIX             = '$out/'"
30   '';
32   nativeBuildInputs = [
33     installShellFiles
34     pkg-config
35     qmake
36   ];
38   buildInputs = [
39     kcoreaddons
40     kwidgetsaddons
41     qtbase
42   ];
44   qmakeFlags = [
45     "INSTALLROOT=$(out)"
46   ];
48   installPhase = ''
49     runHook preInstall
51     install -Dm555 qelectrotech $out/bin/qelectrotech
53     install -Dm444 -t $out/share/applications misc/qelectrotech.desktop
54     install -Dm444 -t $out/share/applications misc/x-qet-titleblock.desktop
55     install -Dm444 -t $out/share/applications misc/x-qet-element.desktop
56     install -Dm444 -t $out/share/applications misc/x-qet-project.desktop
58     mkdir -p $out/share/qelectrotech
59     cp -r elements $out/share/qelectrotech
60     cp -r titleblocks $out/share/qelectrotech
61     cp -r lang $out/share/qelectrotech
62     cp -r examples $out/share/qelectrotech
64     mkdir -p $out/share/icons/hicolor
65     cp -r ico $out/share/icons/hicolor
67     runHook postInstall
68   '';
70   meta = with lib; {
71     description = "Free software to create electric diagrams";
72     mainProgram = "qelectrotech";
73     homepage = "https://qelectrotech.org/";
74     license = licenses.gpl2;
75     maintainers = with maintainers; [ yvesf ];
76     platforms = qtbase.meta.platforms;
77     broken = stdenv.hostPlatform.isDarwin;
78   };