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