sile: nixfmt; move to pkgs/by-name

This commit is contained in:
Doron Behar
2024-11-04 12:46:23 +02:00
parent b83db93b6b
commit 3618ec6a0a
2 changed files with 77 additions and 61 deletions
@@ -1,47 +1,54 @@
{ 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; [
cassowary
cldr
cosmo
fluent
linenoise
loadkit
lpeg
lua-zlib
lua_cliargs
luaepnf
luaexpat
luafilesystem
luarepl
luasec
luasocket
luautf8
penlight
vstruct
] ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [
bit32
] ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [
compat53
]);
luaEnv = lua.withPackages (
ps:
with ps;
[
cassowary
cldr
cosmo
fluent
linenoise
loadkit
lpeg
lua-zlib
lua_cliargs
luaepnf
luaexpat
luafilesystem
luarepl
luasec
luasocket
luautf8
penlight
vstruct
]
++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [
bit32
]
++ 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,20 +84,27 @@ 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
'');
}
''
output=$(mktemp -t selfcheck-XXXXXX.pdf)
echo "<sile>foo</sile>" | sile -o $output -
pdfinfo $output | grep "SILE v${finalAttrs.version}" > $out
''
);
};
postPatch = ''
patchShebangs build-aux/*.sh
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
sed -i -e 's|@import AppKit;|#import <AppKit/AppKit.h>|' src/macfonts.m
'';
postPatch =
''
patchShebangs build-aux/*.sh
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
sed -i -e 's|@import AppKit;|#import <AppKit/AppKit.h>|' src/macfonts.m
'';
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework AppKit";
@@ -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";
};
-4
View File
@@ -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 { };