From 63fcbb8bf7f3639627915ae74758552649d92fcf Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 23 Apr 2023 12:42:17 +0000 Subject: [PATCH] libgweather: disable introspection for cross The gobject-introspection setup hook exports GI_TYPELIB_PATH, which breaks pygobject by trying to make it load cross-compiled glib. Since the script that uses pygobject is mandatory, but the introspection feature itself is not, disable the latter. --- pkgs/development/libraries/libgweather/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libgweather/default.nix b/pkgs/development/libraries/libgweather/default.nix index 0dfa6b91a79..a508593bc49 100644 --- a/pkgs/development/libraries/libgweather/default.nix +++ b/pkgs/development/libraries/libgweather/default.nix @@ -16,13 +16,14 @@ , geocode-glib_2 , vala , gnome +, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform }: stdenv.mkDerivation rec { pname = "libgweather"; version = "4.2.0"; - outputs = [ "out" "dev" "devdoc" ]; + outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -45,10 +46,12 @@ stdenv.mkDerivation rec { ninja pkg-config gettext - vala + glib + (python3.pythonForBuild.withPackages (ps: [ ps.pygobject3 ])) + ] ++ lib.optionals withIntrospection [ gi-docgen gobject-introspection - (python3.pythonForBuild.withPackages (ps: [ ps.pygobject3 ])) + vala ]; buildInputs = [ @@ -61,8 +64,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dzoneinfo_dir=${tzdata}/share/zoneinfo" - "-Denable_vala=true" - "-Dgtk_doc=true" + (lib.mesonBool "introspection" withIntrospection) ]; postPatch = ''