diff options
author | dbn <dbn@FreeBSD.org> | 2018-01-31 03:00:27 +0800 |
---|---|---|
committer | Koop Mast <kwm@rainbow-runner.nl> | 2018-02-04 06:32:05 +0800 |
commit | 69a47a038b374d9a1f4f1dea489133142b82f59c (patch) | |
tree | 975a38778f52b224e5f52adf8f2f888ebf7b4753 /Mk/Uses | |
parent | cf1b43c245df68612adf7c0b2f67f4095613b132 (diff) | |
download | freebsd-ports-gnome-69a47a038b374d9a1f4f1dea489133142b82f59c.tar.gz freebsd-ports-gnome-69a47a038b374d9a1f4f1dea489133142b82f59c.tar.zst freebsd-ports-gnome-69a47a038b374d9a1f4f1dea489133142b82f59c.zip |
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
Diffstat (limited to 'Mk/Uses')
-rw-r--r-- | Mk/Uses/mono.mk | 124 |
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 - |