Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

satysfi: init at 2018-03-07 #36428

Merged
merged 5 commits into from Mar 14, 2018
Merged

satysfi: init at 2018-03-07 #36428

merged 5 commits into from Mar 14, 2018

Conversation

mt-caret
Copy link
Contributor

@mt-caret mt-caret commented Mar 7, 2018

Motivation for this change

A typesetting system.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mt-caret
Copy link
Contributor Author

ping @vbgl

@vbgl
Copy link
Contributor

vbgl commented Mar 10, 2018

@GrahamcOfBorg build ocaml-ng.ocamlPackages_4_06.satysfi

@vbgl
Copy link
Contributor

vbgl commented Mar 10, 2018

Since this is not an OCaml library, it does not belong to pkgs/top-level/ocaml-packages.nix, ocamlPackages, nor pkgs/development/ocaml-modules.

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/156xdjzrfhkwac2ibmac5zn64cr2b0zj-ocaml4.06.1-core_kernel-0.10.0
shrinking /nix/store/156xdjzrfhkwac2ibmac5zn64cr2b0zj-ocaml4.06.1-core_kernel-0.10.0/lib/ocaml/4.06.1/site-lib/core_kernel/core_kernel.cmxs
shrinking /nix/store/156xdjzrfhkwac2ibmac5zn64cr2b0zj-ocaml4.06.1-core_kernel-0.10.0/lib/ocaml/4.06.1/site-lib/core_kernel/base_for_tests/base_for_tests.cmxs
shrinking /nix/store/156xdjzrfhkwac2ibmac5zn64cr2b0zj-ocaml4.06.1-core_kernel-0.10.0/lib/ocaml/4.06.1/site-lib/stubslibs/dllcore_kernel_stubs.so
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/156xdjzrfhkwac2ibmac5zn64cr2b0zj-ocaml4.06.1-core_kernel-0.10.0/lib 
patching script interpreter paths in /nix/store/156xdjzrfhkwac2ibmac5zn64cr2b0zj-ocaml4.06.1-core_kernel-0.10.0
checking for references to /tmp/nix-build-ocaml4.06.1-core_kernel-0.10.0.drv-0 in /nix/store/156xdjzrfhkwac2ibmac5zn64cr2b0zj-ocaml4.06.1-core_kernel-0.10.0...
cannot build derivation ‘/nix/store/2sc1jqmd3mmj5dckscvjca3g86jmpap8-satysfi-2018-03-07.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/2sc1jqmd3mmj5dckscvjca3g86jmpap8-satysfi-2018-03-07.drv’ failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/m9s5m9mvn035gbc7d9ajif2ck73cwnr4-ocaml4.06.1-core_kernel-0.10.0
shrinking /nix/store/m9s5m9mvn035gbc7d9ajif2ck73cwnr4-ocaml4.06.1-core_kernel-0.10.0/lib/ocaml/4.06.1/site-lib/stubslibs/dllcore_kernel_stubs.so
shrinking /nix/store/m9s5m9mvn035gbc7d9ajif2ck73cwnr4-ocaml4.06.1-core_kernel-0.10.0/lib/ocaml/4.06.1/site-lib/core_kernel/core_kernel.cmxs
shrinking /nix/store/m9s5m9mvn035gbc7d9ajif2ck73cwnr4-ocaml4.06.1-core_kernel-0.10.0/lib/ocaml/4.06.1/site-lib/core_kernel/base_for_tests/base_for_tests.cmxs
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/m9s5m9mvn035gbc7d9ajif2ck73cwnr4-ocaml4.06.1-core_kernel-0.10.0/lib
patching script interpreter paths in /nix/store/m9s5m9mvn035gbc7d9ajif2ck73cwnr4-ocaml4.06.1-core_kernel-0.10.0
checking for references to /build in /nix/store/m9s5m9mvn035gbc7d9ajif2ck73cwnr4-ocaml4.06.1-core_kernel-0.10.0...
cannot build derivation '/nix/store/akzna1y18hmf0xvf3mf9j0q7r7200w7c-satysfi-2018-03-07.drv': 2 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/akzna1y18hmf0xvf3mf9j0q7r7200w7c-satysfi-2018-03-07.drv' failed

@mt-caret
Copy link
Contributor Author

Fixed.

@@ -0,0 +1,40 @@
{ stdenv, fetchzip, fetchFromGitHub, ocaml, ocamlbuild, findlib, menhir,
ppx_deriving, uutf, result, core_kernel, bitv, batteries, yojson, camlimages }:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take ocamlPackages as one argument all libraries separately?

homepage = https://github.com/gfngfn/SATySFi;
description = "A statically-typed, functional typesetting system";
license = licenses.lgpl3;
maintainers = [ maintainers.mt-caret ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a platforms attribute.

};
buildInputs = [ findlib menhir ppx_deriving uutf result core_kernel bitv
batteries yojson camlimages ];
nativeBuildInputs = [ ocaml ocamlbuild ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this split between buildInputs and nativeBuildInputs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guessed ocaml and ocamlbuild were only needed at build time. So this should all be in buildInputs?

lm-math = fetchzip {
url = "http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip";
sha256 = "15l3lxjciyjmbh0q6jjvzz16ibk4ij79in9fs47qhrfr2wrddpvs";
stripRoot = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s the purpose of this stripRoot here?

@vbgl
Copy link
Contributor

vbgl commented Mar 11, 2018

Does it work correctly? I tried the tests from https://github.com/gfngfn/SATySFi/tree/master/tests and got:

satysfi list.satyh math.satyh head.satyh first.saty -o output.pdf
 ---- ---- ---- ----
  target file: 'output.pdf'
! [Error] package file not found: dist/hash/default-font.satysfi-hash
make: *** [Makefile:4: all] Error 1

@mt-caret
Copy link
Contributor Author

Yeah, that's a known issue (gfngfn/SATySFi#17) (and probably one of the reasons why there's no official version out yet). Copying everything from ./dist to ~/.satysfi will fix it, but AFAIK that can't be done at build-time in Nix; I believe SATySFi currently looks for various files in hardcoded paths but that will change in the future.

@vbgl
Copy link
Contributor

vbgl commented Mar 11, 2018

It’s easy to fix these hardcoded paths at configure-time. With this change, I could compile the math1 example from the tests directory (other examples fail due to missing fonts).

@vbgl vbgl merged commit cce7d1b into NixOS:master Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants