Skip to content

Instantly share code, notes, and snippets.

@teknoman117
Last active August 8, 2017 05:17
Show Gist options
  • Save teknoman117/f4a03e03e65527d9ac9e7165ba6a29cc to your computer and use it in GitHub Desktop.
Save teknoman117/f4a03e03e65527d9ac9e7165ba6a29cc to your computer and use it in GitHub Desktop.
prototype lib32 version of the SDL2 build script
# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
# Contributor: J0k3r <moebius282 at gmail dot com>
# Contributor: Teknoman117 <linux dot robotdude at gmail dot com>
pkgname=lib32-sdl2-hg
pkgver=2.0.5.r640.0d399e95168b
pkgrel=1
pkgdesc="A library for portable low-level access to video, audio and input (Version 2, 32 bit, development version)"
arch=('x86_64')
url="http://www.libsdl.org"
license=('MIT')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
depends=('lib32-glibc' 'lib32-libxext' 'lib32-libxrender' 'lib32-libx11' 'lib32-libgl'
'lib32-libxcursor' 'lib32-tslib')
# figure out how to source lib32 ibus and fcitx
makedepends=('mercurial' 'gcc-multilib' 'lib32-alsa-lib' 'lib32-mesa' 'lib32-libpulse' 'lib32-libxrandr'
'lib32-libxinerama' 'lib32-wayland' 'lib32-libxkbcommon' 'wayland-protocols'
'lib32-libxss')
optdepends=('lib32-alsa-lib: ALSA audio driver'
'lib32-libpulse: PulseAudio audio driver')
source=("${pkgname%-*}"::"hg+http://hg.libsdl.org/SDL")
md5sums=('SKIP')
pkgver() {
cd "${pkgname%-*}"
_tag=$(hg tags -q | sort -r | grep release- | head -n1)
_commits=$(hg log --template "{node}\n" -r $_tag:tip | wc -l)
echo "${_tag/release-}.r$_commits.$(hg identify -i)"
}
prepare() {
# reset build folder
rm -rf build
mkdir build
}
build() {
export CC='gcc -m32'
export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'
cd build
../${pkgname%-*}/configure --prefix=/usr --libdir=/usr/lib32 \
--enable-sdl-dlopen \
--disable-arts --disable-esd --disable-nas \
--enable-alsa --enable-pulseaudio-shared \
--enable-video-wayland \
--disable-rpath
make
}
package() {
cd build
make DESTDIR="$pkgdir" install
#already included in sdl2-hg
rm -rf "$pkgdir"/usr/{share/aclocal,include,bin}
install -Dm644 ../"${pkgname%-*}"/COPYING.txt "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment