4 class NuGetBinary (Package
):
7 Package
.__init
__(self
, name
='NuGet', version
='5.0.2', sources
=[
8 'https://dist.nuget.org/win-x86-commandline/v%{version}/nuget.exe'])
14 source
= os
.path
.join(self
.workspace
, 'nuget.exe')
15 target
= os
.path
.join(self
.staged_prefix
, 'lib/mono/nuget/nuget.exe')
16 ensure_dir(os
.path
.dirname(target
))
17 shutil
.move(source
, target
)
19 launcher
= os
.path
.join(self
.staged_prefix
, "bin/nuget")
20 ensure_dir(os
.path
.dirname(launcher
))
21 with
open(launcher
, "w") as output
:
22 output
.write("#!/bin/sh\n")
24 'exec {0}/bin/mono $MONO_OPTIONS {1} "$@"\n'.format(self
.staged_prefix
, target
))
25 os
.chmod(launcher
, 0o755)