Commit 3618ec6a authored by Doron Behar's avatar Doron Behar
Browse files

sile: nixfmt; move to pkgs/by-name

parent b83db93b
Loading
Loading
Loading
Loading
+77 −57
Original line number Diff line number Diff line
{ lib
, stdenv
, darwin
, fetchurl
, makeWrapper
, pkg-config
, poppler_utils
, gitMinimal
, harfbuzz
, icu
, fontconfig
, lua
, libiconv
, makeFontsConf
, gentium
, runCommand
, sile
{
  lib,
  stdenv,
  darwin,
  fetchurl,
  makeWrapper,
  pkg-config,
  poppler_utils,
  gitMinimal,
  harfbuzz,
  icu,
  fontconfig,
  lua,
  libiconv,
  makeFontsConf,
  gentium,
  runCommand,
  sile,
}:

let
  luaEnv = lua.withPackages(ps: with ps; [
  luaEnv = lua.withPackages (
    ps:
    with ps;
    [
      cassowary
      cldr
      cosmo
@@ -37,11 +41,14 @@ let
      luautf8
      penlight
      vstruct
  ] ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [
    ]
    ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [
      bit32
  ] ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [
    ]
    ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [
      compat53
  ]);
    ]
  );
in

stdenv.mkDerivation (finalAttrs: {
@@ -69,9 +76,7 @@ stdenv.mkDerivation (finalAttrs: {
    icu
    fontconfig
    libiconv
  ]
  ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.AppKit
  ;
  ] ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.AppKit;
  passthru = {
    # So it will be easier to inspect this environment, in comparison to others
    inherit luaEnv;
@@ -79,18 +84,25 @@ stdenv.mkDerivation (finalAttrs: {
    tests.test = lib.optionalAttrs (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) (
      runCommand "sile-test"
        {
          nativeBuildInputs = [ poppler_utils sile ];
          nativeBuildInputs = [
            poppler_utils
            sile
          ];
          inherit (finalAttrs) FONTCONFIG_FILE;
        } ''
        }
        ''
          output=$(mktemp -t selfcheck-XXXXXX.pdf)
          echo "<sile>foo</sile>" | sile -o $output -
          pdfinfo $output | grep "SILE v${finalAttrs.version}" > $out
      '');
        ''
    );
  };

  postPatch = ''
  postPatch =
    ''
      patchShebangs build-aux/*.sh
  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
    ''
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
      sed -i -e 's|@import AppKit;|#import <AppKit/AppKit.h>|' src/macfonts.m
    '';

@@ -118,7 +130,12 @@ stdenv.mkDerivation (finalAttrs: {
    done
  '';

  outputs = [ "out" "doc" "man" "dev" ];
  outputs = [
    "out"
    "doc"
    "man"
    "dev"
  ];

  meta = with lib; {
    description = "Typesetting system";
@@ -135,7 +152,10 @@ stdenv.mkDerivation (finalAttrs: {
    homepage = "https://sile-typesetter.org";
    changelog = "https://github.com/sile-typesetter/sile/raw/v${finalAttrs.version}/CHANGELOG.md";
    platforms = platforms.unix;
    maintainers = with maintainers; [ doronbehar alerque ];
    maintainers = with maintainers; [
      doronbehar
      alerque
    ];
    license = licenses.mit;
    mainProgram = "sile";
  };
+0 −4
Original line number Diff line number Diff line
@@ -12107,10 +12107,6 @@ with pkgs;
  silc_server = callPackage ../servers/silc-server { };
  sile = callPackage ../tools/typesetting/sile {
    lua = lua5_3;
  };
  silenthound = callPackage ../tools/security/silenthound { };
  silice = callPackage ../development/compilers/silice { };