about summary refs log tree commit diff
path: root/pkgs/tools/typesetting/sile/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/typesetting/sile/default.nix')
-rw-r--r--pkgs/tools/typesetting/sile/default.nix94
1 files changed, 63 insertions, 31 deletions
diff --git a/pkgs/tools/typesetting/sile/default.nix b/pkgs/tools/typesetting/sile/default.nix
index a8969fd459854..209385c378eab 100644
--- a/pkgs/tools/typesetting/sile/default.nix
+++ b/pkgs/tools/typesetting/sile/default.nix
@@ -1,37 +1,78 @@
-{ stdenv, darwin, fetchurl, makeWrapper, pkgconfig, autoconf, automake
-, harfbuzz, icu
-, fontconfig, lua, libiconv
-, makeFontsConf, gentium
+{ stdenv
+, darwin
+, fetchurl
+, makeWrapper
+, pkg-config
+, autoconf
+, automake
+, poppler_utils
+, harfbuzz
+, icu
+, fontconfig
+, lua
+, libiconv
+, makeFontsConf
+, gentium
 }:
 
-with stdenv.lib;
-
 let
-  luaEnv = lua.withPackages(ps: with ps;[cassowary cosmo compat53 linenoise lpeg lua-zlib lua_cliargs luaepnf luaexpat luafilesystem luarepl luasec luasocket stdlib vstruct]);
-
+  luaEnv = lua.withPackages(ps: with ps; [
+    cassowary
+    cosmo
+    compat53
+    linenoise
+    lpeg
+    lua-zlib
+    lua_cliargs
+    luaepnf
+    luaexpat
+    luafilesystem
+    luarepl
+    luasec
+    luasocket
+    stdlib
+    vstruct
+  ]);
 in
 
 stdenv.mkDerivation rec {
   pname = "sile";
-  version = "0.10.4";
+  version = "0.10.9";
 
   src = fetchurl {
-    url = "https://github.com/sile-typesetter/sile/releases/download/v${version}/${pname}-${version}.tar.bz2";
-    sha256 = "08j2vv6spnzz8bsh62wbdv1pjiziiba71cadscsy5hw6pklzndni";
+    url = "https://github.com/sile-typesetter/sile/releases/download/v${version}/${pname}-${version}.tar.xz";
+    sha256 = "0r55c1nz5bkgzfviw72lyh38nls9s49zi3pja7mld6q5dclazsj4";
   };
 
-  configureFlags = [ "--with-system-luarocks" ];
-
-  nativeBuildInputs = [ autoconf automake pkgconfig makeWrapper ];
-  buildInputs = [ harfbuzz icu fontconfig libiconv luaEnv ]
-  ++ optional stdenv.isDarwin darwin.apple_sdk.frameworks.AppKit
+  configureFlags = [
+    "--with-system-luarocks"
+    "--with-manual"
+  ];
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    pkg-config
+    makeWrapper
+  ];
+  buildInputs = [
+    harfbuzz
+    icu
+    fontconfig
+    libiconv
+    luaEnv
+  ]
+  ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AppKit
   ;
+  checkInputs = [
+    poppler_utils
+  ];
 
-  preConfigure = optionalString stdenv.isDarwin ''
+  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i -e 's|@import AppKit;|#import <AppKit/AppKit.h>|' src/macfonts.m
   '';
 
-  NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework AppKit";
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-framework AppKit";
 
   FONTCONFIG_FILE = makeFontsConf {
     fontDirectories = [
@@ -39,11 +80,7 @@ stdenv.mkDerivation rec {
     ];
   };
 
-  # 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
- */
+  doCheck = true;
 
   enableParallelBuilding = true;
 
@@ -52,18 +89,12 @@ stdenv.mkDerivation rec {
       --replace "ASSERT(ht && ht->table && iter);" "ASSERT(ht && iter);"
   '';
 
-  checkTarget = "examples";
-
-  postInstall = ''
-    install -D -t $out/share/doc/sile documentation/sile.pdf
-  '';
-
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
 
-  outputs = [ "out" "doc" ];
+  outputs = [ "out" "doc" "man" "dev" ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A typesetting system";
     longDescription = ''
       SILE is a typesetting system; its job is to produce beautiful
@@ -77,6 +108,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = "https://sile-typesetter.org/";
     platforms = platforms.unix;
+    maintainers = with maintainers; [ doronbehar alerque ];
     license = licenses.mit;
   };
 }