diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 95 |
1 files changed, 52 insertions, 43 deletions
@@ -1,64 +1,73 @@ # Maintainer: S Stewart <tda@null.net> # Maintainer: Cranky Supertoon <crankysupertoon@gmail.com> pkgname="gdlauncher" -pkgver="1.0.9" +pkgver="1.1.29" pkgrel=1 -commitsha="4b42a941f7725e5c6b84dd2066f74f95ef0a3cb0" arch=('x86_64') pkgdesc="GDLauncher is simple, yet powerful Minecraft custom launcher with a strong focus on the user experience" url="https://gdevs.io" license=('GPL3') -makedepends=('gendesk' 'git' 'yarn' 'nodejs' 'rust' 'unzip') -depends=('libnotify' 'libxss' 'libxtst' 'libindicator-gtk3' 'libappindicator-gtk3') -conflicts=('gdlauncher-appimage' 'gdlauncher-git' 'gdlauncher-bin') -source=("gdlauncher::git+https://github.com/gorilla-devs/GDLauncher.git") -md5sums=('SKIP') +makedepends=('gendesk' 'nodejs' 'npm' 'rust') +depends=('libnotify' 'libxss' 'libxtst' 'libindicator-gtk3' 'libappindicator-gtk3' 'electron16' 'p7zip') +conflicts=('gdlauncher-beta' 'gdlauncher-beta-bin' 'gdlauncher-appimage' 'gdlauncher-git' 'gdlauncher-bin' 'gdlauncher-appimage') +provides=('gdlauncher') +source=("https://github.com/gorilla-devs/GDLauncher/archive/refs/tags/v${pkgver}.tar.gz" + "use-system-7za-and-disable-updater.patch") +md5sums=('68987cd0f7d4837f29cf5bb5bdfba8fa' + '68c75869fe0898c54699b9a5eb667d7b') prepare() { - # clone source - cd "${srcdir}/${pkgname}" - git checkout origin/master - git switch master - git reset --hard ${commitsha} - - # generate .desktop - gendesk -f --pkgname "GDLauncher" --pkgdesc "${pkgdesc}" --icon ${pkgname} --exec "/usr/bin/${pkgname}" -n -f - mv "GDLauncher.desktop" "${pkgname}.desktop" + # Generate .desktop + gendesk --pkgname "GDLauncher" --pkgdesc "${pkgdesc}" --icon ${pkgname} --exec "/usr/bin/${pkgname}" --categories "Application;Game" -n -f - # put yarn in testing mode - cd "${srcdir}/${pkgname}" - echo "RELEASE_TESTING=true" > .env + cd "${srcdir}/GDLauncher-${pkgver}/" + + # Apply patches, copied from ObserverOfTime's gdlauncher-git + sed -i package.json \ + -e '/electron-updater/d;/7zip-bin/d' \ + -e 's$public/electron.js$build/electron.js$' \ + -e '/"dependencies"/i\ "bundledDependencies": ["7zip-bin"],' \ + -e 's/0.13.1/0.13.2/g' # bump dependency version + patch -p1 -i "${srcdir}/use-system-7za-and-disable-updater.patch" + + # Create .git folder to stop Husky from crashing + mkdir -p .git } build() { - cd "${srcdir}/${pkgname}" - yarn - yarn release + cd "${srcdir}/GDLauncher-${pkgver}/" + + # Install required npm packages + npm install --legacy-peer-deps --cache="${srcdir}/npm-cache" + + # Build the program + export CI=false \ + APP_TYPE=electron \ + NODE_ENV=production \ + REACT_APP_RELEASE_TYPE=setup + npx craco build + npx webpack --config ./scripts/electronWebpackConfig.js } package() { - # install the main files. - install -d -m755 "${pkgdir}/opt/${pkgname}" - cd "${srcdir}/${pkgname}/deploy" - mkdir gdlauncher/ - unzip "GDLauncher-linux-setup.zip" -d gdlauncher - cp -Rr "${srcdir}/${pkgname}/deploy/${pkgname}"* "${pkgdir}/opt/" - - # desktop entry - install -D -m644 "${srcdir}/${pkgname}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" + # Copy runtime files + install -d -m755 "${pkgdir}/usr/lib/gdlauncher/" + rm "${srcdir}/GDLauncher-${pkgver}/build/installer"{.nsh,{Header,Sidebar}.bmp} # Unecessary install files + cp -r "${srcdir}/GDLauncher-${pkgver}/"{package.json,build} "${pkgdir}/usr/lib/gdlauncher/" - # install the icon - install -d -m755 "${pkgdir}/usr/share/icons/hicolor" - cp -Rr "${srcdir}/${pkgname}/public/icon.png" "${pkgdir}/usr/share/icons/" - - # fix file permissions - all files as 644 - directories as 755 - find "${pkgdir}/"{opt,usr} -type d -exec chmod 755 {} \; - find "${pkgdir}/"{opt,usr} -type f -exec chmod 644 {} \; + # Create run script + install -d -m755 "${pkgdir}/usr/bin/" + printf '#!/bin/sh\ncd /usr/lib/gdlauncher/\nexec electron16 . "$@"' > "${pkgdir}/usr/bin/gdlauncher" + chmod a+x "${pkgdir}/usr/bin/gdlauncher" - # make sure the main binary has the right permissions - chmod +x "${pkgdir}/opt/${pkgname}/${pkgname}" + # Desktop entry + install -d -m755 "${pkgdir}/usr/share/applications/" + install -D -m644 "${srcdir}/GDLauncher.desktop" "${pkgdir}/usr/share/applications/GDLauncher.desktop" - # link the binary - install -d -m755 "${pkgdir}/usr/bin" - ln -sr "${pkgdir}/opt/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" + # Install icons + cd "${srcdir}/GDLauncher-${pkgver}/public/linux-icons/" + for icon in *.png; do + install -d -m755 "${pkgdir}/usr/share/icons/hicolor/${icon::-4}/apps/" + cp "$icon" "${pkgdir}/usr/share/icons/hicolor/${icon::-4}/apps/${pkgname}.png" + done } |