Merge pull request #98818 from lopsided98/libical-cross

libical: fix cross-compilation

authored by John Ericson and committed by GitHub 6a0cf06f 3b390e57

+26 -6
+26 -6
pkgs/development/libraries/libical/default.nix
··· 1 - { stdenv 1 + { lib 2 + , stdenv 2 3 , fetchFromGitHub 4 + , fetchpatch 5 + , buildPackages 3 6 , cmake 4 7 , glib 5 - , gobject-introspection 6 8 , icu 7 9 , libxml2 8 10 , ninja 9 11 , perl 10 12 , pkgconfig 13 + , libical 11 14 , python3 12 15 , tzdata 13 - , vala 16 + , introspectionSupport ? stdenv.buildPlatform == stdenv.hostPlatform 17 + , gobject-introspection ? null 18 + , vala ? null 14 19 }: 20 + 21 + assert introspectionSupport -> gobject-introspection != null && vala != null; 15 22 16 23 stdenv.mkDerivation rec { 17 24 pname = "libical"; ··· 28 35 29 36 nativeBuildInputs = [ 30 37 cmake 31 - gobject-introspection 32 38 ninja 33 39 perl 34 40 pkgconfig 35 - vala 36 41 # Docs building fails: 37 42 # https://github.com/NixOS/nixpkgs/pull/67204 38 43 # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 39 44 # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs 45 + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 46 + # provides ical-glib-src-generator that runs during build 47 + libical 48 + ] ++ lib.optionals introspectionSupport [ 49 + gobject-introspection 50 + vala 40 51 ]; 41 52 installCheckInputs = [ 42 53 # running libical-glib tests ··· 52 63 ]; 53 64 54 65 cmakeFlags = [ 66 + "-DENABLE_GTK_DOC=False" 67 + ] ++ lib.optionals introspectionSupport [ 55 68 "-DGOBJECT_INTROSPECTION=True" 56 - "-DENABLE_GTK_DOC=False" 57 69 "-DICAL_GLIB_VAPI=True" 70 + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 71 + "-DIMPORT_GLIB_SRC_GENERATOR=${lib.getDev buildPackages.libical}/lib/cmake/LibIcal/GlibSrcGenerator.cmake" 58 72 ]; 59 73 60 74 patches = [ 61 75 # Will appear in 3.1.0 62 76 # https://github.com/libical/libical/issues/350 63 77 ./respect-env-tzdir.patch 78 + # Export src-generator binary for use while cross-compiling 79 + # https://github.com/libical/libical/pull/439 80 + (fetchpatch { 81 + url = "https://github.com/libical/libical/commit/1197d84b63dce179b55a6293cfd6d0523607baf1.patch"; 82 + sha256 = "18i1khnwmw488s7g5a1kf05sladf8dbyhfc69mbcf6dkc4nnc3dg"; 83 + }) 64 84 ]; 65 85 66 86 # Using install check so we do not have to manually set