codeium: 1.24.2 -> 1.30.2 (#363819)
[NixPkgs.git] / pkgs / applications / misc / xygrib / default.nix
blob72a5f47d9053b0aef420dd1849a4a4059ec6ae09
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   wrapQtAppsHook,
6   cmake,
7   bzip2,
8   qtbase,
9   qttools,
10   libnova,
11   proj_7,
12   libpng,
13   openjpeg,
16 stdenv.mkDerivation rec {
17   version = "unstable-2022-05-16";
18   pname = "xygrib";
20   src = fetchFromGitHub {
21     owner = "opengribs";
22     repo = "XyGrib";
23     rev = "88c425ca2d7f4ba5d7ab75bfa25e177bee02d310";
24     sha256 = "sha256-qMMeRYIQqJpVRE3YjbXIiXHwS/CHs9l2QihszwQIr/A=";
25   };
27   nativeBuildInputs = [
28     cmake
29     qttools
30     wrapQtAppsHook
31   ];
32   buildInputs = [
33     bzip2
34     qtbase
35     libnova
36     proj_7
37     openjpeg
38     libpng
39   ];
40   cmakeFlags =
41     [
42       "-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/openjpeg-${lib.versions.majorMinor openjpeg.version}"
43     ]
44     ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DLIBNOVA_LIBRARY=${libnova}/lib/libnova.dylib" ];
46   postInstall =
47     if stdenv.hostPlatform.isDarwin then
48       ''
49         mkdir -p "$out/Applications" "$out/XyGrib/XyGrib.app/Contents/Resources"
50         cp "../data/img/xyGrib.icns" "$out/XyGrib/XyGrib.app/Contents/Resources/xyGrib.icns"
51         mv $out/XyGrib/XyGrib.app $out/Applications
52         wrapQtApp "$out/Applications/XyGrib.app/Contents/MacOS/XyGrib"
53       ''
54     else
55       ''
56         wrapQtApp $out/XyGrib/XyGrib
57         mkdir -p $out/bin
58         ln -s $out/XyGrib/XyGrib $out/bin/xygrib
59         install -Dm444 $src/debian/xygrib.png -t $out/share/icons/hicolor/32x32/apps
60         install -Dm444 $src/debian/xygrib.desktop -t $out/share/applications
61         substituteInPlace $out/share/applications/xygrib.desktop \
62           --replace 'Exec=XyGrib' 'Exec=xygrib'
63       '';
65   meta = with lib; {
66     homepage = "https://opengribs.org";
67     description = "Weather Forecast Visualization";
68     mainProgram = "xygrib";
69     longDescription = ''
70       XyGrib is a leading opensource weather visualization package.
71       It interacts with OpenGribs's Grib server providing a choice
72       of global and large area atmospheric and wave models.
73     '';
74     license = licenses.gpl3;
75     platforms = platforms.all;
76     maintainers = with maintainers; [ j03 ];
77   };