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

79 lines
2.6 KiB
Nix
Raw Normal View History

2021-02-08 04:20:00 +00:00
{ lib, stdenv, fetchFromGitHub, ruby, dune_2, ocamlPackages
, ipaexfont, junicode, lmodern, lmmath
2018-12-07 04:11:02 +00:00
}:
2018-03-14 09:57:08 +00:00
let
2018-12-07 04:11:02 +00:00
camlpdf = ocamlPackages.camlpdf.overrideAttrs (o: {
src = fetchFromGitHub {
owner = "gfngfn";
repo = "camlpdf";
2020-08-27 06:12:52 +00:00
rev = "v2.3.1+satysfi";
sha256 = "1s8wcqdkl1alvfcj67lhn3qdz8ikvd1v64f4q6bi4c0qj9lmp30k";
2018-12-07 04:11:02 +00:00
};
});
otfm = ocamlPackages.otfm.overrideAttrs (o: {
src = fetchFromGitHub {
owner = "gfngfn";
repo = "otfm";
2020-02-13 09:20:00 +00:00
rev = "v0.3.7+satysfi";
sha256 = "0y8s0ij1vp1s4h5y1hn3ns76fzki2ba5ysqdib33akdav9krbj8p";
};
});
2020-08-27 06:12:52 +00:00
yojson-with-position = ocamlPackages.buildDunePackage {
pname = "yojson-with-position";
version = "1.4.2";
2020-02-13 09:20:00 +00:00
src = fetchFromGitHub {
owner = "gfngfn";
2020-08-27 06:12:52 +00:00
repo = "yojson-with-position";
rev = "v1.4.2+satysfi";
sha256 = "17s5xrnpim54d1apy972b5l08bph4c0m5kzbndk600fl0vnlirnl";
2018-12-07 04:11:02 +00:00
};
2020-08-27 06:12:52 +00:00
useDune2 = true;
nativeBuildInputs = [ ocamlPackages.cppo ];
propagatedBuildInputs = [ ocamlPackages.biniou ];
inherit (ocamlPackages.yojson) meta;
};
2018-03-14 09:57:08 +00:00
in
stdenv.mkDerivation rec {
pname = "satysfi";
2021-02-08 04:20:00 +00:00
version = "0.0.6";
2018-03-14 09:57:08 +00:00
src = fetchFromGitHub {
owner = "gfngfn";
repo = "SATySFi";
2018-12-07 04:11:02 +00:00
rev = "v${version}";
2021-02-08 04:20:00 +00:00
sha256 = "1wdmcz2b7v37msmsvjvbyj7x5a80qfws8a7w72q0g5959pw5fdxj";
2018-03-14 09:57:08 +00:00
fetchSubmodules = true;
};
preConfigure = ''
substituteInPlace src/frontend/main.ml --replace \
'/usr/local/share/satysfi"; "/usr/share/satysfi' \
$out/share/satysfi
'';
2020-08-27 06:12:52 +00:00
nativeBuildInputs = [ ruby dune_2 ];
2018-12-07 04:11:02 +00:00
2020-08-27 06:12:52 +00:00
buildInputs = [ camlpdf otfm yojson-with-position ] ++ (with ocamlPackages; [
ocaml findlib menhir menhirLib
2020-08-27 06:12:52 +00:00
batteries camlimages core_kernel ppx_deriving uutf omd cppo re
2018-12-07 04:11:02 +00:00
]);
2018-03-14 09:57:08 +00:00
installPhase = ''
2018-12-07 04:11:02 +00:00
cp -r ${ipaexfont}/share/fonts/opentype/* lib-satysfi/dist/fonts/
cp -r ${junicode}/share/fonts/junicode-ttf/* lib-satysfi/dist/fonts/
cp -r ${lmodern}/share/fonts/opentype/public/lm/* lib-satysfi/dist/fonts/
cp -r ${lmmath}/share/fonts/opentype/latinmodern-math.otf lib-satysfi/dist/fonts/
2018-03-14 09:57:08 +00:00
make install PREFIX=$out LIBDIR=$out/share/satysfi
2020-02-13 09:20:00 +00:00
mkdir -p $out/share/satysfi/
cp -r lib-satysfi/dist/ $out/share/satysfi/
2018-03-14 09:57:08 +00:00
'';
meta = with lib; {
homepage = "https://github.com/gfngfn/SATySFi";
2018-03-14 09:57:08 +00:00
description = "A statically-typed, functional typesetting system";
2021-02-08 04:20:00 +00:00
changelog = "https://github.com/gfngfn/SATySFi/blob/v${version}/CHANGELOG.md";
2021-02-08 14:06:00 +00:00
license = licenses.lgpl3Only;
2020-02-13 09:21:00 +00:00
maintainers = [ maintainers.mt-caret maintainers.marsam ];
2018-03-14 09:57:08 +00:00
platforms = platforms.all;
};
}