summaryrefslogtreecommitdiff
path: root/libre
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-04-21 20:51:32 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-04-22 02:22:33 -0300
commiteeaf0d07a2d2eaa4d5342dbe31b2993bf20f8397 (patch)
tree136747a8e545209206ebf99d396ce6c7d5b3f3ce /libre
parent4c270add817d0d8e3f7404545c61ada748699cc9 (diff)
downloadabslibre-eeaf0d07a2d2eaa4d5342dbe31b2993bf20f8397.tar.gz
abslibre-eeaf0d07a2d2eaa4d5342dbe31b2993bf20f8397.tar.bz2
abslibre-eeaf0d07a2d2eaa4d5342dbe31b2993bf20f8397.zip
qemu-static: add new package to [libre]
Diffstat (limited to 'libre')
-rw-r--r--libre/qemu-static/PKGBUILD97
1 files changed, 97 insertions, 0 deletions
diff --git a/libre/qemu-static/PKGBUILD b/libre/qemu-static/PKGBUILD
new file mode 100644
index 000000000..834666111
--- /dev/null
+++ b/libre/qemu-static/PKGBUILD
@@ -0,0 +1,97 @@
+# Maintainer: Márcio Silva <coadde@parabola.nu>
+# based of qemu
+
+pkgbase=qemu
+pkgname=('qemu-static'
+ 'qemu-arch-extra-static')
+pkgver=2.5.1
+pkgrel=1
+arch=('i686' 'x86_64' 'armv7h')
+license=('GPL2' 'LGPL2.1')
+url='http://wiki.qemu.org/'
+makedepends=('python2' 'glib2-static' 'pcre-static' 'libgcrypt-static' 'libgpg-error')
+#makedepends=('pixman' 'libjpeg' 'libpng' 'sdl' 'alsa-lib' 'nss' 'glib2'
+# 'gnutls' 'bluez-libs' 'vde2' 'util-linux' 'curl' 'libsasl'
+# 'libgl' 'libpulse' 'seabios' 'libcap-ng' 'libaio' 'libseccomp'
+# 'libiscsi' 'libcacard' 'spice' 'spice-protocol' 'python2'
+# 'usbredir' 'ceph' 'glusterfs' 'libssh2' 'lzo' 'snappy')
+
+source=(http://wiki.qemu.org/download/${pkgbase}-${pkgver}.tar.bz2)
+md5sums=('42e73182dea8b9213fa7050e168a4615')
+
+_extra_arches=(aarch64 alpha arm armeb cris m68k microblaze microblazeel
+or32 ppc ppc64 ppc64abi32 ppc64le s390x tilegx
+sh4 sh4eb sparc sparc32plus sparc64 unicore32)
+if [[ $CARCH = x86_64 || $CARCH = i686 ]]; then
+ _extra_arches+=(aarch64 arm armeb mips mips64 mips64el mipsel mipsn32 mipsn32el)
+elif [[ $CARCH = armv7h ]]; then
+ _extra_arches+=(x86_64 i386 mips mips64 mips64el mipsel mipsn32 mipsn32el)
+elif [[ $CARCH = mips64el ]]; then
+ _extra_arches+=(x86_64 i386 aarch64 arm armeb)
+fi
+
+
+prepare() {
+ for _p in *.patch; do
+ [[ -e "$_p" ]] || continue
+ msg2 "Patching $_p"
+ patch -p1 -d ${pkgbase}-${pkgver} < "$_p"
+ done
+}
+
+build ()
+{
+ cd ${pkgbase}-${pkgver}
+ # qemu vs. make 4 == bad
+ export ARFLAGS="rv"
+ # http://permalink.gmane.org/gmane.comp.emulators.qemu/238740
+ export CFLAGS+=' -fPIC'
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --python=/usr/bin/python2 \
+ --libexecdir=/usr/lib/qemu \
+ --localstatedir=/var \
+ --enable-tpm \
+ --disable-system --static
+ make V=99
+}
+
+package_qemu-static() {
+ pkgdesc='A generic and free processor emulator which achieves a good emulation speed by using dynamic translation (static binaries only)'
+# depends=('qemu')
+# depends=('glibc' 'pixman' 'libjpeg' 'libpng' 'sdl' 'alsa-lib' 'nss' 'glib2'
+# 'gnutls' 'bluez-libs' 'vde2' 'util-linux' 'libsasl' 'libgl'
+# 'seabios' 'libcap' 'libcap-ng' 'libaio' 'libseccomp' 'libcacard'
+# 'spice' 'usbredir' 'lzo' 'snappy' 'gcc-libs' 'zlib' 'bzip2' 'nspr'
+# 'ncurses' 'libx11' 'libusb' 'libpulse' 'libssh2' 'curl')
+ optdepends=('qemu-arch-extra-static: extra architectures support')
+ options=(!strip)
+
+ make -C ${pkgbase}-${pkgver} DESTDIR="${pkgdir}" install
+
+ cd "${pkgdir}"
+
+ # remove extra arch
+ for _arch in "${_extra_arches[@]}"; do
+ rm -f usr/bin/qemu-${_arch}
+ done
+
+ # remove conflicting files
+ rm -vr {usr/share,var}
+ rm -v bin/{ivshmem-{client,server},qemu-{img,io,nbd},virtfs-proxy-helper}
+ rm -v lib/qemu/qemu-bridge-helper
+}
+
+package_qemu-arch-extra-static() {
+ pkgdesc='QEMU with full support for non native architectures (static binaries only)'
+ depends=('qemu-static' 'qemu-arch-extra')
+ options=(!strip)
+
+ cd qemu-${pkgver}
+ install -dm755 "${pkgdir}"/usr/bin
+ for _arch in "${_extra_arches[@]}"; do
+ install -m755 ${_arch}-*/qemu-*${_arch} "${pkgdir}"/usr/bin
+ done
+
+ # manually stripping
+ find "${pkgdir}"/usr/bin -type f -exec strip {} \;
+}