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

[Backport release-24.05] slskd: 0.21.3 -> 0.21.4 #345785

Merged
Merged
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
92 changes: 52 additions & 40 deletions pkgs/by-name/sl/slskd/package.nix
Original file line number Diff line number Diff line change
@@ -1,70 +1,82 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
dotnetCorePackages,
buildDotnetModule,
buildPackages,
dotnetCorePackages,
fetchFromGitHub,
fetchNpmDeps,
mono,
nodejs_18,
slskd,
testers,
}:

let
nodejs = nodejs_18;
# https://github.com/NixOS/nixpkgs/blob/d88947e91716390bdbefccdf16f7bebcc41436eb/pkgs/build-support/node/build-npm-package/default.nix#L62
npmHooks = buildPackages.npmHooks.override { inherit nodejs; };
in
buildDotnetModule rec {
pname = "slskd";
version = "0.21.3";
version = "0.21.4";

src = fetchFromGitHub {
owner = "slskd";
repo = "slskd";
rev = version;
sha256 = "sha256-qAS8uiXAG0JTOCW/bIVYhv6McUSBihAHFjJu3b5Ttoc=";
rev = "refs/tags/${version}";
hash = "sha256-9EKlCmc+zdiuEPa8YNjoQ3QLTy8vt2qcZ+6D0sWgwEU=";
};

meta = with lib; {
description = "A modern client-server application for the Soulseek file sharing network";
homepage = "https://github.com/slskd/slskd";
license = licenses.agpl3Plus;
maintainers = with maintainers; [
ppom
melvyn2
];
platforms = platforms.linux;
};
nativeBuildInputs = [
nodejs
npmHooks.npmConfigHook
];

wwwroot = buildNpmPackage {
inherit meta version;
runtimeDeps = [ mono ];

pname = "slskd-web";
src = "${src}/src/web";
npmFlags = [ "--legacy-peer-deps" ];
nodejs = nodejs_18;
npmDepsHash = "sha256-06qQ1y870TrkXhkHYADjnWVhdyiLWEqdDt3qrJ1BBFo=";
installPhase = ''
cp -r build $out
'';
npmRoot = "src/web";
npmDeps = fetchNpmDeps {
name = "${pname}-${version}-npm-deps";
inherit src;
sourceRoot = "${src.name}/${npmRoot}";
hash = "sha256-WANoxgPbBoMx6o8fjhSTsKBRZadO2QaeErMMMXk0tgE=";
};

in
buildDotnetModule {
inherit
pname
version
src
meta
;

runtimeDeps = [ mono ];
projectFile = "slskd.sln";
nugetDeps = ./deps.nix;

dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;

projectFile = "slskd.sln";

testProjectFile = "tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj";
doCheck = true;

nugetDeps = ./deps.nix;
postBuild = ''
pushd "$npmRoot"
npm run build --legacy-peer-deps
popd
'';

postInstall = ''
rm -r $out/lib/slskd/wwwroot
ln -s ${wwwroot} $out/lib/slskd/wwwroot
mv "$npmRoot"/build $out/lib/slskd/wwwroot
'';

passthru = {
tests.version = testers.testVersion { package = slskd; };
};

meta = {
description = "Modern client-server application for the Soulseek file sharing network";
homepage = "https://github.com/slskd/slskd";
changelog = "https://github.com/slskd/slskd/releases/tag/${version}";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [
ppom
melvyn2
getchoo
];
mainProgram = "slskd";
platforms = lib.platforms.linux;
};
}
Loading