biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / applications / graphics / openboard / default.nix
blobcd5331d00672f4aa414f7c74c829744a59b44a86
1 { stdenv, lib, fetchFromGitHub, fetchpatch2, copyDesktopItems, makeDesktopItem, qmake
2 , qtbase, qtxmlpatterns, qttools, qtwebengine, libGL, fontconfig, openssl, poppler, wrapQtAppsHook
3 , ffmpeg, libva, alsa-lib, SDL, x264, libvpx, libvorbis, libtheora, libogg
4 , libopus, lame, fdk_aac, libass, quazip, libXext, libXfixes }:
6 let
7   importer = stdenv.mkDerivation {
8     pname = "openboard-importer";
9     version = "unstable-2016-10-08";
11     src = fetchFromGitHub {
12       owner = "OpenBoard-org";
13       repo = "OpenBoard-Importer";
14       rev = "47927bda021b4f7f1540b794825fb0d601875e79";
15       sha256 = "19zhgsimy0f070caikc4vrrqyc8kv2h6rl37sy3iggks8z0g98gf";
16     };
18     nativeBuildInputs = [ qmake ];
19     buildInputs = [ qtbase ];
20     dontWrapQtApps = true;
22     installPhase = ''
23       install -Dm755 OpenBoardImporter $out/bin/OpenBoardImporter
24     '';
25   };
26 in stdenv.mkDerivation (finalAttrs: {
27   pname = "openboard";
28   version = "1.7.1";
30   src = fetchFromGitHub {
31     owner = "OpenBoard-org";
32     repo = "OpenBoard";
33     rev = "v${finalAttrs.version}";
34     hash = "sha256-gXxxlAEuzMCvFu5oSQayNW191XAC/YKvldItYEFxvNM=";
35   };
37   patches = [
38     # fix: Support FFmpeg 7.0
39     # https://github.com/OpenBoard-org/OpenBoard/pull/1017
40     (fetchpatch2 {
41       url = "https://github.com/OpenBoard-org/OpenBoard/commit/4f45b6c4016972cf5835f9188bda6197b1b4ed2f.patch?full_index=1";
42       hash = "sha256-MUJbHfOCMlRO4pg5scm+DrBsngZwB7UPuDJZss5x9Zs=";
43     })
45     # fix: Resolve FFmpeg 7.0 warnings
46     # https://github.com/OpenBoard-org/OpenBoard/pull/1017
47     (fetchpatch2 {
48       url = "https://github.com/OpenBoard-org/OpenBoard/commit/315bcac782e10cc6ceef1fc8b78fff40541ea38f.patch?full_index=1";
49       hash = "sha256-736eX+uXuZwHJxOXAgxs2/vjjD1JY9mMyj3rR45/7xk=";
50     })
51   ];
53   postPatch = ''
54     substituteInPlace OpenBoard.pro \
55       --replace-fail '/usr/include/quazip5' '${lib.getDev quazip}/include/QuaZip-Qt5-${quazip.version}/quazip' \
56       --replace-fail '-lquazip5' '-lquazip1-qt5' \
57       --replace-fail '/usr/include/poppler' '${lib.getDev poppler}/include/poppler'
59     substituteInPlace resources/etc/OpenBoard.config \
60       --replace-fail 'EnableAutomaticSoftwareUpdates=true' 'EnableAutomaticSoftwareUpdates=false' \
61       --replace-fail 'EnableSoftwareUpdates=true' 'EnableAutomaticSoftwareUpdates=false' \
62       --replace-fail 'HideCheckForSoftwareUpdate=false' 'HideCheckForSoftwareUpdate=true'
63   '';
65   nativeBuildInputs = [ qmake copyDesktopItems wrapQtAppsHook ];
67   buildInputs = [
68     qtbase
69     qtxmlpatterns
70     qttools
71     qtwebengine
72     libGL
73     fontconfig
74     openssl
75     poppler
76     ffmpeg
77     libva
78     alsa-lib
79     SDL
80     x264
81     libvpx
82     libvorbis
83     libtheora
84     libogg
85     libopus
86     lame
87     fdk_aac
88     libass
89     quazip
90     libXext
91     libXfixes
92   ];
94   propagatedBuildInputs = [ importer ];
96   makeFlags = [ "release-install" ];
98   desktopItems = [
99     (makeDesktopItem {
100       name = "OpenBoard";
101       exec = "OpenBoard %f";
102       icon = "OpenBoard";
103       comment = "OpenBoard, an interactive white board application";
104       desktopName = "OpenBoard";
105       mimeTypes = [ "application/ubz" ];
106       categories = [ "Education" ];
107       startupNotify = true;
108     })
109   ];
111   installPhase = ''
112     runHook preInstall
114     lrelease OpenBoard.pro
116     # Replicated release_scripts/linux/package.sh
117     mkdir -p $out/opt/openboard/i18n
118     cp -R resources/customizations build/linux/release/product/* $out/opt/openboard/
119     cp resources/i18n/*.qm $out/opt/openboard/i18n/
120     install -m644 resources/linux/openboard-ubz.xml $out/opt/openboard/etc/
121     install -Dm644 resources/images/OpenBoard.png $out/share/icons/hicolor/64x64/apps/OpenBoard.png
123     runHook postInstall
124   '';
126   dontWrapQtApps = true;
128   postFixup = ''
129     makeWrapper $out/opt/openboard/OpenBoard $out/bin/OpenBoard \
130       "''${qtWrapperArgs[@]}"
131   '';
133   meta = with lib; {
134     description = "Interactive whiteboard application";
135     license = licenses.gpl3Plus;
136     maintainers = with maintainers; [ fufexan ];
137     platforms = platforms.linux;
138     mainProgram = "OpenBoard";
139   };