diff options
author | Chris Severance | 2022-12-26 01:50:58 -0500 |
---|---|---|
committer | Chris Severance | 2022-12-26 01:50:58 -0500 |
commit | 23ee931747e1847ffa5d4c6364e2fb529c294cde (patch) | |
tree | 43da9f8bf5f1d8dc74b111ebbc5cffe453cb2749 | |
parent | c34e4cb5fb1ac527fc99cdf12b56585fd86e93f7 (diff) | |
download | aur-23ee931747e1847ffa5d4c6364e2fb529c294cde.tar.gz |
autu: Update to 2.02-1
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | 0000-make-install-again.patch | 164 | ||||
-rw-r--r-- | 0001-trans.c-unistd.h-link-unlink.patch | 33 | ||||
-rw-r--r-- | 0002-makefile-32bit-compile.patch | 16 | ||||
-rw-r--r-- | 0003-sys.p2crc-MainType-int.patch | 16 | ||||
-rw-r--r-- | 0004-_OutMem-64-bit-compile.patch | 33 | ||||
-rw-r--r-- | 1000-examples-Makefile-change-binaries.patch | 20 | ||||
-rw-r--r-- | PKGBUILD | 155 |
8 files changed, 392 insertions, 76 deletions
@@ -1,21 +1,34 @@ -# Generated by mksrcinfo v8 -# Wed Feb 6 20:16:36 UTC 2019 pkgbase = p2c pkgdesc = Pascal to C/C++ translator converter - pkgver = 2.01 + pkgver = 2.02 pkgrel = 1 url = http://users.fred.net/tds/lab/p2c/ arch = x86_64 license = GPL depends = perl - source = https://alum.mit.edu/www/toms/p2c/p2c-2.01.tar.gz + source = http://users.fred.net/tds/lab/p2c/p2c-2.02.zip source = 0000-make-install.patch - md5sums = 6f08c45f1adcdc35789340834dd9c084 + source = 0000-make-install-again.patch + source = 0001-trans.c-unistd.h-link-unlink.patch + source = 0002-makefile-32bit-compile.patch + source = 0003-sys.p2crc-MainType-int.patch + source = 1000-examples-Makefile-change-binaries.patch + source = 0004-_OutMem-64-bit-compile.patch + md5sums = b379caf316c357ab5c0bc4934aa6ae25 md5sums = 3cf28ada6f5935e5ce7eb6515fd429ef - sha256sums = a05635e6b0b40bee9617771ba628deefae13369cd7d49bb880cc8590495fcf60 + md5sums = c52f03457709e7e968debd3b9c93a7a6 + md5sums = bd21f009fbbf835ac2803efd44bb280f + md5sums = e460eaf157a46f8411eec730e05aea24 + md5sums = 0cccd2e48b606e9299a3938103a373b6 + md5sums = 488836c68b8abd8bd1f6ca91d1ced545 + md5sums = 85a7f53c671145bb9bc85fbbe80f53d2 + sha256sums = baa322b12e477af38c767be0406b5e7ca2fa4c26ae2f80f4bc2889bf36d0069f sha256sums = a1dd6995cb13e87bbf6f707224c1a58fbebe9101aeccd7ba3aca0e760950773a - depends_x86_64 = lib32-glibc - makedepends_x86_64 = lib32-gcc-libs + sha256sums = 174664a05674b4cc86d995d520c9d67caf6fe5b81c920666deb4b7b30571f8c1 + sha256sums = cceb0a5fbb104741c75cca10ed9a7389d14ae428f3dc957a2b442cf6d45f4685 + sha256sums = 5b70fbfbc0a6c922bc3c2e1e339fcbe727cfccec037e04bc792c5cd72289f884 + sha256sums = ecdc91610006f5ae75a1fa4cf9cbfe4a492a99704034d33fd72a71bb8378adc5 + sha256sums = 1e06200380e6350b083c94d6b90a24a41fad8b6f0f8b9d2d9c3d8131ea50a49f + sha256sums = 1ae3ce087e662ffd8807139343f6835ca916beb88e819f459c4994de980d3883 pkgname = p2c - diff --git a/0000-make-install-again.patch b/0000-make-install-again.patch new file mode 100644 index 000000000000..7211610eaf4e --- /dev/null +++ b/0000-make-install-again.patch @@ -0,0 +1,164 @@ +diff -pNaru5 a/src/Makefile b/src/Makefile +--- a/src/Makefile 2015-11-18 15:12:06.000000000 -0500 ++++ b/src/Makefile 2022-12-26 01:26:47.885095920 -0500 +@@ -17,34 +17,34 @@ + # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + SHELL = /bin/sh + + # Directories (private version) +-HOMEDIR = ../home +-INCDIR = ../home/p2c +-BINDIR = .. +-LIBDIR = ../home +-MANDIR = ../home +-MANFILE = p2c.cat # human-readable manual (for cat.1) ++#HOMEDIR = ../home ++#INCDIR = ../home/p2c ++#BINDIR = .. ++#LIBDIR = ../home ++#MANDIR = ../home ++#MANFILE = p2c.cat # human-readable manual (for cat.1) + #MANFILE = p2c.man.inst # uncompressed nroff source (for man.1) + #MANFILE = p2c.man.Z # compressed nroff source (for man.1.Z) + + # Directories (public version) +-#HOMEDIR = /usr/lib/p2c +-#INCDIR = /usr/include/p2c +-#BINDIR = /usr/bin +-#LIBDIR = /usr/lib +-#MANDIR = /usr/man/man1 +-#MANFILE = p2c.man.inst ++HOMEDIR = /usr/lib/p2c ++INCDIR = /usr/include/p2c ++BINDIR = /usr/bin ++LIBDIR = /usr/lib ++MANDIR = /usr/share/man/man1 ++MANFILE = p2c.man.inst + + # Compiler options + CC = cc # you may wish to use gcc here instead + OPT = # -O # uncomment this for optimization + DEB = # -g # uncomment this for debugging + DEFS = -DTEST_MALLOC # place other -D types of things here # TDS 2015nov18 + CFLAGS = $(OPT) $(DEB) $(DEFS) +-LFLAGS = ++LFLAGS = $(LDFLAGS) + + + # Custom translator modules + CUSTSRCS = hpmods.c citmods.c + CUSTOBJS = hpmods.o citmods.o +@@ -62,21 +62,22 @@ OBJS = $(P2COBJS) $(CUSTOBJS) + + LIBSRCS = p2clib.c loc.p2clib.c + LIBOBJS = p2clib.o loc.p2clib.o + OTHERLIBOBJS = + +-ABSHOMEDIR = `cd $(HOMEDIR); pwd` +-ABSINCDIR = `cd $(INCDIR); pwd` +-ABSLIBDIR = `cd $(LIBDIR); pwd` ++ABSHOMEDIR = $(HOMEDIR) ++ABSINCDIR = $(INCDIR) ++ABSLIBDIR = $(LIBDIR) + + MISCSRCS = makeproto.c + PROTOS = p2c.proto p2c.hdrs + HDRS = trans.h p2c.h + + + # Top-level targets +-all: proto p2c libp2c.a p2c.cat ++all: proto p2c libp2c.a p2c.cat p2cc ++$(OBJS): proto + proto: $(PROTOS) + + + # Making p2c + p2c: $(OBJS) +@@ -138,70 +139,28 @@ p2cc: p2cc.perl + # First, make sure $(HOMEDIR) and $(INCDIR) exist and are writable; + # Second, make sure $(LIBDIR), $(BINDIR) and $(MANDIR) are writable; + # Third, execute "make install" to compile and set things up. + # (You may need to have a system operator do these steps for you.) + +-COPY = cp ++COPY = install -Dp + + newhome: +- rm -f trans.o # force trans.c to be recompiled (if HOMEDIR changes) ++ rm -f trans.o p2cc # force trans.c to be recompiled (if HOMEDIR changes) + +-install: proto \ +- makedirs \ +- $(BINDIR)/p2c \ +- $(BINDIR)/p2cc \ +- $(LIBDIR)/libp2c.a \ +- $(MANDIR)/p2c.1 \ +- $(INCDIR)/p2c.h \ +- $(HOMEDIR)/p2crc \ +- $(HOMEDIR)/loc.p2crc \ +- $(HOMEDIR)/system.imp \ +- $(HOMEDIR)/system.m2 \ +- $(HOMEDIR)/turbo.imp \ +- $(HOMEDIR)/string.pas +- +-SHELL=/bin/sh +-makedirs: +- if [ ! -d $(HOMEDIR) ]; then mkdir $(HOMEDIR); else true; fi +- if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); else true; fi +- if [ ! -d $(LIBDIR) ]; then mkdir $(LIBDIR); else true; fi +- if [ ! -d $(MANDIR) ]; then mkdir $(MANDIR); else true; fi +- if [ ! -d $(INCDIR) ]; then mkdir $(INCDIR); else true; fi +- +-$(BINDIR)/p2c: p2c +- $(COPY) p2c $(BINDIR)/p2c +- +-$(BINDIR)/p2cc: p2cc +- $(COPY) p2cc $(BINDIR)/p2cc +- +-$(LIBDIR)/libp2c.a: libp2c.a +- $(COPY) libp2c.a $(LIBDIR)/libp2c.a +- if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; then ranlib $(LIBDIR)/libp2c.a; fi +- +-$(MANDIR)/p2c.1: $(MANFILE) +- $(COPY) $(MANFILE) $(MANDIR)/p2c.1 +- +-$(INCDIR)/p2c.h: p2c.h +- $(COPY) p2c.h $(INCDIR)/p2c.h +- +-$(HOMEDIR)/p2crc: sys.p2crc +- $(COPY) sys.p2crc $(HOMEDIR)/p2crc +- +-$(HOMEDIR)/loc.p2crc: loc.p2crc +- $(COPY) loc.p2crc $(HOMEDIR)/loc.p2crc +- +-$(HOMEDIR)/system.imp: system.imp +- $(COPY) system.imp $(HOMEDIR)/system.imp +- +-$(HOMEDIR)/system.m2: system.m2 +- $(COPY) system.m2 $(HOMEDIR)/system.m2 +- +-$(HOMEDIR)/turbo.imp: turbo.imp +- $(COPY) turbo.imp $(HOMEDIR)/turbo.imp +- +-$(HOMEDIR)/string.pas: string.pas +- $(COPY) string.pas $(HOMEDIR)/string.pas ++install: ++ $(COPY) p2c $(DESTDIR)$(BINDIR)/p2c ++ $(COPY) p2cc $(DESTDIR)$(BINDIR)/p2cc ++ $(COPY) libp2c.a $(DESTDIR)$(LIBDIR)/libp2c.a ++ if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; then ranlib $(DESTDIR)$(LIBDIR)/libp2c.a; fi ++ $(COPY) $(MANFILE) $(DESTDIR)$(MANDIR)/p2c.1 ++ $(COPY) p2c.h $(DESTDIR)$(INCDIR)/p2c.h ++ $(COPY) sys.p2crc $(DESTDIR)$(HOMEDIR)/p2crc ++ $(COPY) loc.p2crc $(DESTDIR)$(HOMEDIR)/loc.p2crc ++ $(COPY) system.imp $(DESTDIR)$(HOMEDIR)/system.imp ++ $(COPY) system.m2 $(DESTDIR)$(HOMEDIR)/system.m2 ++ $(COPY) turbo.imp $(DESTDIR)$(HOMEDIR)/turbo.imp ++ $(COPY) string.pas $(DESTDIR)$(HOMEDIR)/string.pas + + + + # Miscellaneous + tags: diff --git a/0001-trans.c-unistd.h-link-unlink.patch b/0001-trans.c-unistd.h-link-unlink.patch new file mode 100644 index 000000000000..de27f8fd1597 --- /dev/null +++ b/0001-trans.c-unistd.h-link-unlink.patch @@ -0,0 +1,33 @@ +diff -pNaru5 a/src/trans.c b/src/trans.c +--- a/src/trans.c 2015-10-02 13:52:53.000000000 -0400 ++++ b/src/trans.c 2022-12-25 21:43:08.603410698 -0500 +@@ -18,10 +18,11 @@ the Free Software Foundation, Inc., 675 + + + + #define define_globals + #define PROTO_TRANS_C ++#include <unistd.h> + #include "trans.h" + + #include <time.h> + + +diff -pNaru5 a/src/trans.h b/src/trans.h +--- a/src/trans.h 2015-10-05 19:04:46.000000000 -0400 ++++ b/src/trans.h 2022-12-25 21:52:49.184033191 -0500 +@@ -1861,12 +1861,14 @@ extern Expr *new_array_size; + + + + /* Our library omits declarations for these functions! */ + ++/* + int link PP( (char *, char *) ); + int unlink PP( (char *) ); ++*/ + + + + #define minspcthresh ((minspacingthresh >= 0) ? minspacingthresh : minspacing) + diff --git a/0002-makefile-32bit-compile.patch b/0002-makefile-32bit-compile.patch new file mode 100644 index 000000000000..2f4c78130bbe --- /dev/null +++ b/0002-makefile-32bit-compile.patch @@ -0,0 +1,16 @@ +diff -pNaru5 a/src/Makefile b/src/Makefile +--- a/src/Makefile 2022-12-25 22:17:35.764513705 -0500 ++++ b/src/Makefile 2022-12-25 22:18:08.694755252 -0500 +@@ -35,11 +35,11 @@ BINDIR = /usr/bin + LIBDIR = /usr/lib + MANDIR = /usr/share/man/man1 + MANFILE = p2c.man.inst + + # Compiler options +-CC = cc # you may wish to use gcc here instead ++CC = cc -m32 # you may wish to use gcc here instead + OPT = # -O # uncomment this for optimization + DEB = # -g # uncomment this for debugging + DEFS = -DTEST_MALLOC # place other -D types of things here # TDS 2015nov18 + CFLAGS = $(OPT) $(DEB) $(DEFS) + LFLAGS = diff --git a/0003-sys.p2crc-MainType-int.patch b/0003-sys.p2crc-MainType-int.patch new file mode 100644 index 000000000000..9956682fa034 --- /dev/null +++ b/0003-sys.p2crc-MainType-int.patch @@ -0,0 +1,16 @@ +diff -pNaru5 a/src/sys.p2crc b/src/sys.p2crc +--- a/src/sys.p2crc 1993-12-08 00:36:47.000000000 -0500 ++++ b/src/sys.p2crc 2022-12-25 22:24:10.007285626 -0500 +@@ -221,11 +221,11 @@ UseAnyptrMacros # 1=use + UsePPMacros # 1=use PP and PV macros for prototypes + # 0=do not use these macros for prototypes + # 2=use them only for external/forward + # default=0 if AnsiC=1, else 2 + +-MainType # Type name to put in front of "main"; ++MainType int # Type name to put in front of "main"; + # generally either "int" or "void". Blank + # works on most systems. + + ReplaceAfter # Textual replacements on output text lines; + ReplaceAfter # see ReplaceBefore for details. diff --git a/0004-_OutMem-64-bit-compile.patch b/0004-_OutMem-64-bit-compile.patch new file mode 100644 index 000000000000..3299c29dc6bc --- /dev/null +++ b/0004-_OutMem-64-bit-compile.patch @@ -0,0 +1,33 @@ +diff -pNaru5 a/src/p2c.h b/src/p2c.h +--- a/src/p2c.h 1993-12-08 00:36:54.000000000 -0500 ++++ b/src/p2c.h 2022-12-25 23:54:13.122754732 -0500 +@@ -309,11 +309,12 @@ extern long strtol PP( (Const C + extern Anyptr malloc PP( (size_t) ); + extern Void free PP( (Anyptr) ); + #endif + #endif + +-extern int _OutMem PV(); ++#include <stdint.h> ++extern intptr_t _OutMem PV(); + extern int _CaseCheck PV(); + extern int _NilCheck PV(); + extern int _Escape PP( (int) ); + extern int _EscIO PP( (int) ); + extern int _EscIO2 PP( (int, Char *) ); +diff -pNaru5 a/src/p2clib.c b/src/p2clib.c +--- a/src/p2clib.c 1993-12-08 00:36:53.000000000 -0500 ++++ b/src/p2clib.c 2022-12-25 23:54:47.053106957 -0500 +@@ -959,11 +959,11 @@ register int len, n; + } + + + + +-int _OutMem() ++intptr_t _OutMem() + { + return _Escape(-2); + } + + int _CaseCheck() diff --git a/1000-examples-Makefile-change-binaries.patch b/1000-examples-Makefile-change-binaries.patch new file mode 100644 index 000000000000..66c179b5e4a2 --- /dev/null +++ b/1000-examples-Makefile-change-binaries.patch @@ -0,0 +1,20 @@ +diff -pNaru5 a/examples/Makefile b/examples/Makefile +--- a/examples/Makefile 1993-12-08 00:36:58.000000000 -0500 ++++ b/examples/Makefile 2022-12-25 22:38:06.486309104 -0500 +@@ -2,13 +2,13 @@ + # Examples for "p2c", the Pascal to C translator. + + + # The following definitions assume p2c has been compiled into the "home" + # directory as shown in src/Makefile. +-P2C = ../p2c +-INC = ../home +-LIB = ../home/libp2c.a ++P2C = ../check/usr/bin/p2c ++INC = ../check/usr/include ++LIB = ../check/usr/lib/libp2c.a + + + default: comp + + @@ -2,12 +2,11 @@ # Contributor: tardo <tardo@nagi-fanboi.net> # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> -# Todo: fix (Anyptr)_OutMem() to be 64 bit safe and enable 64 bit compile -_opt_32bit=1 +_opt_32bit=0 set -u pkgname='p2c' -pkgver='2.01' +pkgver='2.02' pkgrel='1' pkgdesc='Pascal to C/C++ translator converter' arch=('x86_64') @@ -25,101 +24,122 @@ fi #source=('https://alum.mit.edu/www/toms/p2c/p2c-2.01.tar.gz _srcdir="${pkgname}-${pkgver}" #source=("https://schneider.ncifcrf.gov/p2c/${_srcdir}.tar.gz") -source=("https://alum.mit.edu/www/toms/p2c/${_srcdir}.tar.gz") -source+=('0000-make-install.patch') +#source=("https://alum.mit.edu/www/toms/p2c/${_srcdir}.tar.gz") +source=("http://users.fred.net/tds/lab/p2c/${_srcdir}.zip") +_srcdir="${_srcdir/./-ZIPPERDOT-}" +source+=( + '0000-make-install.patch' + '0000-make-install-again.patch' + '0001-trans.c-unistd.h-link-unlink.patch' + '0002-makefile-32bit-compile.patch' + '0003-sys.p2crc-MainType-int.patch' + '1000-examples-Makefile-change-binaries.patch' + '0004-_OutMem-64-bit-compile.patch' +) #options=('!strip') -md5sums=('6f08c45f1adcdc35789340834dd9c084' - '3cf28ada6f5935e5ce7eb6515fd429ef') -sha256sums=('a05635e6b0b40bee9617771ba628deefae13369cd7d49bb880cc8590495fcf60' - 'a1dd6995cb13e87bbf6f707224c1a58fbebe9101aeccd7ba3aca0e760950773a') +md5sums=('b379caf316c357ab5c0bc4934aa6ae25' + '3cf28ada6f5935e5ce7eb6515fd429ef' + 'c52f03457709e7e968debd3b9c93a7a6' + 'bd21f009fbbf835ac2803efd44bb280f' + 'e460eaf157a46f8411eec730e05aea24' + '0cccd2e48b606e9299a3938103a373b6' + '488836c68b8abd8bd1f6ca91d1ced545' + '85a7f53c671145bb9bc85fbbe80f53d2') +sha256sums=('baa322b12e477af38c767be0406b5e7ca2fa4c26ae2f80f4bc2889bf36d0069f' + 'a1dd6995cb13e87bbf6f707224c1a58fbebe9101aeccd7ba3aca0e760950773a' + '174664a05674b4cc86d995d520c9d67caf6fe5b81c920666deb4b7b30571f8c1' + 'cceb0a5fbb104741c75cca10ed9a7389d14ae428f3dc957a2b442cf6d45f4685' + '5b70fbfbc0a6c922bc3c2e1e339fcbe727cfccec037e04bc792c5cd72289f884' + 'ecdc91610006f5ae75a1fa4cf9cbfe4a492a99704034d33fd72a71bb8378adc5' + '1e06200380e6350b083c94d6b90a24a41fad8b6f0f8b9d2d9c3d8131ea50a49f' + '1ae3ce087e662ffd8807139343f6835ca916beb88e819f459c4994de980d3883') _checkdir="${_srcdir}/check" prepare() { set -u - cd "${_srcdir}/src" + cd "${_srcdir}" + + # Fix the permissions + find -type 'd' -exec chmod 755 '{}' '+' + find -type 'f' -exec chmod 644 '{}' '+' + + # Remove supplied binaries + make -C 'src' clean # this deletes p2c.hdrs which we need + rm -f 'src/makeproto' 'src/p2cc' 'src/libp2c.a' #patch -Np2 -i '../p2c_${pkgver}-3.diff' #sed -e 's:getline:xgetline:' -i *.c *.hdrs - # Add includes to get rid of some warnings - sed -e '/^#include <stdio.h>/ a #include <stdlib.h>' -i 'makeproto.c' - # expose conflicting declarations - sed -e '/^#include "trans.h"/ i #include <unistd.h>' -i 'trans.c' - # Switch to built in link,unlink declarations - sed -e '/^int u*n*link / s:^.*$:/* & */:g' -i 'trans.h' + if [ "$(vercmp "${pkgver}" "2.01")" -le 0 ]; then + # Add includes to get rid of some warnings + sed -e '/^#include <stdio.h>/ a #include <stdlib.h>' -i 'src/makeproto.c' + fi - # Remove supplied binaries - rm -f 'makeproto' 'p2cc' 'libp2c.a' + # Switch to built in link,unlink declarations + # cd "${srcdir}"; cp -pr "${_srcdir}" a/; ln -s "${_srcdir}" b; false + # diff -pNaru5 a b > '0001-trans.c-unistd.h-link-unlink.patch' + patch -Nup1 -i '../0001-trans.c-unistd.h-link-unlink.patch' # The mess in make install is too big to fix with sed # cp -p Makefile{,.orig}; false # diff -pNau5 Makefile{.orig,} > '0000-make-install.patch' - patch -Nbup0 -i "${srcdir}/0000-make-install.patch" + #patch -d 'src' -Nup0 -i "${srcdir}/0000-make-install.patch" + + # Make package compatible + # Fix high thread count make + # Set LDFLAGS + #cd "${srcdir}"; cp -pr "${_srcdir}" a/; ln -s "${_srcdir}" b; false + # diff -pNaru5 a b > '0000-make-install-again.patch' + patch -Nup1 -i '../0000-make-install-again.patch' - local _ccc='#' if [ "${_opt_32bit}" -ne 0 ]; then - _ccc='' + #cd "${srcdir}"; cp -pr "${_srcdir}" a/; ln -s "${_srcdir}" b; false + # diff -pNaru5 a b > '0002-makefile-32bit-compile.patch' + patch -Nup1 -i '../0002-makefile-32bit-compile.patch' fi - # Make package compatible - #cp -p Makefile{,.Arch} - sed -e '#Switch from private to public build' \ - -e '/private version/,/^$/ s:^[A-Z]:#&:g' \ - -e '/public version/,/^$/ s:^#\([A-Z]\):\1:g' \ - -e '# Fix MANDIR' \ - -e '/^MANDIR =/ s:/usr/:&share/:g' \ - -e '#Add DESTDIR' \ - -e '/^install:/,/^$/ s:\$([A-Z]\+DIR):$(DESTDIR)&:g' \ - -e '# Make $(COPY) create the folders' \ - -e 's:^COPY = .*$:COPY = install -Dp:g' \ - -e '# No need to resolve .. on these dirs' \ - -e 's:^ABS\([A-Z]*DIR\) = .*$:ABS\1 = $(\1):g' \ - -e '# The messy install covered for a missed target' \ - -e '/^all:/ s:$: p2cc:g' \ - -e '#newhome forgot the target too' \ - -e '/^newhome:/,/^$/ s:trans.o:& p2cc:g' \ - -e '# 32 bit compile' \ - -e "${_ccc}"'s:^CC = cc:& -m32:g' \ - -i 'Makefile' - test ! -s 'Makefile.Arch' # Get rid of a generated code warning - sed -e 's:^MainType\s:&int:g' -i 'sys.p2crc' + #cd "${srcdir}"; cp -pr "${_srcdir}" a/; ln -s "${_srcdir}" b; false + # diff -pNaru5 a b > '0003-sys.p2crc-MainType-int.patch' + patch -Nup1 -i '../0003-sys.p2crc-MainType-int.patch' - cd '..' - # Fix the permissions - find -type 'd' -exec chmod 755 '{}' '+' - find -type 'f' -exec chmod 644 '{}' '+' + # Fix warning in 64 bit generated code + #cd "${srcdir}"; cp -pr "${_srcdir}" a/; ln -s "${_srcdir}" b; false + # diff -pNaru5 a b > '0004-_OutMem-64-bit-compile.patch' + patch -Nup1 -i '../0004-_OutMem-64-bit-compile.patch' # get rid of home for make test examples check() rm -r "../${_srcdir}/home/" # make clean for examples - cd 'examples' - rm 'basic' 'cref' 'e' 'fact' 'self' *.c - rm -r '../examples/c/' + rm 'examples/basic' 'examples/cref' 'examples/e' 'examples/fact' 'examples/self' examples/*.c + rm -r 'examples/c/' # point examples check to the just compiled test version - sed -e 's:^P2C = .*$:P2C = ../check/usr/bin/p2c:g' \ - -e '# Fix INC to use our include dir' \ - -e 's:^INC = .*$:INC = ../check/usr/include:g' \ - -e '# Move to src folder' \ - -e 's:^LIB = .*$:LIB = ../check/usr/lib/libp2c.a:g' \ - -e '# 32 bit compile' \ - -e "${_ccc}"'s:\$(CC) :&-m32 :g' \ - -i 'Makefile' + # cd "${srcdir}"; cp -pr "${_srcdir}" a/; ln -s "${_srcdir}" b; false + # diff -pNaru5 a b > '1000-examples-Makefile-change-binaries.patch' + patch -Nup1 -i '../1000-examples-Makefile-change-binaries.patch' - set +u + if [ "${_opt_32bit}" -ne 0 ]; then + sed -e '# 32 bit compile' \ + -e 's:\$(CC) :&-m32 :g' \ + -i 'examples/Makefile' + fi + sed -e '# Reduce standard for gets' \ + -e 's:\$(CC) :&-ansi -Wno-deprecated-declarations :g' \ + -i 'examples/Makefile' + set +u } build() { set -u - cd "${_srcdir}/src" - # make check() executable - make OPT='-O2 -s' ABSHOMEDIR="${srcdir}/${_checkdir}/usr/lib/p2c" - mv p2c{,_test} - # make package() executable - make newhome - make OPT='-O2 -s' + cd "${_srcdir}" + set +u; msg2 'make check() executable'; set -u + make -C 'src' OPT='-O2 -s' ABSHOMEDIR="${srcdir}/${_checkdir}/usr/lib/p2c" + mv src/p2c{,_test} + make -C 'src' newhome + set +u; msg2 'make package() executable'; set -u + make -C 'src' OPT='-O2 -s' set +u } @@ -136,7 +156,8 @@ check() { package() { set -u cd "${_srcdir}" - make -C 'src' install DESTDIR="${pkgdir}" + make -j1 -C 'src' install DESTDIR="${pkgdir}" + chmod 644 "${pkgdir}/usr/lib"/*.a set +u } set +u |