treewide: use bindgenhook where possible
This commit is contained in:
parent
93706c0f1a
commit
df6a7e941a
@ -24,8 +24,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
cargoHash = "sha256-p4t+G13XaCl7+IbX5YyBFF0PmARbw4XlRvnA0PRcjvQ=";
|
cargoHash = "sha256-p4t+G13XaCl7+IbX5YyBFF0PmARbw4XlRvnA0PRcjvQ=";
|
||||||
|
|
||||||
# needed for librocksdb-sys
|
# needed for librocksdb-sys
|
||||||
nativeBuildInputs = [ llvmPackages.clang ];
|
nativeBuildInputs = [ rustPlatform.bindgenHook ];
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
||||||
|
|
||||||
# link rocksdb dynamically
|
# link rocksdb dynamically
|
||||||
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
|
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
|
||||||
|
@ -34,14 +34,12 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
buildFeatures = [ "modern" "gnosis" ];
|
buildFeatures = [ "modern" "gnosis" ];
|
||||||
|
|
||||||
nativeBuildInputs = [ clang cmake perl protobuf ];
|
nativeBuildInputs = [ rustPlatform.bindgenHook cmake perl protobuf ];
|
||||||
|
|
||||||
buildInputs = lib.optionals stdenv.isDarwin [
|
buildInputs = lib.optionals stdenv.isDarwin [
|
||||||
Security
|
Security
|
||||||
];
|
];
|
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
||||||
|
|
||||||
depositContractSpec = fetchurl {
|
depositContractSpec = fetchurl {
|
||||||
url = "https://raw.githubusercontent.com/ethereum/eth2.0-specs/v${depositContractSpecVersion}/deposit_contract/contracts/validator_registration.json";
|
url = "https://raw.githubusercontent.com/ethereum/eth2.0-specs/v${depositContractSpecVersion}/deposit_contract/contracts/validator_registration.json";
|
||||||
hash = "sha256-ZslAe1wkmkg8Tua/AmmEfBmjqMVcGIiYHwi+WssEwa8=";
|
hash = "sha256-ZslAe1wkmkg8Tua/AmmEfBmjqMVcGIiYHwi+WssEwa8=";
|
||||||
|
@ -42,14 +42,12 @@ rustPlatform.buildRustPackage rec {
|
|||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
protobuf
|
protobuf
|
||||||
|
rustPlatform.bindgenHook
|
||||||
];
|
];
|
||||||
|
|
||||||
# fat LTO requires ~3.4GB RAM
|
# fat LTO requires ~3.4GB RAM
|
||||||
requiredSystemFeatures = [ "big-parallel" ];
|
requiredSystemFeatures = [ "big-parallel" ];
|
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
||||||
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include";
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Reference client for NEAR Protocol";
|
description = "Reference client for NEAR Protocol";
|
||||||
homepage = "https://github.com/near/nearcore";
|
homepage = "https://github.com/near/nearcore";
|
||||||
|
@ -36,14 +36,13 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
||||||
|
|
||||||
nativeBuildInputs = [ clang ];
|
nativeBuildInputs = [ rustPlatform.bindgenHook ];
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
export SUBSTRATE_CLI_GIT_COMMIT_HASH=$(cat .git_commit)
|
export SUBSTRATE_CLI_GIT_COMMIT_HASH=$(cat .git_commit)
|
||||||
rm .git_commit
|
rm .git_commit
|
||||||
'';
|
'';
|
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
||||||
PROTOC = "${protobuf}/bin/protoc";
|
PROTOC = "${protobuf}/bin/protoc";
|
||||||
|
|
||||||
# NOTE: We don't build the WASM runtimes since this would require a more
|
# NOTE: We don't build the WASM runtimes since this would require a more
|
||||||
|
@ -23,15 +23,13 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
# buildAndTestSubdir = "cli";
|
# buildAndTestSubdir = "cli";
|
||||||
|
|
||||||
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config llvmPackages.clang ];
|
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config rustPlatform.bindgenHook ];
|
||||||
|
|
||||||
# Needed to get openssl-sys to use pkg-config.
|
# Needed to get openssl-sys to use pkg-config.
|
||||||
OPENSSL_NO_VENDOR = 1;
|
OPENSSL_NO_VENDOR = 1;
|
||||||
OPENSSL_LIB_DIR = "${lib.getLib openssl}/lib";
|
OPENSSL_LIB_DIR = "${lib.getLib openssl}/lib";
|
||||||
OPENSSL_DIR="${lib.getDev openssl}";
|
OPENSSL_DIR="${lib.getDev openssl}";
|
||||||
|
|
||||||
LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
|
|
||||||
|
|
||||||
# TODO check why rust compilation fails by including the rocksdb from nixpkgs
|
# 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
|
# Used by build.rs in the rocksdb-sys crate. If we don't set these, it would
|
||||||
# try to build RocksDB from source.
|
# try to build RocksDB from source.
|
||||||
|
@ -68,12 +68,9 @@ rustPlatform.buildRustPackage rec {
|
|||||||
cargoBuildFlags = builtins.map (n: "--bin=${n}") solanaPkgs;
|
cargoBuildFlags = builtins.map (n: "--bin=${n}") solanaPkgs;
|
||||||
|
|
||||||
# weird errors. see https://github.com/NixOS/nixpkgs/issues/52447#issuecomment-852079285
|
# weird errors. see https://github.com/NixOS/nixpkgs/issues/52447#issuecomment-852079285
|
||||||
LIBCLANG_PATH = "${libclang.lib}/lib";
|
# LLVM_CONFIG_PATH = "${llvm}/bin/llvm-config";
|
||||||
BINDGEN_EXTRA_CLANG_ARGS =
|
|
||||||
"-isystem ${libclang.lib}/lib/clang/${lib.getVersion clang}/include";
|
|
||||||
LLVM_CONFIG_PATH = "${llvm}/bin/llvm-config";
|
|
||||||
|
|
||||||
nativeBuildInputs = [ clang llvm pkg-config protobuf rustfmt perl ];
|
nativeBuildInputs = [ pkg-config protobuf rustfmt perl rustPlatform.bindgenHook ];
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ openssl zlib libclang hidapi ] ++ (lib.optionals stdenv.isLinux [ udev ]);
|
[ openssl zlib libclang hidapi ] ++ (lib.optionals stdenv.isLinux [ udev ]);
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
@ -38,11 +38,8 @@ let
|
|||||||
perl # used by openssl-sys to configure
|
perl # used by openssl-sys to configure
|
||||||
protobuf
|
protobuf
|
||||||
rustfmt
|
rustfmt
|
||||||
llvmPackages.clang
|
rustPlatform.bindgenHook
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
teos = rustPlatform.buildRustPackage {
|
teos = rustPlatform.buildRustPackage {
|
||||||
@ -50,7 +47,7 @@ in
|
|||||||
cargoSha256 = "sha256-7VYYYSMJ2JP1KuA8sD0X3wInubH/jbA/sgzsTsomyEc=";
|
cargoSha256 = "sha256-7VYYYSMJ2JP1KuA8sD0X3wInubH/jbA/sgzsTsomyEc=";
|
||||||
buildAndTestSubdir = "teos";
|
buildAndTestSubdir = "teos";
|
||||||
|
|
||||||
inherit version src cargoPatches buildInputs nativeBuildInputs LIBCLANG_PATH;
|
inherit version src cargoPatches buildInputs nativeBuildInputs;
|
||||||
|
|
||||||
meta = common.meta // {
|
meta = common.meta // {
|
||||||
description = "A Lightning watchtower compliant with BOLT13, written in Rust";
|
description = "A Lightning watchtower compliant with BOLT13, written in Rust";
|
||||||
@ -66,7 +63,7 @@ in
|
|||||||
cargoSha256 = "sha256-xL+DiEfgBYJQ1UJm7LAr1/f34pkU8FRl4Seic8MFAlM=";
|
cargoSha256 = "sha256-xL+DiEfgBYJQ1UJm7LAr1/f34pkU8FRl4Seic8MFAlM=";
|
||||||
buildAndTestSubdir = "watchtower-plugin";
|
buildAndTestSubdir = "watchtower-plugin";
|
||||||
|
|
||||||
inherit version src cargoPatches buildInputs nativeBuildInputs LIBCLANG_PATH;
|
inherit version src cargoPatches buildInputs nativeBuildInputs;
|
||||||
|
|
||||||
meta = common.meta // {
|
meta = common.meta // {
|
||||||
description = "A Lightning watchtower plugin for clightning";
|
description = "A Lightning watchtower plugin for clightning";
|
||||||
|
@ -43,13 +43,9 @@ let
|
|||||||
|
|
||||||
pname = "tsc-dyn";
|
pname = "tsc-dyn";
|
||||||
|
|
||||||
nativeBuildInputs = [ clang ];
|
nativeBuildInputs = [ rustPlatform.bindgenHook ];
|
||||||
sourceRoot = "source/core";
|
sourceRoot = "source/core";
|
||||||
|
|
||||||
configurePhase = ''
|
|
||||||
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
LIB=($out/lib/libtsc_dyn.*)
|
LIB=($out/lib/libtsc_dyn.*)
|
||||||
TSC_PATH=$out/share/emacs/site-lisp/elpa/tsc-${version}
|
TSC_PATH=$out/share/emacs/site-lisp/elpa/tsc-${version}
|
||||||
|
@ -42,7 +42,6 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
appstream-glib
|
appstream-glib
|
||||||
clang
|
|
||||||
desktop-file-utils
|
desktop-file-utils
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
@ -52,6 +51,7 @@ stdenv.mkDerivation rec {
|
|||||||
cargoSetupHook
|
cargoSetupHook
|
||||||
rust.cargo
|
rust.cargo
|
||||||
rust.rustc
|
rust.rustc
|
||||||
|
bindgenHook
|
||||||
]);
|
]);
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
@ -69,8 +69,6 @@ stdenv.mkDerivation rec {
|
|||||||
zbar
|
zbar
|
||||||
];
|
];
|
||||||
|
|
||||||
LIBCLANG_PATH = "${lib.getLib libclang}/lib";
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Two-factor authentication code generator for GNOME";
|
description = "Two-factor authentication code generator for GNOME";
|
||||||
homepage = "https://gitlab.gnome.org/World/Authenticator";
|
homepage = "https://gitlab.gnome.org/World/Authenticator";
|
||||||
|
@ -14,8 +14,6 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
cargoSha256 = "1n4il3l59m2a6ca54vfaivzg25abf8s4w5kpd5q51p13624iz0kb";
|
cargoSha256 = "1n4il3l59m2a6ca54vfaivzg25abf8s4w5kpd5q51p13624iz0kb";
|
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
||||||
|
|
||||||
# needed for internal protobuf c wrapper library
|
# needed for internal protobuf c wrapper library
|
||||||
PROTOC = "${protobuf}/bin/protoc";
|
PROTOC = "${protobuf}/bin/protoc";
|
||||||
PROTOC_INCLUDE = "${protobuf}/include";
|
PROTOC_INCLUDE = "${protobuf}/include";
|
||||||
@ -23,8 +21,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
||||||
clang
|
rustPlatform.bindgenHook
|
||||||
llvmPackages.libclang
|
|
||||||
|
|
||||||
rustfmt
|
rustfmt
|
||||||
protobuf
|
protobuf
|
||||||
|
@ -21,13 +21,11 @@ rustPlatform.buildRustPackage rec {
|
|||||||
sha256 = "0f9915f083z5qqcxyavj0w6m973c8m1x7kfb89pah5agryy5mkaq";
|
sha256 = "0f9915f083z5qqcxyavj0w6m973c8m1x7kfb89pah5agryy5mkaq";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles pkg-config ];
|
nativeBuildInputs = [ installShellFiles pkg-config rustPlatform.bindgenHook ];
|
||||||
buildInputs = [ openssl ]
|
buildInputs = [ openssl ]
|
||||||
++ lib.optional stdenv.isDarwin Security;
|
++ lib.optional stdenv.isDarwin Security;
|
||||||
checkInputs = [ gitMinimal util-linuxMinimal ];
|
checkInputs = [ gitMinimal util-linuxMinimal ];
|
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
||||||
|
|
||||||
cargoSha256 = "1vnrc72g2271i2p847z30kplxmdpi60n3dzpw0s7dahg33g14ai6";
|
cargoSha256 = "1vnrc72g2271i2p847z30kplxmdpi60n3dzpw0s7dahg33g14ai6";
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user