nixpkgs/pkgs/tools/typesetting/sile/default.nix

83 lines
2.5 KiB
Nix
Raw Normal View History

2020-02-11 08:02:00 +03:00
{ stdenv, darwin, fetchurl, makeWrapper, pkgconfig, autoconf, automake
, harfbuzz, icu
2017-02-04 20:30:00 +03:00
, fontconfig, lua, libiconv
, makeFontsConf, gentium
2017-02-04 20:30:00 +03:00
}:
with stdenv.lib;
let
2020-02-11 08:02:00 +03:00
luaEnv = lua.withPackages(ps: with ps;[cassowary cosmo compat53 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 {
pname = "sile";
version = "0.10.4";
2017-02-11 17:52:50 +03:00
src = fetchurl {
url = "https://github.com/sile-typesetter/sile/releases/download/v${version}/${pname}-${version}.tar.bz2";
sha256 = "08j2vv6spnzz8bsh62wbdv1pjiziiba71cadscsy5hw6pklzndni";
2017-02-11 17:52:50 +03:00
};
2017-02-04 20:30:00 +03:00
2020-02-11 08:02:00 +03:00
configureFlags = [ "--with-system-luarocks" ];
nativeBuildInputs = [ autoconf automake pkgconfig makeWrapper ];
buildInputs = [ harfbuzz icu fontconfig libiconv luaEnv ]
++ 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
FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [
gentium
];
};
2020-02-11 08:02:00 +03:00
# TODO: needs to tweak Makefile-fonts to avoid download fonts
doCheck = false; /*stdenv.targetPlatform == stdenv.hostPlatform
&& ! stdenv.isAarch64 # random seg. faults
&& ! stdenv.isDarwin; # dy lib not found
2020-02-11 08:02:00 +03:00
*/
enableParallelBuilding = true;
2020-02-11 08:02:00 +03:00
preBuild = stdenv.lib.optionalString stdenv.cc.isClang ''
substituteInPlace libtexpdf/dpxutil.c \
--replace "ASSERT(ht && ht->table && iter);" "ASSERT(ht && iter);"
'';
2020-02-11 08:02:00 +03:00
checkTarget = "examples";
2017-02-04 20:30:00 +03:00
postInstall = ''
install -D -t $out/share/doc/sile documentation/sile.pdf
2017-02-04 20:30:00 +03:00
'';
# Hack to avoid TMPDIR in RPATHs.
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
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 TeXfrom
which it borrows some concepts and even syntax and
algorithmsbut 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
'';
2020-02-11 08:02:00 +03:00
homepage = "https://sile-typesetter.org/";
platforms = platforms.unix;
license = licenses.mit;
2017-02-04 20:30:00 +03:00
};
}