diff mbox

Please add multiarch support to libsdl

Message ID 20110804142718.GA1632@afflict.kos.to
State Accepted
Headers show

Commit Message

Riku Voipio Aug. 4, 2011, 2:27 p.m. UTC
Package: libsdl1.2debian
Version: 1.2.14-6.4
Severity: wishlist
User: debian-dpkg@lists.debian.org
Usertags: multiarch
Tags: patch

The following patch adds multiarch support for libsdl1.2. It requires the following changes:

- debian/control changes (Multi-Arch: same and debhelper reqirement update)
- move libs to /usr/lib/$DEB_HOST_MULTIARCH/
- install a /usr/bin/sdl-config wrapper that calls /usr/lib/$DEB_HOST_MULTIARCH/sdl-config

last is needed to support crosscompiling (so that /usr/bin/sdl-config is same on all archs,
allowing Multi-Arch: same setting for the -dev package).

See the following page for details:

http://wiki.debian.org/Multiarch/Implementation

Comments

Sven Joachim Aug. 4, 2011, 2:47 p.m. UTC | #1
On 2011-08-04 16:27 +0200, Riku Voipio wrote:

> The following patch adds multiarch support for libsdl1.2. It requires the following changes:
>
> - debian/control changes (Multi-Arch: same and debhelper reqirement update)
> - move libs to /usr/lib/$DEB_HOST_MULTIARCH/
> - install a /usr/bin/sdl-config wrapper that calls /usr/lib/$DEB_HOST_MULTIARCH/sdl-config
>
> last is needed to support crosscompiling (so that /usr/bin/sdl-config is same on all archs,
> allowing Multi-Arch: same setting for the -dev package).

There is a little problem with the latter, namely…

> @@ -0,0 +1,5 @@
> +#!/bin/sh
> +# Generic multiarch wrapper for sdl-config
> +# Copyright (c) 2011 Riku Voipio <riku.voipio@linaro.org>
> +
> +/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/sdl/sdl-config "$@"

…it requires dpkg-dev (1.16.0 or later due to DEB_HOST_MULTIARCH) for
dpkg-architecture.

Cheers,
       Sven
diff mbox

Patch

diff -u libsdl1.2-1.2.14/debian/control libsdl1.2-1.2.14/debian/control
--- libsdl1.2-1.2.14/debian/control
+++ libsdl1.2-1.2.14/debian/control
@@ -5,7 +5,7 @@ 
 Uploaders: Barry deFreese <bdefreese@debian.org>
 Standards-Version: 3.8.4
 Build-Depends: dpkg (>= 1.13.2),
-               debhelper (>= 5.0),
+               debhelper (>= 8.1.3),
                quilt,
                nasm [any-i386],
                libx11-dev, 
@@ -27,6 +27,7 @@ 
 
 Package: libsdl1.2debian
 Architecture: any
+Multi-Arch: same
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Replaces: libsdl1.2debian-all,
           libsdl1.2debian-alsa,
@@ -65,6 +66,7 @@ 
  This version of SDL is compiled with directfb graphics and no sound.
 
 Package: libsdl1.2-dev
+Multi-Arch: same
 Architecture: any
 Section: libdevel
 Depends: ${misc:Depends},
diff -u libsdl1.2-1.2.14/debian/libsdl1.2debian.install libsdl1.2-1.2.14/debian/libsdl1.2debian.install
--- libsdl1.2-1.2.14/debian/libsdl1.2debian.install
+++ libsdl1.2-1.2.14/debian/libsdl1.2debian.install
@@ -1 +1 @@ 
-usr/lib/*.so.*
+usr/lib/*/*.so.*
diff -u libsdl1.2-1.2.14/debian/rules libsdl1.2-1.2.14/debian/rules
--- libsdl1.2-1.2.14/debian/rules
+++ libsdl1.2-1.2.14/debian/rules
@@ -19,11 +19,13 @@ 
 DEB_HOST_ARCH_CPU	?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 export DEB_HOST_GNU_TYPE
 export DEB_BUILD_GNU_TYPE
 
-confflags = --prefix=/usr
+confflags = --prefix=/usr --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) 
+
 confflags += --disable-rpath --enable-sdl-dlopen --disable-loadso \
 	     --disable-video-ggi --disable-video-svga --disable-video-aalib \
 	     --disable-nas --disable-esd --disable-arts \
@@ -126,7 +128,10 @@ 
 	dh_installman -plibsdl1.2-dev debian/sdl-config.1
 	dh_installchangelogs
 	dh_install --sourcedir=debian/tmp
-	sed -i -e "s/^dependency_libs=.*/dependency_libs=''/" debian/libsdl1.2-dev/usr/lib/libSDL.la
+	sed -i -e "s/^dependency_libs=.*/dependency_libs=''/" debian/libsdl1.2-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libSDL.la
+	mkdir -p  debian/libsdl1.2-dev/usr/bin debian/libsdl1.2-dev/usr/lib/$(DEB_HOST_MULTIARCH)/sdl/
+	mv debian/tmp/usr/bin/sdl-config debian/libsdl1.2-dev/usr/lib/$(DEB_HOST_MULTIARCH)/sdl/sdl-config
+	cp -a debian/sdl-config debian/libsdl1.2-dev/usr/bin/
 	dh_install --sourcedir=builddir/udeb/ -plibsdl1.2debian-udeb build/.libs/*.so.* usr/lib/;
 	rm -rf debian/libsdl1.2debian/usr/include
 	dh_strip
diff -u libsdl1.2-1.2.14/debian/libsdl1.2-dev.install libsdl1.2-1.2.14/debian/libsdl1.2-dev.install
--- libsdl1.2-1.2.14/debian/libsdl1.2-dev.install
+++ libsdl1.2-1.2.14/debian/libsdl1.2-dev.install
@@ -1,7 +1,6 @@ 
 usr/include/SDL
-usr/lib/*.a
-usr/lib/*.so
-usr/lib/*.la
-usr/lib/pkgconfig
-usr/bin/sdl-config
+usr/lib/*/*.a
+usr/lib/*/*.so
+usr/lib/*/*.la
+usr/lib/*/pkgconfig
 usr/share/aclocal/*
only in patch2:
unchanged:
--- libsdl1.2-1.2.14.orig/debian/sdl-config
+++ libsdl1.2-1.2.14/debian/sdl-config
@@ -0,0 +1,5 @@ 
+#!/bin/sh
+# Generic multiarch wrapper for sdl-config
+# Copyright (c) 2011 Riku Voipio <riku.voipio@linaro.org>
+
+/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/sdl/sdl-config "$@"