diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 168 |
1 files changed, 64 insertions, 104 deletions
@@ -1,165 +1,126 @@ # Maintainer: Lucki <https://aur.archlinux.org/account/Lucki> # Contributor: Carl Reinke <mindless2112 gmail com> +# shellcheck shell=bash +# shellcheck disable=SC2034,SC2154 pkgname=lix -pkgver=0.9.24 +pkgver=0.10.22 pkgrel=1 changelog=.CHANGELOG -source=("${pkgname}::git+https://github.com/SimonN/LixD.git#tag=v${pkgver}") -sha512sums=('SKIP') +source=("$pkgname-$pkgver.src.tar.gz::https://github.com/SimonN/LixD/archive/v$pkgver.tar.gz" + "$pkgname-music-1.1.zip::https://www.lixgame.com/dow/lix-music.zip") +sha512sums=('244f148a2dcf428a5009bd346860cc91113b3a025769f2f18ce37a67d8832b6afec16741dce2956ffd2920812d8bac5189124c3be9394842addc29479295558e' + '280fd25a479ac8dd24475b014234270a12ab34edca7fb2f7ce4b768259111b1e7626d3ba37ac13d810f0653d23d7c9f212776e94d2c0b31a0de580864771ce9f') -_pkgname=${pkgname} -# template start; name=lix; version=1.4; +_gitname=LixD pkgdesc="An action-puzzle game inspired by Lemmings" arch=('i686' 'x86_64') -url="http://www.lixgame.com/" +url="https://www.lixgame.com/" license=('custom:CC0') -depends=('allegro' 'enet' 'hicolor-icon-theme' 'liblphobos') -makedepends=('git' 'ldc' 'dub') -_dubv=( "4.0.4+5.2.0" # allegro - "0.7.1" # bolts - "4.1.0" # derelict-enet - "3.0.0-beta.2" # derelict-util - "0.4.2" # enumap - "1.2.2" # libinputvisitor - "0.6.3" # optional - "0.10.4" # sdlang-d - "0.8.0" # silly - "0.10.12" # taggedalgebraic - "0.7.52" # unit-threaded - ) - - -# let makepkg handle dub packages -# https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git_Submodules -source+=( "${_pkgname}-music-1.zip::http://www.lixgame.com/dow/lix-music.zip" - "${_pkgname}.desktop" - ) -sha512sums+=( '37349c98b739ea43c25137dd03865f1c9c41eec91e5edc109afd9d50ce3871bd0c7f63c3f3599a47bb4ef52f5bfd14e034010de0ac2aec5a9c0c83eaf0b89425' - '375b1439d9398371a3f58a92bfc0901b86bd89140aae431c7d9405bd2fb36ebcdb22b2686fea72d88b23a4ab94b138b4d742d8fd2965d8ec0542d2f8f64ed0c2' - ) -source+=( "allegro::git+https://github.com/SiegeLord/DAllegro5.git#tag=v${_dubv[0]}" - "bolts::git+https://github.com/aliak00/bolts.git#tag=v${_dubv[1]}" - "derelict-enet::git+https://github.com/DerelictOrg/DerelictENet.git#tag=v${_dubv[2]}" - "derelict-util::git+https://github.com/DerelictOrg/DerelictUtil.git#tag=v${_dubv[3]}" - "enumap::git+https://github.com/rcorre/enumap.git#tag=v${_dubv[4]}" - "libinputvisitor::git+https://github.com/Abscissa/libInputVisitor.git#tag=v${_dubv[5]}" - "optional::git+https://github.com/aliak00/optional.git#tag=v${_dubv[6]}" - "sdlang-d::git+https://github.com/Abscissa/SDLang-D.git#tag=v${_dubv[7]}" - "silly::git+https://github.com/ohdatboi/silly.git#tag=v${_dubv[8]}" - "taggedalgebraic::git+https://github.com/s-ludwig/taggedalgebraic.git#tag=v${_dubv[9]}" - "unit-threaded::git+https://github.com/atilaneves/unit-threaded.git#tag=v${_dubv[10]}" - ) -sha512sums+=( 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - ) - -_build() -{ - cd "${srcdir}/${_pkgname}" || exit - _r=0 - - # add local dependencies to search path - dub add-path "${srcdir}" +depends=('allegro' 'enet' 'hicolor-icon-theme' 'd-runtime') +makedepends=('git' 'd-compiler' 'dub' 'jq') - # ensure with --cache=local dub stays outside the users home directory - dub $@ --cache=local || _r="$?" +prepare() { + cd "$_gitname-$pkgver" || exit 1 - # remove local dependencies from search path so dub won't find them - # later again - dub remove-path "${srcdir}" + # Iterate thorugh the required packages and versions to fetch them in advance + # Read from dub.selections.json and print them as "package,version" + for line in $(jq -r '.versions | keys[] as $k | "\($k),\(.[$k])"' <dub.selections.json); do - # removes any cached metadata like the list of available packages - # and their latest version - dub clean-caches + # Split each dependency at the ',' + IFS=',' read -ra dep <<< "$line" - if [[ "${_r}" != 0 ]] - then - # dub failed so we also fail after we removed the local dependencies - return "${_r}" - fi + # Fetch each package at the required version + dub fetch --cache=local "${dep[0]}@${dep[1]}" + done } -build() -{ - cd "${srcdir}/${_pkgname}" || exit +_build() { + _r=0 + + # 2022.02.26 + # 15:22 <@SimonN> It's possible that it's already enough to raise the stack size in the current shell: ulimit -s 16384 + # 15:22 <@SimonN> See also: https://github.com/ldc-developers/ldc/issues/3913 + # 15:26 <@SimonN> Yes, very high chance that the following will fix/workaround: Execute "ulimit -s 16384" in the same shell that will then run dub. I.e., we double the stack size, assuming "ulimit -s" printed 8192 before; it does that for me in new shells. + ulimit -s 16384 + + dub "$@" \ + `# Do not resolve missing dependencies before building` \ + --nodeps \ + `# ensure dub stays outside the users home directory:` \ + --cache=local \ + `# Runs multiple compiler instances in parallel, if possible:` \ + --parallel \ + `# Forces a recompilation even if the target is up to date:` \ + --force \ + `# force FHS compatibility:` \ + --build=releaseXDG +} - # force FHS compatibility with 'releaseXDG' - _build build --force --build=releaseXDG +build() { + cd "$_gitname-$pkgver" || exit 1 + _build build } -check() -{ - cd "${srcdir}/${_pkgname}" || exit - _build test --parallel +check() { + cd "$_gitname-$pkgver" || exit 1 + _build test } -package() -{ - cd "${srcdir}" || exit +package() { + cd "$_gitname-$pkgver" || exit 1 # install application entry install -Dm644 \ `# SRCFILE:` \ - "${_pkgname}.desktop" \ + "data/desktop/com.lixgame.Lix.desktop" \ `# DSTFILE:` \ - "${pkgdir}/usr/share/applications/${_pkgname}.desktop" - - cd "${_pkgname}" || exit + "$pkgdir/usr/share/applications/$pkgname.desktop" # install application entry icon install -Dm644 \ `# SRCFILE:` \ - "data/images/${_pkgname}_logo.svg" \ + "data/images/${pkgname}_logo.svg" \ `# DSTFILE:` \ - "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${_pkgname}.svg" + "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg" # install license text install -Dm644 \ `# SRCFILE:` \ "doc/copying.txt" \ `# DSTFILE:` \ - "${pkgdir}/usr/share/licenses/${_pkgname}/COPYING" + "$pkgdir/usr/share/licenses/$pkgname/COPYING" # install man page install -Dm644 \ `# SRCFILE:` \ "doc/lix.6" \ `# DSTFILE:` \ - "${pkgdir}/usr/share/man/man6/lix.6" + "$pkgdir/usr/share/man/man6/lix.6" # install binary install -Dm755 \ `# SRCFILE:` \ - "bin/${_pkgname}" \ + "bin/$pkgname" \ `# DSTFILE:` \ - "${pkgdir}/usr/bin/${_pkgname}" + "$pkgdir/usr/bin/$pkgname" # remove unimportant files # https://raw.githubusercontent.com/SimonN/LixD/master/doc/build/package.txt - rm -r "${srcdir}/${_pkgname}/doc/build" + rm -r "doc/build" # https://lists.archlinux.org/pipermail/aur-general/2011-November/016777.html # make directories mkdir -p \ - "${pkgdir}/usr/share/${_pkgname}" \ - "${pkgdir}/usr/share/doc/${_pkgname}" + "$pkgdir/usr/share/$pkgname" \ + "$pkgdir/usr/share/doc/$pkgname" # copy documentary cp -dpr --no-preserve=ownership \ `# SRCFILES:` \ "doc/." \ `# DSTDIR:` \ - "${pkgdir}/usr/share/doc/${_pkgname}/" + "$pkgdir/usr/share/doc/$pkgname/" # copy game files cp -dpr --no-preserve=ownership \ @@ -167,8 +128,7 @@ package() "data" \ "images" \ "levels" \ - "${srcdir}/music" \ + "$srcdir/music" \ `# DSTDIR:` \ - "${pkgdir}/usr/share/${_pkgname}" + "$pkgdir/usr/share/$pkgname" } -# template end; |