@@ -35,21 +35,55 @@ wget \
3535 https://sources.debian.org/data/main/z/zsync/0.6.2-6/debian/patches/manpages.diff \
3636 https://sources.debian.org/data/main/z/zsync/0.6.2-6/debian/patches/clienthttp.diff \
3737 https://sources.debian.org/data/main/z/zsync/0.6.2-6/debian/patches/fix-build-with-gcc-14.patch
38+
3839sha256sum -c << \EOF
3940f14a7ffcb3bdadba252c9afbe5e8da358fc77f20072ae5b21475bdfc44b50975 buildsystem.diff
4041085e9b5856bb8ac0d8567e977a9d5fafc6c19df02b7cfb8e011fedaf2862eaad clienthttp.diff
4142f04bba2866c47b8597723d49eec3f1fd50e40a08171e261bf0fc262852ba17e5 manpages.diff
424335cbce69194743df1f3f4b9bc9ad36a4c440b117c6a17c268023c642c0d50650 fix-build-with-gcc-14.patch
4344EOF
4445
46+ # custom patch to at least ignore flags passed after the first parameter
47+ # see https://github.com/AppImage/appimagetool/pull/93 for more information
48+ cat > argparser.patch << \EOF
49+ diff --git a/make.c b/make.c
50+ index 191b527..d86f130 100644
51+ --- a/make.c
52+ +++ b/make.c
53+ @@ -564,6 +564,14 @@ off_t get_len(FILE * f) {
54+ * Main program
55+ */
56+ int main(int argc, char **argv) {
57+ + if (getenv("VERBOSE") != 0) {
58+ + fprintf(stderr, "Parameters:");
59+ + for (int i = 0; i < argc; ++i) {
60+ + fprintf(stderr, " %s", argv[i]);
61+ + }
62+ + fprintf(stderr, "\n\n");
63+ + }
64+ +
65+ FILE *instream;
66+ char *fname = NULL, *zfname = NULL;
67+ char **url = NULL;
68+ @@ -641,7 +649,7 @@ int main(int argc, char **argv) {
69+ }
70+
71+ /* Open data to create .zsync for - either it's a supplied filename, or stdin */
72+ - if (optind == argc - 1) {
73+ + if (optind <= argc - 1) {
74+ infname = strdup(argv[optind]);
75+ instream = fopen(infname, "rb");
76+ if (!instream) {
77+ EOF
78+
4579for i in * .diff * .patch; do
4680 echo " Applying patch $i ..."
4781 patch -p1 < " $i "
4882done
4983
5084find . -type f -exec sed -i -e ' s|off_t|size_t|g' {} \;
5185
52- ./configure CFLAGS=-no-pie LDFLAGS=-static --prefix=/usr --build=$( arch) -unknown-linux-gnu
86+ ./configure LDFLAGS=-static --prefix=/usr --build=$( arch) -unknown-linux-gnu
5387
5488if [[ " ${GITHUB_ACTIONS:- } " != " " ]]; then
5589 jobs=" $( nproc) "
0 commit comments