Date: Tuesday, November 8, 2022 @ 07:59:59 Author: grawlinson Revision: 1345904
chore: ft2-clone Instead of maintaining a patch that needs to be updated after every release, do some sed magic instead. Modified: ft2-clone/trunk/PKGBUILD Deleted: ft2-clone/trunk/use-git-commit-date.patch ---------------------------+ PKGBUILD | 15 ++++++--------- use-git-commit-date.patch | 21 --------------------- 2 files changed, 6 insertions(+), 30 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-11-08 07:54:43 UTC (rev 1345903) +++ PKGBUILD 2022-11-08 07:59:59 UTC (rev 1345904) @@ -26,12 +26,8 @@ 'gendesk' ) _commit='3af99afd1fb732d735c34c02c926ca4d7ba5b061' -source=( - "$pkgname::git+https://github.com/8bitbubsy/ft2-clone#commit=$_commit" - 'use-git-commit-date.patch' -) -sha256sums=('SKIP' - '3e64484b9d27b38db050009f6a988a993f3de35dda0b3d40243f4516d3dc820e') +source=("$pkgname::git+https://github.com/8bitbubsy/ft2-clone#commit=$_commit") +b2sums=('SKIP') pkgver() { cd "$pkgname" @@ -55,11 +51,12 @@ --icon "$pkgname" \ --genericname 'Chiptune Tracker' - # attempt repro build - patch -p1 -i "$srcdir/use-git-commit-date.patch" + # attempt repro build by using commit date as build date + local commit_date="$(git show --no-patch --format=%cd --date=format:'%d %B %Y')" sed \ - -e "s/@DATE@/$(git show --no-patch --format=%cd --date=format:'%d %B %Y')/" \ + -e "/PROG_VER_STR/a #define PROG_VER_DATE \"$commit_date\"" \ -i src/ft2_header.h + sed -e 's/__DATE__/PROG_VER_DATE/' -i src/ft2_about.c } build() { Deleted: use-git-commit-date.patch =================================================================== --- use-git-commit-date.patch 2022-11-08 07:54:43 UTC (rev 1345903) +++ use-git-commit-date.patch 2022-11-08 07:59:59 UTC (rev 1345904) @@ -1,21 +0,0 @@ ---- a/src/ft2_about.c -+++ b/src/ft2_about.c -@@ -194,7 +194,7 @@ void showAboutScreen(void) // called once when About screen is opened - - showPushButton(PB_EXIT_ABOUT); - -- sprintf(customText3, "v%s (%s)", PROG_VER_STR, __DATE__); -+ sprintf(customText3, "v%s (%s)", PROG_VER_STR, PROG_VER_DATE); - customText1X = (SCREEN_W - textWidth(customText1)) >> 1; - customText2X = (SCREEN_W-8) - textWidth(customText2); - customText3X = (SCREEN_W-8) - textWidth(customText3); ---- a/src/ft2_header.h -+++ b/src/ft2_header.h -@@ -13,6 +13,7 @@ - #include "ft2_replayer.h" - - #define PROG_VER_STR "1.61" -+#define PROG_VER_DATE "@DATE@" - - // do NOT change these! It will only mess things up... -
