diff options
author | Nicolas Guilloux | 2019-11-02 04:18:41 +0100 |
---|---|---|
committer | Nicolas Guilloux | 2019-11-02 04:18:41 +0100 |
commit | 5fd77ff7736ac9630d23a16f45751b8e2c2d9aa5 (patch) | |
tree | d33526e7effee79c28add329690915e1fa2d0493 | |
parent | 1603403bef1ee9e9a6203fedad8c36da46f6eeea (diff) | |
download | aur-5fd77ff7736ac9630d23a16f45751b8e2c2d9aa5.tar.gz |
Add new AppImage installation with version matching the AppImage version
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | PKGBUILD | 116 | ||||
-rw-r--r-- | parse_yaml.sh | 16 | ||||
-rw-r--r-- | shadow-beta.install | 15 |
6 files changed, 101 insertions, 56 deletions
@@ -1,6 +1,6 @@ pkgbase = shadow-beta pkgdesc = Shadow Bêta application - pkgver = 4.8.6 + pkgver = 5.0.228 pkgrel = 1 url = http://shadow.tech install = shadow-beta.install @@ -33,8 +33,8 @@ pkgbase = shadow-beta depends = libsndio-61-compat depends = gnome-keyring provides = shadow-beta - source = shadow-beta-4.8.6-1.zip::https://update.shadow.tech/launcher/preprod/linux/ubuntu_18.04/ShadowBeta.zip - md5sums = c2837f61b3b7dd190fcb38a1e9b73c88 + source = shadow-beta-5.0.228-1.AppImage::https://update.shadow.tech/launcher/preprod/linux/ubuntu_18.04/ShadowBeta.AppImage + sha512sums = SKIP pkgname = shadow-beta diff --git a/.gitignore b/.gitignore index 8fd22c281b9c..0a20054752cf 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ shadowbeta.deb .directory *.zip *.part +*.AppImage +*.yml @@ -15,6 +15,8 @@ clear: ## Clears files rm -f ./shadow-beta-*.pkg.tar.xz rm -f ./*~ rm -f shadow-beta.zip + rm -f *.AppImage + rm -f *.yml install:build ## Installs package with pacman sudo pacman -U shadow-beta-*.pkg.tar @@ -5,62 +5,102 @@ # Made with https://github.com/NicolasGuilloux/blade-shadow-beta -_commit=9add3366d25530d51d168608c54b5339b64d2a4e -pkgname=shadow-beta -pkgver=4.8.6 -pkgrel=1 -pkgdesc="Shadow Bêta application" -arch=('x86_64') -url="http://shadow.tech" -license=('unknown') -depends=('desktop-file-utils' 'freetype2' 'libuv' 'gconf' 'hicolor-icon-theme' 'json-c' 'libappindicator-gtk2' 'libbsd' 'libcurl-gnutls' 'libdrm' 'libnotify' 'libva' 'libxtst' 'nss' 'opus' 'qt5-base' 'qt5-svg' 'sdl2' 'libappindicator' 'libcurl-compat' 'sdl' 'gcc7-libs' 'ttf-dejavu' 'libxss' 'libsndio-61-compat' 'gnome-keyring') -provides=(shadow-beta) -source=("$pkgname-$pkgver-$pkgrel.zip::https://update.shadow.tech/launcher/preprod/linux/ubuntu_18.04/ShadowBeta.zip") -md5sums=('c2837f61b3b7dd190fcb38a1e9b73c88') -install=$pkgname.install +# Import parse_yaml script +. parse_yaml.sh -# Extract the zip file and prepare for the build -prepare() { - ### Create working folder - mkdir shadow +# Get the info from the yaml +info() { + if [ ! -f info.yml ]; then + curl -s "https://storage.googleapis.com/shadow-update/launcher/preprod/linux/ubuntu_18.04/latest-linux.yml" -o info.yml + fi + + eval $(parse_yaml info.yml "shadow_") +} + +# Get the package version +pkgver() { + info + + echo "$shadow_version" +} + +# Get the SHA512 checksum +sha512sum() { + info - ### Extract zip file - bsdtar -x -f "$pkgname-$pkgver-$pkgrel.zip" -C shadow + echo "$shadow_sha512" +} + +file() { + echo "$pkgname-$pkgver-$pkgrel.AppImage" +} - ### Extract the deb - ar xv shadow/Shadow*.deb +# Extract the zip file and prepare for the build +prepare() { + # Give execution rights + chmod +x $(file) - ### Extract the data - bsdtar xf data.tar.xz + # Extract AppImage + ./$(file) --appimage-extract } # Build the package package() { + # Make the directories + mkdir -p "${pkgdir}/opt" + + # Move directories + mv "${srcdir}/squashfs-root/usr" "${pkgdir}" + mv "${srcdir}/squashfs-root" "${pkgdir}/opt/${pkgname}" + # Move de icons - mv "${srcdir}/usr/share/icons/hicolor/0x0/" "${srcdir}/usr/share/icons/hicolor/1024x1024/" + mv "${pkgdir}/usr/share/icons/hicolor/0x0/" "${pkgdir}/usr/share/icons/hicolor/1024x1024/" # Make a copy of the icons - echo "cp \"${srcdir}/usr/share/icons/hicolor/1024x1024/apps/*\" \"${srcdir}/usr/share/icons/\"" - cp ${srcdir}/usr/share/icons/hicolor/1024x1024/apps/* "${srcdir}/usr/share/icons/" - - # Move the files - mv "${srcdir}/usr" "${pkgdir}" - mv "${srcdir}/opt" "${pkgdir}" + cp "${pkgdir}/usr/share/icons/hicolor/1024x1024/apps/shadow-${basename}.png" "${pkgdir}/usr/share/icons/" # Fix rights chmod -R g-w "${pkgdir}/usr" chmod -R g-w "${pkgdir}/opt" + # Create shortcut folder + mkdir "${pkgdir}/usr/share/applications" + # Move to shortcut directory - cd "${pkgdir}/usr/share/applications/" + cd "${pkgdir}/usr/share/applications" + + mv "${pkgdir}/opt/${pkgname}/shadow-${basename}.desktop" "${pkgname}.desktop" + sed -i -e 's/^Categories=.*$/Categories=Games;Game;Utility;Virtualization/g' ${pkgname}.desktop + sed -i -e "s/^Exec=.*$/Exec=\/opt\/${pkgname}\/shadow-${basename} --no-sandbox/g" ${pkgname}.desktop + + chmod g-w ${pkgname}.desktop - sed -i -e 's/^Categories=.*$/Categories=Games;Game;Utility;Virtualization/g' shadow-preprod.desktop - sed -i -e 's/^Exec=.*$/& --no-sandbox/g' shadow-preprod.desktop - mv shadow-preprod.desktop "${srcdir}/shadow-beta.desktop" + # Create shortcut + mkdir -p "${pkgdir}/usr/bin" + ln -sf "/opt/${pkgname}/shadow-${basename}" "${pkgdir}/usr/bin/{$pkgname}" - # Move the source directory - cd "${srcdir}" + # Remove AppImage related files + rm "${pkgdir}/opt/${pkgname}/AppRun" - chmod g-w "${srcdir}/shadow-beta.desktop" - mv "${srcdir}/shadow-beta.desktop" "${pkgdir}/usr/share/applications/shadow-beta.desktop" + # Remove embedded libraries to avoid conflicts + rm -R "${pkgdir}/usr/lib" + + # Fix rights + chmod 755 -R "${pkgdir}" } + +_commit=9add3366d25530d51d168608c54b5339b64d2a4e +pkgname=shadow-beta +basename=preprod +pkgver="$(pkgver)" +pkgrel=1 +pkgdesc="Shadow Bêta application" +arch=('x86_64') +url="http://shadow.tech" +license=('unknown') +depends=('desktop-file-utils' 'freetype2' 'libuv' 'gconf' 'hicolor-icon-theme' 'json-c' 'libappindicator-gtk2' 'libbsd' 'libcurl-gnutls' 'libdrm' 'libnotify' 'libva' 'libxtst' 'nss' 'opus' 'qt5-base' 'qt5-svg' 'sdl2' 'libappindicator' 'libcurl-compat' 'sdl' 'gcc7-libs' 'ttf-dejavu' 'libxss' 'libsndio-61-compat' 'gnome-keyring') +provides=(shadow-beta) +source=("$(file)::https://update.shadow.tech/launcher/${basename}/linux/ubuntu_18.04/ShadowBeta.AppImage") +# sha512sums=("$(sha512sum)) +sha512sums=('SKIP') +install=$pkgname.install
\ No newline at end of file diff --git a/parse_yaml.sh b/parse_yaml.sh new file mode 100644 index 000000000000..4450daa5c161 --- /dev/null +++ b/parse_yaml.sh @@ -0,0 +1,16 @@ +#!/bin/sh +parse_yaml() { + local prefix=$2 + local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') + sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | + awk -F$fs '{ + indent = length($1)/2; + vname[indent] = $2; + for (i in vname) {if (i > indent) {delete vname[i]}} + if (length($3) > 0) { + vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")} + printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3); + } + }' +}
\ No newline at end of file diff --git a/shadow-beta.install b/shadow-beta.install index cf06b09fe7d0..7c7ae479f860 100644 --- a/shadow-beta.install +++ b/shadow-beta.install @@ -1,14 +1,3 @@ -post_install() { - # Adding all users to the input group - for user in `ls /home` - do - gpasswd -a $user input - done - - # Create the link to the binary - ln -sf '/opt/shadowbeta/shadow-wrapper.pl' '/usr/bin/shadow-beta' -} - post_remove() { # Remove configuration for user in `ls /home` @@ -25,7 +14,3 @@ pre_upgrade(){ rm -r "/opt/Shadow Beta" fi } - -post_upgrade(){ - post_install -} |