From 10362d728084d8810f6af2f8588b172e092b01e6 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 15 Jun 2022 15:58:33 +0300 Subject: librdf_raptor2: 2.0.15 -> unstable-2022-06-06 switches to using cmake and fixes cross-compilation --- pkgs/development/libraries/librdf/raptor2.nix | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/librdf/raptor2.nix b/pkgs/development/libraries/librdf/raptor2.nix index 65655814685..e290aa2b743 100644 --- a/pkgs/development/libraries/librdf/raptor2.nix +++ b/pkgs/development/libraries/librdf/raptor2.nix @@ -1,26 +1,28 @@ -{ lib, stdenv, fetchurl, libxml2, libxslt }: +{ lib, stdenv, libxml2, libxslt, pkg-config, cmake, fetchFromGitHub, perl, bison, flex, fetchpatch }: stdenv.mkDerivation rec { pname = "raptor2"; - version = "2.0.15"; + version = "unstable-2022-06-06"; - src = fetchurl { - url = "http://download.librdf.org/source/${pname}-${version}.tar.gz"; - sha256 = "ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed"; + src = fetchFromGitHub { + owner = "dajobe"; + repo = "raptor"; + rev = "3cca62a33da68143b687c9e486eefc7c7cbb4586"; + sha256 = "sha256-h03IyFH1GHPqajfHBBTb19lCEu+VXzQLGC1wiEGVvgY="; }; patches = [ - (fetchurl { - name = "CVE-2017-18926.patch"; - url = "https://github.com/dajobe/raptor/commit/590681e546cd9aa18d57dc2ea1858cb734a3863f.patch"; - sha256 = "1qlpb5rm3j2yi0x6zgdi5apymg5zlvwq3g1zl417gkjrlvxmndgp"; + # https://github.com/dajobe/raptor/pull/52 + (fetchpatch { + name = "fix-cmake-generated-pc-file"; + url = "https://github.com/dajobe/raptor/commit/fa1ef9a27d8762f5588ac2e92554a188e73dee9f.diff"; + sha256 = "sha256-zXIbrYGgC9oTpiD0WUikT4vRdc9b6bsyfnDkwUSlqao="; }) ]; + nativeBuildInputs = [ pkg-config cmake perl bison flex ]; buildInputs = [ libxml2 libxslt ]; - postInstall = "rm -rvf $out/share/gtk-doc"; - meta = { description = "The RDF Parser Toolkit"; homepage = "https://librdf.org/raptor"; -- cgit 1.4.1 From a83d2f7c918a5badab204d57d8620adb926e618b Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 14 Jun 2022 00:12:53 +0300 Subject: gobject-introspection: cross improvements gobject-introspection: copy $dev/share/gobj.../tests when cross-compiling gobject-introspection: add giscanner-ignore-error-return-codes-from-ldd-wrapper patch polkit-aarch64-unknown-linux-gnu> [102/104] Generating src/polkitagent/PolkitAgent-1.0.gir with a custom command polkit-aarch64-unknown-linux-gnu> FAILED: src/polkitagent/PolkitAgent-1.0.gir polkit-aarch64-unknown-linux-gnu> -gobject-introspection-wrapped-1.72.0-dev/bin/g-ir-scanner --no-libtool --namespace=PolkitAgent --nsversion=1.0 --warn-all --output src/polkitagent/PolkitAgent-1.0.gir --c-include=polkitagent/polkitagent.h - D_POLKIT_AGENT_COMPILATION -D_POLKIT_COMPILATION -I/build/source/src/polkitagent -I/build/source/build/src/polkitagent -I/build/source/. -I/build/source/build/. -I/build/source/src/. -I/build/source/build/src/. --filelist=/build/source/build/src/polkitagent/libpolkit-agent-1.so.0.0.0 .p/PolkitAgent_1.0_gir_filelist --include=Gio-2.0 --include-uninstalled=src/polkit/Polkit-1.0.gir --pkg-export=polkit-agent-1 --cflags-begin -DHAVE_CONFIG_H -I/build/source/. -I/build/source/build/. -I/build/source/src/. -I/build/source/build/src/. -I/nix/store/lqncny8acp6hkclsgbfnrb 65i9hscsmn-expat-aarch64-unknown-linux-gnu-2.4.8-dev/include -I-glib-aarch64-unknown-linux-gnu-2.72.2-dev/include/gio-unix-2.0 -I-glib-aarch64-unknown-linux-gnu-2.72.2-dev/include -I/nix/store/qm1wa x4c7sgf5h3b6dhspxb5miayjyc9-glib-aarch64-unknown-linux-gnu-2.72.2-dev/include/glib-2.0 -I-glib-aarch64-unknown-linux-gnu-2.72.2/lib/glib-2.0/include -I-gobject-introspection-aarch64-unknown-linux-gn u-1.72.0-dev/include/gobject-introspection-1.0 --cflags-end --add-include-path=-gobject-introspection-aarch64-unknown-linux-gnu-1.72.0-dev/share/gir-1.0 --add-include-path=/build/source/build/src/polkit -L/build/source/build/src/polkitagent --library polkit-agent-1 -L/build/source/build/src/polkit -L-expat-aarch64-unknown-linux-gnu-2.4.8/lib --extra-library=expat -L-glib-aarch64-unknown-linux-gnu-2.72.2/lib --extra-library=gio-2.0 --ex tra-library=gobject-2.0 --extra-library=glib-2.0 -L-gobject-introspection-aarch64-unknown-linux-gnu-1.72.0/lib --extra-library=girepository-1.0 --sources-top-dirs /build/source/subprojects/ --sources-top-dirs /build/source/build/subprojects/ polkit-aarch64-unknown-linux-gnu> g-ir-scanner: link: aarch64-unknown-linux-gnu-gcc -o /build/source/build/tmp-introspectzp2ldkyk/PolkitAgent-1.0 /build/source/build/tmp-introspectzp2ldkyk/PolkitAgent-1.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -L/build/source/build/src/polkitagent -Wl ,-rpath,/build/source/build/src/polkitagent -L/build/source/build/src/polkit -Wl,-rpath,/build/source/build/src/polkit -L-expat-aarch64-unknown-linux-gnu-2.4.8/lib -Wl,-rpath,-expat-aarch64-unknown- linux-gnu-2.4.8/lib -L-glib-aarch64-unknown-linux-gnu-2.72.2/lib -Wl,-rpath,-glib-aarch64-unknown-linux-gnu-2.72.2/lib -L-gobject-introspection-aarch64-unk nown-linux-gnu-1.72.0/lib -Wl,-rpath,-gobject-introspection-aarch64-unknown-linux-gnu-1.72.0/lib -lpolkit-agent-1 -lexpat -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgirepository-1.0 -L-glib-aarch64-unknow n-linux-gnu-2.72.2/lib -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 polkit-aarch64-unknown-linux-gnu> Traceback (most recent call last): polkit-aarch64-unknown-linux-gnu> File "-gobject-introspection-wrapped-1.72.0-dev/bin/.g-ir-scanner-wrapped", line 99, in polkit-aarch64-unknown-linux-gnu> sys.exit(scanner_main(sys.argv)) polkit-aarch64-unknown-linux-gnu> File "-gobject-introspection-wrapped-1.72.0/lib/gobject-introspection/giscanner/scannermain.py", line 646, in scanner_main polkit-aarch64-unknown-linux-gnu> shlibs = create_binary(transformer, options, args) polkit-aarch64-unknown-linux-gnu> File "-gobject-introspection-wrapped-1.72.0/lib/gobject-introspection/giscanner/scannermain.py", line 471, in create_binary polkit-aarch64-unknown-linux-gnu> shlibs = resolve_shlibs(options, binary, options.libraries) polkit-aarch64-unknown-linux-gnu> File "-gobject-introspection-wrapped-1.72.0/lib/gobject-introspection/giscanner/shlibs.py", line 179, in resolve_shlibs polkit-aarch64-unknown-linux-gnu> _resolve_non_libtool(options, binary, non_libtool)) polkit-aarch64-unknown-linux-gnu> File "-gobject-introspection-wrapped-1.72.0/lib/go bject-introspection/giscanner/shlibs.py", line 112, in _resolve_non_libtool polkit-aarch64-unknown-linux-gnu> output = subprocess.check_output(args) polkit-aarch64-unknown-linux-gnu> File "-python3-3.10.5/lib/python3.10/subprocess.py", line 420, in check_output polkit-aarch64-unknown-linux-gnu> return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, polkit-aarch64-unknown-linux-gnu> File "-python3-3.10.5/lib/python3.10/subprocess.py", line 524, in run polkit-aarch64-unknown-linux-gnu> raise CalledProcessError(retcode, process.args, polkit-aarch64-unknown-linux-gnu> subprocess.CalledProcessError: Command '['-prelink-unstable-2019-06-24/bin/prelink-rtld', '/build/source/build/tmp-introspectzp2ldkyk/PolkitAgent-1.0']' returned non-zero exit status 127. polkit-aarch64-unknown-linux-gnu> [103/104] Generating src/polkit/Polkit-1.0.typelib with a custom command polkit-aarch64-unknown-linux-gnu> ninja: build stopped: subcommand failed. exit status 127 gobject-introspection: this should fix pkgsMusl pkgsStatic by not putting `/nix/store/iw35xj69w190w7vw17l8mac8srg0vpyz-gobject-introspection-static-x86_64-unknown-linux-musl-1.72.0.drv` in their dependency tree when gobject-introspection is in nativeBuildInputs ex .#pkgsStatic.libjxl gobject-introspection: pc file: use binaries from path instead of a abs path to them fixes issues in networkmanager and some other packages ``` gi._error.GError: g-invoke-error-quark: Could not locate g_option_error_quark: /nix/store/...-glib-aarch64-unknown-linux-gnu-2.72.2/lib/libglib-2.0.so.0: cannot open shared object file: No such file or directory (1) ``` see comment gobject-introspection: propagate gobject-introspection-unwrapped in wrapper with this it is no longer needed to put gobject-introspection in buildInputs in addition to nativeBuildInputs --- .../libraries/gobject-introspection/default.nix | 24 ++++++++++++---- ...gnore-error-return-codes-from-ldd-wrapper.patch | 32 ++++++++++++++++++++++ .../libraries/gobject-introspection/wrapper.nix | 8 ++++-- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix index 82be84e1f1d..bfcb9a44014 100644 --- a/pkgs/development/libraries/gobject-introspection/default.nix +++ b/pkgs/development/libraries/gobject-introspection/default.nix @@ -27,7 +27,7 @@ # it may be worth thinking about using multiple derivation outputs # In that case its about 6MB which could be separated -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gobject-introspection"; version = "1.72.0"; @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { outputBin = "dev"; src = fetchurl { - url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + url = "mirror://gnome/sources/gobject-introspection/${lib.versions.majorMinor finalAttrs.version}/gobject-introspection-${finalAttrs.version}.tar.xz"; sha256 = "Av6OWQhh2I+DBg3TnNpcyqYLLaHSHQ+VSZMBsYa+qrw="; }; @@ -68,7 +68,7 @@ stdenv.mkDerivation rec { docbook-xsl-nons docbook_xml_dtd_45 python3 - setupHook # move .gir files + finalAttrs.setupHook # move .gir files ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ gobject-introspection-unwrapped ]; buildInputs = [ @@ -105,6 +105,10 @@ stdenv.mkDerivation rec { postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' cp -r ${buildPackages.gobject-introspection-unwrapped.devdoc} $devdoc + # these are uncompiled c and header files which aren't installed when cross-compiling because + # code that installs them is in tests/meson.build which is only run when not cross-compiling + # pygobject3 needs them + cp -r ${buildPackages.gobject-introspection-unwrapped.dev}/share/gobject-introspection-1.0/tests $dev/share/gobject-introspection-1.0/tests ''; preCheck = '' @@ -120,11 +124,21 @@ stdenv.mkDerivation rec { rm $out/lib/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary} ''; + # when cross-compiling and using the wrapper then when a package looks up the g_ir_X + # variable with pkg-config they'll get the host version which can't be run + # switch the variables to use g_ir_X from path instead of an absolute path + postFixup = lib.optionalString (!lib.hasSuffix "wrapped" finalAttrs.pname) '' + find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do + substituteInPlace "$pc" \ + --replace '=''${bindir}/g-ir' '=g-ir' + done + ''; + setupHook = ./setup-hook.sh; passthru = { updateScript = gnome.updateScript { - packageName = pname; + packageName = "gobject-introspection"; versionPolicy = "odd-unstable"; }; }; @@ -144,4 +158,4 @@ stdenv.mkDerivation rec { automatically provide bindings to call into the C library. ''; }; -} +}) diff --git a/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch b/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch new file mode 100644 index 00000000000..bf1c1f1b713 --- /dev/null +++ b/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch @@ -0,0 +1,32 @@ +From e0fc4a2a5161a36483ddc518be9bb14390f11b19 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 5 Sep 2018 16:46:52 +0200 +Subject: [PATCH] giscanner: ignore error return codes from ldd-wrapper + +prelink-rtld, which we use instead of ldd returns 127 when it can't find a library. +It is not an error per se, but it breaks subprocess.check_output(). + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +Signed-off-by: Adam Duskett +--- + giscanner/shlibs.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py +index 9f8ab5df..7a1a72fe 100644 +--- a/giscanner/shlibs.py ++++ b/giscanner/shlibs.py +@@ -103,7 +103,7 @@ def _resolve_non_libtool(options, binary, libraries): + args.extend(['otool', '-L', binary.args[0]]) + else: + args.extend(['ldd', binary.args[0]]) +- output = subprocess.check_output(args) ++ output = subprocess.run(args, check=False, stdout=subprocess.PIPE).stdout + if isinstance(output, bytes): + output = output.decode("utf-8", "replace") + +-- +2.25.1 + + diff --git a/pkgs/development/libraries/gobject-introspection/wrapper.nix b/pkgs/development/libraries/gobject-introspection/wrapper.nix index 44d31540e64..e71f2f2fb46 100644 --- a/pkgs/development/libraries/gobject-introspection/wrapper.nix +++ b/pkgs/development/libraries/gobject-introspection/wrapper.nix @@ -7,9 +7,13 @@ # to build, run # `nix build ".#pkgsCross.aarch64-multiplatform.buildPackages.gobject-introspection"` -gobject-introspection-unwrapped.overrideAttrs (_previousAttrs: { +gobject-introspection-unwrapped.overrideAttrs (previousAttrs: { pname = "gobject-introspection-wrapped"; - postFixup = '' + depsTargetTargetPropagated = [ gobject-introspection-unwrapped ]; + # failure in e.g. pkgsCross.aarch64-multiplatform.polkit + # subprocess.CalledProcessError: Command '['/nix/store/...-prelink-unstable-2019-06-24/bin/prelink-rtld', '/build/source/build/tmp-introspectzp2ldkyk/PolkitAgent-1.0']' returned non-zero exit status 127. + patches = previousAttrs.patches ++ [ ./giscanner-ignore-error-return-codes-from-ldd-wrapper.patch ]; + postFixup = (previousAttrs.postFixup or "") + '' mv $dev/bin/g-ir-compiler $dev/bin/.g-ir-compiler-wrapped mv $dev/bin/g-ir-scanner $dev/bin/.g-ir-scanner-wrapped diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6508ddc8b2f..ac44da1d0c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17899,7 +17899,7 @@ with pkgs; gns3-gui = gns3Packages.guiStable; gns3-server = gns3Packages.serverStable; - gobject-introspection = if (stdenv.hostPlatform != stdenv.targetPlatform) + gobject-introspection = if (!stdenv.hostPlatform.canExecute stdenv.targetPlatform) then callPackage ../development/libraries/gobject-introspection/wrapper.nix { } else gobject-introspection-unwrapped; gobject-introspection-unwrapped = callPackage ../development/libraries/gobject-introspection { -- cgit 1.4.1 From 71cbf3b809b5a380d3434171ba5caabffdafb919 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 14 Jun 2022 23:30:55 +0300 Subject: gobject-introspection: use targetOffset to look for libraries for target fixes it finding the build and target gobject-introspection when it should only find the target gobject-introspection --- pkgs/development/libraries/gobject-introspection/setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/pkgs/development/libraries/gobject-introspection/setup-hook.sh index 6bee47aeb09..50571a8f914 100644 --- a/pkgs/development/libraries/gobject-introspection/setup-hook.sh +++ b/pkgs/development/libraries/gobject-introspection/setup-hook.sh @@ -10,7 +10,7 @@ make_gobject_introspection_find_gir_files() { fi } -addEnvHooks "$hostOffset" make_gobject_introspection_find_gir_files +addEnvHooks "$targetOffset" make_gobject_introspection_find_gir_files giDiscoverSelf() { if [ -d "$prefix/lib/girepository-1.0" ]; then -- cgit 1.4.1 From 31f99a8a28c7e6c406ee27d5dc86510d75245d83 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 7 Jul 2022 21:30:16 +0300 Subject: gst_all_1: don't disable gobject-introspection when cross --- pkgs/development/libraries/gstreamer/bad/default.nix | 5 ----- pkgs/development/libraries/gstreamer/base/default.nix | 10 ++++------ pkgs/development/libraries/gstreamer/core/default.nix | 11 +++++------ pkgs/development/libraries/gstreamer/devtools/default.nix | 6 ++++-- pkgs/development/libraries/gstreamer/ges/default.nix | 2 -- pkgs/development/libraries/gstreamer/rtsp-server/default.nix | 2 -- 6 files changed, 13 insertions(+), 23 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index 28bcbe9a74c..152904a8e7a 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -123,9 +123,6 @@ stdenv.mkDerivation rec { buildInputs = [ gst-plugins-base orc - # gobject-introspection has to be in both nativeBuildInputs and - # buildInputs. The build tries to link against libgirepository-1.0.so - gobject-introspection json-glib ldacbt libass @@ -294,8 +291,6 @@ stdenv.mkDerivation rec { # `applemedia/videotexturecache.h` requires `gst/gl/gl.h`, # but its meson build system does not declare the dependency. "-Dapplemedia=disabled" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Dintrospection=disabled" ] ++ (if enableGplPlugins then [ "-Dgpl=enabled" ] else [ diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index 599e6586ea0..b0aed54d9b4 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -18,6 +18,7 @@ , libvisual , tremor # provides 'virbisidec' , libGL +, gobject-introspection , enableX11 ? stdenv.isLinux , libXv , libXext @@ -36,8 +37,6 @@ , enableCdparanoia ? (!stdenv.isDarwin) , cdparanoia , glib -, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform -, gobject-introspection }: stdenv.mkDerivation rec { @@ -52,6 +51,9 @@ stdenv.mkDerivation rec { }; strictDeps = true; + depsBuildBuild = [ + pkg-config + ]; nativeBuildInputs = [ meson ninja @@ -63,7 +65,6 @@ stdenv.mkDerivation rec { gstreamer # docs # TODO add hotdoc here - ] ++ lib.optionals withIntrospection [ gobject-introspection ] ++ lib.optional enableWayland wayland; @@ -91,8 +92,6 @@ stdenv.mkDerivation rec { ] ++ lib.optionals enableWayland [ wayland wayland-protocols - ] ++ lib.optionals withIntrospection [ - gobject-introspection ] ++ lib.optional enableCocoa Cocoa ++ lib.optional enableCdparanoia cdparanoia; @@ -106,7 +105,6 @@ stdenv.mkDerivation rec { "-Dgl-graphene=disabled" # not packaged in nixpkgs as of writing # See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices "-Dgl_winsys=${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}" - "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-Dtests=disabled" ] diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index c5f836f26a4..d867a8f04d3 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -16,7 +16,6 @@ , bash-completion , lib , CoreServices -, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform , gobject-introspection }: @@ -38,6 +37,10 @@ stdenv.mkDerivation rec { sha256 = "0cghi6n4nhdbajz3wqcgbh5xm94myvnqgsi9g2bz9n1s9904l2fy"; }; + depsBuildBuild = [ + pkg-config + ]; + strictDeps = true; nativeBuildInputs = [ meson @@ -50,13 +53,12 @@ stdenv.mkDerivation rec { makeWrapper glib bash-completion + gobject-introspection # documentation # TODO add hotdoc here ] ++ lib.optionals stdenv.isLinux [ libcap # for setcap binary - ] ++ lib.optionals withIntrospection [ - gobject-introspection ]; buildInputs = [ @@ -65,8 +67,6 @@ stdenv.mkDerivation rec { libcap libunwind elfutils - ] ++ lib.optionals withIntrospection [ - gobject-introspection ] ++ lib.optionals stdenv.isDarwin [ CoreServices ]; @@ -79,7 +79,6 @@ stdenv.mkDerivation rec { "-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those "-Dexamples=disabled" # requires many dependencies and probably not useful for our users "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing - "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" ] ++ lib.optionals stdenv.isDarwin [ # darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it. "-Dlibunwind=disabled" diff --git a/pkgs/development/libraries/gstreamer/devtools/default.nix b/pkgs/development/libraries/gstreamer/devtools/default.nix index 31c25648cc7..3b39fa4439a 100644 --- a/pkgs/development/libraries/gstreamer/devtools/default.nix +++ b/pkgs/development/libraries/gstreamer/devtools/default.nix @@ -26,6 +26,10 @@ stdenv.mkDerivation rec { # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs ]; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ meson ninja @@ -49,8 +53,6 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Dintrospection=disabled" ]; meta = with lib; { diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix index 50acba29d67..fa7ea35bcdf 100644 --- a/pkgs/development/libraries/gstreamer/ges/default.nix +++ b/pkgs/development/libraries/gstreamer/ges/default.nix @@ -55,8 +55,6 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Dintrospection=disabled" ]; postPatch = '' diff --git a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix index 679560e8ee1..1a1b136b0ca 100644 --- a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix +++ b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix @@ -46,8 +46,6 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dexamples=disabled" # requires many dependencies and probably not useful for our users "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Dintrospection=disabled" ]; postPatch = '' -- cgit 1.4.1 From c5d7fc0b3cfa92f7b0442b1828495d46ccee52ba Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 7 Jul 2022 21:31:10 +0300 Subject: python310Packages.pygobject3: fix cross --- pkgs/development/python-modules/pygobject/3.nix | 15 ++++++++++++++- pkgs/top-level/python-packages.nix | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix index 447d49a9442..199435c935c 100644 --- a/pkgs/development/python-modules/pygobject/3.nix +++ b/pkgs/development/python-modules/pygobject/3.nix @@ -12,6 +12,7 @@ , ninja , isPy3k , gnome +, python }: buildPythonPackage rec { @@ -29,6 +30,10 @@ buildPythonPackage rec { sha256 = "HzS192JN415E61p+tCg1MoW9AwBNVRMaX39/qbkPPMk="; }; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ pkg-config meson @@ -37,8 +42,9 @@ buildPythonPackage rec { ]; buildInputs = [ - glib + # # .so files link to these gobject-introspection + glib ] ++ lib.optionals stdenv.isDarwin [ ncurses ]; @@ -48,6 +54,13 @@ buildPythonPackage rec { cairo ]; + mesonFlags = [ + # This is only used for figuring out what version of Python is in + # use, and related stuff like figuring out what the install prefix + # should be, but it does need to be able to execute Python code. + "-Dpython=${python.pythonForBuild.interpreter}" + ]; + passthru = { updateScript = gnome.updateScript { packageName = pname; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0006a47025e..8e42b113688 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7472,7 +7472,8 @@ in { pygobject2 = callPackage ../development/python-modules/pygobject { }; pygobject3 = callPackage ../development/python-modules/pygobject/3.nix { - inherit (pkgs) meson; + # inherit (pkgs) meson won't work because it won't be spliced + inherit (pkgs.buildPackages) meson; }; pygogo = callPackage ../development/python-modules/pygogo { }; -- cgit 1.4.1 From 28ca82a86bbead53b1a5724bbb96a6dc88dfbde3 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 7 Jul 2022 21:31:52 +0300 Subject: libgudev: dont specialcase cross and pull patch to not have to have vala in both nativeBuildInputs and buildInputs https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/27 > build: let meson handle gir, vala, gtk-doc dependencies > gnome.generate_gir > gnome.generate_vapi > gnome.gtkdoc > > all do their own dependency finding in a cross-compilation friendly manner while > using dependency() with the default options does not > > fixes finding vapigen while cross-compiling --- pkgs/development/libraries/libgudev/default.nix | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/libgudev/default.nix b/pkgs/development/libraries/libgudev/default.nix index 6a63947c8a5..59df64e6355 100644 --- a/pkgs/development/libraries/libgudev/default.nix +++ b/pkgs/development/libraries/libgudev/default.nix @@ -7,8 +7,8 @@ , glib , gnome , vala -, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform) , gobject-introspection +, fetchpatch }: stdenv.mkDerivation rec { @@ -22,6 +22,25 @@ stdenv.mkDerivation rec { sha256 = "1al6nr492nzbm8ql02xhzwci2kwb1advnkaky3j9636jf08v41hd"; }; + patches = [ + # https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/27 + (fetchpatch { + name = "gir-dep"; + url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/6bdde16a0cfde462502fce1d9a7eb6ec33f388bb.diff"; + sha256 = "sha256-bDtLUxOLEgyJURshqEQC4YCBTUVzQQP4qoWL786b3Z8="; + }) + (fetchpatch { + name = "vapi-dep"; + url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/d1f6457910842ba869c9871e7a2131fbe0d6b6be.diff"; + sha256 = "sha256-/PY8ziZST/vQvksJm69a3O6/YesknIxCDvj0z40piik="; + }) + (fetchpatch { + name = "gtk-doc-dep"; + url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/34336cbadbcaac8b9b029f730eed0bdf4c633617.diff"; + sha256 = "sha256-Bk05xe69LGqWH1uhLMZhwbVMSsCTyBrrOvqWic2TTd4="; + }) + ]; + strictDeps = true; depsBuildBuild = [ pkg-config ]; @@ -32,7 +51,6 @@ stdenv.mkDerivation rec { ninja vala glib # for glib-mkenums needed during the build - ] ++ lib.optionals withIntrospection [ gobject-introspection ]; @@ -44,9 +62,6 @@ stdenv.mkDerivation rec { mesonFlags = [ # There's a dependency cycle with umockdev and the tests fail to LD_PRELOAD anyway "-Dtests=disabled" - "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Dvapi=disabled" ]; passthru = { -- cgit 1.4.1 From 1bd8727a4ca5cd4ed33a3e9349a42637f0f3a3bc Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 7 Jul 2022 21:34:37 +0300 Subject: various: enable gobject-introspection when cross-compiling and fix cross in some --- pkgs/development/libraries/atk/default.nix | 4 --- pkgs/development/libraries/gdk-pixbuf/default.nix | 31 ++++++++++------------- pkgs/development/libraries/geoclue/default.nix | 3 +++ pkgs/development/libraries/gtk/3.x.nix | 1 - pkgs/development/libraries/harfbuzz/default.nix | 9 ++++--- pkgs/development/libraries/json-glib/default.nix | 27 +++++++++++--------- pkgs/development/libraries/libical/default.nix | 12 +++------ pkgs/development/libraries/libmanette/default.nix | 3 +++ pkgs/development/libraries/libsecret/default.nix | 4 +++ pkgs/development/libraries/libsoup/default.nix | 24 ++++++++++-------- pkgs/development/libraries/neon/default.nix | 4 +++ pkgs/development/libraries/opencv/4.x.nix | 5 ++++ pkgs/development/libraries/pango/default.nix | 27 +++++++++++--------- pkgs/development/libraries/polkit/default.nix | 19 +++++++------- pkgs/development/libraries/tracker/default.nix | 31 +++++++++++++++-------- 15 files changed, 115 insertions(+), 89 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix index ce3352b5751..3b8c9a27d03 100644 --- a/pkgs/development/libraries/atk/default.nix +++ b/pkgs/development/libraries/atk/default.nix @@ -44,10 +44,6 @@ stdenv.mkDerivation rec { glib ]; - mesonFlags = [ - "-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" - ]; - doCheck = true; passthru = { diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index cbed6a62a3c..93fb05a13b6 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -16,22 +16,18 @@ , libjpeg , libpng , gnome +, gobject-introspection +, buildPackages , doCheck ? false , makeWrapper , lib -, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform) -, gobject-introspection }: -let - withGtkDoc = stdenv.buildPlatform == stdenv.hostPlatform; -in stdenv.mkDerivation rec { pname = "gdk-pixbuf"; version = "2.42.8"; - outputs = [ "out" "dev" "man" ] - ++ lib.optional withGtkDoc "devdoc" + outputs = [ "out" "dev" "man" "devdoc" ] ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests"; src = fetchurl { @@ -60,6 +56,7 @@ stdenv.mkDerivation rec { makeWrapper glib gi-docgen + gobject-introspection # for man pages libxslt @@ -67,8 +64,6 @@ stdenv.mkDerivation rec { docbook_xml_dtd_43 ] ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames - ] ++ lib.optionals withIntrospection [ - gobject-introspection ]; propagatedBuildInputs = [ @@ -79,9 +74,8 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=${lib.boolToString withGtkDoc}" - "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" "-Dgio_sniffing=false" + "-Dgtk_doc=true" ]; postPatch = '' @@ -89,10 +83,13 @@ stdenv.mkDerivation rec { patchShebangs build-aux substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests" - ''; - preInstall = '' - PATH=$PATH:$out/bin # for install script + # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) + # it should be a build-time dep for build + # TODO: send upstream + substituteInPlace docs/meson.build \ + --replace "dependency('gi-docgen'," "dependency('gi-docgen', native:true," \ + --replace "'gi-docgen', req" "'gi-docgen', native:true, req" ''; postInstall = @@ -108,9 +105,9 @@ stdenv.mkDerivation rec { install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f mv $f ''${f%.dylib}.so done - '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + '' + '' # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/ - $dev/bin/gdk-pixbuf-query-loaders --update-cache + ${stdenv.hostPlatform.emulator buildPackages} $dev/bin/gdk-pixbuf-query-loaders --update-cache ''; # The fixDarwinDylibNames hook doesn't patch binaries. @@ -120,7 +117,7 @@ stdenv.mkDerivation rec { done ''; - postFixup = lib.optionalString withGtkDoc '' + postFixup = '' # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. moveToOutput "share/doc" "$devdoc" ''; diff --git a/pkgs/development/libraries/geoclue/default.nix b/pkgs/development/libraries/geoclue/default.nix index 39156c95949..f3d4ce1aa7b 100644 --- a/pkgs/development/libraries/geoclue/default.nix +++ b/pkgs/development/libraries/geoclue/default.nix @@ -4,6 +4,7 @@ , fetchpatch , intltool , meson +, mesonEmulatorHook , ninja , pkg-config , gtk-doc @@ -74,6 +75,8 @@ stdenv.mkDerivation rec { gtk-doc docbook-xsl-nons docbook_xml_dtd_412 + ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook ]; buildInputs = [ diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index f3f3f0c108a..b69f6164aca 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -158,7 +158,6 @@ stdenv.mkDerivation rec { "-Dbroadway_backend=${lib.boolToString broadwaySupport}" "-Dx11_backend=${lib.boolToString x11Support}" "-Dquartz_backend=${lib.boolToString (stdenv.isDarwin && !x11Support)}" - "-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" ]; doCheck = false; # needs X11 diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix index b7ba05bb79b..49dba7c6580 100644 --- a/pkgs/development/libraries/harfbuzz/default.nix +++ b/pkgs/development/libraries/harfbuzz/default.nix @@ -34,7 +34,6 @@ let inherit (lib) optional optionals optionalString; mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}"; - isNativeCompilation = stdenv.buildPlatform == stdenv.hostPlatform; in stdenv.mkDerivation { @@ -70,7 +69,10 @@ stdenv.mkDerivation { (mesonFeatureFlag "coretext" withCoreText) (mesonFeatureFlag "graphite" withGraphite2) (mesonFeatureFlag "icu" withIcu) - (mesonFeatureFlag "introspection" isNativeCompilation) + ]; + + depsBuildBuild = [ + pkg-config ]; nativeBuildInputs = [ @@ -86,8 +88,7 @@ stdenv.mkDerivation { ]; buildInputs = [ glib freetype ] - ++ lib.optionals withCoreText [ ApplicationServices CoreText ] - ++ lib.optionals isNativeCompilation [ gobject-introspection ]; + ++ lib.optionals withCoreText [ ApplicationServices CoreText ]; propagatedBuildInputs = optional withGraphite2 graphite2 ++ optionals withIcu [ icu harfbuzz ]; diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix index e041908f3f4..e1676a69551 100644 --- a/pkgs/development/libraries/json-glib/default.nix +++ b/pkgs/development/libraries/json-glib/default.nix @@ -6,10 +6,10 @@ , ninja , pkg-config , gettext -, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform , gobject-introspection -, fixDarwinDylibNames , gi-docgen +, libxslt +, fixDarwinDylibNames , gnome }: @@ -17,8 +17,7 @@ stdenv.mkDerivation rec { pname = "json-glib"; version = "1.6.6"; - outputs = [ "out" "dev" ] - ++ lib.optional withIntrospection "devdoc"; + outputs = [ "out" "dev" "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -37,22 +36,26 @@ stdenv.mkDerivation rec { pkg-config gettext glib - ] ++ lib.optional stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ] ++ lib.optionals withIntrospection [ + libxslt gobject-introspection gi-docgen + ] ++ lib.optional stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames ]; propagatedBuildInputs = [ glib ]; - mesonFlags = lib.optionals (!withIntrospection) [ - "-Dintrospection=disabled" - # gi-docgen relies on introspection data - "-Dgtk_doc=disabled" - ]; + + # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) + # it should be a build-time dep for build + # TODO: send upstream + postPatch = '' + substituteInPlace doc/meson.build \ + --replace "'gi-docgen', ver" "'gi-docgen', native:true, ver" \ + --replace "'gi-docgen', req" "'gi-docgen', native:true, req" + ''; doCheck = true; diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix index 48e611a3482..435d1cc9bc0 100644 --- a/pkgs/development/libraries/libical/default.nix +++ b/pkgs/development/libraries/libical/default.nix @@ -13,7 +13,6 @@ , python3 , tzdata , fixDarwinDylibNames -, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform , gobject-introspection , vala }: @@ -37,6 +36,8 @@ stdenv.mkDerivation rec { ninja perl pkg-config + gobject-introspection + vala # Docs building fails: # https://github.com/NixOS/nixpkgs/pull/67204 # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 @@ -44,15 +45,12 @@ stdenv.mkDerivation rec { ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ # provides ical-glib-src-generator that runs during build libical - ] ++ lib.optionals withIntrospection [ - gobject-introspection - vala ] ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ]; installCheckInputs = [ # running libical-glib tests - (python3.withPackages (pkgs: with pkgs; [ + (python3.pythonForBuild.withPackages (pkgs: with pkgs; [ pygobject3 ])) ]; @@ -61,14 +59,10 @@ stdenv.mkDerivation rec { glib libxml2 icu - ] ++ lib.optionals withIntrospection [ - gobject-introspection ]; cmakeFlags = [ "-DENABLE_GTK_DOC=False" - "-DGOBJECT_INTROSPECTION=${if withIntrospection then "True" else "False"}" - "-DICAL_GLIB_VAPI=${if withIntrospection then "True" else "False"}" ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev buildPackages.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake" ]; diff --git a/pkgs/development/libraries/libmanette/default.nix b/pkgs/development/libraries/libmanette/default.nix index 645b521b817..7629dd8a6f1 100644 --- a/pkgs/development/libraries/libmanette/default.nix +++ b/pkgs/development/libraries/libmanette/default.nix @@ -2,6 +2,7 @@ , fetchurl , ninja , meson +, mesonEmulatorHook , pkg-config , vala , gobject-introspection @@ -34,6 +35,8 @@ stdenv.mkDerivation rec { gtk-doc docbook-xsl-nons docbook_xml_dtd_43 + ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook ]; buildInputs = [ diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix index b04012cec28..7378d62d677 100644 --- a/pkgs/development/libraries/libsecret/default.nix +++ b/pkgs/development/libraries/libsecret/default.nix @@ -31,6 +31,10 @@ stdenv.mkDerivation rec { sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00="; }; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ meson ninja diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix index 83fb0c4a029..ea91173540e 100644 --- a/pkgs/development/libraries/libsoup/default.nix +++ b/pkgs/development/libraries/libsoup/default.nix @@ -8,16 +8,13 @@ , pkg-config , gnome , libsysprof-capture -, gnomeSupport ? true -, sqlite -, glib-networking , gobject-introspection -, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform , vala -, withVala ? stdenv.buildPlatform == stdenv.hostPlatform , libpsl -, python3 , brotli +, gnomeSupport ? true +, sqlite +, glib-networking }: stdenv.mkDerivation rec { @@ -31,19 +28,20 @@ stdenv.mkDerivation rec { sha256 = "sha256-8KQnZW5f4Z4d9xwQfojfobLmc8JcVHt4I7YBi0DQEVk="; }; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ meson ninja pkg-config glib - ] ++ lib.optionals withIntrospection [ gobject-introspection - ] ++ lib.optionals withVala [ vala ]; buildInputs = [ - python3 sqlite libpsl glib.out @@ -60,8 +58,6 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency "-Dgssapi=disabled" - "-Dvapi=${if withVala then "enabled" else "disabled"}" - "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" "-Dgnome=${lib.boolToString gnomeSupport}" "-Dntlm=disabled" ] ++ lib.optionals (!stdenv.isLinux) [ @@ -73,6 +69,12 @@ stdenv.mkDerivation rec { doCheck = false; # ERROR:../tests/socket-test.c:37:do_unconnected_socket_test: assertion failed (res == SOUP_STATUS_OK): (2 == 200) postPatch = '' + # fixes finding vapigen when cross-compiling + # the commit is in 3.0.6 + # https://gitlab.gnome.org/GNOME/libsoup/-/commit/5280e936d0a76f94dbc5d8489cfbdc0a06343f65 + substituteInPlace meson.build \ + --replace "required: vapi_opt)" "required: vapi_opt, native: false)" + patchShebangs libsoup/ ''; diff --git a/pkgs/development/libraries/neon/default.nix b/pkgs/development/libraries/neon/default.nix index 1521c1a6389..5250dcddf84 100644 --- a/pkgs/development/libraries/neon/default.nix +++ b/pkgs/development/libraries/neon/default.nix @@ -35,6 +35,10 @@ stdenv.mkDerivation rec { (lib.withFeature sslSupport "ssl") ]; + preConfigure = '' + export PKG_CONFIG="$(command -v "$PKG_CONFIG")" + ''; + passthru = {inherit compressionSupport sslSupport;}; meta = with lib; { diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index c84740ebcdc..edc8acaa92b 100644 --- a/pkgs/development/libraries/opencv/4.x.nix +++ b/pkgs/development/libraries/opencv/4.x.nix @@ -13,6 +13,7 @@ , protobuf , config , ocl-icd +, buildPackages , enableJPEG ? true , libjpeg @@ -291,11 +292,15 @@ stdenv.mkDerivation { "-DOPENCV_GENERATE_PKGCONFIG=ON" "-DWITH_OPENMP=ON" "-DBUILD_PROTOBUF=OFF" + "-DProtobuf_PROTOC_EXECUTABLE=${lib.getExe buildPackages.protobuf}" "-DPROTOBUF_UPDATE_FILES=ON" "-DOPENCV_ENABLE_NONFREE=${printEnabled enableUnfree}" "-DBUILD_TESTS=OFF" "-DBUILD_PERF_TESTS=OFF" "-DBUILD_DOCS=${printEnabled enableDocs}" + # "OpenCV disables pkg-config to avoid using of host libraries. Consider using PKG_CONFIG_LIBDIR to specify target SYSROOT" + # but we have proper separation of build and host libs :), fixes cross + "-DOPENCV_ENABLE_PKG_CONFIG=ON" (opencvFlag "IPP" enableIpp) (opencvFlag "TIFF" enableTIFF) (opencvFlag "WEBP" enableWebP) diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix index 13dd24b5482..16db7be3135 100644 --- a/pkgs/development/libraries/pango/default.nix +++ b/pkgs/development/libraries/pango/default.nix @@ -16,26 +16,21 @@ , ninja , glib , python3 -, x11Support? !stdenv.isDarwin, libXft -, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform) , gobject-introspection -, withDocs ? (stdenv.buildPlatform == stdenv.hostPlatform) +, x11Support? !stdenv.isDarwin, libXft }: stdenv.mkDerivation rec { pname = "pango"; version = "1.50.7"; - outputs = [ "bin" "out" "dev" ] - ++ lib.optionals withDocs [ "devdoc" ]; + outputs = [ "bin" "out" "dev" "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "BHfzaaPUxpXfcpmmmJ3ABHVqf03ifuysQFxnkLfjrTM="; }; - strictDeps = !withIntrospection; - depsBuildBuild = [ pkg-config ]; @@ -44,9 +39,7 @@ stdenv.mkDerivation rec { meson ninja glib # for glib-mkenum pkg-config - ] ++ lib.optionals withIntrospection [ gobject-introspection - ] ++ lib.optionals withDocs [ gi-docgen python3 ]; @@ -71,8 +64,7 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=${lib.boolToString withDocs}" - "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" + "-Dgtk_doc=true" ] ++ lib.optionals (!x11Support) [ "-Dxft=disabled" # only works with x11 ]; @@ -82,9 +74,20 @@ stdenv.mkDerivation rec { fontDirectories = [ freefont_ttf ]; }; + # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) + # it should be a build-time dep for build + # TODO: send upstream + postPatch = '' + substituteInPlace meson.build \ + --replace "dependency('gi-docgen', ver" "dependency('gi-docgen', native:true, ver" + + substituteInPlace docs/meson.build \ + --replace "'gi-docgen', req" "'gi-docgen', native:true, req" + ''; + doCheck = false; # test-font: FAIL - postFixup = lib.optionalString withDocs '' + postFixup = '' # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. moveToOutput "share/doc" "$devdoc" ''; diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix index 9c49f89c2ca..9fb61b1245a 100644 --- a/pkgs/development/libraries/polkit/default.nix +++ b/pkgs/development/libraries/polkit/default.nix @@ -6,6 +6,7 @@ , expat , pam , meson +, mesonEmulatorHook , ninja , perl , rsync @@ -23,10 +24,6 @@ , useSystemd ? stdenv.isLinux , systemd , elogind -# needed until gobject-introspection does cross-compile (https://github.com/NixOS/nixpkgs/pull/88222) -, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform) -# cross build fails on polkit-1-scan (https://github.com/NixOS/nixpkgs/pull/152704) -, withGtkDoc ? (stdenv.buildPlatform == stdenv.hostPlatform) # A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault). # Not yet investigated; it may be due to the "Make netgroup support optional" # patch not updating the tests correctly yet, or doing something wrong, @@ -88,6 +85,10 @@ stdenv.mkDerivation rec { }) ]; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ glib gtk-doc @@ -97,7 +98,8 @@ stdenv.mkDerivation rec { ninja perl rsync - (python3.withPackages (pp: with pp; [ + gobject-introspection + (python3.pythonForBuild.withPackages (pp: with pp; [ dbus-python (python-dbusmock.overridePythonAttrs (attrs: { # Avoid dependency cycle. @@ -109,17 +111,18 @@ stdenv.mkDerivation rec { libxslt docbook-xsl-nons docbook_xml_dtd_412 + ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook ]; buildInputs = [ expat pam spidermonkey_78 + dbus ] ++ lib.optionals stdenv.isLinux [ # On Linux, fall back to elogind when systemd support is off. (if useSystemd then systemd else elogind) - ] ++ lib.optionals withIntrospection [ - gobject-introspection ]; propagatedBuildInputs = [ @@ -136,9 +139,7 @@ stdenv.mkDerivation rec { "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system" "-Dpolkitd_user=polkituser" #TODO? config.ids.uids.polkituser "-Dos_type=redhat" # only affects PAM includes - "-Dintrospection=${lib.boolToString withIntrospection}" "-Dtests=${lib.boolToString doCheck}" - "-Dgtk_doc=${lib.boolToString withGtkDoc}" "-Dman=true" ] ++ lib.optionals stdenv.isLinux [ "-Dsession_tracking=${if useSystemd then "libsystemd-login" else "libelogind"}" diff --git a/pkgs/development/libraries/tracker/default.nix b/pkgs/development/libraries/tracker/default.nix index 835f38ff509..fe7bcbf3a54 100644 --- a/pkgs/development/libraries/tracker/default.nix +++ b/pkgs/development/libraries/tracker/default.nix @@ -25,6 +25,7 @@ , json-glib , systemd , dbus +, writeText }: stdenv.mkDerivation rec { @@ -46,6 +47,10 @@ stdenv.mkDerivation rec { patchShebangs utils/data-generators/cc/generate ''; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ meson ninja @@ -58,11 +63,8 @@ stdenv.mkDerivation rec { gobject-introspection docbook-xsl-nons docbook_xml_dtd_45 - python3 # for data-generators - systemd # used for checks to install systemd user service - dbus # used for checks and pkg-config to install dbus service/s - ] ++ checkInputs; # gi is in the main meson.build and checked regardless of - # whether tests are enabled + (python3.pythonForBuild.withPackages (p: [ p.pygobject3 ])) + ]; buildInputs = [ glib @@ -74,15 +76,24 @@ stdenv.mkDerivation rec { libuuid json-glib libstemmer - ]; - - checkInputs = with python3.pkgs; [ - pygobject3 + dbus + systemd ]; mesonFlags = [ "-Ddocs=true" - ]; + ] ++ ( + let + # https://gitlab.gnome.org/GNOME/tracker/-/blob/master/meson.build#L159 + crossFile = writeText "cross-file.conf" '' + [properties] + sqlite3_has_fts5 = '${lib.boolToString (lib.hasInfix "-DSQLITE_ENABLE_FTS3" sqlite.NIX_CFLAGS_COMPILE)}' + ''; + in + [ + "--cross-file=${crossFile}" + ] + ); doCheck = true; -- cgit 1.4.1 From eb829035c938022bb064faef56a7b1346443e034 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 12 Jul 2022 15:10:40 +0300 Subject: gobject-introspection: do not propagate target gobject-introspection in wrapper broke modemmanager and some of its deps libqmi-aarch64-unknown-linux-gnu> GISCAN Qmi-1.0.gir libqmi-aarch64-unknown-linux-gnu> /build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/.libs/Qmi-1.0: error while loading shared libraries: libqmi-glib.so.5: cannot open shared object file: No such file or directory libqmi-aarch64-unknown-linux-gnu> Command '['/nix/store/wr4mjr9gadvwz6c88fgz4ldzn21sxkpz-qemu-7.0.0/bin/qemu-aarch64', '/build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/.libs/Qmi-1.0', '--introspect-dump=/build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/functions.txt,/build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/dump.xml']' returned non-zero exit status 127. libqmi-aarch64-unknown-linux-gnu> make[4]: *** [/nix/store/jwpcacx8sd4vj0ckk5wxrzn2iwcpp35s-gobject-introspection-aarch64-unknown-linux-gnu-1.72.0-dev/share/gobject-introspection-1.0/Makefile.introspection:156: Qmi-1.0.gir] Error 1 --- pkgs/development/libraries/gobject-introspection/wrapper.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/gobject-introspection/wrapper.nix b/pkgs/development/libraries/gobject-introspection/wrapper.nix index e71f2f2fb46..46000073205 100644 --- a/pkgs/development/libraries/gobject-introspection/wrapper.nix +++ b/pkgs/development/libraries/gobject-introspection/wrapper.nix @@ -9,7 +9,6 @@ # `nix build ".#pkgsCross.aarch64-multiplatform.buildPackages.gobject-introspection"` gobject-introspection-unwrapped.overrideAttrs (previousAttrs: { pname = "gobject-introspection-wrapped"; - depsTargetTargetPropagated = [ gobject-introspection-unwrapped ]; # failure in e.g. pkgsCross.aarch64-multiplatform.polkit # subprocess.CalledProcessError: Command '['/nix/store/...-prelink-unstable-2019-06-24/bin/prelink-rtld', '/build/source/build/tmp-introspectzp2ldkyk/PolkitAgent-1.0']' returned non-zero exit status 127. patches = previousAttrs.patches ++ [ ./giscanner-ignore-error-return-codes-from-ldd-wrapper.patch ]; -- cgit 1.4.1 From 20642e2ab0c278f1e51ca2e63ec0836f91b5451d Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 12 Jul 2022 15:17:11 +0300 Subject: various: readd gobject-introspection to buildInputs see eb829035c938022bb064faef56a7b1346443e034 --- pkgs/development/libraries/atk/default.nix | 2 ++ pkgs/development/libraries/gdk-pixbuf/default.nix | 2 ++ pkgs/development/libraries/geoclue/default.nix | 1 + pkgs/development/libraries/gstreamer/bad/default.nix | 1 + pkgs/development/libraries/gstreamer/base/default.nix | 1 + pkgs/development/libraries/gstreamer/core/default.nix | 1 + pkgs/development/libraries/gstreamer/devtools/default.nix | 1 + pkgs/development/libraries/gstreamer/ges/default.nix | 1 + pkgs/development/libraries/gstreamer/rtsp-server/default.nix | 1 + pkgs/development/libraries/gtk/3.x.nix | 1 + pkgs/development/libraries/harfbuzz/default.nix | 2 +- pkgs/development/libraries/json-glib/default.nix | 2 ++ pkgs/development/libraries/libgudev/default.nix | 1 + pkgs/development/libraries/libical/default.nix | 1 + pkgs/development/libraries/libmanette/default.nix | 1 + pkgs/development/libraries/libsecret/default.nix | 1 + pkgs/development/libraries/libsoup/default.nix | 1 + pkgs/development/libraries/pango/default.nix | 1 + pkgs/development/libraries/polkit/default.nix | 1 + pkgs/development/libraries/tracker/default.nix | 1 + pkgs/tools/networking/networkmanager/default.nix | 1 + 21 files changed, 24 insertions(+), 1 deletion(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix index 3b8c9a27d03..268bf43eb3e 100644 --- a/pkgs/development/libraries/atk/default.nix +++ b/pkgs/development/libraries/atk/default.nix @@ -39,6 +39,8 @@ stdenv.mkDerivation rec { fixDarwinDylibNames ]; + buildInputs = [ gobject-introspection ]; + propagatedBuildInputs = [ # Required by atk.pc glib diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index 93fb05a13b6..ff8ace9613f 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -66,6 +66,8 @@ stdenv.mkDerivation rec { fixDarwinDylibNames ]; + buildInputs = [ gobject-introspection ]; + propagatedBuildInputs = [ glib libtiff diff --git a/pkgs/development/libraries/geoclue/default.nix b/pkgs/development/libraries/geoclue/default.nix index f3d4ce1aa7b..7756f6169cc 100644 --- a/pkgs/development/libraries/geoclue/default.nix +++ b/pkgs/development/libraries/geoclue/default.nix @@ -84,6 +84,7 @@ stdenv.mkDerivation rec { json-glib libsoup avahi + gobject-introspection ] ++ lib.optionals withDemoAgent [ libnotify gdk-pixbuf ] ++ lib.optionals (!stdenv.isDarwin) [ diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index 152904a8e7a..6d940362a21 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -121,6 +121,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection gst-plugins-base orc json-glib diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index b0aed54d9b4..c9e9c7f3248 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -69,6 +69,7 @@ stdenv.mkDerivation rec { ] ++ lib.optional enableWayland wayland; buildInputs = [ + gobject-introspection orc libtheora libintl diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index d867a8f04d3..662c3281b03 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -63,6 +63,7 @@ stdenv.mkDerivation rec { buildInputs = [ bash-completion + gobject-introspection ] ++ lib.optionals stdenv.isLinux [ libcap libunwind diff --git a/pkgs/development/libraries/gstreamer/devtools/default.nix b/pkgs/development/libraries/gstreamer/devtools/default.nix index 3b39fa4439a..acb12b78341 100644 --- a/pkgs/development/libraries/gstreamer/devtools/default.nix +++ b/pkgs/development/libraries/gstreamer/devtools/default.nix @@ -44,6 +44,7 @@ stdenv.mkDerivation rec { cairo python3 json-glib + gobject-introspection ]; propagatedBuildInputs = [ diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix index fa7ea35bcdf..9d6f3c0f483 100644 --- a/pkgs/development/libraries/gstreamer/ges/default.nix +++ b/pkgs/development/libraries/gstreamer/ges/default.nix @@ -46,6 +46,7 @@ stdenv.mkDerivation rec { buildInputs = [ bash-completion libxml2 + gobject-introspection ]; propagatedBuildInputs = [ diff --git a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix index 1a1b136b0ca..8fe79bb7b8b 100644 --- a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix +++ b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix @@ -41,6 +41,7 @@ stdenv.mkDerivation rec { buildInputs = [ gst-plugins-base gst-plugins-bad + gobject-introspection ]; mesonFlags = [ diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index b69f6164aca..c06aa946993 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -110,6 +110,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection libxkbcommon (libepoxy.override { inherit x11Support; }) isocodes diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix index 49dba7c6580..20323796e9d 100644 --- a/pkgs/development/libraries/harfbuzz/default.nix +++ b/pkgs/development/libraries/harfbuzz/default.nix @@ -87,7 +87,7 @@ stdenv.mkDerivation { docbook_xml_dtd_43 ]; - buildInputs = [ glib freetype ] + buildInputs = [ glib freetype gobject-introspection ] ++ lib.optionals withCoreText [ ApplicationServices CoreText ]; propagatedBuildInputs = optional withGraphite2 graphite2 diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix index e1676a69551..1f8f4fd1acc 100644 --- a/pkgs/development/libraries/json-glib/default.nix +++ b/pkgs/development/libraries/json-glib/default.nix @@ -43,6 +43,8 @@ stdenv.mkDerivation rec { fixDarwinDylibNames ]; + buildInputs = [ gobject-introspection ]; + propagatedBuildInputs = [ glib ]; diff --git a/pkgs/development/libraries/libgudev/default.nix b/pkgs/development/libraries/libgudev/default.nix index 59df64e6355..799e1d0f845 100644 --- a/pkgs/development/libraries/libgudev/default.nix +++ b/pkgs/development/libraries/libgudev/default.nix @@ -55,6 +55,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection udev glib ]; diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix index 435d1cc9bc0..3656d2991a8 100644 --- a/pkgs/development/libraries/libical/default.nix +++ b/pkgs/development/libraries/libical/default.nix @@ -59,6 +59,7 @@ stdenv.mkDerivation rec { glib libxml2 icu + gobject-introspection ]; cmakeFlags = [ diff --git a/pkgs/development/libraries/libmanette/default.nix b/pkgs/development/libraries/libmanette/default.nix index 7629dd8a6f1..2320aa78bba 100644 --- a/pkgs/development/libraries/libmanette/default.nix +++ b/pkgs/development/libraries/libmanette/default.nix @@ -40,6 +40,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection glib libgudev libevdev diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix index 7378d62d677..24a34a92f3c 100644 --- a/pkgs/development/libraries/libsecret/default.nix +++ b/pkgs/development/libraries/libsecret/default.nix @@ -52,6 +52,7 @@ stdenv.mkDerivation rec { buildInputs = [ libgcrypt + gobject-introspection ]; propagatedBuildInputs = [ diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix index ea91173540e..9976f4109f0 100644 --- a/pkgs/development/libraries/libsoup/default.nix +++ b/pkgs/development/libraries/libsoup/default.nix @@ -42,6 +42,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection sqlite libpsl glib.out diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix index 16db7be3135..4f5f84702f9 100644 --- a/pkgs/development/libraries/pango/default.nix +++ b/pkgs/development/libraries/pango/default.nix @@ -47,6 +47,7 @@ stdenv.mkDerivation rec { buildInputs = [ fribidi libthai + gobject-introspection ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices Carbon diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix index 9fb61b1245a..ff025fb5210 100644 --- a/pkgs/development/libraries/polkit/default.nix +++ b/pkgs/development/libraries/polkit/default.nix @@ -116,6 +116,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection expat pam spidermonkey_78 diff --git a/pkgs/development/libraries/tracker/default.nix b/pkgs/development/libraries/tracker/default.nix index fe7bcbf3a54..a643fd6e415 100644 --- a/pkgs/development/libraries/tracker/default.nix +++ b/pkgs/development/libraries/tracker/default.nix @@ -67,6 +67,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection glib libxml2 sqlite diff --git a/pkgs/tools/networking/networkmanager/default.nix b/pkgs/tools/networking/networkmanager/default.nix index c170ed10287..2d4e11f5b99 100644 --- a/pkgs/tools/networking/networkmanager/default.nix +++ b/pkgs/tools/networking/networkmanager/default.nix @@ -143,6 +143,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + gobject-introspection systemd libselinux audit -- cgit 1.4.1