aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authordbn <dbn@FreeBSD.org>2016-10-31 14:58:31 +0800
committerdbn <dbn@FreeBSD.org>2016-10-31 14:58:31 +0800
commitaef6e1fa5d7e499fb7084d887cea956b9177fffb (patch)
tree0aff963e63dd1bafe4ff401da3faebceff1bbd36 /Mk
parenta1e36a73f84b39f0c3b4d61a644ddd7355e58307 (diff)
downloadfreebsd-ports-gnome-aef6e1fa5d7e499fb7084d887cea956b9177fffb.tar.gz
freebsd-ports-gnome-aef6e1fa5d7e499fb7084d887cea956b9177fffb.tar.zst
freebsd-ports-gnome-aef6e1fa5d7e499fb7084d887cea956b9177fffb.zip
lang/mono: update to 4.6.1.5.
USES=mono: add nuget argument The nuget argument adds support for nuget packages. The nuget packages must be specified in the NUGET_DEPENDS variable. devel/monodevelop: update to 6.1.1.15 - Switch to github. The other official source is quite a few versions behind. - Add missing dependencies (fsharp, ssl2, curl) - Add required nuget packages - Add required external repositories - Drop options. Although ./configure offers these flags, there is no functional change (i.e. no-op) - All patches have been upstreamed (and the one we need is from upstream). lang/fsharp: update to 4.0.1.15 - convert to use the nuget argument. ChangeLog: - Fix null condition in Fsc task lang/mono-devel: update to 4.6 - switch to new test target (currently tests the port to be installed) www/gecko-sharp20: depreciate: broken and no-upstream - Give 1 month for anyone to complain that this port is being removed. x11-toolkits/gtk-sharp30: bump PORTREVISION - Add LICENSE information - Add missing dependencies (per stage-qa) x11-toolkits/gtk-sharp20: update to 2.12.40. - Add LICENSE information - Add missing dependencies (per stage-qa) - Change download location per Mono's Gtk# website. PR: 213484 PR: 213796 Reviewed by: mat, romain Differential Revision: https://reviews.freebsd.org/D8339
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/mono.mk74
1 files changed, 71 insertions, 3 deletions
diff --git a/Mk/Uses/mono.mk b/Mk/Uses/mono.mk
index 347131cf6be7..9d15cc3c0563 100644
--- a/Mk/Uses/mono.mk
+++ b/Mk/Uses/mono.mk
@@ -3,15 +3,35 @@
# mono (c#) support
#
# Feature: mono
-# Usage: USES=mono
+# Usage: USES=mono:ARGS
+# Valid ARGS: nuget
#
# MAINTAINER= mono@FreeBSD.org
+#
+# Arguments:
+#
+# nuget Specifies that the port uses nuget packages. The
+# variables NUGET_DEPENDS needs to be set with the names,
+# versions and optionally the port origin of the nuget
+# packages in the format:
+# ${name}=${version}(:${PKGORIGIN})
+#
+# Targets:
+#
+# makenuget This target will output the NUGET_DEPENDS based on the
+# port's packages.config file.
+#
+# Variables overrideable by the port:
+#
+# NUGET_PACKAGEDIR The directory in which the port expects the
+# nuget packages to be available
+# default: ${WRKSRC}/packages
.if !defined(_INCLUDE_USES_MONO_MK)
_INCLUDE_USES_MONO_MK= yes
-.if !empty(mono_ARGS)
-IGNORE= USES=mono takes no arguments
+.if !empty(mono_ARGS:Nnuget)
+IGNORE= USES=mono only supports an optional nuget argument
.endif
# Set the location of the .wapi directory so we write to a location we
@@ -30,4 +50,52 @@ GACUTIL=${LOCALBASE}/bin/gacutil /root ${PREFIX}/lib/ /gacdir ${PREFIX}/lib
GACUTIL_INSTALL=${GACUTIL} /i
GACUTIL_INSTALL_PACKAGE=${GACUTIL} /i /package 1.0 /package 2.0
+.if ${mono_ARGS:Mnuget}
+NUGET_PACKAGEDIR= ${WRKSRC}/packages
+
+. for depend in ${NUGET_DEPENDS}
+id= ${depend:C/=.*$//}
+version= ${depend:C/^.*=//}
+group= nuget_${id:S/.//g:S/-//g}
+nupkg= ${id:tl}.${version}.nupkg
+NUPKG_${group}:= ${nupkg}
+DISTFILES_${group}:= ${nupkg}:${group}
+MASTER_SITES_${group}:= https://www.nuget.org/api/v2/package/${id}/${version}?dummy=/:${group}
+NUGET_NUPKGS_${group}:= ${nupkg}:${depend}
+
+NUGET_DISTFILES+=${NUPKG_nuget_${depend:C/=.*$//:S/.//g:S/-//g}}
+DISTFILES+= ${DISTFILES_nuget_${depend:C/=.*$//:S/.//g:S/-//g}}
+MASTER_SITES+= ${MASTER_SITES_nuget_${depend:C/=.*$//:S/.//g:S/-//g}}
+NUGET_NUPKGS+= ${NUGET_NUPKGS_nuget_${depend:C/=.*$//:S/.//g:S/-//g}}
+. endfor
+
+# Prevent the nuget packages from being extracted (and poluting ${WRKDIR}, however
+# only bmake supports this.
+. if !defined(EXTRACT_ONLY) && defined(.PARSEDIR)
+EXTRACT_ONLY= ${_DISTFILES:[0]:C/${NUGET_DISTFILES}//g}
+. endif
+
+_USES_extract+= 900:nuget-extract
+nuget-extract:
+. for nupkg in ${NUGET_NUPKGS}
+ @${MKDIR} ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./}
+ @${LN} -s ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./} ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*//}
+ @tar -xf ${DISTDIR}/${nupkg:C/:.*$//} -C ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./} \
+ -s/%2B/\+/g -s/%2B/\+/g -s/%2B/\+/g \
+ --exclude '\[Content_Types\].xml' \
+ --exclude package/ \
+ --exclude _rels/
+. endfor
.endif
+
+makenuget: patch
+ @${FIND} ${WRKSRC} -name packages.config | \
+ ${XARGS} ${SED} -nE 's|.*<package id="([^"]+)" version="([^"]+)"[^/]*/>.*|\1-\2|gp' | \
+ ${SORT} -u | \
+ ${SED} \
+ -e '1s|^|NUGET_DEPENDS= |' \
+ -e '2,$$s|^| |g' \
+ -e '$$!s|$$| \\|g'
+
+.endif
+