aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/libraries/glib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/glib/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/default.nix85
1 files changed, 53 insertions, 32 deletions
diff --git a/nixpkgs/pkgs/development/libraries/glib/default.nix b/nixpkgs/pkgs/development/libraries/glib/default.nix
index de7505e6cde..bbe503a67f3 100644
--- a/nixpkgs/pkgs/development/libraries/glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glib/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, fetchurl, gettext, meson, ninja, pkgconfig, perl, python3, glibcLocales
+{ config, stdenv, fetchurl, gettext, meson, ninja, pkgconfig, perl, python3
, libiconv, zlib, libffi, pcre, libelf, gnome3, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
# use utillinuxMinimal to avoid circular dependency (utillinux, systemd, glib)
, utillinuxMinimal ? null
@@ -8,7 +8,7 @@
, doCheck ? config.doCheckByDefault or false
, coreutils, dbus, libxml2, tzdata
, desktop-file-utils, shared-mime-info
-, darwin
+, darwin, fetchpatch
}:
with stdenv.lib;
@@ -44,32 +44,59 @@ let
done
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
'';
-
- binPrograms = optional (!stdenv.isDarwin) "gapplication" ++ [ "gdbus" "gio" "gsettings" ];
in
stdenv.mkDerivation rec {
pname = "glib";
- version = "2.60.7";
+ version = "2.62.0";
src = fetchurl {
url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
- sha256 = "0433m0na8nc4cf0gidf4gfzz8k5d3dsssmh541qkpzcsaspw04lb";
+ sha256 = "046sqfmr84blxh4vkipmh8ff7wd19fxmh6lnr5ibchx3l02p49bc";
};
- patches = optional stdenv.isDarwin ./darwin-compilation.patch
- ++ optional doCheck ./skip-timer-test.patch
- ++ optionals stdenv.hostPlatform.isMusl [
- ./quark_init_on_demand.patch
- ./gobject_init_on_demand.patch
- ] ++ [
- ./schema-override-variable.patch
- # Require substituteInPlace in postPatch
- ./fix-gio-launch-desktop-path.patch
- ];
+ patches = optionals stdenv.isDarwin [
+ ./darwin-compilation.patch
+ # fix loading dylibs on darwin
+ # Remove on 2.62.1
+ (fetchpatch {
+ url = "https://gitlab.gnome.org/GNOME/glib/commit/e2409e5e180f1fa369d0e87e38e4d646d9f68791.patch";
+ sha256 = "1dhjwlsqdgnn8fr8pzfrnd63m7pdgf7mizdyn8lwg17ggvq6qsqf";
+ })
+ ] ++ optionals stdenv.hostPlatform.isMusl [
+ ./quark_init_on_demand.patch
+ ./gobject_init_on_demand.patch
+ ] ++ [
+ ./schema-override-variable.patch
+ # Require substituteInPlace in postPatch
+ ./fix-gio-launch-desktop-path.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" ];
- outputBin = "dev";
setupHook = ./setup-hook.sh;
@@ -84,7 +111,7 @@ stdenv.mkDerivation rec {
]);
nativeBuildInputs = [
- meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales
+ meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45
];
propagatedBuildInputs = [ zlib libffi gettext libiconv ];
@@ -94,10 +121,9 @@ stdenv.mkDerivation rec {
# Instead we just copy them over from the native output.
"-Dgtk_doc=${if stdenv.hostPlatform == stdenv.buildPlatform then "true" else "false"}"
"-Dnls=enabled"
+ "-Ddevbindir=${placeholder ''dev''}/bin"
];
- LC_ALL = "en_US.UTF-8";
-
NIX_CFLAGS_COMPILE = [
"-Wno-error=nonnull"
# Default for release buildtype but passed manually because
@@ -111,6 +137,8 @@ stdenv.mkDerivation rec {
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 tests/gen-casefold-txt.py
patchShebangs tests/gen-casemap-txt.py
@@ -122,18 +150,6 @@ stdenv.mkDerivation rec {
DETERMINISTIC_BUILD = 1;
postInstall = ''
- mkdir -p $bin/bin
- for app in ${concatStringsSep " " binPrograms}; do
- mv "$dev/bin/$app" "$bin/bin"
- done
-
- '' + optionalString (!stdenv.isDarwin) ''
- # Add gio-launch-desktop to $out so we can refer to it from $dev
- mkdir $out/bin
- mv "$dev/bin/gio-launch-desktop" "$out/bin/"
- ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
-
- '' + ''
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|"
@@ -141,6 +157,11 @@ stdenv.mkDerivation rec {
# 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.isDarwin) ''
+ # Add gio-launch-desktop to $out so we can refer to it from $lib
+ mkdir $out/bin
+ mv "$bin/bin/gio-launch-desktop" "$out/bin/"
+ ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
'' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
cp -r ${buildPackages.glib.devdoc} $devdoc
'';