nixpkgs/pkgs/by-name/tr/truecrack/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

52 lines
1.4 KiB
Nix

{ lib, gccStdenv, fetchFromGitLab, cudatoolkit
, config
, cudaSupport ? config.cudaSupport
, pkg-config }:
gccStdenv.mkDerivation rec {
pname = "truecrack";
version = "3.6";
src = fetchFromGitLab {
owner = "kalilinux";
repo = "packages/truecrack";
rev = "debian/${version}+git20150326-0kali1";
sha256 = "+Rw9SfaQtO1AJO6UVVDMCo8DT0dYEbv7zX8SI+pHCRQ=";
};
configureFlags = (if cudaSupport then [
"--with-cuda=${cudatoolkit}"
] else [
"--enable-cpu"
]);
nativeBuildInputs = [
pkg-config
];
buildInputs = lib.optionals cudaSupport [
cudatoolkit
];
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: CpuAes.o:/build/source/src/Crypto/CpuAes.h:1233: multiple definition of
# `t_rc'; CpuCore.o:/build/source/src/Crypto/CpuAes.h:1237: first defined here
# TODO: remove on upstream fixes it:
# https://gitlab.com/kalilinux/packages/truecrack/-/issues/1
env.NIX_CFLAGS_COMPILE = "-fcommon";
installFlags = [ "prefix=$(out)" ];
enableParallelBuilding = true;
meta = with lib; {
description = "Brute-force password cracker for TrueCrypt volumes, optimized for Nvidia Cuda technology";
mainProgram = "truecrack";
homepage = "https://gitlab.com/kalilinux/packages/truecrack";
broken = cudaSupport;
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ ethancedwards8 ];
};
}