johnwhitington / camlpdf

OCaml library for reading, writing and modifying PDF files
Other
200 stars 28 forks source link

Building camlpdf.top fails #52

Open glondu opened 1 year ago

glondu commented 1 year ago

Hi,

When updating the Debian package from 2.4 to 2.5.3, I get the following error:

[...]
ocamlmktop \
              \
             flatestubs.o rijndael-alg-fst.o stubs-aes.o sha2.o stubs-sha2.o        -g  -ccopt -Wl,-z,relro      -o camlpdf.top \
            pdfutil.cmo pdfio.cmo pdftransform.cmo pdfunits.cmo pdfpaper.cmo pdfcryptprimitives.cmo pdf.cmo pdfcrypt.cmo pdfflate.cmo pdfcodec.cmo pdfwrite.cmo pdfgenlex.cmo pdfread.cmo pdfjpeg.cmo pdfops.cmo pdfdest.cmo pdfmarks.cmo pdfpagelabels.cmo pdfpage.cmo pdfannot.cmo pdffun.cmo pdfspace.cmo pdfimage.cmo pdfafm.cmo pdfafmdata.cmo pdfglyphlist.cmo pdftext.cmo pdfstandard14.cmo pdfgraphics.cmo pdfshapes.cmo pdfdate.cmo pdfocg.cmo pdfcff.cmo pdftype1.cmo pdftruetype.cmo pdfmerge.cmo
File "_none_", line 1:
Error: Error while linking pdfcryptprimitives.cmo:
       The external function `camlpdf_caml_sha512' is not available
make[2]: *** [OCamlMakefile:966: camlpdf.top] Error 2
[...]
johnwhitington commented 1 year ago

Is this using a Debian-patched version of OCaml? Could you try with a vanilla opam install of OCaml instead as a first step?

glondu commented 1 year ago

Yes. Actually, the problem comes from building with NO_CUSTOM=y. However, without it, camlpdf.cma has the Force custom flag on... I've disabled building the toplevel for the time being.

johnwhitington commented 1 year ago

Is there anything for me to fix here? Is this an OCamlmakefile problem? Are these flags new in recent versions of OCaml?

glondu commented 1 year ago

An OCamlMakefile problem, I would say.

-custom has an history, which I can summarize (from memory) as follows:

This is why the package is built with NO_CUSTOM=y.

By the way, #load-ing camlpdf in the standard toplevel (or utop) seems to work. I do not see the value of building camlpdf.top.

johnwhitington commented 1 year ago

Thanks for the explanation. I've removed the building of camlpdf.top, and I'll leave this bug open to remind me to have another think about -custom for the next release.