nixpkgs/pkgs/by-name/sp/spectre-cli/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

74 lines
1.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib
, stdenv
, fetchFromGitLab
, cmake
, libsodium
, json_c
, ncurses
, libxml2
, jq
}:
stdenv.mkDerivation rec {
pname = "spectre-cli";
version = "unstable-2022-02-05";
src = fetchFromGitLab {
owner = "spectre.app";
repo = "cli";
rev = "a5e7aab28f44b90e5bd1204126339a81f64942d2";
sha256 = "1hp4l1rhg7bzgx0hcai08rvcy6l9645sfngy2cr96l1bpypcld5i";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
libxml2
jq
];
buildInputs = [
libsodium
json_c
ncurses
];
cmakeFlags = [
"-DBUILD_SPECTRE_TESTS=ON"
];
preConfigure = ''
echo "${version}" > VERSION
# The default buildPhase wants to create a ´build´ dir so we rename the build script to stop conflicts.
mv build build.sh
'';
# Some tests are expected to fail on ARM64
# See: https://gitlab.com/spectre.app/cli/-/issues/27#note_962950844
doCheck = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
checkPhase = ''
mv ../spectre-cli-tests ../spectre_tests.xml ./
patchShebangs spectre-cli-tests
export HOME=$(mktemp -d)
./spectre-tests
./spectre-cli-tests
'';
installPhase = ''
mkdir -p $out/bin
mv spectre $out/bin
'';
meta = with lib; {
description = "Stateless cryptographic identity algorithm";
homepage = "https://spectre.app";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ emmabastas ];
mainProgram = "spectre";
platforms = platforms.all;
};
}