gtk: split hooks so gtk2 can use hicolor hook

This commit is contained in:
worldofpeace 2019-09-12 11:57:57 -04:00 committed by Jan Tojnar
parent b7ad6e1be5
commit b3995d40be
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
5 changed files with 24 additions and 15 deletions

View file

@ -25,9 +25,12 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
setupHook = ./setup-hook.sh;
setupHooks = [
./gtk2-clean-immodules-cache.sh
./drop-icon-theme-cache.sh
];
nativeBuildInputs = [ setupHook perl pkgconfig gettext gobject-introspection ];
nativeBuildInputs = [ setupHooks perl pkgconfig gettext gobject-introspection ];
patches = [
./2.0-immodules.cache.patch

View file

@ -49,7 +49,10 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
outputBin = "dev";
setupHook = ./gtk3-setup-hook.sh;
setupHooks = [
./gtk3-clean-immodules-cache.sh
./drop-icon-theme-cache.sh
];
src = fetchurl {
url = "mirror://gnome/sources/gtk+/${stdenv.lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
@ -108,7 +111,7 @@ stdenv.mkDerivation rec {
pkgconfig
python3
sassc
setupHook
setupHooks
];
buildInputs = [

View file

@ -1,15 +1,5 @@
# shellcheck shell=bash
fixupOutputHooks+=(_gtk3CleanComments)
# Clean comments that link to generator of the file
_gtk3CleanComments() {
local f="${prefix:?}/lib/gtk-3.0/3.0.0/immodules.cache"
if [ -f "$f" ]; then
sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
fi
}
# 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() {

View file

@ -1,8 +1,10 @@
# shellcheck shell=bash
fixupOutputHooks+=(_gtk2CleanComments)
# Clean comments that link to generator of the file
_gtk2CleanComments() {
local f="$prefix/lib/gtk-2.0/2.10.0/immodules.cache"
local f="${prefix:?}/lib/gtk-2.0/2.10.0/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,11 @@
# shellcheck shell=bash
fixupOutputHooks+=(_gtk3CleanComments)
# Clean comments that link to generator of the file
_gtk3CleanComments() {
local f="${prefix:?}/lib/gtk-3.0/3.0.0/immodules.cache"
if [ -f "$f" ]; then
sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
fi
}