add support for more systems
This commit is contained in:
parent
cccea58966
commit
1ee35d233f
5 changed files with 164 additions and 73 deletions
87
clang.nix
87
clang.nix
|
|
@ -1,34 +1,61 @@
|
|||
{pkgs ? import <nixpkgs> {}}:
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "esp-clang";
|
||||
version = "18.1.2_20240912";
|
||||
srcs = [
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/espressif/llvm-project/releases/download/esp-${version}/clang-esp-${version}-x86_64-linux-gnu.tar.xz";
|
||||
sha256 = "0k8c596y7nsnyjf1yw54cayhsh6w45v023q7m339w3s40a75pqdf";
|
||||
})
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/espressif/llvm-project/releases/download/esp-${version}/libs-clang-esp-${version}-x86_64-linux-gnu.tar.xz";
|
||||
sha256 = "1i85rm77wzzpijclrzqdd0zb94dnw383gfxxwzim2dkd3nsgrmng";
|
||||
})
|
||||
];
|
||||
{
|
||||
pkgs ? import <nixpkgs> {},
|
||||
system ? builtins.currentSystem,
|
||||
}: let
|
||||
systems_table = {
|
||||
"x86_64-linux" = {
|
||||
system = "x86_64-linux-gnu";
|
||||
binhash = "aee15b8e02440f9ec6a8070f017621dc400dbd62a4701f9cf456dbe34d2a0c4d";
|
||||
libhash = "cfd6fcb41d6d3651e3e7bdbb37d0e0b691b43e680dff4c998cf77f7e4ecd05c5";
|
||||
};
|
||||
"x86_64-darwin" = {
|
||||
system = "x86_64-apple-darwin";
|
||||
binhash = "b4641ec4dd574b6b7d037aa1bb2e5ff5a8a4623c88e89668db656282eb1d9dc8";
|
||||
libhash = "80c086c29235016382b9ab95b41556ff5bdb40186f7f1c60c64acb2af420607b";
|
||||
};
|
||||
"aarch64-linux" = {
|
||||
system = "aarch64-linux-gnu";
|
||||
binhash = "14abbc368d9c153270aa4d22ce28d78633cb0f1ca83d4be70591d9e39ae9bc82";
|
||||
libhash = "d49dfda7331a26b5d0da41bac91d5240a14ee731cbfa49f1ead3aa6377bd1b7e";
|
||||
};
|
||||
"aarch64-darwin" = {
|
||||
system = "aarch64-apple-darwin";
|
||||
binhash = "5d2e187ef40ecc9996630a7c6efcc19bdfd32ec4ce8cc4dd3014cd24e7016560";
|
||||
libhash = "8b9c6bab01bffaed5f24e37e6e255bc4e0905cd175473e7d480f301f9b0d3f0d";
|
||||
};
|
||||
};
|
||||
system_download = systems_table.${system};
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "esp-clang";
|
||||
version = "18.1.2_20240912";
|
||||
srcs = [
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/espressif/llvm-project/releases/download/esp-${version}/clang-esp-${version}-${system_download.system}.tar.xz";
|
||||
sha256 = system_download.binhash;
|
||||
})
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/espressif/llvm-project/releases/download/esp-${version}/libs-clang-esp-${version}-${system_download.system}.tar.xz";
|
||||
sha256 = system_download.libhash;
|
||||
})
|
||||
];
|
||||
|
||||
preferLocalBuild = true;
|
||||
preferLocalBuild = true;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
autoPatchelfHook
|
||||
];
|
||||
nativeBuildInputs = with pkgs; [
|
||||
autoPatchelfHook
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
libz
|
||||
libxml2
|
||||
];
|
||||
buildInputs = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
libz
|
||||
libxml2
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out"
|
||||
cp -R ./{bin,share,lib,include} "$out"
|
||||
'';
|
||||
}
|
||||
installPhase = ''
|
||||
mkdir -p "$out"
|
||||
cp -R ./{bin,share,lib,include} "$out"
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue