1 { lib, stdenv, fetchurl, m4, perl, help2man }:
3 # Note: this package is used for bootstrapping fetchurl, and thus
4 # cannot use fetchpatch! All mutable patches (generated by GitHub or
5 # cgit) that are needed here should be included directly in Nixpkgs as
8 stdenv.mkDerivation rec {
13 url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
14 sha256 = "sha256-BsnhO99+sk1M62tZIFpPZ8LH5yExGWREMP6C+9FKCrs=";
17 # gnulib relies on --host= to detect iconv() features on musl().
18 # Otherwise tests fail due to incorrect unicode symbol oconversion.
19 configurePlatforms = [ "build" "host" ];
21 # there's a /bin/sh shebang in bin/yacc which when no strictDeps is patched with the build stdenv shell
22 # however when cross-compiling it would still be patched with the build stdenv shell which would be wrong
23 # cannot add bash to buildInputs due to infinite recursion
24 strictDeps = stdenv.hostPlatform != stdenv.buildPlatform;
26 nativeBuildInputs = [ m4 perl ] ++ lib.optional stdenv.isSunOS help2man;
27 propagatedBuildInputs = [ m4 ];
29 enableParallelBuilding = true;
31 # Normal check and install check largely execute the same test suite
33 doInstallCheck = true;
36 homepage = "https://www.gnu.org/software/bison/";
37 description = "Yacc-compatible parser generator";
38 license = lib.licenses.gpl3Plus;
41 Bison is a general-purpose parser generator that converts an
42 annotated context-free grammar into an LALR(1) or GLR parser for
43 that grammar. Once you are proficient with Bison, you can use
44 it to develop a wide range of language parsers, from those used
45 in simple desk calculators to complex programming languages.
47 Bison is upward compatible with Yacc: all properly-written Yacc
48 grammars ought to work with Bison with no change. Anyone
49 familiar with Yacc should be able to use Bison with little
50 trouble. You need to be fluent in C or C++ programming in order
54 platforms = lib.platforms.unix;
57 passthru = { glrSupport = true; };