push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,180 @@
{
config,
lib,
stdenv,
fetchurl,
fetchpatch,
atk,
buildPackages,
cairo,
cups,
gdk-pixbuf,
gettext,
glib,
gobject-introspection,
libXcomposite,
libXcursor,
libXdamage,
libXi,
libXinerama,
libXrandr,
libXrender,
pango,
perl,
pkg-config,
replaceVars,
testers,
gdktarget ? if stdenv.hostPlatform.isDarwin then "quartz" else "x11",
cupsSupport ? config.gtk2.cups or stdenv.hostPlatform.isLinux,
xineramaSupport ? stdenv.hostPlatform.isLinux,
}:
let
gtkCleanImmodulesCache = replaceVars ./hooks/clean-immodules-cache.sh {
gtk_module_path = "gtk-2.0";
gtk_binary_version = "2.10.0";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "gtk+";
version = "2.24.33";
src = fetchurl {
url = "mirror://gnome/sources/gtk+/2.24/gtk+-${finalAttrs.version}.tar.xz";
hash = "sha256-rCrHV/WULTGKMRpUsMgLXvKV8pnCpzxjL2v7H/Scxto=";
};
outputs = [
"out"
"dev"
"devdoc"
];
outputBin = "dev";
setupHooks = [
./hooks/drop-icon-theme-cache.sh
gtkCleanImmodulesCache
];
nativeBuildInputs = finalAttrs.setupHooks ++ [
gdk-pixbuf
gettext
gobject-introspection
perl
pkg-config
];
patches = [
./patches/2.0-immodules.cache.patch
./patches/gtk2-theme-paths.patch
(fetchpatch {
# https://gitlab.gnome.org/GNOME/gtk/-/issues/6786
name = "CVE-2024-6655.patch";
url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/3bbf0b6176d42836d23c36a6ac410e807ec0a7a7.patch";
hash = "sha256-mstOPk9NNpUwScrdEbvGhmAv8jlds3SBdj53T0q33vM=";
})
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
./patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch
./patches/2.0-darwin-x11.patch
# Fixes an incompatible function pointer conversion and implicit int errors with clang 16.
./patches/2.0-clang.patch
];
propagatedBuildInputs = [
atk
cairo
gdk-pixbuf
glib
pango
]
++ lib.optionals (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin) [
libXcomposite
libXcursor
libXi
libXrandr
libXrender
]
++ lib.optional xineramaSupport libXinerama
++ lib.optional cupsSupport cups
++ lib.optionals stdenv.hostPlatform.isDarwin [
libXdamage
];
preConfigure = lib.optionalString (
stdenv.hostPlatform.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11"
) "MACOSX_DEPLOYMENT_TARGET=10.16";
configureFlags = [
"--sysconfdir=/etc"
"--with-gdktarget=${gdktarget}"
"--with-xinput=yes"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"--disable-glibtest"
"--disable-introspection"
"--disable-visibility"
]
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"ac_cv_path_GTK_UPDATE_ICON_CACHE=${buildPackages.gtk2}/bin/gtk-update-icon-cache"
"ac_cv_path_GDK_PIXBUF_CSOURCE=${buildPackages.gdk-pixbuf.dev}/bin/gdk-pixbuf-csource"
];
env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=implicit-int"
"-Wno-error=incompatible-pointer-types"
];
};
enableParallelBuilding = true;
installFlags = [
"sysconfdir=${placeholder "out"}/etc"
];
doCheck = false; # needs X11
postInstall = ''
moveToOutput share/gtk-2.0/demo "$devdoc"
# The updater is needed for nixos env and it's tiny.
moveToOutput bin/gtk-update-icon-cache "$out"
'';
passthru = {
gtkExeEnvPostBuild = ''
rm $out/lib/gtk-2.0/2.10.0/immodules.cache
$out/bin/gtk-query-immodules-2.0 $out/lib/gtk-2.0/2.10.0/immodules/*.so > $out/lib/gtk-2.0/2.10.0/immodules.cache
''; # workaround for bug of nix-mode for Emacs */ '';
inherit gdktarget;
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = {
homepage = "https://www.gtk.org/";
description = "Multi-platform toolkit for creating graphical user interfaces";
longDescription = ''
GTK is a highly usable, feature rich toolkit for creating graphical user
interfaces which boasts cross platform compatibility and an easy to use
API. GTK it is written in C, but has bindings to many other popular
programming languages such as C++, Python and C# among others. GTK is
licensed under the GNU LGPL 2.1 allowing development of both free and
proprietary software with GTK without any license fees or royalties.
'';
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${finalAttrs.version}/NEWS";
license = lib.licenses.lgpl2Plus;
maintainers = with lib.maintainers; [
lovek323
raskin
];
platforms = lib.platforms.all;
pkgConfigModules = [
"gdk-2.0"
"gtk+-2.0"
]
++ lib.optionals (gdktarget == "x11") [
"gdk-x11-2.0"
"gtk+-x11-2.0"
];
};
})

