nixpkgs/pkgs/by-name/sh/shopware-cli/package.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

52 lines
1.3 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, makeWrapper
, dart-sass
, git
}:
buildGoModule rec {
pname = "shopware-cli";
version = "0.4.29";
src = fetchFromGitHub {
repo = "shopware-cli";
owner = "FriendsOfShopware";
rev = version;
hash = "sha256-gAn/AkubIwcNBrqBWggVXEmqXuXxjt1xZop0dQ291pA=";
};
nativeBuildInputs = [ installShellFiles makeWrapper ];
nativeCheckInputs = [ git dart-sass ];
vendorHash = "sha256-S7M7B4jtAe1jD6W5q2UewgwG++ecE46Rrp2Qt6kCDeQ=";
postInstall = ''
export HOME="$(mktemp -d)"
installShellCompletion --cmd shopware-cli \
--bash <($out/bin/shopware-cli completion bash) \
--zsh <($out/bin/shopware-cli completion zsh) \
--fish <($out/bin/shopware-cli completion fish)
'';
preFixup = ''
wrapProgram $out/bin/shopware-cli \
--prefix PATH : ${lib.makeBinPath [ dart-sass ]}
'';
ldflags = [
"-s"
"-w"
"-X 'github.com/FriendsOfShopware/shopware-cli/cmd.version=${version}'"
];
meta = with lib; {
description = "Command line tool for Shopware 6";
mainProgram = "shopware-cli";
homepage = "https://github.com/FriendsOfShopware/shopware-cli";
changelog = "https://github.com/FriendsOfShopware/shopware-cli/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ shyim ];
};
}