2023-05-03 11:56:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
2023-06-15 08:41:01 +00:00
|
|
|
, dart-sass
|
2023-08-16 18:05:20 +00:00
|
|
|
, git
|
2023-05-03 11:56:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "shopware-cli";
|
2023-08-16 18:05:20 +00:00
|
|
|
version = "0.2.6";
|
2023-05-03 11:56:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "shopware-cli";
|
|
|
|
owner = "FriendsOfShopware";
|
|
|
|
rev = version;
|
2023-08-16 18:05:20 +00:00
|
|
|
hash = "sha256-Ut/SKdnaJM4B6jXXcRS6UJ1qCEgnZy977qlZbH8S6qU=";
|
2023-05-03 11:56:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2023-08-16 18:05:20 +00:00
|
|
|
nativeCheckInputs = [ git ];
|
2023-05-03 11:56:19 +00:00
|
|
|
|
2023-08-16 18:05:20 +00:00
|
|
|
vendorHash = "sha256-luA+tSePY8V+BQBTykv236mq4z3wQjLrjeYH2KQ0Mrc=";
|
2023-05-03 11:56:19 +00:00
|
|
|
|
|
|
|
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 \
|
2023-06-15 08:41:01 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ dart-sass ]}
|
2023-05-03 11:56:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X 'github.com/FriendsOfShopware/shopware-cli/cmd.version=${version}'"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command line tool for Shopware 6";
|
|
|
|
homepage = "https://github.com/FriendsOfShopware/shopware-cli";
|
|
|
|
changelog = "https://github.com/FriendsOfShopware/shopware-cli/releases/tag/${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ shyim ];
|
|
|
|
};
|
|
|
|
}
|