472aeafc57
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
82 lines
1.8 KiB
Nix
82 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
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.4";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "slskd";
|
|
repo = "slskd";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-9EKlCmc+zdiuEPa8YNjoQ3QLTy8vt2qcZ+6D0sWgwEU=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
npmHooks.npmConfigHook
|
|
];
|
|
|
|
runtimeDeps = [ mono ];
|
|
|
|
npmRoot = "src/web";
|
|
npmDeps = fetchNpmDeps {
|
|
name = "${pname}-${version}-npm-deps";
|
|
inherit src;
|
|
sourceRoot = "${src.name}/${npmRoot}";
|
|
hash = "sha256-WANoxgPbBoMx6o8fjhSTsKBRZadO2QaeErMMMXk0tgE=";
|
|
};
|
|
|
|
projectFile = "slskd.sln";
|
|
nugetDeps = ./deps.nix;
|
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
|
dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;
|
|
|
|
testProjectFile = "tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj";
|
|
doCheck = true;
|
|
|
|
postBuild = ''
|
|
pushd "$npmRoot"
|
|
npm run build --legacy-peer-deps
|
|
popd
|
|
'';
|
|
|
|
postInstall = ''
|
|
rm -r $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;
|
|
};
|
|
}
|