php84Extensions.imagick: fix darwin build (#360575)
[NixPkgs.git] / pkgs / by-name / gn / gnome-weather / package.nix
blobedbfa6503a9738d5800a75aa9e19be132c302b08
2   lib,
3   stdenv,
4   fetchurl,
5   desktop-file-utils,
6   pkg-config,
7   gnome,
8   adwaita-icon-theme,
9   gtk4,
10   libadwaita,
11   wrapGAppsHook4,
12   gjs,
13   gobject-introspection,
14   libgweather,
15   meson,
16   ninja,
17   geoclue2,
18   python3,
19   gsettings-desktop-schemas,
22 stdenv.mkDerivation rec {
23   pname = "gnome-weather";
24   version = "47.0";
26   src = fetchurl {
27     url = "mirror://gnome/sources/gnome-weather/${lib.versions.major version}/gnome-weather-${version}.tar.xz";
28     hash = "sha256-UV9YYjdN00bLyFqd3wMGstMnZXhQu2C2ycmGD86WIOY=";
29   };
31   nativeBuildInputs = [
32     desktop-file-utils
33     pkg-config
34     meson
35     ninja
36     wrapGAppsHook4
37     python3
38     gobject-introspection
39     gjs
40   ];
42   buildInputs = [
43     gtk4
44     libadwaita
45     gjs
46     libgweather
47     adwaita-icon-theme
48     geoclue2
49     gsettings-desktop-schemas
50   ];
52   postPatch = ''
53     # The .service file is not wrapped with the correct environment
54     # so misses GIR files when started. By re-pointing from the gjs
55     # entry point to the wrapped binary we get back to a wrapped
56     # binary.
57     substituteInPlace "data/org.gnome.Weather.service.in" \
58         --replace-fail "Exec=@DATA_DIR@/@APP_ID@" "Exec=gnome-weather"
60     chmod +x meson_post_install.py
61     patchShebangs meson_post_install.py
62   '';
64   passthru = {
65     updateScript = gnome.updateScript { packageName = "gnome-weather"; };
66   };
68   meta = with lib; {
69     homepage = "https://apps.gnome.org/Weather/";
70     description = "Access current weather conditions and forecasts";
71     mainProgram = "gnome-weather";
72     maintainers = teams.gnome.members;
73     license = licenses.gpl2Plus;
74     platforms = platforms.unix;
75   };