From 4a8b2c29420ef11af6d9abad8d8b6710eb397a23 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 26 Mar 2017 08:35:10 +0000 Subject: [PATCH] sile: on Darwin, use AppKit for font selection --- pkgs/tools/typesetting/sile/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/typesetting/sile/default.nix b/pkgs/tools/typesetting/sile/default.nix index 382219a0a3a3..2c34a9aff32b 100644 --- a/pkgs/tools/typesetting/sile/default.nix +++ b/pkgs/tools/typesetting/sile/default.nix @@ -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 |' 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; }; }