summaryrefslogtreecommitdiff
path: root/Mk/Uses/mono.mk
diff options
context:
space:
mode:
authorDavid Naylor <dbn@FreeBSD.org>2018-01-30 19:00:27 +0000
committerDavid Naylor <dbn@FreeBSD.org>2018-01-30 19:00:27 +0000
commit1da3310ac13117c3e66501d672446b7eb0e2d670 (patch)
treef565b3312e4715c9ab2c5543a2fb9b40d667713b /Mk/Uses/mono.mk
parent- Update to 1.8.0 (diff)
lang/mono: update to version 5.2.0.215 (and enhance USES=mono)
Highlights: - New Roslyn compiler for C# available - Improved support for nuget packages in USES=mono General: - fix pkg-plist: mono now produces '.pdb' debug files instead of '.mdb' - bump all dependant ports USES=mono: - properly handle caching of nuget packages - add support for multiple feeds for nuget packages - add support for nuget dependencies in a separate file - add support for paket packages lang/mono: - update to version 5.2.0.215 - automate certificate initialisation [2] - increase test coverage - mark as conflicting with net/czmq (conflicting on makecert) [1] - patch mono to use $PREFIX/share/mono instead of /usr/share/.mono devel/google-gdata: - use nunit.framework nuget package as the Mono shipped version is no longer suppport. - switch to using csc(1) for compiling (mcs(1) is depreciated). - use delayed signing (and then sign with sn(1)) as csc(1) does not support signing. - fix reference to system assemblies (the '.dll' suffix is required). - fix reference to HttpUtility: csc(1) is more strict about scoping devel/monodevelop: - reroll distinfo (no changes to content) lang/fsharp: - reroll distinfo (no changes to content) security/gnome-keyring-sharp: - delay sign (then sign with sn(1)) as csc(1) does not support direct signing. PR: 223188 [1] PR: 209670 [2] Differential Revision: https://reviews.freebsd.org/D13752
Notes
Notes: svn path=/head/; revision=460430
Diffstat (limited to 'Mk/Uses/mono.mk')
-rw-r--r--Mk/Uses/mono.mk124
1 files changed, 105 insertions, 19 deletions
diff --git a/Mk/Uses/mono.mk b/Mk/Uses/mono.mk
index 2a790410ddef..d529e9e639ca 100644
--- a/Mk/Uses/mono.mk
+++ b/Mk/Uses/mono.mk
@@ -10,11 +10,7 @@
#
# 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})
+# nuget Specifies that the port uses nuget packages.
#
# EXTRACT_ONLY is conditionally overridden to exclude all
# files with a '.nupkg' extension.
@@ -29,6 +25,31 @@
# NUGET_PACKAGEDIR The directory in which the port expects the
# nuget packages to be available
# default: ${WRKSRC}/packages
+#
+# NUGET_FEEDS A list of nuget feed names
+# default: NUGET
+#
+# ${NAME}_URL: The base URL for the feed ${NAME}
+# defaults:
+# NUGET_URL=https://www.nuget.org/api/v2/
+#
+# ${NAME}_FILE: The file containing a list of nuget packages from
+# feed ${NAME} in the format:
+# ${name}=${version}
+#
+# ${NAME}_DEPENDS: The list of nuget packages from feed ${NAME} in the
+# format:
+# ${name}=${version}
+# defaults:
+# NUGET_DEPENDS=${PAKET_DEPENDS}
+#
+# PAKET_PACKAGEDIR The directory in which the port expects the
+# nuget packages (managed by paket) to be available
+#
+# PAKET_DEPENDS The list of nuget packages from a nuget feed. The
+# version used needs to be resolved (unlike how paket
+# works). The format is:
+# ${name}=${version}
.if !defined(_INCLUDE_USES_MONO_MK)
_INCLUDE_USES_MONO_MK= yes
@@ -54,37 +75,84 @@ GACUTIL_INSTALL=${GACUTIL} /i
GACUTIL_INSTALL_PACKAGE=${GACUTIL} /i /package 1.0 /package 2.0
.if ${mono_ARGS:Mnuget}
+MAKE_ENV+= NUGET_PACKAGES=${NUGET_PACKAGEDIR}
+
+# TODO: add nuget as a Port, use it for makenupkg
+NUGET_EXE?= ${WRKSRC}/external/nuget-binary/nuget.exe
+
+_NUGET_PACKAGEDIR= ${WRKDIR}/.nuget/packages
NUGET_PACKAGEDIR?= ${WRKSRC}/packages
+NUGET_FEEDS?= NUGET
+NUGET_URL?= https://www.nuget.org/api/v2/
+
+PAKET_PACKAGEDIR?=
+PAKET_DEPENDS?=
+NUGET_DEPENDS?= ${PAKET_DEPENDS}
-. for depend in ${NUGET_DEPENDS}
+. for feed in ${NUGET_FEEDS}
+${feed}_DEPENDS?=
+${feed}_FILE?= ${PKGDIR}/nupkg-${feed:tl}
+. if exists(${${feed}_FILE})
+${feed}_EXTRA!= ${CAT} ${${feed}_FILE}
+. else
+${feed}_EXTRA=
+. endif
+. for depend in ${${feed}_DEPENDS} ${${feed}_EXTRA}
+. if empty(_NUGET_DEPENDS:M${depend})
id= ${depend:C/=.*$//}
version= ${depend:C/^.*=//}
-group= nuget_${id:S/.//g:S/-//g}
+group= nuget_${depend:S/.//g:S/-//g: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}
+MASTER_SITES_${group}:= ${${feed}_URL}package/${id}/${version}?dummy=/:${group}
NUGET_NUPKGS_${group}:= ${nupkg}:${depend}
+NUPKGS_${id}:= ${NUPKGS_${id}} ${version}
-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}}
+DISTFILES+= ${DISTFILES_nuget_${depend:S/.//g:S/-//g:S/=//g}}
+MASTER_SITES+= ${MASTER_SITES_nuget_${depend:S/.//g:S/-//g:S/=//g}}
+NUGET_NUPKGS+= ${NUGET_NUPKGS_nuget_${depend:S/.//g:S/-//g:S/=//g}}
+_NUGET_DEPENDS+= ${depend}
+. endif
. endfor
+. endfor
EXTRACT_ONLY?= ${_DISTFILES:N*.nupkg}
_USES_extract+= 600:nuget-extract
nuget-extract:
-. for nupkg in ${NUGET_NUPKGS}
- @${MKDIR} ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./}
- @${RM} -f ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*//}
- @${LN} -s ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./} ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*//}
- @tar -xf ${DISTDIR}/${nupkg:C/:.*$//} -C ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./} \
+ @${MKDIR} ${_NUGET_PACKAGEDIR} ${PAKET_PACKAGEDIR}
+. for nupkg in ${NUGET_NUPKGS}
+. if !empty(NUPKGS_${nupkg:C/^.*://:C/=.*//}:[2])
+ @${MKDIR} ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}
+. else
+ @${MKDIR} ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*//}
+ @${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*//} ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}
+. endif
+ @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/
- @${CP} ${DISTDIR}/${nupkg:C/:.*$//} ${NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./}/${nupkg:C/^.*://:S/=/./}.nupkg
-. endfor
+ @${CP} ${DISTDIR}/${nupkg:C/:.*$//} ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:S/=/./}.nupkg
+ @openssl dgst -sha512 -binary ${DISTDIR}/${nupkg:C/:.*$//} | openssl enc -base64 | ${TR} -d "\n" \
+ > ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:S/=/./}.nupkg.sha512
+ @${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|} ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./}
+. if ${nupkg:C/^.*://:tl} != ${nupkg:C/^.*://}
+ @${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:C/=.*$//}.nuspec ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:C/=.*$//:tl}.nuspec
+ @${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:S/=/./}.nupkg ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:S/=/./:tl}.nupkg
+ @${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:S/=/./}.nupkg.sha512 ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|}/${nupkg:C/^.*://:S/=/./:tl}.nupkg.sha512
+ @${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S|=|/|} ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:S/=/./:tl}
+ @[ -e ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*$//:tl} ] || ${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*$//} ${_NUGET_PACKAGEDIR}/${nupkg:C/^.*://:C/=.*$//:tl}
+. endif
+. endfor
+ @${LN} -s ${_NUGET_PACKAGEDIR} ${NUGET_PACKAGEDIR}
+ @${TOUCH} ${WRKDIR}/.nuget-sentinal
+
+_USES_extract+= 601:paket-extract
+paket-extract:
+. for nupkg in ${PAKET_DEPENDS}
+ @${LN} -s ${_NUGET_PACKAGEDIR}/${nupkg:S|=|/|} ${PAKET_PACKAGEDIR}/${nupkg:C/=.*$//}
+. endfor
.endif
makenuget: patch
@@ -96,5 +164,23 @@ makenuget: patch
-e '2,$$s|^| |g' \
-e '$$!s|$$| \\|g'
+makenupkg:
+.for feed in ${NUGET_FEEDS}
+ @[ -f ${WRKDIR}/.nupkg-${feed:tl} ] || mono ${NUGET_EXE} list -IncludeDelisted -PreRelease -Source ${${feed}_URL} | ${SED} 's/ .*//g' > ${WRKDIR}/.nupkg-${feed:tl}
+ @${RM} ${WRKDIR}/nupkg-${feed:tl}
+.endfor
+ @for nupkg in `${FIND} ${_NUGET_PACKAGEDIR} -name '*.sha512' | ${SED} 's/\.sha512//g'`; \
+ do \
+ name="`tar -tf $${nupkg} | ${GREP} nuspec | ${SED} 's/.nuspec//g'`"; \
+ version="`${BASENAME} $$(${DIRNAME} $$nupkg)`"; \
+ ${ECHO} "$$name=$${version#$$name.}"; \
+ done | ${SORT} -u > ${WRKDIR}/.nupkgs
+ @${CAT} ${WRKDIR}/.nupkgs | while read nupkg; do \
+ for feed in ${NUGET_FEEDS:tl}; do \
+ if ${GREP} -q "^$${nupkg%%=*}\$$" ${WRKDIR}/.nupkg-$$feed; then \
+ ${ECHO} $$nupkg >> ${WRKDIR}/nupkg-$$feed; \
+ break; \
+ fi; \
+ done; \
+ done
.endif
-