Skip to content

Commit 4d3554e

Browse files
committed
feat(packages): Add eradicate2 package
1 parent bcfa767 commit 4d3554e

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

packages/all-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@
185185
};
186186

187187
inherit corepack-shims;
188+
189+
eradicate2 = callPackage ./eradicate2 { };
188190
}
189191
// lib.optionalAttrs hostPlatform.isLinux rec {
190192
kurtosis = callPackage ./kurtosis/default.nix { };

packages/eradicate2/default.nix

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
opencl-headers,
6+
ocl-icd,
7+
openssl,
8+
}:
9+
10+
stdenv.mkDerivation rec {
11+
pname = "eradicate2";
12+
version = "0.4";
13+
14+
src = fetchFromGitHub {
15+
owner = "johguse";
16+
repo = "ERADICATE2";
17+
rev = "v${version}";
18+
hash = "sha256-ILBhW4/Ia0MR2/XHKxpL5mXCmcczJUBEOva8KFxWhvs=";
19+
};
20+
21+
buildInputs = [
22+
opencl-headers
23+
ocl-icd
24+
openssl
25+
];
26+
27+
postPatch = ''
28+
sed -i '/#include <string>/a #include <cstdint>' hexadecimal.hpp
29+
sed -i '/#include <stdexcept>/a #include <cstdint>' hexadecimal.cpp
30+
31+
if [[ "$OSTYPE" == "darwin"* ]]; then
32+
sed -i 's/&p, NULL/p, NULL/' Dispatcher.cpp
33+
fi
34+
'';
35+
36+
preBuild = ''
37+
mkdir -p $out/bin
38+
'';
39+
40+
makeFlags =
41+
[
42+
"EXECUTABLE=${placeholder "out"}/bin/eradicate2"
43+
"CC=$(CXX)"
44+
]
45+
++ lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [
46+
# On Apple Silicon (aarch64-darwin), the x86-specific -mmmx flag is unsupported.
47+
"CFLAGS=-c -std=c++11 -Wall -O2"
48+
];
49+
50+
dontInstall = true;
51+
52+
meta = with lib; {
53+
description = "Vanity address generator for CREATE2 addresses";
54+
homepage = "https://github.com/johguse/ERADICATE2";
55+
license = licenses.unfree;
56+
mainProgram = "eradicate2";
57+
platforms = platforms.linux ++ platforms.darwin;
58+
};
59+
}

0 commit comments

Comments
 (0)