aboutsummaryrefslogtreecommitdiff
path: root/lang/seed7
diff options
context:
space:
mode:
authorPietro Cerutti <gahr@FreeBSD.org>2013-01-21 17:04:13 +0000
committerPietro Cerutti <gahr@FreeBSD.org>2013-01-21 17:04:13 +0000
commit45138b435ff7e8392045b73062cc50f00e93ff0a (patch)
tree6dcaa4d93f41556805c096ccbe6cfce5dba0f9e4 /lang/seed7
parent34080dff1403e275216783b77b61aa7c42f34dc8 (diff)
downloadports-45138b435ff7e8392045b73062cc50f00e93ff0a.tar.gz
ports-45138b435ff7e8392045b73062cc50f00e93ff0a.zip
Notes
Diffstat (limited to 'lang/seed7')
-rw-r--r--lang/seed7/Makefile25
-rw-r--r--lang/seed7/distinfo4
-rw-r--r--lang/seed7/files/patch-mk_clang.mak29
-rw-r--r--lang/seed7/files/patch-prg_chk_all.sd792
4 files changed, 137 insertions, 13 deletions
diff --git a/lang/seed7/Makefile b/lang/seed7/Makefile
index 57e686fe3340..92f0c78bd04f 100644
--- a/lang/seed7/Makefile
+++ b/lang/seed7/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= seed7
-DISTVERSION= 05_20130105
+DISTVERSION= 05_20130120
CATEGORIES= lang
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${DISTNAME}/
DISTNAME= ${PORTNAME}_${DISTVERSION}
@@ -24,7 +24,7 @@ MAKE_ENV+= S7_LIB_DIR=${S7_LIB_DIR} \
SEED7_LIBRARY=${SEED7_LIBRARY} \
C_COMPILER=${CC} \
CPLUSPLUS_COMPILER=${CPP}
-ALL_TARGET= depend s7
+ALL_TARGET= depend s7 s7c
SEED7_LIBRARY= ${PREFIX}/lib/${PORTNAME}/lib
S7_LIB_DIR= ${PREFIX}/lib/${PORTNAME}/bin
@@ -41,14 +41,21 @@ PORTDOCS= *
BROKEN= does not compile
.endif
+.if ${OSVERSION} >= 1000024 || ${CC} == clang
+MAKEFILE= mk_clang.mak
+.else
+MAKEFILE= makefile
+.endif
+
post-patch:
- ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g;' ${WRKSRC}/makefile
+ ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g;' ${WRKSRC}/makefile ${WRKSRC}/mk_clang.mak
${REINPLACE_CMD} -e '/FLOATTYPE_DOUBLE/s|undef|define|' ${WRKSRC}/config.h
- ${REINPLACE_CMD} -i '' -e 's|./s7|${PREFIX}/bin/s7|g' ${WRKSRC}/../prg/chk_all.sd7
+# ${REINPLACE_CMD} -i '' -e 's|./s7|${PREFIX}/bin/s7|g' ${WRKSRC}/../prg/chk_all.sd7
do-install:
-# install interpreter
+# install interpreter and compiler
${INSTALL_PROGRAM} ${WRKSRC}/../bin/s7 ${PREFIX}/bin
+ ${INSTALL_PROGRAM} ${WRKSRC}/../prg/s7c ${PREFIX}/bin
# install seed7 library
${INSTALL} -d ${SEED7_LIBRARY}
cd ${WRKSRC}/../lib && ${COPYTREE_SHARE} '*.s7i' ${SEED7_LIBRARY}
@@ -57,10 +64,6 @@ do-install:
.for s7_lib in ${S7_LIBS}
${INSTALL_DATA} ${WRKSRC}/../bin/${s7_lib} ${S7_LIB_DIR}
.endfor
-# compile the seed7 compiler (needs the libraries to be installed)
- cd ${WRKSRC} && ${GMAKE} s7c
- ${INSTALL_PROGRAM} ${WRKSRC}/../prg/s7c ${PREFIX}/bin/s7c
- ${RM} ${WRKSRC}/../prg/tmp_s7c.c ${WRKSRC}/../prg/s7c
# install PORTDOCS
.if ${PORT_OPTIONS:MDOCS}
${INSTALL} -d ${DOCSDIR}
@@ -72,9 +75,9 @@ do-install:
cd ${WRKSRC}/../prg && ${COPYTREE_SHARE} '*.dna *.sd7 *.dat *.s7i' ${EXAMPLESDIR}
.endif
-regression-test: ${INSTALL_TARGET}
+regression-test: build
@echo ""
@echo "Testing the ${PORTNAME} installation"
- @(cd ${WRKSRC}/../prg && ${PREFIX}/bin/s7 chk_all)
+ @(cd ${WRKSRC}/../prg && ${WRKSRC}/../bin/s7 -l ${WRKSRC}/../lib chk_all build)
.include <bsd.port.post.mk>
diff --git a/lang/seed7/distinfo b/lang/seed7/distinfo
index 684952da5539..6190ad20b14d 100644
--- a/lang/seed7/distinfo
+++ b/lang/seed7/distinfo
@@ -1,2 +1,2 @@
-SHA256 (seed7_05_20130105.tgz) = 72c166e1854acc4b424b512a44793c8f7ad392e710274a44aacbd2dcc9f5f28b
-SIZE (seed7_05_20130105.tgz) = 1806154
+SHA256 (seed7_05_20130120.tgz) = ddf142b0f79e0ff2cd6d25472bf39f2389bf42f01686d2e6d25c9f6f267c8142
+SIZE (seed7_05_20130120.tgz) = 1821907
diff --git a/lang/seed7/files/patch-mk_clang.mak b/lang/seed7/files/patch-mk_clang.mak
new file mode 100644
index 000000000000..f5ac65ff5aee
--- /dev/null
+++ b/lang/seed7/files/patch-mk_clang.mak
@@ -0,0 +1,29 @@
+--- mk_clang.mak.orig 2013-01-21 11:50:32.000000000 +0100
++++ mk_clang.mak 2013-01-21 11:52:56.000000000 +0100
+@@ -10,7 +10,7 @@
+ # CFLAGS = -O2 -g -Wall -Wextra -Wswitch-default -Wswitch-enum -Wcast-qual -Waggregate-return -Wwrite-strings -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar -Wc++-compat
+ # CFLAGS = -O2 -g -x c++ -Wall -Wextra -Wswitch-default -Wswitch-enum -Wcast-qual -Waggregate-return -Wwrite-strings -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar
+ # CFLAGS = -O2 -fomit-frame-pointer -Wall -Wextra -Wswitch-default -Wcast-qual -Waggregate-return -Wwrite-strings -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar
+-CFLAGS = -O2 -g -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv
++CFLAGS += -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv -I%%LOCALBASE%%/include
+ # CFLAGS = -O2 -g -x c++ -Wall -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv
+ # CFLAGS = -O2 -g -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
+ # CFLAGS = -O2 -g -Wall -Winline -Wconversion -Wshadow -Wpointer-arith
+@@ -18,7 +18,7 @@
+ # CFLAGS = -O2 -g -pg -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith
+ # CFLAGS = -O2 -fomit-frame-pointer -funroll-loops -Wall
+ # CFLAGS = -O2 -funroll-loops -Wall -pg
+-LDFLAGS =
++LDFLAGS = -L%%LOCALBASE%%/lib
+ # LDFLAGS = -pg
+ # LDFLAGS = -pg -lc_p
+ SYSTEM_LIBS = -lm
+@@ -37,7 +37,7 @@
+ COMPILER_LIB = s7_comp.a
+ ALL_S7_LIBS = ../bin/$(COMPILER_LIB) ../bin/$(COMP_DATA_LIB) ../bin/$(DRAW_LIB) ../bin/$(CONSOLE_LIB) ../bin/$(SEED7_LIB)
+ # CC = g++
+-CC = clang
++CC ?= clang
+ GET_CC_VERSION_INFO = $(CC) --version >
+
+ BIGINT_LIB_DEFINE = USE_BIG_RTL_LIBRARY
diff --git a/lang/seed7/files/patch-prg_chk_all.sd7 b/lang/seed7/files/patch-prg_chk_all.sd7
new file mode 100644
index 000000000000..1686e441a676
--- /dev/null
+++ b/lang/seed7/files/patch-prg_chk_all.sd7
@@ -0,0 +1,92 @@
+--- ../prg/chk_all.sd7.orig 2013-01-21 17:05:47.000000000 +0100
++++ ../prg/chk_all.sd7 2013-01-21 17:04:54.000000000 +0100
+@@ -30,6 +30,11 @@
+ const string: OBJECT_FILE_EXTENSION is configValue("OBJECT_FILE_EXTENSION");
+ const string: EXECUTABLE_FILE_EXTENSION is configValue("EXECUTABLE_FILE_EXTENSION");
+
++var string: interpretProgram is "./s7 -q ";
++var string: interpretCompiler is "./s7 s7c ";
++var string: executeCompiler is "./s7c ";
++var string: s7compiler is "./s7c" & EXECUTABLE_FILE_EXTENSION;
++
+ const string: chkint_output is "\n\
+ \Integer literals with exponent work correct.\n\
+ \Based integer literals work correct.\n\
+@@ -234,7 +239,7 @@
+ begin
+ write(progName);
+ flush(OUT);
+- interpretedOutput := cmdOutput("./s7 -q " & progName);
++ interpretedOutput := cmdOutput(interpretProgram & progName);
+ if interpretedOutput <> referenceOutput then
+ writeln;
+ writeln(" *** The interpreted " <& progName <& " does not work okay:");
+@@ -244,7 +249,7 @@
+ if fileType(progName & EXECUTABLE_FILE_EXTENSION) <> FILE_ABSENT then
+ removeFile(progName & EXECUTABLE_FILE_EXTENSION);
+ end if;
+- compilerOutput := cmdOutput("./s7 s7c " & progName);
++ compilerOutput := cmdOutput(interpretCompiler & progName);
+ if fileType(progName & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then
+ compiledOutput := cmdOutput("./" & progName);
+ if compiledOutput <> referenceOutput then
+@@ -284,7 +289,7 @@
+ end if;
+ okay := FALSE;
+ end if;
+- if fileType("s7c" & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then
++ if fileType(s7compiler) = FILE_REGULAR then
+ if fileType("tmp_" & progName & ".c") = FILE_REGULAR then
+ if fileType("tmp1_" & progName & ".c") = FILE_REGULAR then
+ removeFile("tmp1_" & progName & ".c");
+@@ -294,7 +299,7 @@
+ if fileType(progName & EXECUTABLE_FILE_EXTENSION) <> FILE_ABSENT then
+ removeFile(progName & EXECUTABLE_FILE_EXTENSION);
+ end if;
+- compilerOutput := cmdOutput("./s7c " & progName);
++ compilerOutput := cmdOutput(executeCompiler & progName);
+ if fileType(progName & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then
+ if fileType("tmp1_" & progName & ".c") = FILE_REGULAR then
+ if not equalFiles("tmp_" & progName & ".c", "tmp1_" & progName & ".c") then
+@@ -327,17 +332,31 @@
+
+ const proc: main is func
+ begin
+- if fileType("s7c" & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then
+- removeFile("s7c" & EXECUTABLE_FILE_EXTENSION);
+- end if;
+- write("compiling the compiler");
+- flush(OUT);
+- ignore(cmdOutput("./s7 s7c s7c"));
+- if not fileType("s7c" & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then
+- writeln;
+- writeln(" *** Failed to compile the compiler");
++ if length(argv(PROGRAM)) = 1 and argv(PROGRAM)[1] = "build" then
++ interpretProgram := "../bin/s7 -l ../lib -q ";
++ interpretCompiler := "../bin/s7 -l ../lib s7c -l ../lib -b ../bin ";
++ executeCompiler := "../bin/s7c -l ../lib -b ../bin ";
++ s7compiler := "../bin/s7c" & EXECUTABLE_FILE_EXTENSION;
++ write("checking for presence of " <& s7compiler);
++ if not fileType(s7compiler) = FILE_REGULAR then
++ writeln;
++ writeln(" *** No Seed7 compiler executable found");
++ else
++ writeln(" - okay");
++ end if;
+ else
+- writeln(" - okay");
++ if fileType(s7compiler) = FILE_REGULAR then
++ removeFile(s7compiler);
++ end if;
++ write("compiling the compiler");
++ flush(OUT);
++ ignore(cmdOutput(interpretCompiler & "s7c"));
++ if not fileType(s7compiler) = FILE_REGULAR then
++ writeln;
++ writeln(" *** Failed to compile the compiler");
++ else
++ writeln(" - okay");
++ end if;
+ end if;
+ check("chkint", chkint_output);
+ check("chkflt", chkflt_output);