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 2 , fetchFromGitHub 3 , cmake 4 , glib 5 - , gobject-introspection 6 , icu 7 , libxml2 8 , ninja 9 , perl 10 , pkgconfig 11 , python3 12 , tzdata 13 - , vala 14 }: 15 16 stdenv.mkDerivation rec { 17 pname = "libical"; ··· 28 29 nativeBuildInputs = [ 30 cmake 31 - gobject-introspection 32 ninja 33 perl 34 pkgconfig 35 - vala 36 # Docs building fails: 37 # https://github.com/NixOS/nixpkgs/pull/67204 38 # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 39 # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs 40 ]; 41 installCheckInputs = [ 42 # running libical-glib tests ··· 52 ]; 53 54 cmakeFlags = [ 55 "-DGOBJECT_INTROSPECTION=True" 56 - "-DENABLE_GTK_DOC=False" 57 "-DICAL_GLIB_VAPI=True" 58 ]; 59 60 patches = [ 61 # Will appear in 3.1.0 62 # https://github.com/libical/libical/issues/350 63 ./respect-env-tzdir.patch 64 ]; 65 66 # Using install check so we do not have to manually set
··· 1 + { lib 2 + , stdenv 3 , fetchFromGitHub 4 + , fetchpatch 5 + , buildPackages 6 , cmake 7 , glib 8 , icu 9 , libxml2 10 , ninja 11 , perl 12 , pkgconfig 13 + , libical 14 , python3 15 , tzdata 16 + , introspectionSupport ? stdenv.buildPlatform == stdenv.hostPlatform 17 + , gobject-introspection ? null 18 + , vala ? null 19 }: 20 + 21 + assert introspectionSupport -> gobject-introspection != null && vala != null; 22 23 stdenv.mkDerivation rec { 24 pname = "libical"; ··· 35 36 nativeBuildInputs = [ 37 cmake 38 ninja 39 perl 40 pkgconfig 41 # Docs building fails: 42 # https://github.com/NixOS/nixpkgs/pull/67204 43 # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 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 51 ]; 52 installCheckInputs = [ 53 # running libical-glib tests ··· 63 ]; 64 65 cmakeFlags = [ 66 + "-DENABLE_GTK_DOC=False" 67 + ] ++ lib.optionals introspectionSupport [ 68 "-DGOBJECT_INTROSPECTION=True" 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" 72 ]; 73 74 patches = [ 75 # Will appear in 3.1.0 76 # https://github.com/libical/libical/issues/350 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 + }) 84 ]; 85 86 # Using install check so we do not have to manually set