Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / blockchains / oxen / default.nix
blob5c8cbbbbcdd5d6aaaea2ba10017f1ba652824b0f
1 { stdenv, lib, fetchurl, fetchFromGitHub, cmake, pkg-config
2 , boost, openssl, unbound
3 , pcsclite, readline, libsodium, hidapi
4 , rapidjson
5 , curl, sqlite
6 , trezorSupport ? true
7 , libusb1
8 , protobuf
9 , python3
12 stdenv.mkDerivation rec {
13   pname = "oxen";
14   version = "9.1.3";
16   src = fetchFromGitHub {
17     owner = "oxen-io";
18     repo = "oxen-core";
19     rev = "v${version}";
20     sha256 = "11g3wqn0syk47yfcsdql5737kpad8skwdxhifn2yaz9zy8n3xqqb";
21     fetchSubmodules = true;
22   };
24   # Required for static linking, the only supported install path
25   lbzmqsrc = fetchurl {
26     url = "https://github.com/zeromq/libzmq/releases/download/v4.3.3/zeromq-4.3.3.tar.gz";
27     hash = "sha512-TBjXhAhRecWx/LdTqTgTCVoSyNNJcPLhv8pkmb5snWd2nHHGi3ylT/GBsgOQBDFw6Jczwi92/x6kZJSBT3CVsQ==";
28   };
30   postPatch = ''
31     # remove vendored libraries
32     rm -r external/rapidjson
33     sed -i s,/lib/,/lib64/, external/loki-mq/cmake/local-libzmq//LocalLibzmq.cmake
34   '';
36   postInstall = ''
37     rm -R $out/lib $out/include
38   '';
40   nativeBuildInputs = [ cmake pkg-config ];
42   buildInputs = [
43     boost openssl unbound
44     pcsclite readline
45     libsodium hidapi rapidjson
46     protobuf curl sqlite
47   ] ++ lib.optionals trezorSupport [ libusb1 protobuf python3 ];
49   cmakeFlags = [
50     # "-DUSE_DEVICE_TREZOR=ON"
51     # "-DBUILD_GUI_DEPS=ON"
52     "-DReadline_ROOT_DIR=${readline.dev}"
53     # It build with shared libs but doesn't install them. Fail.
54     # "-DBUILD_SHARED_LIBS=ON"
55     "-DLIBZMQ_TARBALL_URL=${lbzmqsrc}"
56   ] ++ lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF";
58   meta = with lib; {
59     description = "Private cryptocurrency based on Monero";
60     homepage = "https://oxen.io/";
61     license = licenses.bsd3;
62     platforms = platforms.all;
63     maintainers = [ maintainers.viric ];
64     # Fails to build on gcc-10 due to boost being built with gcc-12.
65     broken = true;
66   };