summaryrefslogtreecommitdiff
path: root/libre/virtualbox-modules/PKGBUILD
blob: b171e14078741e34297987146b7e9f9eb95f50f4 (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
# $Id$
#Maintainer: Ionut Biru <ibiru@archlinux.org>
#Maintainer (Parabola): Jorge López <jorginho@adinet.com.uy>
#Contributor (Parabola): André Silva <andre.paulista@adinet.com.uy>

pkgbase=virtualbox-modules
pkgname=('virtualbox-modules' 'virtualbox-parabola-modules')
pkgver=4.1.14
pkgrel=2
arch=('i686' 'x86_64')
url='http://virtualbox.org'
license=('GPL')
makedepends=('libstdc++5' 'bin86' 'dev86' 'iasl' 'libxslt' 'libxml2' 'libpng' 'libidl2' 'xalan-c' 'sdl' 'linux-libre-headers')
replaces=('virtualbox-modules')
conflicts=('virtualbox-modules')
provides=("virtualbox-modules=$pkgver")
[[ $CARCH == "x86_64" ]] && makedepends=("${makedepends[@]}" 'gcc-multilib' 'lib32-glibc')
source=(http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}.tar.bz2
         LocalConfig.kmk 60-vboxguest.rules)
md5sums=('f8baa04e6d589bc6b1fb4e7079fbe414'
         '4c88bd122677a35f68abd76eb01b378b'
         'ed1341881437455d9735875ddf455fbe')

_extramodules=extramodules-3.3-LIBRE
_kernver="$(cat /lib/modules/${_extramodules}/version || true)"

export KERN_DIR=/lib/modules/${_kernver}/build
export KERN_INCL=/usr/src/linux-${_kernver}/include/

build() {
    cd "$srcdir/VirtualBox-${pkgver}"

    cp "$srcdir/LocalConfig.kmk" .

    ./configure \
        --with-linux=/usr/src/linux-${_kernver} \
        --disable-java \
        --disable-docs \
        --disable-xpcom \
        --disable-python \
        --disable-sdl-ttf \
        --disable-alsa \
        --disable-pulse \
        --disable-dbus  \
        --disable-opengl \
        --build-headless \
        --nofatal
    source ./env.sh
    kmk all

    make -C "$srcdir/VirtualBox-${pkgver}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
    make -C "$srcdir/VirtualBox-${pkgver}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
}

package_virtualbox-parabola-modules(){
    pkgdesc="Additions only for Parabola guests (kernel modules)"
    license=('GPL')
    install=virtualbox-parabola-modules.install
    depends=('linux-libre>=3.3' 'linux-libre<3.4')
    replaces=('virtualbox-guest-modules' 'virtualbox-archlinux-modules')
    conflicts=('virtualbox-guest-modules' 'virtualbox-archlinux-modules')
    provides=("virtualbox-archlinux-modules=$pkgver")

    source "$srcdir/VirtualBox-${pkgver}/env.sh"

    cd "$srcdir/VirtualBox-${pkgver}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"

    for module in vboxguest.ko vboxsf.ko vboxvideo.ko; do
        install -D -m644 ${module} \
            "$pkgdir/lib/modules/${_extramodules}/${module}"
    done

    install -D -m 0644 "$srcdir/60-vboxguest.rules" \
        "$pkgdir/usr/lib/udev/rules.d/60-vboxguest.rules"

    find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;

    sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "$startdir/virtualbox-parabola-modules.install"
}

package_virtualbox-modules(){
    pkgdesc="Kernel modules for VirtualBox"
    license=('GPL')
    install=virtualbox-modules.install
    depends=('linux-libre>=3.3' 'linux-libre<3.4')

    source "$srcdir/VirtualBox-${pkgver}/env.sh"


    cd "$srcdir/VirtualBox-${pkgver}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"

    install -D -m644 vboxdrv.ko \
        "$pkgdir/lib/modules/${_extramodules}/vboxdrv.ko"

    install -D -m644 vboxnetadp.ko \
        "$pkgdir/lib/modules/${_extramodules}/vboxnetadp.ko"

    install -D -m644 vboxnetflt.ko \
        "$pkgdir/lib/modules/${_extramodules}/vboxnetflt.ko"

    install -D -m644 vboxpci.ko \
        "$pkgdir/lib/modules/${_extramodules}/vboxpci.ko"

    find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;

    sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "$startdir/virtualbox-modules.install"
}