2024-09-19 14:19:46 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildDotnetModule,
|
2024-10-04 16:56:33 +00:00
|
|
|
buildPackages,
|
|
|
|
dotnetCorePackages,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchNpmDeps,
|
2024-09-19 14:19:46 +00:00
|
|
|
mono,
|
|
|
|
nodejs_18,
|
2024-10-04 16:56:33 +00:00
|
|
|
slskd,
|
|
|
|
testers,
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
2024-10-04 16:56:33 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
let
|
2024-10-04 16:56:33 +00:00
|
|
|
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 {
|
2023-05-24 13:37:59 +00:00
|
|
|
pname = "slskd";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "0.21.4";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "slskd";
|
|
|
|
repo = "slskd";
|
2024-10-04 16:56:33 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-9EKlCmc+zdiuEPa8YNjoQ3QLTy8vt2qcZ+6D0sWgwEU=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
runtimeDeps = [ mono ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
npmRoot = "src/web";
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
name = "${pname}-${version}-npm-deps";
|
|
|
|
inherit src;
|
|
|
|
sourceRoot = "${src.name}/${npmRoot}";
|
|
|
|
hash = "sha256-WANoxgPbBoMx6o8fjhSTsKBRZadO2QaeErMMMXk0tgE=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
projectFile = "slskd.sln";
|
|
|
|
nugetDeps = ./deps.nix;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
testProjectFile = "tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj";
|
|
|
|
doCheck = true;
|
2024-10-09 16:51:18 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Random failures on OfBorg, cause unknown
|
|
|
|
"slskd.Tests.Unit.Transfers.Uploads.UploadGovernorTests+ReturnBytes.Returns_Bytes_To_Bucket"
|
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
postBuild = ''
|
|
|
|
pushd "$npmRoot"
|
|
|
|
npm run build --legacy-peer-deps
|
|
|
|
popd
|
|
|
|
'';
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -r $out/lib/slskd/wwwroot
|
2024-10-04 16:56:33 +00:00
|
|
|
mv "$npmRoot"/build $out/lib/slskd/wwwroot
|
2023-05-24 13:37:59 +00:00
|
|
|
'';
|
2024-10-04 16:56:33 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
}
|