2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, bzip2
|
|
|
|
, stdenv
|
|
|
|
, Security
|
|
|
|
}:
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "pactorio";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.5.2";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "figsoda";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-tRmchXDg8flvByjg6GLwwdwQgp/5NdZIgnjYgPLcLP8=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
cargoSha256 = "sha256-FIn+6wflDAjshP2Vz/rXRTrrjPQFW63XtXo8hBHMdkg=";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pkg-config ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [ bzip2 ] ++ lib.optional stdenv.isDarwin Security;
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-03-09 03:18:52 +00:00
|
|
|
completions=($releaseDir/build/pactorio-*/out/completions)
|
2021-12-06 16:07:01 +00:00
|
|
|
installShellCompletion $completions/pactorio.{bash,fish} --zsh $completions/_pactorio
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
GEN_COMPLETIONS = 1;
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-09-18 10:52:07 +00:00
|
|
|
description = "Mod packager for factorio";
|
2021-03-09 03:18:52 +00:00
|
|
|
homepage = "https://github.com/figsoda/pactorio";
|
|
|
|
changelog = "https://github.com/figsoda/pactorio/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|