nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 python3,
6 boost,
7 libevent,
8 autoreconfHook,
9 db4,
10 miniupnpc,
11 sqlite,
12 pkg-config,
13 util-linux,
14 hexdump,
15 zeromq,
16 zlib,
17 darwin,
18 withWallet ? true,
19}:
20
21stdenv.mkDerivation (finalAttrs: {
22 pname = "namecoind";
23 version = "28.0";
24
25 src = fetchFromGitHub {
26 owner = "namecoin";
27 repo = "namecoin-core";
28 tag = "nc${finalAttrs.version}";
29 hash = "sha256-r6rVgPrKz7nZ07oXw7KmVhGF4jVn6L+R9YHded+3E9k=";
30 };
31
32 nativeBuildInputs = [
33 autoreconfHook
34 pkg-config
35 ]
36 ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ]
37 ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ]
38 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
39 darwin.autoSignDarwinBinariesHook
40 ];
41
42 buildInputs = [
43 boost
44 libevent
45 db4
46 miniupnpc
47 zeromq
48 zlib
49 ]
50 ++ lib.optionals withWallet [ sqlite ]
51 # building with db48 (for legacy descriptor wallet support) is broken on Darwin
52 ++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db4 ];
53
54 enableParallelBuilding = true;
55
56 configureFlags = [
57 "--with-boost-libdir=${boost.out}/lib"
58 "--disable-bench"
59 "--disable-gui-tests"
60 ]
61 ++ lib.optionals (!withWallet) [
62 "--disable-wallet"
63 ];
64
65 nativeCheckInputs = [ python3 ];
66
67 doCheck = true;
68
69 checkFlags = [ "LC_ALL=en_US.UTF-8" ];
70
71 meta = {
72 description = "Decentralized open source information registration and transfer system based on the Bitcoin cryptocurrency";
73 homepage = "https://namecoin.org";
74 license = lib.licenses.mit;
75 maintainers = [ ];
76 platforms = lib.platforms.linux;
77 };
78})