2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, bmake
|
2023-05-24 13:37:59 +00:00
|
|
|
, docbook_xsl
|
|
|
|
, libxslt
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libfsm";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.1pre2987_${builtins.substring 0 8 src.rev}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "katef";
|
|
|
|
repo = pname;
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "087e3389ad2cd5e5c40caeb40387e632567d7258";
|
|
|
|
hash = "sha256-XWrZxnRbMB609l+sYFf8VsXy3NxqBsBPUrHgKLIyu/I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
bmake
|
|
|
|
docbook_xsl
|
|
|
|
libxslt # xsltproc
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
enableParallelInstalling = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# note: build checks value of '$CC' to add some extra cflags, but we don't
|
|
|
|
# necessarily know which 'stdenv' someone chose, so we leave it alone (e.g.
|
|
|
|
# if we use stdenv vs clangStdenv, we don't know which, and CC=cc in all
|
|
|
|
# cases.) it's unclear exactly what should be done if we want those flags,
|
|
|
|
# but the defaults work fine.
|
2021-04-17 00:35:05 +00:00
|
|
|
makeFlags = [ "-r" "PREFIX=$(out)" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# fix up multi-output install. we also have to fix the pkg-config libdir
|
2020-04-24 23:36:52 +00:00
|
|
|
# file; it uses prefix=$out; libdir=${prefix}/lib, which is wrong in
|
|
|
|
# our case; libdir should really be set to the $lib output.
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $lib $dev/lib
|
|
|
|
|
|
|
|
mv $out/lib $lib/lib
|
|
|
|
mv $out/include $dev/include
|
|
|
|
mv $out/share/pkgconfig $dev/lib/pkgconfig
|
|
|
|
rmdir $out/share
|
|
|
|
|
|
|
|
for x in libfsm.pc libre.pc; do
|
|
|
|
substituteInPlace "$dev/lib/pkgconfig/$x" \
|
|
|
|
--replace 'libdir=''${prefix}/lib' "libdir=$lib/lib"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "DFA regular expression library & friends";
|
|
|
|
homepage = "https://github.com/katef/libfsm";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|