Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

80 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
makeWrapper,
xz,
python3,
}:
let
# https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/software/script/requirements.txt
pythonPath =
with python3.pkgs;
makePythonPath [
colorama
prompt-toolkit
pyserial
];
in
stdenv.mkDerivation (finalAttrs: {
pname = "chameleon-cli";
version = "2.1.0-unstable-2025-09-12";
src = fetchFromGitHub {
owner = "RfidResearchGroup";
repo = "ChameleonUltra";
rev = "8998621a47011008df23be9a56b1fc9ce1a64ac3";
sparseCheckout = [ "software" ];
hash = "sha256-I+sWxwFdZ5nozxv8Z1TsEHpMbcMHGhKAw3xI7DzyjIA=";
};
sourceRoot = "${finalAttrs.src.name}/software";
postPatch = ''
substituteInPlace src/CMakeLists.txt \
--replace-fail "liblzma" "lzma" \
--replace-fail "FetchContent_MakeAvailable(xz)" ""
'';
nativeBuildInputs = [
cmake
makeWrapper
];
buildInputs = [
xz
];
cmakeFlags = [
"-S"
"../src"
];
installPhase = ''
runHook preInstall
mkdir -p $out/libexec
cp -r ../script/* $out/libexec
rm -r $out/libexec/tests
rm $out/libexec/requirements.txt
makeWrapper ${lib.getExe python3} $out/bin/chameleon-cli \
--add-flags "$out/libexec/chameleon_cli_main.py" \
--prefix PYTHONPATH : ${pythonPath}
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = {
description = "Command line interface for Chameleon Ultra";
homepage = "https://github.com/RfidResearchGroup/ChameleonUltra";
license = lib.licenses.gpl3Only;
mainProgram = "chameleon-cli";
maintainers = with lib.maintainers; [ azuwis ];
};
})