From: Alexis Christoforides Date: Mon, 22 May 2017 20:04:30 +0000 (-0400) Subject: [MacSDK] Update Nuget to 4.5, switch to binary release instead of building X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=99c93cbe8501428d24a8ce47958fd789ad83156c [MacSDK] Update Nuget to 4.5, switch to binary release instead of building --- diff --git a/packaging/MacSDK/nuget.py b/packaging/MacSDK/nuget.py index 321bedfa12d..a603b1e86ee 100644 --- a/packaging/MacSDK/nuget.py +++ b/packaging/MacSDK/nuget.py @@ -1,18 +1,26 @@ +import fileinput -class NuGetPackage(GitHubPackage): + +class NuGetBinary (Package): def __init__(self): - GitHubPackage.__init__(self, - 'mono', 'nuget', - '2.12.0', - '9e2d2c1cc09d2a40eeb72e8c5db789e3b9bf2586', - configure='') + Package.__init__(self, name='NuGet', version='4.5.0', sources=[ + 'https://dist.nuget.org/win-x86-commandline/v%{version}/NuGet.exe']) def build(self): - self.sh('%{make} update_submodules') - self.sh('%{make} PREFIX=%{package_prefix}') + pass def install(self): - self.sh('%{makeinstall} PREFIX=%{staged_prefix}') + source = os.path.join(self.workspace, 'NuGet.exe') + target = os.path.join(self.staged_prefix, 'lib/mono/nuget/NuGet.exe') + ensure_dir(os.path.dirname(target)) + shutil.move(source, target) -NuGetPackage() + launcher = os.path.join(self.staged_prefix, "bin/nuget") + ensure_dir(os.path.dirname(launcher)) + with open(launcher, "w") as output: + output.write("#!/bin/sh\n") + output.write( + 'exec "{0}/bin/mono" $MONO_OPTIONS "{1}" "$@"\n'.format(self.staged_prefix, target)) + os.chmod(launcher, 0o755) +NuGetBinary()