diff options
author | Gleb Popov <arrowd@FreeBSD.org> | 2018-11-19 00:20:20 +0800 |
---|---|---|
committer | Gleb Popov <arrowd@FreeBSD.org> | 2018-11-19 00:20:20 +0800 |
commit | 57fa8182e532a3a6a11b38d3dd87ab0ec73c2e67 (patch) | |
tree | b290c4c54c9f59eb56d0f5939ccec081ab9a87fb /lang | |
parent | e2ad13c2cd94ec6c0efdd84d3387cf4ea403e5bd (diff) | |
download | freebsd-ports-gnome-57fa8182e532a3a6a11b38d3dd87ab0ec73c2e67.tar.gz freebsd-ports-gnome-57fa8182e532a3a6a11b38d3dd87ab0ec73c2e67.tar.zst freebsd-ports-gnome-57fa8182e532a3a6a11b38d3dd87ab0ec73c2e67.zip |
lang/ghc843: Add a port for 8.4.3 version.
Approved by: tcberner (mentor)
Differential Revision: https://reviews.freebsd.org/D17866
Diffstat (limited to 'lang')
-rw-r--r-- | lang/Makefile | 1 | ||||
-rw-r--r-- | lang/ghc843/Makefile | 34 | ||||
-rw-r--r-- | lang/ghc843/distinfo | 15 | ||||
-rw-r--r-- | lang/ghc843/files/build.boot.mk.in | 9 | ||||
-rw-r--r-- | lang/ghc843/files/build.mk.in | 19 | ||||
-rw-r--r-- | lang/ghc843/files/extra-patch-aclocal.m4 | 54 | ||||
-rw-r--r-- | lang/ghc843/files/patch-configure | 22 | ||||
-rw-r--r-- | lang/ghc843/files/patch-configure.ac | 24 | ||||
-rw-r--r-- | lang/ghc843/files/patch-ghc.mk | 21 | ||||
-rw-r--r-- | lang/ghc843/files/patch-libraries__Cabal__Cabal__Distribution__Simple__Program__Builtin.hs | 39 | ||||
-rw-r--r-- | lang/ghc843/files/patch-llvm-targets | 10 | ||||
-rw-r--r-- | lang/ghc843/files/wrap.c | 55 | ||||
-rw-r--r-- | lang/ghc843/pkg-descr | 20 |
13 files changed, 323 insertions, 0 deletions
diff --git a/lang/Makefile b/lang/Makefile index 48cbeae19dc0..f95414f2ae61 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -111,6 +111,7 @@ SUBDIR += gcc9-devel SUBDIR += gforth SUBDIR += ghc + SUBDIR += ghc843 SUBDIR += gjs SUBDIR += gnat_util SUBDIR += gnatcross-aarch64 diff --git a/lang/ghc843/Makefile b/lang/ghc843/Makefile new file mode 100644 index 000000000000..3156a849e33e --- /dev/null +++ b/lang/ghc843/Makefile @@ -0,0 +1,34 @@ +# Created by: Simon Marlow <simonmar@microsoft.com> +# $FreeBSD$ + +PORTNAME= ghc +PORTVERSION= ${GHC_VERSION} +PORTREVISION= 1 +CATEGORIES= lang haskell +MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \ + LOCAL/arrowd/:boot \ + ${HACKAGE_SITE}hscolour-${HSCOLOUR_VERSION}/:docs + +EXTRACT_ONLY= ${_DISTFILES:C/hscolour.*$//g} +DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source \ + hscolour-${HSCOLOUR_VERSION}.tar.gz:docs + +MAINTAINER= haskell@FreeBSD.org +COMMENT= Compiler for the functional language Haskell + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 + +GHC_VERSION= 8.4.3 +HSCOLOUR_VERSION= 1.24.4 +LLVM_VERSION= 50 + +CONFLICTS_INSTALL= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* ghc-8.0.* ghc-8.4.4 + +PLIST= ${.CURDIR}/../../lang/ghc/pkg-plist + +.include "${.CURDIR}/../../lang/ghc/bsd.ghc.mk" + +.include <bsd.port.mk> diff --git a/lang/ghc843/distinfo b/lang/ghc843/distinfo new file mode 100644 index 000000000000..0353ce933f81 --- /dev/null +++ b/lang/ghc843/distinfo @@ -0,0 +1,15 @@ +TIMESTAMP = 1530033471 +SHA256 (ghc-8.4.3-src.tar.xz) = ae47afda985830de8811243255aa3744dfb9207cb980af74393298b2b62160d6 +SIZE (ghc-8.4.3-src.tar.xz) = 11315068 +SHA256 (ghc-8.4.2-boot-amd64-freebsd.tar.xz) = 8fe44700c0b765b38a2072c8ea9ddb1da18b4a738397c9ceddcce80708900e4f +SIZE (ghc-8.4.2-boot-amd64-freebsd.tar.xz) = 72751016 +SHA256 (ghc-8.4.2-boot-i386-freebsd.tar.xz) = 673230735fc459a3c05cf845ef7beeeb6eab9576bc03471b9fb50bd3fe29d911 +SIZE (ghc-8.4.2-boot-i386-freebsd.tar.xz) = 69976728 +SHA256 (hscolour-1.24.4.tar.gz) = 243332b082294117f37b2c2c68079fa61af68b36223b3fc07594f245e0e5321d +SIZE (hscolour-1.24.4.tar.gz) = 28729 +SHA256 (ghc-8.4.2-boot-aarch64-freebsd.tar.xz) = 18412f10bb172dbaff7f31505845fbd43fdde14046463fdacc42e26683be311d +SIZE (ghc-8.4.2-boot-aarch64-freebsd.tar.xz) = 100240140 +SHA256 (ghc-8.4.2-boot-armv6-freebsd.tar.xz) = 61d3a4486dbb904b05a735e98f23a49c2b464d6b19212dd655ff578f36d02f0d +SIZE (ghc-8.4.2-boot-armv6-freebsd.tar.xz) = 107368936 +SHA256 (ghc-8.4.2-boot-armv7-freebsd.tar.xz) = eedb9416870bfe82315155751871e31e815b718b381ccf4f7e45a99a6ad7c94d +SIZE (ghc-8.4.2-boot-armv7-freebsd.tar.xz) = 110153548 diff --git a/lang/ghc843/files/build.boot.mk.in b/lang/ghc843/files/build.boot.mk.in new file mode 100644 index 000000000000..c38f6c9806f0 --- /dev/null +++ b/lang/ghc843/files/build.boot.mk.in @@ -0,0 +1,9 @@ +GhcLibWays = v +XMLDocWays = +HADDOCK_DOCS = NO +HSCOLOUR_SRCS = NO +INTEGER_LIBRARY = integer-simple +DYNAMIC_GHC_PROGRAMS = NO +BUILD_PROF_LIBS = NO +BIN_DIST_NAME = ghc-%%GHC_VERSION%%-boot +BIN_DIST_TAR = ghc-%%GHC_VERSION%%-boot.tar diff --git a/lang/ghc843/files/build.mk.in b/lang/ghc843/files/build.mk.in new file mode 100644 index 000000000000..366ab8678fc5 --- /dev/null +++ b/lang/ghc843/files/build.mk.in @@ -0,0 +1,19 @@ +docdir = %%PREFIX%%/share/doc/ghc-%%GHC_VERSION%% +htmldir = %%PREFIX%%/share/doc/ghc-%%GHC_VERSION%% +mandir = %%PREFIX%%/man +infodir = %%PREFIX%%/info +DYNAMIC_GHC_PROGRAMS = %%WITH_DYNAMIC%% +BUILD_PROF_LIBS = %%WITH_PROFILE%% +HADDOCK_DOCS = %%WITH_DOCS%% +HSCOLOUR_SRCS = %%WITH_DOCS%% +# disable xelatex: PR 231438 +BUILD_SPHINX_PDF = NO +BSD_PATH_TO_HSC2HS = %%HSC2HS%% +SRC_HC_OPTS += -I%%NCURSESINC%% -L%%NCURSESLIB%% -I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib +SRC_CC_OPTS += %%CFLAGS%% +EXTRA_HSC2HS_OPTS += -I%%LOCALBASE%%/include --lflag=-L%%LOCALBASE%%/lib +EXTRA_LD_OPTS += -L%%LOCALBASE%%/lib +EXTRA_CABAL_CONFIGURE_FLAGS += --extra-include-dirs=%%LOCALBASE%%/include +EXTRA_CABAL_CONFIGURE_FLAGS += --extra-lib-dirs=%%LOCALBASE%%/lib +libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes=%%NCURSESINC%% --configure-option=--with-curses-libraries=%%NCURSESLIB%% +V = 0 diff --git a/lang/ghc843/files/extra-patch-aclocal.m4 b/lang/ghc843/files/extra-patch-aclocal.m4 new file mode 100644 index 000000000000..8adc3e28b4e3 --- /dev/null +++ b/lang/ghc843/files/extra-patch-aclocal.m4 @@ -0,0 +1,54 @@ +--- aclocal.m4.orig 2018-03-25 21:22:32 UTC ++++ aclocal.m4 +@@ -648,6 +648,14 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], + $3="$$3 -D_HPUX_SOURCE" + $5="$$5 -D_HPUX_SOURCE" + ;; ++ arm*freebsd*) ++ # On arm/freebsd, tell gcc to generate Arm ++ # instructions (ie not Thumb) and to link using the gold linker. ++ # Forcing LD to be ld.gold is done in FIND_LD m4 macro. ++ $2="$$2 -marm" ++ $3="$$3 -Wl,-z,noexecstack" ++ $4="$$4 -z noexecstack" ++ ;; + arm*linux*) + # On arm/linux and arm/android, tell gcc to generate Arm + # instructions (ie not Thumb). +@@ -656,6 +664,11 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], + $4="$$4 -z noexecstack" + ;; + ++ aarch64*freebsd*) ++ $3="$$3 -Wl,-z,noexecstack" ++ $4="$$4 -z noexecstack" ++ ;; ++ + aarch64*linux*) + $3="$$3 -Wl,-z,noexecstack" + $4="$$4 -z noexecstack" +@@ -1917,6 +1930,10 @@ case "$1" in + # converts the canonicalized target into someting llvm can understand + AC_DEFUN([GHC_LLVM_TARGET], [ + case "$2-$3" in ++ *-freebsd*-gnueabihf) ++ llvm_target_vendor="unknown" ++ llvm_target_os="freebsd-gnueabihf" ++ ;; + hardfloat-*eabi) + llvm_target_vendor="unknown" + llvm_target_os="$3""hf" +@@ -2361,13 +2378,6 @@ AC_DEFUN([FIND_LD],[ + [enable_ld_override=yes]) + + find_ld() { +- # Make sure the user didn't specify LD manually. +- if test "z$LD" != "z"; then +- AC_CHECK_TARGET_TOOL([LD], [ld]) +- LD_NO_GOLD=$LD +- return +- fi +- + # Manually iterate over possible names since we want to ensure that, e.g., + # if ld.lld is installed but gcc doesn't support -fuse-ld=lld, that we + # then still try ld.gold and -fuse-ld=gold. diff --git a/lang/ghc843/files/patch-configure b/lang/ghc843/files/patch-configure new file mode 100644 index 000000000000..a3ff7aea111a --- /dev/null +++ b/lang/ghc843/files/patch-configure @@ -0,0 +1,22 @@ +--- configure.orig 2018-03-06 20:04:54 UTC ++++ configure +@@ -9108,6 +9108,19 @@ $as_echo_n "checking Setting up CFLAGS, LDFLAGS, IGNOR + IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack" + ;; + ++ arm*freebsd*) ++ # On arm/freebsd, tell gcc to generate Arm ++ # instructions (ie not Thumb). ++ CFLAGS="$CFLAGS -marm" ++ LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" ++ IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack" ++ ;; ++ ++ aarch64*freebsd*) ++ LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" ++ IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack" ++ ;; ++ + powerpc-ibm-aix*) + # We need `-D_THREAD_SAFE` to unlock the thread-local `errno`. + CFLAGS="$CFLAGS -D_THREAD_SAFE" diff --git a/lang/ghc843/files/patch-configure.ac b/lang/ghc843/files/patch-configure.ac new file mode 100644 index 000000000000..4d19057acf95 --- /dev/null +++ b/lang/ghc843/files/patch-configure.ac @@ -0,0 +1,24 @@ +--- configure.ac.orig 2018-04-17 19:30:22 UTC ++++ configure.ac +@@ -447,6 +447,9 @@ XCODE_VERSION() + dnl ** Building a cross compiler? + dnl -------------------------------------------------------------- + CrossCompiling=NO ++ ++build=`echo $build | sed -e 's/amd64-/x86_64-/g; s/armv[[67]]-/arm-/g; s/-freebsd.*$/-freebsd/g'` ++ + # If 'host' and 'target' differ, then this means we are building a cross-compiler. + if test "$TargetPlatform" != "$HostPlatform" ; then + CrossCompiling=YES +@@ -1163,6 +1158,11 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; t + # The flag MAP_NORESERVE is supported for source compatibility reasons, + # but is completely ignored by OS mmap + use_large_address_space=no ++ elif test "$ghc_host_os" = "freebsd" ; then ++ # FreeBSD does not support mmap with MAP_NORESERVE, removed in r273250. ++ # The flag MAP_NORESERVE is supported for source compatibility reasons, ++ # but is completely ignored by OS mmap ++ use_large_address_space=no + else + AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[], + [ diff --git a/lang/ghc843/files/patch-ghc.mk b/lang/ghc843/files/patch-ghc.mk new file mode 100644 index 000000000000..8ab4d6e13130 --- /dev/null +++ b/lang/ghc843/files/patch-ghc.mk @@ -0,0 +1,21 @@ +--- ghc.mk.orig 2017-01-03 15:59:18 UTC ++++ ghc.mk +@@ -96,6 +96,7 @@ endif + # Catch make if it runs away into an infinite loop + ifeq "$(MAKE_RESTARTS)" "" + else ifeq "$(MAKE_RESTARTS)" "1" ++else ifeq "$(MAKE_RESTARTS)" "2" + else + $(error Make has restarted itself $(MAKE_RESTARTS) times; is there a makefile bug? See http://ghc.haskell.org/trac/ghc/wiki/Building/Troubleshooting#Makehasrestarteditself3timesisthereamakefilebug for details) + endif +@@ -459,10 +460,7 @@ PACKAGES_STAGE1 += ghc-boot-th + PACKAGES_STAGE1 += ghc-boot + PACKAGES_STAGE1 += template-haskell + PACKAGES_STAGE1 += ghc-compact +- +-ifeq "$(HADDOCK_DOCS)" "YES" + PACKAGES_STAGE1 += xhtml +-endif + + ifeq "$(WITH_TERMINFO)" "YES" + PACKAGES_STAGE1 += terminfo diff --git a/lang/ghc843/files/patch-libraries__Cabal__Cabal__Distribution__Simple__Program__Builtin.hs b/lang/ghc843/files/patch-libraries__Cabal__Cabal__Distribution__Simple__Program__Builtin.hs new file mode 100644 index 000000000000..96b536dc0eab --- /dev/null +++ b/lang/ghc843/files/patch-libraries__Cabal__Cabal__Distribution__Simple__Program__Builtin.hs @@ -0,0 +1,39 @@ +--- libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs.orig 2017-11-28 16:40:34 UTC ++++ libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs +@@ -59,6 +59,8 @@ import Distribution.Compat.Exception + import Distribution.Verbosity + import Distribution.Version + ++import System.FilePath (takeDirectory) ++ + import qualified Data.Map as Map + + -- ------------------------------------------------------------ +@@ -265,11 +267,13 @@ alexProgram = (simpleProgram "alex") { + + gccProgram :: Program + gccProgram = (simpleProgram "gcc") { +- programFindVersion = findProgramVersion "-dumpversion" id +- } ++ programFindLocation = \v p -> findProgramOnSearchPath v p "%%CC%%" ++} + + arProgram :: Program +-arProgram = simpleProgram "ar" ++arProgram = (simpleProgram "ar") { ++ programFindLocation = \v p -> findProgramOnSearchPath v p "%%AR%%" ++} + + stripProgram :: Program + stripProgram = (simpleProgram "strip") { +@@ -337,7 +341,9 @@ greencardProgram :: Program + greencardProgram = simpleProgram "greencard" + + ldProgram :: Program +-ldProgram = simpleProgram "ld" ++ldProgram = (simpleProgram "ld") { ++ programFindLocation = \v p -> findProgramOnSearchPath v p "%%LD%%" ++ } + + tarProgram :: Program + tarProgram = (simpleProgram "tar") { diff --git a/lang/ghc843/files/patch-llvm-targets b/lang/ghc843/files/patch-llvm-targets new file mode 100644 index 000000000000..8ea0574f54a7 --- /dev/null +++ b/lang/ghc843/files/patch-llvm-targets @@ -0,0 +1,10 @@ +--- llvm-targets.orig 2018-03-17 14:04:41 UTC ++++ llvm-targets +@@ -20,4 +20,7 @@ + ,("aarch64-apple-ios", ("e-m:o-i64:64-i128:128-n32:64-S128", "generic", "+neon")) + ,("i386-apple-ios", ("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128", "yonah", "")) + ,("x86_64-apple-ios", ("e-m:o-i64:64-f80:128-n8:16:32:64-S128", "core2", "")) ++,("armv6-unknown-freebsd-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align")) ++,("armv7-unknown-freebsd-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", "+strict-align")) ++,("aarch64-unknown-freebsd", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon")) + ] diff --git a/lang/ghc843/files/wrap.c b/lang/ghc843/files/wrap.c new file mode 100644 index 000000000000..d818d9a3744b --- /dev/null +++ b/lang/ghc843/files/wrap.c @@ -0,0 +1,55 @@ +/* -*- ugly-hack-mode -*- */ +/* $FreeBSD$ */ + +#include <sys/stat.h> + +struct old_dirent; +struct old_stat; + +__asm(".symver old_readdir_r, readdir_r@FBSD_1.0"); +int old_readdir_r(void *dirp, struct old_dirent *entry, + struct old_dirent **result); +__asm(".symver old_stat, stat@FBSD_1.0"); +int old_stat(const char * restrict path, struct old_stat * restrict sb); +__asm(".symver old_lstat, lstat@FBSD_1.0"); +int old_lstat(const char * restrict path, struct old_stat * restrict sb); +__asm(".symver old_fstat, fstat@FBSD_1.0"); +int old_fstat(int fd, struct old_stat *sb); +__asm(".symver old_mknod, mknod@FBSD_1.0"); +int old_mknod(const char *path, mode_t mode, uint32_t dev); + +int +__wrap_readdir_r(void *dirp, struct old_dirent *entry, + struct old_dirent **result) +{ + + return (old_readdir_r(dirp, entry, result)); +} + +int +__wrap_stat(const char * restrict path, struct old_stat * restrict sb) +{ + + return (old_stat(path, sb)); +} + +int +__wrap_lstat(const char * restrict path, struct old_stat * restrict sb) +{ + + return (old_lstat(path, sb)); +} + +int +__wrap_fstat(int fd, struct old_stat *sb) +{ + + return (old_fstat(fd, sb)); +} + +int +__wrap_mknod(const char *path, mode_t mode, uint32_t dev) +{ + + return (old_mknod(path, mode, dev)); +} diff --git a/lang/ghc843/pkg-descr b/lang/ghc843/pkg-descr new file mode 100644 index 000000000000..520a29318997 --- /dev/null +++ b/lang/ghc843/pkg-descr @@ -0,0 +1,20 @@ +The Glasgow Haskell Compiler is a state-of-the-art, open source, compiler and +interactive environment for the functional language Haskell. Highlights: + + * Supports the entire Haskell 2010 language plus a wide variety of + extensions. + * Has particularly good support for concurrency and parallelism, including + support for Software Transactional Memory (STM). + * Generates fast code, particularly for concurrent programs. + * Works on several platforms including FreeBSD, Windows, Mac, Linux, most + varieties of Unix, and several different processor architectures. + * Has extensive optimisation capabilities, including inter-module optimisation. + * Compiles Haskell code either directly to native code or using LLVM as a + back-end. It can also generate C code as an intermediate target for porting + to new platforms. The interactive environment compiles Haskell to bytecode, + and supports execution of mixed bytecode/compiled programs. + * Profiling is supported, both by time/allocation and various kinds of heap + profiling. + * Comes with several libraries, and thousands more are available on Hackage. + +WWW: http://www.haskell.org/ghc/ |