about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/parsing/flex/2.5.35.nix
blob: d6a09929d4f861fd7fa29749689c1470aa2833b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ lib, stdenv, fetchurl, autoreconfHook, flex, bison, texinfo, help2man, m4 }:

stdenv.mkDerivation rec {
  pname = "flex";
  version = "2.5.35";

  src = fetchurl {
    url = "https://github.com/westes/flex/archive/flex-${lib.replaceStrings ["."] ["-"] version}.tar.gz";
    sha256 = "0wh06nix8bd4w1aq4k2fbbkdq5i30a9lxz3xczf3ff28yy0kfwzm";
  };

  postPatch = ''
    patchShebangs tests
  '';

  nativeBuildInputs = [ flex bison texinfo help2man autoreconfHook ];

  propagatedBuildInputs = [ m4 ];

  preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
    ac_cv_func_malloc_0_nonnull=yes
    ac_cv_func_realloc_0_nonnull=yes
  '';

  doCheck = false; # fails 2 out of 46 tests

  meta = with lib; {
    branch = "2.5.35";
    homepage = "https://flex.sourceforge.net/";
    description = "A fast lexical analyser generator";
    mainProgram = "flex";
    license = licenses.bsd2;
    platforms = platforms.unix;
  };
}