-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add Nix support for more reproductive build #344
base: master
Are you sure you want to change the base?
Conversation
Currently can build by Copy src from https://github.com/NixOS/nixpkgs/blob/762b003329510ea855b4097a37511eb19c7077f0/pkgs/tools/typesetting/satysfi/default.nix However, it is completely dependent on the version of I found that |
Currently can't build document with png images ( supported in #329 ) and I don't know why Happens error Occurence (maybe) camlimage not successfully resolved as a dependency? |
Could you show us the displayed error message?
I think that that is unlikely. Succeeding in building SATySFi implies having succeeded in resolving dependency. |
I tried this branch and got an error like below: $ nix run ".#satysfi" -- ./tests/images/test.saty
...
---- ---- ---- ----
embedding fonts ...
! [Error] cannot load image file 'basn0g02.png';
unsupported This error seems to be raised by camlimages. I am afraid that camlimages is not built with png support. (It was not able to find libpng at configure time?) |
@leque Different output (more-detailed) when I switched to libpng12 (unpatched libpng 1.2.59)
|
I have tested with overriding the official definition file for satysfi, and I found that the problem may be cause of either |
The aforementioned test passes if I run
|
I have tested that I can build documents with pngs here as well, thank you very much!. This PR is now undrafted. |
I tried to build SATySFi by Nix with this branch and the latest
I updated the fixed flake version by diff --git a/flake.nix b/flake.nix
index 6dec7065..0cd943cf 100644
--- a/flake.nix
+++ b/flake.nix
@@ -38,7 +38,7 @@
pkgs = import nixpkgs {
inherit system;
overlays = [
- devshell.overlay
+ devshell.overlays.default
];
};
@@ -62,7 +62,7 @@
(inDirectory "lib-satysfi")
];
exclude = [".merlin"];
- }) {satysfi = null;};
+ }) {satysfi = "*";};
duneProjectOverlay = self: super: {
satysfi = super.satysfi.overrideAttrs (oa: {
doNixSupport = false;
diff --git a/satysfi.opam b/satysfi.opam
index 4a2ff9b6..282855e3 100644
--- a/satysfi.opam
+++ b/satysfi.opam
@@ -20,7 +20,7 @@ remove: [
]
# Packages whose version suffix is "+satysfi" are distributed on satysfi-external-repo.
depends: [
- "ocaml" {>= "4.12.0" & < "5.0.0"}
+ "ocaml" {>= "4.13.0" & < "5.0.0"}
"batteries" {>= "3.6.0" & < "4.0.0"}
"camlimages" {>= "5.0.1" & < "5.0.5"}
"camlpdf" {= "2.3.1+satysfi"} These two changes are for the new versions of - devshell.overlay
+ devshell.overlays.default
- }) {satysfi = null;};
+ }) {satysfi = "*";}; This change is for addressing issue where OCaml 4.12.0 was unable to be built by Nix for some reason. - "ocaml" {>= "4.12.0" & < "5.0.0"}
+ "ocaml" {>= "4.13.0" & < "5.0.0"} EDIT: This is unnecessary. OCaml 4.12.0 works with the changes that I commented below. |
Because the version of
--- a/flake.nix
+++ b/flake.nix
@@ -3,7 +3,15 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- opam-nix.url = "github:tweag/opam-nix";
+ opam-repository = {
+ url = "github:ocaml/opam-repository";
+ flake = false;
+ };
+ opam-nix = {
+ url = "github:tweag/opam-nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ inputs.opam-repository.follows = "opam-repository";
+ };
satysfi-external-repo = {
url = "github:gfngfn/satysfi-external-repo";
flake = false; --- a/flake.nix
+++ b/flake.nix
@@ -81,7 +81,7 @@
'/usr/local/share/satysfi"; "/usr/share/satysfi' \
$out/share/satysfi
'';
- installPhase = with pkgs; ''
+ installPhase = with pkgs; oa.installPhase + ''
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/
cp -r ${ipaexfont}/share/fonts/opentype/* lib-satysfi/dist/fonts/ |
My fixed version: 4d27f13...nsfisis:SATySFi:7fcd6f95452189790958124df44c21be77d1503f I merged the branch of this pull request into the latest master and added some fixes desribed above. |
Description
Added some Nix files for more reproducible (or more no (global) environment configuration) builds. Primary goal is making it easier to handle png supported upstream SATySFi with Nix.
I forgot to check before working this, a similar attempt was made several month ago. #322
Current Status
I tested on Linux (
x86_64-linux
) but may be able to inx86_64-darwin
. You need to enable Nix Flake.nix build ".#satysfi"
for buildsatysfi
executable binary andlib-satysfi
with fonts.nix build ".#doc-demo"
for build./demo/demo.saty
nix build ".#doc-lang"
for build./doc/doc-lang.saty
nix build ".#doc-primitives"
for build./doc/doc-primitives.saty
nix run ".#satysfi" -- ./tests/images/test.saty
or else to build document with latest version satysfi.All results to
./result