mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
glib: 2.74.0 → 2.74.1
https://gitlab.gnome.org/GNOME/glib/-/compare/2.74.0...2.74.1
- Docs no longer can be generated in static builds.
- Drop merged patches.
- Add a comment to an undocumented patch.
- Drop huge with statement.
- Drop meson override not needed since a4a300dfff
Changelog-Reviewed-By: Jan Tojnar <jtojnar@gmail.com>
This commit is contained in:
parent
301aada7a6
commit
0b5be61ca1
@ -7,11 +7,9 @@
|
||||
# this is just for tests (not in the closure of any regular package)
|
||||
, coreutils, dbus, libxml2, tzdata
|
||||
, desktop-file-utils, shared-mime-info
|
||||
, darwin, fetchpatch
|
||||
, darwin
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
assert stdenv.isLinux -> util-linuxMinimal != null;
|
||||
|
||||
# TODO:
|
||||
@ -40,20 +38,22 @@ let
|
||||
done
|
||||
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
|
||||
'';
|
||||
|
||||
buildDocs = stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isStatic;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "glib";
|
||||
version = "2.74.0";
|
||||
version = "2.74.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnome/sources/glib/${lib.versions.majorMinor finalAttrs.version}/glib-${finalAttrs.version}.tar.xz";
|
||||
sha256 = "NlLH8HLXsDGmte3WI/d+vF3NKuaYWYq8yJ/znKda3TA=";
|
||||
sha256 = "CrmBYY0dtHhF5WQXsNfBI/gaNCeyuck/Wkb/W7uWSWQ=";
|
||||
};
|
||||
|
||||
patches = optionals stdenv.isDarwin [
|
||||
patches = lib.optionals stdenv.isDarwin [
|
||||
./darwin-compilation.patch
|
||||
] ++ optionals stdenv.hostPlatform.isMusl [
|
||||
] ++ lib.optionals stdenv.hostPlatform.isMusl [
|
||||
./quark_init_on_demand.patch
|
||||
./gobject_init_on_demand.patch
|
||||
] ++ [
|
||||
@ -90,29 +90,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# * gio-launch-desktop
|
||||
./split-dev-programs.patch
|
||||
|
||||
# Fix build on Darwin
|
||||
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2914
|
||||
(fetchpatch {
|
||||
name = "gio-properly-guard-use-of-utimensat.patch";
|
||||
url = "https://gitlab.gnome.org/GNOME/glib/-/commit/7f7171e68a420991b537d3e9e63263a0b2871618.patch";
|
||||
sha256 = "kKEqmBqx/RlvFT3eixu+NnM7JXhHb34b9NLRfAt+9h0=";
|
||||
})
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2866
|
||||
(fetchpatch {
|
||||
name = "tests-skip-g-file-info-test-if-atime-unsupported.patch";
|
||||
url = "https://gitlab.gnome.org/qyliss/glib/-/commit/339a06d66685107280ca6bdca5da5d96b8222fb5.patch";
|
||||
sha256 = "sha256-/NdFkuiJvyass3jTDEJPeciA2Lwe53IUd3kAnKAvTaw=";
|
||||
})
|
||||
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2867
|
||||
./tests-skip-shared-libs-if-default_library-static.patch
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2921
|
||||
(fetchpatch {
|
||||
url = "https://gitlab.gnome.org/GNOME/glib/-/commit/f0dd96c28751f15d0703b384bfc7c314af01caa8.patch";
|
||||
sha256 = "sha256-8ucHS6ZnJuP6ajGb4/L8QfhC49FTQG1kAGHVdww/YYE=";
|
||||
})
|
||||
|
||||
# Disable flaky test.
|
||||
# https://gitlab.gnome.org/GNOME/glib/-/issues/820
|
||||
./skip-timer-test.patch
|
||||
];
|
||||
|
||||
@ -124,14 +103,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
libelf
|
||||
finalAttrs.setupHook
|
||||
pcre2
|
||||
] ++ optionals (!stdenv.hostPlatform.isWindows) [
|
||||
] ++ lib.optionals (!stdenv.hostPlatform.isWindows) [
|
||||
bash gnum4 # install glib-gettextize and m4 macros for other apps to use
|
||||
] ++ optionals stdenv.isLinux [
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
libselinux
|
||||
util-linuxMinimal # for libmount
|
||||
] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||
AppKit Carbon Cocoa CoreFoundation CoreServices Foundation
|
||||
]) ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
|
||||
]) ++ lib.optionals buildDocs [
|
||||
# Note: this needs to be both in buildInputs and nativeBuildInputs. The
|
||||
# Meson gtkdoc module uses find_program to look it up (-> build dep), but
|
||||
# glib's own Meson configuration uses the host pkg-config to find its
|
||||
@ -147,10 +126,18 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
(buildPackages.meson.override {
|
||||
withDarwinFrameworksGtkDocPatch = stdenv.isDarwin;
|
||||
})
|
||||
ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2 libxslt
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
perl
|
||||
python3
|
||||
gettext
|
||||
] ++ lib.optionals buildDocs [
|
||||
gtk-doc
|
||||
docbook_xsl
|
||||
docbook_xml_dtd_45
|
||||
libxml2
|
||||
libxslt
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ zlib libffi gettext libiconv ];
|
||||
@ -158,10 +145,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
mesonFlags = [
|
||||
# Avoid the need for gobject introspection binaries in PATH in cross-compiling case.
|
||||
# Instead we just copy them over from the native output.
|
||||
"-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}"
|
||||
"-Dgtk_doc=${lib.boolToString buildDocs}"
|
||||
"-Dnls=enabled"
|
||||
"-Ddevbindir=${placeholder "dev"}/bin"
|
||||
] ++ optionals (!stdenv.isDarwin) [
|
||||
] ++ lib.optionals (!stdenv.isDarwin) [
|
||||
"-Dman=true" # broken on Darwin
|
||||
];
|
||||
|
||||
@ -215,7 +202,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
for i in $dev/bin/*; do
|
||||
moveToOutput "share/bash-completion/completions/''${i##*/}" "$dev"
|
||||
done
|
||||
'' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
||||
'' + lib.optionalString (!buildDocs) ''
|
||||
cp -r ${buildPackages.glib.devdoc} $devdoc
|
||||
'';
|
||||
|
||||
@ -230,7 +217,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
checkInputs = [ tzdata desktop-file-utils shared-mime-info ];
|
||||
|
||||
preCheck = optionalString finalAttrs.doCheck or config.doCheckByDefault or false ''
|
||||
preCheck = lib.optionalString finalAttrs.doCheck or config.doCheckByDefault or false ''
|
||||
export LD_LIBRARY_PATH="$NIX_BUILD_TOP/glib-${finalAttrs.version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
export TZDIR="${tzdata}/share/zoneinfo"
|
||||
export XDG_CACHE_HOME="$TMP"
|
||||
|
@ -1,141 +0,0 @@
|
||||
From b804e4b82cd8e85631112d935543c62ef56783e5 Mon Sep 17 00:00:00 2001
|
||||
From: Alyssa Ross <hi@alyssa.is>
|
||||
Date: Tue, 23 Aug 2022 13:13:44 +0000
|
||||
Subject: [PATCH] tests: skip shared libs if default_library=static
|
||||
|
||||
Otherwise, the build will fail when the toolchain is static-only, even
|
||||
with -Ddefault_library=static. I talked to a Meson developer in their
|
||||
IRC channel, who told me that the correct fix was to ensure that
|
||||
shared_library is only used if default_library != static.
|
||||
|
||||
Part-of: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2867
|
||||
[Backported to 2.72.3]
|
||||
---
|
||||
gio/tests/meson.build | 43 +++++++++++++++++++++++-------------------
|
||||
glib/tests/meson.build | 2 +-
|
||||
gmodule/tests/meson.build | 30 +++++++++++++++--------------
|
||||
3 files changed, 41 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
|
||||
index 3ed23a5f2..7b1aba80d 100644
|
||||
--- a/gio/tests/meson.build
|
||||
+++ b/gio/tests/meson.build
|
||||
@@ -203,7 +203,7 @@ if host_machine.system() != 'windows'
|
||||
}
|
||||
|
||||
# LD_PRELOAD modules don't work so well with AddressSanitizer
|
||||
- if have_rtld_next and get_option('b_sanitize') == 'none'
|
||||
+ if have_rtld_next and get_option('default_library') != 'static' and get_option('b_sanitize') == 'none'
|
||||
gio_tests += {
|
||||
'gsocketclient-slow' : {
|
||||
'depends' : [
|
||||
@@ -607,24 +607,26 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
|
||||
|
||||
compiler_type = '--compiler=@0@'.format(cc.get_id())
|
||||
|
||||
- plugin_resources_c = custom_target('plugin-resources.c',
|
||||
- input : 'test4.gresource.xml',
|
||||
- output : 'plugin-resources.c',
|
||||
- command : [glib_compile_resources,
|
||||
- compiler_type,
|
||||
- '--target=@OUTPUT@',
|
||||
- '--sourcedir=' + meson.current_source_dir(),
|
||||
- '--internal',
|
||||
- '--generate-source',
|
||||
- '--c-name', '_g_plugin',
|
||||
- '@INPUT@'])
|
||||
+ if get_option('default_library') != 'static'
|
||||
+ plugin_resources_c = custom_target('plugin-resources.c',
|
||||
+ input : 'test4.gresource.xml',
|
||||
+ output : 'plugin-resources.c',
|
||||
+ command : [glib_compile_resources,
|
||||
+ compiler_type,
|
||||
+ '--target=@OUTPUT@',
|
||||
+ '--sourcedir=' + meson.current_source_dir(),
|
||||
+ '--internal',
|
||||
+ '--generate-source',
|
||||
+ '--c-name', '_g_plugin',
|
||||
+ '@INPUT@'])
|
||||
|
||||
- shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c,
|
||||
- link_args : export_dynamic_ldflags,
|
||||
- dependencies : common_gio_tests_deps,
|
||||
- install_dir : installed_tests_execdir,
|
||||
- install : installed_tests_enabled
|
||||
- )
|
||||
+ shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c,
|
||||
+ link_args : export_dynamic_ldflags,
|
||||
+ dependencies : common_gio_tests_deps,
|
||||
+ install_dir : installed_tests_execdir,
|
||||
+ install : installed_tests_enabled
|
||||
+ )
|
||||
+ endif
|
||||
|
||||
# referenced by test2.gresource.xml
|
||||
big_test_resource = custom_target(
|
||||
@@ -917,4 +919,7 @@ if installed_tests_enabled
|
||||
endif
|
||||
|
||||
subdir('services')
|
||||
-subdir('modules')
|
||||
+
|
||||
+if get_option('default_library') != 'static'
|
||||
+ subdir('modules')
|
||||
+endif
|
||||
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
|
||||
index 301158e0f..6203ff45e 100644
|
||||
--- a/glib/tests/meson.build
|
||||
+++ b/glib/tests/meson.build
|
||||
@@ -172,7 +172,7 @@ else
|
||||
'include' : {},
|
||||
'unix' : {},
|
||||
}
|
||||
- if have_rtld_next
|
||||
+ if have_rtld_next and get_option('default_library') != 'static'
|
||||
glib_tests += {
|
||||
'gutils-user-database' : {
|
||||
'depends' : [
|
||||
diff --git a/gmodule/tests/meson.build b/gmodule/tests/meson.build
|
||||
index c95fa1d00..25144c941 100644
|
||||
--- a/gmodule/tests/meson.build
|
||||
+++ b/gmodule/tests/meson.build
|
||||
@@ -72,20 +72,22 @@ if ['darwin', 'ios'].contains(host_machine.system())
|
||||
module_suffix = 'so'
|
||||
endif
|
||||
|
||||
-foreach module : ['moduletestplugin_a', 'moduletestplugin_b']
|
||||
- shared_module(module + '_plugin', 'lib@0@.c'.format(module),
|
||||
- dependencies : [libglib_dep, libgmodule_dep],
|
||||
- install_dir : installed_tests_execdir,
|
||||
- install : installed_tests_enabled,
|
||||
- name_suffix : module_suffix
|
||||
- )
|
||||
- shared_library(module + '_library', 'lib@0@.c'.format(module),
|
||||
- dependencies : [libglib_dep, libgmodule_dep],
|
||||
- install_dir : installed_tests_execdir,
|
||||
- install : installed_tests_enabled,
|
||||
- name_suffix : module_suffix
|
||||
- )
|
||||
-endforeach
|
||||
+if get_option('default_library') != 'static'
|
||||
+ foreach module : ['moduletestplugin_a', 'moduletestplugin_b']
|
||||
+ shared_module(module + '_plugin', 'lib@0@.c'.format(module),
|
||||
+ dependencies : [libglib_dep, libgmodule_dep],
|
||||
+ install_dir : installed_tests_execdir,
|
||||
+ install : installed_tests_enabled,
|
||||
+ name_suffix : module_suffix
|
||||
+ )
|
||||
+ shared_library(module + '_library', 'lib@0@.c'.format(module),
|
||||
+ dependencies : [libglib_dep, libgmodule_dep],
|
||||
+ install_dir : installed_tests_execdir,
|
||||
+ install : installed_tests_enabled,
|
||||
+ name_suffix : module_suffix
|
||||
+ )
|
||||
+ endforeach
|
||||
+endif
|
||||
|
||||
common_c_args = test_cargs + ['-DGLIB_DISABLE_DEPRECATION_WARNINGS']
|
||||
common_deps = [libm, thread_dep, libglib_dep]
|
||||
--
|
||||
2.37.1
|
||||
|
@ -5,7 +5,6 @@
|
||||
, pkg-config
|
||||
, python3
|
||||
, substituteAll
|
||||
, withDarwinFrameworksGtkDocPatch ? false
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
|
Loading…
Reference in New Issue
Block a user