From 57a2ace07e49df0d95acfb1f1eaf91a8eb0145f1 Mon Sep 17 00:00:00 2001 From: paparodeo <170618376+paparodeo@users.noreply.github.com> Date: Sat, 25 May 2024 09:35:19 +0000 Subject: [PATCH] foma: 0.10.0alpha -> 0.10.0alpha-unstable-03-13-2024 - https://github.com/mhulden/foma/compare/82f9acdef234eae8b7619ccc3a386cc0d7df62bc...e0d8122bda4bbd56f18510bdfe840617f9736ae7 - build switched from make to cmake - fixes darwin --- pkgs/tools/misc/foma/default.nix | 33 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/pkgs/tools/misc/foma/default.nix b/pkgs/tools/misc/foma/default.nix index 5d82f699e7d8..aecc13f88e25 100644 --- a/pkgs/tools/misc/foma/default.nix +++ b/pkgs/tools/misc/foma/default.nix @@ -1,35 +1,32 @@ -{ lib, stdenv, fetchFromGitHub, zlib, flex, bison, readline, darwin }: +{ lib, stdenv, fetchFromGitHub, bison, cmake, flex, pkg-config, readline, zlib }: stdenv.mkDerivation rec { pname = "foma"; - version = "0.10.0alpha"; + version = "0.10.0alpha-unstable-03-13-2024"; src = fetchFromGitHub { owner = "mhulden"; repo = "foma"; - rev = "82f9acdef234eae8b7619ccc3a386cc0d7df62bc"; - sha256 = "1vf01l18j8cksnavbabcckp9gg692w6v5lg81xrzv6f5v14zp4nr"; + rev = "e0d8122bda4bbd56f18510bdfe840617f9736ae7"; + hash = "sha256-UbwuHTilKWo4sVD3igcSlTqH78N6JQFvRD35QwfoX10="; }; sourceRoot = "${src.name}/foma"; - nativeBuildInputs = [ flex bison ] - ++ lib.optional stdenv.isDarwin darwin.cctools; - buildInputs = [ zlib readline ]; + outputs = [ "out" "dev" ]; - makeFlags = [ - "CC:=$(CC)" - "RANLIB:=$(RANLIB)" - "prefix=$(out)" - ] ++ lib.optionals (!stdenv.isDarwin) [ - "AR:=$(AR)" # libtool is used for darwin + nativeBuildInputs = [ bison cmake flex pkg-config ]; + buildInputs = [ readline zlib ]; + + cmakeFlags = [ + # the cmake package does not handle absolute CMAKE_INSTALL_XXXDIR + # correctly (setting it to an absolute path causes include files to go to + # $out/$out/include, because the absolute path is interpreted with root at + # $out). + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBDIR=lib" ]; - patchPhase = '' - substituteInPlace Makefile \ - --replace '-ltermcap' ' ' - ''; - meta = with lib; { 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";