sile: on Darwin, use AppKit for font selection

This commit is contained in:
Vincent Laporte 2017-03-26 08:35:10 +00:00
parent 61c43a0f86
commit 4a8b2c2942

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, pkgconfig
{ stdenv, darwin, fetchurl, makeWrapper, pkgconfig
, harfbuzz, icu, lpeg, luaexpat, luazlib, luafilesystem
, fontconfig, lua, libiconv
}:
@ -26,7 +26,15 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [pkgconfig makeWrapper];
buildInputs = [ harfbuzz icu lua lpeg luaexpat luazlib luafilesystem fontconfig libiconv ];
buildInputs = [ harfbuzz icu lua lpeg luaexpat luazlib luafilesystem fontconfig libiconv ]
++ optional stdenv.isDarwin darwin.apple_sdk.frameworks.AppKit
;
preConfigure = optionalString stdenv.isDarwin ''
sed -i -e 's|@import AppKit;|#import <AppKit/AppKit.h>|' src/macfonts.m
'';
NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework AppKit";
LUA_PATH = luaPath;
LUA_CPATH = luaCPath;
@ -49,8 +57,8 @@ stdenv.mkDerivation rec {
technologies and borrowing some ideas from graphical systems
such as InDesign.
'';
homepage = "http://www.sile-typesetter.org";
platforms = stdenv.lib.platforms.unix;
license = stdenv.lib.licenses.mit;
homepage = http://www.sile-typesetter.org;
platforms = platforms.unix;
license = licenses.mit;
};
}