[waffle] [PATCH 01/10] pkg/archlinux: Update to a dual (+multilib) package
Emil Velikov
emil.l.velikov at gmail.com
Fri May 30 19:21:59 PDT 2014
Include both 64bit and multilib binaries when building
on x86-64 platform. This saves us deeping track of version
numbers and interdependencies in case of a split package.
v2: Rebase and bump pkgrel
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
pkg/archlinux/waffle-1.3.0/PKGBUILD | 86 +++++++++++++++++++++++++++++++------
1 file changed, 73 insertions(+), 13 deletions(-)
diff --git a/pkg/archlinux/waffle-1.3.0/PKGBUILD b/pkg/archlinux/waffle-1.3.0/PKGBUILD
index e2fa153..8f8b587 100644
--- a/pkg/archlinux/waffle-1.3.0/PKGBUILD
+++ b/pkg/archlinux/waffle-1.3.0/PKGBUILD
@@ -2,19 +2,19 @@
pkgname='waffle'
pkgver='1.3.0'
-pkgrel=1
+pkgrel=2
pkgdesc='a library for choosing window system and OpenGL API at runtime'
arch=('i686' 'x86_64')
url='http://www.waffle-gl.org'
license=('BSD')
depends=(
- 'libgl' # for GLX
- 'libegl'
- 'libgbm'
- 'libx11'
- 'libxcb'
- 'wayland'
+ 'libgl' 'lib32-libgl' # for GLX
+ 'libegl' 'lib32-libegl'
+ 'libgbm' 'lib32-libgbm'
+ 'libx11' 'lib32-libx11'
+ 'libxcb' 'lib32-libxcb'
+ 'wayland' 'lib32-wayland'
)
makedepends=(
'cmake'
@@ -24,29 +24,89 @@ makedepends=(
'libxslt'
'docbook-xsl'
)
+
+if [[ $CARCH == i686 ]]; then
+ # Strip lib32 etc. on i686
+ depends=(${depends[@]/*lib32-*/})
+else
+ provides=("lib32-$pkgname" "lib32-$pkgname=$pkgver")
+fi
+
source=("http://www.waffle-gl.org/files/release/$pkgname-$pkgver/$pkgname-$pkgver.tar.xz")
sha256sums=('340ee04172dba878249469018cd7ec9d1ecd41af26b612c741b8b52e713bca8e')
build() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "$srcdir"
+
+ rm -rf $pkgname-{32,64}-build
+
+ waffle32_libdir=/usr/lib
+ waffle32_manpages=1
+ waffle32_htmldocs=1
+
+ if [[ $CARCH == x86_64 ]]; then
+ msg2 "Building (x86_64) waffle..."
+
+ mkdir $pkgname-64-build
+ cd "$srcdir/$pkgname-64-build"
+
+ cmake ../$pkgname-$pkgver \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+ -DCMAKE_BUILD_TYPE=Release \
+ -Dwaffle_has_gbm=1 \
+ -Dwaffle_has_glx=1 \
+ -Dwaffle_has_x11_egl=1 \
+ -Dwaffle_has_wayland=1 \
+ -Dwaffle_build_manpages=1 \
+ -Dwaffle_build_htmldocs=1 \
+ -Dwaffle_build_examples=0
+
+ make
- cmake \
+ cd ..
+ waffle32_libdir=/usr/lib32
+ waffle32_manpages=0
+ waffle32_htmldocs=0
+
+ export CC='gcc -m32'
+ export CXX='g++ -m32'
+ export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'
+ fi
+
+ mkdir $pkgname-32-build
+ msg2 "Building (i686) waffle..."
+ cd "$srcdir/$pkgname-32-build"
+
+ cmake ../$pkgname-$pkgver \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+ -DCMAKE_INSTALL_LIBDIR=$waffle32_libdir \
-DCMAKE_BUILD_TYPE=Release \
-Dwaffle_has_gbm=1 \
-Dwaffle_has_glx=1 \
-Dwaffle_has_x11_egl=1 \
-Dwaffle_has_wayland=1 \
- -Dwaffle_build_manpages=1 \
- -Dwaffle_build_htmldocs=1 \
+ -Dwaffle_build_manpages=$waffle32_manpages \
+ -Dwaffle_build_htmldocs=$waffle32_htmldocs \
-Dwaffle_build_examples=0
make
}
package() {
cd "$srcdir/$pkgname-$pkgver"
- make DESTDIR="$pkgdir/" install
+
+ if [[ $CARCH == x86_64 ]]; then
+ msg2 "Packaging (x86_64) waffle..."
+ cd "$srcdir/$pkgname-64-build"
+
+ make DESTDIR="$pkgdir" install
+ fi
+
+ msg2 "Packaging (i686) waffle..."
+ cd "$srcdir/$pkgname-32-build"
+
+ make DESTDIR="$pkgdir" install
+
install -m755 -d "$pkgdir/usr/share/licenses/$pkgname"
install -m644 "$pkgdir/usr/share/doc/waffle1/LICENSE.txt" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
--
1.9.3
More information about the waffle
mailing list