aboutsummaryrefslogtreecommitdiffstats
path: root/lang/fsharp/Makefile
diff options
context:
space:
mode:
authordbn <dbn@FreeBSD.org>2016-10-14 23:35:51 +0800
committerdbn <dbn@FreeBSD.org>2016-10-14 23:35:51 +0800
commitf8e5ce0c7befe8c17a6c34333059d19dc5cbf48e (patch)
tree5e6958575f101378be873ac593ce04c3ab884baf /lang/fsharp/Makefile
parent0faf102047abc1a224423fd973fec943192f4580 (diff)
downloadfreebsd-ports-gnome-f8e5ce0c7befe8c17a6c34333059d19dc5cbf48e.tar.gz
freebsd-ports-gnome-f8e5ce0c7befe8c17a6c34333059d19dc5cbf48e.tar.zst
freebsd-ports-gnome-f8e5ce0c7befe8c17a6c34333059d19dc5cbf48e.zip
lang/fsharp: fix build, add test support.
- Use license file from source - Depend on PCL reference assemblies - Download and extract nuget packages - Mark the port as MAKE_JOBS_UNSAFE (it always run -j1) - Mark the port as architecture agnostic (intepreted by mono) - Add test support PR: 213405
Diffstat (limited to 'lang/fsharp/Makefile')
-rw-r--r--lang/fsharp/Makefile53
1 files changed, 51 insertions, 2 deletions
diff --git a/lang/fsharp/Makefile b/lang/fsharp/Makefile
index 834fc999cd47..088baef33b82 100644
--- a/lang/fsharp/Makefile
+++ b/lang/fsharp/Makefile
@@ -4,20 +4,69 @@
PORTNAME= fsharp
PORTVERSION= 4.0.1.10
CATEGORIES= lang
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= mono@FreeBSD.org
COMMENT= Functional and object-oriented language for the .NET platform
LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
-BUILD_DEPENDS= mono>=3.0:lang/mono
+BUILD_DEPENDS= mono>=3.0:lang/mono \
+ referenceassemblies-pcl>=4.6-1:lang/referenceassemblies-pcl
RUN_DEPENDS= mono>=3.0:lang/mono
-NO_PACKAGE= The build process downloads external dependencies we cannot provide through ports
+NUGET_DEPENDS= FSharp.Compiler.Tools-4.0.1.3 \
+ FSharp.Data-2.2.5 \
+ FSharp.SRGen.Build.Tasks-3.0.0 \
+ fssrgen-3.0.0 \
+ Microsoft.DiaSymReader-1.0.8 \
+ Microsoft.DiaSymReader.PortablePdb-1.1.0 \
+ System.Collections.Immutable-1.2.0 \
+ System.Reflection.Metadata-1.4.1-beta-24227-04
USE_GITHUB= yes
USES= autoreconf gmake mono pkgconfig
GNU_CONFIGURE= yes
+MAKE_JOBS_UNSAFE= Build not parallelizable
+NO_ARCH= yes
+
+NUGET_PACKAGEDIR= ${WRKSRC}/packages
+
+.for depend in ${NUGET_DEPENDS}
+id= ${depend:C/-.*$//}
+version= ${depend:S/${id}-//}
+group= nuget_${id:S/.//g}
+nupkg= ${id:tl}.${version}.nupkg
+DISTFILES_${group}:= ${nupkg}:${group}
+MASTER_SITES_${group}:= https://www.nuget.org/api/v2/package/${id}/${version}?dummy=/:${group}
+NUGET_NUPKGS_${group}:= ${nupkg}:${id}-${version}
+
+DISTFILES+= ${DISTFILES_nuget_${depend:C/-.*$//:S/.//g}}
+MASTER_SITES+= ${MASTER_SITES_nuget_${depend:C/-.*$//:S/.//g}}
+NUGET_NUPKGS+= ${NUGET_NUPKGS_nuget_${depend:C/-.*$//:S/.//g}}
+.endfor
+
+post-extract:
+.for nupkg in ${NUGET_NUPKGS}
+ @${MKDIR} ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/-/./}
+ @tar -xf ${DISTDIR}/${nupkg:C/:.*$//} -C ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/-/./} \
+ -s/%2B/\+/g \
+ --exclude '\[Content_Types\].xml' \
+ --exclude package/ \
+ --exclude _rels/
+.endfor
+
+do-test:
+ ${MKDIR} ${WRKDIR}/bin
+ echo "#!/bin/sh" > ${WRKDIR}/bin/fsharpc
+ echo 'exec ${LOCALBASE}/bin/mono ${WRKSRC}/lib/release/fsc.exe "$$@"' >> ${WRKDIR}/bin/fsharpc
+ ${CHMOD} 0755 ${WRKDIR}/bin/fsharpc
+ (cd ${WRKSRC}/tests/fsharp/core; \
+ ${ENV} \
+ PATH=${WRKDIR}/bin:${PATH} \
+ MONO_PATH=${WRKSRC}/lib/release \
+ ./run-all.sh)
.include <bsd.port.mk>