summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudia Pellegrino2023-05-18 14:09:58 +0200
committerClaudia Pellegrino2023-05-18 14:09:58 +0200
commita6d9802513675539b44c8038faa14ec8b49e8090 (patch)
treec82b1f49361e1e5d78253e2f9b156ab72eade052
parentc9bce64ede9775ba2164cc91c2e602d426c26193 (diff)
downloadaur-a6d9802513675539b44c8038faa14ec8b49e8090.tar.gz
Remove build-time Git error flood
The original Makefile tries to calculate a Git revision number from the source tree. Unless the source tree happens to be a checked-out Git worktree, that causes standard output to be flooded with lots of unhelpful error messages and help texts. If Git is not installed at build time, similar error messages would occur. Short-circuit the Git revision calculation to prevent this.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD3
-rw-r--r--fix-git-rev.patch13
3 files changed, 18 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0d74b3779bc2..0d55095c470f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -12,8 +12,10 @@ pkgbase = x16-emulator
depends = sdl2
depends = x16-rom=r42
source = x16-emulator-r42.tar.gz::https://github.com/X16Community/x16-emulator/archive/r42.tar.gz
+ source = fix-git-rev.patch
source = modify-base-path.patch
md5sums = 3cc24b8783c2c11890dc284d9d55219e
+ md5sums = c0b5ba5190ef5ee4dd8e58433f261e35
md5sums = 5cd0550d2af1b4267c9b9f30eed9691e
pkgname = x16-emulator
diff --git a/PKGBUILD b/PKGBUILD
index b019b6382477..b7d4069cda2f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,16 +13,19 @@ makedepends=('clang' 'pandoc' 'gendesk')
source=(
"$pkgname-$pkgver.tar.gz::https://github.com/X16Community/$pkgname/archive/$pkgver.tar.gz"
+ "fix-git-rev.patch"
"modify-base-path.patch"
)
md5sums=(
'3cc24b8783c2c11890dc284d9d55219e'
+ 'c0b5ba5190ef5ee4dd8e58433f261e35'
'5cd0550d2af1b4267c9b9f30eed9691e'
)
prepare() {
cd "$pkgname-$pkgver"
+ patch -uN < ../fix-git-rev.patch
patch -uN src/main.c ../modify-base-path.patch
sed -i -e 's/^\(LDFLAGS=.*\)/\1 '"${LDFLAGS}/" Makefile
gendesk -f -n --pkgname "$pkgname" --pkgdesc "$pkgdesc" --name "X16 Emulator" --icon "$pkgname" --exec "x16emu" --categories "Game;Emulator"
diff --git a/fix-git-rev.patch b/fix-git-rev.patch
new file mode 100644
index 000000000000..186ce1e616ba
--- /dev/null
+++ b/fix-git-rev.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 6b1f4fe..ee65ed2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -42,7 +42,7 @@ endif
+ X16_OUTPUT=x16emu
+ MAKECART_OUTPUT=makecart
+
+-GIT_REV=$(shell git diff --quiet && echo -n $$(git rev-parse --short=8 HEAD || /bin/echo "00000000") || /bin/echo -n $$( /bin/echo -n $$(git rev-parse --short=7 HEAD || /bin/echo "0000000"); /bin/echo -n '+'))
++GIT_REV=0000000
+
+ CFLAGS+=-D GIT_REV='"$(GIT_REV)"'
+