libical: re-disable introspection if no emulator

e.g. when cross compiling from Linux to FreeBSD.

We have to get the build libical from pkgsBuildBuild, to avoid picking
up a propagated gobject-introspection host dependency.

Fixes: 1bd8727a4c ("various: enable gobject-introspection when cross-compiling")
This commit is contained in:
Alyssa Ross 2023-03-01 16:08:08 +00:00
parent 5ecef164cb
commit 9144866bb7
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -1,7 +1,8 @@
{ lib { lib
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, buildPackages , pkgsBuildBuild
, pkgsBuildHost
, cmake , cmake
, glib , glib
, icu , icu
@ -13,6 +14,7 @@
, python3 , python3
, tzdata , tzdata
, fixDarwinDylibNames , fixDarwinDylibNames
, withIntrospection ? stdenv.hostPlatform.emulatorAvailable pkgsBuildHost
, gobject-introspection , gobject-introspection
, vala , vala
}: }:
@ -31,20 +33,24 @@ stdenv.mkDerivation rec {
}; };
strictDeps = true; strictDeps = true;
depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# provides ical-glib-src-generator that runs during build
libical
];
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
ninja ninja
perl perl
pkg-config pkg-config
] ++ lib.optionals withIntrospection [
gobject-introspection gobject-introspection
vala vala
# Docs building fails: # Docs building fails:
# https://github.com/NixOS/nixpkgs/pull/67204 # https://github.com/NixOS/nixpkgs/pull/67204
# previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489
# gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# provides ical-glib-src-generator that runs during build
libical
] ++ lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
fixDarwinDylibNames fixDarwinDylibNames
]; ];
@ -63,10 +69,10 @@ stdenv.mkDerivation rec {
cmakeFlags = [ cmakeFlags = [
"-DENABLE_GTK_DOC=False" "-DENABLE_GTK_DOC=False"
"-DGOBJECT_INTROSPECTION=True" "-DGOBJECT_INTROSPECTION=${if withIntrospection then "True" else "False"}"
"-DICAL_GLIB_VAPI=True" "-DICAL_GLIB_VAPI=${if withIntrospection then "True" else "False"}"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev buildPackages.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake" "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev pkgsBuildBuild.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake"
]; ];
patches = [ patches = [