Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # virtualbox-epoch1-6-1-40.sh
- # 2022 RocketMouse
- # Try to build virtualbox 6.1.40 with epoch 1, against updated dependencies,
- # in a clean chroot, to replace community/virtualbox
- # Use pkgrel to quasi sync with community/virtualbox
- # for example community/virtualbox 7.0.2-2
- # pkgrel=702.2 for 1:6.1.40-7 0 2.2
- clear
- echo
- echo " Always run the script using the full path."
- echo " Don't run it like this $ ./virtualbox-epoch1-6-1-40.sh"
- echo " Run it like this $ /foo/bar/virtualbox-epoch1-6-1-40.sh"
- printf "\n "
- sleep 4
- printf "6\n "
- sleep 2
- printf "4\n "
- sleep 2
- printf "2\n "
- sleep 2
- echo
- case $(id -nu) in
- rocketmouse)
- MYPATH=/.tmp ;;
- *)
- MYPATH=~ ;;
- esac
- CHROOT=$MYPATH/chroot
- # Original:
- # https://github.com/archlinux/svntogit-community/tree/fa40648a7e715d19fa3ca032ce8c3e7b135ccbc0/trunk
- WWWGET=wget\ https://raw.githubusercontent.com/archlinux/svntogit-community/fa40648a7e715d19fa3ca032ce8c3e7b135ccbc0/trunk
- # New:
- mkdir -p $CHROOT $MYPATH/virtualbox-epoch1-6.1.40
- cd $MYPATH/virtualbox-epoch1-6.1.40
- $WWWGET/001-disable-update.patch
- $WWWGET/004-drop-Wno-format.patch
- $WWWGET/005-gsoap-build.patch
- $WWWGET/006-rdesktop-vrdp-keymap-path.patch
- $WWWGET/008-no-vboxvideo.patch
- $WWWGET/009-i3wm.patch
- $WWWGET/012-vbglR3GuestCtrlDetectPeekGetCancelSupport.patch
- $WWWGET/013-Makefile.patch
- $WWWGET/017-fix-narrowing-conversion.patch
- $WWWGET/018-xclient.patch
- $WWWGET/60-vboxdrv.rules
- $WWWGET/60-vboxguest.rules
- $WWWGET/LocalConfig.kmk
- tail -357 $0 > $MYPATH/virtualbox-epoch1-6.1.40/PKGBUILD
- $WWWGET/build.sh
- $WWWGET/vboxdrmclient.path
- $WWWGET/vboxdrmclient.service
- $WWWGET/vboxreload
- $WWWGET/vboxservice-nox.service
- $WWWGET/vboxservice.service
- $WWWGET/vboxweb.service
- $WWWGET/virtualbox-ext-vnc.install
- $WWWGET/virtualbox-guest-utils.sysusers
- $WWWGET/virtualbox-host-dkms.conf
- $WWWGET/virtualbox-host-dkms.install
- $WWWGET/virtualbox.sysusers
- echo
- echo
- echo "# # # # # # # # # # # # # # # # # #"
- echo
- echo
- mkarchroot $CHROOT/root base-devel
- echo
- echo
- echo "# # # # # # # # # # # # # # # # # #"
- echo
- echo
- arch-nspawn $CHROOT/root pacman -Syu
- makechrootpkg -c -r $CHROOT
- exit $?
- ###########################
- #### ####
- #### P K G B U I L D ####
- #### ####
- ###########################
- # Maintainer: Sébastien "Seblu" Luttringer
- # Contributor: Ionut Biru <ibiru@archlinux.org>
- pkgbase=virtualbox
- pkgname=('virtualbox'
- 'virtualbox-host-dkms'
- 'virtualbox-sdk'
- 'virtualbox-guest-utils'
- 'virtualbox-guest-utils-nox'
- 'virtualbox-ext-vnc')
- pkgver=6.1.40
- _tarver=${pkgver}
- pkgrel=702.2
- epoch=1
- arch=('x86_64')
- url='https://virtualbox.org/'
- license=('GPL' 'custom')
- makedepends=('alsa-lib'
- 'bin86'
- 'cdrkit'
- 'curl'
- 'dev86'
- 'device-mapper'
- 'git'
- 'glu'
- 'gsoap'
- 'iasl'
- 'jdk8-openjdk'
- 'libidl2'
- 'libpulse'
- 'libvncserver'
- 'libvpx'
- 'libxcomposite'
- 'libxcursor'
- 'libxinerama'
- 'libxml2'
- 'libxmu'
- 'libxrandr'
- 'libxslt'
- 'libxtst'
- 'linux-headers'
- 'mesa'
- 'opus'
- 'python'
- 'qt5-base'
- 'qt5-x11extras'
- 'qt5-tools'
- 'sdl'
- 'sdl_ttf'
- 'vde2'
- 'xalan-c'
- 'xorgproto'
- 'xorg-server-devel')
- source=("https://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${_tarver}.tar.bz2"
- 'virtualbox-host-dkms.conf'
- 'virtualbox.sysusers'
- 'virtualbox-guest-utils.sysusers'
- '60-vboxdrv.rules'
- '60-vboxguest.rules'
- 'LocalConfig.kmk'
- 'vboxservice.service'
- 'vboxservice-nox.service'
- 'vboxdrmclient.path'
- 'vboxdrmclient.service'
- 'vboxweb.service'
- 'vboxreload'
- '001-disable-update.patch'
- '004-drop-Wno-format.patch'
- '005-gsoap-build.patch'
- '006-rdesktop-vrdp-keymap-path.patch'
- '008-no-vboxvideo.patch'
- '009-i3wm.patch'
- '012-vbglR3GuestCtrlDetectPeekGetCancelSupport.patch'
- '013-Makefile.patch'
- '017-fix-narrowing-conversion.patch'
- '018-xclient.patch')
- sha256sums=('bc857555d3e836ad9350a8f7b03bb54d2fdc04dddb2043d09813f4634bca4814'
- '76d98ea062fcad9e5e3fa981d046a6eb12a3e718a296544a68b66f4b65cb56db'
- '2101ebb58233bbfadf3aa74381f22f7e7e508559d2b46387114bc2d8e308554c'
- 'da4c49f6ca94e047e196cdbcba2c321199f4760056ea66e0fbc659353e128c9e'
- 'f876e9f55243eded423fda4fc2ffe3b174dca90380a6315f7c9b3cd1c9d07206'
- '033c597e0f5285d2ddb0490868e5b6f945f45c7b1b1152a02a9e6fea438b2c95'
- '3cf42bc6e9e55fd2cb6be7b89c5b98d0f6a2eff6125a9ee7efafaabc35f1de22'
- 'c41a801fe344a4471a7b61a4764d1d857c403e4fb96e2ba6bc89c77a35f2be7a'
- '01dbb921bd57a852919cc78be5b73580a564f28ebab2fe8d6c9b8301265cbfce'
- '83d8f24bff25bb925083cf39b3195236c6136105e62417712cc3f25b92e14b47'
- '2beab8de525220fa418c9873f9e0d657ddbad4ff9e4a46d7053e6cd9bc4ce95e'
- 'e6e875ef186578b53106d7f6af48e426cdaf1b4e86834f01696b8ef1c685787f'
- '4001b5927348fe669a541e80526d4f9ea91b883805f102f7d571edbb482a9b9d'
- '9ee947c9b5ec5b25f52d3e72340fc3a57ca6e65a604e15b669ac582a3fb0dc1b'
- '2ef32b9f6df4c5489751de36446f29825b4602048ee6d5e59573e4b01c8f4846'
- '7d2da8fe10a90f76bbfc80ad1f55df4414f118cd10e10abfb76070326abebd46'
- '13c6ca9be0f91582445fd2a14a8c58a0625a15d9cb98cb6e8c2736d77ea976ab'
- '053bfeee8863f3ffdf2f0e3f9f0d77dc61dd32764700a97a7635fd8611e20491'
- 'c1e13ea4340cff681b273408b1e7f38c887ff8dab6923db390aa58d5ae0f82fa'
- '81900e13d36630488accd8c0bfd2ceb69563fb2c4f0f171caba1cca59d438024'
- 'da7e58ed37dc23c6202aab3017864579a99e78417f3421ddcc98a198198fe2c9'
- '5aac692909a0a0ec56b08bdece9e42cf7463abdca9da2f990d441ff463be6a99'
- 'cac5a573e9ed5aafb2f469c2e6fffb8cd4f389bbadba5a968c9f65be7a72fee3')
- prepare() {
- cd "VirtualBox-$pkgver"
- # apply patch from the source array (should be a pacman feature)
- local filename
- for filename in "${source[@]}"; do
- if [[ "$filename" =~ \.patch$ ]]; then
- echo "Applying patch ${filename##*/}"
- patch -p1 -N -i "$srcdir/${filename##*/}"
- fi
- done
- echo 'Applying local config'
- cp "$srcdir/LocalConfig.kmk" .
- echo 'Use our CFLAGS'
- echo "VBOX_GCC_OPT=$CXXFLAGS" >> LocalConfig.kmk
- }
- build() {
- cd "VirtualBox-$pkgver"
- echo 'Build virtualbox'
- ./configure \
- --disable-docs \
- --disable-kmods \
- --disable-vmmraw \
- --enable-vde \
- --enable-vnc \
- --enable-webservice \
- --with-makeself=/usr/bin/echo
- # fake makeself binary to compile without nofatal
- # makeself is used by linux installer. we don't need it.
- source ./env.sh
- kmk
- echo 'Build rdesktop-vrdp'
- kmk -C src/VBox/RDP/client-1.8.4
- echo 'Build VNC extension pack'
- kmk -C src/VBox/ExtPacks/VNC packing
- echo 'Build vboximg-mount'
- kmk -C src/VBox/ImageMounter/vboximg-mount
- }
- package_virtualbox() {
- pkgdesc='Powerful x86 virtualization for enterprise as well as home use'
- depends=('glibc' 'openssl' 'curl' 'gcc-libs' 'libpng' 'python' 'sdl'
- 'libvpx' 'libxml2' 'procps-ng' 'shared-mime-info' 'zlib'
- 'libxcursor' 'libxinerama' 'libx11' 'libxext' 'libxmu' 'libxt'
- 'opus' 'qt5-base' 'qt5-x11extras' 'VIRTUALBOX-HOST-MODULES')
- optdepends=('vde2: Virtual Distributed Ethernet support'
- 'virtualbox-guest-iso: Guest Additions CD image'
- 'virtualbox-ext-vnc: VNC server support'
- 'virtualbox-sdk: Developer kit')
- backup=('etc/vbox/vbox.cfg')
- replaces=('virtualbox-ose')
- conflicts=('virtualbox-ose')
- source "VirtualBox-$pkgver/env.sh"
- cd "VirtualBox-$pkgver/out/linux.$BUILD_PLATFORM_ARCH/release/bin"
- # binaries
- install -dm0755 "$pkgdir/usr/bin"
- install -m0755 VBox.sh "$pkgdir/usr/bin/VBox"
- for i in VBoxHeadless VBoxManage VBoxSDL VirtualBox vboxwebsrv VBoxBalloonCtrl; do
- ln -sf VBox "$pkgdir/usr/bin/$i"
- ln -sf VBox "$pkgdir/usr/bin/${i,,}"
- done
- install -m0755 VBoxTunctl "$pkgdir/usr/bin"
- install -m0755 rdesktop-vrdp "$pkgdir/usr/bin"
- install -m0755 vboximg-mount "$pkgdir/usr/bin"
- # libraries
- install -dm0755 "$pkgdir/usr/lib/virtualbox"
- install -m0755 *.so "$pkgdir/usr/lib/virtualbox"
- install -m0644 *.r0 VBoxEFI*.fd "$pkgdir/usr/lib/virtualbox"
- ## setuid root binaries
- install -m4755 VBoxSDL VirtualBoxVM VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl VBoxNetNAT -t "$pkgdir/usr/lib/virtualbox"
- ## other binaries
- install -m0755 VirtualBox VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL VBoxBalloonCtrl vboxwebsrv webtest -t "$pkgdir/usr/lib/virtualbox"
- # components
- install -dm0755 "$pkgdir/usr/lib/virtualbox/components"
- install -m0755 components/* -t "$pkgdir/usr/lib/virtualbox/components"
- # extensions packs
- ## as virtualbox install itself stuff in this directory, move it to /var and
- ## trick it with a symlink
- ## FIXME: trick is disabled for now
- #install -dm0755 "$pkgdir/var/lib/virtualbox/extensions"
- #install -dm0755 "$pkgdir/usr/share/virtualbox/extensions"
- #ln -s ../../../var/lib/virtualbox/extensions "$pkgdir/usr/lib/virtualbox/ExtensionPacks"
- install -dm0755 "$pkgdir/usr/lib/virtualbox/ExtensionPacks"
- # languages
- install -dm0755 "$pkgdir/usr/share/virtualbox/nls"
- install -m0755 nls/*.qm -t "$pkgdir/usr/share/virtualbox/nls"
- # rdesktop keymaps
- install -dm0755 "$pkgdir/usr/share/virtualbox/rdesktop-vrdp-keymaps"
- install -m0644 rdesktop-vrdp-keymaps/* "$pkgdir/usr/share/virtualbox/rdesktop-vrdp-keymaps"
- # useless scripts
- install -m0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh -t "$pkgdir/usr/share/virtualbox"
- # icons
- install -Dm0644 VBox.png "$pkgdir/usr/share/pixmaps/VBox.png"
- pushd icons >/dev/null
- for i in *; do
- install -d "$pkgdir/usr/share/icons/hicolor/$i/mimetypes"
- cp $i/* "$pkgdir/usr/share/icons/hicolor/$i/mimetypes"
- done
- popd >/dev/null
- #desktop
- install -Dm0644 virtualbox.desktop "$pkgdir/usr/share/applications/virtualbox.desktop"
- install -Dm0644 virtualbox.xml "$pkgdir/usr/share/mime/packages/virtualbox.xml"
- #install configuration
- install -dm0755 "$pkgdir/etc/vbox"
- echo 'INSTALL_DIR=/usr/lib/virtualbox' > "$pkgdir/etc/vbox/vbox.cfg"
- # back to srcdir
- cd "$srcdir"
- #licence
- install -Dm0644 VirtualBox-$pkgver/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- # install systemd stuff
- install -Dm0644 60-vboxdrv.rules "$pkgdir/usr/lib/udev/rules.d/60-vboxdrv.rules"
- install -Dm0644 vboxweb.service "$pkgdir/usr/lib/systemd/system/vboxweb.service"
- install -Dm0644 virtualbox.sysusers "$pkgdir/usr/lib/sysusers.d/virtualbox.conf"
- # install module reloading shortcut (with a symlink with default helper)
- install -Dm0755 vboxreload "$pkgdir/usr/bin"
- ln -s vboxreload "$pkgdir/usr/bin/rcvboxdrv"
- }
- package_virtualbox-sdk() {
- pkgdesc='VirtualBox Software Developer Kit (SDK)'
- depends=('python')
- install -dm0755 "$pkgdir/usr/lib/virtualbox"
- source "VirtualBox-$pkgver/env.sh"
- cd "VirtualBox-$pkgver/out/linux.$BUILD_PLATFORM_ARCH/release/bin"
- install -Dm0755 vboxshell.py "$pkgdir/usr/lib/virtualbox/vboxshell.py"
- # python sdk
- pushd sdk/installer
- VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$pkgdir"
- popd
- cp -r sdk "$pkgdir/usr/lib/virtualbox"
- rm -r "$pkgdir/usr/lib/virtualbox/sdk/installer"
- # licence
- install -Dm0644 "$srcdir/VirtualBox-$pkgver/COPYING" \
- "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- }
- package_virtualbox-host-dkms() {
- pkgdesc='VirtualBox Host kernel modules sources'
- depends=('dkms' 'gcc' 'make')
- replaces=('virtualbox-source'
- 'virtualbox-host-source'
- 'virtualbox-host-modules-lts')
- conflicts=('virtualbox-source' 'virtualbox-host-source')
- provides=('VIRTUALBOX-HOST-MODULES')
- install=virtualbox-host-dkms.install
- install -dm0755 "$pkgdir/usr/src"
- source "VirtualBox-$pkgver/env.sh"
- cd "VirtualBox-$pkgver/out/linux.$BUILD_PLATFORM_ARCH/release/bin"
- cp -r src "$pkgdir/usr/src/vboxhost-${pkgver}_OSE"
- # licence
- install -Dm0644 "$srcdir/VirtualBox-$pkgver/COPYING" \
- "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- # module loading
- local _p="$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
- install -Dm0644 /dev/null "$_p"
- printf "vboxdrv\nvboxnetadp\nvboxnetflt\n" > "$_p"
- # starting vbox 5.1, dkms.conf file was dropped
- local _p="$pkgdir/usr/src/vboxhost-${pkgver}_OSE/dkms.conf"
- install -Dm0644 "$srcdir/$pkgname.conf" "$_p"
- sed -i "s,@VERSION@,$pkgver," "$_p"
- }
- package_virtualbox-guest-utils() {
- pkgdesc='VirtualBox Guest userspace utilities'
- depends=('glibc' 'pam' 'libx11' 'libxcomposite' 'libxdamage' 'libxext'
- 'libxfixes' 'libxmu' 'libxt' 'xorg-xrandr' 'xf86-video-vmware'
- 'VIRTUALBOX-GUEST-MODULES')
- replaces=('virtualbox-archlinux-additions'
- 'virtualbox-guest-additions'
- 'virtualbox-guest-dkms')
- conflicts=('virtualbox-archlinux-additions'
- 'virtualbox-guest-additions'
- 'virtualbox-guest-utils-nox'
- 'virtualbox-guest-dkms')
- source "VirtualBox-$pkgver/env.sh"
- pushd "VirtualBox-$pkgver/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
- install -d "$pkgdir/usr/bin"
- install -m0755 VBoxClient VBoxControl VBoxDRMClient VBoxService "$pkgdir/usr/bin"
- install -m0755 -D "$srcdir"/VirtualBox-$pkgver/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
- "$pkgdir"/usr/bin/VBoxClient-all
- install -m0644 -D "$srcdir"/VirtualBox-$pkgver/src/VBox/Additions/x11/Installer/vboxclient.desktop \
- "$pkgdir"/etc/xdg/autostart/vboxclient.desktop
- install -m0755 -D pam_vbox.so "$pkgdir/usr/lib/security/pam_vbox.so"
- popd
- # systemd stuff
- install -Dm0644 60-vboxguest.rules "$pkgdir/usr/lib/udev/rules.d/60-vboxguest.rules"
- install -Dm0644 vboxdrmclient.path "$pkgdir/usr/lib/systemd/system/vboxdrmclient.path"
- install -Dm0644 vboxdrmclient.service "$pkgdir/usr/lib/systemd/system/vboxdrmclient.service"
- install -Dm0644 vboxservice.service "$pkgdir/usr/lib/systemd/system/vboxservice.service"
- install -Dm0644 virtualbox-guest-utils.sysusers "$pkgdir/usr/lib/sysusers.d/virtualbox-guest-utils.conf"
- # licence
- install -Dm0644 VirtualBox-$pkgver/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- }
- package_virtualbox-guest-utils-nox() {
- pkgdesc='VirtualBox Guest userspace utilities without X support'
- depends=('glibc' 'pam' 'VIRTUALBOX-GUEST-MODULES')
- replaces=('virtualbox-guest-dkms')
- conflicts=('virtualbox-guest-utils'
- 'virtualbox-guest-dkms')
- source "VirtualBox-$pkgver/env.sh"
- pushd "VirtualBox-$pkgver/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
- install -d "$pkgdir/usr/bin"
- install -m0755 VBoxControl VBoxService "$pkgdir/usr/bin"
- install -m0755 -D pam_vbox.so "$pkgdir/usr/lib/security/pam_vbox.so"
- popd
- # systemd stuff
- install -Dm0644 60-vboxguest.rules "$pkgdir/usr/lib/udev/rules.d/60-vboxguest.rules"
- install -Dm0644 vboxservice-nox.service "$pkgdir/usr/lib/systemd/system/vboxservice.service"
- install -Dm0644 virtualbox-guest-utils.sysusers "$pkgdir/usr/lib/sysusers.d/virtualbox-guest-utils.conf"
- # licence
- install -Dm0644 "$srcdir/VirtualBox-$pkgver/COPYING" \
- "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- }
- package_virtualbox-ext-vnc() {
- pkgdesc='VirtualBox VNC extension pack'
- depends=('virtualbox' 'libvncserver')
- optdepends=('tigervnc: vnc client')
- install=virtualbox-ext-vnc.install
- source "VirtualBox-$pkgver/env.sh"
- cd "VirtualBox-$pkgver/out/linux.$BUILD_PLATFORM_ARCH/release/packages"
- install -Dm0644 VNC-*.vbox-extpack "$pkgdir/usr/share/virtualbox/extensions/VNC-${pkgver}.vbox-extpack"
- # licence
- install -Dm0644 "$srcdir/VirtualBox-$pkgver/COPYING" \
- "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement