mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 09:34:36 +00:00
Merge pull request #182311 from 06kellyjac/deno
This commit is contained in:
commit
759945155a
@ -8,6 +8,10 @@
|
|||||||
, which
|
, which
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
# avoid "malformed 32-bit x.y.z" error on mac when using clang
|
||||||
|
isCleanVer = version: builtins.match "^[0-9]\\.+[0-9]+\\.[0-9]+" version != null;
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "tcc";
|
pname = "tcc";
|
||||||
version = "unstable-2022-07-15";
|
version = "unstable-2022-07-15";
|
||||||
@ -62,7 +66,11 @@ stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
echo ${version} > VERSION
|
${
|
||||||
|
if stdenv.isDarwin && ! isCleanVer version
|
||||||
|
then "echo 'not overwriting VERSION since it would upset ld'"
|
||||||
|
else "echo ${version} > VERSION"
|
||||||
|
}
|
||||||
configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)")
|
configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, rustPlatform
|
, rustPlatform
|
||||||
, installShellFiles
|
, installShellFiles
|
||||||
, fetchpatch
|
|
||||||
, tinycc
|
, tinycc
|
||||||
, libiconv
|
, libiconv
|
||||||
, libobjc
|
, libobjc
|
||||||
@ -16,38 +15,17 @@
|
|||||||
, librusty_v8 ? callPackage ./librusty_v8.nix { }
|
, librusty_v8 ? callPackage ./librusty_v8.nix { }
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
libtcc = tinycc.overrideAttrs (oa: {
|
|
||||||
makeFlags = [ "libtcc.a" ];
|
|
||||||
# tests want tcc binary
|
|
||||||
doCheck = false;
|
|
||||||
outputs = [ "out" ];
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/lib/
|
|
||||||
mv libtcc.a $out/lib/
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
in
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "deno";
|
pname = "deno";
|
||||||
version = "1.23.4";
|
version = "1.25.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "denoland";
|
owner = "denoland";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-nLQqfLRuh9mhZfjeiPaGpQbi5bXEg7HiGwrwDmaIRWM=";
|
sha256 = "sha256-nKMQDfCU1HsOfdzVwmgCIWa/rUmvufHlsS9jcDwcZzw=";
|
||||||
};
|
};
|
||||||
cargoSha256 = "sha256-l5Ce/ypYXZKEi859OFskwC/Unpo842ZPxIHvp6lCjQc=";
|
cargoSha256 = "sha256-jFoVQK74gnhC6Ume/PHe8NG7rNeTkwPMBBWn/hT7nCs=";
|
||||||
|
|
||||||
patches = [
|
|
||||||
# remove after https://github.com/denoland/deno/pull/15193 is in a release
|
|
||||||
(fetchpatch {
|
|
||||||
name = "byo-tcc.patch";
|
|
||||||
url = "https://github.com/denoland/deno/pull/15193/commits/c43698b2b58af1ef69b1558d55c8ebea0268dfea.patch";
|
|
||||||
sha256 = "sha256-YE5mGHyEm20FjFhr8yveBRlrOVL3+qQYxz2xp/IfmJs=";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# upstream uses lld on aarch64-darwin for faster builds
|
# upstream uses lld on aarch64-darwin for faster builds
|
||||||
@ -68,7 +46,20 @@ rustPlatform.buildRustPackage rec {
|
|||||||
# The deno_ffi package currently needs libtcc.a on linux and macos and will try to compile it at build time
|
# The deno_ffi package currently needs libtcc.a on linux and macos and will try to compile it at build time
|
||||||
# To avoid this we point it to our copy (dir)
|
# To avoid this we point it to our copy (dir)
|
||||||
# In the future tinycc will be replaced with asm
|
# In the future tinycc will be replaced with asm
|
||||||
DENO_FFI_LIBTCC = "${libtcc}/lib";
|
libtcc = tinycc.overrideAttrs (oa: {
|
||||||
|
makeFlags = [ "libtcc.a" ];
|
||||||
|
# tests want tcc binary
|
||||||
|
doCheck = false;
|
||||||
|
outputs = [ "out" ];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/lib/
|
||||||
|
mv libtcc.a $out/lib/
|
||||||
|
'';
|
||||||
|
# building the whole of tcc on darwin is broken in nixpkgs
|
||||||
|
# but just building libtcc.a works fine so mark this as unbroken
|
||||||
|
meta.broken = false;
|
||||||
|
});
|
||||||
|
TCC_PATH = "${libtcc}/lib";
|
||||||
|
|
||||||
# Tests have some inconsistencies between runs with output integration tests
|
# Tests have some inconsistencies between runs with output integration tests
|
||||||
# Skipping until resolved
|
# Skipping until resolved
|
||||||
|
@ -11,11 +11,11 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
fetch_librusty_v8 {
|
fetch_librusty_v8 {
|
||||||
version = "0.45.0";
|
version = "0.49.0";
|
||||||
shas = {
|
shas = {
|
||||||
x86_64-linux = "sha256-yZw6zwEhJyRntqOmyk03N+sHxzIrbY/e67AQ21ePlAU=";
|
x86_64-linux = "sha256-l6+NdMzYI9r2aHU7/OUhbgmc/LmAZjEFL8y8GrJ+EX8=";
|
||||||
aarch64-linux = "sha256-2p21Smm5wZycv9u+yDbyerKTjSTB7yau5WC2aJ+Vr8w=";
|
aarch64-linux = "sha256-uo+/Wsrlkm+xotoIr8xlQWoiWzMz02TKFW+olfXtpz8=";
|
||||||
x86_64-darwin = "sha256-HO287V+iBwdqKZUWhZJnuGJO9RE4wGG4cQMN8CkB7WQ=";
|
x86_64-darwin = "sha256-gWxljTgt6aXUzwex2zu46B9YzTvhN0Pi9C1Ll1eiohg=";
|
||||||
aarch64-darwin = "sha256-ekoMhWMQpBUdM7R7i82NWrNtQMNqCujNYy1ijOxT64U=";
|
aarch64-darwin = "sha256-/UnBIQ/wA/0biIG9vIDKylhqFJ8QCoqjKH7xiePZ/eg=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ const getLibrustyV8Version = async (
|
|||||||
) =>
|
) =>
|
||||||
fetch(`https://github.com/${owner}/${repo}/raw/${version}/core/Cargo.toml`)
|
fetch(`https://github.com/${owner}/${repo}/raw/${version}/core/Cargo.toml`)
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((txt) => mod.parse(txt).dependencies.v8.version);
|
.then((txt) => toml.parse(txt).dependencies.v8.version);
|
||||||
|
|
||||||
const fetchArchShaTasks = (version: string, arches: Architecture[]) =>
|
const fetchArchShaTasks = (version: string, arches: Architecture[]) =>
|
||||||
arches.map(
|
arches.map(
|
||||||
|
Loading…
Reference in New Issue
Block a user