diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 116 |
1 files changed, 78 insertions, 38 deletions
@@ -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 |