[nix] Support aarch64-darwin (#1964)

This commit is contained in:
Salvador Girones Gil 2023-05-11 20:43:41 +02:00 committed by GitHub
parent af85d6d831
commit e90e4b57bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 19 deletions

View file

@ -32,11 +32,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1682749232,
"narHash": "sha256-tZdhmgUIuSrRB8j1fTa5JVdewdNf0crNwDMnNIKfYqE=",
"lastModified": 1683699806,
"narHash": "sha256-Nw3pzHv9oRdIDmgetGWG5mqLDK78v3fTsReqANMjZ1Q=",
"owner": "nix-community",
"repo": "fenix",
"rev": "30d4a659367f2399cdc9e813c516ae53d46ab266",
"rev": "71e7505152ef95dfddd0f5f0e5a755f4c3bbee86",
"type": "github"
},
"original": {
@ -110,11 +110,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1682682915,
"narHash": "sha256-haR0u/j/nUvlMloYlaOYq1FMXTvkNHw+wGxc+0qXisM=",
"lastModified": 1683627095,
"narHash": "sha256-8u9SejRpL2TrMuHBdhYh4FKc1OGPDLyWTpIbNTtoHsA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "09f1b33fcc0f59263137e23e935c1bb03ec920e4",
"rev": "a08e061a4ee8329747d54ddf1566d34c55c895eb",
"type": "github"
},
"original": {
@ -136,11 +136,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1682710505,
"narHash": "sha256-03cthpkTbEdQF7wpmJjPuBvwcQ5eSV4jDfWj8Evg4Lk=",
"lastModified": 1683653808,
"narHash": "sha256-GiKwJySG/YCPIKwz9wSm9fJa5e4CU3GvTYAKZzjBhFo=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "370b72c7dd3dcdb1efe92224ab1622e44639cb07",
"rev": "b7cdd93f3e1533e96d4cfa1ac8573e6210a2bedf",
"type": "github"
},
"original": {

View file

@ -29,7 +29,7 @@
# are used to express the output but not themselves paths in the output.
let
nativeSystems = [ aarch64-linux x86_64-darwin x86_64-linux ];
nativeSystems = [ aarch64-darwin aarch64-linux x86_64-darwin x86_64-linux ];
# Build the output set for each default system and map system sets into
# attributes, resulting in paths such as:

View file

@ -0,0 +1,23 @@
{ pkgs, target, util }:
{
inherit target;
features = with util.features; [ default storage-tikv ];
buildSpec = with pkgs; {
depsBuildBuild = [ clang protobuf perl ];
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ openssl libiconv darwin.apple_sdk.frameworks.Security ];
# From https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/rocksdb/default.nix#LL43C7-L52C6
NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=unused-private-field"
"-faligned-allocation"
]);
CARGO_BUILD_TARGET = target;
};
}

View file

@ -3,22 +3,21 @@
{
inherit target;
features = with util.features; [ storage-mem http ];
features = with util.features; [ default storage-tikv ];
buildSpec = with pkgs; {
depsBuildBuild = [ clang protobuf perl ];
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ openssl libiconv darwin.apple_sdk.frameworks.Security ];
# From https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/rocksdb/default.nix#LL43C7-L52C6
NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=unused-private-field"
"-faligned-allocation"
]);
CARGO_BUILD_TARGET = target;
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
PROTOC = "${protobuf}/bin/protoc";
PROTOC_INCLUDE = "${protobuf}/include";
OPENSSL_NO_VENDOR = "true";
};
}