summaryrefslogtreecommitdiff
path: root/libre/qemu-linaro/PKGBUILD
blob: f3b104a5ec1b8018b41147e34a5d62e8df03e0dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Maintainer: Márcio Silva <coadde@parabola.nu>

pkgbase='qemu'
pkgname=("${pkgbase}-linaro"
         "${pkgbase}-linaro-block-iscsi"
         "${pkgbase}-linaro-block-rbd"
         "${pkgbase}-linaro-block-gluster")
_gitcount='r39004' # git rev-list <commit/branch> --count
_gitcommit='e571600'
pkgver="${_gitcount}.${_gitcommit}"
pkgrel='1'
arch=('i686' 'x86_64' 'armv7h')
license=('GPL2' 'LGPL2.1')
url="https://launchpad.net/${pkgbase}-linaro"
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' 'dtc' 'git')
source=("${pkgname}-${pkgver}::git+http://git.linaro.org/${pkgbase}/${pkgbase}-linaro.git#commit=${_gitcommit}")
md5sums=('SKIP')

prepare() {
  for _p in *.patch; do
    [[ -e "$_p" ]] || continue
    msg2 "Patching $_p"
    patch -p1 -d ${pkgname}-${pkgver} < "$_p"
  done
}

build() {
  cd "${pkgname}-${pkgver}"
  # qemu vs. make 4 == bad
  export ARFLAGS="rv"
  # http://permalink.gmane.org/gmane.comp.emulators.qemu/238740
  export CFLAGS+=' -fPIC'
  # gtk gui breaks keymappings at the moment
  ./configure --prefix='/usr' --sysconfdir='/etc' --audio-drv-list='pa alsa sdl' \
              --python='/usr/bin/python2' --smbd=/usr/bin/smbd \
              --disable-docs --libexecdir="/usr/lib/${pkgbase}-linaro" \
              --disable-gtk --enable-linux-aio --enable-seccomp \
              --enable-spice --with-confsuffix="/${pkgbase}-linaro" \
              --enable-tpm --enable-guest-base --disable-guest-agent \
              --enable-modules --enable-{rbd,glusterfs,libiscsi,curl} \
              --target-list='aarch64-softmmu arm-softmmu aarch64-linux-user armeb-linux-user arm-linux-user'
  make V=99
}

package_qemu-linaro() {
  pkgdesc='QEMU with community improvements support for ARM architectures'
  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=('samba: SMB/CIFS server support'
              "${pkgbase}: KVM and extra docs/tools support"
              "${pkgbase}-arch-extra: ARM generic architectures support"
              "${pkgbase}-linaro-block-iscsi: iSCSI block support"
              "${pkgbase}-linaro-block-rbd: RBD block support"
              "${pkgbase}-linaro-block-gluster: glusterfs block support")
  options=(!strip)
  install=qemu.install

  make -C "${pkgname}-${pkgver}" DESTDIR="${pkgdir}" libexecdir="/usr/lib/${pkgbase}-linaro" install

  cd "${pkgdir}"

  msg 'rm (and ln -s) files, due provided by seabios package'
  rm -v "usr/share/${pkgbase}-linaro/acpi-dsdt.aml"
  rm -v "usr/share/${pkgbase}-linaro/q35-acpi-dsdt.aml"
  ln -vs "../${pkgbase}/acpi-dsdt.aml" "usr/share/${pkgbase}-linaro/acpi-dsdt.aml"
  ln -vs "../${pkgbase}/q35-acpi-dsdt.aml" "usr/share/${pkgbase}-linaro/q35-acpi-dsdt.aml"

  msg 'bridge_helper needs suid'
  msg 'https://bugs.archlinux.org/task/32565'
  chmod u+s "usr/lib/${pkgbase}-linaro/${pkgbase}-bridge-helper"

  msg 'remove libcacard files'
  rm -vr 'usr/include/cacard'
  rm -v 'usr/lib/libcacard'*
  rm -v 'usr/lib/pkgconfig/libcacard.pc'
  rm -v 'usr/bin/vscclient'
  rmdir -v 'usr/include'
  rmdir -v 'usr/lib/pkgconfig'

  msg 'remove splitted block modules'
  rm -v "usr/lib/${pkgbase}-linaro/block-"{iscsi,rbd,gluster}'.so'

  msg 'remove unused binaries'
  rm -v "usr/bin/${pkgbase}-"{img,io,nbd}
  rm -v 'usr/bin/virtfs-proxy-helper'

  msg 'rename binaries'
  mv -v "usr/bin/${pkgbase}"{,-linaro}'-aarch64'
  mv -v "usr/bin/${pkgbase}"{,-linaro}'-arm'
  mv -v "usr/bin/${pkgbase}"{,-linaro}'-armeb'
  mv -v "usr/bin/${pkgbase}"{,-linaro}'-system-aarch64'
  mv -v "usr/bin/${pkgbase}"{,-linaro}'-system-arm'

  msg 'manually stripping'
  find "${pkgdir}/usr/bin" -type f -exec strip {} \;
}

package_qemu-linaro-block-iscsi() {
  pkgdesc='QEMU (Linaro) iSCSI block module'
  depends=('glibc' 'glib2' 'libiscsi')

  install -D "${pkgbase}-linaro-${pkgver}/block-iscsi.so" "${pkgdir}/usr/lib/${pkgbase}-linaro/block-iscsi.so"
}

package_qemu-linaro-block-rbd() {
  pkgdesc='QEMU (Linaro) RBD block module'
  depends=('glibc' 'glib2' 'ceph')

  install -D "${pkgbase}-linaro-${pkgver}/block-rbd.so" "${pkgdir}/usr/lib/${pkgbase}-linaro/block-rbd.so"
}

package_qemu-linaro-block-gluster() {
  pkgdesc='QEMU (Linaro) GlusterFS block module'
  depends=('glibc' 'glib2' 'glusterfs')

  install -D "${pkgbase}-linaro-${pkgver}/block-gluster.so" "${pkgdir}/usr/lib/${pkgbase}-linaro/block-gluster.so"
}