Import FPC.

Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal
compiler. It is available for different processors: Intel x86,
Amd64/x86_64, PowerPC, PowerPC64, Sparc, ARM. The discontinued 1.0
version also supports the Motorola 680x0. The following operating
systems are supported: Linux, FreeBSD, Haiku, Mac OS X/Darwin, DOS,
Win32, Win64, WinCE, OS/2, Netware (libc and classic) and MorphOS.

Thanks to pierre at freepascal dot org for taking care of the patches
and to aja@ for mirroring the bootstrap.

tweaks and ok jasper@ sthen@
This commit is contained in:
pascal 2013-03-08 11:34:15 +00:00
parent 0f080c706b
commit 230df100e2
18 changed files with 2784 additions and 0 deletions

86
lang/fpc/Makefile Normal file
View File

@ -0,0 +1,86 @@
# $OpenBSD: Makefile,v 1.1.1.1 2013/03/08 11:34:15 pascal Exp $
ONLY_FOR_ARCHS = amd64 i386
COMMENT = open source compiler for Pascal/Object Pascal
V = 2.6.2
DISTNAME = fpcbuild-${V}
PKGNAME = fpc-${V}
BOOT_GEN = 0
CATEGORIES = lang
HOMEPAGE = http://www.freepascal.org/
MAINTAINER = Pascal Stumpf <Pascal.Stumpf@cubes.de>
# compiler: GPLv2+, packages/rtl: modified LGPLv2
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
MASTER_SITES = ftp://ftp.freepascal.org/pub/fpc/dist/$V/source/
MASTER_SITES0 = http://distfiles.bsdfrog.org/
DIST_SUBDIR = fpc
BOOTSTRAP = fpcboot-openbsd-$V-${BOOT_GEN}${EXTRACT_SUFX}
DISTFILES = ${DISTNAME}${EXTRACT_SUFX} ${BOOTSTRAP}:0
.if ${MACHINE_ARCH} == "amd64"
COMPNAME = ppcx64
CONFIG = x86_64-openbsd
PKG_ARGS += -Damd64=1
PKG_ARGS += -Di386=0
.else
COMPNAME = ppc386
CONFIG = i386-openbsd
PKG_ARGS += -Di386=1
PKG_ARGS += -Damd64=0
.endif
SUBST_VARS += V CONFIG
REGRESS_DEPENDS = devel/nasm
MAKE_FLAGS = NOGDB=1
MAKE_ENV = MKDIRPROG=/bin/mkdir ECHO=/bin/echo \
GINSTALL=/usr/bin/install DATE=/bin/date \
TARPROG=/bin/tar FPC="${WRKDIR}/bin/${COMPNAME}"
FAKE_FLAGS = INSTALLEXE="${INSTALL_PROGRAM}" \
MKDIR="${INSTALL_DATA_DIR}" \
INSTALL="${INSTALL_DATA}"
REGRESS_FLAGS = TEST_FPC="${WRKSRC}/fpcsrc/compiler/${COMPNAME}" \
FPC="${WRKSRC}/fpcsrc/compiler/${COMPNAME}" \
FPCOPT="-Fu${WRKSRC}/fpcsrc/rtl/units/${CONFIG}" \
FPCMAKE="${WRKSRC}/fpcsrc/utils/fpcm/fpcmake"
USE_GMAKE = Yes
post-patch:
${SUBST_CMD} ${WRKSRC}/fpcsrc/compiler/systems/t_bsd.pas
post-install:
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/fpc/lexyacc
chmod ${DIRMODE} ${PREFIX}/lib/fpc/lexyacc/
chmod ${SHAREMODE} ${PREFIX}/lib/fpc/lexyacc/*
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/doc/fpc-${V}/fpc
chmod ${DIRMODE} ${PREFIX}/share/doc/fpc-${V}/fpc/
chmod ${SHAREMODE} ${PREFIX}/share/doc/fpc-${V}/fpc/*
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/examples/fpc-$V
find ${PREFIX}/share/examples/fpc-$V -type d -exec \
chmod ${DIRMODE} {} \+
find ${PREFIX}/share/examples/fpc-$V -type f -exec \
chmod ${SHAREMODE} {} \+
cd ${PREFIX}/bin && ln -s ../lib/fpc/${V}/${COMPNAME} .
# generate sample config file
${PREFIX}/bin/fpcmkcfg -d "basepath=${TRUEPREFIX}/lib/fpc/$V" \
-o ${PREFIX}/share/examples/fpc-$V/fpc.cfg.sample
# clean these up for regress
find ${WRKSRC} -name Package.fpc | xargs rm -f
do-regress:
cd ${WRKSRC}/fpcsrc/tests && ${MAKE_PROGRAM} ${ALL_REGRESS_FLAGS} full
.include <bsd.port.mk>

4
lang/fpc/distinfo Normal file
View File

@ -0,0 +1,4 @@
SHA256 (fpc/fpcboot-openbsd-2.6.2-0.tar.gz) = 6hQHVhJagWcgrXMFp3YFJXgPIl2Y82lfvWXK/vxUTQY=
SHA256 (fpc/fpcbuild-2.6.2.tar.gz) = da1wDMx3KwcwTChrCq6V9IpQSxX+iQo2Nh0X3I6S2Dw=
SIZE (fpc/fpcboot-openbsd-2.6.2-0.tar.gz) = 2007022
SIZE (fpc/fpcbuild-2.6.2.tar.gz) = 55198144

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Install manpages on OpenBSD.
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&root=fpcbuild&revision=1049
--- Makefile.orig Fri Oct 19 17:37:19 2012
+++ Makefile Wed Dec 26 22:48:12 2012
@@ -2043,7 +2043,7 @@ endif
ifeq ($(OS_TARGET),emx)
$(COPY) $(addprefix $(CVSINSTALL)/binos2/,*.ico *.dll) $(INSTALL_BINDIR)
endif
-ifneq ($(findstring $(OS_TARGET),linux freebsd sunos qnx),)
+ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd sunos qnx),)
$(MAKE) -C $(CVSINSTALL)/man installman
endif
endif

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-fpcsrc_compiler_systems_t_bsd_pas,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Correct library search path for OpenBSD; always add -nopie to linker flags.
--- fpcsrc/compiler/systems/t_bsd.pas.orig Thu Feb 28 23:09:15 2013
+++ fpcsrc/compiler/systems/t_bsd.pas Fri Mar 1 00:28:57 2013
@@ -126,7 +126,10 @@ begin
Inherited Create;
if not Dontlinkstdlibpath Then
if not(target_info.system in systems_darwin) then
- LibrarySearchPath.AddPath(sysrootpath,'/lib;/usr/lib;/usr/X11R6/lib',true)
+ if not(target_info.system in systems_openbsd) then
+ LibrarySearchPath.AddPath(sysrootpath,'/lib;/usr/lib;/usr/X11R6/lib',true)
+ else
+ LibrarySearchPath.AddPath(sysrootpath,'/usr/lib;/usr/X11R6/lib;${LOCALBASE}/lib',true)
else
{ Mac OS X doesn't have a /lib }
LibrarySearchPath.AddPath(sysrootpath,'/usr/lib',true)
@@ -647,6 +650,11 @@ begin
else
DynLinKStr:=DynLinkStr+' -dynamic'; // one dash!
end;
+
+{ Use -nopie on OpenBSD }
+ if (target_info.system in systems_openbsd) then
+ Info.ExtraOptions:=Info.ExtraOptions+' -nopie';
+
{ Write used files and libraries }
WriteResponseFile(false);

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-fpcsrc_rtl_bsd_ossysc_inc,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Correct last parameter to getdirentries(2)
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=23223
--- fpcsrc/rtl/bsd/ossysc.inc.orig Thu Jul 26 20:34:03 2012
+++ fpcsrc/rtl/bsd/ossysc.inc Thu Jul 26 20:34:16 2012
@@ -223,7 +223,7 @@ with blockmode have this higher?}
function readbuffer:longint;
var retval :longint;
- basep : clong;
+ basep : off_t;
begin
{$ifdef USE_GETDIRENTRIES_SYSCALL}
Retval:=do_syscall(syscall_nr_getdirentries,TSysParam(dirp^.dd_fd),TSysParam(@dirp^.dd_buf^),DIRBLKSIZ {sizeof(getdentsbuffer)},TSysParam(@basep));

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-fpcsrc_rtl_openbsd_i386_cprt0_as,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Add .note.openbsd.ident section, needed to identify as OpenBSD executable.
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=23685
--- fpcsrc/rtl/openbsd/i386/cprt0.as.orig Fri Mar 1 00:03:02 2013
+++ fpcsrc/rtl/openbsd/i386/cprt0.as Fri Mar 1 00:03:03 2013
@@ -1,3 +1,11 @@
+ .section ".note.openbsd.ident", "a"
+ .p2align 2
+ .long 8
+ .long 4
+ .long 1
+ .ascii "OpenBSD\0"
+ .long 0
+ .previous
.file "crt0.c"
gcc2_compiled.:
.data

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-fpcsrc_rtl_openbsd_i386_prt0_as,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Add .note.openbsd.ident section, needed to identify as OpenBSD executable.
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=23685
--- fpcsrc/rtl/openbsd/i386/prt0.as.orig Fri Mar 1 00:03:06 2013
+++ fpcsrc/rtl/openbsd/i386/prt0.as Fri Mar 1 00:03:14 2013
@@ -1,3 +1,11 @@
+ .section ".note.openbsd.ident", "a"
+ .p2align 2
+ .long 8
+ .long 4
+ .long 1
+ .ascii "OpenBSD\0"
+ .long 0
+ .previous
.file "crt0.c"
gcc2_compiled.:
.data

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-fpcsrc_rtl_openbsd_sysnr_inc,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Use correct getdirentries(2) syscall, not the (now deleted) compat one.
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=23223
--- fpcsrc/rtl/openbsd/sysnr.inc.orig Thu Jul 26 19:33:38 2012
+++ fpcsrc/rtl/openbsd/sysnr.inc Thu Jul 26 19:35:30 2012
@@ -256,7 +256,7 @@ Const
syscall_nr_MAXSYSCALL = 313;
{ Aliases }
- syscall_nr_getdirentries = syscall_nr_ogetdirentries;
+ syscall_nr_getdirentries = syscall_nr_getdirentriesi49;
syscall_nr_waitpid = syscall_nr_wait4; // 7, added: ease of notation purposes
{ syscall_nr_getdents = syscall_nr_getdirentries; }
{$define USE_GETDIRENTRIES_SYSCALL}

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-fpcsrc_rtl_openbsd_x86_64_cprt0_as,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Add .note.openbsd.ident section, needed to identify as OpenBSD executable.
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=23685
--- fpcsrc/rtl/openbsd/x86_64/cprt0.as.orig Thu Feb 28 23:57:37 2013
+++ fpcsrc/rtl/openbsd/x86_64/cprt0.as Fri Mar 1 00:00:37 2013
@@ -1,3 +1,11 @@
+ .section ".note.openbsd.ident", "a"
+ .p2align 2
+ .long 8
+ .long 4
+ .long 1
+ .ascii "OpenBSD\0"
+ .long 0
+ .previous
.file "crt0.c"
.globl __progname
.section .rodata

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-fpcsrc_rtl_openbsd_x86_64_gprt0_as,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Add .note.openbsd.ident section, needed to identify as OpenBSD executable.
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=23685
--- fpcsrc/rtl/openbsd/x86_64/gprt0.as.orig Thu Feb 28 23:57:52 2013
+++ fpcsrc/rtl/openbsd/x86_64/gprt0.as Fri Mar 1 00:00:55 2013
@@ -1,3 +1,11 @@
+ .section ".note.openbsd.ident", "a"
+ .p2align 2
+ .long 8
+ .long 4
+ .long 1
+ .ascii "OpenBSD\0"
+ .long 0
+ .previous
.file "crt0.c"
.globl __progname
.section .rodata

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-fpcsrc_rtl_openbsd_x86_64_prt0_as,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Add .note.openbsd.ident section, needed to identify as OpenBSD executable.
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=23685
--- fpcsrc/rtl/openbsd/x86_64/prt0.as.orig Thu Feb 28 23:58:27 2013
+++ fpcsrc/rtl/openbsd/x86_64/prt0.as Fri Mar 1 00:00:18 2013
@@ -1,3 +1,11 @@
+ .section ".note.openbsd.ident", "a"
+ .p2align 2
+ .long 8
+ .long 4
+ .long 1
+ .ascii "OpenBSD\0"
+ .long 0
+ .previous
.file "crt0.c"
.globl __progname
.section .rodata

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-install_man_Makefile,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Don't gzip manpages.
--- install/man/Makefile.orig Thu May 3 14:33:10 2012
+++ install/man/Makefile Thu May 3 14:34:25 2012
@@ -31,5 +31,3 @@ installman:
$(GINSTALL) -d -m 755 $(INSTALL_MANDIR)/man5
$(GINSTALL) -c -m 644 man1/*.1 $(INSTALL_MANDIR)/man1
$(GINSTALL) -c -m 644 man5/*.5 $(INSTALL_MANDIR)/man5
- find man1/*.1 -exec gzip -9f $(INSTALL_MANDIR)/'{}' \;
- find man5/*.5 -exec gzip -9f $(INSTALL_MANDIR)/'{}' \;

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-install_man_man1_fpc_1,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
.PP doesn't take arguments.
--- install/man/man1/fpc.1.orig Thu May 3 14:49:31 2012
+++ install/man/man1/fpc.1 Thu May 3 14:51:55 2012
@@ -252,7 +252,8 @@ Add
to the include file search path.
This path is used when looking for include files.
-.PP Options controlling the kind of output
+.PP
+Options controlling the kind of output
for more information on these options, see also the programmers manual.
.TP
.BI \-a

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-install_man_man1_ppdep_1,v 1.1.1.1 2013/03/08 11:34:18 pascal Exp $
Superflous .RE
--- install/man/man1/ppdep.1.orig Thu May 3 14:49:01 2012
+++ install/man/man1/ppdep.1 Thu May 3 14:49:11 2012
@@ -89,7 +89,6 @@ Writes some diagnostic messages. If you use this optio
.I \-o
as well, since the diagnostic messages will also be written to
standard output.
-.RE
.SH SEE ALSO
.IP

6
lang/fpc/pkg/DESCR Normal file
View File

@ -0,0 +1,6 @@
Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal
compiler. It is available for different processors: Intel x86,
Amd64/x86_64, PowerPC, PowerPC64, Sparc, ARM. The discontinued 1.0
version also supports the Motorola 680x0. The following operating
systems are supported: Linux, FreeBSD, Haiku, Mac OS X/Darwin, DOS,
Win32, Win64, WinCE, OS/2, Netware (libc and classic) and MorphOS.

4
lang/fpc/pkg/PFRAG.amd64 Normal file
View File

@ -0,0 +1,4 @@
@comment $OpenBSD: PFRAG.amd64,v 1.1.1.1 2013/03/08 11:34:15 pascal Exp $
bin/ppcx64
@bin lib/fpc/${V}/ppcx64
@man man/man1/ppcx64.1

7
lang/fpc/pkg/PFRAG.i386 Normal file
View File

@ -0,0 +1,7 @@
@comment $OpenBSD: PFRAG.i386,v 1.1.1.1 2013/03/08 11:34:15 pascal Exp $
bin/ppc386
@bin lib/fpc/${V}/ppc386
lib/fpc/${V}/units/${CONFIG}/rtl/libpmmx.a
lib/fpc/${V}/units/${CONFIG}/rtl/mmx.o
lib/fpc/${V}/units/${CONFIG}/rtl/mmx.ppu
@man man/man1/ppc386.1

2462
lang/fpc/pkg/PLIST Normal file

File diff suppressed because it is too large Load Diff