Merge pull request #236563 from figsoda/erg

This commit is contained in:
figsoda
2023-06-08 10:56:27 -04:00
committed by GitHub
2 changed files with 65 additions and 0 deletions
@@ -0,0 +1,63 @@
{ lib
, rustPlatform
, fetchFromGitHub
, makeWrapper
, python3
, which
}:
rustPlatform.buildRustPackage rec {
pname = "erg";
version = "0.6.13";
src = fetchFromGitHub {
owner = "erg-lang";
repo = "erg";
rev = "v${version}";
hash = "sha256-XwQKtorE1HGRRCCtxQBVbl6O6aTs5Z2/W9n2Am40e8Q=";
};
cargoHash = "sha256-I4hQ78RTkCDKpq7HBNJsKqCiFL9004XvWdwtRdTQQkE=";
nativeBuildInputs = [
makeWrapper
python3
which
];
buildFeatures = [ "full" ];
env = {
BUILD_DATE = "1970/01/01 00:00:00";
GIT_HASH_SHORT = src.rev;
};
# TODO(figsoda): fix tests
doCheck = false;
# the build script is impure and also assumes we are in a git repository
postPatch = ''
rm crates/erg_common/build.rs
'';
preBuild = ''
export HOME=$(mktemp -d)
export CARGO_ERG_PATH=$HOME/.erg
'';
postInstall = ''
mkdir -p $out/share
mv "$CARGO_ERG_PATH" $out/share/erg
wrapProgram $out/bin/erg \
--set-default ERG_PATH $out/share/erg
'';
meta = with lib; {
description = "A statically typed language that can deeply improve the Python ecosystem";
homepage = "https://github.com/erg-lang/erg";
changelog = "https://github.com/erg-lang/erg/releases/tag/${src.rev}";
license = with licenses; [ asl20 mit ];
maintainers = with maintainers; [ figsoda ];
};
}
+2
View File
@@ -14908,6 +14908,8 @@ with pkgs;
eql = callPackage ../development/compilers/eql { };
erg = callPackage ../development/compilers/erg { };
elm2nix = haskell.lib.compose.justStaticExecutables haskellPackages.elm2nix;
elmPackages = recurseIntoAttrs (callPackage ../development/compilers/elm { });