nixpkgs/pkgs/tools/misc/foma/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.1 KiB
Nix
Raw Normal View History

2021-05-15 12:13:11 +00:00
{ lib, stdenv, fetchFromGitHub, zlib, flex, bison, readline, darwin }:
2021-01-07 02:54:02 +00:00
stdenv.mkDerivation rec {
pname = "foma";
version = "0.10.0alpha";
2021-01-07 02:54:02 +00:00
src = fetchFromGitHub {
owner = "mhulden";
repo = "foma";
rev = "82f9acdef234eae8b7619ccc3a386cc0d7df62bc";
sha256 = "1vf01l18j8cksnavbabcckp9gg692w6v5lg81xrzv6f5v14zp4nr";
2021-01-07 02:54:02 +00:00
};
2022-07-06 19:22:52 +00:00
sourceRoot = "${src.name}/foma";
2021-01-07 02:54:02 +00:00
2021-05-15 12:13:11 +00:00
nativeBuildInputs = [ flex bison ]
++ lib.optional stdenv.isDarwin darwin.cctools;
2021-01-07 02:54:02 +00:00
buildInputs = [ zlib readline ];
2021-05-15 12:13:11 +00:00
makeFlags = [
2022-07-06 19:22:52 +00:00
"CC:=$(CC)"
"RANLIB:=$(RANLIB)"
"prefix=$(out)"
] ++ lib.optionals (!stdenv.isDarwin) [
"AR:=$(AR)" # libtool is used for darwin
2021-05-15 12:13:11 +00:00
];
2021-01-07 02:54:02 +00:00
patchPhase = ''
substituteInPlace Makefile \
2022-07-06 19:22:52 +00:00
--replace '-ltermcap' ' '
2021-01-07 02:54:02 +00:00
'';
meta = with lib; {
2021-01-07 02:54:02 +00:00
description = "A multi-purpose finite-state toolkit designed for applications ranging from natural language processing to research in automata theory";
homepage = "https://github.com/mhulden/foma";
license = licenses.asl20;
maintainers = [ maintainers.tckmn ];
platforms = platforms.all;
};
}