python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / typesetting / satysfi / default.nix
blob819112b53d34588861b7386b94873eff5989e775
1 { lib, stdenv, fetchFromGitHub, ruby, dune_2, ocamlPackages
2 , ipaexfont, junicode, lmodern, lmmath
3 }:
4 let
5   camlpdf = ocamlPackages.camlpdf.overrideAttrs (o: {
6     src = fetchFromGitHub {
7       owner = "gfngfn";
8       repo = "camlpdf";
9       rev = "v2.3.1+satysfi";
10       sha256 = "1s8wcqdkl1alvfcj67lhn3qdz8ikvd1v64f4q6bi4c0qj9lmp30k";
11     };
12   });
13   otfm = ocamlPackages.otfm.overrideAttrs (o: {
14     src = fetchFromGitHub {
15       owner = "gfngfn";
16       repo = "otfm";
17       rev = "v0.3.7+satysfi";
18       sha256 = "0y8s0ij1vp1s4h5y1hn3ns76fzki2ba5ysqdib33akdav9krbj8p";
19     };
20   });
21   yojson-with-position = ocamlPackages.buildDunePackage {
22     pname = "yojson-with-position";
23     version = "1.4.2";
24     src = fetchFromGitHub {
25       owner = "gfngfn";
26       repo = "yojson-with-position";
27       rev = "v1.4.2+satysfi";
28       sha256 = "17s5xrnpim54d1apy972b5l08bph4c0m5kzbndk600fl0vnlirnl";
29     };
30     useDune2 = true;
31     nativeBuildInputs = [ ocamlPackages.cppo ];
32     propagatedBuildInputs = [ ocamlPackages.biniou ];
33     inherit (ocamlPackages.yojson) meta;
34   };
36   stdenv.mkDerivation rec {
37     pname = "satysfi";
38     version = "0.0.8";
39     src = fetchFromGitHub {
40       owner = "gfngfn";
41       repo = "SATySFi";
42       rev = "v${version}";
43       sha256 = "sha256-cVGe1N3qMlEGAE/jPUji/X3zlijadayka1OL6iFioY4=";
44       fetchSubmodules = true;
45     };
47     preConfigure = ''
48       substituteInPlace src/frontend/main.ml --replace \
49       '/usr/local/share/satysfi"; "/usr/share/satysfi' \
50       $out/share/satysfi
51     '';
53     DUNE_PROFILE = "release";
55     nativeBuildInputs = [ ruby dune_2 ];
57     buildInputs = [ camlpdf otfm yojson-with-position ] ++ (with ocamlPackages; [
58       ocaml findlib menhir menhirLib
59       batteries camlimages core_kernel ppx_deriving uutf omd cppo re
60     ]);
62     installPhase = ''
63       cp -r ${ipaexfont}/share/fonts/opentype/* lib-satysfi/dist/fonts/
64       cp -r ${junicode}/share/fonts/junicode-ttf/* lib-satysfi/dist/fonts/
65       cp -r ${lmodern}/share/fonts/opentype/public/lm/* lib-satysfi/dist/fonts/
66       cp -r ${lmmath}/share/fonts/opentype/latinmodern-math.otf lib-satysfi/dist/fonts/
67       make install PREFIX=$out LIBDIR=$out/share/satysfi
68       mkdir -p $out/share/satysfi/
69       cp -r lib-satysfi/dist/ $out/share/satysfi/
70     '';
72     meta = with lib; {
73       homepage = "https://github.com/gfngfn/SATySFi";
74       description = "A statically-typed, functional typesetting system";
75       changelog = "https://github.com/gfngfn/SATySFi/blob/v${version}/CHANGELOG.md";
76       license = licenses.lgpl3Only;
77       maintainers = [ maintainers.mt-caret maintainers.marsam ];
78       platforms = platforms.all;
79     };
80   }