2018-07-21 02:44:44 +02:00
|
|
|
{ fetchurl, buildDotnetPackage, unzip }:
|
2015-05-22 15:25:02 +02:00
|
|
|
|
|
|
|
attrs @
|
2021-11-08 17:12:26 +01:00
|
|
|
{ pname
|
2015-05-22 15:25:02 +02:00
|
|
|
, version
|
2021-11-08 17:12:26 +01:00
|
|
|
, url ? "https://www.nuget.org/api/v2/package/${pname}/${version}"
|
2015-05-22 15:25:02 +02:00
|
|
|
, sha256 ? ""
|
|
|
|
, md5 ? ""
|
|
|
|
, ...
|
|
|
|
}:
|
2017-03-13 13:31:44 +01:00
|
|
|
if md5 != "" then
|
|
|
|
throw "fetchnuget does not support md5 anymore, please use sha256"
|
|
|
|
else
|
2015-05-22 15:25:02 +02:00
|
|
|
buildDotnetPackage ({
|
|
|
|
src = fetchurl {
|
2017-03-13 13:31:44 +01:00
|
|
|
inherit url sha256;
|
2021-11-08 17:12:26 +01:00
|
|
|
name = "${pname}.${version}.zip";
|
2015-05-22 15:25:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2021-02-20 22:01:53 +01:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2015-05-22 15:25:02 +02:00
|
|
|
|
2015-06-12 17:13:21 +02:00
|
|
|
dontBuild = true;
|
2015-05-22 15:25:02 +02:00
|
|
|
|
|
|
|
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)
|