summary refs log tree commit diff
path: root/pkgs/applications/blockchains
diff options
context:
space:
mode:
authorYt <raphael@megzari.com>2022-01-23 10:21:02 -0500
committerGitHub <noreply@github.com>2022-01-24 00:21:02 +0900
commitdeaf36f4c68b4d9537d071e821706480d31a12e5 (patch)
tree092e5be9a12e374de0a334bda3e455e100ae8e30 /pkgs/applications/blockchains
parente98bf7d9718ad180b165e4b09d43f9a1b0433221 (diff)
downloadnixpkgs-deaf36f4c68b4d9537d071e821706480d31a12e5.tar
nixpkgs-deaf36f4c68b4d9537d071e821706480d31a12e5.tar.gz
nixpkgs-deaf36f4c68b4d9537d071e821706480d31a12e5.tar.bz2
nixpkgs-deaf36f4c68b4d9537d071e821706480d31a12e5.tar.lz
nixpkgs-deaf36f4c68b4d9537d071e821706480d31a12e5.tar.xz
nixpkgs-deaf36f4c68b4d9537d071e821706480d31a12e5.tar.zst
nixpkgs-deaf36f4c68b4d9537d071e821706480d31a12e5.zip
snarkos: init at unstable-2021-01-21 (#156209)
Diffstat (limited to 'pkgs/applications/blockchains')
-rw-r--r--pkgs/applications/blockchains/snarkos/default.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/applications/blockchains/snarkos/default.nix b/pkgs/applications/blockchains/snarkos/default.nix
new file mode 100644
index 00000000000..e265d9de8de
--- /dev/null
+++ b/pkgs/applications/blockchains/snarkos/default.nix
@@ -0,0 +1,61 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, rustPlatform
+, Security
+, curl
+, pkg-config
+, openssl
+, llvmPackages
+}:
+rustPlatform.buildRustPackage rec {
+  pname = "snarkos";
+  version = "unstable-2021-01-21";
+
+  src = fetchFromGitHub {
+    owner = "AleoHQ";
+    repo = "snarkOS";
+    rev = "7068dc0394139c887f5187288ca2af54bc729614";
+    sha256 = "sha256-fgdIJX/Ep3amPAjo00BtNGSXhaItw41S1XliDXk6b7k=";
+  };
+
+  cargoSha256 = "sha256-bax7cnqVY49rdcWs73+KqW+dzPebKLlsbPvOM1d25zA=";
+
+  # buildAndTestSubdir = "cli";
+
+  nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config llvmPackages.clang ];
+
+  # Needed to get openssl-sys to use pkg-config.
+  OPENSSL_NO_VENDOR = 1;
+  OPENSSL_LIB_DIR = "${openssl.out}/lib";
+  OPENSSL_DIR="${lib.getDev openssl}";
+
+  LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
+
+  # TODO check why rust compilation fails by including the rocksdb from nixpkgs
+  # Used by build.rs in the rocksdb-sys crate. If we don't set these, it would
+  # try to build RocksDB from source.
+  # ROCKSDB_INCLUDE_DIR="${rocksdb}/include";
+  # ROCKSDB_LIB_DIR="${rocksdb}/lib";
+
+  buildInputs = lib.optionals stdenv.isDarwin [ Security curl ];
+
+  # some tests are flaky and some need network access
+  # TODO finish filtering the tests to enable them
+  doCheck = !stdenv.isLinux;
+  # checkFlags = [
+  #   # tries to make a network access
+  #   "--skip=rpc::rpc::tests::test_send_transaction_large"
+  #   # flaky test
+  #   "--skip=helpers::block_requests::tests::test_block_requests_case_2ca"
+  # ];
+
+
+  meta = with lib; {
+    description = "A Decentralized Operating System for Zero-Knowledge Applications";
+    homepage = "https://snarkos.org";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ happysalada ];
+    platforms = platforms.unix;
+  };
+}