Skip to content

Commit

Permalink
Portability fixes for preparation of NetBSD CI
Browse files Browse the repository at this point in the history
- 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=#2482
  • Loading branch information
tsutsui authored and fujiwarat committed Mar 27, 2023
1 parent a4007f7 commit 9553dbf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
: ${srcdir=$(dirname $0)}
: ${srcdir:=.}
: ${SAVE_DIST_FILES:=0}
: ${MAKE:=make}

olddir=$(pwd)
# shellcheck disable=SC2016
Expand Down Expand Up @@ -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."
Expand All @@ -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"
11 changes: 8 additions & 3 deletions data/dconf/make-dconf-override-db.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#!/bin/bash
#!/bin/sh

set -e

# gnome-continuous doesn't have a machine-id set, which
# 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"
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"
Expand Down

0 comments on commit 9553dbf

Please sign in to comment.