Files
nixpkgs/pkgs/by-name/li/libfsm/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

71 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
bmake,
docbook_xsl,
libxslt,
}:
stdenv.mkDerivation rec {
pname = "libfsm";
version = "0.1pre2987_${builtins.substring 0 8 src.rev}";
src = fetchFromGitHub {
owner = "katef";
repo = "libfsm";
rev = "087e3389ad2cd5e5c40caeb40387e632567d7258";
hash = "sha256-XWrZxnRbMB609l+sYFf8VsXy3NxqBsBPUrHgKLIyu/I=";
fetchSubmodules = true;
};
nativeBuildInputs = [
bmake
docbook_xsl
libxslt # xsltproc
];
enableParallelBuilding = true;
enableParallelInstalling = false;
# 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.
makeFlags = [
"-r"
"PREFIX=$(out)"
];
# fix up multi-output install. we also have to fix the pkg-config libdir
# 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"
];
meta = with lib; {
description = "DFA regular expression library & friends";
homepage = "https://github.com/katef/libfsm";
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = with maintainers; [ thoughtpolice ];
};
}