texpresso: fix build on darwin

This commit is contained in:
Weijia Wang 2024-07-07 22:29:24 +02:00
parent ed490bc06b
commit 13514d5faa

View File

@ -19,6 +19,12 @@ stdenv.mkDerivation rec {
pname = "texpresso";
version = "0-unstable-2024-06-22";
postPatch = ''
substituteInPlace Makefile \
--replace-fail "CC=gcc" "CC=${stdenv.cc.targetPrefix}cc" \
--replace-fail "LDCC=g++" "LDCC=${stdenv.cc.targetPrefix}c++"
'';
nativeBuildInputs = [
makeWrapper
mupdf
@ -41,6 +47,10 @@ stdenv.mkDerivation rec {
buildFlags = [ "texpresso" ];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
"-Wno-error=implicit-function-declaration"
]);
installPhase = ''
runHook preInstall
install -Dm0755 -t "$out/bin/" "build/${pname}"
@ -70,5 +80,6 @@ stdenv.mkDerivation rec {
description = "Live rendering and error reporting for LaTeX";
maintainers = with lib.maintainers; [ nickhu ];
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
}