1 { lib, stdenv, fetchFromGitHub, wrapQtAppsHook, cmake, bzip2, qtbase, qttools, libnova, proj_7, libpng, openjpeg }:
3 stdenv.mkDerivation rec {
4 version = "unstable-2022-05-16";
7 src = fetchFromGitHub {
10 rev = "88c425ca2d7f4ba5d7ab75bfa25e177bee02d310";
11 sha256 = "sha256-qMMeRYIQqJpVRE3YjbXIiXHwS/CHs9l2QihszwQIr/A=";
14 nativeBuildInputs = [ cmake qttools wrapQtAppsHook ];
15 buildInputs = [ bzip2 qtbase libnova proj_7 openjpeg libpng ];
16 cmakeFlags = [ "-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/openjpeg-${lib.versions.majorMinor openjpeg.version}" ]
17 ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DLIBNOVA_LIBRARY=${libnova}/lib/libnova.dylib" ];
20 if stdenv.hostPlatform.isDarwin then ''
21 mkdir -p "$out/Applications" "$out/XyGrib/XyGrib.app/Contents/Resources"
22 cp "../data/img/xyGrib.icns" "$out/XyGrib/XyGrib.app/Contents/Resources/xyGrib.icns"
23 mv $out/XyGrib/XyGrib.app $out/Applications
24 wrapQtApp "$out/Applications/XyGrib.app/Contents/MacOS/XyGrib"
26 wrapQtApp $out/XyGrib/XyGrib
28 ln -s $out/XyGrib/XyGrib $out/bin/xygrib
29 install -Dm444 $src/debian/xygrib.png -t $out/share/icons/hicolor/32x32/apps
30 install -Dm444 $src/debian/xygrib.desktop -t $out/share/applications
31 substituteInPlace $out/share/applications/xygrib.desktop \
32 --replace 'Exec=XyGrib' 'Exec=xygrib'
36 homepage = "https://opengribs.org";
37 description = "Weather Forecast Visualization";
38 mainProgram = "xygrib";
40 XyGrib is a leading opensource weather visualization package.
41 It interacts with OpenGribs's Grib server providing a choice
42 of global and large area atmospheric and wave models.
44 license = licenses.gpl3;
45 platforms = platforms.all;
46 maintainers = with maintainers; [ j03 ];