Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 308706fe9edf
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f70b980def40
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jun 9, 2019

  1. sile: leverage lua environments

    allows to simplify the implementation quite a bit
    teto authored and vbgl committed Jun 9, 2019
    Copy the full SHA
    f70b980 View commit details
Showing with 4 additions and 20 deletions.
  1. +3 −17 pkgs/tools/typesetting/sile/default.nix
  2. +1 −3 pkgs/top-level/all-packages.nix
20 changes: 3 additions & 17 deletions pkgs/tools/typesetting/sile/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
{ stdenv, darwin, fetchurl, makeWrapper, pkgconfig
, harfbuzz, icu, lpeg, luaexpat, lua-zlib, luafilesystem, luasocket, luasec
, harfbuzz, icu
, fontconfig, lua, libiconv
, makeFontsConf, gentium, gentium-book-basic, dejavu_fonts
}:

with stdenv.lib;

let

libs = [ lpeg luaexpat lua-zlib luafilesystem luasocket luasec ];
getPath = lib : type : "${lib}/lib/lua/${lua.luaversion}/?.${type};${lib}/share/lua/${lua.luaversion}/?.${type}";
getLuaPath = lib : getPath lib "lua";
getLuaCPath = lib : getPath lib "so";
luaPath = concatStringsSep ";" (map getLuaPath libs);
luaCPath = concatStringsSep ";" (map getLuaCPath libs);
luaEnv = lua.withPackages(ps: with ps;[ lpeg luaexpat lua-zlib luafilesystem luasocket luasec]);

in

@@ -27,8 +21,7 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [pkgconfig makeWrapper];
buildInputs = [ harfbuzz icu lua fontconfig libiconv ]
++ libs
buildInputs = [ harfbuzz icu fontconfig libiconv luaEnv ]
++ optional stdenv.isDarwin darwin.apple_sdk.frameworks.AppKit
;

@@ -38,9 +31,6 @@ stdenv.mkDerivation rec {

NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework AppKit";

LUA_PATH = luaPath;
LUA_CPATH = luaCPath;

FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [
gentium
@@ -60,10 +50,6 @@ stdenv.mkDerivation rec {
'';

postInstall = ''
wrapProgram $out/bin/sile \
--set LUA_PATH "${luaPath};" \
--set LUA_CPATH "${luaCPath};" \
install -D -t $out/share/doc/sile documentation/*.pdf
'';

4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -5857,9 +5857,7 @@ in

silc_server = callPackage ../servers/silc-server { };

sile = callPackage ../tools/typesetting/sile {
inherit (lua52Packages) lua luaexpat lua-zlib luafilesystem lpeg luasocket luasec;
};
sile = callPackage ../tools/typesetting/sile { };

silver-searcher = callPackage ../tools/text/silver-searcher { };