2021-10-22 15:58:49 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, withOpenCL ? true
|
2021-10-30 16:48:45 +00:00
|
|
|
, stdenv
|
|
|
|
, OpenCL
|
2021-10-22 15:58:49 +00:00
|
|
|
, ocl-icd
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lucky-commit";
|
2022-07-28 01:33:32 +00:00
|
|
|
version = "2.2.1";
|
2021-10-22 15:58:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "not-an-aardvark";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-07-28 01:33:32 +00:00
|
|
|
sha256 = "sha256-0RSNlzmwat89ewQrjdGxLcXo01d+UaPZlteaxZCBRyE=";
|
2021-10-22 15:58:49 +00:00
|
|
|
};
|
|
|
|
|
2022-07-28 01:33:32 +00:00
|
|
|
cargoSha256 = "sha256-8r/EGIiN+HTtChgLTdOS+Y7AdmjswqD4BZtYlL5UiEo=";
|
2021-10-22 15:58:49 +00:00
|
|
|
|
2021-10-30 16:48:45 +00:00
|
|
|
buildInputs = lib.optional withOpenCL (if stdenv.isDarwin then OpenCL else ocl-icd);
|
2021-10-22 15:58:49 +00:00
|
|
|
|
2021-11-16 13:34:11 +00:00
|
|
|
buildNoDefaultFeatures = !withOpenCL;
|
2021-10-22 15:58:49 +00:00
|
|
|
|
|
|
|
# disable tests that require gpu
|
2021-10-27 11:59:25 +00:00
|
|
|
checkNoDefaultFeatures = true;
|
2021-10-22 15:58:49 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Change the start of your git commit hashes to whatever you want";
|
|
|
|
homepage = "https://github.com/not-an-aardvark/lucky-commit";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
mainProgram = "lucky_commit";
|
|
|
|
};
|
|
|
|
}
|