From d4681bf62672083f92545e02e00b8cf040247e8d Mon Sep 17 00:00:00 2001 From: obadz Date: Fri, 22 May 2015 14:25:02 +0100 Subject: Lay down the foundation for packaging the .NET echosystem - fetchNuGet can fetch binaries from nuget servers - buildDotnetPackage can build .NET packages using mono/xbuild - Places nuget & paket as they would clash with nix - Patch project files because F# targets are expected to be found in the mono directory (and we know that's not going to happen on nix) - Find DLLs that were copied from buildInputs and replace by symlink for sharing - Export produced DLL via the pkg-config mechanism - Create wrappers for produced EXEs - Repackaged this new infrastructure: keepass, monodevelop - Newly packaged: ExtCore, UnionArgParser, FSharp.Data, Paket, and a bunch more.. This is a combination of 73 commits. --- pkgs/build-support/fetchnuget/default.nix | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pkgs/build-support/fetchnuget/default.nix (limited to 'pkgs/build-support/fetchnuget/default.nix') diff --git a/pkgs/build-support/fetchnuget/default.nix b/pkgs/build-support/fetchnuget/default.nix new file mode 100644 index 000000000000..803db27c9d56 --- /dev/null +++ b/pkgs/build-support/fetchnuget/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, buildDotnetPackage, unzip }: + +attrs @ +{ baseName +, version +, url ? "https://www.nuget.org/api/v2/package/${baseName}/${version}" +, sha256 ? "" +, md5 ? "" +, ... +}: + buildDotnetPackage ({ + src = fetchurl { + inherit url sha256 md5; + name = "${baseName}.${version}.zip"; + }; + + sourceRoot = "."; + + buildInputs = [ unzip ]; + + phases = [ "unpackPhase" "installPhase" ]; + + preInstall = '' + function traverseRename () { + for e in * + do + t="$(echo "$e" | sed -e "s/%20/\ /g" -e "s/%2B/+/g")" + [ "$t" != "$e" ] && mv -vn "$e" "$t" + if [ -d "$t" ] + then + cd "$t" + traverseRename + cd .. + fi + done + } + + traverseRename + ''; + } // attrs) -- cgit 1.4.1