summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorØrjan Malde <red@foxi.me>2024-03-20 10:49:24 +0100
committerØrjan Malde <red@foxi.me>2024-03-20 10:49:24 +0100
commite9ad7add1c661084a88e37a49431ef1ef5dcb8ff (patch)
tree1f8b447d6c1761e85c4569d6cc25780ac2409961
parentbbdd30b1bc87b53dce51d9dab8e80f9ca341c2d5 (diff)
downloadmidipix_build-e9ad7add1c661084a88e37a49431ef1ef5dcb8ff.tar.bz2
midipix_build-e9ad7add1c661084a88e37a49431ef1ef5dcb8ff.tar.xz
groups.d/221.native_packages_dev.group: adds p2c v2.02
Signed-off-by: Ørjan Malde <red@foxi.me>
-rw-r--r--groups.d/221.native_packages_dev.group7
-rw-r--r--patches/p2c-2.02.local.patch203
2 files changed, 209 insertions, 1 deletions
diff --git a/groups.d/221.native_packages_dev.group b/groups.d/221.native_packages_dev.group
index 2762007d..0e870e15 100644
--- a/groups.d/221.native_packages_dev.group
+++ b/groups.d/221.native_packages_dev.group
@@ -4,7 +4,7 @@
GROUP_TARGET_APPEND="native_packages";
NATIVE_PACKAGES_DEV_PACKAGES="
algol68g bison cdecl chicken cparser cssc diffutils flex gdb gengetopt gnucobol indent lua lunix m4 make mandoc nasm
-patch patchutils perl posix_cc python2 python3 ruby sbsigntools tk";
+patch patchutils perl posix_cc python2 python3 p2c ruby sbsigntools tk";
: ${PKG_ALGOL68G_SHA256SUM:=bd26e3dd89720ace1b003a43ab10247120b556ca106768fe8c829ee7bed6b435};
: ${PKG_ALGOL68G_VERSION:=3.3.24};
: ${PKG_ALGOL68G_URL:=https://jmvdveer.home.xs4all.nl/algol68g-${PKG_ALGOL68G_VERSION}.tar.gz}
@@ -170,6 +170,11 @@ make_cv_synchronous_posix_spawn=yes"};
: ${PKG_PYTHON3_SOFORT_NATIVE_CFLAGS_EXTRA:="-std=c99 -D_XOPEN_SOURCE=700"};
: ${PKG_PYTHON3_INSTALL_FILES_V2:="@python3=bin/python"};
: ${PKG_PYTHON3_SUBDIR:=Python-${PKG_PYTHON3_VERSION}};
+: ${PKG_P2C_SHA256SUM:=8c806babe964f34ebc686fdd945b1bf14f98d88020acabe434fa8764284af282};
+: ${PKG_P2C_VERSION:=2.02};
+: ${PKG_P2C_URL:=https://mirror.midipix.org/p2c/p2c-${PKG_P2C_VERSION}.tar.xz};
+: ${PKG_P2C_ENV_VARS_EXTRA:="HOST_CC=gcc"};
+: ${PKG_P2C_BUILD_DIR:=p2c-${PKG_P2C_VERSION}};
: ${PKG_RUBY_SHA256SUM:=ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507};
: ${PKG_RUBY_VERSION:=2.3.0};
: ${PKG_RUBY_URL:=https://cache.ruby-lang.org/pub/ruby/${PKG_RUBY_VERSION%.*}/ruby-${PKG_RUBY_VERSION}.tar.gz};
diff --git a/patches/p2c-2.02.local.patch b/patches/p2c-2.02.local.patch
new file mode 100644
index 00000000..207ae68a
--- /dev/null
+++ b/patches/p2c-2.02.local.patch
@@ -0,0 +1,203 @@
+diff -ru p2c-2.02.orig/Makefile p2c-2.02/Makefile
+--- p2c-2.02.orig/Makefile 1993-12-08 06:37:05.000000000 +0100
++++ p2c-2.02/Makefile 2024-03-20 10:32:36.899062261 +0100
+@@ -24,25 +24,7 @@
+ # and src/Makefile.
+
+ test:
+- @echo "Compiling p2c, installing in `pwd`/home..."
+- cd src; make install
+- @echo ""
+- @echo "Translating and compiling example files..."
+- cd examples; make comp
+- @echo ""
+- @echo "Running the factorial example..."
+- examples/fact
+- @echo ""
+- @echo "Running the 'e' computation example..."
+- examples/e
+- @echo ""
+- @echo "Running the self-printing Pascal example..."
+- examples/self >examples/self.out
+- cat examples/self.out
+- diff examples/self.p examples/self.out
+- @echo ""
+- @echo "Also try 'cref' and 'basic' in the examples directory."
+-
++ cd src; make
+
+ install:
+ cd src; make install
+diff -ru p2c-2.02.orig/src/Makefile p2c-2.02/src/Makefile
+--- p2c-2.02.orig/src/Makefile 2015-11-18 21:12:06.000000000 +0100
++++ p2c-2.02/src/Makefile 2024-03-20 10:32:36.899062261 +0100
+@@ -19,25 +19,21 @@
+ 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)
+ #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/man/man1
++MANFILE = p2c.man.inst
++DESTDIR ?=
+
+ # Compiler options
+ CC = cc # you may wish to use gcc here instead
++AR = ar
+ OPT = # -O # uncomment this for optimization
+ DEB = # -g # uncomment this for debugging
+ DEFS = -DTEST_MALLOC # place other -D types of things here # TDS 2015nov18
+@@ -74,7 +70,7 @@
+
+
+ # Top-level targets
+-all: proto p2c libp2c.a p2c.cat
++all: proto p2c libp2c.a p2c.cat proto
+ proto: $(PROTOS)
+
+
+@@ -86,7 +82,7 @@
+ $(CC) -c $(CFLAGS) $(CUSTDEFS) dir.c
+
+ trans.o: trans.c trans.h
+- $(CC) -c $(CFLAGS) -DHASDUMPS -DP2C_HOME=\"$(ABSHOMEDIR)\" trans.c
++ $(CC) -c $(CFLAGS) -DHASDUMPS -DP2C_HOME=\"/usr/lib/p2c\" trans.c
+
+
+ # Making and using makeproto
+@@ -97,12 +93,12 @@
+ ./makeproto -n -m -h -t16 -a35 -s1 -i $(SRCS) -o p2c.proto
+
+ makeproto: makeproto.c
+- $(CC) $(CFLAGS) $(LFLAGS) makeproto.c -o makeproto
++ $(HOST_CC) $(CFLAGS) $(LFLAGS) makeproto.c -o makeproto
+
+
+ # Making the p2c runtime library
+ libp2c.a: $(LIBOBJS)
+- ar r libp2c.a $(LIBOBJS) $(OTHERLIBOBJS)
++ $(AR) r libp2c.a $(LIBOBJS) $(OTHERLIBOBJS)
+
+ p2clib.o: p2clib.c
+ $(CC) -c $(CFLAGS) p2clib.c
+@@ -145,61 +141,23 @@
+ newhome:
+ rm -f trans.o # 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:
++ if [ ! -d $(DESTDIR)$(HOMEDIR) ]; then mkdir $(DESTDIR)$(HOMEDIR); else true; fi
++ if [ ! -d $(DESTDIR)$(BINDIR) ]; then mkdir $(DESTDIR)$(BINDIR); else true; fi
++ if [ ! -d $(DESTDIR)$(LIBDIR) ]; then mkdir $(DESTDIR)$(LIBDIR); else true; fi
++ if [ ! -d $(DESTDIR)$(MANDIR) ]; then mkdir $(DESTDIR)$(MANDIR); else true; fi
++ if [ ! -d $(DESTDIR)$(INCDIR) ]; then mkdir $(DESTDIR)$(INCDIR); else true; fi
++ $(COPY) p2c $(DESTDIR)$(BINDIR)/p2c
++ $(COPY) libp2c.a $(DESTDIR)$(LIBDIR)/libp2c.a
++ $(AR) -s $(DESTDIR)$(LIBDIR)/libp2c.a
++ $(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
+
+
+
+diff -ru p2c-2.02.orig/src/stuff.c p2c-2.02/src/stuff.c
+--- p2c-2.02.orig/src/stuff.c 1993-12-08 06:36:48.000000000 +0100
++++ p2c-2.02/src/stuff.c 2024-03-20 10:43:13.059760161 +0100
+@@ -316,7 +316,7 @@
+ cp = my_strrchr(fn, '.');
+ if (!cp)
+ return;
+-#if defined(unix) || defined(__unix)
++#if defined(unix) || defined(__unix) || defined(__midipix__)
+ cp2 = my_strrchr(fn, '/');
+ if (cp2 && cp < cp2)
+ return;
+diff -ru p2c-2.02.orig/src/trans.c p2c-2.02/src/trans.c
+--- p2c-2.02.orig/src/trans.c 2015-10-02 19:52:53.000000000 +0200
++++ p2c-2.02/src/trans.c 2024-03-20 10:45:31.173956389 +0100
+@@ -558,7 +558,7 @@
+ void saveoldfile(fname)
+ char *fname;
+ {
+-#if defined(unix) || defined(__unix) || defined(CAN_LINK)
++#if defined(unix) || defined(__unix) || defined(CAN_LINK) || defined(__midipix__)
+ (void) unlink(format_s("%s~", fname));
+ if (link(fname, format_s("%s~", fname)) == 0)
+ (void) unlink(fname);