diff options
author | David Seifert <soap@gentoo.org> | 2020-11-21 21:37:58 +0100 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2020-11-21 21:37:58 +0100 |
commit | 493e624738974512a14a9eef9391f4c9340f659d (patch) | |
tree | 743862dc3bb27350c4c3adfb44f1b82fff3150a7 /games-util | |
parent | games-action/luola: Port to EAPI 7 (diff) | |
download | gentoo-493e624738974512a14a9eef9391f4c9340f659d.tar.gz gentoo-493e624738974512a14a9eef9391f4c9340f659d.tar.bz2 gentoo-493e624738974512a14a9eef9391f4c9340f659d.zip |
games-util/fteqcc: Port to EAPI 7
Closes: https://bugs.gentoo.org/707434
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'games-util')
-rw-r--r-- | games-util/fteqcc/files/fteqcc-2501-Makefile.patch | 61 | ||||
-rw-r--r-- | games-util/fteqcc/files/fteqcc-2501-cleanup-source.patch | 205 | ||||
-rw-r--r-- | games-util/fteqcc/fteqcc-2501.ebuild | 31 |
3 files changed, 240 insertions, 57 deletions
diff --git a/games-util/fteqcc/files/fteqcc-2501-Makefile.patch b/games-util/fteqcc/files/fteqcc-2501-Makefile.patch new file mode 100644 index 000000000000..cc70e9be4d8b --- /dev/null +++ b/games-util/fteqcc/files/fteqcc-2501-Makefile.patch @@ -0,0 +1,61 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,51 +1,19 @@ + QCC_OBJS=qccmain.o qcc_cmdlib.o qcc_pr_comp.o qcc_pr_lex.o comprout.o hash.o qcd_main.o
+ GTKGUI_OBJS=qcc_gtk.o qccguistuff.c
+
+-CC=gcc -Wall -DQCCONLY
+-
+-DO_CC=$(CC) $(BASE_CFLAGS) -o $@ -c $< $(CFLAGS)
+-
+ all: qcc
+
+-BASE_CFLAGS=-ggdb
+-CFLAGS =
+-
++CFLAGS += -Wall
++CPPFLAGS += -DQCCONLY
+
+ win_nocyg: $(QCC_OBJS) qccgui.c qccguistuff.c
+- $(CC) $(BASE_CFLAGS) -o fteqcc.exe -O3 -s $(QCC_OBJS) -mno-cygwin -mwindows
++ $(CC) $(BASE_CFLAGS) -o fteqcc.exe $(QCC_OBJS) -mno-cygwin -mwindows
+ nocyg: $(QCC_OBJS) qccgui.c qccguistuff.c
+- $(CC) $(BASE_CFLAGS) -o fteqcc.exe -O3 -s $(QCC_OBJS) -mno-cygwin
++ $(CC) $(BASE_CFLAGS) -o fteqcc.exe $(QCC_OBJS) -mno-cygwin
+ win: $(QCC_OBJS) qccgui.c qccguistuff.c
+- $(CC) $(BASE_CFLAGS) -o fteqcc.exe -O3 -s $(QCC_OBJS) -mwindows
++ $(CC) $(BASE_CFLAGS) -o fteqcc.exe $(QCC_OBJS) -mwindows
+ qcc: $(QCC_OBJS)
+- $(CC) $(BASE_CFLAGS) -o fteqcc.bin -O3 -s $(QCC_OBJS)
+-
+-qccmain.o: qccmain.c qcc.h
+- $(DO_CC)
+-
+-qcc_cmdlib.o: qcc_cmdlib.c qcc.h
+- $(DO_CC)
+-
+-qcc_pr_comp.o: qcc_pr_comp.c qcc.h
+- $(DO_CC)
+-
+-qcc_pr_lex.o: qcc_pr_lex.c qcc.h
+- $(DO_CC)
+-
+-comprout.o: comprout.c qcc.h
+- $(DO_CC)
+-
+-hash.o: hash.c qcc.h
+- $(DO_CC)
+-
+-qcd_main.o: qcd_main.c qcc.h
+- $(DO_CC)
+-
+-qccguistuff.o: qccguistuff.c qcc.h
+- $(DO_CC)
+-
+-qcc_gtk.o: qcc_gtk.c qcc.h
+- $(DO_CC) `pkg-config --cflags gtk+-2.0`
++ $(CC) $(BASE_CFLAGS) $(LDFLAGS) -o fteqcc.bin $(QCC_OBJS)
+
+ gtkgui: $(QCC_OBJS) $(GTKGUI_OBJS)
+- $(CC) $(BASE_CFLAGS) -DQCCONLY -DUSEGUI -o fteqccgui.bin -O3 $(GTKGUI_OBJS) $(QCC_OBJS) `pkg-config --libs gtk+-2.0`
++ $(CC) $(CFLAGS) $(LDFLAGS) -DUSEGUI -o fteqccgui.bin $(GTKGUI_OBJS) $(QCC_OBJS) $(GTK_LIBS)
diff --git a/games-util/fteqcc/files/fteqcc-2501-cleanup-source.patch b/games-util/fteqcc/files/fteqcc-2501-cleanup-source.patch index 35f3dcf100ae..be8cccb074b2 100644 --- a/games-util/fteqcc/files/fteqcc-2501-cleanup-source.patch +++ b/games-util/fteqcc/files/fteqcc-2501-cleanup-source.patch @@ -1,43 +1,5 @@ ---- qcc_pr_comp.c -+++ qcc_pr_comp.c -@@ -7322,7 +7322,7 @@ - QCC_def_t *def, *d;
- QCC_function_t *f;
- QCC_dfunction_t *df;
-- int i;
-+ int i = 0;
- pbool shared=false;
- pbool externfnc=false;
- pbool isconstant = false;
-@@ -8541,8 +8545,6 @@ - struct qcc_includechunk_s *oldcurrentchunk;
- extern struct qcc_includechunk_s *currentchunk;
-
-- extern char qccmsourcedir[];
--
- ocompilingfile = compilingfile;
- os_file = s_file;
- os_file2 = s_file2;
---- hash.h -+++ hash.h -@@ -19,12 +19,12 @@ - int Hash_Key(char *name, int modulus);
- void *Hash_Get(hashtable_t *table, char *name);
- void *Hash_GetInsensative(hashtable_t *table, char *name);
--void *Hash_GetKey(hashtable_t *table, int key);
-+void *Hash_GetKey(hashtable_t *table, long key);
- void *Hash_GetNext(hashtable_t *table, char *name, void *old);
- void *Hash_GetNextInsensative(hashtable_t *table, char *name, void *old);
- void *Hash_Add(hashtable_t *table, char *name, void *data, bucket_t *buck);
- void *Hash_AddInsensative(hashtable_t *table, char *name, void *data, bucket_t *buck);
- void Hash_Remove(hashtable_t *table, char *name);
- void Hash_RemoveData(hashtable_t *table, char *name, void *data);
--void Hash_RemoveKey(hashtable_t *table, int key);
--void *Hash_AddKey(hashtable_t *table, int key, void *data, bucket_t *buck);
-+void Hash_RemoveKey(hashtable_t *table, long key);
-+void *Hash_AddKey(hashtable_t *table, long key, void *data, bucket_t *buck);
---- hash.c -+++ hash.c +--- a/hash.c ++++ b/hash.c @@ -68,7 +68,7 @@ }
return NULL;
@@ -91,3 +53,166 @@ {
buck->next = buck->next->next;
return;
+--- a/hash.h ++++ b/hash.h +@@ -19,12 +19,12 @@ + int Hash_Key(char *name, int modulus);
+ void *Hash_Get(hashtable_t *table, char *name);
+ void *Hash_GetInsensative(hashtable_t *table, char *name);
+-void *Hash_GetKey(hashtable_t *table, int key);
++void *Hash_GetKey(hashtable_t *table, long key);
+ void *Hash_GetNext(hashtable_t *table, char *name, void *old);
+ void *Hash_GetNextInsensative(hashtable_t *table, char *name, void *old);
+ void *Hash_Add(hashtable_t *table, char *name, void *data, bucket_t *buck);
+ void *Hash_AddInsensative(hashtable_t *table, char *name, void *data, bucket_t *buck);
+ void Hash_Remove(hashtable_t *table, char *name);
+ void Hash_RemoveData(hashtable_t *table, char *name, void *data);
+-void Hash_RemoveKey(hashtable_t *table, int key);
+-void *Hash_AddKey(hashtable_t *table, int key, void *data, bucket_t *buck);
++void Hash_RemoveKey(hashtable_t *table, long key);
++void *Hash_AddKey(hashtable_t *table, long key, void *data, bucket_t *buck);
+--- a/qcc.h ++++ b/qcc.h +@@ -286,7 +286,7 @@ + #endif
+
+ #ifdef WRITEASM
+-FILE *asmfile;
++extern FILE *asmfile;
+ #endif
+ //=============================================================================
+
+@@ -830,23 +830,23 @@ +
+ typedef char PATHSTRING[MAX_DATA_PATH];
+
+-PATHSTRING *precache_sounds;
+-int *precache_sounds_block;
+-int *precache_sounds_used;
+-int numsounds;
+-
+-PATHSTRING *precache_textures;
+-int *precache_textures_block;
+-int numtextures;
+-
+-PATHSTRING *precache_models;
+-int *precache_models_block;
+-int *precache_models_used;
+-int nummodels;
+-
+-PATHSTRING *precache_files;
+-int *precache_files_block;
+-int numfiles;
++extern PATHSTRING *precache_sounds;
++extern int *precache_sounds_block;
++extern int *precache_sounds_used;
++extern int numsounds;
++
++extern PATHSTRING *precache_textures;
++extern int *precache_textures_block;
++extern int numtextures;
++
++extern PATHSTRING *precache_models;
++extern int *precache_models_block;
++extern int *precache_models_used;
++extern int nummodels;
++
++extern PATHSTRING *precache_files;
++extern int *precache_files_block;
++extern int numfiles;
+
+ int QCC_CopyString (char *str);
+
+--- a/qccmain.c ++++ b/qccmain.c +@@ -2,6 +2,14 @@ +
+ #define PROGSUSED
+ #include "qcc.h"
++
++#ifdef WRITEASM
++FILE *asmfile;
++#endif
++
++int *precache_sounds_used;
++int *precache_models_used;
++
+ int mkdir(const char *path);
+
+ char QCC_copyright[1024];
+@@ -22,7 +30,7 @@ + void *FS_ReadToMem(char *fname, void *membuf, int *len);
+ void FS_CloseFromMem(void *mem);
+
+-struct qcc_includechunk_s *currentchunk;
++extern struct qcc_includechunk_s *currentchunk;
+
+ unsigned int MAX_REGS;
+
+@@ -84,8 +92,8 @@ + hashtable_t compconstantstable;
+ hashtable_t globalstable;
+ hashtable_t localstable;
+-hashtable_t floatconstdefstable;
+-hashtable_t stringconstdefstable;
++extern hashtable_t floatconstdefstable;
++extern hashtable_t stringconstdefstable;
+
+ pbool qccwarningdisabled[WARN_MAX];
+
+@@ -1627,7 +1635,7 @@ +
+ #define PROGDEFS_MAX_SIZE 16384
+ //write (to file buf) and add to the crc
+-void inline Add(char *p, unsigned short *crc, char *file)
++void Add(char *p, unsigned short *crc, char *file)
+ {
+ char *s;
+ int i = strlen(file);
+@@ -1643,7 +1651,7 @@ + #define ADD(p) Add(p, &crc, file)
+ //#define ADD(p) {char *s;int i = strlen(p);for(s=p;*s;s++,i++){QCC_CRC_ProcessByte(&crc, *s);file[i] = *s;}file[i]='\0';}
+
+-void inline Add3(char *p, unsigned short *crc, char *file)
++void Add3(char *p, unsigned short *crc, char *file)
+ {
+ char *s;
+ for(s=p;*s;s++)
+@@ -3283,7 +3291,7 @@ +
+
+ #ifdef QCCONLY
+-progfuncs_t *progfuncs;
++extern progfuncs_t *progfuncs;
+
+ /*
+ ==============
+--- a/qcc_pr_comp.c ++++ b/qcc_pr_comp.c +@@ -733,7 +733,7 @@ + ============
+ */
+ QCC_def_t *QCC_PR_Statement ( QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var_b, QCC_dstatement_t **outstatement);
+-int inline QCC_ShouldConvert(QCC_def_t *var, etype_t wanted)
++int QCC_ShouldConvert(QCC_def_t *var, etype_t wanted)
+ {
+ if (var->type->type == ev_integer && wanted == ev_function)
+ return 0;
+@@ -7322,7 +7322,7 @@ + QCC_def_t *def, *d;
+ QCC_function_t *f;
+ QCC_dfunction_t *df;
+- int i;
++ int i = 0;
+ pbool shared=false;
+ pbool externfnc=false;
+ pbool isconstant = false;
+@@ -8541,8 +8541,6 @@ + struct qcc_includechunk_s *oldcurrentchunk;
+ extern struct qcc_includechunk_s *currentchunk;
+
+- extern char qccmsourcedir[];
+-
+ ocompilingfile = compilingfile;
+ os_file = s_file;
+ os_file2 = s_file2;
diff --git a/games-util/fteqcc/fteqcc-2501.ebuild b/games-util/fteqcc/fteqcc-2501.ebuild index c03aa1ac4ee1..3791f964ea75 100644 --- a/games-util/fteqcc/fteqcc-2501.ebuild +++ b/games-util/fteqcc/fteqcc-2501.ebuild @@ -1,8 +1,9 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=5 -inherit eutils flag-o-matic +EAPI=7 + +inherit edos2unix toolchain-funcs DESCRIPTION="QC compiler" HOMEPAGE="http://fteqw.sourceforge.net/" @@ -11,28 +12,24 @@ SRC_URI="mirror://sourceforge/fteqw/qclibsrc${PV}.zip" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" RESTRICT="test" -DEPEND="app-arch/unzip" -RDEPEND="" +BDEPEND="app-arch/unzip" + +S="${WORKDIR}" -S=${WORKDIR} +PATCHES=( + "${FILESDIR}"/${P}-cleanup-source.patch + "${FILESDIR}"/${P}-Makefile.patch +) src_prepare() { - epatch "${FILESDIR}"/${P}-cleanup-source.patch - sed -i \ - -e '/^CC/d' \ - -e "s: -O3 : :g" \ - -e "s: -s : :g" \ - -e 's/-o fteqcc.bin/$(LDFLAGS) -o fteqcc.bin/' \ - Makefile || die "sed failed" + default edos2unix readme.txt - append-flags -DQCCONLY } -src_compile() { - emake BASE_CFLAGS="${CFLAGS} -Wall" +src_configure() { + tc-export CC } src_install() { |