uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
24
pkgs/development/libraries/glib/darwin-compilation.patch
Normal file
24
pkgs/development/libraries/glib/darwin-compilation.patch
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
Fix compilation on Mac OS X with gcc 4.8.
|
||||
|
||||
diff -ru glib-2.40.0-orig/gio/gdummyfile.c glib-2.40.0/gio/gdummyfile.c
|
||||
--- glib-2.40.0-orig/gio/gdummyfile.c 2014-02-03 18:40:41.000000000 +0100
|
||||
+++ glib-2.40.0/gio/gdummyfile.c 2014-07-15 10:58:31.000000000 +0200
|
||||
@@ -454,7 +454,8 @@
|
||||
result = g_malloc (escaped_string_end - escaped_string + 1);
|
||||
|
||||
out = result;
|
||||
- for (in = escaped_string; in < escaped_string_end; in++)
|
||||
+ in = escaped_string;
|
||||
+ for (; in < escaped_string_end; in++)
|
||||
{
|
||||
character = *in;
|
||||
if (*in == '%')
|
||||
@@ -551,6 +552,7 @@
|
||||
|
||||
decoded->scheme = g_malloc (p - uri);
|
||||
out = decoded->scheme;
|
||||
- for (in = uri; in < p - 1; in++)
|
||||
+ in = uri;
|
||||
+ for (; in < p - 1; in++)
|
||||
*out++ = g_ascii_tolower (*in);
|
||||
*out = 0;
|
||||
233
pkgs/development/libraries/glib/default.nix
Normal file
233
pkgs/development/libraries/glib/default.nix
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
{ config, lib, stdenv, fetchurl, gettext, meson, ninja, pkg-config, perl, python3
|
||||
, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
|
||||
# use util-linuxMinimal to avoid circular dependency (util-linux, systemd, glib)
|
||||
, util-linuxMinimal ? null
|
||||
, buildPackages
|
||||
|
||||
# this is just for tests (not in the closure of any regular package)
|
||||
, doCheck ? config.doCheckByDefault or false
|
||||
, coreutils, dbus, libxml2, tzdata
|
||||
, desktop-file-utils, shared-mime-info
|
||||
, darwin, fetchpatch
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
assert stdenv.isLinux -> util-linuxMinimal != null;
|
||||
|
||||
# TODO:
|
||||
# * Make it build without python
|
||||
# Problem: an example (test?) program needs it.
|
||||
# Possible solution: disable compilation of this example somehow
|
||||
# Reminder: add 'sed -e 's@python2\.[0-9]@python@' -i
|
||||
# $out/bin/gtester-report' to postInstall if this is solved
|
||||
/*
|
||||
* Use --enable-installed-tests for GNOME-related packages,
|
||||
and use them as a separately installed tests runned by Hydra
|
||||
(they should test an already installed package)
|
||||
https://wiki.gnome.org/GnomeGoals/InstalledTests
|
||||
* Support org.freedesktop.Application, including D-Bus activation from desktop files
|
||||
*/
|
||||
let
|
||||
# Some packages don't get "Cflags" from pkg-config correctly
|
||||
# and then fail to build when directly including like <glib/...>.
|
||||
# This is intended to be run in postInstall of any package
|
||||
# which has $out/include/ containing just some disjunct directories.
|
||||
flattenInclude = ''
|
||||
for dir in "''${!outputInclude}"/include/*; do
|
||||
cp -r "$dir"/* "''${!outputInclude}/include/"
|
||||
rm -r "$dir"
|
||||
ln -s . "$dir"
|
||||
done
|
||||
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
|
||||
'';
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "glib";
|
||||
version = "2.72.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnome/sources/glib/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
||||
sha256 = "wH5XFHslTO+SzoCgN43AwCpDWOfeRwLp9AMGl4EJX+I=";
|
||||
};
|
||||
|
||||
patches = optionals stdenv.isDarwin [
|
||||
./darwin-compilation.patch
|
||||
] ++ optionals stdenv.hostPlatform.isMusl [
|
||||
./quark_init_on_demand.patch
|
||||
./gobject_init_on_demand.patch
|
||||
] ++ [
|
||||
./glib-appinfo-watch.patch
|
||||
./schema-override-variable.patch
|
||||
|
||||
# Add support for the GNOME’s default terminal emulator.
|
||||
# https://gitlab.gnome.org/GNOME/glib/-/issues/2618
|
||||
./gnome-console-support.patch
|
||||
# Do the same for Pantheon’s terminal emulator.
|
||||
./elementary-terminal-support.patch
|
||||
|
||||
# GLib contains many binaries used for different purposes;
|
||||
# we will install them to different outputs:
|
||||
# 1. Tools for desktop environment ($bin)
|
||||
# * gapplication (non-darwin)
|
||||
# * gdbus
|
||||
# * gio
|
||||
# * gio-launch-desktop (symlink to $out)
|
||||
# * gsettings
|
||||
# 2. Development/build tools ($dev)
|
||||
# * gdbus-codegen
|
||||
# * gio-querymodules
|
||||
# * glib-compile-resources
|
||||
# * glib-compile-schemas
|
||||
# * glib-genmarshal
|
||||
# * glib-gettextize
|
||||
# * glib-mkenums
|
||||
# * gobject-query
|
||||
# * gresource
|
||||
# * gtester
|
||||
# * gtester-report
|
||||
# 3. Tools for desktop environment that cannot go to $bin due to $out depending on them ($out)
|
||||
# * gio-launch-desktop
|
||||
./split-dev-programs.patch
|
||||
] ++ optional doCheck ./skip-timer-test.patch;
|
||||
|
||||
outputs = [ "bin" "out" "dev" "devdoc" ];
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
buildInputs = [
|
||||
libelf setupHook pcre
|
||||
] ++ optionals (!stdenv.hostPlatform.isWindows) [
|
||||
bash gnum4 # install glib-gettextize and m4 macros for other apps to use
|
||||
] ++ optionals stdenv.isLinux [
|
||||
libselinux
|
||||
util-linuxMinimal # for libmount
|
||||
] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||
AppKit Carbon Cocoa CoreFoundation CoreServices Foundation
|
||||
]) ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
|
||||
# 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
|
||||
# version (-> host dep). We could technically go and fix this in glib, add
|
||||
# pkg-config to depsBuildBuild, but this would be a futile exercise since
|
||||
# Meson's gtkdoc integration does not support cross compilation[1] anyway
|
||||
# and this derivation disables the docs build when cross compiling.
|
||||
#
|
||||
# [1] https://github.com/mesonbuild/meson/issues/2003
|
||||
gtk-doc
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
(buildPackages.meson.override {
|
||||
withDarwinFrameworksGtkDocPatch = stdenv.isDarwin;
|
||||
})
|
||||
ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ zlib libffi gettext libiconv ];
|
||||
|
||||
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)}"
|
||||
"-Dnls=enabled"
|
||||
"-Ddevbindir=${placeholder "dev"}/bin"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = toString [
|
||||
"-Wno-error=nonnull"
|
||||
# Default for release buildtype but passed manually because
|
||||
# we're using plain
|
||||
"-DG_DISABLE_CAST_CHECKS"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
chmod +x gio/tests/gengiotypefuncs.py
|
||||
patchShebangs gio/tests/gengiotypefuncs.py
|
||||
chmod +x docs/reference/gio/concat-files-helper.py
|
||||
patchShebangs docs/reference/gio/concat-files-helper.py
|
||||
patchShebangs glib/gen-unicode-tables.pl
|
||||
patchShebangs glib/tests/gen-casefold-txt.py
|
||||
patchShebangs glib/tests/gen-casemap-txt.py
|
||||
'' + lib.optionalString stdenv.hostPlatform.isWindows ''
|
||||
substituteInPlace gio/win32/meson.build \
|
||||
--replace "libintl, " ""
|
||||
'';
|
||||
|
||||
DETERMINISTIC_BUILD = 1;
|
||||
|
||||
postInstall = ''
|
||||
moveToOutput "share/glib-2.0" "$dev"
|
||||
substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev"
|
||||
sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|"
|
||||
|
||||
# This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
|
||||
sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
|
||||
-i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
|
||||
'' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
||||
cp -r ${buildPackages.glib.devdoc} $devdoc
|
||||
'';
|
||||
|
||||
checkInputs = [ tzdata desktop-file-utils shared-mime-info ];
|
||||
|
||||
preCheck = optionalString doCheck ''
|
||||
export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${pname}-${version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
||||
export TZDIR="${tzdata}/share/zoneinfo"
|
||||
export XDG_CACHE_HOME="$TMP"
|
||||
export XDG_RUNTIME_HOME="$TMP"
|
||||
export HOME="$TMP"
|
||||
export XDG_DATA_DIRS="${desktop-file-utils}/share:${shared-mime-info}/share"
|
||||
export G_TEST_DBUS_DAEMON="${dbus.daemon}/bin/dbus-daemon"
|
||||
export PATH="$PATH:$(pwd)/gobject"
|
||||
echo "PATH=$PATH"
|
||||
|
||||
substituteInPlace gio/tests/desktop-files/home/applications/epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop \
|
||||
--replace "Exec=/bin/true" "Exec=${coreutils}/bin/true"
|
||||
# Needs machine-id, comment the test
|
||||
sed -e '/\/gdbus\/codegen-peer-to-peer/ s/^\/*/\/\//' -i gio/tests/gdbus-peer.c
|
||||
sed -e '/g_test_add_func/ s/^\/*/\/\//' -i gio/tests/gdbus-unix-addresses.c
|
||||
# All gschemas fail to pass the test, upstream bug?
|
||||
sed -e '/g_test_add_data_func/ s/^\/*/\/\//' -i gio/tests/gschema-compile.c
|
||||
# Cannot reproduce the failing test_associations on hydra
|
||||
sed -e '/\/appinfo\/associations/d' -i gio/tests/appinfo.c
|
||||
# Needed because of libtool wrappers
|
||||
sed -e '/g_subprocess_launcher_set_environ (launcher, envp);/a g_subprocess_launcher_setenv (launcher, "PATH", g_getenv("PATH"), TRUE);' -i gio/tests/gsubprocess.c
|
||||
'';
|
||||
|
||||
inherit doCheck;
|
||||
|
||||
separateDebugInfo = stdenv.isLinux;
|
||||
|
||||
passthru = rec {
|
||||
gioModuleDir = "lib/gio/modules";
|
||||
|
||||
makeSchemaDataDirPath = dir: name: "${dir}/share/gsettings-schemas/${name}";
|
||||
makeSchemaPath = dir: name: "${makeSchemaDataDirPath dir name}/glib-2.0/schemas";
|
||||
getSchemaPath = pkg: makeSchemaPath pkg pkg.name;
|
||||
getSchemaDataDirPath = pkg: makeSchemaDataDirPath pkg pkg.name;
|
||||
|
||||
inherit flattenInclude;
|
||||
updateScript = gnome.updateScript {
|
||||
packageName = "glib";
|
||||
versionPolicy = "odd-unstable";
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "C library of programming buildings blocks";
|
||||
homepage = "https://www.gtk.org/";
|
||||
license = licenses.lgpl21Plus;
|
||||
maintainers = teams.gnome.members ++ (with maintainers; [ lovek323 raskin ]);
|
||||
platforms = platforms.unix;
|
||||
|
||||
longDescription = ''
|
||||
GLib provides the core application building blocks for libraries
|
||||
and applications written in C. It provides the core object
|
||||
system used in GNOME, the main loop implementation, and a large
|
||||
set of utility functions for strings and common data structures.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
|
||||
index a441bfec9..6bcd3e690 100644
|
||||
--- a/gio/gdesktopappinfo.c
|
||||
+++ b/gio/gdesktopappinfo.c
|
||||
@@ -2678,6 +2678,11 @@ prepend_terminal_to_vector (int *argc,
|
||||
if (check != NULL)
|
||||
pass_cmd_as_single_arg = TRUE;
|
||||
}
|
||||
+ if (check == NULL) {
|
||||
+ check = g_find_program_in_path ("io.elementary.terminal");
|
||||
+ if (check != NULL)
|
||||
+ pass_cmd_as_single_arg = TRUE;
|
||||
+ }
|
||||
if (check == NULL)
|
||||
check = g_find_program_in_path ("tilix");
|
||||
if (check == NULL)
|
||||
102
pkgs/development/libraries/glib/glib-appinfo-watch.patch
Normal file
102
pkgs/development/libraries/glib/glib-appinfo-watch.patch
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
This patch lets GLib's GDesktopAppInfo API watch and notice changes
|
||||
to the Nix user and system profiles. That way, the list of available
|
||||
applications shown by the desktop environment is immediately updated
|
||||
when the user installs or removes any
|
||||
(see <https://issues.guix.gnu.org/35594>).
|
||||
|
||||
It does so by monitoring /nix/var/nix/profiles (for changes to the system
|
||||
profile) and /nix/var/nix/profiles/per-user/USER (for changes to the user
|
||||
profile) as well as /etc/profiles/per-user (for chanes to the user
|
||||
environment profile) and crawling their share/applications sub-directory when
|
||||
changes happen.
|
||||
|
||||
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
|
||||
index b779b30..31069f7 100644
|
||||
--- a/gio/gdesktopappinfo.c
|
||||
+++ b/gio/gdesktopappinfo.c
|
||||
@@ -150,6 +150,7 @@ typedef struct
|
||||
gchar *alternatively_watching;
|
||||
gboolean is_config;
|
||||
gboolean is_setup;
|
||||
+ gchar *nix_profile_watch_dir;
|
||||
GFileMonitor *monitor;
|
||||
GHashTable *app_names;
|
||||
GHashTable *mime_tweaks;
|
||||
@@ -181,6 +182,7 @@ desktop_file_dir_unref (DesktopFileDir *dir)
|
||||
{
|
||||
desktop_file_dir_reset (dir);
|
||||
g_free (dir->path);
|
||||
+ g_free (dir->nix_profile_watch_dir);
|
||||
g_free (dir);
|
||||
}
|
||||
}
|
||||
@@ -205,6 +207,14 @@ desktop_file_dir_get_alternative_dir (DesktopFileDir *dir)
|
||||
{
|
||||
gchar *parent;
|
||||
|
||||
+ /* If DIR is a profile, watch the specified directory--e.g.,
|
||||
+ * /nix/var/nix/profiles/per-user/$USER/ for the user profile. Do not watch
|
||||
+ * ~/.nix-profile or /run/current-system/sw because GFileMonitor does
|
||||
+ * not pass IN_DONT_FOLLOW and thus cannot notice any change.
|
||||
+ * /etc/profiles/per-user is monitored directly for the same reason. */
|
||||
+ if (dir->nix_profile_watch_dir != NULL)
|
||||
+ return g_strdup (dir->nix_profile_watch_dir);
|
||||
+
|
||||
/* If the directory itself exists then we need no alternative. */
|
||||
if (g_access (dir->path, R_OK | X_OK) == 0)
|
||||
return NULL;
|
||||
@@ -250,11 +260,11 @@ desktop_file_dir_changed (GFileMonitor *monitor,
|
||||
*
|
||||
* If this is a notification for a parent directory (because the
|
||||
* desktop directory didn't exist) then we shouldn't fire the signal
|
||||
- * unless something actually changed.
|
||||
+ * unless something actually changed or it's part of a Nix profile.
|
||||
*/
|
||||
g_mutex_lock (&desktop_file_dir_lock);
|
||||
|
||||
- if (dir->alternatively_watching)
|
||||
+ if (dir->alternatively_watching && dir->nix_profile_watch_dir == NULL)
|
||||
{
|
||||
gchar *alternative_dir;
|
||||
|
||||
@@ -1556,6 +1566,40 @@ desktop_file_dirs_lock (void)
|
||||
for (i = 0; dirs[i]; i++)
|
||||
g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dirs[i]));
|
||||
|
||||
+ {
|
||||
+ /* Monitor the system and user profile under /nix/var/nix/profiles and
|
||||
+ * treat modifications to them as if they were modifications to their
|
||||
+ * /share sub-directory. */
|
||||
+ const gchar *user;
|
||||
+ DesktopFileDir *system_profile_dir, *user_profile_dir, *user_env_dir;
|
||||
+
|
||||
+ system_profile_dir =
|
||||
+ desktop_file_dir_new ("/nix/var/nix/profiles/system/sw/share");
|
||||
+ system_profile_dir->nix_profile_watch_dir = g_strdup ("/nix/var/nix/profiles");
|
||||
+ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (system_profile_dir));
|
||||
+
|
||||
+ user = g_get_user_name ();
|
||||
+ if (user != NULL)
|
||||
+ {
|
||||
+ gchar *profile_dir, *user_data_dir, *env_dir, *env_data_dir;
|
||||
+
|
||||
+ profile_dir = g_build_filename ("/nix/var/nix/profiles/per-user", user, NULL);
|
||||
+ user_data_dir = g_build_filename (profile_dir, "profile", "share", NULL);
|
||||
+ user_profile_dir = desktop_file_dir_new (user_data_dir);
|
||||
+ user_profile_dir->nix_profile_watch_dir = profile_dir;
|
||||
+
|
||||
+ env_dir = g_build_filename ("/etc/profiles/per-user", NULL);
|
||||
+ env_data_dir = g_build_filename (env_dir, user, "share", NULL);
|
||||
+ user_env_dir = desktop_file_dir_new (env_data_dir);
|
||||
+ user_env_dir->nix_profile_watch_dir = env_dir;
|
||||
+
|
||||
+ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (user_profile_dir));
|
||||
+ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (user_env_dir));
|
||||
+ g_free (user_data_dir);
|
||||
+ g_free (env_data_dir);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* The list of directories will never change after this, unless
|
||||
* g_get_user_config_dir() changes due to %G_TEST_OPTION_ISOLATE_DIRS. */
|
||||
desktop_file_dirs_config_dir = user_config_dir;
|
||||
55
pkgs/development/libraries/glib/gnome-console-support.patch
Normal file
55
pkgs/development/libraries/glib/gnome-console-support.patch
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
|
||||
index 60d6debb2..a441bfec9 100644
|
||||
--- a/gio/gdesktopappinfo.c
|
||||
+++ b/gio/gdesktopappinfo.c
|
||||
@@ -2627,6 +2627,7 @@ prepend_terminal_to_vector (int *argc,
|
||||
int i, j;
|
||||
char **term_argv = NULL;
|
||||
int term_argc = 0;
|
||||
+ gboolean pass_cmd_as_single_arg = FALSE;
|
||||
char *check;
|
||||
char **the_argv;
|
||||
|
||||
@@ -2672,6 +2673,11 @@ prepend_terminal_to_vector (int *argc,
|
||||
}
|
||||
else
|
||||
{
|
||||
+ if (check == NULL) {
|
||||
+ check = g_find_program_in_path ("kgx");
|
||||
+ if (check != NULL)
|
||||
+ pass_cmd_as_single_arg = TRUE;
|
||||
+ }
|
||||
if (check == NULL)
|
||||
check = g_find_program_in_path ("tilix");
|
||||
if (check == NULL)
|
||||
@@ -2697,14 +2703,27 @@ prepend_terminal_to_vector (int *argc,
|
||||
}
|
||||
}
|
||||
|
||||
- real_argc = term_argc + *argc;
|
||||
+ real_argc = term_argc + (pass_cmd_as_single_arg ? 1 : *argc);
|
||||
real_argv = g_new (char *, real_argc + 1);
|
||||
|
||||
for (i = 0; i < term_argc; i++)
|
||||
real_argv[i] = term_argv[i];
|
||||
|
||||
- for (j = 0; j < *argc; j++, i++)
|
||||
- real_argv[i] = (char *)the_argv[j];
|
||||
+ if (pass_cmd_as_single_arg) {
|
||||
+ char **quoted_argv = g_new (char *, *argc + 1);
|
||||
+
|
||||
+ for (j = 0; j < *argc; j++) {
|
||||
+ quoted_argv[j] = g_shell_quote (the_argv[j]);
|
||||
+ g_free (the_argv[j]);
|
||||
+ }
|
||||
+ quoted_argv[j] = NULL;
|
||||
+
|
||||
+ real_argv[i++] = g_strjoinv (" ", quoted_argv);
|
||||
+ g_strfreev (quoted_argv);
|
||||
+ } else {
|
||||
+ for (j = 0; j < *argc; j++, i++)
|
||||
+ real_argv[i] = (char *)the_argv[j];
|
||||
+ }
|
||||
|
||||
real_argv[i] = NULL;
|
||||
|
||||
87
pkgs/development/libraries/glib/gobject_init_on_demand.patch
Normal file
87
pkgs/development/libraries/glib/gobject_init_on_demand.patch
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
--- glib-source/gobject/gtype.c 2016-08-17 17:20:47.000000000 +0200
|
||||
+++ glib-source/gobject/gtype.c 2016-09-01 21:56:31.777406646 +0200
|
||||
@@ -209,6 +209,9 @@
|
||||
static gboolean type_node_is_a_L (TypeNode *node,
|
||||
TypeNode *iface_node);
|
||||
|
||||
+#if !defined(__GLIBC__)
|
||||
+static void gobject_init (void);
|
||||
+#endif
|
||||
|
||||
/* --- enumeration --- */
|
||||
|
||||
@@ -2631,7 +2634,10 @@
|
||||
GTypeFlags flags)
|
||||
{
|
||||
TypeNode *node;
|
||||
-
|
||||
+
|
||||
+#if !defined(__GLIBC__)
|
||||
+ gobject_init();
|
||||
+#endif
|
||||
g_assert_type_system_initialized ();
|
||||
g_return_val_if_fail (type_id > 0, 0);
|
||||
g_return_val_if_fail (type_name != NULL, 0);
|
||||
@@ -2749,6 +2755,9 @@
|
||||
TypeNode *pnode, *node;
|
||||
GType type = 0;
|
||||
|
||||
+#if !defined(__GLIBC__)
|
||||
+ gobject_init();
|
||||
+#endif
|
||||
g_assert_type_system_initialized ();
|
||||
g_return_val_if_fail (parent_type > 0, 0);
|
||||
g_return_val_if_fail (type_name != NULL, 0);
|
||||
@@ -2804,6 +2813,9 @@
|
||||
TypeNode *pnode, *node;
|
||||
GType type;
|
||||
|
||||
+#if !defined(__GLIBC__)
|
||||
+ gobject_init();
|
||||
+#endif
|
||||
g_assert_type_system_initialized ();
|
||||
g_return_val_if_fail (parent_type > 0, 0);
|
||||
g_return_val_if_fail (type_name != NULL, 0);
|
||||
@@ -3319,6 +3331,9 @@
|
||||
{
|
||||
TypeNode *node;
|
||||
|
||||
+#if !defined(__GLIBC__)
|
||||
+ gobject_init();
|
||||
+#endif
|
||||
g_assert_type_system_initialized ();
|
||||
|
||||
node = lookup_type_node_I (type);
|
||||
@@ -4343,6 +4358,9 @@
|
||||
void
|
||||
g_type_init_with_debug_flags (GTypeDebugFlags debug_flags)
|
||||
{
|
||||
+#if !defined(__GLIBC__)
|
||||
+ gobject_init();
|
||||
+#endif
|
||||
g_assert_type_system_initialized ();
|
||||
|
||||
if (debug_flags)
|
||||
@@ -4361,6 +4379,9 @@
|
||||
void
|
||||
g_type_init (void)
|
||||
{
|
||||
+#if !defined(__GLIBC__)
|
||||
+ gobject_init();
|
||||
+#endif
|
||||
g_assert_type_system_initialized ();
|
||||
}
|
||||
|
||||
@@ -4372,6 +4393,12 @@
|
||||
TypeNode *node;
|
||||
GType type;
|
||||
|
||||
+#if !defined(__GLIBC__)
|
||||
+ static int gobject_initialized = 0;
|
||||
+ if (gobject_initialized)
|
||||
+ return;
|
||||
+ gobject_initialized = 1;
|
||||
+#endif
|
||||
/* Ensure GLib is initialized first, see
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=756139
|
||||
*/
|
||||
33
pkgs/development/libraries/glib/quark_init_on_demand.patch
Normal file
33
pkgs/development/libraries/glib/quark_init_on_demand.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
--- glib-source/glib/gquark.c 2016-08-17 17:20:47.000000000 +0200
|
||||
+++ glib-source/glib/gquark.c 2016-08-30 07:49:13.298234757 +0200
|
||||
@@ -57,6 +57,9 @@
|
||||
void
|
||||
g_quark_init (void)
|
||||
{
|
||||
+ if (quark_ht)
|
||||
+ return;
|
||||
+
|
||||
g_assert (quark_seq_id == 0);
|
||||
quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
|
||||
@@ -138,9 +141,12 @@
|
||||
return 0;
|
||||
|
||||
G_LOCK (quark_global);
|
||||
+#if !defined(__GLIBC__)
|
||||
+ g_quark_init ();
|
||||
+#endif
|
||||
quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
|
||||
G_UNLOCK (quark_global);
|
||||
|
||||
return quark;
|
||||
}
|
||||
|
||||
@@ -280,6 +286,7 @@
|
||||
GQuark quark;
|
||||
gchar **quarks_new;
|
||||
|
||||
+ g_quark_init ();
|
||||
if (quark_seq_id % QUARK_BLOCK_SIZE == 0)
|
||||
{
|
||||
quarks_new = g_new (gchar*, quark_seq_id + QUARK_BLOCK_SIZE);
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
|
||||
index 1282c10a1..feadfe3aa 100644
|
||||
--- a/gio/gsettingsschema.c
|
||||
+++ b/gio/gsettingsschema.c
|
||||
@@ -360,6 +360,9 @@ initialise_schema_sources (void)
|
||||
|
||||
try_prepend_data_dir (g_get_user_data_dir ());
|
||||
|
||||
+ if (!is_setuid && (path = g_getenv ("NIX_GSETTINGS_OVERRIDES_DIR")) != NULL)
|
||||
+ try_prepend_dir (path);
|
||||
+
|
||||
/* Disallow loading extra schemas if running as setuid, as that could
|
||||
* allow reading privileged files. */
|
||||
if (!is_setuid && (path = g_getenv ("GSETTINGS_SCHEMA_DIR")) != NULL)
|
||||
34
pkgs/development/libraries/glib/setup-hook.sh
Normal file
34
pkgs/development/libraries/glib/setup-hook.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
make_glib_find_gsettings_schemas() {
|
||||
# For packages that need gschemas of other packages (e.g. empathy)
|
||||
for maybe_dir in "$1"/share/gsettings-schemas/*; do
|
||||
if [[ -d "$maybe_dir/glib-2.0/schemas" ]]; then
|
||||
addToSearchPath GSETTINGS_SCHEMAS_PATH "$maybe_dir"
|
||||
fi
|
||||
done
|
||||
}
|
||||
addEnvHooks "$targetOffset" make_glib_find_gsettings_schemas
|
||||
|
||||
# Install gschemas, if any, in a package-specific directory
|
||||
glibPreInstallPhase() {
|
||||
makeFlagsArray+=("gsettingsschemadir=${!outputLib}/share/gsettings-schemas/$name/glib-2.0/schemas/")
|
||||
}
|
||||
preInstallPhases+=" glibPreInstallPhase"
|
||||
|
||||
glibPreFixupPhase() {
|
||||
# Move gschemas in case the install flag didn't help
|
||||
if [ -d "$prefix/share/glib-2.0/schemas" ]; then
|
||||
mkdir -p "${!outputLib}/share/gsettings-schemas/$name/glib-2.0"
|
||||
mv "$prefix/share/glib-2.0/schemas" "${!outputLib}/share/gsettings-schemas/$name/glib-2.0/"
|
||||
fi
|
||||
|
||||
addToSearchPath GSETTINGS_SCHEMAS_PATH "${!outputLib}/share/gsettings-schemas/$name"
|
||||
}
|
||||
|
||||
# gappsWrapperArgsHook expects GSETTINGS_SCHEMAS_PATH variable to be set by this.
|
||||
# Until we have dependency mechanism in generic builder, we need to use this ugly hack.
|
||||
if [[ " ${preFixupPhases:-} " =~ " gappsWrapperArgsHook " ]]; then
|
||||
preFixupPhases+=" "
|
||||
preFixupPhases="${preFixupPhases/ gappsWrapperArgsHook / glibPreFixupPhase gappsWrapperArgsHook }"
|
||||
else
|
||||
preFixupPhases+=" glibPreFixupPhase"
|
||||
fi
|
||||
17
pkgs/development/libraries/glib/skip-timer-test.patch
Normal file
17
pkgs/development/libraries/glib/skip-timer-test.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Description: Skip test which performs some unreliable floating point comparisons
|
||||
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=722604
|
||||
|
||||
Index: b/glib/tests/timer.c
|
||||
===================================================================
|
||||
--- a/glib/tests/timer.c
|
||||
+++ b/glib/tests/timer.c
|
||||
@@ -203,7 +203,7 @@
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
- g_test_add_func ("/timer/basic", test_timer_basic);
|
||||
+/* g_test_add_func ("/timer/basic", test_timer_basic);*/
|
||||
- g_test_add_func ("/timer/stop", test_timer_stop);
|
||||
+/* g_test_add_func ("/timer/stop", test_timer_stop);*/
|
||||
g_test_add_func ("/timer/continue", test_timer_continue);
|
||||
g_test_add_func ("/timer/reset", test_timer_reset);
|
||||
154
pkgs/development/libraries/glib/split-dev-programs.patch
Normal file
154
pkgs/development/libraries/glib/split-dev-programs.patch
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build
|
||||
index 5ea6bae2f..e0b584a86 100644
|
||||
--- a/gio/gdbus-2.0/codegen/meson.build
|
||||
+++ b/gio/gdbus-2.0/codegen/meson.build
|
||||
@@ -16,7 +16,7 @@ gdbus_codegen_conf.set('DATADIR', glib_datadir)
|
||||
# Install gdbus-codegen executable
|
||||
gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
|
||||
output : 'gdbus-codegen',
|
||||
- install_dir : get_option('bindir'),
|
||||
+ install_dir : get_option('devbindir'),
|
||||
configuration : gdbus_codegen_conf
|
||||
)
|
||||
# Provide tools for others when we're a subproject and they use the Meson GNOME module
|
||||
diff --git a/gio/meson.build b/gio/meson.build
|
||||
index 3535788ab..99c3b48d6 100644
|
||||
--- a/gio/meson.build
|
||||
+++ b/gio/meson.build
|
||||
@@ -831,14 +831,15 @@ pkg.generate(libgio,
|
||||
variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')),
|
||||
'schemasdir=' + join_paths('${datadir}', schemas_subdir),
|
||||
'bindir=' + join_paths('${prefix}', get_option('bindir')),
|
||||
+ 'devbindir=' + get_option('devbindir'),
|
||||
'giomoduledir=' + pkgconfig_giomodulesdir,
|
||||
'gio=' + join_paths('${bindir}', 'gio'),
|
||||
- 'gio_querymodules=' + join_paths('${bindir}', 'gio-querymodules'),
|
||||
- 'glib_compile_schemas=' + join_paths('${bindir}', 'glib-compile-schemas'),
|
||||
- 'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'),
|
||||
+ 'gio_querymodules=' + join_paths('${devbindir}', 'gio-querymodules'),
|
||||
+ 'glib_compile_schemas=' + join_paths('${devbindir}', 'glib-compile-schemas'),
|
||||
+ 'glib_compile_resources=' + join_paths('${devbindir}', 'glib-compile-resources'),
|
||||
'gdbus=' + join_paths('${bindir}', 'gdbus'),
|
||||
- 'gdbus_codegen=' + join_paths('${bindir}', 'gdbus-codegen'),
|
||||
- 'gresource=' + join_paths('${bindir}', 'gresource'),
|
||||
+ 'gdbus_codegen=' + join_paths('${devbindir}', 'gdbus-codegen'),
|
||||
+ 'gresource=' + join_paths('${devbindir}', 'gresource'),
|
||||
'gsettings=' + join_paths('${bindir}', 'gsettings')],
|
||||
version : glib_version,
|
||||
install_dir : glib_pkgconfigreldir,
|
||||
@@ -939,12 +940,14 @@ executable('gio', gio_tool_sources,
|
||||
|
||||
executable('gresource', 'gresource-tool.c',
|
||||
install : true,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
# intl.lib is not compatible with SAFESEH
|
||||
link_args : noseh_link_args,
|
||||
dependencies : [libelf, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
|
||||
|
||||
gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodule-priv.c',
|
||||
install : true,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
c_args : gio_c_args,
|
||||
# intl.lib is not compatible with SAFESEH
|
||||
link_args : noseh_link_args,
|
||||
@@ -953,6 +956,7 @@ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodu
|
||||
glib_compile_schemas = executable('glib-compile-schemas',
|
||||
[gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-schemas.c'],
|
||||
install : true,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
# intl.lib is not compatible with SAFESEH
|
||||
link_args : noseh_link_args,
|
||||
dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
|
||||
@@ -960,6 +964,7 @@ glib_compile_schemas = executable('glib-compile-schemas',
|
||||
glib_compile_resources = executable('glib-compile-resources',
|
||||
[gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-resources.c'],
|
||||
install : true,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
c_args : gio_c_args,
|
||||
# intl.lib is not compatible with SAFESEH
|
||||
link_args : noseh_link_args,
|
||||
diff --git a/glib/meson.build b/glib/meson.build
|
||||
index aaf5f00f5..09edd291a 100644
|
||||
--- a/glib/meson.build
|
||||
+++ b/glib/meson.build
|
||||
@@ -375,9 +375,10 @@ pkg.generate(libglib,
|
||||
subdirs : ['glib-2.0'],
|
||||
extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags,
|
||||
variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')),
|
||||
- 'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'),
|
||||
- 'gobject_query=' + join_paths('${bindir}', 'gobject-query'),
|
||||
- 'glib_mkenums=' + join_paths('${bindir}', 'glib-mkenums')],
|
||||
+ 'devbindir=' + get_option('devbindir'),
|
||||
+ 'glib_genmarshal=' + join_paths('${devbindir}', 'glib-genmarshal'),
|
||||
+ 'gobject_query=' + join_paths('${devbindir}', 'gobject-query'),
|
||||
+ 'glib_mkenums=' + join_paths('${devbindir}', 'glib-mkenums')],
|
||||
version : glib_version,
|
||||
install_dir : glib_pkgconfigreldir,
|
||||
filebase : 'glib-2.0',
|
||||
@@ -413,6 +414,7 @@ if host_system == 'windows'
|
||||
else
|
||||
gtester = executable('gtester', 'gtester.c',
|
||||
install : true,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
c_args : ['-UG_DISABLE_ASSERT'],
|
||||
include_directories : configinc,
|
||||
dependencies : [libglib_dep])
|
||||
@@ -424,7 +426,7 @@ report_conf.set('PYTHON', python_name)
|
||||
configure_file(
|
||||
input: 'gtester-report.in',
|
||||
output: 'gtester-report',
|
||||
- install_dir: get_option('bindir'),
|
||||
+ install_dir: get_option('devbindir'),
|
||||
configuration: report_conf,
|
||||
install_mode: 'rwxr-xr-x'
|
||||
)
|
||||
diff --git a/gobject/meson.build b/gobject/meson.build
|
||||
index 85e283bab..386ad5e4e 100644
|
||||
--- a/gobject/meson.build
|
||||
+++ b/gobject/meson.build
|
||||
@@ -75,7 +75,7 @@ foreach tool: python_tools
|
||||
input : tool + '.in',
|
||||
output : tool,
|
||||
configuration : python_tools_conf,
|
||||
- install_dir : glib_bindir,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
)
|
||||
|
||||
# Set variables for later use
|
||||
@@ -145,6 +145,7 @@ libgobject_dep = declare_dependency(link_with : libgobject,
|
||||
|
||||
executable('gobject-query', 'gobject-query.c',
|
||||
install : true,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
dependencies : [libglib_dep, libgobject_dep])
|
||||
|
||||
install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 484f4c750..c7f9327d9 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -2122,7 +2122,7 @@ if have_sh
|
||||
gettextize_conf.set('datarootdir', glib_datadir)
|
||||
gettextize_conf.set('datadir', glib_datadir)
|
||||
configure_file(input : 'glib-gettextize.in',
|
||||
- install_dir : glib_bindir,
|
||||
+ install_dir : get_option('devbindir'),
|
||||
output : 'glib-gettextize',
|
||||
configuration : gettextize_conf)
|
||||
endif
|
||||
diff --git a/meson_options.txt b/meson_options.txt
|
||||
index 2c831e37e..5d8928577 100644
|
||||
--- a/meson_options.txt
|
||||
+++ b/meson_options.txt
|
||||
@@ -3,6 +3,11 @@ option('runtime_libdir',
|
||||
value : '',
|
||||
description : 'install runtime libraries relative to libdir')
|
||||
|
||||
+option('devbindir',
|
||||
+ type : 'string',
|
||||
+ value : '',
|
||||
+ description : 'bindir for development tools')
|
||||
+
|
||||
option('iconv',
|
||||
type : 'combo',
|
||||
choices : ['auto', 'libc', 'external'],
|
||||
Loading…
Add table
Add a link
Reference in a new issue