16 gobject-introspection,
23 lib.meta.availableOn stdenv.hostPlatform gobject-introspection
24 && stdenv.hostPlatform.emulatorAvailable buildPackages,
27 stdenv.mkDerivation rec {
28 pname = "libgweather";
34 ] ++ lib.optional withIntrospection "devdoc";
37 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
38 hash = "sha256-cBdnd1PN99H9w1Xkv82x66g2l5Oo3yTSQUJ6k5y/QoM=";
42 # Headers depend on glib but it is only listed in Requires.private,
43 # which does not influence Cflags on non-static builds in nixpkgs’s
44 # pkg-config. Let’s add it to Requires to ensure Cflags are set correctly.
60 (python3.pythonOnBuildForHost.withPackages (ps: [ ps.pygobject3 ]))
62 ++ lib.optionals withIntrospection [
78 "-Dzoneinfo_dir=${tzdata}/share/zoneinfo"
79 (lib.mesonBool "introspection" withIntrospection)
81 ++ lib.optionals stdenv.hostPlatform.isDarwin [
82 "-Dc_args=-D_DARWIN_C_SOURCE"
86 patchShebangs --build build-aux/meson/gen_locations_variant.py
87 wrapProgram $PWD/build-aux/meson/gen_locations_variant.py \
88 --prefix GI_TYPELIB_PATH : ${lib.getLib buildPackages.glib}/lib/girepository-1.0 \
90 # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
91 # it should be a build-time dep for build
93 substituteInPlace doc/meson.build \
94 --replace-fail "'gi-docgen', ver" "'gi-docgen', native:true, ver" \
95 --replace-fail "'gi-docgen', req" "'gi-docgen', native:true, req"
97 # gir works for us even when cross-compiling
98 # TODO: send upstream because downstream users can use the option to disable gir if they don't have it working
99 substituteInPlace meson.build \
100 --replace-fail "g_ir_scanner.found() and not meson.is_cross_build()" "g_ir_scanner.found()"
102 substituteInPlace libgweather/meson.build --replace-fail \
103 "dependency('vapigen', required: enable_vala == 'true')" \
104 "dependency('vapigen', native: true, required: enable_vala == 'true')"
108 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
109 moveToOutput "share/doc" "$devdoc"
115 updateScript = gnome.updateScript {
117 versionPolicy = "odd-unstable";
118 # Version 40.alpha preceded version 4.0.
124 description = "Library to access weather information from online services for numerous locations";
125 homepage = "https://gitlab.gnome.org/GNOME/libgweather";
126 license = licenses.gpl2Plus;
127 maintainers = teams.gnome.members;
128 platforms = platforms.unix;