[Pkg-utopia-maintainers] Bug#946303: dbus-glib: Please make autopkgtests cross-test-friendly

Steve Langasek steve.langasek at canonical.com
Fri Dec 6 23:45:55 GMT 2019


Package: dbus-glib
Followup-For: Bug #946303
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu focal ubuntu-patch

Here is a better patch that accounts for the test being set -u, and also
works when NOT cross-testing.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru dbus-glib-0.110/debian/tests/build dbus-glib-0.110/debian/tests/build
--- dbus-glib-0.110/debian/tests/build	2019-01-29 01:44:28.000000000 -0800
+++ dbus-glib-0.110/debian/tests/build	2019-12-06 15:39:24.000000000 -0800
@@ -12,6 +12,12 @@
 
 cd "$AUTOPKGTEST_TMP"
 
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+    CROSS_COMPILE=
+fi
+
 echo "1..2"
 
 cat > connect.c <<'EOF'
@@ -42,7 +48,7 @@
 
 # Deliberately word-splitting, that's how pkg-config works:
 # shellcheck disable=SC2046
-gcc -o connect connect.c $(pkg-config --cflags --libs dbus-glib-1)
+${CROSS_COMPILE}gcc -o connect connect.c $(${CROSS_COMPILE}pkg-config --cflags --libs dbus-glib-1)
 test -x connect
 dbus-run-session -- ./connect
 echo "ok 1"


More information about the Pkg-utopia-maintainers mailing list