artalk: 2.9.0 -> 2.9.1

This commit is contained in:
Moraxyc 2024-10-11 21:18:40 +08:00
parent 90c671a343
commit 42b355a908
No known key found for this signature in database

View File

@ -5,34 +5,31 @@
artalk, artalk,
fetchurl, fetchurl,
installShellFiles, installShellFiles,
versionCheckHook,
stdenv, stdenv,
testers, testers,
nixosTests, nixosTests,
}: }:
buildGoModule rec { buildGoModule rec {
pname = "artalk"; pname = "artalk";
version = "2.9.0"; version = "2.9.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ArtalkJS"; owner = "ArtalkJS";
repo = "artalk"; repo = "artalk";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-5tUUlkGeT4kY/81EQ29M6z+JnBT4YCa8gecbV9WMuDo="; hash = "sha256-gzagE3muNpX/dwF45p11JAN9ElsGXNFQ3fCvF1QhvdU=";
}; };
web = fetchurl { web = fetchurl {
url = "https://github.com/${src.owner}/${src.repo}/releases/download/v${version}/artalk_ui.tar.gz"; url = "https://github.com/${src.owner}/${src.repo}/releases/download/v${version}/artalk_ui.tar.gz";
hash = "sha256-Cx3fDpnl52kwILzH9BBLfsWe5qEbIl/ecJd1wJEB/Hc="; hash = "sha256-ckKC4lErKVdJuJ+pGysmMR96a9LkrCYnWB4j6VPP8OY=";
}; };
CGO_ENABLED = 1; vendorHash = "sha256-oAqYQzOUjly97H5L5PQ9I2SO2KqiUVxdJA+eoPrHD6Q=";
vendorHash = "sha256-edqmv/Q99pgnScJqCmLwjHd7uKMNPGfCSujNTUQtpLc=";
ldflags = [ ldflags = [
"-s" "-s"
"-w" "-w"
"-X github.com/ArtalkJS/Artalk/internal/config.Version=${version}"
"-X github.com/ArtalkJS/Artalk/internal/config.CommitHash=${version}"
]; ];
preBuild = '' preBuild = ''
@ -42,21 +39,22 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
postInstall = postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
'' installShellCompletion --cmd artalk \
# work around case insensitive file systems --bash <($out/bin/artalk completion bash) \
mv $out/bin/Artalk $out/bin/artalk.tmp --fish <($out/bin/artalk completion fish) \
mv $out/bin/artalk.tmp $out/bin/artalk --zsh <($out/bin/artalk completion zsh)
'' '';
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd artalk \ doInstallCheck = true;
--bash <($out/bin/artalk completion bash) \
--fish <($out/bin/artalk completion fish) \ versionCheckProgramArg = "-v";
--zsh <($out/bin/artalk completion zsh)
''; nativeInstallCheckInputs = [
versionCheckHook
];
passthru.tests = { passthru.tests = {
version = testers.testVersion { package = artalk; };
inherit (nixosTests) artalk; inherit (nixosTests) artalk;
}; };
@ -65,6 +63,10 @@ buildGoModule rec {
homepage = "https://github.com/ArtalkJS/Artalk"; homepage = "https://github.com/ArtalkJS/Artalk";
changelog = "https://github.com/ArtalkJS/Artalk/releases/tag/v${version}"; changelog = "https://github.com/ArtalkJS/Artalk/releases/tag/v${version}";
license = lib.licenses.mit; license = lib.licenses.mit;
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode
];
maintainers = with lib.maintainers; [ moraxyc ]; maintainers = with lib.maintainers; [ moraxyc ];
mainProgram = "artalk"; mainProgram = "artalk";
}; };