Merge pull request #218844 from chayleaf/lalrpop
This commit is contained in:
commit
91cba67bc1
4 changed files with 68 additions and 0 deletions
|
@ -2851,6 +2851,13 @@
|
|||
githubId = 6608071;
|
||||
name = "Charles Huyghues-Despointes";
|
||||
};
|
||||
chayleaf = {
|
||||
email = "chayleaf-nix@pavluk.org";
|
||||
github = "chayleaf";
|
||||
githubId = 9590981;
|
||||
matrix = "@chayleaf:matrix.pavluk.org";
|
||||
name = "Anna Pavlyuk";
|
||||
};
|
||||
chekoopa = {
|
||||
email = "chekoopa@mail.ru";
|
||||
github = "chekoopa";
|
||||
|
|
46
pkgs/development/tools/lalrpop/default.nix
Normal file
46
pkgs/development/tools/lalrpop/default.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ lib
|
||||
, rustPlatform
|
||||
, rust
|
||||
, fetchFromGitHub
|
||||
, substituteAll
|
||||
, stdenv
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "lalrpop";
|
||||
version = "0.20.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lalrpop";
|
||||
repo = "lalrpop";
|
||||
# there's no tag for 0.20.0
|
||||
rev = "1584ddb243726195b540fdd2b3ccf693876288e0";
|
||||
# rev = version;
|
||||
hash = "sha256-aYlSR8XqJnj76Hm3MFqfA5d9L3SO/iCCKpzOES5YQGY=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-JaU5ZJbmlV/HfFT/ODpB3xFjZc2XiljhEVz/dql8o/c=";
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./use-correct-binary-path-in-tests.patch;
|
||||
target_triple = rust.toRustTarget stdenv.hostPlatform;
|
||||
})
|
||||
];
|
||||
|
||||
buildAndTestSubdir = "lalrpop";
|
||||
|
||||
# there are some tests in lalrpop-test and some in lalrpop
|
||||
checkPhase = ''
|
||||
buildAndTestSubdir=lalrpop-test cargoCheckHook
|
||||
cargoCheckHook
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "LR(1) parser generator for Rust";
|
||||
homepage = "https://github.com/lalrpop/lalrpop";
|
||||
changelog = "https://github.com/lalrpop/lalrpop/blob/${src.rev}/RELEASES.md";
|
||||
license = with licenses; [ asl20 /* or */ mit ];
|
||||
maintainers = with maintainers; [ chayleaf ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/lalrpop-test/src/lib.rs b/lalrpop-test/src/lib.rs
|
||||
index cb4f2b0..725b0d4 100644
|
||||
--- a/lalrpop-test/src/lib.rs
|
||||
+++ b/lalrpop-test/src/lib.rs
|
||||
@@ -1089,7 +1089,7 @@ fn verify_lalrpop_generates_itself() {
|
||||
// Don't remove the .rs file that already exist
|
||||
fs::copy(&grammar_file, &copied_grammar_file).expect("no grammar file found");
|
||||
|
||||
- assert!(Command::new("../target/debug/lalrpop")
|
||||
+ assert!(Command::new("../target/@target_triple@/release/lalrpop")
|
||||
.args([
|
||||
"--force",
|
||||
"--no-whitespace",
|
|
@ -9422,6 +9422,8 @@ with pkgs;
|
|||
|
||||
lalezar-fonts = callPackage ../data/fonts/lalezar-fonts { };
|
||||
|
||||
lalrpop = callPackage ../development/tools/lalrpop { };
|
||||
|
||||
last-resort = callPackage ../data/fonts/last-resort { };
|
||||
|
||||
ldc = callPackage ../development/compilers/ldc { };
|
||||
|
|
Loading…
Reference in a new issue