mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
soundalike: init at 0.1.2
This commit is contained in:
parent
79f26c8965
commit
bd9ebda4bf
1 changed files with 73 additions and 0 deletions
73
pkgs/by-name/so/soundalike/package.nix
Normal file
73
pkgs/by-name/so/soundalike/package.nix
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildGoModule,
|
||||||
|
fetchFromGitea,
|
||||||
|
chromaprint,
|
||||||
|
makeWrapper,
|
||||||
|
versionCheckHook,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildGoModule rec {
|
||||||
|
pname = "soundalike";
|
||||||
|
version = "0.1.2";
|
||||||
|
|
||||||
|
src = fetchFromGitea {
|
||||||
|
domain = "codeberg.org";
|
||||||
|
owner = "derat";
|
||||||
|
repo = "soundalike";
|
||||||
|
tag = "v${version}";
|
||||||
|
hash = "sha256-mpYUVTj3Zll6kNuK5Mdzv1R7k5FZy6XFghhzmAPPVM8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendorHash = "sha256-7hRezOBcjB2wsx/SwV519wg3Azh+0kHMcAoc9aYPM3A=";
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
"-s"
|
||||||
|
"-w"
|
||||||
|
"-X"
|
||||||
|
"main.buildVersion=${version}"
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
makeWrapper
|
||||||
|
chromaprint
|
||||||
|
];
|
||||||
|
|
||||||
|
doCheck = true;
|
||||||
|
# need to grab another repo for music test data
|
||||||
|
testDataVersion = "0.0.1";
|
||||||
|
testData = fetchFromGitea {
|
||||||
|
domain = "codeberg.org";
|
||||||
|
owner = "derat";
|
||||||
|
repo = "soundalike-testdata";
|
||||||
|
tag = "v${testDataVersion}";
|
||||||
|
hash = "sha256-7JQTnEjoYiiaQlnxsGcfj/9PYDWAkWq4/oxyczjEMo4=";
|
||||||
|
};
|
||||||
|
preCheck = ''
|
||||||
|
# add soundalike to PATH to be available for unit tests
|
||||||
|
export PATH="$GOPATH/bin:$PATH"
|
||||||
|
# need to symlink test data to a relative path
|
||||||
|
# that the unit tests are expecting
|
||||||
|
ln -sfv ${testData} ./testdata
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||||
|
versionCheckProgramArg = "-version";
|
||||||
|
doInstallCheck = true;
|
||||||
|
|
||||||
|
# soundalike depends on fpcalc (chromparint) at runtime, so we
|
||||||
|
# need to use wrapProgram to make it available
|
||||||
|
postInstall = ''
|
||||||
|
wrapProgram $out/bin/soundalike \
|
||||||
|
--prefix PATH : ${lib.makeBinPath [ chromaprint ]}
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Find duplicate audio files using acoustic fingerprints";
|
||||||
|
homepage = "https://codeberg.org/derat/soundalike";
|
||||||
|
changelog = "https://codeberg.org/derat/soundalike/releases/tag/v${version}";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = with maintainers; [ atar13 ];
|
||||||
|
mainProgram = "soundalike";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue