2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, stdenv
|
|
|
|
, libiconv
|
|
|
|
, Security
|
|
|
|
, SystemConfiguration
|
2023-02-09 11:40:11 +00:00
|
|
|
, curl
|
2021-10-28 06:52:43 +00:00
|
|
|
, openssl
|
2024-02-29 20:09:43 +00:00
|
|
|
, buildPackages
|
|
|
|
, installShellFiles
|
2021-10-28 06:52:43 +00:00
|
|
|
}:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
let
|
|
|
|
canRunCmd = stdenv.hostPlatform.emulatorAvailable buildPackages;
|
|
|
|
gix = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/gix";
|
2024-06-20 14:57:18 +00:00
|
|
|
ein = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/ein";
|
2024-02-29 20:09:43 +00:00
|
|
|
in rustPlatform.buildRustPackage rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "gitoxide";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.37.0";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Byron";
|
|
|
|
repo = "gitoxide";
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-ZnfWIFphIdPHKvpzO0Cn5KCahpvKh56HZun09I1l8Vc=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
cargoHash = "sha256-oKcCodoMUaduxXXgUV+z7zlg5mc783PSsgoECdW/Uug=";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config installShellFiles ];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = [ curl ] ++ (if stdenv.hostPlatform.isDarwin
|
2021-10-28 06:52:43 +00:00
|
|
|
then [ libiconv Security SystemConfiguration ]
|
2023-02-09 11:40:11 +00:00
|
|
|
else [ openssl ]);
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
preFixup = lib.optionalString canRunCmd ''
|
|
|
|
installShellCompletion --cmd gix \
|
|
|
|
--bash <(${gix} completions --shell bash) \
|
|
|
|
--fish <(${gix} completions --shell fish) \
|
|
|
|
--zsh <(${gix} completions --shell zsh)
|
2024-06-20 14:57:18 +00:00
|
|
|
|
|
|
|
installShellCompletion --cmd ein \
|
|
|
|
--bash <(${ein} completions --shell bash) \
|
|
|
|
--fish <(${ein} completions --shell fish) \
|
|
|
|
--zsh <(${ein} completions --shell zsh)
|
2024-02-29 20:09:43 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# Needed to get openssl-sys to use pkg-config.
|
2023-08-10 07:59:29 +00:00
|
|
|
env.OPENSSL_NO_VENDOR = 1;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command-line application for interacting with git repositories";
|
2020-08-20 17:08:02 +00:00
|
|
|
homepage = "https://github.com/Byron/gitoxide";
|
2021-10-28 06:52:43 +00:00
|
|
|
changelog = "https://github.com/Byron/gitoxide/blob/v${version}/CHANGELOG.md";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
2021-10-28 06:52:43 +00:00
|
|
|
maintainers = with maintainers; [ syberant ];
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
}
|