9 stdenv.mkDerivation rec {
11 version = "0.1pre2987_${builtins.substring 0 8 src.rev}";
13 src = fetchFromGitHub {
16 rev = "087e3389ad2cd5e5c40caeb40387e632567d7258";
17 hash = "sha256-XWrZxnRbMB609l+sYFf8VsXy3NxqBsBPUrHgKLIyu/I=";
18 fetchSubmodules = true;
26 enableParallelBuilding = true;
27 enableParallelInstalling = false;
29 # note: build checks value of '$CC' to add some extra cflags, but we don't
30 # necessarily know which 'stdenv' someone chose, so we leave it alone (e.g.
31 # if we use stdenv vs clangStdenv, we don't know which, and CC=cc in all
32 # cases.) it's unclear exactly what should be done if we want those flags,
33 # but the defaults work fine.
34 makeFlags = [ "-r" "PREFIX=$(out)" ];
36 # fix up multi-output install. we also have to fix the pkg-config libdir
37 # file; it uses prefix=$out; libdir=${prefix}/lib, which is wrong in
38 # our case; libdir should really be set to the $lib output.
40 mkdir -p $lib $dev/lib
43 mv $out/include $dev/include
44 mv $out/share/pkgconfig $dev/lib/pkgconfig
47 for x in libfsm.pc libre.pc; do
48 substituteInPlace "$dev/lib/pkgconfig/$x" \
49 --replace 'libdir=''${prefix}/lib' "libdir=$lib/lib"
53 outputs = [ "out" "lib" "dev" ];
56 description = "DFA regular expression library & friends";
57 homepage = "https://github.com/katef/libfsm";
58 license = licenses.bsd2;
59 platforms = platforms.unix;
60 maintainers = with maintainers; [ thoughtpolice ];