Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildDotnetPackage/fetchNuGet: use pname instead of name and baseName #145090

Merged
merged 2 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
838 changes: 419 additions & 419 deletions pkgs/applications/blockchains/btcpayserver/deps.nix

Large diffs are not rendered by default.

432 changes: 216 additions & 216 deletions pkgs/applications/blockchains/nbxplorer/deps.nix

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkgs/applications/blockchains/nbxplorer/util/create-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ HOME=home DOTNET_CLI_TELEMETRY_OPTOUT=1 \

echo "{ fetchNuGet }: [" > "$depsFile"
while read pkgSpec; do
{ read name; read version; } < <(
{ read pname; read version; } < <(
# Ignore build version part: 1.0.0-beta2+77df2220 -> 1.0.0-beta2
sed -nE 's/.*<id>([^<]*).*/\1/p; s/.*<version>([^<+]*).*/\1/p' "$pkgSpec"
)
sha256=$(nix-hash --type sha256 --flat --base32 "$(dirname "$pkgSpec")"/*.nupkg)
cat >> "$depsFile" <<EOF
(fetchNuGet {
name = "$name";
pname = "$pname";
version = "$version";
sha256 = "$sha256";
})
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/graphics/pinta/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let
mono-addins = dotnetPackages.MonoAddins;
in
buildDotnetPackage rec {
baseName = "Pinta";
pname = "Pinta";
version = "1.7.1";

outputFiles = [ "bin/*" ];
Expand Down
578 changes: 289 additions & 289 deletions pkgs/applications/misc/ArchiSteamFarm/deps.nix

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkgs/applications/misc/keepass/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
unzip, icoutils, gtk2, xorg, xdotool, xsel, coreutils, unixtools, glib, plugins ? [] }:

with builtins; buildDotnetPackage rec {
baseName = "keepass";
pname = "keepass";
version = "2.49";

src = fetchurl {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/build-support/build-dotnet-module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ assert nugetDeps == null -> throw "Defining the `nugetDeps` attribute is require

let
_nugetDeps = linkFarmFromDrvs "${name}-nuget-deps" (import nugetDeps {
fetchNuGet = { name, version, sha256 }: fetchurl {
name = "nuget-${name}-${version}.nupkg";
url = "https://www.nuget.org/api/v2/package/${name}/${version}";
fetchNuGet = { pname, version, sha256 }: fetchurl {
name = "${pname}-${version}.nupkg";
url = "https://www.nuget.org/api/v2/package/${pname}/${version}";
inherit sha256;
};
});
Expand Down
6 changes: 3 additions & 3 deletions pkgs/build-support/build-dotnet-package/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv, lib, makeWrapper, pkg-config, mono, dotnetbuildhelpers }:

attrsOrig @
{ baseName
{ pname
, version
, nativeBuildInputs ? []
, xBuildFiles ? [ ]
Expand All @@ -17,7 +17,7 @@ attrsOrig @
arrayToShell = (a: toString (map (lib.escape (lib.stringToCharacters "\\ ';$`()|<>\t") ) a));

attrs = {
name = "${baseName}-${version}";
inherit pname version;

nativeBuildInputs = [
pkg-config
Expand Down Expand Up @@ -64,7 +64,7 @@ attrsOrig @
installPhase = ''
runHook preInstall

target="$out/lib/dotnet/${baseName}"
target="$out/lib/dotnet/${pname}"
mkdir -p "$target"

cp -rv ${arrayToShell outputFiles} "''${outputFilesArray[@]}" "$target"
Expand Down
6 changes: 3 additions & 3 deletions pkgs/build-support/fetchnuget/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ fetchurl, buildDotnetPackage, unzip }:

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

sourceRoot = ".";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/nuget-to-nix/nuget-to-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ while read pkg_spec; do
sed -nE 's/.*<id>([^<]*).*/\1/p; s/.*<version>([^<+]*).*/\1/p' "$pkg_spec")
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)

echo "]"
238 changes: 119 additions & 119 deletions pkgs/development/dotnet-modules/python-language-server/deps.nix

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkgs/development/python-modules/pythonnet/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ let

dotnetPkgs = [
(fetchNuGet {
baseName = "UnmanagedExports";
pname = "UnmanagedExports";
version = "1.2.7";
sha256 = "0bfrhpmq556p0swd9ssapw4f2aafmgp930jgf00sy89hzg2bfijf";
outputFiles = [ "*" ];
})
(fetchNuGet {
baseName = "NUnit";
pname = "NUnit";
version = "3.12.0";
sha256 = "1880j2xwavi8f28vxan3hyvdnph4nlh5sbmh285s4lc9l0b7bdk2";
outputFiles = [ "*" ];
})
(fetchNuGet {
baseName = "System.ValueTuple";
pname = "System.ValueTuple";
version = "4.5.0";
sha256 = "00k8ja51d0f9wrq4vv5z2jhq8hy31kac2rg0rv06prylcybzl8cy";
outputFiles = [ "*" ];
Expand Down Expand Up @@ -82,7 +82,7 @@ buildPythonPackage rec {

${builtins.concatStringsSep "\n" (
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)}

# Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542
Expand Down
164 changes: 82 additions & 82 deletions pkgs/development/tools/misc/netcoredbg/deps.nix

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkgs/games/osu-lazer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ in stdenv.mkDerivation rec {
];

nugetDeps = linkFarmFromDrvs "${pname}-nuget-deps" (import ./deps.nix {
fetchNuGet = { name, version, sha256 }: fetchurl {
name = "nuget-${name}-${version}.nupkg";
url = "https://www.nuget.org/api/v2/package/${name}/${version}";
fetchNuGet = { pname, version, sha256 }: fetchurl {
name = "${pname}-${version}.nupkg";
url = "https://www.nuget.org/api/v2/package/${pname}/${version}";
inherit sha256;
};
});
Expand Down
Loading