View File

@@ -0,0 +1,299 @@
{
lib,
stdenv,
replaceVars,
fetchurl,
pkg-config,
gettext,
docbook-xsl-nons,
docbook_xml_dtd_43,
gtk-doc,
meson,
mesonEmulatorHook,
ninja,
python3,
makeWrapper,
shared-mime-info,
isocodes,
expat,
glib,
cairo,
pango,
gdk-pixbuf,
atk,
at-spi2-atk,
gobject-introspection,
buildPackages,
withIntrospection ?
lib.meta.availableOn stdenv.hostPlatform gobject-introspection
&& stdenv.hostPlatform.emulatorAvailable buildPackages,
compileSchemas ? stdenv.hostPlatform.emulatorAvailable buildPackages,
fribidi,
xorg,
libepoxy,
libxkbcommon,
libxml2,
gnome,
gsettings-desktop-schemas,
sassc,
trackerSupport ? stdenv.hostPlatform.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform),
tinysparql,
x11Support ? stdenv.hostPlatform.isLinux,
waylandSupport ? stdenv.hostPlatform.isLinux,
libGL,
wayland,
wayland-protocols,
xineramaSupport ? stdenv.hostPlatform.isLinux,
cupsSupport ? stdenv.hostPlatform.isLinux,
cups,
broadwaySupport ? true,
wayland-scanner,
testers,
}:
let
gtkCleanImmodulesCache = replaceVars ./hooks/clean-immodules-cache.sh {
gtk_module_path = "gtk-3.0";
gtk_binary_version = "3.0.0";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "gtk+3";
version = "3.24.49";
outputs = [
"out"
"dev"
]
++ lib.optional withIntrospection "devdoc";
outputBin = "dev";
setupHooks = [
./hooks/drop-icon-theme-cache.sh
gtkCleanImmodulesCache
];
src =
let
inherit (finalAttrs) version;
in
fetchurl {
url = "mirror://gnome/sources/gtk/${lib.versions.majorMinor version}/gtk-${version}.tar.xz";
hash = "sha256-XqUsaijw5ezy6aPC+suzDQQLc4cfzV8zzRMX6QGKFG4=";
};
patches = [
./patches/3.0-immodules.cache.patch
./patches/3.0-Xft-setting-fallback-compute-DPI-properly.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
# lets drop that dependency in similar way to how other parts of the library do it
# e.g. https://gitlab.gnome.org/GNOME/gtk/blob/3.24.4/gtk/gtk-launch.c#L31-33
# https://gitlab.gnome.org/GNOME/gtk/merge_requests/536
./patches/3.0-darwin-x11.patch
];
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
gettext
makeWrapper
meson
ninja
pkg-config
python3
sassc
gdk-pixbuf
]
++ finalAttrs.setupHooks
++ lib.optionals withIntrospection [
gobject-introspection
docbook_xml_dtd_43
docbook-xsl-nons
gtk-doc
# For xmllint
libxml2
]
++
lib.optionals
((withIntrospection || compileSchemas) && !stdenv.buildPlatform.canExecute stdenv.hostPlatform)
[
mesonEmulatorHook
]
++ lib.optionals waylandSupport [
wayland-scanner
];
buildInputs =
lib.optionals (x11Support || waylandSupport) [
# TODO: Reorder me on `staging`.
libxkbcommon
]
++ [
(libepoxy.override { inherit x11Support; })
]
++ lib.optionals (x11Support || waylandSupport) [
isocodes
]
++ lib.optionals trackerSupport [
tinysparql
];
#TODO: colord?
propagatedBuildInputs = [
at-spi2-atk
atk
cairo
expat
fribidi
gdk-pixbuf
glib
gsettings-desktop-schemas
]
++ lib.optionals x11Support (
with xorg;
[
libICE
libSM
libXcomposite
libXcursor
libXdamage
libXfixes
libXi
libXrandr
libXrender
]
)
++ [
# TODO: Reorder me on `staging`.
pango
]
++ lib.optionals waylandSupport [
libGL
wayland
wayland-protocols
]
++ lib.optionals xineramaSupport [
xorg.libXinerama
]
++ lib.optionals cupsSupport [
cups
];
mesonFlags = [
"-Dgtk_doc=${lib.boolToString withIntrospection}"
"-Dtests=false"
"-Dtracker3=${lib.boolToString trackerSupport}"
"-Dbroadway_backend=${lib.boolToString broadwaySupport}"
"-Dx11_backend=${lib.boolToString x11Support}"
"-Dquartz_backend=${lib.boolToString (stdenv.hostPlatform.isDarwin && !x11Support)}"
"-Dintrospection=${lib.boolToString withIntrospection}"
];
doCheck = false; # needs X11
separateDebugInfo = stdenv.hostPlatform.isLinux;
# These are the defines that'd you'd get with --enable-debug=minimum (default).
# See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
env.NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
postPatch = ''
# See https://github.com/NixOS/nixpkgs/issues/132259
substituteInPlace meson.build \
--replace "x11_enabled = false" ""
# this conditional gates the installation of share/gsettings-schemas/.../glib-2.0/schemas/gschemas.compiled.
substituteInPlace meson.build \
--replace 'if not meson.is_cross_build()' 'if ${lib.boolToString compileSchemas}'
files=(
build-aux/meson/post-install.py
demos/gtk-demo/geninclude.py
gdk/broadway/gen-c-array.py
gdk/gen-gdk-gresources-xml.py
gtk/cursor/dnd-copy.png
gtk/gen-gtk-gresources-xml.py
gtk/gen-rc.py
gtk/gentypefuncs.py
)
chmod +x ''${files[@]}
patchShebangs ''${files[@]}
'';
postInstall =
lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
# The updater is needed for nixos env and it's tiny.
moveToOutput bin/gtk-update-icon-cache "$out"
# Launcher
moveToOutput bin/gtk-launch "$out"
# Broadway daemon
moveToOutput bin/broadwayd "$out"
# TODO: patch glib directly
for f in $dev/bin/gtk-encode-symbolic-svg; do
wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
done
''
+ lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) ''
GTK_PATH="''${out:?}/lib/gtk-3.0/3.0.0/immodules/" ''${dev:?}/bin/gtk-query-immodules-3.0 > "''${out:?}/lib/gtk-3.0/3.0.0/immodules.cache"
'';
# Wrap demos
postFixup =
lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
demos=(gtk3-demo gtk3-demo-application gtk3-icon-browser gtk3-widget-factory)
for program in ''${demos[@]}; do
wrapProgram $dev/bin/$program \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${finalAttrs.pname}-${finalAttrs.version}"
done
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# a comment created a cycle between outputs
sed '/^# ModulesPath =/d' -i "$out"/lib/gtk-*/*/immodules.cache
'';
passthru = {
updateScript = gnome.updateScript {
packageName = "gtk";
attrPath = "gtk3";
freeze = true;
};
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = with lib; {
description = "Multi-platform toolkit for creating graphical user interfaces";
longDescription = ''
GTK is a highly usable, feature rich toolkit for creating
graphical user interfaces which boasts cross platform
compatibility and an easy to use API. GTK it is written in C,
but has bindings to many other popular programming languages
such as C++, Python and C# among others. GTK is licensed
under the GNU LGPL 2.1 allowing development of both free and
proprietary software with GTK without any license fees or
royalties.
'';
homepage = "https://www.gtk.org/";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ raskin ];
teams = [ teams.gnome ];
pkgConfigModules = [
"gdk-3.0"
"gtk+-3.0"
]
++ lib.optionals x11Support [
"gdk-x11-3.0"
"gtk+-x11-3.0"
];
platforms = platforms.all;
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${finalAttrs.version}/NEWS";
};
})

View File

@@ -0,0 +1,317 @@
{
lib,
stdenv,
buildPackages,
replaceVars,
fetchurl,
pkg-config,
docutils,
gettext,
graphene,
gi-docgen,
meson,
mesonEmulatorHook,
ninja,
python3,
makeWrapper,
shared-mime-info,
isocodes,
glib,
cairo,
pango,
gdk-pixbuf,
gobject-introspection,
fribidi,
harfbuzz,
xorg,
libepoxy,
libxkbcommon,
libpng,
libtiff,
libjpeg,
libxml2,
gnome,
gsettings-desktop-schemas,
gst_all_1,
sassc,
trackerSupport ? stdenv.hostPlatform.isLinux,
tinysparql,
x11Support ? stdenv.hostPlatform.isLinux,
waylandSupport ? stdenv.hostPlatform.isLinux,
libGL,
vulkanSupport ? stdenv.hostPlatform.isLinux,
shaderc,
vulkan-loader,
vulkan-headers,
libdrm,
wayland,
wayland-protocols,
wayland-scanner,
xineramaSupport ? stdenv.hostPlatform.isLinux,
cupsSupport ? stdenv.hostPlatform.isLinux,
compileSchemas ? stdenv.hostPlatform.emulatorAvailable buildPackages,
cups,
libexecinfo,
broadwaySupport ? true,
testers,
darwinMinVersionHook,
}:
let
gtkCleanImmodulesCache = replaceVars ./hooks/clean-immodules-cache.sh {
gtk_module_path = "gtk-4.0";
gtk_binary_version = "4.0.0";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "gtk4";
version = "4.18.6";
outputs = [
"out"
"dev"
]
++ lib.optionals x11Support [ "devdoc" ];
outputBin = "dev";
setupHooks = [
./hooks/drop-icon-theme-cache.sh
gtkCleanImmodulesCache
];
src = fetchurl {
url = "mirror://gnome/sources/gtk/${lib.versions.majorMinor finalAttrs.version}/gtk-${finalAttrs.version}.tar.xz";
hash = "sha256-4YF8ZQ3cMmH5qDRbOyKial2ArxVGMN7cA8x77O//0Po=";
};
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
docutils # for rst2man, rst2html5
gettext
gobject-introspection
makeWrapper
meson
ninja
pkg-config
python3
sassc
gi-docgen
libxml2 # for xmllint
]
++ lib.optionals (compileSchemas && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
]
++ lib.optionals waylandSupport [
wayland-scanner
]
++ lib.optionals vulkanSupport [
shaderc # for glslc
]
++ finalAttrs.setupHooks;
buildInputs = [
libxkbcommon
libpng
libtiff
libjpeg
(libepoxy.override { inherit x11Support; })
isocodes
]
++ lib.optionals vulkanSupport [
vulkan-headers
libdrm
]
++ [
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-bad
fribidi
harfbuzz
]
++ (with xorg; [
libICE
libSM
libXcursor
libXdamage
libXi
libXrandr
libXrender
])
++ lib.optionals trackerSupport [
tinysparql
]
++ lib.optionals waylandSupport [
libGL
wayland
wayland-protocols
]
++ lib.optionals xineramaSupport [
xorg.libXinerama
]
++ lib.optionals cupsSupport [
cups
]
++ lib.optionals stdenv.hostPlatform.isMusl [
libexecinfo
];
#TODO: colord?
propagatedBuildInputs = [
# Required by pkg-config files.
cairo
gdk-pixbuf
glib
graphene
pango
]
++ lib.optionals waylandSupport [
wayland
]
++ lib.optionals vulkanSupport [
vulkan-loader
]
++ [
# Required for GSettings schemas at runtime.
# Will be picked up by wrapGAppsHook4.
gsettings-desktop-schemas
];
mesonFlags = [
# ../docs/tools/shooter.c:4:10: fatal error: 'cairo-xlib.h' file not found
(lib.mesonBool "documentation" x11Support)
"-Dbuild-tests=false"
(lib.mesonEnable "tracker" trackerSupport)
(lib.mesonBool "broadway-backend" broadwaySupport)
(lib.mesonEnable "vulkan" vulkanSupport)
(lib.mesonEnable "print-cups" cupsSupport)
(lib.mesonBool "x11-backend" x11Support)
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isAarch64) [
"-Dmedia-gstreamer=disabled" # requires gstreamer-gl
];
doCheck = false; # needs X11
separateDebugInfo = stdenv.hostPlatform.isLinux;
# These are the defines that'd you'd get with --enable-debug=minimum (default).
# See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
env = {
NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
}
// lib.optionalAttrs stdenv.hostPlatform.isMusl {
NIX_LDFLAGS = "-lexecinfo";
};
postPatch = ''
# this conditional gates the installation of share/gsettings-schemas/.../glib-2.0/schemas/gschemas.compiled.
substituteInPlace meson.build \
--replace 'if not meson.is_cross_build()' 'if ${lib.boolToString compileSchemas}'
files=(
build-aux/meson/gen-profile-conf.py
build-aux/meson/gen-visibility-macros.py
demos/gtk-demo/geninclude.py
gdk/broadway/gen-c-array.py
gdk/gen-gdk-gresources-xml.py
gtk/gen-gtk-gresources-xml.py
gtk/gentypefuncs.py
)
chmod +x ''${files[@]}
patchShebangs ''${files[@]}
'';
preInstall = ''
OLD_PATH="$PATH"
PATH="$PATH:$dev/bin" # so the install script finds gtk4-update-icon-cache
'';
postInstall = ''
PATH="$OLD_PATH"
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
# The updater is needed for nixos env and it's tiny.
moveToOutput bin/gtk4-update-icon-cache "$out"
# Launcher
moveToOutput bin/gtk-launch "$out"
# TODO: patch glib directly
for f in $dev/bin/gtk4-encode-symbolic-svg; do
wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
done
''
+ lib.optionalString broadwaySupport ''
# Broadway daemon
moveToOutput bin/gtk4-broadwayd "$out"
'';
# Wrap demos
postFixup =
lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
demos=(gtk4-demo gtk4-demo-application gtk4-widget-factory)
for program in ''${demos[@]}; do
wrapProgram $dev/bin/$program \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${finalAttrs.pname}-${finalAttrs.version}"
done
''
+ lib.optionalString x11Support ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
moveToOutput "share/doc" "$devdoc"
'';
passthru = {
updateScript = gnome.updateScript {
packageName = "gtk";
versionPolicy = "odd-unstable";
attrPath = "gtk4";
};
tests = {
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
};
};
meta = with lib; {
description = "Multi-platform toolkit for creating graphical user interfaces";
longDescription = ''
GTK is a highly usable, feature rich toolkit for creating
graphical user interfaces which boasts cross platform
compatibility and an easy to use API. GTK it is written in C,
but has bindings to many other popular programming languages
such as C++, Python and C# among others. GTK is licensed
under the GNU LGPL 2.1 allowing development of both free and
proprietary software with GTK without any license fees or
royalties.
'';
homepage = "https://www.gtk.org/";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ raskin ];
teams = [ teams.gnome ];
platforms = platforms.all;
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${finalAttrs.version}/NEWS";
pkgConfigModules = [
"gtk4"
]
++ lib.optionals broadwaySupport [
"gtk4-broadway"
]
++ lib.optionals stdenv.hostPlatform.isUnix [
"gtk4-unix-print"
]
++ lib.optionals waylandSupport [
"gtk4-wayland"
]
++ lib.optionals x11Support [
"gtk4-x11"
];
};
})

View File

@@ -0,0 +1,15 @@
# shellcheck shell=bash
fixupOutputHooks+=(_gtkCleanImmodulesCache)
# Clean comments that link to generator of the file
_gtkCleanImmodulesCache() {
# gtk_module_path is where the modules are installed
# https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.24/gtk/gtkmodules.c#L68
# gtk_binary_version can be retrived with:
# pkg-config --variable=gtk_binary_version gtk+-3.0
local f="${prefix:?}/lib/@gtk_module_path@/@gtk_binary_version@/immodules.cache"
if [ -f "$f" ]; then
sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
fi
}

View File

@@ -0,0 +1,19 @@
# shellcheck shell=bash
# Packages often run gtk-update-icon-cache to include their icons in themes icon cache.
# However, since each package is installed to its own prefix, the files will only collide.
dropIconThemeCache() {
if [[ -z "${dontDropIconThemeCache:-}" ]]; then
local icondir="${out:?}/share/icons"
if [[ -d "${icondir}" ]]; then
# App icons are supposed to go to hicolor theme, since it is a fallback theme as per [icon-theme-spec], but some might still choose to install stylized icons to other themes.
find "${icondir}" -name 'icon-theme.cache' -print0 \
| while IFS= read -r -d '' file; do
echo "Removing ${file}"
rm -f "${file}"
done
fi
fi
}
appendToVar preFixupPhases dropIconThemeCache

View File

@@ -0,0 +1,49 @@
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 4317523fb8..3c09cd3ae8 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1471,7 +1471,7 @@ gtk_scale_add_mark (GtkScale *scale,
mark->position = position;
priv->marks = g_slist_insert_sorted_with_data (priv->marks, mark,
- (GCompareFunc) compare_marks,
+ (GCompareDataFunc) compare_marks,
GINT_TO_POINTER (
gtk_range_get_inverted (GTK_RANGE (scale))
));
diff --git a/tests/testmenubars.c b/tests/testmenubars.c
index 416a939861..c65e82be26 100644
--- a/tests/testmenubars.c
+++ b/tests/testmenubars.c
@@ -21,7 +21,7 @@
#include <gtk/gtk.h>
static GtkWidget *
-create_menu (depth)
+create_menu (int depth, gboolean _unused)
{
GtkWidget *menu;
GtkWidget *menuitem;
@@ -35,19 +35,19 @@ create_menu (depth)
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
- create_menu (depth - 1));
+ create_menu (depth - 1, _unused));
menuitem = gtk_menu_item_new_with_mnemonic ("Two");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
- create_menu (depth - 1));
+ create_menu (depth - 1, _unused));
menuitem = gtk_menu_item_new_with_mnemonic ("Three");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
- create_menu (depth - 1));
+ create_menu (depth - 1, _unused));
return menu;
}

View File

@@ -0,0 +1,22 @@
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -26,7 +26,6 @@
#include <unistd.h>
#include <glib.h>
-#include <gio/gdesktopappinfo.h>
#include "gdkx.h"
#include "gdkapplaunchcontext.h"
@@ -363,10 +362,7 @@
else
workspace_str = NULL;
- if (G_IS_DESKTOP_APP_INFO (info))
- application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
- else
- application_id = NULL;
+ application_id = NULL;
startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
g_get_prgname (),

View File

@@ -0,0 +1,54 @@
From 8b822ab0060acdf4217f589411fe71574cbb09c0 Mon Sep 17 00:00:00 2001
From: Daniel Trebbien <dtrebbien@gmail.com>
Date: Fri, 3 Jul 2015 12:08:18 -0400
Subject: [PATCH] quartz: Bug 557780 - Missing support for depth == 1 in
gdk_image_new_for_depth()
When the gtk2 client of Freeciv is started, an assertion failure is seen
immediately and the client stops:
"Gdk:ERROR:gdkimage-quartz.c:325:_gdk_image_new_for_depth: assertion
failed: (depth == 24 || depth == 32)"
In this case, _gdk_image_new_for_depth() is being called from
_gdk_quartz_image_copy_to_image(). The GdkImage passed to this function
is NULL so a new GdkImage is created. However, the depth of the passed
GdkDrawable is 1 and this is passed directly as the `depth' parameter to
_gdk_image_new_for_depth(), leading to the assertion failure.
In _gdk_quartz_image_copy_to_image(), rather than directly pass the
GdkDrawable's depth to _gdk_image_new_for_depth(), if the depth is 1,
then create the new GdkImage with depth 24. The case where the depth is
1 is already handled in _gdk_quartz_image_copy_to_image().
This allows the Freeciv 2.5.0 gtk2 client to start and play a game.
---
gdk/quartz/gdkimage-quartz.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/gdk/quartz/gdkimage-quartz.c b/gdk/quartz/gdkimage-quartz.c
index 493efba..853ef61 100644
--- a/gdk/quartz/gdkimage-quartz.c
+++ b/gdk/quartz/gdkimage-quartz.c
@@ -43,10 +43,15 @@ _gdk_quartz_image_copy_to_image (GdkDrawable *drawable,
screen = gdk_drawable_get_screen (drawable);
if (!image)
- image = _gdk_image_new_for_depth (screen, GDK_IMAGE_FASTEST, NULL,
- width, height,
- gdk_drawable_get_depth (drawable));
-
+ {
+ gint drawable_depth = gdk_drawable_get_depth (drawable);
+ if (drawable_depth == 1)
+ drawable_depth = 24;
+ image = _gdk_image_new_for_depth (screen, GDK_IMAGE_FASTEST, NULL,
+ width, height,
+ drawable_depth);
+ }
+
if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable))
{
GdkPixmapImplQuartz *pix_impl;
--
2.3.2 (Apple Git-55)

View File

@@ -0,0 +1,27 @@
--- a/gtk/gtkrc.c 2014-09-30 05:02:17.000000000 +0900
+++ b/gtk/gtkrc.c 2016-04-09 17:39:51.363288355 +0900
@@ -445,5 +445,23 @@
if (var)
result = g_strdup (var);
+ // check NIX_PROFILES paths.
+ const gchar *nixProfilesEnv = g_getenv ("NIX_PROFILES");
+ gchar *cachePath;
+ guint i;
+
+ if(nixProfilesEnv && !result){
+ gchar **paths = g_strsplit(nixProfilesEnv, " ", -1);
+ for (i = 0; paths[i] != NULL; i++){
+ cachePath = g_build_filename(paths[i], "etc", "gtk-2.0", "immodules.cache", NULL);
+ if( g_file_test( cachePath, G_FILE_TEST_EXISTS) ){
+ if(result) g_free(result);
+ result = g_strdup(cachePath);
+ }
+ g_free(cachePath);
+ }
+ g_strfreev(paths);
+ }
+
if (!result)
{

View File

@@ -0,0 +1,34 @@
From 269f2d80ea41cde17612600841fbdc32e99010f5 Mon Sep 17 00:00:00 2001
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date: Tue, 24 Jan 2017 12:30:08 +0100
Subject: [PATCH] Xft setting fallback: compute DPI properly
This is a partial revert of bdf0820c501437a2150d8ff0d5340246e713f73f. If
the Xft DPI settings are not explicitly set, use the values provided by
the X server rather than hard-coding the fallback value of 96.
While an auto-configured Xorg already reports 96, this value can be
overriden by the user, and we should respect the user choice in this
case. There is no need to require them to set the same value in
different places (the Xorg DPI settings and Xft.dpi).
---
gdk/x11/gdkxftdefaults.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdk/x11/gdkxftdefaults.c b/gdk/x11/gdkxftdefaults.c
index fa1cfde2ec..c462b78c4b 100644
--- a/gdk/x11/gdkxftdefaults.c
+++ b/gdk/x11/gdkxftdefaults.c
@@ -174,7 +174,8 @@ init_xft_settings (GdkScreen *screen)
x11_screen->xft_rgba = FC_RGBA_UNKNOWN;
if (!get_double_default (xdisplay, "dpi", &dpi_double))
- dpi_double = 96.0;
+ dpi_double = (DisplayHeight(xdisplay, x11_screen->screen_num)*25.4)/
+ DisplayHeightMM(xdisplay, x11_screen->screen_num);
x11_screen->xft_dpi = (int)(0.5 + PANGO_SCALE * dpi_double);
}
--
2.11.0.616.gd72966cf44.dirty

View File

@@ -0,0 +1,28 @@
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -27,7 +27,9 @@
#include "gdkprivate-x11.h"
#include <glib.h>
+#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
#include <gio/gdesktopappinfo.h>
+#endif
#include <string.h>
#include <unistd.h>
@@ -352,10 +354,15 @@
else
workspace_str = NULL;
+#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
if (G_IS_DESKTOP_APP_INFO (info))
application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
else
application_id = NULL;
+#else
+ application_id = NULL;
+#warning Please add support for creating AppInfo from id for your OS
+#endif
startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
g_get_prgname (),

View File

@@ -0,0 +1,27 @@
--- a/gtk/deprecated/gtkrc.c 2016-04-02 18:43:08.401663112 +0900
+++ b/gtk/deprecated/gtkrc.c 2016-04-02 18:29:19.927608592 +0900
@@ -774,5 +774,23 @@
if (var)
result = g_strdup (var);
+ // check NIX_PROFILES paths.
+ const gchar *nixProfilesEnv = g_getenv ("NIX_PROFILES");
+ gchar *cachePath;
+ guint i;
+
+ if(nixProfilesEnv && !result){
+ gchar **paths = g_strsplit(nixProfilesEnv, " ", -1);
+ for (i = 0; paths[i] != NULL; i++){
+ cachePath = g_build_filename(paths[i], "etc", "gtk-3.0", "immodules.cache", NULL);
+ if( g_file_test( cachePath, G_FILE_TEST_EXISTS) ){
+ if(result) g_free(result);
+ result = g_strdup(cachePath);
+ }
+ g_free(cachePath);
+ }
+ g_strfreev(paths);
+ }
+
if (!result)
{

View File

@@ -0,0 +1,40 @@
Subject: [PATCHv2] gtk: Patch GTK+ to look for themes in profiles.
To: guix-devel@gnu.org
Date: Sun, 13 Mar 2016 15:17:37 +1100
Url: https://lists.gnu.org/archive/html/guix-devel/2016-03/msg00492.html
diff -Naur gtk+-2.24.28.new/gtk/gtkrc.c gtk+-2.24.28/gtk/gtkrc.c
--- gtk+-2.24.28.new/gtk/gtkrc.c 2016-03-13 10:31:14.413644362 +1100
+++ gtk+-2.24.28/gtk/gtkrc.c 2016-03-13 12:51:34.723398423 +1100
@@ -808,6 +808,8 @@
gchar *path = NULL;
const gchar *home_dir;
gchar *subpath;
+ const gchar * const *xdg_data_dirs;
+ gint i;
if (type)
subpath = g_strconcat ("gtk-2.0-", type,
@@ -830,6 +832,22 @@
}
if (!path)
+ {
+ xdg_data_dirs = g_get_system_data_dirs ();
+ for (i = 0; xdg_data_dirs[i]; i++)
+ {
+ path = g_build_filename (xdg_data_dirs[i], "themes", name, subpath, NULL);
+ if (g_file_test (path, G_FILE_TEST_EXISTS))
+ break;
+ else
+ {
+ g_free (path);
+ path = NULL;
+ }
+ }
+ }
+
+ if (!path)
{
gchar *theme_dir = gtk_rc_get_theme_dir ();
path = g_build_filename (theme_dir, name, subpath, NULL);