tags 546184 + patch thanks This build failure appears to be caused by the Quake 3 build system guessing what platform we're on from uname, which in this case doesn't match the compiler we're using.
The obvious solution is to use dpkg-architecture; however, because the Makefile expects to see uname results rather than either Debian or GNU architecture descriptions, some remapping is required. See attached. (I don't intend to NMU this, but nmudiff seemed the easiest way to provide a patch :-) Regards, Simon
diffstat for openarena_0.8.1-5 openarena_0.8.1-5.1 debian/q3arch.sh | 90 ++++++++++++++++++++++++ openarena-0.8.1/debian/changelog | 12 +++ openarena-0.8.1/debian/patches/40_kfreebsd.diff | 2 openarena-0.8.1/debian/rules | 17 ++-- 4 files changed, 114 insertions(+), 7 deletions(-) diff -u openarena-0.8.1/debian/rules openarena-0.8.1/debian/rules --- openarena-0.8.1/debian/rules +++ openarena-0.8.1/debian/rules @@ -1,9 +1,10 @@ #!/usr/bin/make -f #export DH_VERBOSE=1 -# copied from ioq3 make scripts -Q3OS=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g') -Q3ARCH=$(shell uname -m | sed -e s/i.86/i386/) +Q3ARCH := $(shell sh $(CURDIR)/debian/q3arch.sh arch HOST) +Q3PLATFORM := $(shell sh $(CURDIR)/debian/q3arch.sh platform HOST) +Q3COMPILE_ARCH := $(shell sh $(CURDIR)/debian/q3arch.sh arch BUILD) +Q3COMPILE_PLATFORM := $(shell sh $(CURDIR)/debian/q3arch.sh platform BUILD) CFLAGS += -fsigned-char @@ -18,7 +19,11 @@ USE_INTERNAL_SPEEX=0 \ BUILD_CLIENT_SMP=1 \ USE_LOCAL_HEADERS=0 \ - DEFAULT_BASEDIR=/usr/share/games/openarena + DEFAULT_BASEDIR=/usr/share/games/openarena \ + ARCH=$(Q3ARCH) \ + PLATFORM=$(Q3PLATFORM) \ + COMPILE_ARCH=$(Q3COMPILE_ARCH) \ + COMPILE_PLATFORM=$(Q3COMPILE_PLATFORM) touch $@ patch-stamp: patch @@ -46,8 +51,8 @@ dh_testroot dh_clean -k mkdir -p debian/tmp - cp build/release-$(Q3OS)-$(Q3ARCH)/openarena.$(Q3ARCH) debian/tmp/openarena - cp build/release-$(Q3OS)-$(Q3ARCH)/oa_ded.$(Q3ARCH) debian/tmp/openarena-server + cp build/release-$(Q3PLATFORM)-$(Q3ARCH)/openarena.$(Q3ARCH) debian/tmp/openarena + cp build/release-$(Q3PLATFORM)-$(Q3ARCH)/oa_ded.$(Q3ARCH) debian/tmp/openarena-server uudecode -o openarena128.png debian/oa128.png.uu convert -scale 32x32 openarena128.png openarena32.xpm dh_install diff -u openarena-0.8.1/debian/changelog openarena-0.8.1/debian/changelog --- openarena-0.8.1/debian/changelog +++ openarena-0.8.1/debian/changelog @@ -1,3 +1,15 @@ +openarena (0.8.1-5.1) UNRELEASED; urgency=low + + * Non-maintainer upload. + * Ask dpkg for the GNU-style CPU and OS we're compiling for, then transform + them into the form Quake 3 expects with debian/q3arch.sh, rather than + guessing from uname -m and uname. This fixes FTBFS with an amd64 kernel + and i386 user-space (Closes: #546184) + * Update patch for kFreeBSD support to accept kfreebsd-gnu too, since this + seems less painful than yet another special case. + + -- Simon McVittie <s...@debian.org> Sat, 24 Oct 2009 04:08:55 +0100 + openarena (0.8.1-5) unstable; urgency=low [ Gonéri Le Bouder ] diff -u openarena-0.8.1/debian/patches/40_kfreebsd.diff openarena-0.8.1/debian/patches/40_kfreebsd.diff --- openarena-0.8.1/debian/patches/40_kfreebsd.diff +++ openarena-0.8.1/debian/patches/40_kfreebsd.diff @@ -14,7 +14,7 @@ MKDIR=mkdir -ifeq ($(PLATFORM),linux) -+ifneq (,findstring($(PLATFORM),linux gnu_kfreebsd)) ++ifneq (,findstring($(PLATFORM),linux gnu_kfreebsd kfreebsd-gnu)) ifeq ($(ARCH),alpha) ARCH=alpha only in patch2: unchanged: --- openarena-0.8.1.orig/debian/q3arch.sh +++ openarena-0.8.1/debian/q3arch.sh @@ -0,0 +1,90 @@ +#!/bin/sh +# Usage: q3arch.sh arch|platform BUILD|HOST +# +# Output an architecture or platform name that Quake 3 could use for the +# build or host CPU architecture or operating system. + +set -e + +case $1 in + +arch) + # In the upstream Makefile the architecture is given by uname -m, with the + # following substitutions: + # + # i.86 -> i386 + # powerpc -> ppc + # alpha -> axp (on Linux and FreeBSD) + # + # However, for most architectures the build system doesn't actually care, + # it's just "some other architecture", so we can get away with using the + # GNU CPU as-is. i386, ppc and x86_64 are the unusual ones. + # + # (For instance, on Debian's HPPA buildd, uname -m says parisc64 whereas + # the GNU CPU type is hppa, but that's not important because the Makefile + # doesn't actually do anything different.) + + DEB_X_GNU_CPU=`dpkg-architecture -qDEB_$2_GNU_CPU` + + case ${DEB_X_GNU_CPU} in + + i?86) + echo i386 + ;; + + powerpc) + echo ppc + ;; + + *) + echo ${DEB_X_GNU_CPU} + ;; + + esac + ;; + +platform) + # In the upstream Makefile the platform is given by uname, with the + # following substitutions: + # + # anything after _ removed + # folded to lower case + # / -> _ + # + # This would result in Debian builds being done for linux, gnu_kfreebsd and + # gnu. + # + # However, for most platform names the build system doesn't actually care, + # it's just "some other platform", so we can get away with using the + # GNU system as-is. + # + # (For instance, on Debian kFreeBSD buildd, uname says GNU/kFreeBSD whereas + # the GNU CPU type is kfreebsd-gnu, but that's not important because the + # Makefile doesn't actually do anything different.) + + DEB_X_GNU_SYSTEM=`dpkg-architecture -qDEB_$2_GNU_SYSTEM` + + case ${DEB_X_GNU_SYSTEM} in + + linux-gnu) + echo linux + ;; + + *) + echo ${DEB_X_GNU_SYSTEM} + ;; + + esac + ;; + +*) + echo "Usage: sh q3arch.sh arch|platform BUILD|HOST" >&2 + exit 1 + ;; + +esac + +# Copyright 2009 Simon McVittie <s...@debian.org> +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided this notice is preserved. +# This file is offered as-is, without any warranty.
signature.asc
Description: Digital signature