2017-03-26 11:35:10 +03:00
|
|
|
{ stdenv, darwin, fetchurl, makeWrapper, pkgconfig
|
2019-06-06 10:31:23 +03:00
|
|
|
, harfbuzz, icu
|
2017-02-04 20:30:00 +03:00
|
|
|
, fontconfig, lua, libiconv
|
2020-01-15 11:33:31 +03:00
|
|
|
, makeFontsConf, gentium
|
2017-02-04 20:30:00 +03:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
2020-02-05 11:57:54 +03:00
|
|
|
luaEnv = lua.withPackages(ps: with ps;[cassowary cosmo linenoise lpeg lua-zlib lua_cliargs luaepnf luaexpat luafilesystem luarepl luasec luasocket stdlib vstruct]);
|
2017-02-04 20:30:00 +03:00
|
|
|
|
2017-02-11 17:52:50 +03:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "sile";
|
2020-02-05 11:57:54 +03:00
|
|
|
version = "0.10.3";
|
2017-02-11 17:52:50 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-01-15 11:33:31 +03:00
|
|
|
url = "https://github.com/sile-typesetter/sile/releases/download/v${version}/${pname}-${version}.tar.bz2";
|
2020-02-05 11:57:54 +03:00
|
|
|
sha256 = "d89d5ce7d2bf46fb062e5299ffd8b5d821dc3cb3462a0e7c1109edeee111d856";
|
2017-02-11 17:52:50 +03:00
|
|
|
};
|
2017-02-04 20:30:00 +03:00
|
|
|
|
|
|
|
nativeBuildInputs = [pkgconfig makeWrapper];
|
2019-06-06 10:31:23 +03:00
|
|
|
buildInputs = [ harfbuzz icu fontconfig libiconv luaEnv ]
|
2017-03-26 11:35:10 +03:00
|
|
|
++ 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";
|
2017-02-04 20:30:00 +03:00
|
|
|
|
2019-03-05 13:03:59 +03:00
|
|
|
FONTCONFIG_FILE = makeFontsConf {
|
|
|
|
fontDirectories = [
|
|
|
|
gentium
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = stdenv.targetPlatform == stdenv.hostPlatform
|
|
|
|
&& ! stdenv.isAarch64 # random seg. faults
|
|
|
|
&& ! stdenv.isDarwin; # dy lib not found
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
2020-01-24 23:57:43 +03:00
|
|
|
make examples
|
2019-03-05 13:03:59 +03:00
|
|
|
'';
|
|
|
|
|
2017-02-04 20:30:00 +03:00
|
|
|
postInstall = ''
|
2020-01-15 11:33:31 +03:00
|
|
|
install -D -t $out/share/doc/sile documentation/sile.pdf
|
|
|
|
install -D -t $out/share/doc/sile examples
|
2017-02-04 20:30:00 +03:00
|
|
|
'';
|
|
|
|
|
2017-05-18 12:39:00 +03:00
|
|
|
# Hack to avoid TMPDIR in RPATHs.
|
|
|
|
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
|
|
|
|
2019-03-05 13:03:59 +03:00
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
2017-02-04 20:30:00 +03:00
|
|
|
meta = {
|
|
|
|
description = "A typesetting system";
|
|
|
|
longDescription = ''
|
2017-02-11 17:52:50 +03:00
|
|
|
SILE is a typesetting system; its job is to produce beautiful
|
|
|
|
printed documents. Conceptually, SILE is similar to TeX—from
|
|
|
|
which it borrows some concepts and even syntax and
|
|
|
|
algorithms—but the similarities end there. Rather than being a
|
|
|
|
derivative of the TeX family SILE is a new typesetting and
|
|
|
|
layout engine written from the ground up using modern
|
|
|
|
technologies and borrowing some ideas from graphical systems
|
|
|
|
such as InDesign.
|
2017-02-04 20:30:00 +03:00
|
|
|
'';
|
2017-03-26 11:35:10 +03:00
|
|
|
homepage = http://www.sile-typesetter.org;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.mit;
|
2017-02-04 20:30:00 +03:00
|
|
|
};
|
|
|
|
}
|