Merge pull request #177538 from Artturin/fixcross3

This commit is contained in:
Artturi 2022-07-12 16:14:46 +03:00 committed by GitHub
commit 4427b7dfab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 283 additions and 148 deletions

View file

@ -155,14 +155,14 @@ doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
#### Package using Meson needs to run binaries for the host platform during build. {#cross-meson-runs-host-code}
Add `mesonEmulatorHook` cross conditionally to `nativeBuildInputs`.
Add `mesonEmulatorHook` to `nativeBuildInputs` conditionally on if the target binaries can be executed.
e.g.
```
nativeBuildInputs = [
meson
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];
```

View file

@ -39,15 +39,13 @@ stdenv.mkDerivation rec {
fixDarwinDylibNames
];
buildInputs = [ gobject-introspection ];
propagatedBuildInputs = [
# Required by atk.pc
glib
];
mesonFlags = [
"-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
];
doCheck = true;
passthru = {

View file

@ -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,10 +64,10 @@ stdenv.mkDerivation rec {
docbook_xml_dtd_43
] ++ lib.optionals stdenv.isDarwin [
fixDarwinDylibNames
] ++ lib.optionals withIntrospection [
gobject-introspection
];
buildInputs = [ gobject-introspection ];
propagatedBuildInputs = [
glib
libtiff
@ -79,9 +76,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 +85,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 +107,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 +119,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"
'';

View file

@ -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 = [
@ -81,6 +84,7 @@ stdenv.mkDerivation rec {
json-glib
libsoup
avahi
gobject-introspection
] ++ lib.optionals withDemoAgent [
libnotify gdk-pixbuf
] ++ lib.optionals (!stdenv.isDarwin) [

View file

@ -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.
'';
};
}
})

View file

@ -0,0 +1,32 @@
From e0fc4a2a5161a36483ddc518be9bb14390f11b19 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
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 <alex.kanavin@gmail.com>
Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
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

View file

@ -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

View file

@ -7,9 +7,12 @@
# 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 = ''
# 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

View file

