diff options
author | Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> | 2023-03-27 19:45:37 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2023-03-27 19:45:37 +0900 |
commit | 9553dbf12ec42a58beb671a7039827fbd652e14d (patch) | |
tree | 0c7707e48081327a7f849535b4313a85ba15fc8e | |
parent | a4007f7d0bdfb98457487c85304188c411e6d991 (diff) | |
download | ibus-9553dbf12ec42a58beb671a7039827fbd652e14d.tar.gz |
Portability fixes for preparation of NetBSD CI
- Makefile: Ignore errors on $(RM) -r "`uname -i`"
- autogen: Replace make with $MAKE
- data/dconf: BSD does not support the --tmpdir long option
in mktemp. Also add the cleanup function.
BUG=https://github.com/ibus/ibus/pull/2482
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | autogen.sh | 7 | ||||
-rwxr-xr-x | data/dconf/make-dconf-override-db.sh | 11 |
3 files changed, 13 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index 17e56b38..16548d25 100644 --- a/Makefile.am +++ b/Makefile.am @@ -139,7 +139,7 @@ srpm: dist @PACKAGE_NAME@.spec @PACKAGE_NAME@.spec clean-rpm: - $(RM) -r "`uname -i`" + -$(RM) -r "`uname -i`" clean-local: clean-rpm @@ -4,6 +4,7 @@ : ${srcdir=$(dirname $0)} : ${srcdir:=.} : ${SAVE_DIST_FILES:=0} +: ${MAKE:=make} olddir=$(pwd) # shellcheck disable=SC2016 @@ -73,7 +74,7 @@ cd "$olddir" (test "$1" = "--help" ) && { exit 0 } || { - echo "Now type 'make' to compile $PKG_NAME" || exit 1 + echo "Now type '$MAKE' to compile $PKG_NAME" || exit 1 } } || { echo "Skipping configure process." @@ -83,8 +84,8 @@ cd "$srcdir" (test "x$SAVE_DIST_FILES" = "x0" ) && { # rm engine/simple.xml.in src/ibusemojigen.h src/ibusunicodegen.h for d in engine src src/compose; do - echo "make -C $d maintainer-clean-generic" - make -C $d maintainer-clean-generic + echo "$MAKE -C $d maintainer-clean-generic" + $MAKE -C $d maintainer-clean-generic done } || : cd "$olddir" diff --git a/data/dconf/make-dconf-override-db.sh b/data/dconf/make-dconf-override-db.sh index 601c1c3f..32cb1530 100755 --- a/data/dconf/make-dconf-override-db.sh +++ b/data/dconf/make-dconf-override-db.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e @@ -6,7 +6,7 @@ set -e # breaks dbus-launch. There's dbus-run-session which is # better, but not everyone has it yet. export DBUS_FATAL_WARNINGS=0 -export TMPDIR=$(mktemp -d --tmpdir="$PWD") +export TMPDIR=$(mktemp -d -p "$PWD") export XDG_CONFIG_HOME="$TMPDIR/config" export XDG_CACHE_HOME="$TMPDIR/cache" export GSETTINGS_SCHEMA_DIR="$TMPDIR/schemas" @@ -14,7 +14,12 @@ mkdir -p $XDG_CONFIG_HOME $XDG_CACHE_HOME $GSETTINGS_SCHEMA_DIR eval `dbus-launch --sh-syntax` -trap 'rm -rf $TMPDIR; kill $DBUS_SESSION_BUS_PID' ERR +trap cleanup EXIT + +cleanup() { + test $? -eq 0 && exit + rm -rf $TMPDIR; kill $DBUS_SESSION_BUS_PID +} # in case that schema is not installed on the system glib-compile-schemas --targetdir "$GSETTINGS_SCHEMA_DIR" "$PWD" |