buildDotnetPackage: rename baseName to pname

This commit is contained in:
Felix Buehler 2021-11-08 17:12:26 +01:00
parent e2b2136d63
commit 989e950f48
8 changed files with 40 additions and 40 deletions

View File

@ -10,7 +10,7 @@ let
mono-addins = dotnetPackages.MonoAddins; mono-addins = dotnetPackages.MonoAddins;
in in
buildDotnetPackage rec { buildDotnetPackage rec {
baseName = "Pinta"; pname = "Pinta";
version = "1.7.1"; version = "1.7.1";
outputFiles = [ "bin/*" ]; outputFiles = [ "bin/*" ];

View File

@ -2,7 +2,7 @@
unzip, icoutils, gtk2, xorg, xdotool, xsel, coreutils, unixtools, glib, plugins ? [] }: unzip, icoutils, gtk2, xorg, xdotool, xsel, coreutils, unixtools, glib, plugins ? [] }:
with builtins; buildDotnetPackage rec { with builtins; buildDotnetPackage rec {
baseName = "keepass"; pname = "keepass";
version = "2.49"; version = "2.49";
src = fetchurl { src = fetchurl {

View File

@ -1,7 +1,7 @@
{ stdenv, lib, makeWrapper, pkg-config, mono, dotnetbuildhelpers }: { stdenv, lib, makeWrapper, pkg-config, mono, dotnetbuildhelpers }:
attrsOrig @ attrsOrig @
{ baseName { pname
, version , version
, nativeBuildInputs ? [] , nativeBuildInputs ? []
, xBuildFiles ? [ ] , xBuildFiles ? [ ]
@ -17,7 +17,7 @@ attrsOrig @
arrayToShell = (a: toString (map (lib.escape (lib.stringToCharacters "\\ ';$`()|<>\t") ) a)); arrayToShell = (a: toString (map (lib.escape (lib.stringToCharacters "\\ ';$`()|<>\t") ) a));
attrs = { attrs = {
name = "${baseName}-${version}"; inherit pname version;
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
@ -64,7 +64,7 @@ attrsOrig @
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
target="$out/lib/dotnet/${baseName}" target="$out/lib/dotnet/${pname}"
mkdir -p "$target" mkdir -p "$target"
cp -rv ${arrayToShell outputFiles} "''${outputFilesArray[@]}" "$target" cp -rv ${arrayToShell outputFiles} "''${outputFilesArray[@]}" "$target"

View File

@ -1,9 +1,9 @@
{ fetchurl, buildDotnetPackage, unzip }: { fetchurl, buildDotnetPackage, unzip }:
attrs @ attrs @
{ baseName { pname
, version , version
, url ? "https://www.nuget.org/api/v2/package/${baseName}/${version}" , url ? "https://www.nuget.org/api/v2/package/${pname}/${version}"
, sha256 ? "" , sha256 ? ""
, md5 ? "" , md5 ? ""
, ... , ...
@ -14,7 +14,7 @@ else
buildDotnetPackage ({ buildDotnetPackage ({
src = fetchurl { src = fetchurl {
inherit url sha256; inherit url sha256;
name = "${baseName}.${version}.zip"; name = "${pname}.${version}.zip";
}; };
sourceRoot = "."; sourceRoot = ".";

View File

@ -17,7 +17,7 @@ while read pkg_spec; do
sed -nE 's/.*<id>([^<]*).*/\1/p; s/.*<version>([^<+]*).*/\1/p' "$pkg_spec") sed -nE 's/.*<id>([^<]*).*/\1/p; s/.*<version>([^<+]*).*/\1/p' "$pkg_spec")
pkg_sha256="$(nix-hash --type sha256 --flat --base32 "$(dirname "$pkg_spec")"/*.nupkg)" pkg_sha256="$(nix-hash --type sha256 --flat --base32 "$(dirname "$pkg_spec")"/*.nupkg)"
echo " (fetchNuGet { name = \"$pkg_name\"; version = \"$pkg_version\"; sha256 = \"$pkg_sha256\"; })" echo " (fetchNuGet { pname = \"$pkg_name\"; version = \"$pkg_version\"; sha256 = \"$pkg_sha256\"; })"
done < <(find $1 -name '*.nuspec' | sort) done < <(find $1 -name '*.nuspec' | sort)
echo "]" echo "]"

View File

@ -16,19 +16,19 @@ let
dotnetPkgs = [ dotnetPkgs = [
(fetchNuGet { (fetchNuGet {
baseName = "UnmanagedExports"; pname = "UnmanagedExports";
version = "1.2.7"; version = "1.2.7";
sha256 = "0bfrhpmq556p0swd9ssapw4f2aafmgp930jgf00sy89hzg2bfijf"; sha256 = "0bfrhpmq556p0swd9ssapw4f2aafmgp930jgf00sy89hzg2bfijf";
outputFiles = [ "*" ]; outputFiles = [ "*" ];
}) })
(fetchNuGet { (fetchNuGet {
baseName = "NUnit"; pname = "NUnit";
version = "3.12.0"; version = "3.12.0";
sha256 = "1880j2xwavi8f28vxan3hyvdnph4nlh5sbmh285s4lc9l0b7bdk2"; sha256 = "1880j2xwavi8f28vxan3hyvdnph4nlh5sbmh285s4lc9l0b7bdk2";
outputFiles = [ "*" ]; outputFiles = [ "*" ];
}) })
(fetchNuGet { (fetchNuGet {
baseName = "System.ValueTuple"; pname = "System.ValueTuple";
version = "4.5.0"; version = "4.5.0";
sha256 = "00k8ja51d0f9wrq4vv5z2jhq8hy31kac2rg0rv06prylcybzl8cy"; sha256 = "00k8ja51d0f9wrq4vv5z2jhq8hy31kac2rg0rv06prylcybzl8cy";
outputFiles = [ "*" ]; outputFiles = [ "*" ];
@ -82,7 +82,7 @@ buildPythonPackage rec {
${builtins.concatStringsSep "\n" ( ${builtins.concatStringsSep "\n" (
builtins.map ( builtins.map (
x: ''ln -s ${x}/lib/dotnet/${x.baseName} ./packages/${x.baseName}.${x.version}'' x: ''ln -s ${x}/lib/dotnet/${x.pname} ./packages/${x.pname}.${x.version}''
) dotnetPkgs)} ) dotnetPkgs)}
# Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542 # Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542

View File

@ -1,7 +1,7 @@
{ lib, fetchFromGitHub, buildDotnetPackage }: { lib, fetchFromGitHub, buildDotnetPackage }:
buildDotnetPackage { buildDotnetPackage {
baseName = "pash"; pname = "pash";
version = "git-2016-07-06"; version = "git-2016-07-06";
src = fetchFromGitHub { src = fetchFromGitHub {

View File

@ -15,14 +15,14 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
# BINARY PACKAGES # BINARY PACKAGES
NUnit3 = fetchNuGet { NUnit3 = fetchNuGet {
baseName = "NUnit"; pname = "NUnit";
version = "3.0.1"; version = "3.0.1";
sha256 = "1g3j3kvg9vrapb1vjgq65nvn1vg7bzm66w7yjnaip1iww1yn1b0p"; sha256 = "1g3j3kvg9vrapb1vjgq65nvn1vg7bzm66w7yjnaip1iww1yn1b0p";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
NUnit2 = fetchNuGet { NUnit2 = fetchNuGet {
baseName = "NUnit"; pname = "NUnit";
version = "2.6.4"; version = "2.6.4";
sha256 = "1acwsm7p93b1hzfb83ia33145x0w6fvdsfjm9xflsisljxpdx35y"; sha256 = "1acwsm7p93b1hzfb83ia33145x0w6fvdsfjm9xflsisljxpdx35y";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
@ -31,91 +31,91 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
NUnit = NUnit2; NUnit = NUnit2;
NUnitConsole = fetchNuGet { NUnitConsole = fetchNuGet {
baseName = "NUnit.Console"; pname = "NUnit.Console";
version = "3.0.1"; version = "3.0.1";
sha256 = "154bqwm2n95syv8nwd67qh8qsv0b0h5zap60sk64z3kd3a9ffi5p"; sha256 = "154bqwm2n95syv8nwd67qh8qsv0b0h5zap60sk64z3kd3a9ffi5p";
outputFiles = [ "tools/*" ]; outputFiles = [ "tools/*" ];
}; };
MaxMindDb = fetchNuGet { MaxMindDb = fetchNuGet {
baseName = "MaxMind.Db"; pname = "MaxMind.Db";
version = "1.1.0.0"; version = "1.1.0.0";
sha256 = "0lixl76f7k3ldiqzg94zh13gn82w5mm5dx72y97fcqvp8g6nj3ds"; sha256 = "0lixl76f7k3ldiqzg94zh13gn82w5mm5dx72y97fcqvp8g6nj3ds";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
MaxMindGeoIP2 = fetchNuGet { MaxMindGeoIP2 = fetchNuGet {
baseName = "MaxMind.GeoIP2"; pname = "MaxMind.GeoIP2";
version = "2.3.1"; version = "2.3.1";
sha256 = "1s44dvjnmj1aimbrgkmpj6h5dn1w6acgqjch1axc76yz6hwknqgf"; sha256 = "1s44dvjnmj1aimbrgkmpj6h5dn1w6acgqjch1axc76yz6hwknqgf";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
SharpZipLib = fetchNuGet { SharpZipLib = fetchNuGet {
baseName = "SharpZipLib"; pname = "SharpZipLib";
version = "0.86.0"; version = "0.86.0";
sha256 = "01w2038gckfnq31pncrlgm7d0c939pwr1x4jj5450vcqpd4c41jr"; sha256 = "01w2038gckfnq31pncrlgm7d0c939pwr1x4jj5450vcqpd4c41jr";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
StyleCopMSBuild = fetchNuGet { StyleCopMSBuild = fetchNuGet {
baseName = "StyleCop.MSBuild"; pname = "StyleCop.MSBuild";
version = "4.7.49.0"; version = "4.7.49.0";
sha256 = "0rpfyvcggm881ynvgr17kbx5hvj7ivlms0bmskmb2zyjlpddx036"; sha256 = "0rpfyvcggm881ynvgr17kbx5hvj7ivlms0bmskmb2zyjlpddx036";
outputFiles = [ "tools/*" ]; outputFiles = [ "tools/*" ];
}; };
StyleCopPlusMSBuild = fetchNuGet { StyleCopPlusMSBuild = fetchNuGet {
baseName = "StyleCopPlus.MSBuild"; pname = "StyleCopPlus.MSBuild";
version = "4.7.49.5"; version = "4.7.49.5";
sha256 = "1hv4lfxw72aql8siyqc4n954vzdz8p6jx9f2wrgzz0jy1k98x2mr"; sha256 = "1hv4lfxw72aql8siyqc4n954vzdz8p6jx9f2wrgzz0jy1k98x2mr";
outputFiles = [ "tools/*" ]; outputFiles = [ "tools/*" ];
}; };
RestSharp = fetchNuGet { RestSharp = fetchNuGet {
baseName = "RestSharp"; pname = "RestSharp";
version = "105.2.3"; version = "105.2.3";
sha256 = "1br48124ppz80x92m84sfyil1gn23hxg2ml9i9hsd0lp86vlaa1m"; sha256 = "1br48124ppz80x92m84sfyil1gn23hxg2ml9i9hsd0lp86vlaa1m";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
SharpFont = fetchNuGet { SharpFont = fetchNuGet {
baseName = "SharpFont"; pname = "SharpFont";
version = "4.0.1"; version = "4.0.1";
sha256 = "1yd3cm4ww0hw2k3aymf792hp6skyg8qn491m2a3fhkzvsl8z7vs8"; sha256 = "1yd3cm4ww0hw2k3aymf792hp6skyg8qn491m2a3fhkzvsl8z7vs8";
outputFiles = [ "lib/*" "config/*" ]; outputFiles = [ "lib/*" "config/*" ];
}; };
SmartIrc4net = fetchNuGet { SmartIrc4net = fetchNuGet {
baseName = "SmartIrc4net"; pname = "SmartIrc4net";
version = "0.4.5.1"; version = "0.4.5.1";
sha256 = "1d531sj39fvwmj2wgplqfify301y3cwp7kwr9ai5hgrq81jmjn2b"; sha256 = "1d531sj39fvwmj2wgplqfify301y3cwp7kwr9ai5hgrq81jmjn2b";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
FuzzyLogicLibrary = fetchNuGet { FuzzyLogicLibrary = fetchNuGet {
baseName = "FuzzyLogicLibrary"; pname = "FuzzyLogicLibrary";
version = "1.2.0"; version = "1.2.0";
sha256 = "0x518i8d3rw9n51xwawa4sywvqd722adj7kpcgcm63r66s950r5l"; sha256 = "0x518i8d3rw9n51xwawa4sywvqd722adj7kpcgcm63r66s950r5l";
outputFiles = [ "bin/*" ]; outputFiles = [ "bin/*" ];
}; };
OpenNAT = fetchNuGet { OpenNAT = fetchNuGet {
baseName = "Open.NAT"; pname = "Open.NAT";
version = "2.1.0"; version = "2.1.0";
sha256 = "1jyd30fwycdwx5ck96zhp2xf20yz0sp7g3pjbqhmay4kd322mfwk"; sha256 = "1jyd30fwycdwx5ck96zhp2xf20yz0sp7g3pjbqhmay4kd322mfwk";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
MonoNat = fetchNuGet { MonoNat = fetchNuGet {
baseName = "Mono.Nat"; pname = "Mono.Nat";
version = "1.2.24"; version = "1.2.24";
sha256 = "0vfkach11kkcd9rcqz3s38m70d5spyb21gl99iqnkljxj5555wjs"; sha256 = "0vfkach11kkcd9rcqz3s38m70d5spyb21gl99iqnkljxj5555wjs";
outputFiles = [ "lib/*" ]; outputFiles = [ "lib/*" ];
}; };
NUnitRunners = fetchNuGet { NUnitRunners = fetchNuGet {
baseName = "NUnit.Runners"; pname = "NUnit.Runners";
version = "2.6.4"; version = "2.6.4";
sha256 = "11nmi7vikn9idz8qcad9z7f73arsh5rw18fc1sri9ywz77mpm1s4"; sha256 = "11nmi7vikn9idz8qcad9z7f73arsh5rw18fc1sri9ywz77mpm1s4";
outputFiles = [ "tools/*" ]; outputFiles = [ "tools/*" ];
@ -125,7 +125,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
# SOURCE PACKAGES # SOURCE PACKAGES
Boogie = buildDotnetPackage rec { Boogie = buildDotnetPackage rec {
baseName = "Boogie"; pname = "Boogie";
version = "2.4.1"; version = "2.4.1";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -152,8 +152,8 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
outputFiles = [ "Binaries/*" ]; outputFiles = [ "Binaries/*" ];
postInstall = '' postInstall = ''
mkdir -pv "$out/lib/dotnet/${baseName}" mkdir -pv "$out/lib/dotnet/${pname}"
ln -sv "${pkgs.z3}/bin/z3" "$out/lib/dotnet/${baseName}/z3.exe" ln -sv "${pkgs.z3}/bin/z3" "$out/lib/dotnet/${pname}/z3.exe"
# so that this derivation can be used as a vim plugin to install syntax highlighting # so that this derivation can be used as a vim plugin to install syntax highlighting
vimdir=$out/share/vim-plugins/boogie vimdir=$out/share/vim-plugins/boogie
@ -194,7 +194,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
}); });
Boogie = assert self'.Boogie.version == "2.4.1"; self'.Boogie; Boogie = assert self'.Boogie.version == "2.4.1"; self'.Boogie;
in buildDotnetPackage rec { in buildDotnetPackage rec {
baseName = "Dafny"; pname = "Dafny";
version = "2.3.0"; version = "2.3.0";
src = fetchurl { src = fetchurl {
@ -229,11 +229,11 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
# Boogie as an input is not enough. Boogie libraries need to be at the same # Boogie as an input is not enough. Boogie libraries need to be at the same
# place as Dafny ones. Same for "*.dll.mdb". No idea why or how to fix. # place as Dafny ones. Same for "*.dll.mdb". No idea why or how to fix.
postFixup = '' postFixup = ''
for lib in ${Boogie}/lib/dotnet/${Boogie.baseName}/*.dll{,.mdb}; do for lib in ${Boogie}/lib/dotnet/${Boogie.pname}/*.dll{,.mdb}; do
ln -s $lib $out/lib/dotnet/${baseName}/ ln -s $lib $out/lib/dotnet/${pname}/
done done
# We generate our own executable scripts # We generate our own executable scripts
rm -f $out/lib/dotnet/${baseName}/dafny{,-server} rm -f $out/lib/dotnet/${pname}/dafny{,-server}
''; '';
meta = with lib; { meta = with lib; {
@ -246,7 +246,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
}; };
MonoAddins = buildDotnetPackage rec { MonoAddins = buildDotnetPackage rec {
baseName = "Mono.Addins"; pname = "Mono.Addins";
version = "1.2"; version = "1.2";
xBuildFiles = [ xBuildFiles = [
@ -278,14 +278,14 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
}; };
NewtonsoftJson = fetchNuGet { NewtonsoftJson = fetchNuGet {
baseName = "Newtonsoft.Json"; pname = "Newtonsoft.Json";
version = "11.0.2"; version = "11.0.2";
sha256 = "07na27n4mlw77f3hg5jpayzxll7f4gyna6x7k9cybmxpbs6l77k7"; sha256 = "07na27n4mlw77f3hg5jpayzxll7f4gyna6x7k9cybmxpbs6l77k7";
outputFiles = [ "*" ]; outputFiles = [ "*" ];
}; };
Nuget = buildDotnetPackage rec { Nuget = buildDotnetPackage rec {
baseName = "Nuget"; pname = "Nuget";
version = "5.6.0.6489"; version = "5.6.0.6489";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -306,7 +306,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; {
}; };
Paket = fetchNuGet { Paket = fetchNuGet {
baseName = "Paket"; pname = "Paket";
version = "5.179.1"; version = "5.179.1";
sha256 = "11rzna03i145qj08hwrynya548fwk8xzxmg65swyaf19jd7gzg82"; sha256 = "11rzna03i145qj08hwrynya548fwk8xzxmg65swyaf19jd7gzg82";
outputFiles = [ "*" ]; outputFiles = [ "*" ];