@ -121,11 +121,9 @@ stdenv.mkDerivation rec {
];
buildInputs = [
gobject-introspection
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 +292,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 [

View file

@ -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,11 +65,11 @@ stdenv.mkDerivation rec {
gstreamer
# docs
# TODO add hotdoc here
] ++ lib.optionals withIntrospection [
gobject-introspection
] ++ lib.optional enableWayland wayland;
buildInputs = [
gobject-introspection
orc
libtheora
libintl
@ -91,8 +93,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 +106,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"
]

View file

@ -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,23 +53,21 @@ 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 = [
bash-completion
gobject-introspection
] ++ lib.optionals stdenv.isLinux [
libcap
libunwind
elfutils
] ++ lib.optionals withIntrospection [
gobject-introspection
] ++ lib.optionals stdenv.isDarwin [
CoreServices
];
@ -79,7 +80,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"

View file

@ -26,6 +26,10 @@ stdenv.mkDerivation rec {
# "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
];
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
meson
ninja
@ -40,6 +44,7 @@ stdenv.mkDerivation rec {
cairo
python3
json-glib
gobject-introspection
];
propagatedBuildInputs = [
@ -49,8 +54,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; {

View file

@ -46,6 +46,7 @@ stdenv.mkDerivation rec {
buildInputs = [
bash-completion
libxml2
gobject-introspection
];
propagatedBuildInputs = [
@ -55,8 +56,6 @@ stdenv.mkDerivation rec {
mesonFlags = [
"-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-Dintrospection=disabled"
];
postPatch = ''

View file

@ -41,13 +41,12 @@ stdenv.mkDerivation rec {
buildInputs = [
gst-plugins-base
gst-plugins-bad
gobject-introspection
];
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 = ''

View file

@ -110,6 +110,7 @@ stdenv.mkDerivation rec {
];
buildInputs = [
gobject-introspection
libxkbcommon
(libepoxy.override { inherit x11Support; })
isocodes
@ -158,7 +159,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

View file

@ -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 = [
@ -85,9 +87,8 @@ stdenv.mkDerivation {
docbook_xml_dtd_43
];
buildInputs = [ glib freetype ]
++ lib.optionals withCoreText [ ApplicationServices CoreText ]
++ lib.optionals isNativeCompilation [ gobject-introspection ];
buildInputs = [ glib freetype gobject-introspection ]
++ lib.optionals withCoreText [ ApplicationServices CoreText ];
propagatedBuildInputs = optional withGraphite2 graphite2
++ optionals withIcu [ icu harfbuzz ];

View file

@ -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,28 @@ 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
];
buildInputs = [ gobject-introspection ];
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;

View file

@ -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,11 +51,11 @@ stdenv.mkDerivation rec {
ninja
vala
glib # for glib-mkenums needed during the build
] ++ lib.optionals withIntrospection [
gobject-introspection
];
buildInputs = [
gobject-introspection
udev
glib
];
@ -44,9 +63,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 = {

View file

@ -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,11 @@ 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"
];

View file

@ -2,6 +2,7 @@
, fetchurl
, ninja
, meson
, mesonEmulatorHook
, pkg-config
, vala
, gobject-introspection
@ -34,9 +35,12 @@ stdenv.mkDerivation rec {
gtk-doc
docbook-xsl-nons
docbook_xml_dtd_43
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];
buildInputs = [
gobject-introspection
glib
libgudev
libevdev

View file

@ -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";

View file

@ -31,6 +31,10 @@ stdenv.mkDerivation rec {
sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00=";
};
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
meson
ninja
@ -48,6 +52,7 @@ stdenv.mkDerivation rec {
buildInputs = [
libgcrypt
gobject-introspection
];
propagatedBuildInputs = [

View file

@ -8,16 +8,13 @@
, pkg-config
, gnome
, libsysprof-capture
, gobject-introspection
, vala
, libpsl
, brotli
, gnomeSupport ? true
, sqlite
, glib-networking
, gobject-introspection
, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
, vala
, withVala ? stdenv.buildPlatform == stdenv.hostPlatform
, libpsl
, python3
, brotli
}:
stdenv.mkDerivation rec {
@ -31,19 +28,21 @@ 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
gobject-introspection
sqlite
libpsl
glib.out
@ -60,8 +59,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 +70,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/
'';

View file

@ -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; {

View file

@ -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)

View file

@ -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
];
@ -54,6 +47,7 @@ stdenv.mkDerivation rec {
buildInputs = [
fribidi
libthai
gobject-introspection
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
ApplicationServices
Carbon
@ -71,8 +65,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 +75,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"
'';

View file

@ -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,19 @@ stdenv.mkDerivation rec {
libxslt
docbook-xsl-nons
docbook_xml_dtd_412
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];
buildInputs = [
gobject-introspection
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 +140,7 @@ stdenv.mkDerivation rec {
"-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
"-Dpolkitd_user=polkituser" #TODO? <nixos> 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"}"

View file

@ -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,13 +63,11 @@ 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 = [
gobject-introspection
glib
libxml2
sqlite
@ -74,15 +77,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;

View file

@ -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;

View file

@ -34,6 +34,7 @@
, iputils
, kmod
, jansson
, elfutils
, gtk-doc
, libxslt
, docbook_xsl
@ -43,14 +44,16 @@
, openconnect
, curl
, meson
, mesonEmulatorHook
, ninja
, libpsl
, mobile-broadband-provider-info
, runtimeShell
, buildPackages
}:
let
pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]);
pythonForDocs = python3.pythonForBuild.withPackages (pkgs: with pkgs; [ pygobject3 ]);
in
stdenv.mkDerivation rec {
pname = "networkmanager";
@ -102,7 +105,9 @@ stdenv.mkDerivation rec {
"-Ddhcpcanon=no"
# Miscellaneous
"-Ddocs=true"
# almost cross-compiles, however fails with
# ** (process:9234): WARNING **: Failed to load shared library '/nix/store/...-networkmanager-aarch64-unknown-linux-gnu-1.38.2/lib/libnm.so.0' referenced by the typelib: /nix/store/...-networkmanager-aarch64-unknown-linux-gnu-1.38.2/lib/libnm.so.0: cannot open shared object file: No such file or directory
"-Ddocs=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
# We don't use firewalld in NixOS
"-Dfirewalld_zone=false"
"-Dtests=no"
@ -138,6 +143,7 @@ stdenv.mkDerivation rec {
];
buildInputs = [
gobject-introspection
systemd
libselinux
audit
@ -150,12 +156,12 @@ stdenv.mkDerivation rec {
mobile-broadband-provider-info
bluez5
dnsmasq
gobject-introspection
modemmanager
readline
newt
libsoup
jansson
dbus # used to get directory paths with pkg-config during configuration
];
propagatedBuildInputs = [ gnutls libgcrypt ];
@ -167,7 +173,7 @@ stdenv.mkDerivation rec {
pkg-config
vala
gobject-introspection
dbus
elfutils # used to find jansson soname
# Docs
gtk-doc
libxslt
@ -176,6 +182,8 @@ stdenv.mkDerivation rec {
docbook_xml_dtd_42
docbook_xml_dtd_43
pythonForDocs
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];
doCheck = false; # requires /sys, the net
@ -183,6 +191,10 @@ stdenv.mkDerivation rec {
postPatch = ''
patchShebangs ./tools
patchShebangs libnm/generate-setting-docs.py
# TODO: submit upstream
substituteInPlace meson.build \
--replace "'vala', req" "'vala', native: false, req"
'';
preBuild = ''
@ -194,6 +206,11 @@ stdenv.mkDerivation rec {
ln -s $PWD/src/libnm-client-impl/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0
'';
postFixup = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp -r ${buildPackages.networkmanager.devdoc} $devdoc
cp -r ${buildPackages.networkmanager.man} $man
'';
passthru = {
updateScript = gnome.updateScript {
packageName = "NetworkManager";

View file

@ -4148,7 +4148,7 @@ with pkgs;
# example of an error which this fixes
# [Errno 8] Exec format error: './gdk3-scan'
mesonEmulatorHook =
if (stdenv.buildPlatform != stdenv.targetPlatform) then
if (!stdenv.buildPlatform.canExecute stdenv.targetPlatform) then
makeSetupHook
{
name = "mesonEmulatorHook";
@ -4159,7 +4159,7 @@ with pkgs;
'';
};
} ../development/tools/build-managers/meson/emulator-hook.sh
else throw "mesonEmulatorHook has to be in a cross conditional i.e. (stdenv.buildPlatform != stdenv.hostPlatform)";
else throw "mesonEmulatorHook has to be in a conditional to check if the target binaries can be executed i.e. (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)";
meson-tools = callPackage ../misc/meson-tools { };
@ -17943,7 +17943,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 {

View file

@ -7476,7 +7476,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 { };