mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-20 19:16:11 +00:00
amber-lang: init at 0.3.1-alpha
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
5c0c6e1492
commit
a5a479363d
49
pkgs/by-name/am/amber-lang/package.nix
Normal file
49
pkgs/by-name/am/amber-lang/package.nix
Normal file
@ -0,0 +1,49 @@
|
||||
{ lib,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
bc,
|
||||
makeWrapper,
|
||||
runCommand,
|
||||
amber-lang
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "amber-lang";
|
||||
version = "0.3.1-alpha";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Ph0enixKM";
|
||||
repo = "Amber";
|
||||
rev = version;
|
||||
hash = "sha256-VSlLPgoi+KPnUQJEb6m0VZQVs1zkxEnfqs3fAp8m1o4=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-NzcyX/1yeFcI80pNxx/OTkaI82qyQFJW8U0vPbqSU7g=";
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
nativeCheckInputs = [ bc ];
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace src/compiler.rs \
|
||||
--replace-fail "/bin/bash" "bash"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/amber" --prefix PATH : "${lib.makeBinPath [bc]}"
|
||||
'';
|
||||
|
||||
passthru.tests.run = runCommand "amber-lang-eval-test" { nativeBuildInputs = [ amber-lang ]; } ''
|
||||
diff -U3 --color=auto <(amber -e 'echo "Hello, World"') <(echo 'Hello, World')
|
||||
touch $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Programming language compiled to bash";
|
||||
homepage = "https://amber-lang.com";
|
||||
license = licenses.gpl3Plus;
|
||||
mainProgram = "amber";
|
||||
maintainers = with maintainers; [ cafkafk uncenter ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user