2023-01-22 18:34:06 +01:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, distrobox
|
2024-01-12 14:22:52 +01:00
|
|
|
, installShellFiles
|
2023-01-22 18:34:06 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "apx";
|
2024-01-29 15:10:58 +01:00
|
|
|
version = "2.4.0";
|
2023-01-22 18:34:06 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Vanilla-OS";
|
2024-01-02 17:56:23 +01:00
|
|
|
repo = "apx";
|
2023-11-08 13:39:26 +01:00
|
|
|
rev = "v${version}";
|
2024-01-29 15:10:58 +01:00
|
|
|
hash = "sha256-OLJrwibw9uX5ty7FRZ0q8zx0i1vQXRKK8reQsJFFxAI=";
|
2023-01-22 18:34:06 +01:00
|
|
|
};
|
|
|
|
|
2023-09-21 19:11:11 +02:00
|
|
|
vendorHash = null;
|
2023-01-22 18:34:06 +01:00
|
|
|
|
2024-01-12 14:22:52 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-01-22 18:34:06 +01:00
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2023-11-08 13:39:26 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace config/apx.json \
|
2023-12-16 20:24:53 +01:00
|
|
|
--replace "/usr/share/apx/distrobox/distrobox" "${distrobox}/bin/distrobox" \
|
2023-11-08 13:39:26 +01:00
|
|
|
--replace "/usr/share/apx" "$out/bin/apx"
|
|
|
|
substituteInPlace settings/config.go \
|
|
|
|
--replace "/usr/share/apx/" "$out/share/apx/"
|
|
|
|
'';
|
2023-01-22 18:34:06 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
2024-01-29 15:10:58 +01:00
|
|
|
install -Dm444 config/apx.json -t $out/share/apx/
|
2024-01-12 14:22:52 +01:00
|
|
|
installManPage man/man1/*
|
2024-01-29 15:10:58 +01:00
|
|
|
install -Dm444 README.md -t $out/share/docs/apx
|
|
|
|
install -Dm444 COPYING.md $out/share/licenses/apx/LICENSE
|
2023-01-22 18:34:06 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The Vanilla OS package manager";
|
|
|
|
homepage = "https://github.com/Vanilla-OS/apx";
|
2023-11-08 13:39:26 +01:00
|
|
|
changelog = "https://github.com/Vanilla-OS/apx/releases/tag/v${version}";
|
2023-05-31 09:06:17 +02:00
|
|
|
license = licenses.gpl3Only;
|
2023-11-24 14:32:09 +01:00
|
|
|
maintainers = with maintainers; [ dit7ya chewblacka ];
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "apx";
|
2023-01-22 18:34:06 +01:00
|
|
|
};
|
|
|
|
}
|