2017-10-15 16:03:00 +00:00
|
|
|
{ stdenv, buildPackages, fetchurl, bison, m4
|
2017-11-06 18:20:21 +00:00
|
|
|
, fetchpatch, autoreconfHook, help2man
|
|
|
|
}:
|
2008-03-20 09:50:15 +00:00
|
|
|
|
2015-11-19 01:49:54 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2016-12-30 19:36:03 +00:00
|
|
|
name = "flex-${version}";
|
2017-07-29 17:14:47 +00:00
|
|
|
version = "2.6.4";
|
2014-01-07 13:24:59 +00:00
|
|
|
|
2008-03-20 09:50:15 +00:00
|
|
|
src = fetchurl {
|
2016-12-30 19:36:03 +00:00
|
|
|
url = "https://github.com/westes/flex/releases/download/v${version}/flex-${version}.tar.gz";
|
2017-07-29 17:14:47 +00:00
|
|
|
sha256 = "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8";
|
2008-03-20 09:50:15 +00:00
|
|
|
};
|
2014-01-07 13:24:59 +00:00
|
|
|
|
2017-11-06 18:25:14 +00:00
|
|
|
# Also upstream, will be part of 2.6.5
|
|
|
|
# https://github.com/westes/flex/commit/24fd0551333e
|
2017-11-06 18:20:21 +00:00
|
|
|
patches = [(fetchpatch {
|
|
|
|
name = "glibc-2.26.patch";
|
|
|
|
url = "https://raw.githubusercontent.com/lede-project/source/0fb14a2b1ab2f82c"
|
|
|
|
+ "/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch";
|
|
|
|
sha256 = "1aarhcmz7mfrgh15pkj6f7ikxa2m0mllw1i1vscsf1kw5d05lw6f";
|
|
|
|
})];
|
|
|
|
|
2017-10-15 16:03:00 +00:00
|
|
|
nativeBuildInputs = [ buildPackages.stdenv.cc autoreconfHook help2man ];
|
2014-01-07 13:24:59 +00:00
|
|
|
buildInputs = [ bison ];
|
2017-10-15 16:03:00 +00:00
|
|
|
nativePropagatedBuildInputs = [ m4 ];
|
2008-03-20 09:50:15 +00:00
|
|
|
|
2015-06-04 17:26:30 +00:00
|
|
|
postConfigure = stdenv.lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
|
2014-04-15 10:04:27 +00:00
|
|
|
sed -i Makefile -e 's/-no-undefined//;'
|
|
|
|
'';
|
|
|
|
|
2011-11-04 21:31:07 +00:00
|
|
|
crossAttrs = {
|
2015-12-23 10:57:34 +00:00
|
|
|
# disable tests which can't run on build machine
|
|
|
|
postPatch = ''
|
2018-01-07 22:47:54 +00:00
|
|
|
substituteInPlace Makefile.in --replace "tests" " "
|
|
|
|
|
|
|
|
substituteInPlace doc/Makefile.am --replace 'flex.1: $(top_srcdir)/configure.ac' 'flex.1: '
|
2015-12-23 10:57:34 +00:00
|
|
|
'';
|
|
|
|
|
2011-11-04 21:31:07 +00:00
|
|
|
preConfigure = ''
|
|
|
|
export ac_cv_func_malloc_0_nonnull=yes
|
|
|
|
export ac_cv_func_realloc_0_nonnull=yes
|
|
|
|
'';
|
2017-10-15 17:01:08 +00:00
|
|
|
|
|
|
|
# linux-pam derivation relies on static archive
|
|
|
|
dontDisableStatic = true;
|
2011-11-04 21:31:07 +00:00
|
|
|
};
|
|
|
|
|
2008-03-20 09:50:15 +00:00
|
|
|
meta = {
|
2016-09-24 01:42:08 +00:00
|
|
|
homepage = https://github.com/westes/flex;
|
2008-03-20 09:50:15 +00:00
|
|
|
description = "A fast lexical analyser generator";
|
2016-08-02 17:50:55 +00:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2008-03-20 09:50:15 +00:00
|
|
|
};
|
|
|
|
}
|