gtk(2,3): simplify hooks and don't print 'No schema file found' in case when no glib schemas exist

This commit is contained in:
Leonid Pliushch 2018-10-06 15:34:11 +03:00 committed by Yaksh Bariya
parent 5d968b6a54
commit 13efba8427
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
14 changed files with 69 additions and 68 deletions

View File

@ -3,7 +3,7 @@ TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
TERMUX_PKG_HOMEPAGE=http://www.gtk.org/
TERMUX_PKG_DESCRIPTION="GObject-based multi-platform GUI toolkit (legacy)"
TERMUX_PKG_VERSION=2.24.32
TERMUX_PKG_REVISION=6
TERMUX_PKG_REVISION=7
TERMUX_PKG_SRCURL=https://github.com/GNOME/gtk/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=961678c64ad986029befd7bdd8ed3e3849e2c5e54d24affbc7d49758245c87fa
TERMUX_PKG_BUILD_IN_SRC=true
@ -35,9 +35,13 @@ termux_step_pre_configure() {
export LDFLAGS="${LDFLAGS} -landroid-shmem"
}
termux_step_create_debscripts()
{
cp "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
cp "${TERMUX_PKG_BUILDER_DIR}/postrm" ./
cp "${TERMUX_PKG_BUILDER_DIR}/triggers" ./
termux_step_create_debscripts() {
for i in postinst postrm triggers; do
sed \
"s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" \
"${TERMUX_PKG_BUILDER_DIR}/hooks/${i}.in" > ./${i}
chmod 755 ./${i}
done
unset i
chmod 644 ./triggers
}

View File

@ -0,0 +1,14 @@
#!@TERMUX_PREFIX@/bin/sh
gtk-query-immodules-2.0 --update-cache
for i in $(find "@TERMUX_PREFIX@/share/icons" -type f -iname index.theme); do
gtk-update-icon-cache --force --quiet $(dirname "${i}")
done
unset i
## Usually, glib and gdk-pixbuf should have own triggers
## but in Termux they don't have.
glib-compile-schemas "@TERMUX_PREFIX@/share/glib-2.0/schemas" > /dev/null
gdk-pixbuf-query-loaders --update-cache
exit 0

View File

@ -0,0 +1,8 @@
#!@TERMUX_PREFIX@/bin/sh
if [ -d "@TERMUX_PREFIX@/lib/gtk-2.0/2.10.0" ]; then
rm -f "@TERMUX_PREFIX@/lib/gtk-2.0/2.10.0/immodules.cache"
rmdir -p --ignore-fail-on-non-empty "@TERMUX_PREFIX@/lib/gtk-2.0/2.10.0"
fi
exit 0

View File

@ -0,0 +1,3 @@
interest-noawait @TERMUX_PREFIX@/lib/gtk-2.0/2.10.0
interest-noawait @TERMUX_PREFIX@/share/glib-2.0/schemas
interest-noawait @TERMUX_PREFIX@/share/icons

View File

@ -1,18 +0,0 @@
#!/data/data/com.termux/files/usr/bin/sh
set -e
PREFIX="/data/data/com.termux/files/usr"
gtk-query-immodules-2.0 --update-cache || true
for i in $(find "${PREFIX}/share/icons" -type f -iname index.theme); do
gtk-update-icon-cache --force --quiet $(dirname "${i}") || true
done
unset i
## Usually, glib and gdk-pixbuf should have own triggers
## but in Termux they don't have.
glib-compile-schemas "${PREFIX}/share/glib-2.0/schemas" || true
gdk-pixbuf-query-loaders --update-cache || true
if [ "${1}" = "triggered" ]; then
exit 0
fi

View File

@ -1,8 +0,0 @@
#!/data/data/com.termux/files/usr/bin/sh
set -e
PREFIX="/data/data/com.termux/files/usr"
if [ -d "${PREFIX}/lib/gtk-2.0/2.10.0" ]; then
rm -f "${PREFIX}/lib/gtk-2.0/2.10.0/immodules.cache"
rmdir -p --ignore-fail-on-non-empty "${PREFIX}/lib/gtk-2.0/2.10.0"
fi

View File

@ -1,3 +0,0 @@
interest-noawait /data/data/com.termux/files/usr/lib/gtk-2.0/2.10.0
interest-noawait /data/data/com.termux/files/usr/share/glib-2.0/schemas
interest-noawait /data/data/com.termux/files/usr/share/icons

View File

@ -3,7 +3,7 @@ TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
TERMUX_PKG_HOMEPAGE=http://www.gtk.org/
TERMUX_PKG_DESCRIPTION="GObject-based multi-platform GUI toolkit"
TERMUX_PKG_VERSION=3.24.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/GNOME/gtk/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=3dd9a8d52e6832e9294182c3a9d3b3979e9593db181101476323241ae67b4a44
TERMUX_PKG_BUILD_IN_SRC=true
@ -30,7 +30,12 @@ termux_step_pre_configure() {
}
termux_step_create_debscripts() {
cp "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
cp "${TERMUX_PKG_BUILDER_DIR}/postrm" ./
cp "${TERMUX_PKG_BUILDER_DIR}/triggers" ./
for i in postinst postrm triggers; do
sed \
"s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" \
"${TERMUX_PKG_BUILDER_DIR}/hooks/${i}.in" > ./${i}
chmod 755 ./${i}
done
unset i
chmod 644 ./triggers
}

View File

@ -0,0 +1,14 @@
#!@TERMUX_PREFIX@/bin/sh
gtk-query-immodules-3.0 --update-cache
for i in $(find "@TERMUX_PREFIX@/share/icons" -type f -iname index.theme); do
gtk-update-icon-cache --force --quiet $(dirname "${i}")
done
unset i
## Usually, glib and gdk-pixbuf should have own triggers
## but in Termux they don't have.
glib-compile-schemas "@TERMUX_PREFIX@/share/glib-2.0/schemas" > /dev/null
gdk-pixbuf-query-loaders --update-cache
exit 0

View File

@ -0,0 +1,8 @@
#!@TERMUX_PREFIX@/bin/sh
if [ -d "@TERMUX_PREFIX@/lib/gtk-3.0/3.0.0" ]; then
rm -f "@TERMUX_PREFIX@/lib/gtk-3.0/3.0.0/immodules.cache"
rmdir -p --ignore-fail-on-non-empty "@TERMUX_PREFIX@/lib/gtk-3.0/3.0.0"
fi
exit 0

View File

@ -0,0 +1,3 @@
interest-noawait @TERMUX_PREFIX@/lib/gtk-3.0/3.0.0
interest-noawait @TERMUX_PREFIX@/share/glib-2.0/schemas
interest-noawait @TERMUX_PREFIX@/share/icons

View File

@ -1,18 +0,0 @@
#!/data/data/com.termux/files/usr/bin/sh
set -e
PREFIX="/data/data/com.termux/files/usr"
gtk-query-immodules-3.0 --update-cache || true
for i in $(find "${PREFIX}/share/icons" -type f -iname index.theme); do
gtk-update-icon-cache --force --quiet $(dirname "${i}") || true
done
unset i
## Usually, glib and gdk-pixbuf should have own triggers
## but in Termux they don't have.
glib-compile-schemas "${PREFIX}/share/glib-2.0/schemas" || true
gdk-pixbuf-query-loaders --update-cache || true
if [ "${1}" = "triggered" ]; then
exit 0
fi

View File

@ -1,8 +0,0 @@
#!/data/data/com.termux/files/usr/bin/sh
set -e
PREFIX="/data/data/com.termux/files/usr"
if [ -d "${PREFIX}/lib/gtk-3.0/3.0.0" ]; then
rm -f "${PREFIX}/lib/gtk-3.0/3.0.0/immodules.cache"
rmdir -p --ignore-fail-on-non-empty "${PREFIX}/lib/gtk-3.0/3.0.0"
fi

View File

@ -1,3 +0,0 @@
interest-noawait /data/data/com.termux/files/usr/lib/gtk-3.0/3.0.0
interest-noawait /data/data/com.termux/files/usr/share/glib-2.0/schemas
interest-noawait /data/data/com.termux/files/usr/share/icons