go-chromecast: fix build by using buildGo122Module
(#353037)
This commit is contained in:
commit
68c8a7ebdd
@ -1,25 +0,0 @@
|
||||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "go-chromecast";
|
||||
version = "0.3.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vishen";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Kzo8iWj4mtnX1Jxm2sLsnmEOmpzScxWHZ/sLYYm3vQI=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-cEUlCR/xtPJJSWplV1COwV6UfzSmVArF4V0pJRk+/Og=";
|
||||
|
||||
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" "-X main.date=unknown" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/vishen/go-chromecast";
|
||||
description = "CLI for Google Chromecast, Home devices and Cast Groups";
|
||||
license = licenses.asl20;
|
||||
maintainers = [ ];
|
||||
mainProgram = "go-chromecast";
|
||||
};
|
||||
}
|
58
pkgs/by-name/go/go-chromecast/package.nix
Normal file
58
pkgs/by-name/go/go-chromecast/package.nix
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
lib,
|
||||
buildGo122Module,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
stdenvNoCC,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
# "go test" fails with go 1.23
|
||||
buildGo122Module rec {
|
||||
pname = "go-chromecast";
|
||||
version = "0.3.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vishen";
|
||||
repo = "go-chromecast";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-Kzo8iWj4mtnX1Jxm2sLsnmEOmpzScxWHZ/sLYYm3vQI=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-cEUlCR/xtPJJSWplV1COwV6UfzSmVArF4V0pJRk+/Og=";
|
||||
|
||||
CGO_ENABLED = 0;
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X=main.version=${version}"
|
||||
"-X=main.commit=${src.rev}"
|
||||
"-X=main.date=unknown"
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
versionCheckProgramArg = "--version";
|
||||
|
||||
postInstall = lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
|
||||
installShellCompletion --cmd go-chromecast \
|
||||
--bash <($out/bin/go-chromecast completion bash) \
|
||||
--fish <($out/bin/go-chromecast completion fish) \
|
||||
--zsh <($out/bin/go-chromecast completion zsh)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/vishen/go-chromecast";
|
||||
description = "CLI for Google Chromecast, Home devices and Cast Groups";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = [ lib.maintainers.zi3m5f ];
|
||||
mainProgram = "go-chromecast";
|
||||
};
|
||||
}
|
@ -5027,8 +5027,6 @@ with pkgs;
|
||||
|
||||
gfxreconstruct = callPackage ../tools/graphics/gfxreconstruct { };
|
||||
|
||||
go-chromecast = callPackage ../applications/video/go-chromecast { };
|
||||
|
||||
go-containerregistry = callPackage ../development/tools/go-containerregistry { };
|
||||
inherit (go-containerregistry) crane gcrane;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user