summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorLucki2024-04-08 16:44:00 +0200
committerLucki2024-04-08 16:49:45 +0200
commit4bd62d6a22ea1ff39c3de7f56bc335fff2983d78 (patch)
treee60e8d873de02a632b9cce26e8eed5981c7593c5 /PKGBUILD
parent9897685d8c9118285805e78f7918f7ff2b3dd9b7 (diff)
downloadaur-lix-git.tar.gz
upgpkg: lix-git 0.10.21.r1712198474.629c7121-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD76
1 files changed, 20 insertions, 56 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 32af93a6c453..d9bc333d74df 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
pkgname=lix-git
_pkgname=${pkgname%-git}
-pkgver=0.10.12.r1687252947.9bfcc4ab
+pkgver=0.10.21.r1712198474.629c7121
pkgrel=1
provides=("$_pkgname")
conflicts=("$_pkgname")
@@ -18,42 +18,7 @@ arch=('i686' 'x86_64')
url="https://www.lixgame.com/"
license=('custom:CC0')
depends=('allegro' 'enet' 'hicolor-icon-theme' 'd-runtime')
-makedepends=('git' 'd-compiler' 'dub')
-_dubv=( "4.0.6+5.2.0" # allegro
- "1.3.1" # bolts
- "4.2.0" # derelict-enet
- "3.0.0-beta.2" # derelict-util
- "0.4.2" # enumap
- "1.3.0" # optional
- "0.10.6" # sdlang-d
- "0.11.22" # taggedalgebraic
- "0.7.55" # unit-threaded
- )
-
-# let makepkg handle dub packages
-# These have to be git clones, otherwise dub isn't able to pick them up with the correct version later on
-# no git, no version field, assumed ~master
-# https://dub.pm/commandline.html#add-path
-source+=( "$pkgname-allegro::git+https://github.com/SiegeLord/DAllegro5.git#tag=v${_dubv[0]}"
- "$pkgname-bolts::git+https://github.com/aliak00/bolts.git#tag=v${_dubv[1]}"
- "$pkgname-derelict-enet::git+https://github.com/DerelictOrg/DerelictENet.git#tag=v${_dubv[2]}"
- "$pkgname-derelict-util::git+https://github.com/DerelictOrg/DerelictUtil.git#tag=v${_dubv[3]}"
- "$pkgname-enumap::git+https://github.com/rcorre/enumap.git#tag=v${_dubv[4]}"
- "$pkgname-optional::git+https://github.com/aliak00/optional.git#tag=v${_dubv[5]}"
- "$pkgname-sdlang-d::git+https://github.com/Abscissa/SDLang-D.git#tag=v${_dubv[6]}"
- "$pkgname-taggedalgebraic::git+https://github.com/s-ludwig/taggedalgebraic.git#tag=v${_dubv[7]}"
- "$pkgname-unit-threaded::git+https://github.com/atilaneves/unit-threaded.git#tag=v${_dubv[8]}"
- )
-sha512sums+=( 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- )
+makedepends=('git' 'd-compiler' 'dub' 'jq')
pkgver() {
# https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git
@@ -69,6 +34,21 @@ pkgver() {
)
}
+prepare() {
+ cd "$pkgname" || exit 1
+
+ # 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
+
+ # Split each dependency at the ','
+ IFS=',' read -ra dep <<< "$line"
+
+ # Fetch each package at the required version
+ dub fetch --cache=local "${dep[0]}@${dep[1]}"
+ done
+}
+
_build() {
_r=0
@@ -78,10 +58,9 @@ _build() {
# 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
- # add local dependencies to search path
- dub add-path "$srcdir"
-
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:` \
@@ -89,22 +68,7 @@ _build() {
`# Forces a recompilation even if the target is up to date:` \
--force \
`# force FHS compatibility:` \
- --build=releaseXDG \
- `# Save result code for later when failed:` \
- || _r="$?"
-
- # remove local dependencies from search path so dub won't find them
- # later again
- dub remove-path "$srcdir"
-
- # removes any cached metadata like the list of available packages
- # and their latest version
- dub clean-caches
-
- if [[ "$_r" != 0 ]]; then
- # dub failed so we also fail after we removed the local dependencies
- return "$_r"
- fi
+ --build=releaseXDG
}
build() {