mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
It is more common to specify hash as the last attribute of fetcher
function args. Let's move fetcherVersion right above hash for all
occurrences.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
(cherry picked from commit a8c9a2aa3e)
102 lines
2.0 KiB
Nix
102 lines
2.0 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
stdenvNoCC,
|
|
nix-update-script,
|
|
nodejs,
|
|
pnpm_9,
|
|
typescript,
|
|
versionCheckHook,
|
|
}:
|
|
|
|
let
|
|
pname = "autobrr";
|
|
version = "1.62.0";
|
|
src = fetchFromGitHub {
|
|
owner = "autobrr";
|
|
repo = "autobrr";
|
|
tag = "v${version}";
|
|
hash = "sha256-lygDs92WiIzHYgYqel2nseWcXgBFEQV+i5tC0NYpYUE=";
|
|
};
|
|
|
|
autobrr-web = stdenvNoCC.mkDerivation {
|
|
pname = "${pname}-web";
|
|
inherit src version;
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
pnpm_9.configHook
|
|
typescript
|
|
];
|
|
|
|
sourceRoot = "${src.name}/web";
|
|
|
|
pnpmDeps = pnpm_9.fetchDeps {
|
|
inherit (autobrr-web)
|
|
pname
|
|
version
|
|
src
|
|
sourceRoot
|
|
;
|
|
fetcherVersion = 1;
|
|
hash = "sha256-XFGxutHWk1RHnrN//WVTr4RyARIkygdG2C1Af5W0dBc=";
|
|
};
|
|
|
|
postBuild = ''
|
|
pnpm run build
|
|
'';
|
|
|
|
installPhase = ''
|
|
cp -r dist $out
|
|
'';
|
|
};
|
|
in
|
|
buildGoModule rec {
|
|
inherit
|
|
autobrr-web
|
|
pname
|
|
version
|
|
src
|
|
;
|
|
|
|
vendorHash = "sha256-/MOP06po885vg1C6j+let8UC710j68oP+L3j9oEU0Lw=";
|
|
|
|
preBuild = ''
|
|
cp -r ${autobrr-web}/* web/dist
|
|
'';
|
|
|
|
ldflags = [
|
|
"-X main.version=${version}"
|
|
"-X main.commit=${src.tag}"
|
|
];
|
|
|
|
# In darwin, tests try to access /etc/protocols, which is not permitted.
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
doInstallCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
nativeInstallCheckInputs = [
|
|
versionCheckHook
|
|
];
|
|
versionCheckProgram = "${placeholder "out"}/bin/autobrrctl";
|
|
versionCheckProgramArg = "version";
|
|
|
|
passthru.updateScript = nix-update-script {
|
|
extraArgs = [
|
|
"--subpackage"
|
|
"autobrr-web"
|
|
];
|
|
};
|
|
|
|
meta = {
|
|
description = "Modern, easy to use download automation for torrents and usenet";
|
|
license = lib.licenses.gpl2Plus;
|
|
homepage = "https://autobrr.com/";
|
|
changelog = "https://autobrr.com/release-notes/v${version}";
|
|
maintainers = with lib.maintainers; [ av-gal ];
|
|
mainProgram = "autobrr";
|
|
platforms = with lib.platforms; darwin ++ freebsd ++ linux;
|
|
};
|
|
}
|