From eb91a0daf73d30d17a312fe28363e22fc5a566b8 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Thu, 23 May 2024 11:34:01 +0200 Subject: [PATCH 1/2] add patches from opam-repository --- patches/0install/0install.install | 19 + patches/0install/gui_gtk_dir.patch | 13 + patches/CamlGI/CamlGI.install | 1 + patches/FrontC/FrontC.install | 6 + patches/FrontC/META.3.4 | 5 + patches/FrontC/META.3.4.1 | 5 + patches/FrontC/META.3.4.2 | 5 + patches/FrontC/fix-cmxs-cmx.patch | 31 + patches/FrontC/opam.patch.3.4 | 25 + patches/FrontC/opam.patch.3.4.1 | 25 + patches/FrontC/opam.patch.3.4.2 | 25 + patches/abella/abella.install.2.0.2 | 1 + patches/abella/abella.install.2.0.3 | 120 + patches/abella/abella.install.2.0.4 | 125 + patches/abella/abella.install.2.0.5 | 129 + patches/aez/META.0.3 | 6 + patches/afl-persistent/config.patch | 19 + patches/afl/add-uninstall-target.patch.2.52b | 23 + patches/afl/add-uninstall-target.patch.2.57b | 21 + patches/agrep/META.1.0 | 5 + patches/agrep/find-install.patch | 29 + patches/aifad/_oasis_remove_.ml | 7 + patches/aifad/aifad.install | 6 + patches/aio/meta.patch | 9 + patches/alphaCaml/alphaCaml.install | 1 + patches/alt-ergo-free/dune-3-fix.patch | 37 + ...makefile.user_replace_echo_by_printf.patch | 29 + .../patch_for_changes_in_num_library.patch | 62 + patches/alt-ergo-lib-free/dune-3-fix.patch | 37 + patches/alt-ergo-lib/version_update.patch | 13 + .../alt-ergo-parsers-free/dune-3-fix.patch | 37 + patches/alt-ergo-parsers/version_update.patch | 13 + .../0001-fix-uninstall-lib-in-Makefile.patch | 24 + patches/alt-ergo/alt-ergo.install.0.95.2 | 1 + patches/alt-ergo/alt-ergo.install.0.99.1 | 3 + .../alt-ergo/compile-with-OCaml-4.04.patch | 23 + ...makefile.user_replace_echo_by_printf.patch | 29 + .../patch_for_changes_in_num_library.patch | 62 + patches/alt-ergo/version_update.patch | 13 + patches/altgr-ergo/altgr-ergo.install.0.95.2 | 1 + patches/altgr-ergo/altgr-ergo.install.0.99.1 | 3 + patches/altgr-ergo/version_update.patch | 13 + patches/apalogretrieve/apalogretrieve.install | 1 + patches/apron/docker-workaround.diff | 36 + patches/arakoon/opam.patch | 23 + patches/archimedes/archimedes.install | 4 + .../0001-bigarray-compat.patch | 31 + patches/async/disable_warn_error.patch | 11 + patches/async_core/disable_warn_error.patch | 11 + patches/async_extra/disable_warn_error.patch | 11 + patches/async_extra/patch-errno.diff | 10 + patches/async_unix/disable_warn_error.patch | 11 + patches/atd/atd.install.1.0.2 | 1 + patches/atd/atd.install.1.0.3 | 1 + patches/atd/atd.install.1.1.0 | 1 + patches/atd/atd.install.1.1.1 | 1 + patches/atd/atd.install.1.1.2 | 1 + patches/atd/atd.install.1.2.0 | 1 + patches/atd/atd.install.1.2.1 | 87 + patches/atdgen/atdgen.install.1.10.0 | 6 + patches/atdgen/atdgen.install.1.2.2 | 4 + patches/atdgen/atdgen.install.1.2.3 | 4 + patches/atdgen/atdgen.install.1.2.4 | 4 + patches/atdgen/atdgen.install.1.3.0 | 4 + patches/atdgen/atdgen.install.1.3.1 | 4 + patches/atdgen/atdgen.install.1.4.0 | 4 + patches/atdgen/atdgen.install.1.4.1 | 4 + patches/atdgen/atdgen.install.1.5.0 | 4 + patches/atdgen/atdgen.install.1.6.0 | 4 + patches/atdgen/atdgen.install.1.6.1 | 4 + patches/atdgen/atdgen.install.1.7.1 | 4 + patches/atdgen/atdgen.install.1.7.2 | 4 + patches/atdgen/atdgen.install.1.8.0 | 6 + patches/atdgen/atdgen.install.1.9.0 | 6 + patches/atdgen/atdgen.install.1.9.1 | 6 + patches/atdj/atdj.install | 2 + patches/atomic/META.atomic | 4 + patches/atomic/atomic.install | 3 + patches/bamboo/bamboo.install | 5 + patches/bap-ida-python/bap.cfg.in | 2 + patches/bap-llvm/detect.travis | 5 + patches/bap-x86/setup-llvm-version.sh | 5 + patches/base-metaocaml-ocamlfind/META.base | 7 + .../base-metaocaml-ocamlfind/metaocaml.conf | 2 + .../metaocaml.native.conf | 3 + patches/base-native-int63/META.0.1 | 1 + .../base-native-int63.install | 1 + patches/base/metaocaml.patch | 13 + patches/batteries/cloexec.patch | 15 + patches/bdd/bdd.obuild | 32 + patches/beluga/beluga.install.0.5 | 2 + patches/beluga/beluga.install.0.8 | 2 + patches/beluga/beluga.install.0.8.1 | 2 + patches/beluga/beluga.install.0.8.2 | 2 + patches/bes/bes.install | 4 + patches/bibtex2html/0001-make-uninstall.patch | 29 + patches/bibtex2html/make-uninstall.patch | 29 + patches/bigbro/bigbro.install | 1 + patches/bigbro/opam.patch | 41 + patches/bin_prot/disable_warn_error.patch | 11 + patches/bin_prot/fix-arm-double-field.diff | 29 + patches/biniou/biniou.install.1.0.12 | 4 + patches/biniou/biniou.install.1.0.13 | 4 + patches/biniou/biniou.install.1.0.5 | 1 + patches/biniou/biniou.install.1.0.6 | 1 + patches/biniou/biniou.install.1.0.9 | 1 + patches/biniou/biniou.install.1.1.0 | 4 + patches/bisect/bisect.install | 4 + patches/bisect/install-thread.patch | 28 + patches/bisect/opam.patch.1.1 | 31 + patches/bisect/opam.patch.1.3 | 49 + patches/bisect_ppx/bisect_ppx.install.0.1 | 4 + patches/bisect_ppx/bisect_ppx.install.0.2 | 4 + patches/bisect_ppx/bisect_ppx.install.0.2.2 | 4 + patches/bisect_ppx/bisect_ppx.install.0.2.3 | 4 + patches/bisect_ppx/bisect_ppx.install.0.2.4 | 4 + patches/bisect_ppx/bisect_ppx.install.0.2.5 | 4 + patches/bisect_ppx/bisect_ppx.install.0.2.6 | 4 + patches/bisect_ppx/bisect_ppx.install.1.0.0 | 4 + patches/bisect_ppx/bisect_ppx.install.1.0.1 | 4 + patches/bisect_ppx/bisect_ppx.install.1.1.0 | 4 + patches/bisect_ppx/bisect_ppx.install.1.2.0 | 4 + ...7ee561c3e660dc33a6938346abf7354a23d4.patch | 48 + patches/bitstring/fix_402.patch | 341 + patches/bitstring/fix_404.patch | 10 + patches/bitv/META.1.0 | 5 + patches/bitv/bitv.install | 8 + patches/bolt/opam.bolt.META.patch | 10 + patches/bolt/opam.patch.1.2 | 22 + patches/bolt/opam.patch.1.3 | 22 + patches/bolt/opam.patch.1.4 | 21 + patches/boomerang/boomerang.install | 5 + patches/brotli/_oasis_remove_.ml | 7 + patches/brotli/brotli.install | 6 + patches/brozip/_oasis_remove_.ml | 7 + patches/brozip/brozip.install | 6 + patches/bsdowl/bsdowl.install | 59 + patches/bsdowl/remove.sh.2.2 | 5 + patches/bsdowl/remove.sh.3.0.0-20150401 | 5 + patches/bsdowl/remove.sh.3.0.0-20150830 | 5 + patches/bt/bt.install | 4 + patches/cairo/META.1.2.0 | 24 + patches/cairo/configure_fontconfig.patch | 23 + patches/cairo/configure_lablgtkdir.patch | 13 + patches/cairo/opam.patch | 12 + patches/cairo/opam.patch.in | 34 + patches/caml2html/caml2html.install | 1 + patches/camlhighlight/camlhighlight.install | 1 + patches/camlhighlight/sexp-dir.patch.in.3.0 | 12 + patches/camlhighlight/sexp-dir.patch.in.4.0 | 12 + patches/camlhighlight/sexp-dir.patch.in.5.0 | 12 + patches/camlidl/META.1.05 | 4 + patches/camlidl/META.1.07 | 4 + patches/camlidl/META.1.09 | 5 + patches/camlidl/META.1.10 | 5 + patches/camlidl/META.1.11 | 5 + patches/camlidl/META.1.12 | 5 + patches/camlidl/build-dll.diff | 24 + patches/camlidl/camlidl.install.1.05 | 19 + patches/camlidl/camlidl.install.1.07 | 21 + patches/camlidl/camlidl.install.1.09 | 21 + patches/camlidl/camlidl.install.1.10 | 21 + patches/camlidl/camlidl.install.1.11 | 21 + patches/camlidl/camlidl.install.1.12 | 21 + patches/camlidl/cpp-location.diff | 15 + patches/camlidl/disable-fatal-warn-31.diff | 24 + .../camlimages.4.1.0.build_fix.patch | 12 + patches/camlmix/camlmix.install | 1 + ...53725465260556832398096cef8d3f20b49d.patch | 28 + patches/camlp4/safe-string.patch | 79 + patches/camlp4/termux.patch | 40 + patches/camlp5/camlp5.install.6.04 | 11 + patches/camlp5/camlp5.install.6.06 | 11 + patches/camlp5/camlp5.install.6.07 | 12 + patches/camlp5/camlp5.install.6.11 | 12 + patches/camlp5/camlp5.install.6.12 | 12 + patches/camlp5/camlp5.install.6.13 | 12 + patches/camlp5/camlp5.install.6.14 | 12 + patches/camlp5/camlp5.install.6.15 | 12 + patches/camlp5/camlp5.install.6.16 | 12 + patches/camlp5/camlp5.install.6.17 | 12 + patches/camlp5/camlp5.install.7.00 | 12 + patches/camlp5/camlp5.install.7.01 | 12 + patches/camlp5/camlp5.install.7.03 | 12 + patches/camlp5/camlp5.install.7.05 | 12 + patches/camlp5/camlp5.install.7.06 | 12 + .../camlp5/camlp5.install.7.06.10-g84ce6cc4 | 12 + patches/camlp5/camlp5.install.7.08 | 12 + patches/camlpdf/int.patch | 20 + patches/camlpdf/unsafe_string.patch | 13 + patches/camltc/osx.patch | 31 + patches/camlzip/META.1.04 | 7 + patches/camlzip/build_with_trunk.patch.1.05 | 33 + patches/camlzip/build_with_trunk.patch.1.06 | 33 + patches/camlzip/camlzip-install.diff | 42 + patches/camlzip/camlzip.install | 5 + patches/camlzip/fix-install.patch.1.05 | 63 + patches/camlzip/fix-install.patch.1.06 | 76 + patches/camlzip/no-L.patch | 52 + patches/camomile/4.05-typing-fix.patch | 43 + patches/camomile/cmx.patch | 15 + patches/camomile/cmxs.patch | 57 + patches/camomile/no-camlp4.patch | 757 +++ patches/caradoc/caradoc.install | 4 + patches/caradoc/no_warn_error.patch | 10 + patches/cca/cca.install.0.1 | 21 + patches/cca/cca.install.0.2 | 21 + patches/cca/cca.install.0.4 | 21 + patches/cca/cca.install.0.5 | 21 + patches/cca/cca.install.0.6.2 | 21 + patches/cca/cca.install.0.7 | 21 + patches/cduce/cduce.install | 1 + patches/cgi/ocamlfind.patch | 56 + patches/chamo/chamo.install | 5 + patches/checkseum/mirage.patch | 8 + patches/choice/ocamldoc-3.12.1-fix.patch | 48 + patches/cil/cil.install | 1 + patches/cil/format-obj-magic.patch | 13 + .../clangml/build_with_bigger_stack_size.sh | 7 + patches/clangml/clangml.install | 3 + patches/cmdliner/backport_pre_4_00_0.patch | 30 + patches/coccinelle/install-python-fix.patch | 24 + patches/coccinelle/opam.patch | 41 + .../cohttp/0001-revert-header-change.patch | 44 + patches/colibrics/big_constant.patch | 23 + patches/combine/META.0.42 | 5 + patches/combine/combine.install | 1 + patches/combine/install.diff | 21 + patches/commonjs_of_ocaml/_oasis_remove_.ml | 7 + .../commonjs_of_ocaml.install | 6 + patches/comparelib/disable_warn_error.patch | 11 + patches/conf-bap-llvm/configure | 45 + patches/conf-bap-llvm/find-llvm.ml.in.1.1 | 148 + patches/conf-bap-llvm/find-llvm.ml.in.1.2 | 148 + patches/conf-bap-llvm/find-llvm.ml.in.1.3 | 148 + patches/conf-bap-llvm/find-llvm.ml.in.1.4 | 148 + patches/conf-bap-llvm/find-llvm.ml.in.1.5 | 146 + patches/conf-bap-llvm/find-llvm.ml.in.1.6 | 155 + patches/conf-bap-llvm/find-llvm.ml.in.1.7 | 183 + patches/conf-bap-llvm/find-llvm.ml.in.1.8 | 183 + patches/conf-binutils/find-binutils.ml.in.0.1 | 132 + patches/conf-binutils/find-binutils.ml.in.0.2 | 146 + patches/conf-binutils/find-binutils.ml.in.0.3 | 221 + patches/conf-blas/test-win.sh | 4 + patches/conf-blas/test.c | 10 + patches/conf-bluetooth/test-unix.c | 13 + patches/conf-bmake/detect_program.sh | 43 + patches/conf-cmake/configure.sh | 11 + patches/conf-dbm/test_gdbm.c | 7 + patches/conf-dbm/test_ndbm.c | 8 + patches/conf-env-travis/configure | 22 + patches/conf-fswatch/test.c | 5 + patches/conf-fts/test.c | 6 + patches/conf-gmp-paths/test-gmp.c | 7 + patches/conf-gmp-powm-sec/test.c.1 | 11 + patches/conf-gmp-powm-sec/test.c.2 | 26 + patches/conf-gmp-powm-sec/test.c.3 | 26 + patches/conf-gmp/test.c.1 | 8 + patches/conf-gmp/test.c.2 | 10 + patches/conf-gmp/test.c.3 | 10 + patches/conf-gmp/test.c.4 | 10 + patches/conf-ida/find-ida.ml.in.0.1 | 156 + patches/conf-ida/find-ida.ml.in.0.2 | 173 + patches/conf-ida/find-ida.ml.in.0.3 | 246 + patches/conf-lapack/test-win.sh | 4 + patches/conf-lapack/test.c | 8 + patches/conf-leveldb/test.cc | 14 + patches/conf-libclang/configure.sh.1.0.0 | 88 + patches/conf-libclang/configure.sh.10 | 79 + patches/conf-libclang/configure.sh.11 | 80 + patches/conf-libclang/configure.sh.12 | 96 + patches/conf-libclang/configure.sh.13 | 92 + patches/conf-libclang/configure.sh.14 | 143 + patches/conf-libclang/configure.sh.15 | 131 + patches/conf-libev/build.sh | 3 + patches/conf-libev/discover.ml.4-11 | 234 + patches/conf-libev/discover.ml.4-12 | 235 + patches/conf-libportmidi/check.sh | 8 + patches/conf-libssl/homebrew.sh.3 | 30 + patches/conf-libssl/homebrew.sh.4 | 34 + patches/conf-libssl/osx-build.sh | 41 + patches/conf-libsvm/test.c | 17 + patches/conf-llvm/configure | 26 + patches/conf-llvm/configure.sh.10.0.0 | 24 + patches/conf-llvm/configure.sh.11.0.0 | 24 + patches/conf-llvm/configure.sh.12.0.1 | 24 + patches/conf-llvm/configure.sh.13.0.0 | 24 + patches/conf-llvm/configure.sh.14.0.6 | 24 + patches/conf-llvm/configure.sh.15 | 27 + patches/conf-llvm/configure.sh.16 | 27 + patches/conf-llvm/configure.sh.3.8 | 26 + patches/conf-llvm/configure.sh.3.9 | 26 + patches/conf-llvm/configure.sh.4.0.0 | 26 + patches/conf-llvm/configure.sh.5.0.0 | 24 + patches/conf-llvm/configure.sh.6.0.0 | 24 + patches/conf-llvm/configure.sh.7.0.0 | 24 + patches/conf-llvm/configure.sh.8.0.0 | 24 + patches/conf-llvm/configure.sh.9.0.0 | 24 + patches/conf-mbedtls/test.c | 7 + patches/conf-mecab/test.c | 9 + patches/conf-mpfr-paths/test-mpfr.c | 9 + patches/conf-mpfr/test.c | 11 + patches/conf-mpi/configure | 83 + patches/conf-netsnmp/test.c | 11 + patches/conf-openblas/centos_install.sh | 11 + patches/conf-openblas/test.c.0.1 | 11 + patches/conf-openblas/test.c.0.2.0 | 11 + patches/conf-openblas/test.c.0.2.1 | 12 + patches/conf-openblas/test.c.0.2.2 | 12 + patches/conf-opencc0/test.c | 3 + patches/conf-opencc1/test.c | 3 + patches/conf-opencc1_1/test.c | 3 + patches/conf-openimageio/test.cpp | 5 + patches/conf-pam/main.c | 4 + patches/conf-pic-switch/check.sh | 8 + patches/conf-ppl/test.c | 9 + patches/conf-python-2-7-dev/test.c | 5 + patches/conf-python-2-7/test.py | 1 + patches/conf-python-3-7/configure.sh | 8 + patches/conf-python-3-7/test.py | 2 + patches/conf-python-3-dev/Makefile | 2 + patches/conf-python-3-dev/test.c | 5 + patches/conf-python-3/test.py | 1 + patches/conf-qt/configure.sh | 29 + patches/conf-r/check.r | 1 + patches/conf-radare2/find-radare2.ml.in | 60 + patches/conf-rdkit/test.cpp | 9 + patches/conf-rocksdb/main.c | 1 + patches/conf-rust-2018/test.rs | 1 + patches/conf-rust-2021/test.rs | 1 + patches/conf-snappy/test.cpp | 14 + patches/conf-sundials/test.c | 1 + patches/conf-tcl/check.sh | 6 + patches/conf-tcl/compiletest.c | 6 + patches/conf-tidy/test.c | 5 + patches/conf-tk/check.sh | 9 + patches/conf-tk/compiletest.c | 6 + patches/conf-trexio/test.c | 7 + patches/conf-xen/test.c | 5 + patches/conf-zmq/test.c | 7 + patches/coq-serapi/coq-serapi.install | 4 + .../coq/0001_make_install_static_plug.patch | 45 + patches/coq/0002_alpine_linux.patch | 27 + .../0003_fix_num_ocamlfind_detection.patch | 46 + patches/coq/0004_fix_more_num.patch | 34 + patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl1 | 11 + patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl2 | 11 + patches/coq/Makefile.checker.patch | 19 + patches/coq/build_with_trunk.patch | 330 + patches/coq/configure.patch.8.3 | 11 + patches/coq/configure.patch.8.4pl1 | 11 + patches/coq/configure.patch.8.4pl2 | 11 + patches/coq/coq.install.8.10.0 | 12 + patches/coq/coq.install.8.10.1 | 12 + patches/coq/coq.install.8.10.2 | 12 + patches/coq/coq.install.8.11.0 | 12 + patches/coq/coq.install.8.11.1 | 12 + patches/coq/coq.install.8.11.2 | 12 + patches/coq/coq.install.8.12.0 | 12 + patches/coq/coq.install.8.12.1 | 12 + patches/coq/coq.install.8.12.2 | 12 + patches/coq/coq.install.8.13.0 | 12 + patches/coq/coq.install.8.13.1 | 12 + patches/coq/coq.install.8.13.2 | 12 + patches/coq/coq.install.8.3 | 13 + patches/coq/coq.install.8.4.5 | 13 + patches/coq/coq.install.8.4.6 | 17 + patches/coq/coq.install.8.4.6~camlp4 | 17 + patches/coq/coq.install.8.4pl1 | 13 + patches/coq/coq.install.8.4pl2 | 13 + patches/coq/coq.install.8.4pl4 | 13 + patches/coq/coq.install.8.5.0 | 13 + patches/coq/coq.install.8.5.0~camlp4 | 13 + patches/coq/coq.install.8.5.1 | 13 + patches/coq/coq.install.8.5.2 | 13 + patches/coq/coq.install.8.5.2~camlp4 | 13 + patches/coq/coq.install.8.5.3 | 13 + patches/coq/coq.install.8.6 | 13 + patches/coq/coq.install.8.6.1 | 13 + patches/coq/coq.install.8.7.0 | 14 + patches/coq/coq.install.8.7.1 | 14 + patches/coq/coq.install.8.7.1+1 | 14 + patches/coq/coq.install.8.7.1+2 | 14 + patches/coq/coq.install.8.7.2 | 14 + patches/coq/coq.install.8.8.0 | 13 + patches/coq/coq.install.8.8.1 | 13 + patches/coq/coq.install.8.8.2 | 13 + patches/coq/coq.install.8.9.0 | 12 + patches/coq/coq.install.8.9.1 | 12 + patches/coq/coqmktop.patch | 12 + patches/coq/disable_warn_70.patch.8.13.0 | 13 + patches/coq/disable_warn_70.patch.8.13.1 | 13 + patches/coq/disable_warn_70.patch.8.13.2 | 13 + patches/coq/disable_warn_70.patch.8.14.0 | 13 + patches/coq/dune-install-set-root.patch | 37 + patches/coq/ephemeron-rename.patch | 726 ++ patches/coq/fix-meta-plugin.patch | 182 + patches/coq/fix-parallel-make.patch | 72 + patches/coq/ld_stricter.patch | 14 + patches/coq/ocaml408_compat.patch | 13 + patches/coqide/CAML_LD_LIBRARY_PATH.patch | 11 + patches/coqide/CONFIGURE_allow_make4.patch | 15 + ...FILE_remove_useless_for_coqide.patch.8.4.5 | 50 + ...FILE_remove_useless_for_coqide.patch.8.4.6 | 50 + ...ILE_remove_useless_for_coqide.patch.8.4pl2 | 50 + ...ILE_remove_useless_for_coqide.patch.8.4pl4 | 50 + patches/coqide/coq-coqide.install | 9 + patches/coqide/coqide.install.8.10.0 | 9 + patches/coqide/coqide.install.8.10.1 | 9 + patches/coqide/coqide.install.8.10.2 | 9 + patches/coqide/coqide.install.8.11.0 | 9 + patches/coqide/coqide.install.8.11.1 | 9 + patches/coqide/coqide.install.8.11.2 | 9 + patches/coqide/coqide.install.8.12.0 | 9 + patches/coqide/coqide.install.8.12.1 | 9 + patches/coqide/coqide.install.8.12.2 | 9 + patches/coqide/coqide.install.8.13.0 | 9 + patches/coqide/coqide.install.8.13.1 | 9 + patches/coqide/coqide.install.8.13.2 | 9 + patches/coqide/coqide.install.8.5.1 | 9 + patches/coqide/coqide.install.8.5.2 | 9 + patches/coqide/coqide.install.8.5.3 | 9 + patches/coqide/coqide.install.8.6 | 9 + patches/coqide/coqide.install.8.6.1 | 9 + patches/coqide/coqide.install.8.7.0 | 9 + patches/coqide/coqide.install.8.7.1 | 9 + patches/coqide/coqide.install.8.7.2 | 9 + patches/coqide/coqide.install.8.8.0 | 9 + patches/coqide/coqide.install.8.8.1 | 9 + patches/coqide/coqide.install.8.8.2 | 9 + patches/coqide/coqide.install.8.9.0 | 9 + patches/coqide/coqide.install.8.9.1 | 9 + patches/coqide/ephemeron-rename.patch | 726 ++ .../coqide/fix-idedeps-double-linking.patch | 54 + patches/coqide/fix-parallel-make.patch | 72 + patches/core/4.01cloexec.diff | 25 + patches/core/build_with_trunk.patch | 67 + patches/core/core.install.109.32.00 | 1 + patches/core/core.install.109.34.00 | 1 + patches/core/core.install.109.35.00 | 1 + patches/core/core.install.109.36.00 | 1 + patches/core/core.install.109.37.00 | 1 + patches/core/core.install.109.38.00 | 1 + patches/core/core.install.109.40.00 | 1 + patches/core/core.install.109.41.00 | 1 + patches/core/core.install.109.42.00 | 1 + patches/core/core.install.109.45.00 | 1 + patches/core/core.install.109.47.00 | 1 + patches/core/core.install.109.53.00 | 1 + patches/core/core.install.109.53.01 | 1 + patches/core/core.install.109.55.00 | 1 + patches/core/core.install.109.55.02 | 1 + patches/core/core.install.109.58.00 | 1 + patches/core/core.install.109.60.00 | 1 + patches/core/core.install.110.01.00 | 1 + patches/core/core.install.111.03.00 | 1 + patches/core/core.install.111.06.00 | 1 + patches/core/core.install.111.08.00 | 1 + patches/core/core.install.111.11.00 | 1 + patches/core/core.install.111.11.01 | 1 + patches/core/core.install.111.13.00 | 1 + patches/core/core.install.111.17.00 | 1 + patches/core/core.install.111.21.00 | 1 + patches/core/core.install.111.25.00 | 1 + patches/core/core.install.111.28.00 | 1 + patches/core/core.install.111.28.01 | 1 + patches/core/core.install.112.01.00 | 1 + patches/core/core.install.112.01.01 | 1 + patches/core/core.install.112.06.00 | 1 + patches/core/core.install.112.06.01 | 1 + patches/core/core.install.112.06.02 | 1 + patches/core/core.install.112.17.00 | 1 + patches/core/core.install.112.24.00 | 1 + patches/core/core.install.112.24.01 | 1 + patches/core/core.install.112.35.00 | 1 + patches/core/core.install.112.35.01 | 1 + patches/core/core.install.113.00.00 | 1 + patches/core/corebuild | 18 + patches/core/disable_warn_error.patch | 11 + patches/core/fix_META.patch.108.08.00 | 11 + patches/core/fix_META.patch.109.07.00 | 11 + .../core_extended/disable_warn_error.patch | 11 + .../core_extended/fix_META.patch.108.08.00 | 11 + .../core_extended/fix_META.patch.109.07.00 | 11 + .../openbsd-quota-disable.diff.112.06.00 | 64 + .../openbsd-quota-disable.diff.112.17.00 | 64 + .../openbsd-quota-disable.diff.112.24.00 | 64 + .../openbsd-quota-disable.diff.112.35.00 | 64 + .../openbsd-quota-disable.diff.113.00.00 | 64 + patches/core_kernel/build_with_trunk.patch | 58 + .../core_kernel/include_compatibility.patch | 25 + patches/cpdf/cpdf.install | 1 + patches/cppo/cppo.install | 1 + patches/cryptokit/aesni-align.patch | 63 + patches/cryptokit/aesni-detect.patch | 46 + patches/csdp/csdp.install | 8 + patches/csv/_oasis_remove_.ml | 7 + patches/csv/csv.install.1.2.6 | 4 + patches/csv/csv.install.1.3.0 | 4 + patches/csv/csv.install.1.3.1 | 4 + patches/csv/csv.install.1.3.2 | 4 + patches/csv/csv.install.1.3.3 | 4 + patches/csv/csv.install.1.3.4 | 4 + patches/csv/csv.install.1.4 | 4 + patches/csv/csv.install.1.4.1 | 6 + patches/csv/csv.install.1.4.2 | 6 + patches/ctypes/build_with_trunk.patch | 21 + patches/cubicle/cubicle.install | 1 + .../cubicle/patch_syntax_ocaml_4_03_0.patch | 13 + patches/cudf/META.0.6.3 | 4 + patches/cudf/cudf.install | 19 + patches/cudf/cudf.ocp.in | 25 + .../fmt.tty-is-used-by-datakit-log.patch | 22 + patches/dbforge/dbforge.install | 6 + patches/dbm/hasgotfix.patch | 13 + patches/dbm/include_fix.patch | 13 + patches/dbm/include_local_fix.patch | 26 + patches/dbm/mkdir-stublibs.patch | 17 + ...lure-cases-in-favor-of-finer-diagnos.patch | 28 + patches/dose/0002-ocamlgraph-1.8.6.diff | 13 + ...lure-cases-in-favor-of-finer-diagnos.patch | 28 + patches/dose/0004-Remove-broken-assert.patch | 26 + ...est-function-allowing-more-control-o.patch | 83 + patches/dose/META.dose | 3 + patches/dose/META.dose3 | 4 + patches/dose/dose.install | 9 + patches/dose/dose.ocp.in | 84 + ...nvocation-of-mktemp-for-Linux-and-BS.patch | 25 + ...ing-containing-the-criteria-before-p.patch | 33 + ...-interpolation-to-ensure-only-one-is.patch | 38 + ...cudfsolver-are-now-exceptions-and-no.patch | 56 + ...de-bug-in-the-check_request-function.patch | 41 + ...ompilation-problems-with-ocaml-4.0.1.patch | 170 + ...omputing-upgrade-constraints-handle-.patch | 59 + .../0008-Use-re.pcre-instead-of-pcre.patch | 295 + .../0009-Hardcode-__FILE__-macros.patch | 617 ++ ...Hardcode-IFDEF-macros-assuming-false.patch | 396 ++ patches/dose3/0001-Install-mli-cmx-etc.patch | 133 + patches/dose3/0002-dont-make-printconf.patch | 9 + patches/dose3/0003-Fix-for-ocaml-4.06.patch | 52 + ...ependency-to-dose3.common-in-META.in.patch | 25 + ...ix-compatibility-with-ocamlgraph-2.0.patch | 31 + ...0006-Grep-carefully-for-ocaml-system.patch | 22 + .../add-missing-version.patch | 12 + .../dune-build-info/add-missing-version.patch | 12 + ...gurator-for-Dune-2.0.0-on-OCaml-4.06.patch | 176 + .../add-missing-version.patch | 12 + patches/dune-glob/add-missing-version.patch | 12 + .../add-missing-version.patch | 12 + patches/dune-release/fix-tests.patch | 92 + patches/dune-site/add-missing-version.patch | 12 + patches/dune/add-missing-version.patch | 12 + patches/dypgen/dypgen.install | 5 + patches/dypgen/install-bsd-compatible.patch | 62 + patches/easy-format/easy-format-make.diff | 27 + patches/easy-format/meta-tpl.diff | 10 + patches/eigen/eigen.install.0.0.1 | 6 + patches/eigen/eigen.install.0.0.2 | 6 + patches/eigen/eigen.install.0.0.3 | 6 + patches/eigen/eigen.install.0.0.4 | 6 + patches/eigen/eigen.install.0.0.5 | 6 + patches/eigen/eigen.install.0.0.6 | 9 + patches/electrumAnalyzer/_oasis_remove_.ml | 7 + .../electrumAnalyzer/electrumAnalyzer.install | 6 + patches/elf2json/_oasis_remove_.ml | 7 + patches/elf2json/elf2json.install | 6 + patches/eliom/build-against-newer-lwt.diff | 71 + patches/eliom/eliom.install.2.2.2 | 7 + patches/eliom/eliom.install.3.0.0 | 8 + patches/eliom/eliom.install.3.0.1 | 8 + patches/eliom/eliom.install.3.0.2 | 8 + patches/eliom/eliom.install.3.0.3 | 8 + patches/eliom/fix_int64.patch | 123 + patches/eliom/makefile_log.patch | 11 + ...0001-Makefile-pass-DUNE_OPTS-to-dune.patch | 64 + patches/elpi/use-digest.patch | 132 + patches/elpi/win-temp-file.patch | 32 + patches/erm_xmpp/disable_tests.patch | 43 + .../0001-Add-support-for-OCaml-4.12.patch | 25 + ...aram-was-removed-for-OCaml-pre-4.00-.patch | 38 + patches/extlib/extlib.install | 26 + patches/extlib/extlib.ocp | 29 + patches/extlib/opam.patch | 12 + patches/extprot/no_bin_annot.patch | 13 + patches/ezjsonm/build_with_trunk.patch | 13 + patches/facile/META.1.1 | 5 + patches/facile/bsdmake.patch | 46 + patches/facile/facile.install | 1 + patches/facile/ocaml_4.00.patch | 12 + patches/fieldslib/disable_warn_error.patch | 11 + patches/flowtype/flowtype.install | 1 + patches/frag/frag.install | 4 + patches/frama-c-base/4.05-support.patch | 162 + .../frama-c-base/run_autoconf_if_needed.sh | 5 + patches/frama-c-base/wp-ocaml-403.patch | 11 + .../frama-c-e-acsl/run_autoconf_if_needed.ml | 5 + .../0004-Port-to-OCamlgraph-1.8.5.patch | 254 + patches/frama-c/01-tests-cpp-m32.patch | 45 + patches/frama-c/02-tests-flamegraph.patch | 47 + patches/frama-c/4.01-compat.patch | 151 + patches/frama-c/frama-c.install.7.0 | 5 + patches/frama-c/frama-c.install.8.0 | 5 + patches/frama-c/frama-c.install.9.0 | 7 + patches/frama-c/frama-c.install.9.1 | 5 + patches/frama-c/macos.patch | 14 + patches/frama-c/run_autoconf_if_needed.sh | 5 + patches/frama-clang/CMakeLists.txt.patch | 31 + patches/frama-clang/build.sh.patch.in | 17 + patches/freetennis/freetennis | 2 + patches/freetennis/freetennis.install | 347 + patches/fstar/fstar.install | 4 + patches/functoria-runtime/num.patch | 13 + patches/fury-puyo/4.05-compatibility.patch | 29 + patches/fury-puyo/data_dir.patch.in | 33 + patches/fury-puyo/fury-puyo.install | 94 + patches/gadelac/gadelac.install | 1 + .../gappa/0001-Added-configure-for-c-11.patch | 983 +++ patches/gappa/remake.patch | 22 + patches/gasoline/META.0.1 | 8 + patches/gasoline/gasoline.install | 25 + patches/gdb/gdb.install | 3 + patches/genlet/META.201406 | 6 + patches/genlet/gengenlet.ml | 192 + patches/genlet/gengenlet.mli | 17 + patches/genlet/genlet.install | 7 + patches/genlet/remove-tests.patch | 105 + patches/getopt/getopt.install | 1 + patches/gettext/gettext.install | 4 + patches/git/remove-warn-error.diff | 12 + patches/gitlab-unix/no-diff-installed.patch | 12 + .../gmp-freestanding.pc.6.0.0 | 9 + .../gmp-freestanding.pc.6.0.0-1 | 9 + .../gmp-freestanding.pc.6.1.2 | 9 + .../gmp-freestanding.pc.6.1.2-1 | 9 + .../gmp-freestanding.pc.6.1.2-2 | 9 + .../gmp-freestanding.pc.6.2.0 | 9 + .../gmp-freestanding.pc.6.2.1 | 9 + .../gmp-freestanding/mirage-build.sh.6.0.0 | 37 + .../gmp-freestanding/mirage-build.sh.6.0.0-1 | 37 + .../gmp-freestanding/mirage-build.sh.6.1.2 | 37 + .../gmp-freestanding/mirage-build.sh.6.1.2-1 | 37 + .../gmp-freestanding/mirage-build.sh.6.1.2-2 | 43 + .../gmp-freestanding/mirage-build.sh.6.2.0 | 43 + .../gmp-freestanding/mirage-build.sh.6.2.1 | 43 + patches/gmp-freestanding/mirage-install.sh | 14 + patches/gmp-xen/gmp-6a.diff | 20 + patches/gmp-xen/gmp-xen.pc | 9 + patches/gmp-xen/mirage-build.sh.6.0.0 | 31 + patches/gmp-xen/mirage-build.sh.6.0.0-1 | 31 + patches/gmp-xen/mirage-install.sh | 13 + patches/goblint-cil/realGccConfigure.patch | 15 + ...cated-File.exists-in-update_suite.rb.patch | 39 + patches/gpr/gpr.install.1.2.1 | 4 + patches/gpr/gpr.install.1.2.2 | 5 + patches/grain_dypgen/dypgen.install | 5 + .../grain_dypgen/install-bsd-compatible.patch | 62 + patches/graphics/META.3.07 | 6 + patches/graphics/META.3.07+1 | 6 + patches/graphics/META.3.07+2 | 6 + patches/graphics/META.3.08.0 | 6 + patches/graphics/META.3.08.1 | 6 + patches/graphics/META.3.08.2 | 6 + patches/graphics/META.3.08.3 | 6 + patches/graphics/META.3.08.4 | 6 + patches/graphics/META.3.09.0 | 6 + patches/graphics/META.3.09.1 | 6 + patches/graphics/META.3.09.2 | 6 + patches/graphics/META.3.09.3 | 6 + patches/graphics/META.3.10.0 | 6 + patches/graphics/META.3.10.1 | 6 + patches/graphics/META.3.10.2 | 6 + patches/graphics/META.3.11.0 | 6 + patches/graphics/META.3.11.1 | 6 + patches/graphics/META.3.11.2 | 6 + patches/graphics/META.3.12.0 | 6 + patches/graphics/META.3.12.1 | 6 + patches/graphics/META.4.00.0 | 6 + patches/graphics/META.4.00.1 | 6 + patches/graphics/META.4.01.0 | 6 + patches/graphics/META.4.02.0 | 6 + patches/graphics/META.4.02.1 | 6 + patches/graphics/META.4.02.2 | 6 + patches/graphics/META.4.02.3 | 6 + patches/graphics/META.4.03.0 | 6 + patches/graphics/META.4.04.0 | 6 + patches/graphics/META.4.04.1 | 6 + patches/graphics/META.4.04.2 | 6 + patches/graphics/META.4.05.0 | 6 + patches/graphics/META.4.06.0 | 6 + patches/graphics/META.4.06.1 | 6 + patches/graphics/META.4.07.0 | 6 + patches/graphics/META.4.07.1 | 6 + patches/graphics/META.4.08.0 | 6 + patches/graphics/META.4.08.1 | 6 + patches/graphics/graphics.install | 1 + patches/graphics/install.sh | 110 + patches/gsl/fixdeps.patch | 20 + .../hardcaml-examples.install | 8 + .../hardcaml-reedsolomon.install | 4 + patches/headache/headache.install | 1 + patches/heptagon/heptagon.install | 19 + patches/herdtools7/chatouille.patch | 13 + patches/hevea/hevea.install | 7 + patches/higlo/higlo.install | 5 + patches/hlarp/hlarp.install | 3 + patches/ibx/async.patch | 13 + patches/igvxml/igvxml.install | 3 + patches/imagemagick/fix_build.patch | 22 + patches/interval/META.1.3 | 6 + patches/interval/Makefile.patch | 71 + patches/iocaml-kernel/4.00.1.patch | 43 + patches/iocaml-kernel/iocaml-kernel.install | 35 + patches/iocaml/chromium-bug.patch | 13 + patches/iocaml/iocaml.install.0.4.2 | 1 + patches/iocaml/iocaml.install.0.4.3 | 1 + patches/iocaml/iocaml.install.0.4.4 | 3 + patches/iocaml/iocaml.install.0.4.5 | 3 + patches/iocaml/iocaml.install.0.4.6 | 3 + patches/iocaml/iocaml.install.0.4.7 | 3 + patches/iocaml/iocaml.install.0.4.8 | 3 + patches/iocaml/iocaml.install.0.4.9 | 3 + patches/iocamljs-kernel/4.00.1.patch | 40 + .../iocamljs-kernel.install.0.4.0 | 7 + .../iocamljs-kernel.install.0.4.3 | 7 + .../iocamljs-kernel.install.0.4.4 | 7 + .../iocamljs-kernel.install.0.4.5 | 7 + .../iocamljs-kernel.install.0.4.6 | 15 + .../iocamljs-kernel.install.0.4.8 | 15 + patches/irc-client/obuild-workaround.patch | 8 + patches/iri/ocaml-before.4.03.0.patch | 30 + patches/javalib/patch-javalib.diff | 12 + patches/jenga/jenga.install | 6 + patches/joolog/joolog.install | 1 + patches/js_of_ocaml/js_of_ocaml.install.1.2 | 1 + patches/js_of_ocaml/js_of_ocaml.install.1.3.1 | 1 + patches/js_of_ocaml/js_of_ocaml.install.1.3.2 | 1 + patches/js_of_ocaml/js_of_ocaml.install.1.4.0 | 1 + patches/js_of_ocaml/js_of_ocaml.install.2.0 | 4 + .../json-wheel-1.0.6+safe-string.patch | 22 + patches/jsondiff/jsondiff.install | 1 + patches/jsonm/jsonm.install | 6 + patches/kaputt/install.patch | 12 + patches/kaputt/install2.patch | 53 + patches/kaputt/safe_string.patch | 34 + patches/lablgl/META.1.04.20120306 | 20 + patches/lablgl/META.1.05 | 20 + patches/lablgl/META.1.06 | 20 + patches/lablgl/META.1.07 | 20 + patches/lablgl/lablgl.install | 1 + patches/lablgtk/lablgldir.patch.2.16.0 | 12 + patches/lablgtk/lablgldir.patch.2.18.10 | 12 + patches/lablgtk/lablgldir.patch.2.18.11 | 12 + patches/lablgtk/lablgldir.patch.2.18.12 | 13 + patches/lablgtk/lablgldir.patch.2.18.13 | 13 + patches/lablgtk/lablgldir.patch.2.18.2 | 12 + patches/lablgtk/lablgldir.patch.2.18.3 | 12 + patches/lablgtk/lablgldir.patch.2.18.4 | 12 + patches/lablgtk/lablgldir.patch.2.18.5 | 12 + patches/lablgtk/lablgldir.patch.2.18.6 | 12 + patches/lablgtk/lablgldir.patch.2.18.7 | 12 + patches/lablgtk/lablgldir.patch.2.18.8 | 12 + patches/lablgtk/lablgldir.patch.2.18.9 | 12 + patches/lablgtk/lablgtk.install | 5 + patches/lablgtk3/dune-project.patch | 8 + patches/lablgtk3/lablgtk.install.0.beta1 | 4 + patches/lablgtk3/lablgtk.install.0.beta2 | 4 + patches/lablgtk3/lablgtk.install.0.beta3 | 5 + patches/lablgtk3/ml_gtk.c.diff | 13 + patches/labltk/auxlibs-in-META.patch | 20 + patches/labltk/cltkImg.patch | 12 + patches/labltk/configure.patch | 63 + patches/labltk/hasgot.patch | 14 + patches/labrys/fix-dune.patch | 41 + patches/lambda-term/lambda-term.install.1.10 | 8 + .../lambda-term/lambda-term.install.1.10.1 | 8 + patches/lambda-term/lambda-term.install.1.4 | 4 + patches/lambda-term/lambda-term.install.1.5 | 4 + patches/lambda-term/lambda-term.install.1.6 | 4 + patches/lambda-term/lambda-term.install.1.7 | 4 + patches/lambda-term/lambda-term.install.1.8 | 4 + patches/lambda-term/lambda-term.install.1.9 | 4 + patches/lambda-term/openbsd.diff | 125 + patches/lambdoc/lambdoc.install.1.0-beta2 | 5 + patches/lambdoc/lambdoc.install.1.0-beta3 | 81 + patches/lambdoc/lambdoc.install.1.0-beta4 | 96 + patches/lbfgs/setup.patch | 31 + patches/lbfgs/string.patch | 20 + patches/lbvs_consent/lbvs_consent.install | 7 + patches/lbvs_consent/makefile.patch | 28 + patches/ledit/ledit.install.2.03 | 1 + patches/ledit/ledit.install.2.04 | 2 + patches/ledit/ledit.install.2.05 | 2 + patches/ledit/ledit.install.2.06 | 2 + patches/leveldb/fix_snappy_link_issue.patch | 13 + patches/leveldb/link_against_extra_libs.patch | 13 + patches/leveldb/warn_error.patch | 11 + patches/libres3/depfix.patch | 22 + patches/libres3/libres3.install.0.1 | 13 + patches/libres3/libres3.install.0.2 | 14 + patches/libres3/libres3.install.0.3 | 17 + patches/libres3/libres3.install.0.9 | 17 + patches/libres3/libres3.install.1.0 | 18 + patches/libres3/libres3.install.1.1 | 17 + patches/libres3/libres3.install.1.2 | 17 + patches/libres3/libres3.install.1.3 | 17 + patches/libsvm/calc_scc_fix.patch | 28 + patches/libsvm/svm_cli_fix.patch | 32 + patches/libwasmer/config.toml | 5 + patches/libwasmer/libwasmer.install | 6 + patches/lilis/lilis.install | 1 + patches/liquidsoap/camomile.patch | 108 + patches/liquidsoap/fix-last-metadata.diff | 19 + patches/liquidsoap/fix_4.05.patch | 11 + patches/liquidsoap/fix_process_output.patch | 25 + ...gnore-bash-completion-install-errors.patch | 14 + patches/liquidsoap/lang_builtins.patch | 13 + patches/llvm/D24354.diff | 77 + patches/llvm/META.patch.10.0.0 | 186 + patches/llvm/META.patch.11.0.0 | 186 + patches/llvm/META.patch.12.0.1 | 186 + patches/llvm/META.patch.13.0.0 | 199 + patches/llvm/META.patch.14.0.6 | 199 + patches/llvm/META.patch.4.0.0 | 186 + patches/llvm/META.patch.5.0.0 | 186 + patches/llvm/META.patch.6.0.0 | 186 + patches/llvm/META.patch.7.0.0 | 186 + patches/llvm/META.patch.8.0.0 | 186 + patches/llvm/META.patch.9.0.0 | 186 + patches/llvm/add-cmt-for-llvm-13.patch | 23 + patches/llvm/build.sh | 20 + patches/llvm/cmake.patch | 27 + patches/llvm/compile.sh | 58 + patches/llvm/fix-macos.patch.10.0.0 | 30 + patches/llvm/fix-macos.patch.11.0.0 | 30 + patches/llvm/fix-macos.patch.12.0.1 | 30 + patches/llvm/fix-macos.patch.13.0.0 | 30 + patches/llvm/fix-macos.patch.14.0.6 | 30 + patches/llvm/fix-rhel.patch.10.0.0 | 45 + patches/llvm/fix-rhel.patch.11.0.0 | 45 + patches/llvm/fix-rhel.patch.12.0.1 | 45 + patches/llvm/fix-rhel.patch.13.0.0 | 45 + patches/llvm/fix-rhel.patch.14.0.6 | 45 + patches/llvm/fix-shared.patch.10.0.0 | 37 + patches/llvm/fix-shared.patch.11.0.0 | 37 + patches/llvm/fix-shared.patch.12.0.1 | 37 + patches/llvm/fix-shared.patch.13.0.0 | 37 + patches/llvm/fix-shared.patch.14.0.6 | 37 + patches/llvm/fix-shared.patch.5.0.0 | 25 + patches/llvm/fix-shared.patch.6.0.0 | 25 + patches/llvm/fix-shared.patch.7.0.0 | 25 + patches/llvm/fix-shared.patch.8.0.0 | 25 + patches/llvm/fix-shared.patch.9.0.0 | 25 + patches/llvm/install.sh.10.0.0 | 71 + patches/llvm/install.sh.11.0.0 | 71 + patches/llvm/install.sh.12.0.1 | 71 + patches/llvm/install.sh.13.0.0 | 71 + patches/llvm/install.sh.14.0.6 | 78 + patches/llvm/install.sh.3.6 | 49 + patches/llvm/install.sh.3.7 | 51 + patches/llvm/install.sh.3.8 | 36 + patches/llvm/install.sh.4.0.0 | 63 + patches/llvm/install.sh.5.0.0 | 49 + patches/llvm/install.sh.6.0.0 | 49 + patches/llvm/install.sh.7.0.0 | 49 + patches/llvm/install.sh.8.0.0 | 49 + patches/llvm/install.sh.9.0.0 | 49 + patches/llvm/link-META.patch.10.0.0 | 156 + patches/llvm/link-META.patch.11.0.0 | 156 + patches/llvm/link-META.patch.12.0.1 | 156 + patches/llvm/link-META.patch.13.0.0 | 166 + patches/llvm/link-META.patch.14.0.6 | 166 + patches/llvm/link-META.patch.4.0.0 | 143 + patches/llvm/link-META.patch.5.0.0 | 156 + patches/llvm/link-META.patch.6.0.0 | 156 + patches/llvm/link-META.patch.7.0.0 | 156 + patches/llvm/link-META.patch.8.0.0 | 156 + patches/llvm/link-META.patch.9.0.0 | 156 + patches/llvm/link.patch.3.9 | 13 + patches/llvm/link.patch.4.0.0 | 14 + patches/llvm/makefile+build.patch | 14 + patches/llvm/makefile+system.patch | 28 + patches/lru/hashtbl-seeded.patch | 13 + patches/lutils/_oasis_remove_.ml | 7 + patches/lutils/lutils.install | 6 + patches/lwt/4.01cloexec.diff | 44 + patches/lwt/META-version.patch | 36 + patches/lwt/lwt.install.2.7.0 | 6 + patches/lwt/lwt.install.2.7.1 | 6 + patches/lwt/lwt.install.3.0.0 | 6 + patches/lwt/patch-ocsigen-lwt-101.diff | 49 + patches/macaque/fix-configure.patch | 24 + patches/mascot/4.01.patch | 31 + patches/mascot/mascot.install | 1 + patches/melt/melt.install | 5 + patches/menhir/menhir.install.20120123 | 1 + patches/menhir/menhir.install.20130116 | 1 + patches/menhir/menhir.install.20130911 | 1 + patches/menhir/menhir.install.20140422 | 1 + patches/menhir/menhir.install.20141215 | 1 + patches/menhir/menhir.install.20150914 | 1 + patches/menhir/menhir.install.20150921 | 1 + patches/menhir/menhir.install.20151005 | 1 + patches/menhir/menhir.install.20151012 | 1 + patches/menhir/menhir.install.20151023 | 1 + patches/menhir/menhir.install.20151026 | 1 + patches/menhir/menhir.install.20151030 | 1 + patches/menhir/menhir.install.20151103 | 1 + patches/menhir/menhir.install.20151112 | 1 + patches/menhir/menhir.install.20160303 | 1 + patches/menhir/menhir.install.20160504 | 1 + patches/menhir/warn_error.patch | 10 + patches/merlin-acme/merlin-acme.install | 6 + .../disable-error-on-warn.patch | 151 + .../fix-mktemp-for-busybox.patch | 25 + patches/mezzo/mezzo.install | 1 + .../mezzo/no-deprecated-fatal-warning.patch | 13 + patches/mikmatch/fix_build.patch | 17 + patches/mikmatch/mikmatch.patch | 13 + patches/minilight/minilight.install | 1 + patches/minios-xen/build-opam.sh | 11 + patches/mirage-www/mirage-www.install.0.3.0 | 4 + patches/mirage-www/mirage-www.install.0.4.0 | 4 + patches/mirage-www/mirage-www.install.1.0.0 | 3 + patches/mirage-www/mirage-www.install.1.1.0 | 3 + patches/mirari/mirari.install | 1 + patches/missinglib/meta-0.4.1.patch | 11 + patches/missinglib/opam.patch | 12 + patches/mldonkey/mldonkey.install.3.1.2 | 8 + patches/mldonkey/mldonkey.install.3.1.3 | 8 + patches/mldonkey/mldonkey.install.3.1.5 | 8 + patches/mldonkey/mldonkey.install.3.1.6 | 8 + patches/mldonkey/mldonkey.install.3.1.7-2 | 3 + patches/mlgmp/_oasis | 15 + patches/mlgmp/fix-extern-declarations.diff | 20 + .../mlmpfr_compatibility_test.c.4.0.2+dune | 24 + .../mlmpfr/mlmpfr_compatibility_test.c.4.1.0 | 16 + .../mlmpfr_compatibility_test.c.4.1.0+bugfix1 | 16 + .../mlmpfr_compatibility_test.c.4.1.0+bugfix2 | 16 + .../mlmpfr/mlmpfr_compatibility_test.c.4.1.1 | 20 + .../mlmpfr/mlmpfr_compatibility_test.c.4.2.0 | 17 + .../mlmpfr/mlmpfr_compatibility_test.c.4.2.1 | 17 + patches/mlmpfr/test.c.3.1.6 | 20 + patches/mlmpfr/test.c.4.0.0 | 16 + patches/mlmpfr/test.c.4.0.1 | 20 + patches/mlmpfr/test.c.4.0.2 | 24 + patches/mlpost/mlpost.install | 1 + patches/mlpost/opam.patch.in | 15 + patches/modelica_ml/modelica.ml.install.0.1.1 | 6 + patches/modelica_ml/modelica.ml.install.0.2.0 | 14 + patches/mpi/post103.patch | 33 + patches/mpi/post105.patch | 14 + patches/mpp/_oasis_remove_.ml | 7 + patches/mpp/mpp.install.0.1.0 | 4 + patches/mpp/mpp.install.0.1.1 | 4 + patches/mpp/mpp.install.0.1.2 | 4 + patches/mpp/mpp.install.0.1.3 | 4 + patches/mpp/mpp.install.0.1.4 | 4 + patches/mpp/mpp.install.0.1.5 | 4 + patches/mpp/mpp.install.0.1.7 | 6 + patches/mpp/mpp.install.0.1.8 | 6 + patches/mpp/mpp.install.0.2.0 | 6 + patches/mpp/mpp.install.0.2.1 | 6 + patches/mpp/mpp.install.0.3.0 | 6 + patches/mpp/mpp.install.0.3.2 | 6 + patches/msgpack/no-camlp4.patch.1.0.0 | 73 + patches/msgpack/no-camlp4.patch.1.1.0 | 73 + patches/msgpack/no-camlp4.patch.1.1.1 | 73 + patches/msgpack/no-camlp4.patch.1.2.0 | 73 + patches/msgpack/no-camlp4.patch.1.2.1 | 73 + patches/mstruct/build_with_trunk.patch | 13 + patches/mustache/add_pipe.patch | 28 + patches/mybuild/mybuild.install | 3 + ...issing-runtime-dependencies-in-_tags.patch | 47 + ...v-as-a-runtime-dependency-in-the-pac.patch | 39 + ...detect-ppx_sexp_conv-runtime-library.patch | 146 + ...ck-package-workaround-ocamlbuild-272.patch | 38 + .../0005-use-modern-cstruct-findlib.patch | 32 + .../0006-explicit-dependency-on-sexplib.patch | 24 + patches/nocrypto/0007-mirage-entropy.patch | 58 + patches/nocrypto/postconf.patch | 18 + patches/nocrypto/werror.patch.0.5.0 | 72 + patches/nocrypto/werror.patch.0.5.1 | 72 + patches/nocrypto/werror.patch.0.5.2 | 72 + patches/nocrypto/werror.patch.0.5.3 | 20 + patches/num/findlib-install.patch.1.0 | 129 + patches/num/findlib-install.patch.1.1 | 129 + patches/num/installation-warning.patch | 59 + patches/nuscr/fix-cram-tests.patch | 105 + patches/oasis-mirage/oasis.install | 3 + patches/oasis/_oasis_remove_.ml | 7 + patches/oasis/oasis.install.0.2.0 | 1 + patches/oasis/oasis.install.0.3.0 | 1 + patches/oasis/oasis.install.0.4.0 | 1 + patches/oasis/oasis.install.0.4.1 | 1 + patches/oasis/oasis.install.0.4.10 | 5 + patches/oasis/oasis.install.0.4.11 | 5 + patches/oasis/oasis.install.0.4.2 | 1 + patches/oasis/oasis.install.0.4.3 | 1 + patches/oasis/oasis.install.0.4.4 | 1 + patches/oasis/oasis.install.0.4.5 | 6 + patches/oasis/oasis.install.0.4.6 | 6 + patches/oasis/oasis.install.0.4.7 | 6 + patches/oasis/oasis.install.0.4.8 | 5 + patches/oasis2debian/oasis.install | 5 + patches/oasis2opam/_oasis_remove_.ml | 7 + patches/oasis2opam/oasis2opam.install.0.2 | 4 + patches/oasis2opam/oasis2opam.install.0.2.1 | 4 + patches/oasis2opam/oasis2opam.install.0.2.2 | 4 + patches/oasis2opam/oasis2opam.install.0.2.3 | 4 + patches/oasis2opam/oasis2opam.install.0.2.4 | 4 + patches/oasis2opam/oasis2opam.install.0.2.5 | 4 + patches/oasis2opam/oasis2opam.install.0.2.6 | 4 + patches/oasis2opam/oasis2opam.install.0.2.7 | 4 + patches/oasis2opam/oasis2opam.install.0.3.0 | 4 + patches/oasis2opam/oasis2opam.install.0.3.1 | 4 + patches/oasis2opam/oasis2opam.install.0.3.2 | 4 + patches/oasis2opam/oasis2opam.install.0.3.3 | 4 + patches/oasis2opam/oasis2opam.install.0.3.4 | 4 + patches/oasis2opam/oasis2opam.install.0.3.5 | 4 + patches/oasis2opam/oasis2opam.install.0.3.6 | 4 + patches/oasis2opam/oasis2opam.install.0.4.0 | 4 + patches/oasis2opam/oasis2opam.install.0.4.4 | 4 + patches/oasis2opam/oasis2opam.install.0.4.5 | 4 + patches/oasis2opam/oasis2opam.install.0.5.0 | 4 + patches/oasis2opam/oasis2opam.install.0.5.1 | 4 + patches/oasis2opam/oasis2opam.install.0.6.0 | 4 + patches/oasis2opam/oasis2opam.install.0.6.1 | 6 + patches/oasis2opam/oasis2opam.install.0.6.2 | 6 + .../obigstore/obigstore-unset-warn-error.diff | 12 + patches/obuild/obuild.install | 4 + patches/ocaml-arg/ocaml-arg.install | 8 + .../0001-Re-generate-configure.patch | 119 + patches/ocaml-base-compiler/PIC.patch.3.07 | 210 + patches/ocaml-base-compiler/PIC.patch.3.07+1 | 210 + patches/ocaml-base-compiler/PIC.patch.3.07+2 | 210 + patches/ocaml-base-compiler/PIC.patch.3.08.0 | 210 + patches/ocaml-base-compiler/PIC.patch.3.08.1 | 210 + patches/ocaml-base-compiler/PIC.patch.3.08.2 | 210 + patches/ocaml-base-compiler/PIC.patch.3.08.3 | 210 + patches/ocaml-base-compiler/PIC.patch.3.08.4 | 210 + patches/ocaml-base-compiler/PIC.patch.3.09.0 | 44 + .../alt-signal-stack.patch.3.07 | 184 + .../alt-signal-stack.patch.3.07+1 | 184 + .../alt-signal-stack.patch.3.07+2 | 184 + .../alt-signal-stack.patch.3.08.0 | 184 + .../alt-signal-stack.patch.3.08.1 | 184 + .../alt-signal-stack.patch.3.08.2 | 184 + .../alt-signal-stack.patch.3.08.3 | 184 + .../alt-signal-stack.patch.3.08.4 | 184 + .../alt-signal-stack.patch.3.09.0 | 175 + .../alt-signal-stack.patch.3.09.1 | 175 + .../alt-signal-stack.patch.3.09.2 | 175 + .../alt-signal-stack.patch.3.09.3 | 175 + .../alt-signal-stack.patch.3.10.0 | 178 + .../alt-signal-stack.patch.3.10.1 | 178 + .../alt-signal-stack.patch.3.10.2 | 178 + .../alt-signal-stack.patch.3.11.0 | 178 + .../alt-signal-stack.patch.3.11.1 | 178 + .../alt-signal-stack.patch.3.11.2 | 178 + .../fix-gcc10.patch.4.00.0 | 33 + .../fix-gcc10.patch.4.00.1 | 33 + .../fix-gcc10.patch.4.01.0 | 33 + .../fix-gcc10.patch.4.02.0 | 27 + .../fix-gcc10.patch.4.02.1 | 27 + .../fix-gcc10.patch.4.02.2 | 27 + .../fix-gcc10.patch.4.02.3 | 27 + .../fix-gcc10.patch.4.03.0 | 21 + .../fix-gcc10.patch.4.04.0 | 21 + .../fix-gcc10.patch.4.04.1 | 21 + .../fix-gcc10.patch.4.04.2 | 21 + .../fix-gcc10.patch.4.05.0 | 21 + .../fix-gcc10.patch.4.06.0 | 21 + .../fix-gcc10.patch.4.06.1 | 21 + .../fix-gcc10.patch.4.07.0 | 21 + .../fix-gcc10.patch.4.07.1 | 21 + .../fix-gcc10.patch.4.08.0 | 34 + .../fix-gcc10.patch.4.08.1 | 34 + .../fix-gcc10.patch.4.09.0 | 34 + .../ocaml-base-compiler.install | 1 + .../ocaml-base-compiler/ocamlopt-fPIC.patch | 34 + patches/ocaml-base-compiler/pr2061.patch | 23 + patches/ocaml-base-compiler/pr4439.patch | 25 + .../ocaml-base-compiler/pr4867.patch.3.09.0 | 75 + .../ocaml-base-compiler/pr4867.patch.3.09.1 | 89 + .../ocaml-base-compiler/pr4867.patch.3.09.2 | 89 + .../ocaml-base-compiler/pr4867.patch.3.09.3 | 89 + .../ocaml-base-compiler/pr4867.patch.3.10.0 | 89 + .../ocaml-base-compiler/pr4867.patch.3.10.1 | 103 + .../ocaml-base-compiler/pr4867.patch.3.10.2 | 103 + patches/ocaml-base-compiler/pr5237.patch | 64 + patches/ocaml-config/gen_ocaml_config.ml.in.0 | 48 + patches/ocaml-config/gen_ocaml_config.ml.in.1 | 52 + patches/ocaml-config/gen_ocaml_config.ml.in.2 | 56 + patches/ocaml-config/gen_ocaml_config.ml.in.3 | 65 + patches/ocaml-config/ocaml-config.install | 1 + patches/ocaml-expat/Makefile.patch | 21 + patches/ocaml-inifiles/fix_build.diff | 11 + patches/ocaml-inifiles/fix_lowercase.diff | 11 + patches/ocaml-inifiles/ocaml-inifiles.diff | 11 + patches/ocaml-markdown/opam.patch | 57 + ...Don-t-build-manpages-for-stdlib-docs.patch | 24 + ...1-Fix-failure-to-install-tools-links.patch | 26 + .../ocaml-secondary-compiler/fix-gcc10.patch | 34 + patches/ocaml-src/META.3.12.1 | 1 + patches/ocaml-src/META.4.00.0 | 1 + patches/ocaml-src/META.4.00.1 | 1 + patches/ocaml-src/META.4.01.0 | 1 + patches/ocaml-src/META.4.02.0 | 1 + patches/ocaml-src/META.4.02.1 | 1 + patches/ocaml-src/META.4.02.2 | 1 + patches/ocaml-src/META.4.02.3 | 1 + patches/ocaml-src/META.4.03.0 | 1 + patches/ocaml-src/META.4.04.0 | 1 + patches/ocaml-src/META.4.04.1 | 1 + patches/ocaml-src/META.4.04.2 | 1 + patches/ocaml-src/META.4.05.0 | 1 + patches/ocaml-src/META.4.06.0 | 1 + patches/ocaml-src/META.4.06.1 | 1 + patches/ocaml-src/META.4.07.0 | 1 + patches/ocaml-src/META.4.07.1 | 1 + patches/ocaml-src/META.4.08.0 | 1 + patches/ocaml-src/META.4.08.1 | 1 + patches/ocaml-src/META.4.09.0 | 1 + patches/ocaml-src/META.4.09.1 | 1 + patches/ocaml-src/META.4.09.1-1 | 1 + patches/ocaml-src/META.4.10.0 | 1 + patches/ocaml-src/META.4.10.1 | 1 + patches/ocaml-src/META.4.10.2 | 1 + patches/ocaml-src/META.4.11.0 | 1 + patches/ocaml-src/META.4.11.1 | 1 + patches/ocaml-src/META.4.11.2 | 1 + patches/ocaml-src/META.4.12.0 | 1 + patches/ocaml-src/META.4.12.1 | 1 + patches/ocaml-src/META.4.13.0 | 1 + patches/ocaml-src/META.4.13.1 | 1 + patches/ocaml-src/META.4.13.dev | 1 + patches/ocaml-src/META.4.14.0 | 1 + patches/ocaml-src/META.4.14.1 | 1 + patches/ocaml-src/META.4.14.2 | 1 + patches/ocaml-src/META.4.14.dev | 1 + patches/ocaml-src/META.5.0.0 | 1 + patches/ocaml-src/META.5.0.dev | 1 + patches/ocaml-src/META.5.1.0 | 1 + patches/ocaml-src/META.5.1.1 | 1 + patches/ocaml-src/META.5.2.0 | 1 + patches/ocaml-src/fix-configure-4.09.1.patch | 104 + patches/ocaml-system/gen_ocaml_config.ml.in | 43 + ...ditional-compilation.patch.4.06.1+rescript | 691 ++ ...ditional-compilation.patch.4.10.2+rescript | 692 ++ .../fix-gcc10.patch.4.02.0+improved-errors | 27 + .../fix-gcc10.patch.4.02.2+improved-errors | 27 + .../fix-gcc10.patch.4.02.4+trunk | 27 + .../fix-gcc10.patch.4.03.1+trunk | 21 + .../fix-gcc10.patch.4.04.1+copatterns | 21 + .../fix-gcc10.patch.4.04.3+trunk | 21 + .../fix-gcc10.patch.4.05.1+trunk | 21 + .../fix-gcc10.patch.4.05.1+trunk+afl | 21 + .../fix-gcc10.patch.4.05.1+trunk+flambda | 21 + .../fix-gcc10.patch.4.05.1+trunk+fp | 21 + .../fix-gcc10.patch.4.05.1+trunk+fp+flambda | 21 + .../fix-gcc10.patch.4.05.1+trunk+safe-string | 21 + .../fix-gcc10.patch.4.06.2+trunk | 21 + .../fix-gcc10.patch.4.06.2+trunk+afl | 21 + .../fix-gcc10.patch.4.06.2+trunk+flambda | 21 + .../fix-gcc10.patch.4.06.2+trunk+fp | 21 + .../fix-gcc10.patch.4.06.2+trunk+fp+flambda | 21 + .../fix-gcc10.patch.4.07.2+trunk | 21 + .../fix-gcc10.patch.4.07.2+trunk+afl | 21 + ...0.patch.4.07.2+trunk+default-unsafe-string | 21 + .../fix-gcc10.patch.4.07.2+trunk+flambda | 21 + .../fix-gcc10.patch.4.07.2+trunk+fp | 21 + .../fix-gcc10.patch.4.07.2+trunk+fp+flambda | 21 + .../fix-gcc10.patch.4.08.2+trunk | 34 + .../fix-gcc10.patch.4.08.2+trunk+afl | 34 + ...0.patch.4.08.2+trunk+default-unsafe-string | 34 + .../fix-gcc10.patch.4.08.2+trunk+flambda | 34 + .../fix-gcc10.patch.4.08.2+trunk+fp | 34 + .../fix-gcc10.patch.4.08.2+trunk+fp+flambda | 34 + patches/ocaml-variants/ocaml-variants.install | 1 + patches/ocaml-xml-rpc/ocaml-xml-rpc.install | 1 + patches/ocamlbrowser/hasgot.patch | 14 + patches/ocamlclean/disable-warn-error.patch | 18 + patches/ocamldap/ocaml-4.02.patch | 13 + patches/ocamldsort/ocamldsort.install | 4 + patches/ocamlfind-lint/ocamlfind-lint.install | 4 + patches/ocamlfind-secondary/META.in | 3 + .../ocaml-secondary-compiler.conf.in | 10 + ...en-installing-with-a-system-compiler.patch | 26 + .../0001-Harden-test-for-OCaml-5.patch | 12 + patches/ocamlfind/1.5.4-sed-bsd-compat.patch | 13 + patches/ocamlfind/check-num-in-sitelib.patch | 39 + patches/ocamlfind/fix-bsd.patch | 25 + patches/ocamlfind/no-awk-check.patch.1.0.4 | 19 + patches/ocamlfind/no-awk-check.patch.1.3.1 | 19 + patches/ocamlfind/no-awk-check.patch.1.3.2 | 19 + patches/ocamlfind/no-awk-check.patch.1.3.3 | 19 + patches/ocamlfind/no-awk-check.patch.1.4.0 | 19 + patches/ocamlfind/no-awk-check.patch.1.4.1 | 19 + patches/ocamlfind/no-awk-check.patch.1.5.1 | 19 + patches/ocamlfind/no-awk-check.patch.1.5.2 | 19 + patches/ocamlfind/no-awk-check.patch.1.5.3 | 19 + patches/ocamlfind/no-awk-check.patch.1.5.4 | 19 + patches/ocamlfind/no-awk-check.patch.1.5.5 | 19 + patches/ocamlfind/no-awk-check.patch.1.5.6 | 19 + patches/ocamlfind/no-awk-check.patch.1.6.1 | 19 + patches/ocamlfind/no-awk-check.patch.1.6.2 | 19 + patches/ocamlfind/no-awk-check.patch.1.7.1 | 19 + patches/ocamlfind/no-awk-check.patch.1.7.2 | 19 + patches/ocamlfind/no-awk-check.patch.1.7.3 | 19 + patches/ocamlfind/no-awk-check.patch.1.7.3-1 | 19 + patches/ocamlfind/no-awk-check.patch.1.8.0 | 19 + patches/ocamlfind/ocaml-stub | 4 + patches/ocamlfind/ocamlfind.install.1.0.4 | 4 + patches/ocamlfind/ocamlfind.install.1.3.1 | 5 + patches/ocamlfind/ocamlfind.install.1.3.2 | 5 + patches/ocamlfind/ocamlfind.install.1.3.3 | 5 + patches/ocamlfind/ocamlfind.install.1.4.0 | 5 + patches/ocamlfind/ocamlfind.install.1.4.1 | 6 + patches/ocamlfind/ocamlfind.install.1.5.1 | 6 + patches/ocamlfind/ocamlfind.install.1.5.2 | 6 + patches/ocamlfind/ocamlfind.install.1.5.3 | 6 + patches/ocamlfind/ocamlfind.install.1.5.4 | 6 + patches/ocamlfind/ocamlfind.install.1.5.5 | 6 + patches/ocamlfind/ocamlfind.install.1.5.6 | 6 + patches/ocamlfind/ocamlfind.install.1.6.1 | 6 + patches/ocamlfind/ocamlfind.install.1.6.2 | 6 + patches/ocamlfind/ocamlfind.install.1.7.1 | 6 + patches/ocamlfind/ocamlfind.install.1.7.2 | 6 + patches/ocamlfind/ocamlfind.install.1.7.3 | 6 + patches/ocamlfind/ocamlfind.install.1.7.3-1 | 6 + patches/ocamlfind/ocamlfind.install.1.8.0 | 6 + patches/ocamlfind/ocamlfind.install.1.8.1 | 6 + patches/ocamlfind/termux.patch.1.6.2 | 46 + patches/ocamlfind/termux.patch.1.7.1 | 52 + patches/ocamlfind/threads.patch | 26 + .../ocamlgraph/install-findlib-dgraph.patch | 16 + patches/ocamlgraph/ocamlgraph.install | 6 + patches/ocamlify/ocamlify.install | 1 + patches/ocamlmod/_oasis_remove_.ml | 7 + patches/ocamlmod/ocamlmod.install.0.0.3 | 1 + patches/ocamlmod/ocamlmod.install.0.0.4 | 1 + patches/ocamlmod/ocamlmod.install.0.0.7 | 6 + patches/ocamlmod/ocamlmod.install.0.0.8 | 6 + patches/ocamlmod/ocamlmod.install.0.0.9 | 6 + patches/ocamlmod/safe-string.patch | 25 + patches/ocamlmod/test01.mod.patch | 5 + patches/ocamlnet/cloexec.patch | 71 + patches/ocamlnet/fix-ocaml-4.02.patch | 12 + patches/ocamlnet/fix-version-number.patch | 13 + patches/ocamlnet/netgzip.patch | 96 + patches/ocamlnet/nethttpd_types.patch | 23 + patches/ocamlnet/netpop.patch | 21 + patches/ocamlnet/ocamlnet-ocaml4.diff | 11 + patches/ocamlnet/ocamlnet.install | 4 + patches/ocamlnet/pkg-config.patch | 17 + patches/ocamlnet/robust-host.patch | 155 + patches/ocamlscript/ocamlscript.install | 1 + patches/ocamlsdl/safe-string.diff | 19 + patches/ocamlspot/ocamlspot.install | 4 + patches/ocamltter/cleanup.patch | 4362 ++++++++++++ patches/ocamlviz/ocamlviz.install | 4 + patches/ocamlviz/opam.patch.in | 48 + patches/ocamlweb/ocamlweb.install | 1 + patches/ocb-stubblr/custom-cclib.patch | 22 + .../ocb-stubblr/use-OPAM_SWITCH_PREFIX.patch | 33 + patches/oclaunch/oclaunch.install | 4 + patches/ocp-indent/elisp-hotfix.patch | 14 + patches/ocp-indent/fix-warn-error.patch.0.6.0 | 14 + patches/ocp-indent/fix-warn-error.patch.0.6.2 | 12 + patches/ocp-indent/fix-warn-error.patch.0.9.0 | 12 + patches/ocp-indent/ocp-indent.install | 40 + patches/ocp-indent/warnings.patch | 9 + patches/ocp-index/0001-Update-for-4.02.patch | 367 + patches/ocp-index/META.1.1.5 | 7 + patches/ocp-index/ocaml.4.02.patch.1.1.0 | 440 ++ patches/ocp-index/ocaml.4.02.patch.1.1.1 | 440 ++ patches/ocp-index/ocaml.4.02.patch.1.1.2 | 734 ++ patches/ocp-index/ocaml.4.02.patch.1.1.3 | 808 +++ patches/ocp-index/ocaml.4.02.patch.1.1.4 | 808 +++ patches/ocp-index/ocaml.4.03.patch.1.1.2 | 66 + patches/ocp-index/ocaml.4.03.patch.1.1.3 | 88 + patches/ocp-index/ocaml.4.03.patch.1.1.4 | 192 + .../ocp-ocamlres/non-portable-sed-option.diff | 12 + patches/ocp-pack-split/ocp-pack-split.install | 4 + ...-ocp-pp-for-changes-in-compiler-libs.patch | 57 + .../build-against-recent-lwt.diff | 39 + .../fix-build-with-ocsipersist-sqlite.diff | 47 + patches/ocsigenserver/fix-gmake-4.3.patch.2.1 | 35 + .../ocsigenserver/fix-gmake-4.3.patch.2.10 | 48 + .../ocsigenserver/fix-gmake-4.3.patch.2.11.0 | 48 + .../ocsigenserver/fix-gmake-4.3.patch.2.12.0 | 48 + .../ocsigenserver/fix-gmake-4.3.patch.2.13.0 | 48 + .../ocsigenserver/fix-gmake-4.3.patch.2.14.0 | 48 + .../ocsigenserver/fix-gmake-4.3.patch.2.15.0 | 48 + .../ocsigenserver/fix-gmake-4.3.patch.2.16.0 | 48 + .../ocsigenserver/fix-gmake-4.3.patch.2.2.0 | 35 + .../ocsigenserver/fix-gmake-4.3.patch.2.3.1 | 35 + .../ocsigenserver/fix-gmake-4.3.patch.2.4.0 | 35 + patches/ocsigenserver/fix-gmake-4.3.patch.2.5 | 35 + patches/ocsigenserver/fix-gmake-4.3.patch.2.6 | 35 + patches/ocsigenserver/fix-gmake-4.3.patch.2.7 | 35 + patches/ocsigenserver/fix-gmake-4.3.patch.2.8 | 48 + patches/ocsigenserver/fix-gmake-4.3.patch.2.9 | 48 + patches/ocsigenserver/ocsigenserver.install | 4 + .../ocsigenserver/use_netstring-pcre.patch | 44 + patches/ocurl/examples.diff | 28 + patches/ocurl/fix_depend.diff | 19 + patches/odb-server/opam.patch.in | 19 + patches/odnnr/install_keras.r | 8 + ...-Don-t-make-parser-tests-installable.patch | 25 + patches/omake/fam.patch | 12 + patches/omake/lib_build_OCaml.om.diff | 13 + patches/omake/netbsd_fam.patch | 26 + patches/omake/omake.install | 5 + patches/omake/opam.patch | 12 + patches/omake/readline.patch | 11 + patches/omd/_oasis_remove_.ml | 7 + patches/omd/omd.install.0.2 | 4 + patches/omd/omd.install.0.3 | 4 + patches/omd/omd.install.0.4 | 4 + patches/omd/omd.install.0.5 | 4 + patches/omd/omd.install.0.5.4 | 4 + patches/omd/omd.install.0.5.5 | 4 + patches/omd/omd.install.0.6.0 | 4 + patches/omd/omd.install.0.6.1 | 4 + patches/omd/omd.install.0.6.2 | 4 + patches/omd/omd.install.0.6.3 | 4 + patches/omd/omd.install.0.6.4 | 4 + patches/omd/omd.install.0.6.5 | 4 + patches/omd/omd.install.0.7.0 | 4 + patches/omd/omd.install.0.7.1 | 4 + patches/omd/omd.install.0.7.2 | 4 + patches/omd/omd.install.0.7.3 | 4 + patches/omd/omd.install.0.7.4 | 4 + patches/omd/omd.install.0.7.5 | 4 + patches/omd/omd.install.0.8.0 | 4 + patches/omd/omd.install.0.8.1 | 4 + patches/omd/omd.install.0.8.2 | 4 + patches/omd/omd.install.0.9.0 | 4 + patches/omd/omd.install.0.9.1 | 4 + patches/omd/omd.install.0.9.3 | 4 + patches/omd/omd.install.0.9.4 | 4 + patches/omd/omd.install.0.9.5 | 4 + patches/omd/omd.install.0.9.6 | 4 + patches/omd/omd.install.0.9.7 | 4 + patches/omd/omd.install.1.0.0 | 4 + patches/omd/omd.install.1.0.1 | 4 + patches/omd/omd.install.1.1.0 | 4 + patches/omd/omd.install.1.1.1 | 4 + patches/omd/omd.install.1.1.2 | 4 + patches/omd/omd.install.1.1.3 | 4 + patches/omd/omd.install.1.2.0 | 4 + patches/omd/omd.install.1.2.1 | 4 + patches/omd/omd.install.1.2.2 | 4 + patches/omd/omd.install.1.2.3 | 4 + patches/omd/omd.install.1.2.4 | 4 + patches/omd/omd.install.1.2.5 | 4 + patches/omd/omd.install.1.2.6 | 4 + patches/omd/omd.install.1.3.0 | 6 + patches/opa-base/META.1.1.0+4263 | 6 + patches/opa-base/configure_notty.patch | 28 + patches/opa-base/ocamlfind.patch | 15 + patches/opa-base/opa-base.install | 216 + patches/opa-base/rm_deps.patch | 41 + patches/opam-build-revdeps/_oasis_remove_.ml | 7 + .../opam-build-revdeps.install | 6 + patches/opam-lib/fix-build.diff | 84 + patches/opam-lib/fix-wait.diff | 19 + patches/opam-lib/ocamlbuild.diff | 63 + patches/opass/opass.install | 1 + patches/oplay/oplay.install | 3 + patches/oplsr/install_pls.r | 5 + patches/oqamldebug/oqamldebug.install | 1 + patches/oranger/compile_ranger.sh.0.9.11 | 12 + patches/oranger/compile_ranger.sh.2.0.1 | 12 + patches/oranger/compile_ranger.sh.2.0.2 | 12 + patches/ordma/unsafe_string.patch | 10 + patches/ordma/version.patch | 19 + patches/orrandomForest/install_matrix.r | 5 + patches/orrandomForest/install_randomForest.r | 5 + patches/orsvm_e1071/install_e1071.r | 1 + patches/orsvm_e1071/install_svmpath.r | 1 + patches/orxgboost/install_matrix.r | 5 + patches/orxgboost/install_xgboost.r | 5 + patches/ospec/ospec.install.0.2.1 | 1 + patches/ospec/ospec.install.0.3.0 | 1 + patches/ospec/ospec.install.0.3.1 | 1 + patches/ospec/ospec.install.0.3.2 | 1 + patches/ott/Makefile.release.patch | 32 + patches/ott/new-string-syntax.diff | 12 + patches/ott/ott.install.0.21.2 | 1 + patches/ott/ott.install.0.24 | 3 + patches/ott/ott.install.0.25 | 3 + patches/ott/ott.install.0.26 | 3 + patches/ott/ott.install.0.27 | 3 + patches/ott/ott.install.0.28 | 3 + patches/ounit/safe-string.patch | 103 + ...t-update-config-file-for-publication.patch | 29 + patches/owl/owl.install | 6 + patches/pa_ounit/disable_warn_error.patch | 11 + patches/pcre/_oasis_remove_.ml | 7 + patches/pcre/pcre.install | 6 + ...module_js.ml-Fix-invalid-documentati.patch | 80 + .../pfff/lang_js-analyze-utils_js.mli.patch | 30 + patches/pgocaml/opam.patch | 12 + patches/pipebang/disable_warn_error.patch | 11 + .../0001-Detect-dlfcn.h-using-__linux__.patch | 26 + patches/planck/build_fix.patch | 12 + patches/planets/planets.install | 1 + patches/plasma/plasma.install | 11 + patches/podge/_oasis_remove_.ml | 7 + patches/podge/podge.install | 6 + patches/ppx_deriving/fix_dune_3.patch | 19 + .../fix_ppx_deriving_make_mllib.patch | 18 + .../ppx_deriving_morphism.install | 18 + .../ppx_monadic/2.2.1-fix-match-expr.patch | 124 + patches/prbnmcn-stats/convergence-test.patch | 27 + patches/profound/profound.install | 1 + patches/publish/publish.install | 1 + patches/pure-splitmix/pure-splitmix.install | 8 + patches/pxp/408.patch | 42 + patches/pxp/rm-dup-exc.patch | 11 + patches/qocamlbrowser/opam-configure.sh | 26 + patches/qtest/qtest.install | 4 + patches/rdbg/_oasis_remove_.ml | 7 + patches/rdbg/rdbg.install.1.0 | 10 + patches/rdbg/rdbg.install.1.65 | 6 + patches/rdbg/rdbg.install.1.70 | 6 + .../reason/reason-1.13.7-topkg-compat.patch | 79 + patches/regstab/opam.patch | 12 + patches/regstab/regstab.install | 8 + patches/reins/fix_build.patch | 88 + patches/res/build_with_trunk.patch | 26 + patches/rubytt/rubytt.install | 1 + patches/schoca/schoca.install | 4 + patches/scrypt/no-ctypes-dependency.patch | 10 + patches/seq/META.seq | 4 + patches/seq/seq.install | 3 + patches/sexplib/disable_warn_error.patch | 11 + patches/sha/freebsd.patch | 24 + .../sibylfs-lem/generate_install_manifest.sh | 9 + patches/sibylfs-lem/ocamlfind_install.sh | 8 + patches/sill/sill.install | 4 + patches/skkserv-lite/_oasis_remove_.ml | 7 + patches/skkserv-lite/skkserv-lite.install | 6 + patches/slack-backup/_oasis_remove_.ml | 7 + patches/slack-backup/slack-backup.install | 6 + patches/smart-print/operators.patch | 18 + patches/snappy/myocamlbuild.ml.osx.patch | 21 + .../solo5-no-asm-msr-index.diff | 20 + .../solo5-kernel-ukvm/solo5-no-werror.diff | 19 + .../solo5-kernel-virtio/solo5-no-werror.diff | 19 + patches/spdiff/spdiff.install | 3 + patches/sqlgg/sqlgg.install | 1 + patches/ssl/configure | 5964 +++++++++++++++++ patches/ssl/fix-accept.diff | 51 + patches/ssl/fix-meta.diff | 14 + patches/ssl/osx-configure.sh | 11 + patches/ssl/pkgconfigure | 5 + patches/stog/stog.install.0.10.0 | 10 + patches/stog/stog.install.0.11.0 | 10 + patches/stog/stog.install.0.11.1 | 10 + patches/stog/stog.install.0.12.0 | 10 + patches/stog/stog.install.0.13.0 | 12 + patches/stog/stog.install.0.14.0 | 12 + patches/stog/stog.install.0.15.0 | 16 + patches/stog/stog.install.0.16.0 | 16 + patches/stog/stog.install.0.17.0 | 16 + patches/stog/stog.install.0.17.1 | 16 + patches/stog/stog.install.0.4 | 5 + patches/stog/stog.install.0.5 | 5 + patches/stog/stog.install.0.6.1 | 5 + patches/stog/stog.install.0.7.0 | 8 + patches/stog/stog.install.0.8.0 | 8 + patches/stog/stog.install.0.9.0 | 8 + patches/stone/configure.diff | 13 + patches/stone/configure2.diff | 12 + patches/swdogen/swdogen.install | 4 + patches/tallgeese/_oasis_remove_.ml | 7 + patches/tallgeese/tallgeese.install | 6 + patches/tezos-clic/with-re.patch | 18 + patches/tezos-crypto/crypto_for_ocaml12.diff | 37 + .../tezos-hacl-glue/tests_in-packages.patch | 12 + .../tezos-lmdb/tezos-lmdb_under_freebsd.diff | 13 + .../tests_in-packages.patch | 12 + .../tests_in-packages.patch | 12 + patches/tezos-stdlib-unix/with-re.patch | 30 + .../tests_in-packages.patch | 12 + .../webassembly_for_ocaml12.diff | 13 + patches/tplib/fix-makefile.diff | 12 + ...p-rather-than-parse-its-shell-output.patch | 42 + patches/tuareg/tuareg.install | 5 + patches/type_conv/disable_warn_error.patch | 11 + patches/typehashlib/disable_warn_error.patch | 11 + patches/tyxml/rm_netstring_pcre.patch | 64 + patches/tyxml/tyxml.install | 6 + patches/ucaml/ucaml.install | 3 + patches/unison/ocaml48.patch.2.48.15v4 | 65 + patches/unison/ocaml48.patch.2.51.2 | 76 + patches/unison/opam.patch | 20 + patches/unison/unison.install.2.40.102 | 4 + patches/unison/unison.install.2.40.63 | 4 + patches/unison/unison.install.2.48.15v4 | 4 + patches/unison/unison.install.2.48.3 | 4 + patches/unison/unison.install.2.51.2 | 4 + patches/usbmux/_oasis_remove_.ml | 7 + patches/usbmux/usbmux.install | 6 + patches/utop/utop.install.1.10 | 6 + patches/utop/utop.install.1.11 | 6 + patches/utop/utop.install.1.12 | 6 + patches/utop/utop.install.1.14 | 6 + patches/utop/utop.install.1.15 | 6 + patches/utop/utop.install.1.16 | 6 + patches/utop/utop.install.1.17 | 6 + patches/utop/utop.install.1.18 | 6 + patches/utop/utop.install.1.18.1 | 6 + patches/utop/utop.install.1.18.2 | 6 + patches/utop/utop.install.1.19 | 11 + patches/utop/utop.install.1.19.1 | 11 + patches/utop/utop.install.1.19.2 | 11 + patches/utop/utop.install.1.19.3 | 11 + patches/utop/utop.install.1.4.0 | 6 + patches/utop/utop.install.1.5 | 6 + patches/utop/utop.install.1.6 | 6 + patches/utop/utop.install.1.7 | 6 + patches/utop/utop.install.1.8 | 6 + patches/utop/utop.install.1.9 | 6 + patches/uuidm/uuidm.install | 1 + patches/uunf/uunf.install | 1 + patches/uutf/uutf.install | 1 + patches/valentine/_oasis_remove_.ml | 7 + patches/valentine/valentine.install | 6 + patches/variantslib/disable_warn_error.patch | 11 + patches/volt/opam.patch | 21 + patches/wall/fix-ocaml-beta.patch.0.1 | 15 + patches/wall/fix-ocaml-beta.patch.0.2 | 15 + patches/wall/fix-ocaml-beta.patch.0.3 | 15 + patches/wall/fix-ocaml-dev.patch | 19 + patches/wasmer/lib-dune | 6 + patches/weberizer/weberizer.install | 4 + patches/websocket/websocket.install | 1 + patches/wget/wget.install | 1 + patches/why/configure.Fluorine-version.patch | 34 + patches/why/opam.patch.in | 30 + patches/why/warn-error.patch | 13 + patches/why/why-suppress-fatal-warnings.diff | 13 + patches/why/why-tuple.diff | 13 + patches/why/why.install | 16 + .../why3-base/disable-ocamldep-native.patch | 14 + patches/why3-base/gmain-build.patch | 14 + patches/why3/Makefile.patch.0.81 | 55 + patches/why3/Makefile.patch.0.82 | 21 + patches/why3/configure.patch | 43 + patches/why3/cygwin.patch | 365 + patches/why3/opam.patch | 12 + patches/why3/why3.install.0.73 | 11 + patches/why3/why3.install.0.80 | 11 + patches/wyrd/wyrd.install | 1 + .../xapi-rrd-transport/use-xen-gnt-unix.patch | 26 + patches/xapi-rrd/depend-on-rpclib.json.patch | 32 + patches/xapi-rrdd/use-xen-gnt-unix.patch | 35 + patches/xmlm/xmlm.install | 1 + patches/xstrp4/version.patch | 8 + patches/yojson/yojson.install | 1 + ...001-OCaml-static-fix-linking-options.patch | 39 + ...provide-static-linking-options-by-de.patch | 81 + patches/z3/4468.patch | 267 + patches/z3/fix-gcc-13.patch | 28 + patches/z3/fix-parallel-build.patch | 19 + patches/z3/libatomic.patch | 100 + patches/z3/optional-python-bytecode.patch | 64 + patches/zarith-freestanding/config.diff | 17 + .../zarith-freestanding/mirage-build.sh.1.10 | 15 + .../zarith-freestanding/mirage-build.sh.1.11 | 15 + .../zarith-freestanding/mirage-build.sh.1.12 | 15 + .../zarith-freestanding/mirage-build.sh.1.4 | 17 + .../zarith-freestanding/mirage-build.sh.1.4.1 | 17 + .../zarith-freestanding/mirage-build.sh.1.6 | 17 + .../zarith-freestanding/mirage-build.sh.1.7 | 17 + .../zarith-freestanding/mirage-build.sh.1.7-1 | 17 + .../zarith-freestanding/mirage-build.sh.1.7-2 | 18 + .../zarith-freestanding/mirage-build.sh.1.9.1 | 18 + .../mirage-install.sh.1.10 | 12 + .../mirage-install.sh.1.11 | 12 + .../mirage-install.sh.1.12 | 12 + .../zarith-freestanding/mirage-install.sh.1.4 | 12 + .../mirage-install.sh.1.4.1 | 12 + .../zarith-freestanding/mirage-install.sh.1.6 | 12 + .../zarith-freestanding/mirage-install.sh.1.7 | 12 + .../mirage-install.sh.1.7-1 | 12 + .../mirage-install.sh.1.7-2 | 12 + .../mirage-install.sh.1.9.1 | 12 + .../mirage-uninstall.sh.1.10 | 9 + .../mirage-uninstall.sh.1.11 | 9 + .../mirage-uninstall.sh.1.12 | 9 + .../mirage-uninstall.sh.1.4 | 9 + .../mirage-uninstall.sh.1.4.1 | 9 + .../mirage-uninstall.sh.1.6 | 9 + .../mirage-uninstall.sh.1.7 | 9 + .../mirage-uninstall.sh.1.7-1 | 9 + .../mirage-uninstall.sh.1.7-2 | 9 + .../mirage-uninstall.sh.1.9.1 | 9 + .../zarith-freestanding/no-dynlink.patch.1.10 | 86 + .../zarith-freestanding/no-dynlink.patch.1.11 | 86 + .../zarith-freestanding/no-dynlink.patch.1.12 | 86 + .../no-dynlink.patch.1.7-1 | 85 + .../no-dynlink.patch.1.7-2 | 85 + .../no-dynlink.patch.1.9.1 | 86 + patches/zarith-freestanding/z_pp.pl.patch | 11 + patches/zarith-xen/mirage-install.sh.1.3 | 18 + patches/zarith-xen/mirage-install.sh.1.4 | 21 + patches/zarith-xen/mirage-install.sh.1.6 | 21 + patches/zarith-xen/mirage-install.sh.1.7 | 21 + patches/zarith-xen/mirage-uninstall.sh | 9 + patches/zarith-xen/xen_linkopts.patch | 9 + patches/zarith/absolute_CC.patch | 35 + patches/zarith/install_fix.patch | 84 + patches/zarith/z_pp.pl.patch.1.3 | 11 + patches/zarith/z_pp.pl.patch.1.4 | 11 + 1619 files changed, 62739 insertions(+) create mode 100644 patches/0install/0install.install create mode 100644 patches/0install/gui_gtk_dir.patch create mode 100644 patches/CamlGI/CamlGI.install create mode 100644 patches/FrontC/FrontC.install create mode 100644 patches/FrontC/META.3.4 create mode 100644 patches/FrontC/META.3.4.1 create mode 100644 patches/FrontC/META.3.4.2 create mode 100644 patches/FrontC/fix-cmxs-cmx.patch create mode 100644 patches/FrontC/opam.patch.3.4 create mode 100644 patches/FrontC/opam.patch.3.4.1 create mode 100644 patches/FrontC/opam.patch.3.4.2 create mode 100644 patches/abella/abella.install.2.0.2 create mode 100644 patches/abella/abella.install.2.0.3 create mode 100644 patches/abella/abella.install.2.0.4 create mode 100644 patches/abella/abella.install.2.0.5 create mode 100644 patches/aez/META.0.3 create mode 100644 patches/afl-persistent/config.patch create mode 100644 patches/afl/add-uninstall-target.patch.2.52b create mode 100644 patches/afl/add-uninstall-target.patch.2.57b create mode 100644 patches/agrep/META.1.0 create mode 100644 patches/agrep/find-install.patch create mode 100644 patches/aifad/_oasis_remove_.ml create mode 100644 patches/aifad/aifad.install create mode 100644 patches/aio/meta.patch create mode 100644 patches/alphaCaml/alphaCaml.install create mode 100644 patches/alt-ergo-free/dune-3-fix.patch create mode 100644 patches/alt-ergo-free/makefile.user_replace_echo_by_printf.patch create mode 100644 patches/alt-ergo-free/patch_for_changes_in_num_library.patch create mode 100644 patches/alt-ergo-lib-free/dune-3-fix.patch create mode 100644 patches/alt-ergo-lib/version_update.patch create mode 100644 patches/alt-ergo-parsers-free/dune-3-fix.patch create mode 100644 patches/alt-ergo-parsers/version_update.patch create mode 100644 patches/alt-ergo/0001-fix-uninstall-lib-in-Makefile.patch create mode 100644 patches/alt-ergo/alt-ergo.install.0.95.2 create mode 100644 patches/alt-ergo/alt-ergo.install.0.99.1 create mode 100644 patches/alt-ergo/compile-with-OCaml-4.04.patch create mode 100644 patches/alt-ergo/makefile.user_replace_echo_by_printf.patch create mode 100644 patches/alt-ergo/patch_for_changes_in_num_library.patch create mode 100644 patches/alt-ergo/version_update.patch create mode 100644 patches/altgr-ergo/altgr-ergo.install.0.95.2 create mode 100644 patches/altgr-ergo/altgr-ergo.install.0.99.1 create mode 100644 patches/altgr-ergo/version_update.patch create mode 100644 patches/apalogretrieve/apalogretrieve.install create mode 100644 patches/apron/docker-workaround.diff create mode 100644 patches/arakoon/opam.patch create mode 100644 patches/archimedes/archimedes.install create mode 100644 patches/asn1-combinators/0001-bigarray-compat.patch create mode 100644 patches/async/disable_warn_error.patch create mode 100644 patches/async_core/disable_warn_error.patch create mode 100644 patches/async_extra/disable_warn_error.patch create mode 100644 patches/async_extra/patch-errno.diff create mode 100644 patches/async_unix/disable_warn_error.patch create mode 100644 patches/atd/atd.install.1.0.2 create mode 100644 patches/atd/atd.install.1.0.3 create mode 100644 patches/atd/atd.install.1.1.0 create mode 100644 patches/atd/atd.install.1.1.1 create mode 100644 patches/atd/atd.install.1.1.2 create mode 100644 patches/atd/atd.install.1.2.0 create mode 100644 patches/atd/atd.install.1.2.1 create mode 100644 patches/atdgen/atdgen.install.1.10.0 create mode 100644 patches/atdgen/atdgen.install.1.2.2 create mode 100644 patches/atdgen/atdgen.install.1.2.3 create mode 100644 patches/atdgen/atdgen.install.1.2.4 create mode 100644 patches/atdgen/atdgen.install.1.3.0 create mode 100644 patches/atdgen/atdgen.install.1.3.1 create mode 100644 patches/atdgen/atdgen.install.1.4.0 create mode 100644 patches/atdgen/atdgen.install.1.4.1 create mode 100644 patches/atdgen/atdgen.install.1.5.0 create mode 100644 patches/atdgen/atdgen.install.1.6.0 create mode 100644 patches/atdgen/atdgen.install.1.6.1 create mode 100644 patches/atdgen/atdgen.install.1.7.1 create mode 100644 patches/atdgen/atdgen.install.1.7.2 create mode 100644 patches/atdgen/atdgen.install.1.8.0 create mode 100644 patches/atdgen/atdgen.install.1.9.0 create mode 100644 patches/atdgen/atdgen.install.1.9.1 create mode 100644 patches/atdj/atdj.install create mode 100644 patches/atomic/META.atomic create mode 100644 patches/atomic/atomic.install create mode 100644 patches/bamboo/bamboo.install create mode 100644 patches/bap-ida-python/bap.cfg.in create mode 100644 patches/bap-llvm/detect.travis create mode 100644 patches/bap-x86/setup-llvm-version.sh create mode 100644 patches/base-metaocaml-ocamlfind/META.base create mode 100644 patches/base-metaocaml-ocamlfind/metaocaml.conf create mode 100644 patches/base-metaocaml-ocamlfind/metaocaml.native.conf create mode 100644 patches/base-native-int63/META.0.1 create mode 100644 patches/base-native-int63/base-native-int63.install create mode 100644 patches/base/metaocaml.patch create mode 100644 patches/batteries/cloexec.patch create mode 100644 patches/bdd/bdd.obuild create mode 100644 patches/beluga/beluga.install.0.5 create mode 100644 patches/beluga/beluga.install.0.8 create mode 100644 patches/beluga/beluga.install.0.8.1 create mode 100644 patches/beluga/beluga.install.0.8.2 create mode 100644 patches/bes/bes.install create mode 100644 patches/bibtex2html/0001-make-uninstall.patch create mode 100644 patches/bibtex2html/make-uninstall.patch create mode 100644 patches/bigbro/bigbro.install create mode 100644 patches/bigbro/opam.patch create mode 100644 patches/bin_prot/disable_warn_error.patch create mode 100644 patches/bin_prot/fix-arm-double-field.diff create mode 100644 patches/biniou/biniou.install.1.0.12 create mode 100644 patches/biniou/biniou.install.1.0.13 create mode 100644 patches/biniou/biniou.install.1.0.5 create mode 100644 patches/biniou/biniou.install.1.0.6 create mode 100644 patches/biniou/biniou.install.1.0.9 create mode 100644 patches/biniou/biniou.install.1.1.0 create mode 100644 patches/bisect/bisect.install create mode 100644 patches/bisect/install-thread.patch create mode 100644 patches/bisect/opam.patch.1.1 create mode 100644 patches/bisect/opam.patch.1.3 create mode 100644 patches/bisect_ppx/bisect_ppx.install.0.1 create mode 100644 patches/bisect_ppx/bisect_ppx.install.0.2 create mode 100644 patches/bisect_ppx/bisect_ppx.install.0.2.2 create mode 100644 patches/bisect_ppx/bisect_ppx.install.0.2.3 create mode 100644 patches/bisect_ppx/bisect_ppx.install.0.2.4 create mode 100644 patches/bisect_ppx/bisect_ppx.install.0.2.5 create mode 100644 patches/bisect_ppx/bisect_ppx.install.0.2.6 create mode 100644 patches/bisect_ppx/bisect_ppx.install.1.0.0 create mode 100644 patches/bisect_ppx/bisect_ppx.install.1.0.1 create mode 100644 patches/bisect_ppx/bisect_ppx.install.1.1.0 create mode 100644 patches/bisect_ppx/bisect_ppx.install.1.2.0 create mode 100644 patches/bitmasks/82eb7ee561c3e660dc33a6938346abf7354a23d4.patch create mode 100644 patches/bitstring/fix_402.patch create mode 100644 patches/bitstring/fix_404.patch create mode 100644 patches/bitv/META.1.0 create mode 100644 patches/bitv/bitv.install create mode 100644 patches/bolt/opam.bolt.META.patch create mode 100644 patches/bolt/opam.patch.1.2 create mode 100644 patches/bolt/opam.patch.1.3 create mode 100644 patches/bolt/opam.patch.1.4 create mode 100644 patches/boomerang/boomerang.install create mode 100644 patches/brotli/_oasis_remove_.ml create mode 100644 patches/brotli/brotli.install create mode 100644 patches/brozip/_oasis_remove_.ml create mode 100644 patches/brozip/brozip.install create mode 100644 patches/bsdowl/bsdowl.install create mode 100644 patches/bsdowl/remove.sh.2.2 create mode 100644 patches/bsdowl/remove.sh.3.0.0-20150401 create mode 100644 patches/bsdowl/remove.sh.3.0.0-20150830 create mode 100644 patches/bt/bt.install create mode 100644 patches/cairo/META.1.2.0 create mode 100644 patches/cairo/configure_fontconfig.patch create mode 100644 patches/cairo/configure_lablgtkdir.patch create mode 100644 patches/cairo/opam.patch create mode 100644 patches/cairo/opam.patch.in create mode 100644 patches/caml2html/caml2html.install create mode 100644 patches/camlhighlight/camlhighlight.install create mode 100644 patches/camlhighlight/sexp-dir.patch.in.3.0 create mode 100644 patches/camlhighlight/sexp-dir.patch.in.4.0 create mode 100644 patches/camlhighlight/sexp-dir.patch.in.5.0 create mode 100644 patches/camlidl/META.1.05 create mode 100644 patches/camlidl/META.1.07 create mode 100644 patches/camlidl/META.1.09 create mode 100644 patches/camlidl/META.1.10 create mode 100644 patches/camlidl/META.1.11 create mode 100644 patches/camlidl/META.1.12 create mode 100644 patches/camlidl/build-dll.diff create mode 100644 patches/camlidl/camlidl.install.1.05 create mode 100644 patches/camlidl/camlidl.install.1.07 create mode 100644 patches/camlidl/camlidl.install.1.09 create mode 100644 patches/camlidl/camlidl.install.1.10 create mode 100644 patches/camlidl/camlidl.install.1.11 create mode 100644 patches/camlidl/camlidl.install.1.12 create mode 100644 patches/camlidl/cpp-location.diff create mode 100644 patches/camlidl/disable-fatal-warn-31.diff create mode 100644 patches/camlimages/camlimages.4.1.0.build_fix.patch create mode 100644 patches/camlmix/camlmix.install create mode 100644 patches/camlp4/f0ea53725465260556832398096cef8d3f20b49d.patch create mode 100644 patches/camlp4/safe-string.patch create mode 100644 patches/camlp4/termux.patch create mode 100644 patches/camlp5/camlp5.install.6.04 create mode 100644 patches/camlp5/camlp5.install.6.06 create mode 100644 patches/camlp5/camlp5.install.6.07 create mode 100644 patches/camlp5/camlp5.install.6.11 create mode 100644 patches/camlp5/camlp5.install.6.12 create mode 100644 patches/camlp5/camlp5.install.6.13 create mode 100644 patches/camlp5/camlp5.install.6.14 create mode 100644 patches/camlp5/camlp5.install.6.15 create mode 100644 patches/camlp5/camlp5.install.6.16 create mode 100644 patches/camlp5/camlp5.install.6.17 create mode 100644 patches/camlp5/camlp5.install.7.00 create mode 100644 patches/camlp5/camlp5.install.7.01 create mode 100644 patches/camlp5/camlp5.install.7.03 create mode 100644 patches/camlp5/camlp5.install.7.05 create mode 100644 patches/camlp5/camlp5.install.7.06 create mode 100644 patches/camlp5/camlp5.install.7.06.10-g84ce6cc4 create mode 100644 patches/camlp5/camlp5.install.7.08 create mode 100644 patches/camlpdf/int.patch create mode 100644 patches/camlpdf/unsafe_string.patch create mode 100644 patches/camltc/osx.patch create mode 100644 patches/camlzip/META.1.04 create mode 100644 patches/camlzip/build_with_trunk.patch.1.05 create mode 100644 patches/camlzip/build_with_trunk.patch.1.06 create mode 100644 patches/camlzip/camlzip-install.diff create mode 100644 patches/camlzip/camlzip.install create mode 100644 patches/camlzip/fix-install.patch.1.05 create mode 100644 patches/camlzip/fix-install.patch.1.06 create mode 100644 patches/camlzip/no-L.patch create mode 100644 patches/camomile/4.05-typing-fix.patch create mode 100644 patches/camomile/cmx.patch create mode 100644 patches/camomile/cmxs.patch create mode 100644 patches/camomile/no-camlp4.patch create mode 100644 patches/caradoc/caradoc.install create mode 100644 patches/caradoc/no_warn_error.patch create mode 100644 patches/cca/cca.install.0.1 create mode 100644 patches/cca/cca.install.0.2 create mode 100644 patches/cca/cca.install.0.4 create mode 100644 patches/cca/cca.install.0.5 create mode 100644 patches/cca/cca.install.0.6.2 create mode 100644 patches/cca/cca.install.0.7 create mode 100644 patches/cduce/cduce.install create mode 100644 patches/cgi/ocamlfind.patch create mode 100644 patches/chamo/chamo.install create mode 100644 patches/checkseum/mirage.patch create mode 100644 patches/choice/ocamldoc-3.12.1-fix.patch create mode 100644 patches/cil/cil.install create mode 100644 patches/cil/format-obj-magic.patch create mode 100644 patches/clangml/build_with_bigger_stack_size.sh create mode 100644 patches/clangml/clangml.install create mode 100644 patches/cmdliner/backport_pre_4_00_0.patch create mode 100644 patches/coccinelle/install-python-fix.patch create mode 100644 patches/coccinelle/opam.patch create mode 100644 patches/cohttp/0001-revert-header-change.patch create mode 100644 patches/colibrics/big_constant.patch create mode 100644 patches/combine/META.0.42 create mode 100644 patches/combine/combine.install create mode 100644 patches/combine/install.diff create mode 100644 patches/commonjs_of_ocaml/_oasis_remove_.ml create mode 100644 patches/commonjs_of_ocaml/commonjs_of_ocaml.install create mode 100644 patches/comparelib/disable_warn_error.patch create mode 100644 patches/conf-bap-llvm/configure create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.1 create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.2 create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.3 create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.4 create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.5 create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.6 create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.7 create mode 100644 patches/conf-bap-llvm/find-llvm.ml.in.1.8 create mode 100644 patches/conf-binutils/find-binutils.ml.in.0.1 create mode 100644 patches/conf-binutils/find-binutils.ml.in.0.2 create mode 100644 patches/conf-binutils/find-binutils.ml.in.0.3 create mode 100644 patches/conf-blas/test-win.sh create mode 100644 patches/conf-blas/test.c create mode 100644 patches/conf-bluetooth/test-unix.c create mode 100644 patches/conf-bmake/detect_program.sh create mode 100644 patches/conf-cmake/configure.sh create mode 100644 patches/conf-dbm/test_gdbm.c create mode 100644 patches/conf-dbm/test_ndbm.c create mode 100644 patches/conf-env-travis/configure create mode 100644 patches/conf-fswatch/test.c create mode 100644 patches/conf-fts/test.c create mode 100644 patches/conf-gmp-paths/test-gmp.c create mode 100644 patches/conf-gmp-powm-sec/test.c.1 create mode 100644 patches/conf-gmp-powm-sec/test.c.2 create mode 100644 patches/conf-gmp-powm-sec/test.c.3 create mode 100644 patches/conf-gmp/test.c.1 create mode 100644 patches/conf-gmp/test.c.2 create mode 100644 patches/conf-gmp/test.c.3 create mode 100644 patches/conf-gmp/test.c.4 create mode 100644 patches/conf-ida/find-ida.ml.in.0.1 create mode 100644 patches/conf-ida/find-ida.ml.in.0.2 create mode 100644 patches/conf-ida/find-ida.ml.in.0.3 create mode 100644 patches/conf-lapack/test-win.sh create mode 100644 patches/conf-lapack/test.c create mode 100644 patches/conf-leveldb/test.cc create mode 100644 patches/conf-libclang/configure.sh.1.0.0 create mode 100644 patches/conf-libclang/configure.sh.10 create mode 100644 patches/conf-libclang/configure.sh.11 create mode 100644 patches/conf-libclang/configure.sh.12 create mode 100644 patches/conf-libclang/configure.sh.13 create mode 100644 patches/conf-libclang/configure.sh.14 create mode 100644 patches/conf-libclang/configure.sh.15 create mode 100644 patches/conf-libev/build.sh create mode 100644 patches/conf-libev/discover.ml.4-11 create mode 100644 patches/conf-libev/discover.ml.4-12 create mode 100644 patches/conf-libportmidi/check.sh create mode 100644 patches/conf-libssl/homebrew.sh.3 create mode 100644 patches/conf-libssl/homebrew.sh.4 create mode 100644 patches/conf-libssl/osx-build.sh create mode 100644 patches/conf-libsvm/test.c create mode 100644 patches/conf-llvm/configure create mode 100644 patches/conf-llvm/configure.sh.10.0.0 create mode 100644 patches/conf-llvm/configure.sh.11.0.0 create mode 100644 patches/conf-llvm/configure.sh.12.0.1 create mode 100644 patches/conf-llvm/configure.sh.13.0.0 create mode 100644 patches/conf-llvm/configure.sh.14.0.6 create mode 100644 patches/conf-llvm/configure.sh.15 create mode 100644 patches/conf-llvm/configure.sh.16 create mode 100644 patches/conf-llvm/configure.sh.3.8 create mode 100644 patches/conf-llvm/configure.sh.3.9 create mode 100644 patches/conf-llvm/configure.sh.4.0.0 create mode 100644 patches/conf-llvm/configure.sh.5.0.0 create mode 100644 patches/conf-llvm/configure.sh.6.0.0 create mode 100644 patches/conf-llvm/configure.sh.7.0.0 create mode 100644 patches/conf-llvm/configure.sh.8.0.0 create mode 100644 patches/conf-llvm/configure.sh.9.0.0 create mode 100644 patches/conf-mbedtls/test.c create mode 100644 patches/conf-mecab/test.c create mode 100644 patches/conf-mpfr-paths/test-mpfr.c create mode 100644 patches/conf-mpfr/test.c create mode 100644 patches/conf-mpi/configure create mode 100644 patches/conf-netsnmp/test.c create mode 100644 patches/conf-openblas/centos_install.sh create mode 100644 patches/conf-openblas/test.c.0.1 create mode 100644 patches/conf-openblas/test.c.0.2.0 create mode 100644 patches/conf-openblas/test.c.0.2.1 create mode 100644 patches/conf-openblas/test.c.0.2.2 create mode 100644 patches/conf-opencc0/test.c create mode 100644 patches/conf-opencc1/test.c create mode 100644 patches/conf-opencc1_1/test.c create mode 100644 patches/conf-openimageio/test.cpp create mode 100644 patches/conf-pam/main.c create mode 100644 patches/conf-pic-switch/check.sh create mode 100644 patches/conf-ppl/test.c create mode 100644 patches/conf-python-2-7-dev/test.c create mode 100644 patches/conf-python-2-7/test.py create mode 100644 patches/conf-python-3-7/configure.sh create mode 100644 patches/conf-python-3-7/test.py create mode 100644 patches/conf-python-3-dev/Makefile create mode 100644 patches/conf-python-3-dev/test.c create mode 100644 patches/conf-python-3/test.py create mode 100644 patches/conf-qt/configure.sh create mode 100644 patches/conf-r/check.r create mode 100644 patches/conf-radare2/find-radare2.ml.in create mode 100644 patches/conf-rdkit/test.cpp create mode 100644 patches/conf-rocksdb/main.c create mode 100644 patches/conf-rust-2018/test.rs create mode 100644 patches/conf-rust-2021/test.rs create mode 100644 patches/conf-snappy/test.cpp create mode 100644 patches/conf-sundials/test.c create mode 100644 patches/conf-tcl/check.sh create mode 100644 patches/conf-tcl/compiletest.c create mode 100644 patches/conf-tidy/test.c create mode 100644 patches/conf-tk/check.sh create mode 100644 patches/conf-tk/compiletest.c create mode 100644 patches/conf-trexio/test.c create mode 100644 patches/conf-xen/test.c create mode 100644 patches/conf-zmq/test.c create mode 100644 patches/coq-serapi/coq-serapi.install create mode 100644 patches/coq/0001_make_install_static_plug.patch create mode 100644 patches/coq/0002_alpine_linux.patch create mode 100644 patches/coq/0003_fix_num_ocamlfind_detection.patch create mode 100644 patches/coq/0004_fix_more_num.patch create mode 100644 patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl1 create mode 100644 patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl2 create mode 100644 patches/coq/Makefile.checker.patch create mode 100644 patches/coq/build_with_trunk.patch create mode 100644 patches/coq/configure.patch.8.3 create mode 100644 patches/coq/configure.patch.8.4pl1 create mode 100644 patches/coq/configure.patch.8.4pl2 create mode 100644 patches/coq/coq.install.8.10.0 create mode 100644 patches/coq/coq.install.8.10.1 create mode 100644 patches/coq/coq.install.8.10.2 create mode 100644 patches/coq/coq.install.8.11.0 create mode 100644 patches/coq/coq.install.8.11.1 create mode 100644 patches/coq/coq.install.8.11.2 create mode 100644 patches/coq/coq.install.8.12.0 create mode 100644 patches/coq/coq.install.8.12.1 create mode 100644 patches/coq/coq.install.8.12.2 create mode 100644 patches/coq/coq.install.8.13.0 create mode 100644 patches/coq/coq.install.8.13.1 create mode 100644 patches/coq/coq.install.8.13.2 create mode 100644 patches/coq/coq.install.8.3 create mode 100644 patches/coq/coq.install.8.4.5 create mode 100644 patches/coq/coq.install.8.4.6 create mode 100644 patches/coq/coq.install.8.4.6~camlp4 create mode 100644 patches/coq/coq.install.8.4pl1 create mode 100644 patches/coq/coq.install.8.4pl2 create mode 100644 patches/coq/coq.install.8.4pl4 create mode 100644 patches/coq/coq.install.8.5.0 create mode 100644 patches/coq/coq.install.8.5.0~camlp4 create mode 100644 patches/coq/coq.install.8.5.1 create mode 100644 patches/coq/coq.install.8.5.2 create mode 100644 patches/coq/coq.install.8.5.2~camlp4 create mode 100644 patches/coq/coq.install.8.5.3 create mode 100644 patches/coq/coq.install.8.6 create mode 100644 patches/coq/coq.install.8.6.1 create mode 100644 patches/coq/coq.install.8.7.0 create mode 100644 patches/coq/coq.install.8.7.1 create mode 100644 patches/coq/coq.install.8.7.1+1 create mode 100644 patches/coq/coq.install.8.7.1+2 create mode 100644 patches/coq/coq.install.8.7.2 create mode 100644 patches/coq/coq.install.8.8.0 create mode 100644 patches/coq/coq.install.8.8.1 create mode 100644 patches/coq/coq.install.8.8.2 create mode 100644 patches/coq/coq.install.8.9.0 create mode 100644 patches/coq/coq.install.8.9.1 create mode 100644 patches/coq/coqmktop.patch create mode 100644 patches/coq/disable_warn_70.patch.8.13.0 create mode 100644 patches/coq/disable_warn_70.patch.8.13.1 create mode 100644 patches/coq/disable_warn_70.patch.8.13.2 create mode 100644 patches/coq/disable_warn_70.patch.8.14.0 create mode 100644 patches/coq/dune-install-set-root.patch create mode 100644 patches/coq/ephemeron-rename.patch create mode 100644 patches/coq/fix-meta-plugin.patch create mode 100644 patches/coq/fix-parallel-make.patch create mode 100644 patches/coq/ld_stricter.patch create mode 100644 patches/coq/ocaml408_compat.patch create mode 100644 patches/coqide/CAML_LD_LIBRARY_PATH.patch create mode 100644 patches/coqide/CONFIGURE_allow_make4.patch create mode 100644 patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.5 create mode 100644 patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.6 create mode 100644 patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl2 create mode 100644 patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl4 create mode 100644 patches/coqide/coq-coqide.install create mode 100644 patches/coqide/coqide.install.8.10.0 create mode 100644 patches/coqide/coqide.install.8.10.1 create mode 100644 patches/coqide/coqide.install.8.10.2 create mode 100644 patches/coqide/coqide.install.8.11.0 create mode 100644 patches/coqide/coqide.install.8.11.1 create mode 100644 patches/coqide/coqide.install.8.11.2 create mode 100644 patches/coqide/coqide.install.8.12.0 create mode 100644 patches/coqide/coqide.install.8.12.1 create mode 100644 patches/coqide/coqide.install.8.12.2 create mode 100644 patches/coqide/coqide.install.8.13.0 create mode 100644 patches/coqide/coqide.install.8.13.1 create mode 100644 patches/coqide/coqide.install.8.13.2 create mode 100644 patches/coqide/coqide.install.8.5.1 create mode 100644 patches/coqide/coqide.install.8.5.2 create mode 100644 patches/coqide/coqide.install.8.5.3 create mode 100644 patches/coqide/coqide.install.8.6 create mode 100644 patches/coqide/coqide.install.8.6.1 create mode 100644 patches/coqide/coqide.install.8.7.0 create mode 100644 patches/coqide/coqide.install.8.7.1 create mode 100644 patches/coqide/coqide.install.8.7.2 create mode 100644 patches/coqide/coqide.install.8.8.0 create mode 100644 patches/coqide/coqide.install.8.8.1 create mode 100644 patches/coqide/coqide.install.8.8.2 create mode 100644 patches/coqide/coqide.install.8.9.0 create mode 100644 patches/coqide/coqide.install.8.9.1 create mode 100644 patches/coqide/ephemeron-rename.patch create mode 100644 patches/coqide/fix-idedeps-double-linking.patch create mode 100644 patches/coqide/fix-parallel-make.patch create mode 100644 patches/core/4.01cloexec.diff create mode 100644 patches/core/build_with_trunk.patch create mode 100644 patches/core/core.install.109.32.00 create mode 100644 patches/core/core.install.109.34.00 create mode 100644 patches/core/core.install.109.35.00 create mode 100644 patches/core/core.install.109.36.00 create mode 100644 patches/core/core.install.109.37.00 create mode 100644 patches/core/core.install.109.38.00 create mode 100644 patches/core/core.install.109.40.00 create mode 100644 patches/core/core.install.109.41.00 create mode 100644 patches/core/core.install.109.42.00 create mode 100644 patches/core/core.install.109.45.00 create mode 100644 patches/core/core.install.109.47.00 create mode 100644 patches/core/core.install.109.53.00 create mode 100644 patches/core/core.install.109.53.01 create mode 100644 patches/core/core.install.109.55.00 create mode 100644 patches/core/core.install.109.55.02 create mode 100644 patches/core/core.install.109.58.00 create mode 100644 patches/core/core.install.109.60.00 create mode 100644 patches/core/core.install.110.01.00 create mode 100644 patches/core/core.install.111.03.00 create mode 100644 patches/core/core.install.111.06.00 create mode 100644 patches/core/core.install.111.08.00 create mode 100644 patches/core/core.install.111.11.00 create mode 100644 patches/core/core.install.111.11.01 create mode 100644 patches/core/core.install.111.13.00 create mode 100644 patches/core/core.install.111.17.00 create mode 100644 patches/core/core.install.111.21.00 create mode 100644 patches/core/core.install.111.25.00 create mode 100644 patches/core/core.install.111.28.00 create mode 100644 patches/core/core.install.111.28.01 create mode 100644 patches/core/core.install.112.01.00 create mode 100644 patches/core/core.install.112.01.01 create mode 100644 patches/core/core.install.112.06.00 create mode 100644 patches/core/core.install.112.06.01 create mode 100644 patches/core/core.install.112.06.02 create mode 100644 patches/core/core.install.112.17.00 create mode 100644 patches/core/core.install.112.24.00 create mode 100644 patches/core/core.install.112.24.01 create mode 100644 patches/core/core.install.112.35.00 create mode 100644 patches/core/core.install.112.35.01 create mode 100644 patches/core/core.install.113.00.00 create mode 100644 patches/core/corebuild create mode 100644 patches/core/disable_warn_error.patch create mode 100644 patches/core/fix_META.patch.108.08.00 create mode 100644 patches/core/fix_META.patch.109.07.00 create mode 100644 patches/core_extended/disable_warn_error.patch create mode 100644 patches/core_extended/fix_META.patch.108.08.00 create mode 100644 patches/core_extended/fix_META.patch.109.07.00 create mode 100644 patches/core_extended/openbsd-quota-disable.diff.112.06.00 create mode 100644 patches/core_extended/openbsd-quota-disable.diff.112.17.00 create mode 100644 patches/core_extended/openbsd-quota-disable.diff.112.24.00 create mode 100644 patches/core_extended/openbsd-quota-disable.diff.112.35.00 create mode 100644 patches/core_extended/openbsd-quota-disable.diff.113.00.00 create mode 100644 patches/core_kernel/build_with_trunk.patch create mode 100644 patches/core_kernel/include_compatibility.patch create mode 100644 patches/cpdf/cpdf.install create mode 100644 patches/cppo/cppo.install create mode 100644 patches/cryptokit/aesni-align.patch create mode 100644 patches/cryptokit/aesni-detect.patch create mode 100644 patches/csdp/csdp.install create mode 100644 patches/csv/_oasis_remove_.ml create mode 100644 patches/csv/csv.install.1.2.6 create mode 100644 patches/csv/csv.install.1.3.0 create mode 100644 patches/csv/csv.install.1.3.1 create mode 100644 patches/csv/csv.install.1.3.2 create mode 100644 patches/csv/csv.install.1.3.3 create mode 100644 patches/csv/csv.install.1.3.4 create mode 100644 patches/csv/csv.install.1.4 create mode 100644 patches/csv/csv.install.1.4.1 create mode 100644 patches/csv/csv.install.1.4.2 create mode 100644 patches/ctypes/build_with_trunk.patch create mode 100644 patches/cubicle/cubicle.install create mode 100644 patches/cubicle/patch_syntax_ocaml_4_03_0.patch create mode 100644 patches/cudf/META.0.6.3 create mode 100644 patches/cudf/cudf.install create mode 100644 patches/cudf/cudf.ocp.in create mode 100644 patches/datakit-bridge-github/fmt.tty-is-used-by-datakit-log.patch create mode 100644 patches/dbforge/dbforge.install create mode 100644 patches/dbm/hasgotfix.patch create mode 100644 patches/dbm/include_fix.patch create mode 100644 patches/dbm/include_local_fix.patch create mode 100644 patches/dbm/mkdir-stublibs.patch create mode 100644 patches/dose/0001-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch create mode 100644 patches/dose/0002-ocamlgraph-1.8.6.diff create mode 100644 patches/dose/0003-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch create mode 100644 patches/dose/0004-Remove-broken-assert.patch create mode 100644 patches/dose/0005-Add-a-check_request-function-allowing-more-control-o.patch create mode 100644 patches/dose/META.dose create mode 100644 patches/dose/META.dose3 create mode 100644 patches/dose/dose.install create mode 100644 patches/dose/dose.ocp.in create mode 100644 patches/dose/patches/0001-Added-portable-invocation-of-mktemp-for-Linux-and-BS.patch create mode 100644 patches/dose/patches/0002-Sanitize-the-string-containing-the-criteria-before-p.patch create mode 100644 patches/dose/patches/0003-Modified-pattern-interpolation-to-ensure-only-one-is.patch create mode 100644 patches/dose/patches/0004-All-errors-from-cudfsolver-are-now-exceptions-and-no.patch create mode 100644 patches/dose/patches/0005-Fix-upgrade-bug-in-the-check_request-function.patch create mode 100644 patches/dose/patches/0006-Fix-compilation-problems-with-ocaml-4.0.1.patch create mode 100644 patches/dose/patches/0007-Fixed-code-for-computing-upgrade-constraints-handle-.patch create mode 100644 patches/dose/patches/0008-Use-re.pcre-instead-of-pcre.patch create mode 100644 patches/dose/patches/0009-Hardcode-__FILE__-macros.patch create mode 100644 patches/dose/patches/0010-Hardcode-IFDEF-macros-assuming-false.patch create mode 100644 patches/dose3/0001-Install-mli-cmx-etc.patch create mode 100644 patches/dose3/0002-dont-make-printconf.patch create mode 100644 patches/dose3/0003-Fix-for-ocaml-4.06.patch create mode 100644 patches/dose3/0004-Add-unix-as-dependency-to-dose3.common-in-META.in.patch create mode 100644 patches/dose3/0005-Fix-compatibility-with-ocamlgraph-2.0.patch create mode 100644 patches/dose3/0006-Grep-carefully-for-ocaml-system.patch create mode 100644 patches/dune-action-plugin/add-missing-version.patch create mode 100644 patches/dune-build-info/add-missing-version.patch create mode 100644 patches/dune-configurator/0001-dune-configurator-for-Dune-2.0.0-on-OCaml-4.06.patch create mode 100644 patches/dune-configurator/add-missing-version.patch create mode 100644 patches/dune-glob/add-missing-version.patch create mode 100644 patches/dune-private-libs/add-missing-version.patch create mode 100644 patches/dune-release/fix-tests.patch create mode 100644 patches/dune-site/add-missing-version.patch create mode 100644 patches/dune/add-missing-version.patch create mode 100644 patches/dypgen/dypgen.install create mode 100644 patches/dypgen/install-bsd-compatible.patch create mode 100644 patches/easy-format/easy-format-make.diff create mode 100644 patches/easy-format/meta-tpl.diff create mode 100644 patches/eigen/eigen.install.0.0.1 create mode 100644 patches/eigen/eigen.install.0.0.2 create mode 100644 patches/eigen/eigen.install.0.0.3 create mode 100644 patches/eigen/eigen.install.0.0.4 create mode 100644 patches/eigen/eigen.install.0.0.5 create mode 100644 patches/eigen/eigen.install.0.0.6 create mode 100644 patches/electrumAnalyzer/_oasis_remove_.ml create mode 100644 patches/electrumAnalyzer/electrumAnalyzer.install create mode 100644 patches/elf2json/_oasis_remove_.ml create mode 100644 patches/elf2json/elf2json.install create mode 100644 patches/eliom/build-against-newer-lwt.diff create mode 100644 patches/eliom/eliom.install.2.2.2 create mode 100644 patches/eliom/eliom.install.3.0.0 create mode 100644 patches/eliom/eliom.install.3.0.1 create mode 100644 patches/eliom/eliom.install.3.0.2 create mode 100644 patches/eliom/eliom.install.3.0.3 create mode 100644 patches/eliom/fix_int64.patch create mode 100644 patches/eliom/makefile_log.patch create mode 100644 patches/elpi/0001-Makefile-pass-DUNE_OPTS-to-dune.patch create mode 100644 patches/elpi/use-digest.patch create mode 100644 patches/elpi/win-temp-file.patch create mode 100644 patches/erm_xmpp/disable_tests.patch create mode 100644 patches/extlib/0001-Add-support-for-OCaml-4.12.patch create mode 100644 patches/extlib/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch create mode 100644 patches/extlib/extlib.install create mode 100644 patches/extlib/extlib.ocp create mode 100644 patches/extlib/opam.patch create mode 100644 patches/extprot/no_bin_annot.patch create mode 100644 patches/ezjsonm/build_with_trunk.patch create mode 100644 patches/facile/META.1.1 create mode 100644 patches/facile/bsdmake.patch create mode 100644 patches/facile/facile.install create mode 100644 patches/facile/ocaml_4.00.patch create mode 100644 patches/fieldslib/disable_warn_error.patch create mode 100644 patches/flowtype/flowtype.install create mode 100644 patches/frag/frag.install create mode 100644 patches/frama-c-base/4.05-support.patch create mode 100644 patches/frama-c-base/run_autoconf_if_needed.sh create mode 100644 patches/frama-c-base/wp-ocaml-403.patch create mode 100644 patches/frama-c-e-acsl/run_autoconf_if_needed.ml create mode 100644 patches/frama-c/0004-Port-to-OCamlgraph-1.8.5.patch create mode 100644 patches/frama-c/01-tests-cpp-m32.patch create mode 100644 patches/frama-c/02-tests-flamegraph.patch create mode 100644 patches/frama-c/4.01-compat.patch create mode 100644 patches/frama-c/frama-c.install.7.0 create mode 100644 patches/frama-c/frama-c.install.8.0 create mode 100644 patches/frama-c/frama-c.install.9.0 create mode 100644 patches/frama-c/frama-c.install.9.1 create mode 100644 patches/frama-c/macos.patch create mode 100644 patches/frama-c/run_autoconf_if_needed.sh create mode 100644 patches/frama-clang/CMakeLists.txt.patch create mode 100644 patches/frama-clang/build.sh.patch.in create mode 100644 patches/freetennis/freetennis create mode 100644 patches/freetennis/freetennis.install create mode 100644 patches/fstar/fstar.install create mode 100644 patches/functoria-runtime/num.patch create mode 100644 patches/fury-puyo/4.05-compatibility.patch create mode 100644 patches/fury-puyo/data_dir.patch.in create mode 100644 patches/fury-puyo/fury-puyo.install create mode 100644 patches/gadelac/gadelac.install create mode 100644 patches/gappa/0001-Added-configure-for-c-11.patch create mode 100644 patches/gappa/remake.patch create mode 100644 patches/gasoline/META.0.1 create mode 100644 patches/gasoline/gasoline.install create mode 100644 patches/gdb/gdb.install create mode 100644 patches/genlet/META.201406 create mode 100644 patches/genlet/gengenlet.ml create mode 100644 patches/genlet/gengenlet.mli create mode 100644 patches/genlet/genlet.install create mode 100644 patches/genlet/remove-tests.patch create mode 100644 patches/getopt/getopt.install create mode 100644 patches/gettext/gettext.install create mode 100644 patches/git/remove-warn-error.diff create mode 100644 patches/gitlab-unix/no-diff-installed.patch create mode 100644 patches/gmp-freestanding/gmp-freestanding.pc.6.0.0 create mode 100644 patches/gmp-freestanding/gmp-freestanding.pc.6.0.0-1 create mode 100644 patches/gmp-freestanding/gmp-freestanding.pc.6.1.2 create mode 100644 patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-1 create mode 100644 patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-2 create mode 100644 patches/gmp-freestanding/gmp-freestanding.pc.6.2.0 create mode 100644 patches/gmp-freestanding/gmp-freestanding.pc.6.2.1 create mode 100644 patches/gmp-freestanding/mirage-build.sh.6.0.0 create mode 100644 patches/gmp-freestanding/mirage-build.sh.6.0.0-1 create mode 100644 patches/gmp-freestanding/mirage-build.sh.6.1.2 create mode 100644 patches/gmp-freestanding/mirage-build.sh.6.1.2-1 create mode 100644 patches/gmp-freestanding/mirage-build.sh.6.1.2-2 create mode 100644 patches/gmp-freestanding/mirage-build.sh.6.2.0 create mode 100644 patches/gmp-freestanding/mirage-build.sh.6.2.1 create mode 100644 patches/gmp-freestanding/mirage-install.sh create mode 100644 patches/gmp-xen/gmp-6a.diff create mode 100644 patches/gmp-xen/gmp-xen.pc create mode 100644 patches/gmp-xen/mirage-build.sh.6.0.0 create mode 100644 patches/gmp-xen/mirage-build.sh.6.0.0-1 create mode 100644 patches/gmp-xen/mirage-install.sh create mode 100644 patches/goblint-cil/realGccConfigure.patch create mode 100644 patches/goblint/0001-Fix-deprecated-File.exists-in-update_suite.rb.patch create mode 100644 patches/gpr/gpr.install.1.2.1 create mode 100644 patches/gpr/gpr.install.1.2.2 create mode 100644 patches/grain_dypgen/dypgen.install create mode 100644 patches/grain_dypgen/install-bsd-compatible.patch create mode 100644 patches/graphics/META.3.07 create mode 100644 patches/graphics/META.3.07+1 create mode 100644 patches/graphics/META.3.07+2 create mode 100644 patches/graphics/META.3.08.0 create mode 100644 patches/graphics/META.3.08.1 create mode 100644 patches/graphics/META.3.08.2 create mode 100644 patches/graphics/META.3.08.3 create mode 100644 patches/graphics/META.3.08.4 create mode 100644 patches/graphics/META.3.09.0 create mode 100644 patches/graphics/META.3.09.1 create mode 100644 patches/graphics/META.3.09.2 create mode 100644 patches/graphics/META.3.09.3 create mode 100644 patches/graphics/META.3.10.0 create mode 100644 patches/graphics/META.3.10.1 create mode 100644 patches/graphics/META.3.10.2 create mode 100644 patches/graphics/META.3.11.0 create mode 100644 patches/graphics/META.3.11.1 create mode 100644 patches/graphics/META.3.11.2 create mode 100644 patches/graphics/META.3.12.0 create mode 100644 patches/graphics/META.3.12.1 create mode 100644 patches/graphics/META.4.00.0 create mode 100644 patches/graphics/META.4.00.1 create mode 100644 patches/graphics/META.4.01.0 create mode 100644 patches/graphics/META.4.02.0 create mode 100644 patches/graphics/META.4.02.1 create mode 100644 patches/graphics/META.4.02.2 create mode 100644 patches/graphics/META.4.02.3 create mode 100644 patches/graphics/META.4.03.0 create mode 100644 patches/graphics/META.4.04.0 create mode 100644 patches/graphics/META.4.04.1 create mode 100644 patches/graphics/META.4.04.2 create mode 100644 patches/graphics/META.4.05.0 create mode 100644 patches/graphics/META.4.06.0 create mode 100644 patches/graphics/META.4.06.1 create mode 100644 patches/graphics/META.4.07.0 create mode 100644 patches/graphics/META.4.07.1 create mode 100644 patches/graphics/META.4.08.0 create mode 100644 patches/graphics/META.4.08.1 create mode 100644 patches/graphics/graphics.install create mode 100644 patches/graphics/install.sh create mode 100644 patches/gsl/fixdeps.patch create mode 100644 patches/hardcaml-examples/hardcaml-examples.install create mode 100644 patches/hardcaml-reedsolomon/hardcaml-reedsolomon.install create mode 100644 patches/headache/headache.install create mode 100644 patches/heptagon/heptagon.install create mode 100644 patches/herdtools7/chatouille.patch create mode 100644 patches/hevea/hevea.install create mode 100644 patches/higlo/higlo.install create mode 100644 patches/hlarp/hlarp.install create mode 100644 patches/ibx/async.patch create mode 100644 patches/igvxml/igvxml.install create mode 100644 patches/imagemagick/fix_build.patch create mode 100644 patches/interval/META.1.3 create mode 100644 patches/interval/Makefile.patch create mode 100644 patches/iocaml-kernel/4.00.1.patch create mode 100644 patches/iocaml-kernel/iocaml-kernel.install create mode 100644 patches/iocaml/chromium-bug.patch create mode 100644 patches/iocaml/iocaml.install.0.4.2 create mode 100644 patches/iocaml/iocaml.install.0.4.3 create mode 100644 patches/iocaml/iocaml.install.0.4.4 create mode 100644 patches/iocaml/iocaml.install.0.4.5 create mode 100644 patches/iocaml/iocaml.install.0.4.6 create mode 100644 patches/iocaml/iocaml.install.0.4.7 create mode 100644 patches/iocaml/iocaml.install.0.4.8 create mode 100644 patches/iocaml/iocaml.install.0.4.9 create mode 100644 patches/iocamljs-kernel/4.00.1.patch create mode 100644 patches/iocamljs-kernel/iocamljs-kernel.install.0.4.0 create mode 100644 patches/iocamljs-kernel/iocamljs-kernel.install.0.4.3 create mode 100644 patches/iocamljs-kernel/iocamljs-kernel.install.0.4.4 create mode 100644 patches/iocamljs-kernel/iocamljs-kernel.install.0.4.5 create mode 100644 patches/iocamljs-kernel/iocamljs-kernel.install.0.4.6 create mode 100644 patches/iocamljs-kernel/iocamljs-kernel.install.0.4.8 create mode 100644 patches/irc-client/obuild-workaround.patch create mode 100644 patches/iri/ocaml-before.4.03.0.patch create mode 100644 patches/javalib/patch-javalib.diff create mode 100644 patches/jenga/jenga.install create mode 100644 patches/joolog/joolog.install create mode 100644 patches/js_of_ocaml/js_of_ocaml.install.1.2 create mode 100644 patches/js_of_ocaml/js_of_ocaml.install.1.3.1 create mode 100644 patches/js_of_ocaml/js_of_ocaml.install.1.3.2 create mode 100644 patches/js_of_ocaml/js_of_ocaml.install.1.4.0 create mode 100644 patches/js_of_ocaml/js_of_ocaml.install.2.0 create mode 100644 patches/json-wheel/json-wheel-1.0.6+safe-string.patch create mode 100644 patches/jsondiff/jsondiff.install create mode 100644 patches/jsonm/jsonm.install create mode 100644 patches/kaputt/install.patch create mode 100644 patches/kaputt/install2.patch create mode 100644 patches/kaputt/safe_string.patch create mode 100644 patches/lablgl/META.1.04.20120306 create mode 100644 patches/lablgl/META.1.05 create mode 100644 patches/lablgl/META.1.06 create mode 100644 patches/lablgl/META.1.07 create mode 100644 patches/lablgl/lablgl.install create mode 100644 patches/lablgtk/lablgldir.patch.2.16.0 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.10 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.11 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.12 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.13 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.2 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.3 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.4 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.5 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.6 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.7 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.8 create mode 100644 patches/lablgtk/lablgldir.patch.2.18.9 create mode 100644 patches/lablgtk/lablgtk.install create mode 100644 patches/lablgtk3/dune-project.patch create mode 100644 patches/lablgtk3/lablgtk.install.0.beta1 create mode 100644 patches/lablgtk3/lablgtk.install.0.beta2 create mode 100644 patches/lablgtk3/lablgtk.install.0.beta3 create mode 100644 patches/lablgtk3/ml_gtk.c.diff create mode 100644 patches/labltk/auxlibs-in-META.patch create mode 100644 patches/labltk/cltkImg.patch create mode 100644 patches/labltk/configure.patch create mode 100644 patches/labltk/hasgot.patch create mode 100644 patches/labrys/fix-dune.patch create mode 100644 patches/lambda-term/lambda-term.install.1.10 create mode 100644 patches/lambda-term/lambda-term.install.1.10.1 create mode 100644 patches/lambda-term/lambda-term.install.1.4 create mode 100644 patches/lambda-term/lambda-term.install.1.5 create mode 100644 patches/lambda-term/lambda-term.install.1.6 create mode 100644 patches/lambda-term/lambda-term.install.1.7 create mode 100644 patches/lambda-term/lambda-term.install.1.8 create mode 100644 patches/lambda-term/lambda-term.install.1.9 create mode 100644 patches/lambda-term/openbsd.diff create mode 100644 patches/lambdoc/lambdoc.install.1.0-beta2 create mode 100644 patches/lambdoc/lambdoc.install.1.0-beta3 create mode 100644 patches/lambdoc/lambdoc.install.1.0-beta4 create mode 100644 patches/lbfgs/setup.patch create mode 100644 patches/lbfgs/string.patch create mode 100644 patches/lbvs_consent/lbvs_consent.install create mode 100644 patches/lbvs_consent/makefile.patch create mode 100644 patches/ledit/ledit.install.2.03 create mode 100644 patches/ledit/ledit.install.2.04 create mode 100644 patches/ledit/ledit.install.2.05 create mode 100644 patches/ledit/ledit.install.2.06 create mode 100644 patches/leveldb/fix_snappy_link_issue.patch create mode 100644 patches/leveldb/link_against_extra_libs.patch create mode 100644 patches/leveldb/warn_error.patch create mode 100644 patches/libres3/depfix.patch create mode 100644 patches/libres3/libres3.install.0.1 create mode 100644 patches/libres3/libres3.install.0.2 create mode 100644 patches/libres3/libres3.install.0.3 create mode 100644 patches/libres3/libres3.install.0.9 create mode 100644 patches/libres3/libres3.install.1.0 create mode 100644 patches/libres3/libres3.install.1.1 create mode 100644 patches/libres3/libres3.install.1.2 create mode 100644 patches/libres3/libres3.install.1.3 create mode 100644 patches/libsvm/calc_scc_fix.patch create mode 100644 patches/libsvm/svm_cli_fix.patch create mode 100644 patches/libwasmer/config.toml create mode 100644 patches/libwasmer/libwasmer.install create mode 100644 patches/lilis/lilis.install create mode 100644 patches/liquidsoap/camomile.patch create mode 100644 patches/liquidsoap/fix-last-metadata.diff create mode 100644 patches/liquidsoap/fix_4.05.patch create mode 100644 patches/liquidsoap/fix_process_output.patch create mode 100644 patches/liquidsoap/ignore-bash-completion-install-errors.patch create mode 100644 patches/liquidsoap/lang_builtins.patch create mode 100644 patches/llvm/D24354.diff create mode 100644 patches/llvm/META.patch.10.0.0 create mode 100644 patches/llvm/META.patch.11.0.0 create mode 100644 patches/llvm/META.patch.12.0.1 create mode 100644 patches/llvm/META.patch.13.0.0 create mode 100644 patches/llvm/META.patch.14.0.6 create mode 100644 patches/llvm/META.patch.4.0.0 create mode 100644 patches/llvm/META.patch.5.0.0 create mode 100644 patches/llvm/META.patch.6.0.0 create mode 100644 patches/llvm/META.patch.7.0.0 create mode 100644 patches/llvm/META.patch.8.0.0 create mode 100644 patches/llvm/META.patch.9.0.0 create mode 100644 patches/llvm/add-cmt-for-llvm-13.patch create mode 100644 patches/llvm/build.sh create mode 100644 patches/llvm/cmake.patch create mode 100644 patches/llvm/compile.sh create mode 100644 patches/llvm/fix-macos.patch.10.0.0 create mode 100644 patches/llvm/fix-macos.patch.11.0.0 create mode 100644 patches/llvm/fix-macos.patch.12.0.1 create mode 100644 patches/llvm/fix-macos.patch.13.0.0 create mode 100644 patches/llvm/fix-macos.patch.14.0.6 create mode 100644 patches/llvm/fix-rhel.patch.10.0.0 create mode 100644 patches/llvm/fix-rhel.patch.11.0.0 create mode 100644 patches/llvm/fix-rhel.patch.12.0.1 create mode 100644 patches/llvm/fix-rhel.patch.13.0.0 create mode 100644 patches/llvm/fix-rhel.patch.14.0.6 create mode 100644 patches/llvm/fix-shared.patch.10.0.0 create mode 100644 patches/llvm/fix-shared.patch.11.0.0 create mode 100644 patches/llvm/fix-shared.patch.12.0.1 create mode 100644 patches/llvm/fix-shared.patch.13.0.0 create mode 100644 patches/llvm/fix-shared.patch.14.0.6 create mode 100644 patches/llvm/fix-shared.patch.5.0.0 create mode 100644 patches/llvm/fix-shared.patch.6.0.0 create mode 100644 patches/llvm/fix-shared.patch.7.0.0 create mode 100644 patches/llvm/fix-shared.patch.8.0.0 create mode 100644 patches/llvm/fix-shared.patch.9.0.0 create mode 100644 patches/llvm/install.sh.10.0.0 create mode 100644 patches/llvm/install.sh.11.0.0 create mode 100644 patches/llvm/install.sh.12.0.1 create mode 100644 patches/llvm/install.sh.13.0.0 create mode 100644 patches/llvm/install.sh.14.0.6 create mode 100644 patches/llvm/install.sh.3.6 create mode 100644 patches/llvm/install.sh.3.7 create mode 100644 patches/llvm/install.sh.3.8 create mode 100644 patches/llvm/install.sh.4.0.0 create mode 100644 patches/llvm/install.sh.5.0.0 create mode 100644 patches/llvm/install.sh.6.0.0 create mode 100644 patches/llvm/install.sh.7.0.0 create mode 100644 patches/llvm/install.sh.8.0.0 create mode 100644 patches/llvm/install.sh.9.0.0 create mode 100644 patches/llvm/link-META.patch.10.0.0 create mode 100644 patches/llvm/link-META.patch.11.0.0 create mode 100644 patches/llvm/link-META.patch.12.0.1 create mode 100644 patches/llvm/link-META.patch.13.0.0 create mode 100644 patches/llvm/link-META.patch.14.0.6 create mode 100644 patches/llvm/link-META.patch.4.0.0 create mode 100644 patches/llvm/link-META.patch.5.0.0 create mode 100644 patches/llvm/link-META.patch.6.0.0 create mode 100644 patches/llvm/link-META.patch.7.0.0 create mode 100644 patches/llvm/link-META.patch.8.0.0 create mode 100644 patches/llvm/link-META.patch.9.0.0 create mode 100644 patches/llvm/link.patch.3.9 create mode 100644 patches/llvm/link.patch.4.0.0 create mode 100644 patches/llvm/makefile+build.patch create mode 100644 patches/llvm/makefile+system.patch create mode 100644 patches/lru/hashtbl-seeded.patch create mode 100644 patches/lutils/_oasis_remove_.ml create mode 100644 patches/lutils/lutils.install create mode 100644 patches/lwt/4.01cloexec.diff create mode 100644 patches/lwt/META-version.patch create mode 100644 patches/lwt/lwt.install.2.7.0 create mode 100644 patches/lwt/lwt.install.2.7.1 create mode 100644 patches/lwt/lwt.install.3.0.0 create mode 100644 patches/lwt/patch-ocsigen-lwt-101.diff create mode 100644 patches/macaque/fix-configure.patch create mode 100644 patches/mascot/4.01.patch create mode 100644 patches/mascot/mascot.install create mode 100644 patches/melt/melt.install create mode 100644 patches/menhir/menhir.install.20120123 create mode 100644 patches/menhir/menhir.install.20130116 create mode 100644 patches/menhir/menhir.install.20130911 create mode 100644 patches/menhir/menhir.install.20140422 create mode 100644 patches/menhir/menhir.install.20141215 create mode 100644 patches/menhir/menhir.install.20150914 create mode 100644 patches/menhir/menhir.install.20150921 create mode 100644 patches/menhir/menhir.install.20151005 create mode 100644 patches/menhir/menhir.install.20151012 create mode 100644 patches/menhir/menhir.install.20151023 create mode 100644 patches/menhir/menhir.install.20151026 create mode 100644 patches/menhir/menhir.install.20151030 create mode 100644 patches/menhir/menhir.install.20151103 create mode 100644 patches/menhir/menhir.install.20151112 create mode 100644 patches/menhir/menhir.install.20160303 create mode 100644 patches/menhir/menhir.install.20160504 create mode 100644 patches/menhir/warn_error.patch create mode 100644 patches/merlin-acme/merlin-acme.install create mode 100644 patches/message-switch/disable-error-on-warn.patch create mode 100644 patches/message-switch/fix-mktemp-for-busybox.patch create mode 100644 patches/mezzo/mezzo.install create mode 100644 patches/mezzo/no-deprecated-fatal-warning.patch create mode 100644 patches/mikmatch/fix_build.patch create mode 100644 patches/mikmatch/mikmatch.patch create mode 100644 patches/minilight/minilight.install create mode 100644 patches/minios-xen/build-opam.sh create mode 100644 patches/mirage-www/mirage-www.install.0.3.0 create mode 100644 patches/mirage-www/mirage-www.install.0.4.0 create mode 100644 patches/mirage-www/mirage-www.install.1.0.0 create mode 100644 patches/mirage-www/mirage-www.install.1.1.0 create mode 100644 patches/mirari/mirari.install create mode 100644 patches/missinglib/meta-0.4.1.patch create mode 100644 patches/missinglib/opam.patch create mode 100644 patches/mldonkey/mldonkey.install.3.1.2 create mode 100644 patches/mldonkey/mldonkey.install.3.1.3 create mode 100644 patches/mldonkey/mldonkey.install.3.1.5 create mode 100644 patches/mldonkey/mldonkey.install.3.1.6 create mode 100644 patches/mldonkey/mldonkey.install.3.1.7-2 create mode 100644 patches/mlgmp/_oasis create mode 100644 patches/mlgmp/fix-extern-declarations.diff create mode 100644 patches/mlmpfr/mlmpfr_compatibility_test.c.4.0.2+dune create mode 100644 patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0 create mode 100644 patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix1 create mode 100644 patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix2 create mode 100644 patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.1 create mode 100644 patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.0 create mode 100644 patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.1 create mode 100644 patches/mlmpfr/test.c.3.1.6 create mode 100644 patches/mlmpfr/test.c.4.0.0 create mode 100644 patches/mlmpfr/test.c.4.0.1 create mode 100644 patches/mlmpfr/test.c.4.0.2 create mode 100644 patches/mlpost/mlpost.install create mode 100644 patches/mlpost/opam.patch.in create mode 100644 patches/modelica_ml/modelica.ml.install.0.1.1 create mode 100644 patches/modelica_ml/modelica.ml.install.0.2.0 create mode 100644 patches/mpi/post103.patch create mode 100644 patches/mpi/post105.patch create mode 100644 patches/mpp/_oasis_remove_.ml create mode 100644 patches/mpp/mpp.install.0.1.0 create mode 100644 patches/mpp/mpp.install.0.1.1 create mode 100644 patches/mpp/mpp.install.0.1.2 create mode 100644 patches/mpp/mpp.install.0.1.3 create mode 100644 patches/mpp/mpp.install.0.1.4 create mode 100644 patches/mpp/mpp.install.0.1.5 create mode 100644 patches/mpp/mpp.install.0.1.7 create mode 100644 patches/mpp/mpp.install.0.1.8 create mode 100644 patches/mpp/mpp.install.0.2.0 create mode 100644 patches/mpp/mpp.install.0.2.1 create mode 100644 patches/mpp/mpp.install.0.3.0 create mode 100644 patches/mpp/mpp.install.0.3.2 create mode 100644 patches/msgpack/no-camlp4.patch.1.0.0 create mode 100644 patches/msgpack/no-camlp4.patch.1.1.0 create mode 100644 patches/msgpack/no-camlp4.patch.1.1.1 create mode 100644 patches/msgpack/no-camlp4.patch.1.2.0 create mode 100644 patches/msgpack/no-camlp4.patch.1.2.1 create mode 100644 patches/mstruct/build_with_trunk.patch create mode 100644 patches/mustache/add_pipe.patch create mode 100644 patches/mybuild/mybuild.install create mode 100644 patches/nocrypto/0001-add-missing-runtime-dependencies-in-_tags.patch create mode 100644 patches/nocrypto/0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch create mode 100644 patches/nocrypto/0003-Auto-detect-ppx_sexp_conv-runtime-library.patch create mode 100644 patches/nocrypto/0004-pack-package-workaround-ocamlbuild-272.patch create mode 100644 patches/nocrypto/0005-use-modern-cstruct-findlib.patch create mode 100644 patches/nocrypto/0006-explicit-dependency-on-sexplib.patch create mode 100644 patches/nocrypto/0007-mirage-entropy.patch create mode 100644 patches/nocrypto/postconf.patch create mode 100644 patches/nocrypto/werror.patch.0.5.0 create mode 100644 patches/nocrypto/werror.patch.0.5.1 create mode 100644 patches/nocrypto/werror.patch.0.5.2 create mode 100644 patches/nocrypto/werror.patch.0.5.3 create mode 100644 patches/num/findlib-install.patch.1.0 create mode 100644 patches/num/findlib-install.patch.1.1 create mode 100644 patches/num/installation-warning.patch create mode 100644 patches/nuscr/fix-cram-tests.patch create mode 100644 patches/oasis-mirage/oasis.install create mode 100644 patches/oasis/_oasis_remove_.ml create mode 100644 patches/oasis/oasis.install.0.2.0 create mode 100644 patches/oasis/oasis.install.0.3.0 create mode 100644 patches/oasis/oasis.install.0.4.0 create mode 100644 patches/oasis/oasis.install.0.4.1 create mode 100644 patches/oasis/oasis.install.0.4.10 create mode 100644 patches/oasis/oasis.install.0.4.11 create mode 100644 patches/oasis/oasis.install.0.4.2 create mode 100644 patches/oasis/oasis.install.0.4.3 create mode 100644 patches/oasis/oasis.install.0.4.4 create mode 100644 patches/oasis/oasis.install.0.4.5 create mode 100644 patches/oasis/oasis.install.0.4.6 create mode 100644 patches/oasis/oasis.install.0.4.7 create mode 100644 patches/oasis/oasis.install.0.4.8 create mode 100644 patches/oasis2debian/oasis.install create mode 100644 patches/oasis2opam/_oasis_remove_.ml create mode 100644 patches/oasis2opam/oasis2opam.install.0.2 create mode 100644 patches/oasis2opam/oasis2opam.install.0.2.1 create mode 100644 patches/oasis2opam/oasis2opam.install.0.2.2 create mode 100644 patches/oasis2opam/oasis2opam.install.0.2.3 create mode 100644 patches/oasis2opam/oasis2opam.install.0.2.4 create mode 100644 patches/oasis2opam/oasis2opam.install.0.2.5 create mode 100644 patches/oasis2opam/oasis2opam.install.0.2.6 create mode 100644 patches/oasis2opam/oasis2opam.install.0.2.7 create mode 100644 patches/oasis2opam/oasis2opam.install.0.3.0 create mode 100644 patches/oasis2opam/oasis2opam.install.0.3.1 create mode 100644 patches/oasis2opam/oasis2opam.install.0.3.2 create mode 100644 patches/oasis2opam/oasis2opam.install.0.3.3 create mode 100644 patches/oasis2opam/oasis2opam.install.0.3.4 create mode 100644 patches/oasis2opam/oasis2opam.install.0.3.5 create mode 100644 patches/oasis2opam/oasis2opam.install.0.3.6 create mode 100644 patches/oasis2opam/oasis2opam.install.0.4.0 create mode 100644 patches/oasis2opam/oasis2opam.install.0.4.4 create mode 100644 patches/oasis2opam/oasis2opam.install.0.4.5 create mode 100644 patches/oasis2opam/oasis2opam.install.0.5.0 create mode 100644 patches/oasis2opam/oasis2opam.install.0.5.1 create mode 100644 patches/oasis2opam/oasis2opam.install.0.6.0 create mode 100644 patches/oasis2opam/oasis2opam.install.0.6.1 create mode 100644 patches/oasis2opam/oasis2opam.install.0.6.2 create mode 100644 patches/obigstore/obigstore-unset-warn-error.diff create mode 100644 patches/obuild/obuild.install create mode 100644 patches/ocaml-arg/ocaml-arg.install create mode 100644 patches/ocaml-base-compiler/0001-Re-generate-configure.patch create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.07 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.07+1 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.07+2 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.08.0 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.08.1 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.08.2 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.08.3 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.08.4 create mode 100644 patches/ocaml-base-compiler/PIC.patch.3.09.0 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.07 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+1 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+2 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.0 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.1 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.2 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.3 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.4 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.0 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.1 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.2 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.3 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.0 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.1 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.2 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.0 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.1 create mode 100644 patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.2 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.00.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.00.1 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.01.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.02.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.02.1 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.02.2 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.02.3 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.03.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.04.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.04.1 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.04.2 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.05.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.06.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.06.1 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.07.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.07.1 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.08.0 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.08.1 create mode 100644 patches/ocaml-base-compiler/fix-gcc10.patch.4.09.0 create mode 100644 patches/ocaml-base-compiler/ocaml-base-compiler.install create mode 100644 patches/ocaml-base-compiler/ocamlopt-fPIC.patch create mode 100644 patches/ocaml-base-compiler/pr2061.patch create mode 100644 patches/ocaml-base-compiler/pr4439.patch create mode 100644 patches/ocaml-base-compiler/pr4867.patch.3.09.0 create mode 100644 patches/ocaml-base-compiler/pr4867.patch.3.09.1 create mode 100644 patches/ocaml-base-compiler/pr4867.patch.3.09.2 create mode 100644 patches/ocaml-base-compiler/pr4867.patch.3.09.3 create mode 100644 patches/ocaml-base-compiler/pr4867.patch.3.10.0 create mode 100644 patches/ocaml-base-compiler/pr4867.patch.3.10.1 create mode 100644 patches/ocaml-base-compiler/pr4867.patch.3.10.2 create mode 100644 patches/ocaml-base-compiler/pr5237.patch create mode 100644 patches/ocaml-config/gen_ocaml_config.ml.in.0 create mode 100644 patches/ocaml-config/gen_ocaml_config.ml.in.1 create mode 100644 patches/ocaml-config/gen_ocaml_config.ml.in.2 create mode 100644 patches/ocaml-config/gen_ocaml_config.ml.in.3 create mode 100644 patches/ocaml-config/ocaml-config.install create mode 100644 patches/ocaml-expat/Makefile.patch create mode 100644 patches/ocaml-inifiles/fix_build.diff create mode 100644 patches/ocaml-inifiles/fix_lowercase.diff create mode 100644 patches/ocaml-inifiles/ocaml-inifiles.diff create mode 100644 patches/ocaml-markdown/opam.patch create mode 100644 patches/ocaml-secondary-compiler/0001-Don-t-build-manpages-for-stdlib-docs.patch create mode 100644 patches/ocaml-secondary-compiler/0001-Fix-failure-to-install-tools-links.patch create mode 100644 patches/ocaml-secondary-compiler/fix-gcc10.patch create mode 100644 patches/ocaml-src/META.3.12.1 create mode 100644 patches/ocaml-src/META.4.00.0 create mode 100644 patches/ocaml-src/META.4.00.1 create mode 100644 patches/ocaml-src/META.4.01.0 create mode 100644 patches/ocaml-src/META.4.02.0 create mode 100644 patches/ocaml-src/META.4.02.1 create mode 100644 patches/ocaml-src/META.4.02.2 create mode 100644 patches/ocaml-src/META.4.02.3 create mode 100644 patches/ocaml-src/META.4.03.0 create mode 100644 patches/ocaml-src/META.4.04.0 create mode 100644 patches/ocaml-src/META.4.04.1 create mode 100644 patches/ocaml-src/META.4.04.2 create mode 100644 patches/ocaml-src/META.4.05.0 create mode 100644 patches/ocaml-src/META.4.06.0 create mode 100644 patches/ocaml-src/META.4.06.1 create mode 100644 patches/ocaml-src/META.4.07.0 create mode 100644 patches/ocaml-src/META.4.07.1 create mode 100644 patches/ocaml-src/META.4.08.0 create mode 100644 patches/ocaml-src/META.4.08.1 create mode 100644 patches/ocaml-src/META.4.09.0 create mode 100644 patches/ocaml-src/META.4.09.1 create mode 100644 patches/ocaml-src/META.4.09.1-1 create mode 100644 patches/ocaml-src/META.4.10.0 create mode 100644 patches/ocaml-src/META.4.10.1 create mode 100644 patches/ocaml-src/META.4.10.2 create mode 100644 patches/ocaml-src/META.4.11.0 create mode 100644 patches/ocaml-src/META.4.11.1 create mode 100644 patches/ocaml-src/META.4.11.2 create mode 100644 patches/ocaml-src/META.4.12.0 create mode 100644 patches/ocaml-src/META.4.12.1 create mode 100644 patches/ocaml-src/META.4.13.0 create mode 100644 patches/ocaml-src/META.4.13.1 create mode 100644 patches/ocaml-src/META.4.13.dev create mode 100644 patches/ocaml-src/META.4.14.0 create mode 100644 patches/ocaml-src/META.4.14.1 create mode 100644 patches/ocaml-src/META.4.14.2 create mode 100644 patches/ocaml-src/META.4.14.dev create mode 100644 patches/ocaml-src/META.5.0.0 create mode 100644 patches/ocaml-src/META.5.0.dev create mode 100644 patches/ocaml-src/META.5.1.0 create mode 100644 patches/ocaml-src/META.5.1.1 create mode 100644 patches/ocaml-src/META.5.2.0 create mode 100644 patches/ocaml-src/fix-configure-4.09.1.patch create mode 100644 patches/ocaml-system/gen_ocaml_config.ml.in create mode 100644 patches/ocaml-variants/add-conditional-compilation.patch.4.06.1+rescript create mode 100644 patches/ocaml-variants/add-conditional-compilation.patch.4.10.2+rescript create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.02.0+improved-errors create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.02.2+improved-errors create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.02.4+trunk create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.03.1+trunk create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.04.1+copatterns create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.04.3+trunk create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp create mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda create mode 100644 patches/ocaml-variants/ocaml-variants.install create mode 100644 patches/ocaml-xml-rpc/ocaml-xml-rpc.install create mode 100644 patches/ocamlbrowser/hasgot.patch create mode 100644 patches/ocamlclean/disable-warn-error.patch create mode 100644 patches/ocamldap/ocaml-4.02.patch create mode 100644 patches/ocamldsort/ocamldsort.install create mode 100644 patches/ocamlfind-lint/ocamlfind-lint.install create mode 100644 patches/ocamlfind-secondary/META.in create mode 100644 patches/ocamlfind-secondary/ocaml-secondary-compiler.conf.in create mode 100644 patches/ocamlfind/0001-Fix-bug-when-installing-with-a-system-compiler.patch create mode 100644 patches/ocamlfind/0001-Harden-test-for-OCaml-5.patch create mode 100644 patches/ocamlfind/1.5.4-sed-bsd-compat.patch create mode 100644 patches/ocamlfind/check-num-in-sitelib.patch create mode 100644 patches/ocamlfind/fix-bsd.patch create mode 100644 patches/ocamlfind/no-awk-check.patch.1.0.4 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.3.1 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.3.2 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.3.3 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.4.0 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.4.1 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.5.1 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.5.2 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.5.3 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.5.4 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.5.5 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.5.6 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.6.1 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.6.2 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.7.1 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.7.2 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.7.3 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.7.3-1 create mode 100644 patches/ocamlfind/no-awk-check.patch.1.8.0 create mode 100644 patches/ocamlfind/ocaml-stub create mode 100644 patches/ocamlfind/ocamlfind.install.1.0.4 create mode 100644 patches/ocamlfind/ocamlfind.install.1.3.1 create mode 100644 patches/ocamlfind/ocamlfind.install.1.3.2 create mode 100644 patches/ocamlfind/ocamlfind.install.1.3.3 create mode 100644 patches/ocamlfind/ocamlfind.install.1.4.0 create mode 100644 patches/ocamlfind/ocamlfind.install.1.4.1 create mode 100644 patches/ocamlfind/ocamlfind.install.1.5.1 create mode 100644 patches/ocamlfind/ocamlfind.install.1.5.2 create mode 100644 patches/ocamlfind/ocamlfind.install.1.5.3 create mode 100644 patches/ocamlfind/ocamlfind.install.1.5.4 create mode 100644 patches/ocamlfind/ocamlfind.install.1.5.5 create mode 100644 patches/ocamlfind/ocamlfind.install.1.5.6 create mode 100644 patches/ocamlfind/ocamlfind.install.1.6.1 create mode 100644 patches/ocamlfind/ocamlfind.install.1.6.2 create mode 100644 patches/ocamlfind/ocamlfind.install.1.7.1 create mode 100644 patches/ocamlfind/ocamlfind.install.1.7.2 create mode 100644 patches/ocamlfind/ocamlfind.install.1.7.3 create mode 100644 patches/ocamlfind/ocamlfind.install.1.7.3-1 create mode 100644 patches/ocamlfind/ocamlfind.install.1.8.0 create mode 100644 patches/ocamlfind/ocamlfind.install.1.8.1 create mode 100644 patches/ocamlfind/termux.patch.1.6.2 create mode 100644 patches/ocamlfind/termux.patch.1.7.1 create mode 100644 patches/ocamlfind/threads.patch create mode 100644 patches/ocamlgraph/install-findlib-dgraph.patch create mode 100644 patches/ocamlgraph/ocamlgraph.install create mode 100644 patches/ocamlify/ocamlify.install create mode 100644 patches/ocamlmod/_oasis_remove_.ml create mode 100644 patches/ocamlmod/ocamlmod.install.0.0.3 create mode 100644 patches/ocamlmod/ocamlmod.install.0.0.4 create mode 100644 patches/ocamlmod/ocamlmod.install.0.0.7 create mode 100644 patches/ocamlmod/ocamlmod.install.0.0.8 create mode 100644 patches/ocamlmod/ocamlmod.install.0.0.9 create mode 100644 patches/ocamlmod/safe-string.patch create mode 100644 patches/ocamlmod/test01.mod.patch create mode 100644 patches/ocamlnet/cloexec.patch create mode 100644 patches/ocamlnet/fix-ocaml-4.02.patch create mode 100644 patches/ocamlnet/fix-version-number.patch create mode 100644 patches/ocamlnet/netgzip.patch create mode 100644 patches/ocamlnet/nethttpd_types.patch create mode 100644 patches/ocamlnet/netpop.patch create mode 100644 patches/ocamlnet/ocamlnet-ocaml4.diff create mode 100644 patches/ocamlnet/ocamlnet.install create mode 100644 patches/ocamlnet/pkg-config.patch create mode 100644 patches/ocamlnet/robust-host.patch create mode 100644 patches/ocamlscript/ocamlscript.install create mode 100644 patches/ocamlsdl/safe-string.diff create mode 100644 patches/ocamlspot/ocamlspot.install create mode 100644 patches/ocamltter/cleanup.patch create mode 100644 patches/ocamlviz/ocamlviz.install create mode 100644 patches/ocamlviz/opam.patch.in create mode 100644 patches/ocamlweb/ocamlweb.install create mode 100644 patches/ocb-stubblr/custom-cclib.patch create mode 100644 patches/ocb-stubblr/use-OPAM_SWITCH_PREFIX.patch create mode 100644 patches/oclaunch/oclaunch.install create mode 100644 patches/ocp-indent/elisp-hotfix.patch create mode 100644 patches/ocp-indent/fix-warn-error.patch.0.6.0 create mode 100644 patches/ocp-indent/fix-warn-error.patch.0.6.2 create mode 100644 patches/ocp-indent/fix-warn-error.patch.0.9.0 create mode 100644 patches/ocp-indent/ocp-indent.install create mode 100644 patches/ocp-indent/warnings.patch create mode 100644 patches/ocp-index/0001-Update-for-4.02.patch create mode 100644 patches/ocp-index/META.1.1.5 create mode 100644 patches/ocp-index/ocaml.4.02.patch.1.1.0 create mode 100644 patches/ocp-index/ocaml.4.02.patch.1.1.1 create mode 100644 patches/ocp-index/ocaml.4.02.patch.1.1.2 create mode 100644 patches/ocp-index/ocaml.4.02.patch.1.1.3 create mode 100644 patches/ocp-index/ocaml.4.02.patch.1.1.4 create mode 100644 patches/ocp-index/ocaml.4.03.patch.1.1.2 create mode 100644 patches/ocp-index/ocaml.4.03.patch.1.1.3 create mode 100644 patches/ocp-index/ocaml.4.03.patch.1.1.4 create mode 100644 patches/ocp-ocamlres/non-portable-sed-option.diff create mode 100644 patches/ocp-pack-split/ocp-pack-split.install create mode 100644 patches/ocp-pp/0001-Fix-ocp-pp-for-changes-in-compiler-libs.patch create mode 100644 patches/ocsigenserver/build-against-recent-lwt.diff create mode 100644 patches/ocsigenserver/fix-build-with-ocsipersist-sqlite.diff create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.1 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.10 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.11.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.12.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.13.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.14.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.15.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.16.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.2.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.3.1 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.4.0 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.5 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.6 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.7 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.8 create mode 100644 patches/ocsigenserver/fix-gmake-4.3.patch.2.9 create mode 100644 patches/ocsigenserver/ocsigenserver.install create mode 100644 patches/ocsigenserver/use_netstring-pcre.patch create mode 100644 patches/ocurl/examples.diff create mode 100644 patches/ocurl/fix_depend.diff create mode 100644 patches/odb-server/opam.patch.in create mode 100644 patches/odnnr/install_keras.r create mode 100644 patches/odoc-parser/0001-Don-t-make-parser-tests-installable.patch create mode 100644 patches/omake/fam.patch create mode 100644 patches/omake/lib_build_OCaml.om.diff create mode 100644 patches/omake/netbsd_fam.patch create mode 100644 patches/omake/omake.install create mode 100644 patches/omake/opam.patch create mode 100644 patches/omake/readline.patch create mode 100644 patches/omd/_oasis_remove_.ml create mode 100644 patches/omd/omd.install.0.2 create mode 100644 patches/omd/omd.install.0.3 create mode 100644 patches/omd/omd.install.0.4 create mode 100644 patches/omd/omd.install.0.5 create mode 100644 patches/omd/omd.install.0.5.4 create mode 100644 patches/omd/omd.install.0.5.5 create mode 100644 patches/omd/omd.install.0.6.0 create mode 100644 patches/omd/omd.install.0.6.1 create mode 100644 patches/omd/omd.install.0.6.2 create mode 100644 patches/omd/omd.install.0.6.3 create mode 100644 patches/omd/omd.install.0.6.4 create mode 100644 patches/omd/omd.install.0.6.5 create mode 100644 patches/omd/omd.install.0.7.0 create mode 100644 patches/omd/omd.install.0.7.1 create mode 100644 patches/omd/omd.install.0.7.2 create mode 100644 patches/omd/omd.install.0.7.3 create mode 100644 patches/omd/omd.install.0.7.4 create mode 100644 patches/omd/omd.install.0.7.5 create mode 100644 patches/omd/omd.install.0.8.0 create mode 100644 patches/omd/omd.install.0.8.1 create mode 100644 patches/omd/omd.install.0.8.2 create mode 100644 patches/omd/omd.install.0.9.0 create mode 100644 patches/omd/omd.install.0.9.1 create mode 100644 patches/omd/omd.install.0.9.3 create mode 100644 patches/omd/omd.install.0.9.4 create mode 100644 patches/omd/omd.install.0.9.5 create mode 100644 patches/omd/omd.install.0.9.6 create mode 100644 patches/omd/omd.install.0.9.7 create mode 100644 patches/omd/omd.install.1.0.0 create mode 100644 patches/omd/omd.install.1.0.1 create mode 100644 patches/omd/omd.install.1.1.0 create mode 100644 patches/omd/omd.install.1.1.1 create mode 100644 patches/omd/omd.install.1.1.2 create mode 100644 patches/omd/omd.install.1.1.3 create mode 100644 patches/omd/omd.install.1.2.0 create mode 100644 patches/omd/omd.install.1.2.1 create mode 100644 patches/omd/omd.install.1.2.2 create mode 100644 patches/omd/omd.install.1.2.3 create mode 100644 patches/omd/omd.install.1.2.4 create mode 100644 patches/omd/omd.install.1.2.5 create mode 100644 patches/omd/omd.install.1.2.6 create mode 100644 patches/omd/omd.install.1.3.0 create mode 100644 patches/opa-base/META.1.1.0+4263 create mode 100644 patches/opa-base/configure_notty.patch create mode 100644 patches/opa-base/ocamlfind.patch create mode 100644 patches/opa-base/opa-base.install create mode 100644 patches/opa-base/rm_deps.patch create mode 100644 patches/opam-build-revdeps/_oasis_remove_.ml create mode 100644 patches/opam-build-revdeps/opam-build-revdeps.install create mode 100644 patches/opam-lib/fix-build.diff create mode 100644 patches/opam-lib/fix-wait.diff create mode 100644 patches/opam-lib/ocamlbuild.diff create mode 100644 patches/opass/opass.install create mode 100644 patches/oplay/oplay.install create mode 100644 patches/oplsr/install_pls.r create mode 100644 patches/oqamldebug/oqamldebug.install create mode 100644 patches/oranger/compile_ranger.sh.0.9.11 create mode 100644 patches/oranger/compile_ranger.sh.2.0.1 create mode 100644 patches/oranger/compile_ranger.sh.2.0.2 create mode 100644 patches/ordma/unsafe_string.patch create mode 100644 patches/ordma/version.patch create mode 100644 patches/orrandomForest/install_matrix.r create mode 100644 patches/orrandomForest/install_randomForest.r create mode 100644 patches/orsvm_e1071/install_e1071.r create mode 100644 patches/orsvm_e1071/install_svmpath.r create mode 100644 patches/orxgboost/install_matrix.r create mode 100644 patches/orxgboost/install_xgboost.r create mode 100644 patches/ospec/ospec.install.0.2.1 create mode 100644 patches/ospec/ospec.install.0.3.0 create mode 100644 patches/ospec/ospec.install.0.3.1 create mode 100644 patches/ospec/ospec.install.0.3.2 create mode 100644 patches/ott/Makefile.release.patch create mode 100644 patches/ott/new-string-syntax.diff create mode 100644 patches/ott/ott.install.0.21.2 create mode 100644 patches/ott/ott.install.0.24 create mode 100644 patches/ott/ott.install.0.25 create mode 100644 patches/ott/ott.install.0.26 create mode 100644 patches/ott/ott.install.0.27 create mode 100644 patches/ott/ott.install.0.28 create mode 100644 patches/ounit/safe-string.patch create mode 100644 patches/owl/0001-Revert-update-config-file-for-publication.patch create mode 100644 patches/owl/owl.install create mode 100644 patches/pa_ounit/disable_warn_error.patch create mode 100644 patches/pcre/_oasis_remove_.ml create mode 100644 patches/pcre/pcre.install create mode 100644 patches/pfff/lang_js-analyze-module_js.ml-Fix-invalid-documentati.patch create mode 100644 patches/pfff/lang_js-analyze-utils_js.mli.patch create mode 100644 patches/pgocaml/opam.patch create mode 100644 patches/pipebang/disable_warn_error.patch create mode 100644 patches/pkcs11/0001-Detect-dlfcn.h-using-__linux__.patch create mode 100644 patches/planck/build_fix.patch create mode 100644 patches/planets/planets.install create mode 100644 patches/plasma/plasma.install create mode 100644 patches/podge/_oasis_remove_.ml create mode 100644 patches/podge/podge.install create mode 100644 patches/ppx_deriving/fix_dune_3.patch create mode 100644 patches/ppx_deriving/fix_ppx_deriving_make_mllib.patch create mode 100644 patches/ppx_deriving_morphism/ppx_deriving_morphism.install create mode 100644 patches/ppx_monadic/2.2.1-fix-match-expr.patch create mode 100644 patches/prbnmcn-stats/convergence-test.patch create mode 100644 patches/profound/profound.install create mode 100644 patches/publish/publish.install create mode 100644 patches/pure-splitmix/pure-splitmix.install create mode 100644 patches/pxp/408.patch create mode 100644 patches/pxp/rm-dup-exc.patch create mode 100644 patches/qocamlbrowser/opam-configure.sh create mode 100644 patches/qtest/qtest.install create mode 100644 patches/rdbg/_oasis_remove_.ml create mode 100644 patches/rdbg/rdbg.install.1.0 create mode 100644 patches/rdbg/rdbg.install.1.65 create mode 100644 patches/rdbg/rdbg.install.1.70 create mode 100644 patches/reason/reason-1.13.7-topkg-compat.patch create mode 100644 patches/regstab/opam.patch create mode 100644 patches/regstab/regstab.install create mode 100644 patches/reins/fix_build.patch create mode 100644 patches/res/build_with_trunk.patch create mode 100644 patches/rubytt/rubytt.install create mode 100644 patches/schoca/schoca.install create mode 100644 patches/scrypt/no-ctypes-dependency.patch create mode 100644 patches/seq/META.seq create mode 100644 patches/seq/seq.install create mode 100644 patches/sexplib/disable_warn_error.patch create mode 100644 patches/sha/freebsd.patch create mode 100644 patches/sibylfs-lem/generate_install_manifest.sh create mode 100644 patches/sibylfs-lem/ocamlfind_install.sh create mode 100644 patches/sill/sill.install create mode 100644 patches/skkserv-lite/_oasis_remove_.ml create mode 100644 patches/skkserv-lite/skkserv-lite.install create mode 100644 patches/slack-backup/_oasis_remove_.ml create mode 100644 patches/slack-backup/slack-backup.install create mode 100644 patches/smart-print/operators.patch create mode 100644 patches/snappy/myocamlbuild.ml.osx.patch create mode 100644 patches/solo5-kernel-ukvm/solo5-no-asm-msr-index.diff create mode 100644 patches/solo5-kernel-ukvm/solo5-no-werror.diff create mode 100644 patches/solo5-kernel-virtio/solo5-no-werror.diff create mode 100644 patches/spdiff/spdiff.install create mode 100644 patches/sqlgg/sqlgg.install create mode 100644 patches/ssl/configure create mode 100644 patches/ssl/fix-accept.diff create mode 100644 patches/ssl/fix-meta.diff create mode 100644 patches/ssl/osx-configure.sh create mode 100644 patches/ssl/pkgconfigure create mode 100644 patches/stog/stog.install.0.10.0 create mode 100644 patches/stog/stog.install.0.11.0 create mode 100644 patches/stog/stog.install.0.11.1 create mode 100644 patches/stog/stog.install.0.12.0 create mode 100644 patches/stog/stog.install.0.13.0 create mode 100644 patches/stog/stog.install.0.14.0 create mode 100644 patches/stog/stog.install.0.15.0 create mode 100644 patches/stog/stog.install.0.16.0 create mode 100644 patches/stog/stog.install.0.17.0 create mode 100644 patches/stog/stog.install.0.17.1 create mode 100644 patches/stog/stog.install.0.4 create mode 100644 patches/stog/stog.install.0.5 create mode 100644 patches/stog/stog.install.0.6.1 create mode 100644 patches/stog/stog.install.0.7.0 create mode 100644 patches/stog/stog.install.0.8.0 create mode 100644 patches/stog/stog.install.0.9.0 create mode 100644 patches/stone/configure.diff create mode 100644 patches/stone/configure2.diff create mode 100644 patches/swdogen/swdogen.install create mode 100644 patches/tallgeese/_oasis_remove_.ml create mode 100644 patches/tallgeese/tallgeese.install create mode 100644 patches/tezos-clic/with-re.patch create mode 100644 patches/tezos-crypto/crypto_for_ocaml12.diff create mode 100644 patches/tezos-hacl-glue/tests_in-packages.patch create mode 100644 patches/tezos-lmdb/tezos-lmdb_under_freebsd.diff create mode 100644 patches/tezos-lwt-result-stdlib/tests_in-packages.patch create mode 100644 patches/tezos-protocol-environment-packer/tests_in-packages.patch create mode 100644 patches/tezos-stdlib-unix/with-re.patch create mode 100644 patches/tezos-test-helpers/tests_in-packages.patch create mode 100644 patches/tezos-webassembly-interpreter/webassembly_for_ocaml12.diff create mode 100644 patches/tplib/fix-makefile.diff create mode 100644 patches/tuareg/0001-Run-opam-sexp-rather-than-parse-its-shell-output.patch create mode 100644 patches/tuareg/tuareg.install create mode 100644 patches/type_conv/disable_warn_error.patch create mode 100644 patches/typehashlib/disable_warn_error.patch create mode 100644 patches/tyxml/rm_netstring_pcre.patch create mode 100644 patches/tyxml/tyxml.install create mode 100644 patches/ucaml/ucaml.install create mode 100644 patches/unison/ocaml48.patch.2.48.15v4 create mode 100644 patches/unison/ocaml48.patch.2.51.2 create mode 100644 patches/unison/opam.patch create mode 100644 patches/unison/unison.install.2.40.102 create mode 100644 patches/unison/unison.install.2.40.63 create mode 100644 patches/unison/unison.install.2.48.15v4 create mode 100644 patches/unison/unison.install.2.48.3 create mode 100644 patches/unison/unison.install.2.51.2 create mode 100644 patches/usbmux/_oasis_remove_.ml create mode 100644 patches/usbmux/usbmux.install create mode 100644 patches/utop/utop.install.1.10 create mode 100644 patches/utop/utop.install.1.11 create mode 100644 patches/utop/utop.install.1.12 create mode 100644 patches/utop/utop.install.1.14 create mode 100644 patches/utop/utop.install.1.15 create mode 100644 patches/utop/utop.install.1.16 create mode 100644 patches/utop/utop.install.1.17 create mode 100644 patches/utop/utop.install.1.18 create mode 100644 patches/utop/utop.install.1.18.1 create mode 100644 patches/utop/utop.install.1.18.2 create mode 100644 patches/utop/utop.install.1.19 create mode 100644 patches/utop/utop.install.1.19.1 create mode 100644 patches/utop/utop.install.1.19.2 create mode 100644 patches/utop/utop.install.1.19.3 create mode 100644 patches/utop/utop.install.1.4.0 create mode 100644 patches/utop/utop.install.1.5 create mode 100644 patches/utop/utop.install.1.6 create mode 100644 patches/utop/utop.install.1.7 create mode 100644 patches/utop/utop.install.1.8 create mode 100644 patches/utop/utop.install.1.9 create mode 100644 patches/uuidm/uuidm.install create mode 100644 patches/uunf/uunf.install create mode 100644 patches/uutf/uutf.install create mode 100644 patches/valentine/_oasis_remove_.ml create mode 100644 patches/valentine/valentine.install create mode 100644 patches/variantslib/disable_warn_error.patch create mode 100644 patches/volt/opam.patch create mode 100644 patches/wall/fix-ocaml-beta.patch.0.1 create mode 100644 patches/wall/fix-ocaml-beta.patch.0.2 create mode 100644 patches/wall/fix-ocaml-beta.patch.0.3 create mode 100644 patches/wall/fix-ocaml-dev.patch create mode 100644 patches/wasmer/lib-dune create mode 100644 patches/weberizer/weberizer.install create mode 100644 patches/websocket/websocket.install create mode 100644 patches/wget/wget.install create mode 100644 patches/why/configure.Fluorine-version.patch create mode 100644 patches/why/opam.patch.in create mode 100644 patches/why/warn-error.patch create mode 100644 patches/why/why-suppress-fatal-warnings.diff create mode 100644 patches/why/why-tuple.diff create mode 100644 patches/why/why.install create mode 100644 patches/why3-base/disable-ocamldep-native.patch create mode 100644 patches/why3-base/gmain-build.patch create mode 100644 patches/why3/Makefile.patch.0.81 create mode 100644 patches/why3/Makefile.patch.0.82 create mode 100644 patches/why3/configure.patch create mode 100644 patches/why3/cygwin.patch create mode 100644 patches/why3/opam.patch create mode 100644 patches/why3/why3.install.0.73 create mode 100644 patches/why3/why3.install.0.80 create mode 100644 patches/wyrd/wyrd.install create mode 100644 patches/xapi-rrd-transport/use-xen-gnt-unix.patch create mode 100644 patches/xapi-rrd/depend-on-rpclib.json.patch create mode 100644 patches/xapi-rrdd/use-xen-gnt-unix.patch create mode 100644 patches/xmlm/xmlm.install create mode 100644 patches/xstrp4/version.patch create mode 100644 patches/yojson/yojson.install create mode 100644 patches/z3/0001-OCaml-static-fix-linking-options.patch create mode 100644 patches/z3/0002-OCaml-API-build-provide-static-linking-options-by-de.patch create mode 100644 patches/z3/4468.patch create mode 100644 patches/z3/fix-gcc-13.patch create mode 100644 patches/z3/fix-parallel-build.patch create mode 100644 patches/z3/libatomic.patch create mode 100644 patches/z3/optional-python-bytecode.patch create mode 100644 patches/zarith-freestanding/config.diff create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.10 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.11 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.12 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.4 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.4.1 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.6 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.7 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.7-1 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.7-2 create mode 100644 patches/zarith-freestanding/mirage-build.sh.1.9.1 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.10 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.11 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.12 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.4 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.4.1 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.6 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.7 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.7-1 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.7-2 create mode 100644 patches/zarith-freestanding/mirage-install.sh.1.9.1 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.10 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.11 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.12 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.4 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.4.1 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.6 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.7 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.7-1 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.7-2 create mode 100644 patches/zarith-freestanding/mirage-uninstall.sh.1.9.1 create mode 100644 patches/zarith-freestanding/no-dynlink.patch.1.10 create mode 100644 patches/zarith-freestanding/no-dynlink.patch.1.11 create mode 100644 patches/zarith-freestanding/no-dynlink.patch.1.12 create mode 100644 patches/zarith-freestanding/no-dynlink.patch.1.7-1 create mode 100644 patches/zarith-freestanding/no-dynlink.patch.1.7-2 create mode 100644 patches/zarith-freestanding/no-dynlink.patch.1.9.1 create mode 100644 patches/zarith-freestanding/z_pp.pl.patch create mode 100644 patches/zarith-xen/mirage-install.sh.1.3 create mode 100644 patches/zarith-xen/mirage-install.sh.1.4 create mode 100644 patches/zarith-xen/mirage-install.sh.1.6 create mode 100644 patches/zarith-xen/mirage-install.sh.1.7 create mode 100644 patches/zarith-xen/mirage-uninstall.sh create mode 100644 patches/zarith-xen/xen_linkopts.patch create mode 100644 patches/zarith/absolute_CC.patch create mode 100644 patches/zarith/install_fix.patch create mode 100644 patches/zarith/z_pp.pl.patch.1.3 create mode 100644 patches/zarith/z_pp.pl.patch.1.4 diff --git a/patches/0install/0install.install b/patches/0install/0install.install new file mode 100644 index 0000000..fc2ef53 --- /dev/null +++ b/patches/0install/0install.install @@ -0,0 +1,19 @@ +bin: [ + "dist/files/0install" + "dist/files/0install" {"0launch"} + "dist/files/0install" {"0store"} + "dist/files/0install" {"0store-secure-add"} + "dist/files/0install" {"0desktop"} + "dist/files/0install" {"0alias"} +] +lib: [ + "?dist/files/gui_gtk.cmxs" + "?dist/files/gui_gtk.cma" +] +man: [ + "0launch.1" {"man1/0launch.1"} + "0store-secure-add.1" {"man1/0store-secure-add.1"} + "0store.1" {"man1/0store.1"} + "0desktop.1" {"man1/0desktop.1"} + "0install.1" {"man1/0install.1"} +] diff --git a/patches/0install/gui_gtk_dir.patch b/patches/0install/gui_gtk_dir.patch new file mode 100644 index 0000000..29e3cb3 --- /dev/null +++ b/patches/0install/gui_gtk_dir.patch @@ -0,0 +1,13 @@ +diff --git a/ocaml/zeroinstall/gui.ml b/ocaml/zeroinstall/gui.ml +index fa92430..8f15419 100644 +--- a/ocaml/zeroinstall/gui.ml ++++ b/ocaml/zeroinstall/gui.ml +@@ -359,6 +359,8 @@ let try_get_gui config ~use_gui = + let plugin_path = + let sys_lib = Filename.dirname bindir +/ "lib" in + U.first_match check_plugin_dir [ ++ (* 0install lib dir *) ++ sys_lib +/ "0install"; + (* Is 0install is installed as distro package? *) + sys_lib +/ "0install.net"; + (* Are we running via 0install? *) diff --git a/patches/CamlGI/CamlGI.install b/patches/CamlGI/CamlGI.install new file mode 100644 index 0000000..f03f71c --- /dev/null +++ b/patches/CamlGI/CamlGI.install @@ -0,0 +1 @@ +lib: ["camlGI.a"] diff --git a/patches/FrontC/FrontC.install b/patches/FrontC/FrontC.install new file mode 100644 index 0000000..e1130ff --- /dev/null +++ b/patches/FrontC/FrontC.install @@ -0,0 +1,6 @@ +bin: [ + "calipso/calipso" + "calipso/calipso_stat" + "ctoxml/ctoxml" + "printc/printc" +] diff --git a/patches/FrontC/META.3.4 b/patches/FrontC/META.3.4 new file mode 100644 index 0000000..10a7dbc --- /dev/null +++ b/patches/FrontC/META.3.4 @@ -0,0 +1,5 @@ +description = "Parser for the C language" +version = "3.4" +requires = "unix" +archive(byte) = "frontc.cma" +archive(native) = "frontc.cmxa" diff --git a/patches/FrontC/META.3.4.1 b/patches/FrontC/META.3.4.1 new file mode 100644 index 0000000..68f7784 --- /dev/null +++ b/patches/FrontC/META.3.4.1 @@ -0,0 +1,5 @@ +description = "Parser for the C language" +version = "3.4.1" +requires = "unix" +archive(byte) = "frontc.cma" +archive(native) = "frontc.cmxa" diff --git a/patches/FrontC/META.3.4.2 b/patches/FrontC/META.3.4.2 new file mode 100644 index 0000000..68f7784 --- /dev/null +++ b/patches/FrontC/META.3.4.2 @@ -0,0 +1,5 @@ +description = "Parser for the C language" +version = "3.4.1" +requires = "unix" +archive(byte) = "frontc.cma" +archive(native) = "frontc.cmxa" diff --git a/patches/FrontC/fix-cmxs-cmx.patch b/patches/FrontC/fix-cmxs-cmx.patch new file mode 100644 index 0000000..685459b --- /dev/null +++ b/patches/FrontC/fix-cmxs-cmx.patch @@ -0,0 +1,31 @@ +diff --git a/Makefile.head b/Makefile.head +index 88e5b65..5f9969f 100644 +--- a/Makefile.head ++++ b/Makefile.head +@@ -100,8 +100,9 @@ $(1)_CMIX = $$(patsubst %.cmx,%.cmi,$$($(1)_CMX)) + _DEPS += $$(patsubst %.cmx,$(DEP_DIR)/%.d,$$($(1)_CMX)) \ + $$(patsubst %.mly,$(DEP_DIR)/%.mli.d,$$($(1)_MLYX)) + _PRE_DEPS += $$($(1)_MLX) +-_DIST_CLEAN += $(1).cmxa $(1).a $$($(1)_CMIX) ++_DIST_CLEAN += $(1).cmxa $(1).cmxs $(1).a $$($(1)_CMIX) + _CLEAN += $$($(1)_CMX) \ ++ $(1).cmxa $(1).cmxs \ + $$(patsubst %.cmx,%.o,$$($(1)_CMX)) \ + $$(patsubst %.mll,%.ml,$$($(1)_MLLX)) \ + $$(patsubst %.mly,%.ml,$$($(1)_MLYX)) \ +@@ -113,12 +114,12 @@ _INSTALL += _install_$(1)_CMXA _install_$(1)_CMXS + $(1).cmxa: $$($(1)_CMX) + $$(OCAMLOPT) -a $$($(1)_LDFLAGS) $$(OCAMLOPT_LDFLAGS) -o $$@ $$($(1)_CMX) $$(OCAMLOPT_LIBS) + +-$(1).cmxs: $$($(1).cmxa) +- $$(OCAMLOPT) -shared -linkall $$($(1).cmxa) -o $$@ ++$(1).cmxs: $(1).cmxa $(1).a ++ $$(OCAMLOPT) -shared -linkall $(1).cmxa -o $$@ + + _install_$(1)_CMXA: + install -d $(OCAML_SITE)/FrontC +- install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/FrontC ++ install $(1).cmxa $(1).a $$($(1)_CMX) $$($(1)_CMIX) $(OCAML_SITE)/FrontC + + _install_$(1)_CMXS: + install -d $(OCAML_SITE)/FrontC diff --git a/patches/FrontC/opam.patch.3.4 b/patches/FrontC/opam.patch.3.4 new file mode 100644 index 0000000..4caeb4f --- /dev/null +++ b/patches/FrontC/opam.patch.3.4 @@ -0,0 +1,25 @@ +diff -ru FrontC.3.4/Makefile.head FrontC.3.4/Makefile.head +--- FrontC.3.4/Makefile.head 2008-04-01 15:53:52.000000000 +0200 ++++ FrontC.3.4/Makefile.head 2012-10-05 18:14:56.993802068 +0200 +@@ -84,8 +84,8 @@ + $$(OCAMLC) -a $$($(1)_LDFLAGS) $$(OCAMLC_LDFLAGS) -o $$@ $$($(1)_CMO) $$(OCAMLC_LIBS) + + _install_$(1)_CMA: +- install -d $(OCAML_SITE)/$(1) +- install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/$(1) ++ install -d $(OCAML_SITE)/FrontC ++ install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/FrontC + + endef + +@@ -114,8 +114,8 @@ + $$(OCAMLOPT) -a $$($(1)_LDFLAGS) $$(OCAMLOPT_LDFLAGS) -o $$@ $$($(1)_CMX) $$(OCAMLOPT_LIBS) + + _install_$(1)_CMXA: +- install -d $(OCAML_SITE)/$(1) +- install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/$(1) ++ install -d $(OCAML_SITE)/FrontC ++ install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/FrontC + + endef + diff --git a/patches/FrontC/opam.patch.3.4.1 b/patches/FrontC/opam.patch.3.4.1 new file mode 100644 index 0000000..d25cc85 --- /dev/null +++ b/patches/FrontC/opam.patch.3.4.1 @@ -0,0 +1,25 @@ +diff -ru FrontC.3.4.1/Makefile.head FrontC.3.4.1/Makefile.head +--- FrontC.3.4.1/Makefile.head 2008-04-01 15:53:52.000000000 +0200 ++++ FrontC.3.4.1/Makefile.head 2012-10-05 18:14:56.993802068 +0200 +@@ -84,8 +84,8 @@ + $$(OCAMLC) -a $$($(1)_LDFLAGS) $$(OCAMLC_LDFLAGS) -o $$@ $$($(1)_CMO) $$(OCAMLC_LIBS) + + _install_$(1)_CMA: +- install -d $(OCAML_SITE)/$(1) +- install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/$(1) ++ install -d $(OCAML_SITE)/FrontC ++ install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/FrontC + + endef + +@@ -114,8 +114,8 @@ + $$(OCAMLOPT) -a $$($(1)_LDFLAGS) $$(OCAMLOPT_LDFLAGS) -o $$@ $$($(1)_CMX) $$(OCAMLOPT_LIBS) + + _install_$(1)_CMXA: +- install -d $(OCAML_SITE)/$(1) +- install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/$(1) ++ install -d $(OCAML_SITE)/FrontC ++ install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/FrontC + + endef + diff --git a/patches/FrontC/opam.patch.3.4.2 b/patches/FrontC/opam.patch.3.4.2 new file mode 100644 index 0000000..d25cc85 --- /dev/null +++ b/patches/FrontC/opam.patch.3.4.2 @@ -0,0 +1,25 @@ +diff -ru FrontC.3.4.1/Makefile.head FrontC.3.4.1/Makefile.head +--- FrontC.3.4.1/Makefile.head 2008-04-01 15:53:52.000000000 +0200 ++++ FrontC.3.4.1/Makefile.head 2012-10-05 18:14:56.993802068 +0200 +@@ -84,8 +84,8 @@ + $$(OCAMLC) -a $$($(1)_LDFLAGS) $$(OCAMLC_LDFLAGS) -o $$@ $$($(1)_CMO) $$(OCAMLC_LIBS) + + _install_$(1)_CMA: +- install -d $(OCAML_SITE)/$(1) +- install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/$(1) ++ install -d $(OCAML_SITE)/FrontC ++ install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/FrontC + + endef + +@@ -114,8 +114,8 @@ + $$(OCAMLOPT) -a $$($(1)_LDFLAGS) $$(OCAMLOPT_LDFLAGS) -o $$@ $$($(1)_CMX) $$(OCAMLOPT_LIBS) + + _install_$(1)_CMXA: +- install -d $(OCAML_SITE)/$(1) +- install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/$(1) ++ install -d $(OCAML_SITE)/FrontC ++ install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/FrontC + + endef + diff --git a/patches/abella/abella.install.2.0.2 b/patches/abella/abella.install.2.0.2 new file mode 100644 index 0000000..39c19a7 --- /dev/null +++ b/patches/abella/abella.install.2.0.2 @@ -0,0 +1 @@ +bin: ["_build/src/abella.native" {"abella"}] diff --git a/patches/abella/abella.install.2.0.3 b/patches/abella/abella.install.2.0.3 new file mode 100644 index 0000000..0ca0bbb --- /dev/null +++ b/patches/abella/abella.install.2.0.3 @@ -0,0 +1,120 @@ +bin: ["_build/src/abella.native" {"abella"}] +share: [ "emacs/abella.el" {"emacs/abella.el"} + "emacs/lprolog.el" {"emacs/lprolog.el"} + "emacs/pg/abella.el" {"emacs/pg/abella.el"} + "emacs/pg/abella-syntax.el" {"emacs/pg/abella-syntax.el"} + "emacs/pg/Makefile" {"emacs/pg/Makefile"} + "emacs/pg/README.markdown" {"emacs/pg/README.markdown"} + "emacs/README" {"emacs/README"} + "examples/first-order/ackermann.thm" {"examples/first-order/ackermann.thm"} + "examples/first-order/add.mod" {"examples/first-order/add.mod"} + "examples/first-order/add.sig" {"examples/first-order/add.sig"} + "examples/first-order/add.thm" {"examples/first-order/add.thm"} + "examples/first-order/even-odd.thm" {"examples/first-order/even-odd.thm"} + "examples/first-order/gcd.mod" {"examples/first-order/gcd.mod"} + "examples/first-order/gcd.sig" {"examples/first-order/gcd.sig"} + "examples/first-order/gcd.thm" {"examples/first-order/gcd.thm"} + "examples/first-order/lists.mod" {"examples/first-order/lists.mod"} + "examples/first-order/lists.sig" {"examples/first-order/lists.sig"} + "examples/first-order/lists.thm" {"examples/first-order/lists.thm"} + "examples/higher-order/bred_alt.mod" {"examples/higher-order/bred_alt.mod"} + "examples/higher-order/bred_alt.sig" {"examples/higher-order/bred_alt.sig"} + "examples/higher-order/bred_alt.thm" {"examples/higher-order/bred_alt.thm"} + "examples/higher-order/breduce.mod" {"examples/higher-order/breduce.mod"} + "examples/higher-order/breduce.sig" {"examples/higher-order/breduce.sig"} + "examples/higher-order/breduce.thm" {"examples/higher-order/breduce.thm"} + "examples/higher-order/debruijn_ho.mod" {"examples/higher-order/debruijn_ho.mod"} + "examples/higher-order/debruijn_ho.sig" {"examples/higher-order/debruijn_ho.sig"} + "examples/higher-order/debruijn_ho.thm" {"examples/higher-order/debruijn_ho.thm"} + "examples/higher-order/fsub.mod" {"examples/higher-order/fsub.mod"} + "examples/higher-order/fsub.sig" {"examples/higher-order/fsub.sig"} + "examples/higher-order/fsub.thm" {"examples/higher-order/fsub.thm"} + "examples/lambda-calculus/cr.mod" {"examples/lambda-calculus/cr.mod"} + "examples/lambda-calculus/cr.sig" {"examples/lambda-calculus/cr.sig"} + "examples/lambda-calculus/cr.thm" {"examples/lambda-calculus/cr.thm"} + "examples/lambda-calculus/eval.mod" {"examples/lambda-calculus/eval.mod"} + "examples/lambda-calculus/eval.sig" {"examples/lambda-calculus/eval.sig"} + "examples/lambda-calculus/eval.thm" {"examples/lambda-calculus/eval.thm"} + "examples/lambda-calculus/normalization/stlc-strong-norm.mod" {"examples/lambda-calculus/normalization/stlc-strong-norm.mod"} + "examples/lambda-calculus/normalization/stlc-strong-norm.sig" {"examples/lambda-calculus/normalization/stlc-strong-norm.sig"} + "examples/lambda-calculus/normalization/stlc-strong-norm.thm" {"examples/lambda-calculus/normalization/stlc-strong-norm.thm"} + "examples/lambda-calculus/normalization/stlc-weak-norm.mod" {"examples/lambda-calculus/normalization/stlc-weak-norm.mod"} + "examples/lambda-calculus/normalization/stlc-weak-norm.sig" {"examples/lambda-calculus/normalization/stlc-weak-norm.sig"} + "examples/lambda-calculus/normalization/stlc-weak-norm.thm" {"examples/lambda-calculus/normalization/stlc-weak-norm.thm"} + "examples/lambda-calculus/sred.mod" {"examples/lambda-calculus/sred.mod"} + "examples/lambda-calculus/sred.sig" {"examples/lambda-calculus/sred.sig"} + "examples/lambda-calculus/sred.thm" {"examples/lambda-calculus/sred.thm"} + "examples/lambda-calculus/term-structure/debruijn.mod" {"examples/lambda-calculus/term-structure/debruijn.mod"} + "examples/lambda-calculus/term-structure/debruijn.sig" {"examples/lambda-calculus/term-structure/debruijn.sig"} + "examples/lambda-calculus/term-structure/debruijn.thm" {"examples/lambda-calculus/term-structure/debruijn.thm"} + "examples/lambda-calculus/term-structure/normal.mod" {"examples/lambda-calculus/term-structure/normal.mod"} + "examples/lambda-calculus/term-structure/normal.sig" {"examples/lambda-calculus/term-structure/normal.sig"} + "examples/lambda-calculus/term-structure/normal.thm" {"examples/lambda-calculus/term-structure/normal.thm"} + "examples/lambda-calculus/term-structure/path.mod" {"examples/lambda-calculus/term-structure/path.mod"} + "examples/lambda-calculus/term-structure/path.sig" {"examples/lambda-calculus/term-structure/path.sig"} + "examples/lambda-calculus/term-structure/path.thm" {"examples/lambda-calculus/term-structure/path.thm"} + "examples/lambda-calculus/type-uniq/type-uniq-fresh.thm" {"examples/lambda-calculus/type-uniq/type-uniq-fresh.thm"} + "examples/lambda-calculus/type-uniq/type-uniq-lg.thm" {"examples/lambda-calculus/type-uniq/type-uniq-lg.thm"} + "examples/lambda-calculus/type-uniq/type-uniq.mod" {"examples/lambda-calculus/type-uniq/type-uniq.mod"} + "examples/lambda-calculus/type-uniq/type-uniq.sig" {"examples/lambda-calculus/type-uniq/type-uniq.sig"} + "examples/lambda-calculus/type-uniq/type-uniq-single.thm" {"examples/lambda-calculus/type-uniq/type-uniq-single.thm"} + "examples/lambda-calculus/type-uniq/type-uniq.thm" {"examples/lambda-calculus/type-uniq/type-uniq.thm"} + "examples/logic/cut.mod" {"examples/logic/cut.mod"} + "examples/logic/cut.sig" {"examples/logic/cut.sig"} + "examples/logic/cut.thm" {"examples/logic/cut.thm"} + "examples/logic/equiv.mod" {"examples/logic/equiv.mod"} + "examples/logic/equiv.sig" {"examples/logic/equiv.sig"} + "examples/logic/equiv.thm" {"examples/logic/equiv.thm"} + "examples/logic/focus.mod" {"examples/logic/focus.mod"} + "examples/logic/focus.sig" {"examples/logic/focus.sig"} + "examples/logic/focus.thm" {"examples/logic/focus.thm"} + "examples/logic/hh_meta.thm" {"examples/logic/hh_meta.thm"} + "examples/logic/seq.thm" {"examples/logic/seq.thm"} + "examples/misc/cascade.thm" {"examples/misc/cascade.thm"} + "examples/misc/colist.thm" {"examples/misc/colist.thm"} + "examples/misc/conat.thm" {"examples/misc/conat.thm"} + "examples/misc/copy.mod" {"examples/misc/copy.mod"} + "examples/misc/copy.sig" {"examples/misc/copy.sig"} + "examples/misc/copy.thm" {"examples/misc/copy.thm"} + "examples/misc/flex-rigid.thm" {"examples/misc/flex-rigid.thm"} + "examples/misc/higher-order.mod" {"examples/misc/higher-order.mod"} + "examples/misc/higher-order.sig" {"examples/misc/higher-order.sig"} + "examples/misc/higher-order.thm" {"examples/misc/higher-order.thm"} + "examples/misc/subst.mod" {"examples/misc/subst.mod"} + "examples/misc/subst.sig" {"examples/misc/subst.sig"} + "examples/misc/subst.thm" {"examples/misc/subst.thm"} + "examples/misc/umt.thm" {"examples/misc/umt.thm"} + "examples/process-calculi/ccs/ccs_bisim_context_examples.thm" {"examples/process-calculi/ccs/ccs_bisim_context_examples.thm"} + "examples/process-calculi/ccs/ccs_bisim_context.thm" {"examples/process-calculi/ccs/ccs_bisim_context.thm"} + "examples/process-calculi/ccs/ccs_bisim_examples_helper.thm" {"examples/process-calculi/ccs/ccs_bisim_examples_helper.thm"} + "examples/process-calculi/ccs/ccs_bisim_examples.thm" {"examples/process-calculi/ccs/ccs_bisim_examples.thm"} + "examples/process-calculi/ccs/ccs_bisim.thm" {"examples/process-calculi/ccs/ccs_bisim.thm"} + "examples/process-calculi/ccs/ccs_context.thm" {"examples/process-calculi/ccs/ccs_context.thm"} + "examples/process-calculi/ccs/ccs_core.thm" {"examples/process-calculi/ccs/ccs_core.thm"} + "examples/process-calculi/ccs/ccs_ctx.thm" {"examples/process-calculi/ccs/ccs_ctx.thm"} + "examples/process-calculi/ccs_two_level/ccs.mod" {"examples/process-calculi/ccs_two_level/ccs.mod"} + "examples/process-calculi/ccs_two_level/ccs.sig" {"examples/process-calculi/ccs_two_level/ccs.sig"} + "examples/process-calculi/ccs_two_level/ccs.thm" {"examples/process-calculi/ccs_two_level/ccs.thm"} + "examples/process-calculi/pic/pic_bisim_examples.thm" {"examples/process-calculi/pic/pic_bisim_examples.thm"} + "examples/process-calculi/pic/pic_bisim.thm" {"examples/process-calculi/pic/pic_bisim.thm"} + "examples/process-calculi/pic/pic_core.thm" {"examples/process-calculi/pic/pic_core.thm"} + "examples/process-calculi/pic/pic_ctx.thm" {"examples/process-calculi/pic/pic_ctx.thm"} + "examples/process-calculi/pic_two_level/finite-pic-cong.thm" {"examples/process-calculi/pic_two_level/finite-pic-cong.thm"} + "examples/process-calculi/pic_two_level/finite-pic.mod" {"examples/process-calculi/pic_two_level/finite-pic.mod"} + "examples/process-calculi/pic_two_level/finite-pic.sig" {"examples/process-calculi/pic_two_level/finite-pic.sig"} + "examples/process-calculi/pic_two_level/finite-pic.thm" {"examples/process-calculi/pic_two_level/finite-pic.thm"} + "examples/process-calculi/pic_two_level/pic.mod" {"examples/process-calculi/pic_two_level/pic.mod"} + "examples/process-calculi/pic_two_level/pic.sig" {"examples/process-calculi/pic_two_level/pic.sig"} + "examples/process-calculi/pic_two_level/pic.thm" {"examples/process-calculi/pic_two_level/pic.thm"} + "examples/programming-languages/ees.mod" {"examples/programming-languages/ees.mod"} + "examples/programming-languages/ees.sig" {"examples/programming-languages/ees.sig"} + "examples/programming-languages/ees.thm" {"examples/programming-languages/ees.thm"} + "examples/programming-languages/pcf.mod" {"examples/programming-languages/pcf.mod"} + "examples/programming-languages/pcf.sig" {"examples/programming-languages/pcf.sig"} + "examples/programming-languages/pcf.thm" {"examples/programming-languages/pcf.thm"} + "examples/programming-languages/poplmark-1a.mod" {"examples/programming-languages/poplmark-1a.mod"} + "examples/programming-languages/poplmark-1a.sig" {"examples/programming-languages/poplmark-1a.sig"} + "examples/programming-languages/poplmark-1a.thm" {"examples/programming-languages/poplmark-1a.thm"} + "examples/programming-languages/poplmark-2a.mod" {"examples/programming-languages/poplmark-2a.mod"} + "examples/programming-languages/poplmark-2a.sig" {"examples/programming-languages/poplmark-2a.sig"} + "examples/programming-languages/poplmark-2a.thm" {"examples/programming-languages/poplmark-2a.thm"} ] diff --git a/patches/abella/abella.install.2.0.4 b/patches/abella/abella.install.2.0.4 new file mode 100644 index 0000000..eeb600e --- /dev/null +++ b/patches/abella/abella.install.2.0.4 @@ -0,0 +1,125 @@ +bin: ["_build/src/abella.native" {"abella"}] +share: [ "emacs/lprolog.el" {"emacs/lprolog.el"} + "emacs/abella.el" {"emacs/abella.el"} + "emacs/README" {"emacs/README"} + "examples/programming-languages/poplmark-2a.thm" {"examples/programming-languages/poplmark-2a.thm"} + "examples/programming-languages/poplmark-2a.sig" {"examples/programming-languages/poplmark-2a.sig"} + "examples/programming-languages/poplmark-2a.mod" {"examples/programming-languages/poplmark-2a.mod"} + "examples/programming-languages/poplmark-1a.thm" {"examples/programming-languages/poplmark-1a.thm"} + "examples/programming-languages/poplmark-1a.sig" {"examples/programming-languages/poplmark-1a.sig"} + "examples/programming-languages/poplmark-1a.mod" {"examples/programming-languages/poplmark-1a.mod"} + "examples/programming-languages/pcf.thm" {"examples/programming-languages/pcf.thm"} + "examples/programming-languages/pcf.sig" {"examples/programming-languages/pcf.sig"} + "examples/programming-languages/pcf.mod" {"examples/programming-languages/pcf.mod"} + "examples/programming-languages/ees.thm" {"examples/programming-languages/ees.thm"} + "examples/programming-languages/ees.sig" {"examples/programming-languages/ees.sig"} + "examples/programming-languages/ees.mod" {"examples/programming-languages/ees.mod"} + "examples/process-calculi/pic_two_level/pic.thm" {"examples/process-calculi/pic_two_level/pic.thm"} + "examples/process-calculi/pic_two_level/pic.sig" {"examples/process-calculi/pic_two_level/pic.sig"} + "examples/process-calculi/pic_two_level/pic.mod" {"examples/process-calculi/pic_two_level/pic.mod"} + "examples/process-calculi/pic_two_level/finite-pic.thm" {"examples/process-calculi/pic_two_level/finite-pic.thm"} + "examples/process-calculi/pic_two_level/finite-pic.sig" {"examples/process-calculi/pic_two_level/finite-pic.sig"} + "examples/process-calculi/pic_two_level/finite-pic.mod" {"examples/process-calculi/pic_two_level/finite-pic.mod"} + "examples/process-calculi/pic_two_level/finite-pic-cong.thm" {"examples/process-calculi/pic_two_level/finite-pic-cong.thm"} + "examples/process-calculi/pic_lambda/trans_is_bisimulation.thm" {"examples/process-calculi/pic_lambda/trans_is_bisimulation.thm"} + "examples/process-calculi/pic_lambda/trans.thm" {"examples/process-calculi/pic_lambda/trans.thm"} + "examples/process-calculi/pic_lambda/processes_terms.sig" {"examples/process-calculi/pic_lambda/processes_terms.sig"} + "examples/process-calculi/pic_lambda/processes_terms.mod" {"examples/process-calculi/pic_lambda/processes_terms.mod"} + "examples/process-calculi/pic_lambda/picalc_str_eq_is_bisimulation.thm" {"examples/process-calculi/pic_lambda/picalc_str_eq_is_bisimulation.thm"} + "examples/process-calculi/pic_lambda/picalc.thm" {"examples/process-calculi/pic_lambda/picalc.thm"} + "examples/process-calculi/pic_lambda/lsc.thm" {"examples/process-calculi/pic_lambda/lsc.thm"} + "examples/process-calculi/pic/pic_ctx.thm" {"examples/process-calculi/pic/pic_ctx.thm"} + "examples/process-calculi/pic/pic_core.thm" {"examples/process-calculi/pic/pic_core.thm"} + "examples/process-calculi/pic/pic_bisim_examples.thm" {"examples/process-calculi/pic/pic_bisim_examples.thm"} + "examples/process-calculi/pic/pic_bisim.thm" {"examples/process-calculi/pic/pic_bisim.thm"} + "examples/process-calculi/ccs_two_level/ccs.thm" {"examples/process-calculi/ccs_two_level/ccs.thm"} + "examples/process-calculi/ccs_two_level/ccs.sig" {"examples/process-calculi/ccs_two_level/ccs.sig"} + "examples/process-calculi/ccs_two_level/ccs.mod" {"examples/process-calculi/ccs_two_level/ccs.mod"} + "examples/process-calculi/ccs/ccs_ctx.thm" {"examples/process-calculi/ccs/ccs_ctx.thm"} + "examples/process-calculi/ccs/ccs_core.thm" {"examples/process-calculi/ccs/ccs_core.thm"} + "examples/process-calculi/ccs/ccs_context.thm" {"examples/process-calculi/ccs/ccs_context.thm"} + "examples/process-calculi/ccs/ccs_bisim_examples_helper.thm" {"examples/process-calculi/ccs/ccs_bisim_examples_helper.thm"} + "examples/process-calculi/ccs/ccs_bisim_examples.thm" {"examples/process-calculi/ccs/ccs_bisim_examples.thm"} + "examples/process-calculi/ccs/ccs_bisim_context_examples.thm" {"examples/process-calculi/ccs/ccs_bisim_context_examples.thm"} + "examples/process-calculi/ccs/ccs_bisim_context.thm" {"examples/process-calculi/ccs/ccs_bisim_context.thm"} + "examples/process-calculi/ccs/ccs_bisim.thm" {"examples/process-calculi/ccs/ccs_bisim.thm"} + "examples/pic.md" {"examples/pic.md"} + "examples/misc/umt.thm" {"examples/misc/umt.thm"} + "examples/misc/subst.thm" {"examples/misc/subst.thm"} + "examples/misc/subst.sig" {"examples/misc/subst.sig"} + "examples/misc/subst.mod" {"examples/misc/subst.mod"} + "examples/misc/flex-rigid.thm" {"examples/misc/flex-rigid.thm"} + "examples/misc/copy.thm" {"examples/misc/copy.thm"} + "examples/misc/copy.sig" {"examples/misc/copy.sig"} + "examples/misc/copy.mod" {"examples/misc/copy.mod"} + "examples/misc/conat.thm" {"examples/misc/conat.thm"} + "examples/misc/colist.thm" {"examples/misc/colist.thm"} + "examples/misc/cascade.thm" {"examples/misc/cascade.thm"} + "examples/makefile" {"examples/makefile"} + "examples/logic/seq.thm" {"examples/logic/seq.thm"} + "examples/logic/hh_meta.thm" {"examples/logic/hh_meta.thm"} + "examples/logic/focus.thm" {"examples/logic/focus.thm"} + "examples/logic/focus.sig" {"examples/logic/focus.sig"} + "examples/logic/focus.mod" {"examples/logic/focus.mod"} + "examples/logic/equiv.thm" {"examples/logic/equiv.thm"} + "examples/logic/equiv.sig" {"examples/logic/equiv.sig"} + "examples/logic/equiv.mod" {"examples/logic/equiv.mod"} + "examples/logic/cut.thm" {"examples/logic/cut.thm"} + "examples/logic/cut.sig" {"examples/logic/cut.sig"} + "examples/logic/cut.mod" {"examples/logic/cut.mod"} + "examples/lambda-calculus/type-uniq/type-uniq.thm" {"examples/lambda-calculus/type-uniq/type-uniq.thm"} + "examples/lambda-calculus/type-uniq/type-uniq.sig" {"examples/lambda-calculus/type-uniq/type-uniq.sig"} + "examples/lambda-calculus/type-uniq/type-uniq.mod" {"examples/lambda-calculus/type-uniq/type-uniq.mod"} + "examples/lambda-calculus/type-uniq/type-uniq-single.thm" {"examples/lambda-calculus/type-uniq/type-uniq-single.thm"} + "examples/lambda-calculus/type-uniq/type-uniq-lg.thm" {"examples/lambda-calculus/type-uniq/type-uniq-lg.thm"} + "examples/lambda-calculus/type-uniq/type-uniq-fresh.thm" {"examples/lambda-calculus/type-uniq/type-uniq-fresh.thm"} + "examples/lambda-calculus/term-structure/path.thm" {"examples/lambda-calculus/term-structure/path.thm"} + "examples/lambda-calculus/term-structure/path.sig" {"examples/lambda-calculus/term-structure/path.sig"} + "examples/lambda-calculus/term-structure/path.mod" {"examples/lambda-calculus/term-structure/path.mod"} + "examples/lambda-calculus/term-structure/normal.thm" {"examples/lambda-calculus/term-structure/normal.thm"} + "examples/lambda-calculus/term-structure/normal.sig" {"examples/lambda-calculus/term-structure/normal.sig"} + "examples/lambda-calculus/term-structure/normal.mod" {"examples/lambda-calculus/term-structure/normal.mod"} + "examples/lambda-calculus/term-structure/debruijn.thm" {"examples/lambda-calculus/term-structure/debruijn.thm"} + "examples/lambda-calculus/term-structure/debruijn.sig" {"examples/lambda-calculus/term-structure/debruijn.sig"} + "examples/lambda-calculus/term-structure/debruijn.mod" {"examples/lambda-calculus/term-structure/debruijn.mod"} + "examples/lambda-calculus/sred.thm" {"examples/lambda-calculus/sred.thm"} + "examples/lambda-calculus/sred.sig" {"examples/lambda-calculus/sred.sig"} + "examples/lambda-calculus/sred.mod" {"examples/lambda-calculus/sred.mod"} + "examples/lambda-calculus/normalization/stlc-weak-norm.thm" {"examples/lambda-calculus/normalization/stlc-weak-norm.thm"} + "examples/lambda-calculus/normalization/stlc-weak-norm.sig" {"examples/lambda-calculus/normalization/stlc-weak-norm.sig"} + "examples/lambda-calculus/normalization/stlc-weak-norm.mod" {"examples/lambda-calculus/normalization/stlc-weak-norm.mod"} + "examples/lambda-calculus/normalization/stlc-strong-norm.thm" {"examples/lambda-calculus/normalization/stlc-strong-norm.thm"} + "examples/lambda-calculus/normalization/stlc-strong-norm.sig" {"examples/lambda-calculus/normalization/stlc-strong-norm.sig"} + "examples/lambda-calculus/normalization/stlc-strong-norm.mod" {"examples/lambda-calculus/normalization/stlc-strong-norm.mod"} + "examples/lambda-calculus/fcurry/fcurry.thm" {"examples/lambda-calculus/fcurry/fcurry.thm"} + "examples/lambda-calculus/fcurry/fcurry.sig" {"examples/lambda-calculus/fcurry/fcurry.sig"} + "examples/lambda-calculus/fcurry/fcurry.mod" {"examples/lambda-calculus/fcurry/fcurry.mod"} + "examples/lambda-calculus/eval.thm" {"examples/lambda-calculus/eval.thm"} + "examples/lambda-calculus/eval.sig" {"examples/lambda-calculus/eval.sig"} + "examples/lambda-calculus/eval.mod" {"examples/lambda-calculus/eval.mod"} + "examples/lambda-calculus/cr.thm" {"examples/lambda-calculus/cr.thm"} + "examples/lambda-calculus/cr.sig" {"examples/lambda-calculus/cr.sig"} + "examples/lambda-calculus/cr.mod" {"examples/lambda-calculus/cr.mod"} + "examples/higher-order/fsub.thm" {"examples/higher-order/fsub.thm"} + "examples/higher-order/fsub.sig" {"examples/higher-order/fsub.sig"} + "examples/higher-order/fsub.mod" {"examples/higher-order/fsub.mod"} + "examples/higher-order/debruijn_ho.thm" {"examples/higher-order/debruijn_ho.thm"} + "examples/higher-order/debruijn_ho.sig" {"examples/higher-order/debruijn_ho.sig"} + "examples/higher-order/debruijn_ho.mod" {"examples/higher-order/debruijn_ho.mod"} + "examples/higher-order/breduce.thm" {"examples/higher-order/breduce.thm"} + "examples/higher-order/breduce.sig" {"examples/higher-order/breduce.sig"} + "examples/higher-order/breduce.mod" {"examples/higher-order/breduce.mod"} + "examples/higher-order/bred_alt.thm" {"examples/higher-order/bred_alt.thm"} + "examples/higher-order/bred_alt.sig" {"examples/higher-order/bred_alt.sig"} + "examples/higher-order/bred_alt.mod" {"examples/higher-order/bred_alt.mod"} + "examples/first-order/lists.thm" {"examples/first-order/lists.thm"} + "examples/first-order/lists.sig" {"examples/first-order/lists.sig"} + "examples/first-order/lists.mod" {"examples/first-order/lists.mod"} + "examples/first-order/gcd.thm" {"examples/first-order/gcd.thm"} + "examples/first-order/gcd.sig" {"examples/first-order/gcd.sig"} + "examples/first-order/gcd.mod" {"examples/first-order/gcd.mod"} + "examples/first-order/even-odd.thm" {"examples/first-order/even-odd.thm"} + "examples/first-order/add.thm" {"examples/first-order/add.thm"} + "examples/first-order/add.sig" {"examples/first-order/add.sig"} + "examples/first-order/add.mod" {"examples/first-order/add.mod"} + "examples/first-order/ackermann.thm" {"examples/first-order/ackermann.thm"} ] diff --git a/patches/abella/abella.install.2.0.5 b/patches/abella/abella.install.2.0.5 new file mode 100644 index 0000000..8be13be --- /dev/null +++ b/patches/abella/abella.install.2.0.5 @@ -0,0 +1,129 @@ +bin: ["_build/src/abella.native" {"abella"}] +share: [ "emacs/lprolog.el" {"emacs/lprolog.el"} + "emacs/abella.el" {"emacs/abella.el"} + "emacs/README" {"emacs/README"} + "examples/programming-languages/poplmark-2a.thm" {"examples/programming-languages/poplmark-2a.thm"} + "examples/programming-languages/poplmark-2a.sig" {"examples/programming-languages/poplmark-2a.sig"} + "examples/programming-languages/poplmark-2a.mod" {"examples/programming-languages/poplmark-2a.mod"} + "examples/programming-languages/poplmark-1a.thm" {"examples/programming-languages/poplmark-1a.thm"} + "examples/programming-languages/poplmark-1a.sig" {"examples/programming-languages/poplmark-1a.sig"} + "examples/programming-languages/poplmark-1a.mod" {"examples/programming-languages/poplmark-1a.mod"} + "examples/programming-languages/pcf.thm" {"examples/programming-languages/pcf.thm"} + "examples/programming-languages/pcf.sig" {"examples/programming-languages/pcf.sig"} + "examples/programming-languages/pcf.mod" {"examples/programming-languages/pcf.mod"} + "examples/programming-languages/howe/subst.thm" {"examples/programming-languages/howe/subst.thm"} + "examples/programming-languages/howe/sim.thm" {"examples/programming-languages/howe/sim.thm"} + "examples/programming-languages/howe/pclf.sig" {"examples/programming-languages/howe/pclf.sig"} + "examples/programming-languages/howe/pclf.mod" {"examples/programming-languages/howe/pclf.mod"} + "examples/programming-languages/howe/howe.thm" {"examples/programming-languages/howe/howe.thm"} + "examples/programming-languages/ees.thm" {"examples/programming-languages/ees.thm"} + "examples/programming-languages/ees.sig" {"examples/programming-languages/ees.sig"} + "examples/programming-languages/ees.mod" {"examples/programming-languages/ees.mod"} + "examples/process-calculi/pic_two_level/pic.thm" {"examples/process-calculi/pic_two_level/pic.thm"} + "examples/process-calculi/pic_two_level/pic.sig" {"examples/process-calculi/pic_two_level/pic.sig"} + "examples/process-calculi/pic_two_level/pic.mod" {"examples/process-calculi/pic_two_level/pic.mod"} + "examples/process-calculi/pic_two_level/finite-pic.thm" {"examples/process-calculi/pic_two_level/finite-pic.thm"} + "examples/process-calculi/pic_two_level/finite-pic.sig" {"examples/process-calculi/pic_two_level/finite-pic.sig"} + "examples/process-calculi/pic_two_level/finite-pic.mod" {"examples/process-calculi/pic_two_level/finite-pic.mod"} + "examples/process-calculi/pic_two_level/finite-pic-cong.thm" {"examples/process-calculi/pic_two_level/finite-pic-cong.thm"} + "examples/process-calculi/pic_lambda/trans_is_bisimulation.thm" {"examples/process-calculi/pic_lambda/trans_is_bisimulation.thm"} + "examples/process-calculi/pic_lambda/trans.thm" {"examples/process-calculi/pic_lambda/trans.thm"} + "examples/process-calculi/pic_lambda/processes_terms.sig" {"examples/process-calculi/pic_lambda/processes_terms.sig"} + "examples/process-calculi/pic_lambda/processes_terms.mod" {"examples/process-calculi/pic_lambda/processes_terms.mod"} + "examples/process-calculi/pic_lambda/picalc_str_eq_is_bisimulation.thm" {"examples/process-calculi/pic_lambda/picalc_str_eq_is_bisimulation.thm"} + "examples/process-calculi/pic_lambda/picalc.thm" {"examples/process-calculi/pic_lambda/picalc.thm"} + "examples/process-calculi/pic_lambda/lsc.thm" {"examples/process-calculi/pic_lambda/lsc.thm"} + "examples/process-calculi/pic/pic_ctx.thm" {"examples/process-calculi/pic/pic_ctx.thm"} + "examples/process-calculi/pic/pic_core.thm" {"examples/process-calculi/pic/pic_core.thm"} + "examples/process-calculi/pic/pic_bisim_examples.thm" {"examples/process-calculi/pic/pic_bisim_examples.thm"} + "examples/process-calculi/pic/pic_bisim.thm" {"examples/process-calculi/pic/pic_bisim.thm"} + "examples/process-calculi/ccs_two_level/ccs.thm" {"examples/process-calculi/ccs_two_level/ccs.thm"} + "examples/process-calculi/ccs_two_level/ccs.sig" {"examples/process-calculi/ccs_two_level/ccs.sig"} + "examples/process-calculi/ccs_two_level/ccs.mod" {"examples/process-calculi/ccs_two_level/ccs.mod"} + "examples/process-calculi/ccs/ccs_ctx.thm" {"examples/process-calculi/ccs/ccs_ctx.thm"} + "examples/process-calculi/ccs/ccs_core.thm" {"examples/process-calculi/ccs/ccs_core.thm"} + "examples/process-calculi/ccs/ccs_context.thm" {"examples/process-calculi/ccs/ccs_context.thm"} + "examples/process-calculi/ccs/ccs_bisim_examples_helper.thm" {"examples/process-calculi/ccs/ccs_bisim_examples_helper.thm"} + "examples/process-calculi/ccs/ccs_bisim_examples.thm" {"examples/process-calculi/ccs/ccs_bisim_examples.thm"} + "examples/process-calculi/ccs/ccs_bisim_context_examples.thm" {"examples/process-calculi/ccs/ccs_bisim_context_examples.thm"} + "examples/process-calculi/ccs/ccs_bisim_context.thm" {"examples/process-calculi/ccs/ccs_bisim_context.thm"} + "examples/process-calculi/ccs/ccs_bisim.thm" {"examples/process-calculi/ccs/ccs_bisim.thm"} + "examples/misc/well-founded.thm" {"examples/misc/well-founded.thm"} + "examples/misc/umt.thm" {"examples/misc/umt.thm"} + "examples/misc/subst.thm" {"examples/misc/subst.thm"} + "examples/misc/subst.sig" {"examples/misc/subst.sig"} + "examples/misc/subst.mod" {"examples/misc/subst.mod"} + "examples/misc/flex-rigid.thm" {"examples/misc/flex-rigid.thm"} + "examples/misc/copy.thm" {"examples/misc/copy.thm"} + "examples/misc/copy.sig" {"examples/misc/copy.sig"} + "examples/misc/copy.mod" {"examples/misc/copy.mod"} + "examples/misc/conat.thm" {"examples/misc/conat.thm"} + "examples/misc/colist.thm" {"examples/misc/colist.thm"} + "examples/misc/cascade.thm" {"examples/misc/cascade.thm"} + "examples/logic/seq.thm" {"examples/logic/seq.thm"} + "examples/logic/hh_meta.thm" {"examples/logic/hh_meta.thm"} + "examples/logic/focus.thm" {"examples/logic/focus.thm"} + "examples/logic/focus.sig" {"examples/logic/focus.sig"} + "examples/logic/focus.mod" {"examples/logic/focus.mod"} + "examples/logic/equiv.thm" {"examples/logic/equiv.thm"} + "examples/logic/equiv.sig" {"examples/logic/equiv.sig"} + "examples/logic/equiv.mod" {"examples/logic/equiv.mod"} + "examples/logic/cut.thm" {"examples/logic/cut.thm"} + "examples/logic/cut.sig" {"examples/logic/cut.sig"} + "examples/logic/cut.mod" {"examples/logic/cut.mod"} + "examples/lambda-calculus/type-uniq/type-uniq.thm" {"examples/lambda-calculus/type-uniq/type-uniq.thm"} + "examples/lambda-calculus/type-uniq/type-uniq.sig" {"examples/lambda-calculus/type-uniq/type-uniq.sig"} + "examples/lambda-calculus/type-uniq/type-uniq.mod" {"examples/lambda-calculus/type-uniq/type-uniq.mod"} + "examples/lambda-calculus/type-uniq/type-uniq-single.thm" {"examples/lambda-calculus/type-uniq/type-uniq-single.thm"} + "examples/lambda-calculus/type-uniq/type-uniq-lg.thm" {"examples/lambda-calculus/type-uniq/type-uniq-lg.thm"} + "examples/lambda-calculus/type-uniq/type-uniq-fresh.thm" {"examples/lambda-calculus/type-uniq/type-uniq-fresh.thm"} + "examples/lambda-calculus/term-structure/path.thm" {"examples/lambda-calculus/term-structure/path.thm"} + "examples/lambda-calculus/term-structure/path.sig" {"examples/lambda-calculus/term-structure/path.sig"} + "examples/lambda-calculus/term-structure/path.mod" {"examples/lambda-calculus/term-structure/path.mod"} + "examples/lambda-calculus/term-structure/normal.thm" {"examples/lambda-calculus/term-structure/normal.thm"} + "examples/lambda-calculus/term-structure/normal.sig" {"examples/lambda-calculus/term-structure/normal.sig"} + "examples/lambda-calculus/term-structure/normal.mod" {"examples/lambda-calculus/term-structure/normal.mod"} + "examples/lambda-calculus/term-structure/debruijn.thm" {"examples/lambda-calculus/term-structure/debruijn.thm"} + "examples/lambda-calculus/term-structure/debruijn.sig" {"examples/lambda-calculus/term-structure/debruijn.sig"} + "examples/lambda-calculus/term-structure/debruijn.mod" {"examples/lambda-calculus/term-structure/debruijn.mod"} + "examples/lambda-calculus/sred.thm" {"examples/lambda-calculus/sred.thm"} + "examples/lambda-calculus/sred.sig" {"examples/lambda-calculus/sred.sig"} + "examples/lambda-calculus/sred.mod" {"examples/lambda-calculus/sred.mod"} + "examples/lambda-calculus/normalization/stlc-weak-norm.thm" {"examples/lambda-calculus/normalization/stlc-weak-norm.thm"} + "examples/lambda-calculus/normalization/stlc-weak-norm.sig" {"examples/lambda-calculus/normalization/stlc-weak-norm.sig"} + "examples/lambda-calculus/normalization/stlc-weak-norm.mod" {"examples/lambda-calculus/normalization/stlc-weak-norm.mod"} + "examples/lambda-calculus/normalization/stlc-strong-norm.thm" {"examples/lambda-calculus/normalization/stlc-strong-norm.thm"} + "examples/lambda-calculus/normalization/stlc-strong-norm.sig" {"examples/lambda-calculus/normalization/stlc-strong-norm.sig"} + "examples/lambda-calculus/normalization/stlc-strong-norm.mod" {"examples/lambda-calculus/normalization/stlc-strong-norm.mod"} + "examples/lambda-calculus/fcurry/fcurry.thm" {"examples/lambda-calculus/fcurry/fcurry.thm"} + "examples/lambda-calculus/fcurry/fcurry.sig" {"examples/lambda-calculus/fcurry/fcurry.sig"} + "examples/lambda-calculus/fcurry/fcurry.mod" {"examples/lambda-calculus/fcurry/fcurry.mod"} + "examples/lambda-calculus/eval.thm" {"examples/lambda-calculus/eval.thm"} + "examples/lambda-calculus/eval.sig" {"examples/lambda-calculus/eval.sig"} + "examples/lambda-calculus/eval.mod" {"examples/lambda-calculus/eval.mod"} + "examples/lambda-calculus/cr.thm" {"examples/lambda-calculus/cr.thm"} + "examples/lambda-calculus/cr.sig" {"examples/lambda-calculus/cr.sig"} + "examples/lambda-calculus/cr.mod" {"examples/lambda-calculus/cr.mod"} + "examples/higher-order/fsub.thm" {"examples/higher-order/fsub.thm"} + "examples/higher-order/fsub.sig" {"examples/higher-order/fsub.sig"} + "examples/higher-order/fsub.mod" {"examples/higher-order/fsub.mod"} + "examples/higher-order/debruijn_ho.thm" {"examples/higher-order/debruijn_ho.thm"} + "examples/higher-order/debruijn_ho.sig" {"examples/higher-order/debruijn_ho.sig"} + "examples/higher-order/debruijn_ho.mod" {"examples/higher-order/debruijn_ho.mod"} + "examples/higher-order/breduce.thm" {"examples/higher-order/breduce.thm"} + "examples/higher-order/breduce.sig" {"examples/higher-order/breduce.sig"} + "examples/higher-order/breduce.mod" {"examples/higher-order/breduce.mod"} + "examples/higher-order/bred_alt.thm" {"examples/higher-order/bred_alt.thm"} + "examples/higher-order/bred_alt.sig" {"examples/higher-order/bred_alt.sig"} + "examples/higher-order/bred_alt.mod" {"examples/higher-order/bred_alt.mod"} + "examples/first-order/lists.thm" {"examples/first-order/lists.thm"} + "examples/first-order/lists.sig" {"examples/first-order/lists.sig"} + "examples/first-order/lists.mod" {"examples/first-order/lists.mod"} + "examples/first-order/gcd.thm" {"examples/first-order/gcd.thm"} + "examples/first-order/gcd.sig" {"examples/first-order/gcd.sig"} + "examples/first-order/gcd.mod" {"examples/first-order/gcd.mod"} + "examples/first-order/even-odd.thm" {"examples/first-order/even-odd.thm"} + "examples/first-order/add.thm" {"examples/first-order/add.thm"} + "examples/first-order/add.sig" {"examples/first-order/add.sig"} + "examples/first-order/add.mod" {"examples/first-order/add.mod"} + "examples/first-order/ackermann.thm" {"examples/first-order/ackermann.thm"} ] diff --git a/patches/aez/META.0.3 b/patches/aez/META.0.3 new file mode 100644 index 0000000..15ee778 --- /dev/null +++ b/patches/aez/META.0.3 @@ -0,0 +1,6 @@ +name="aez" +version="0.3" +description="Alt-Ergo Zero is an OCaml library for an SMT solver." +requires="num unix" +archive(byte) = "aez.cma" +archive(native) = "aez.cmxa" diff --git a/patches/afl-persistent/config.patch b/patches/afl-persistent/config.patch new file mode 100644 index 0000000..aa2ecc9 --- /dev/null +++ b/patches/afl-persistent/config.patch @@ -0,0 +1,19 @@ +--- a/config.sh 2024-01-31 15:13:00 ++++ b/config.sh 2024-01-31 15:11:06 +@@ -2,6 +2,7 @@ + + set -e + tmpdir="$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')" ++curdir="$(pwd)" + output="$(pwd)/afl-persistent.config" + cd "$tmpdir" + echo 'print_string "Hello"' > test.ml +@@ -11,7 +12,7 @@ + afl_always=false + fi + rm test.* +-cd / ++cd "$curdir" + rmdir "$tmpdir" + + cat > "$output" <> $$ldconf; fi + ++find-install: ++ ocamlfind install agrep \ ++ agrep.cma agrep.cmi agrep.cmxa libagrep.a dllagrep.$(LIB_EXT) META ++ + testagrep: testagrep.ml agrep.cma libagrep.a + $(OCAMLC) -I . -custom -o $@ agrep.cma testagrep.ml + diff --git a/patches/aifad/_oasis_remove_.ml b/patches/aifad/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/aifad/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/aifad/aifad.install b/patches/aifad/aifad.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/aifad/aifad.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/aio/meta.patch b/patches/aio/meta.patch new file mode 100644 index 0000000..828d7cb --- /dev/null +++ b/patches/aio/meta.patch @@ -0,0 +1,9 @@ +diff -ur libaio-ocaml-1.0-orig/lib/META libaio-ocaml-1.0/lib/META +--- libaio-ocaml-1.0-orig/lib/META 2013-08-24 14:08:16.922728137 +0100 ++++ libaio-ocaml-1.0/lib/META 2013-08-24 14:08:28.282728434 +0100 +@@ -2,5 +2,4 @@ + description = "Linux kernel AIO access library for OCaml" + archive(byte) = "aio.cma" + archive(native) = "aio.cmxa" +-directory = "+aio" + requires = "unix,bigarray" diff --git a/patches/alphaCaml/alphaCaml.install b/patches/alphaCaml/alphaCaml.install new file mode 100644 index 0000000..cf51a98 --- /dev/null +++ b/patches/alphaCaml/alphaCaml.install @@ -0,0 +1 @@ +bin: ["tool/alphaCaml"] diff --git a/patches/alt-ergo-free/dune-3-fix.patch b/patches/alt-ergo-free/dune-3-fix.patch new file mode 100644 index 0000000..04bcfee --- /dev/null +++ b/patches/alt-ergo-free/dune-3-fix.patch @@ -0,0 +1,37 @@ +commit c6604df9aa68ede640fc07459099ef953f4520e7 +author: Steven de Oliveira +date: Fri, 1 Jul 2022 10:38:36 +0200 + + Dune fix + +diff --git a/configure.ml b/configure.ml +index ad9489ec..1ccd4d61 100644 +--- a/configure.ml ++++ b/configure.ml +@@ -139,26 +139,6 @@ let () = + Format.eprintf "ERROR: Couldn't find dune in env@."; + exit 1 + +-(* run dune to check that dependencies are installed *) +-let () = +- let p_opt = match !pkg with +- | "" -> "" +- | s -> Format.asprintf "-p %s" s +- in +- let cmd = Format.asprintf +- "dune external-lib-deps --display=quiet --missing %s @install" +- p_opt +- in +- let ch = Unix.open_process_in cmd in +- let _ = read_all ch in +- let res = Unix.close_process_in ch in +- match res with +- | Unix.WEXITED 0 -> +- Format.printf "All deps are installed.@." +- | _ -> +- (* dune already prints the missing libs on stderr *) +- exit 2 +- + let () = + Format.printf "Good to go !@." + diff --git a/patches/alt-ergo-free/makefile.user_replace_echo_by_printf.patch b/patches/alt-ergo-free/makefile.user_replace_echo_by_printf.patch new file mode 100644 index 0000000..2a566f3 --- /dev/null +++ b/patches/alt-ergo-free/makefile.user_replace_echo_by_printf.patch @@ -0,0 +1,29 @@ +diff --git a/Makefile.users b/Makefile.users +index 63e7bf2..294b510 100644 +--- a/Makefile.users ++++ b/Makefile.users +@@ -177,15 +177,15 @@ lib/util/config.ml: config.status + @echo "let mandir = \""$(MANDIR)"\"" >> lib/util/config.ml + + lib/util/cmdline_parser.ml: config.status +- @echo "(* parse_args () should be called as soon as possible (put earlier" > lib/util/cmdline_parser.ml +- @echo " when linking) because some choices during compilation depend on" >> lib/util/cmdline_parser.ml +- @echo " given options (e.g. dfs-sat)" >> lib/util/cmdline_parser.ml +- @echo "\n -> The following call:" >> lib/util/cmdline_parser.ml +- @echo " 1 - should be kept when builtind Alt-Ergo tools" >> lib/util/cmdline_parser.ml +- @echo " 2 - should be removed to build and use only the library." >> lib/util/cmdline_parser.ml +- @echo "\n Alternatively to 2, one can just remove cmdline_parser.cmo/cmx in" >> lib/util/cmdline_parser.ml +- @echo " Makefile.users *)" >> lib/util/cmdline_parser.ml +- @echo "\nlet () = Options.parse_cmdline_arguments ()" >> lib/util/cmdline_parser.ml ++ @printf "(* parse_args () should be called as soon as possible (put earlier" > lib/util/cmdline_parser.ml ++ @printf " when linking) because some choices during compilation depend on" >> lib/util/cmdline_parser.ml ++ @printf " given options (e.g. dfs-sat)" >> lib/util/cmdline_parser.ml ++ @printf "\n -> The following call:" >> lib/util/cmdline_parser.ml ++ @printf " 1 - should be kept when builtind Alt-Ergo tools" >> lib/util/cmdline_parser.ml ++ @printf " 2 - should be removed to build and use only the library." >> lib/util/cmdline_parser.ml ++ @printf "\n Alternatively to 2, one can just remove cmdline_parser.cmo/cmx in" >> lib/util/cmdline_parser.ml ++ @printf " Makefile.users *)" >> lib/util/cmdline_parser.ml ++ @printf "\nlet () = Options.parse_cmdline_arguments ()" >> lib/util/cmdline_parser.ml + + META: config.status + @echo "description = \"API of Alt-Ergo: An automatic theorem prover dedicated to program verification\"" > META diff --git a/patches/alt-ergo-free/patch_for_changes_in_num_library.patch b/patches/alt-ergo-free/patch_for_changes_in_num_library.patch new file mode 100644 index 0000000..a0acc4e --- /dev/null +++ b/patches/alt-ergo-free/patch_for_changes_in_num_library.patch @@ -0,0 +1,62 @@ +diff --git a/Makefile.configurable.in b/Makefile.configurable.in +index bcf1dfc..5f15ee5 100644 +--- a/Makefile.configurable.in ++++ b/Makefile.configurable.in +@@ -39,6 +39,7 @@ OCAMLWIN32 = @OCAMLWIN32@ + EXE = @EXE@ + ENABLEGUI = @ENABLEGUI@ + ZARITHLIB=@ZARITHLIB@ ++NUMLIB=@NUMLIB@ + CAMLZIPLIB=@CAMLZIPLIB@ + #OCAMLGRAPHLIB=@OCAMLGRAPHLIB@ + LABLGTK2LIB=@LABLGTK2LIB@ +diff --git a/Makefile.users b/Makefile.users +index 63e7bf2..94cd733 100644 +--- a/Makefile.users ++++ b/Makefile.users +@@ -8,7 +8,7 @@ LOCAL_INC = -I lib/util -I lib/structures -I lib/reasoners \ + -I plugins/common -I plugins/satML \ + -I plugins/fm-simplex + +-INCLUDES = $(ZARITHLIB) $(LABLGTK2LIB) $(CAMLZIPLIB) $(OCPLIBSIMPLEXLIB) $(LOCAL_INC) ++INCLUDES = $(NUMLIB) $(ZARITHLIB) $(LABLGTK2LIB) $(CAMLZIPLIB) $(OCPLIBSIMPLEXLIB) $(LOCAL_INC) + #for coverage # -I /usr/local/lib/ocaml/3.12.1/bisect -pp "camlp4o str.cma /usr/local/lib/ocaml/3.12.1/bisect/bisect_pp.cmo" + + BFLAGS = -annot -absname -bin-annot -short-paths -strict-sequence -g $(INCLUDES) +diff --git a/configure.in b/configure.in +index f7ba81a..938d5b7 100644 +--- a/configure.in ++++ b/configure.in +@@ -116,6 +116,24 @@ else + fi + fi + ++#looking for num library ++ ++if test "$USEOCAMLFIND" = yes; then ++ NUMLIB=$(ocamlfind query -i-format num) ++fi ++ ++if test -n "$NUMLIB";then ++ echo "ocamlfind found num in $NUMLIB" ++ NUM=yes ++else ++ AC_CHECK_FILE($OCAMLLIB/nums.cma,NUM=yes,NUM=no) ++ if test "$NUM" = no ; then ++ AC_MSG_ERROR(Cannot find num library.) ++ else ++ NUMLIB="" ++ fi ++fi ++ + #looking for camlzip library + + if test "$USEOCAMLFIND" = yes; then +@@ -283,6 +301,7 @@ AC_SUBST(OCAMLVERSION) + AC_SUBST(OCAMLLIB) + #AC_SUBST(OCAMLGRAPHLIB) + AC_SUBST(ZARITHLIB) ++AC_SUBST(NUMLIB) + AC_SUBST(CAMLZIPLIB) + AC_SUBST(OCAMLWEB) + AC_SUBST(LABLGTK2LIB) diff --git a/patches/alt-ergo-lib-free/dune-3-fix.patch b/patches/alt-ergo-lib-free/dune-3-fix.patch new file mode 100644 index 0000000..04bcfee --- /dev/null +++ b/patches/alt-ergo-lib-free/dune-3-fix.patch @@ -0,0 +1,37 @@ +commit c6604df9aa68ede640fc07459099ef953f4520e7 +author: Steven de Oliveira +date: Fri, 1 Jul 2022 10:38:36 +0200 + + Dune fix + +diff --git a/configure.ml b/configure.ml +index ad9489ec..1ccd4d61 100644 +--- a/configure.ml ++++ b/configure.ml +@@ -139,26 +139,6 @@ let () = + Format.eprintf "ERROR: Couldn't find dune in env@."; + exit 1 + +-(* run dune to check that dependencies are installed *) +-let () = +- let p_opt = match !pkg with +- | "" -> "" +- | s -> Format.asprintf "-p %s" s +- in +- let cmd = Format.asprintf +- "dune external-lib-deps --display=quiet --missing %s @install" +- p_opt +- in +- let ch = Unix.open_process_in cmd in +- let _ = read_all ch in +- let res = Unix.close_process_in ch in +- match res with +- | Unix.WEXITED 0 -> +- Format.printf "All deps are installed.@." +- | _ -> +- (* dune already prints the missing libs on stderr *) +- exit 2 +- + let () = + Format.printf "Good to go !@." + diff --git a/patches/alt-ergo-lib/version_update.patch b/patches/alt-ergo-lib/version_update.patch new file mode 100644 index 0000000..831a5cf --- /dev/null +++ b/patches/alt-ergo-lib/version_update.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/util/version.ml b/src/lib/util/version.ml +index 67710c68..761ed2fb 100644 +--- a/src/lib/util/version.ml ++++ b/src/lib/util/version.ml +@@ -29,7 +29,7 @@ + (* WARNING: a "cut" is performed on the following file in the Makefile. + DO NOT CHANGE its format *) + +-let _version="dev" ++let _version="2.4.2" + + let _release_commit = "(not released)" + diff --git a/patches/alt-ergo-parsers-free/dune-3-fix.patch b/patches/alt-ergo-parsers-free/dune-3-fix.patch new file mode 100644 index 0000000..04bcfee --- /dev/null +++ b/patches/alt-ergo-parsers-free/dune-3-fix.patch @@ -0,0 +1,37 @@ +commit c6604df9aa68ede640fc07459099ef953f4520e7 +author: Steven de Oliveira +date: Fri, 1 Jul 2022 10:38:36 +0200 + + Dune fix + +diff --git a/configure.ml b/configure.ml +index ad9489ec..1ccd4d61 100644 +--- a/configure.ml ++++ b/configure.ml +@@ -139,26 +139,6 @@ let () = + Format.eprintf "ERROR: Couldn't find dune in env@."; + exit 1 + +-(* run dune to check that dependencies are installed *) +-let () = +- let p_opt = match !pkg with +- | "" -> "" +- | s -> Format.asprintf "-p %s" s +- in +- let cmd = Format.asprintf +- "dune external-lib-deps --display=quiet --missing %s @install" +- p_opt +- in +- let ch = Unix.open_process_in cmd in +- let _ = read_all ch in +- let res = Unix.close_process_in ch in +- match res with +- | Unix.WEXITED 0 -> +- Format.printf "All deps are installed.@." +- | _ -> +- (* dune already prints the missing libs on stderr *) +- exit 2 +- + let () = + Format.printf "Good to go !@." + diff --git a/patches/alt-ergo-parsers/version_update.patch b/patches/alt-ergo-parsers/version_update.patch new file mode 100644 index 0000000..831a5cf --- /dev/null +++ b/patches/alt-ergo-parsers/version_update.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/util/version.ml b/src/lib/util/version.ml +index 67710c68..761ed2fb 100644 +--- a/src/lib/util/version.ml ++++ b/src/lib/util/version.ml +@@ -29,7 +29,7 @@ + (* WARNING: a "cut" is performed on the following file in the Makefile. + DO NOT CHANGE its format *) + +-let _version="dev" ++let _version="2.4.2" + + let _release_commit = "(not released)" + diff --git a/patches/alt-ergo/0001-fix-uninstall-lib-in-Makefile.patch b/patches/alt-ergo/0001-fix-uninstall-lib-in-Makefile.patch new file mode 100644 index 0000000..2156b89 --- /dev/null +++ b/patches/alt-ergo/0001-fix-uninstall-lib-in-Makefile.patch @@ -0,0 +1,24 @@ +From f6ac7490cf262b4669081282feab7bccbea22e1a Mon Sep 17 00:00:00 2001 +From: OCamlPro-Iguernlala +Date: Thu, 26 Apr 2018 19:09:41 +0200 +Subject: [PATCH] fix uninstall-lib in Makefile + +--- + sources/Makefile.users | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sources/Makefile.users b/sources/Makefile.users +index fdad643..16d2be4 100644 +--- a/Makefile.users ++++ b/Makefile.users +@@ -263,7 +263,7 @@ install-lib: lib META + # cp -f META $(LIBDIR) + + uninstall-lib: +- ocamlfind remove alt-ergo-lib ++ ocamlfind remove alt-ergo + + install: install-ae install-gui install-fm-simplex install-lib + +2.14.1 + diff --git a/patches/alt-ergo/alt-ergo.install.0.95.2 b/patches/alt-ergo/alt-ergo.install.0.95.2 new file mode 100644 index 0000000..745bf78 --- /dev/null +++ b/patches/alt-ergo/alt-ergo.install.0.95.2 @@ -0,0 +1 @@ +bin: ["alt-ergo.opt" {"alt-ergo"}] diff --git a/patches/alt-ergo/alt-ergo.install.0.99.1 b/patches/alt-ergo/alt-ergo.install.0.99.1 new file mode 100644 index 0000000..49c7835 --- /dev/null +++ b/patches/alt-ergo/alt-ergo.install.0.99.1 @@ -0,0 +1,3 @@ +bin: [ + "alt-ergo.opt" {"alt-ergo"} +] diff --git a/patches/alt-ergo/compile-with-OCaml-4.04.patch b/patches/alt-ergo/compile-with-OCaml-4.04.patch new file mode 100644 index 0000000..bd941cc --- /dev/null +++ b/patches/alt-ergo/compile-with-OCaml-4.04.patch @@ -0,0 +1,23 @@ +diff --git a/lib/reasoners/satml.ml b/lib/reasoners/satml.ml +index 1c6703c..72f170c 100644 +--- a/lib/reasoners/satml.ml ++++ b/lib/reasoners/satml.ml +@@ -1729,6 +1729,9 @@ module Make (Th : Theory.S) : SAT_ML with type th = Th.t = struct + | None -> assert false + + ++let rec list_find_opt p = function ++ | [] -> None ++ | x :: l -> if p x then Some x else list_find_opt p l + + + let add_form_to_lazy_cnf = +@@ -1755,7 +1758,7 @@ let add_form_to_lazy_cnf = + List.fold_left add_aux ma l + + | OR l -> +- match List.find_opt (fun e -> ++ match list_find_opt (fun e -> + let p = get_atom_or_proxy e env.proxies in + p.is_true) l + with diff --git a/patches/alt-ergo/makefile.user_replace_echo_by_printf.patch b/patches/alt-ergo/makefile.user_replace_echo_by_printf.patch new file mode 100644 index 0000000..2a566f3 --- /dev/null +++ b/patches/alt-ergo/makefile.user_replace_echo_by_printf.patch @@ -0,0 +1,29 @@ +diff --git a/Makefile.users b/Makefile.users +index 63e7bf2..294b510 100644 +--- a/Makefile.users ++++ b/Makefile.users +@@ -177,15 +177,15 @@ lib/util/config.ml: config.status + @echo "let mandir = \""$(MANDIR)"\"" >> lib/util/config.ml + + lib/util/cmdline_parser.ml: config.status +- @echo "(* parse_args () should be called as soon as possible (put earlier" > lib/util/cmdline_parser.ml +- @echo " when linking) because some choices during compilation depend on" >> lib/util/cmdline_parser.ml +- @echo " given options (e.g. dfs-sat)" >> lib/util/cmdline_parser.ml +- @echo "\n -> The following call:" >> lib/util/cmdline_parser.ml +- @echo " 1 - should be kept when builtind Alt-Ergo tools" >> lib/util/cmdline_parser.ml +- @echo " 2 - should be removed to build and use only the library." >> lib/util/cmdline_parser.ml +- @echo "\n Alternatively to 2, one can just remove cmdline_parser.cmo/cmx in" >> lib/util/cmdline_parser.ml +- @echo " Makefile.users *)" >> lib/util/cmdline_parser.ml +- @echo "\nlet () = Options.parse_cmdline_arguments ()" >> lib/util/cmdline_parser.ml ++ @printf "(* parse_args () should be called as soon as possible (put earlier" > lib/util/cmdline_parser.ml ++ @printf " when linking) because some choices during compilation depend on" >> lib/util/cmdline_parser.ml ++ @printf " given options (e.g. dfs-sat)" >> lib/util/cmdline_parser.ml ++ @printf "\n -> The following call:" >> lib/util/cmdline_parser.ml ++ @printf " 1 - should be kept when builtind Alt-Ergo tools" >> lib/util/cmdline_parser.ml ++ @printf " 2 - should be removed to build and use only the library." >> lib/util/cmdline_parser.ml ++ @printf "\n Alternatively to 2, one can just remove cmdline_parser.cmo/cmx in" >> lib/util/cmdline_parser.ml ++ @printf " Makefile.users *)" >> lib/util/cmdline_parser.ml ++ @printf "\nlet () = Options.parse_cmdline_arguments ()" >> lib/util/cmdline_parser.ml + + META: config.status + @echo "description = \"API of Alt-Ergo: An automatic theorem prover dedicated to program verification\"" > META diff --git a/patches/alt-ergo/patch_for_changes_in_num_library.patch b/patches/alt-ergo/patch_for_changes_in_num_library.patch new file mode 100644 index 0000000..a0acc4e --- /dev/null +++ b/patches/alt-ergo/patch_for_changes_in_num_library.patch @@ -0,0 +1,62 @@ +diff --git a/Makefile.configurable.in b/Makefile.configurable.in +index bcf1dfc..5f15ee5 100644 +--- a/Makefile.configurable.in ++++ b/Makefile.configurable.in +@@ -39,6 +39,7 @@ OCAMLWIN32 = @OCAMLWIN32@ + EXE = @EXE@ + ENABLEGUI = @ENABLEGUI@ + ZARITHLIB=@ZARITHLIB@ ++NUMLIB=@NUMLIB@ + CAMLZIPLIB=@CAMLZIPLIB@ + #OCAMLGRAPHLIB=@OCAMLGRAPHLIB@ + LABLGTK2LIB=@LABLGTK2LIB@ +diff --git a/Makefile.users b/Makefile.users +index 63e7bf2..94cd733 100644 +--- a/Makefile.users ++++ b/Makefile.users +@@ -8,7 +8,7 @@ LOCAL_INC = -I lib/util -I lib/structures -I lib/reasoners \ + -I plugins/common -I plugins/satML \ + -I plugins/fm-simplex + +-INCLUDES = $(ZARITHLIB) $(LABLGTK2LIB) $(CAMLZIPLIB) $(OCPLIBSIMPLEXLIB) $(LOCAL_INC) ++INCLUDES = $(NUMLIB) $(ZARITHLIB) $(LABLGTK2LIB) $(CAMLZIPLIB) $(OCPLIBSIMPLEXLIB) $(LOCAL_INC) + #for coverage # -I /usr/local/lib/ocaml/3.12.1/bisect -pp "camlp4o str.cma /usr/local/lib/ocaml/3.12.1/bisect/bisect_pp.cmo" + + BFLAGS = -annot -absname -bin-annot -short-paths -strict-sequence -g $(INCLUDES) +diff --git a/configure.in b/configure.in +index f7ba81a..938d5b7 100644 +--- a/configure.in ++++ b/configure.in +@@ -116,6 +116,24 @@ else + fi + fi + ++#looking for num library ++ ++if test "$USEOCAMLFIND" = yes; then ++ NUMLIB=$(ocamlfind query -i-format num) ++fi ++ ++if test -n "$NUMLIB";then ++ echo "ocamlfind found num in $NUMLIB" ++ NUM=yes ++else ++ AC_CHECK_FILE($OCAMLLIB/nums.cma,NUM=yes,NUM=no) ++ if test "$NUM" = no ; then ++ AC_MSG_ERROR(Cannot find num library.) ++ else ++ NUMLIB="" ++ fi ++fi ++ + #looking for camlzip library + + if test "$USEOCAMLFIND" = yes; then +@@ -283,6 +301,7 @@ AC_SUBST(OCAMLVERSION) + AC_SUBST(OCAMLLIB) + #AC_SUBST(OCAMLGRAPHLIB) + AC_SUBST(ZARITHLIB) ++AC_SUBST(NUMLIB) + AC_SUBST(CAMLZIPLIB) + AC_SUBST(OCAMLWEB) + AC_SUBST(LABLGTK2LIB) diff --git a/patches/alt-ergo/version_update.patch b/patches/alt-ergo/version_update.patch new file mode 100644 index 0000000..831a5cf --- /dev/null +++ b/patches/alt-ergo/version_update.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/util/version.ml b/src/lib/util/version.ml +index 67710c68..761ed2fb 100644 +--- a/src/lib/util/version.ml ++++ b/src/lib/util/version.ml +@@ -29,7 +29,7 @@ + (* WARNING: a "cut" is performed on the following file in the Makefile. + DO NOT CHANGE its format *) + +-let _version="dev" ++let _version="2.4.2" + + let _release_commit = "(not released)" + diff --git a/patches/altgr-ergo/altgr-ergo.install.0.95.2 b/patches/altgr-ergo/altgr-ergo.install.0.95.2 new file mode 100644 index 0000000..06130ad --- /dev/null +++ b/patches/altgr-ergo/altgr-ergo.install.0.95.2 @@ -0,0 +1 @@ +bin: ["altgr-ergo.opt" {"altgr-ergo"}] diff --git a/patches/altgr-ergo/altgr-ergo.install.0.99.1 b/patches/altgr-ergo/altgr-ergo.install.0.99.1 new file mode 100644 index 0000000..ace1015 --- /dev/null +++ b/patches/altgr-ergo/altgr-ergo.install.0.99.1 @@ -0,0 +1,3 @@ +bin: [ + "altgr-ergo.opt" {"altgr-ergo"} +] diff --git a/patches/altgr-ergo/version_update.patch b/patches/altgr-ergo/version_update.patch new file mode 100644 index 0000000..831a5cf --- /dev/null +++ b/patches/altgr-ergo/version_update.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/util/version.ml b/src/lib/util/version.ml +index 67710c68..761ed2fb 100644 +--- a/src/lib/util/version.ml ++++ b/src/lib/util/version.ml +@@ -29,7 +29,7 @@ + (* WARNING: a "cut" is performed on the following file in the Makefile. + DO NOT CHANGE its format *) + +-let _version="dev" ++let _version="2.4.2" + + let _release_commit = "(not released)" + diff --git a/patches/apalogretrieve/apalogretrieve.install b/patches/apalogretrieve/apalogretrieve.install new file mode 100644 index 0000000..4051d1d --- /dev/null +++ b/patches/apalogretrieve/apalogretrieve.install @@ -0,0 +1 @@ +bin: ["apalog"] diff --git a/patches/apron/docker-workaround.diff b/patches/apron/docker-workaround.diff new file mode 100644 index 0000000..2ab19c5 --- /dev/null +++ b/patches/apron/docker-workaround.diff @@ -0,0 +1,36 @@ +diff --git a/Makefile b/Makefile +index fab8118..2b659d6 100644 +--- a/Makefile ++++ b/Makefile +@@ -35,7 +35,7 @@ java: + (cd japron; $(MAKE)) + + ml: +- (cd mlapronidl; $(MAKE) all) ++ (cd mlapronidl; $(MAKE) INCLUDE_DEPEND=no depend; $(MAKE) all) + (cd newpolka; $(MAKE) ml) + (cd box; $(MAKE) ml) + (cd octagons; $(MAKE) mlMPQ mlD) +diff --git a/mlapronidl/Makefile b/mlapronidl/Makefile +index f1a049a..926338f 100644 +--- a/mlapronidl/Makefile ++++ b/mlapronidl/Makefile +@@ -222,10 +222,13 @@ rebuild: + # Dependencies + #--------------------------------------- + +-depend: $(MLMODULES:%=%.ml) $(MLMODULES:%=%.mli) ++INCLUDE_DEPEND ?= yes ++ifneq ($(INCLUDE_DEPEND),yes) ++ depend: $(MLMODULES:%=%.ml) $(MLMODULES:%=%.mli) + $(OCAMLDEP) $^ > $@ +- +-# Hack to avoid rebuilding depends on cleanup +-ifeq ($(filter %clean,$(MAKECMDGOALS)),) +- -include depend ++else ++ # Hack to avoid rebuilding depends on cleanup ++ ifeq ($(filter %clean,$(MAKECMDGOALS)),) ++ -include depend ++ endif + endif diff --git a/patches/arakoon/opam.patch b/patches/arakoon/opam.patch new file mode 100644 index 0000000..ba9116b --- /dev/null +++ b/patches/arakoon/opam.patch @@ -0,0 +1,23 @@ +diff -ur arakoon-1.6.5/Makefile arakoon-1.6.5-opam/Makefile +--- arakoon-1.6.5/Makefile 2013-10-01 17:45:58.000000000 +0200 ++++ arakoon-1.6.5-opam/Makefile 2013-12-10 13:22:02.323993019 +0100 +@@ -1,7 +1,7 @@ + # This makefile wrapper makes DEBIAN packaging easier. + + OCAML_VERSION ?= 4.00.1 +-OCAML_LIBDIR ?= $(DESTDIR)/usr/lib/ocaml/ ++OCAML_LIBDIR ?= $(DESTDIR)/lib/ + OCAML_FIND ?= ocamlfind + + all: build +@@ -18,8 +18,8 @@ + install: install_client install_server + + install_server: +- mkdir -p $(DESTDIR)/usr/bin/ +- cp ./arakoon.native $(DESTDIR)/usr/bin/arakoon ++ mkdir -p $(DESTDIR)/bin/ ++ cp ./arakoon.native $(DESTDIR)/bin/arakoon + + install_client: + mkdir -p $(OCAML_LIBDIR) diff --git a/patches/archimedes/archimedes.install b/patches/archimedes/archimedes.install new file mode 100644 index 0000000..bb92b61 --- /dev/null +++ b/patches/archimedes/archimedes.install @@ -0,0 +1,4 @@ +share: [ + "src/archimedes_cairo.dep" + "src/archimedes_graphics.dep" +] diff --git a/patches/asn1-combinators/0001-bigarray-compat.patch b/patches/asn1-combinators/0001-bigarray-compat.patch new file mode 100644 index 0000000..a97b02b --- /dev/null +++ b/patches/asn1-combinators/0001-bigarray-compat.patch @@ -0,0 +1,31 @@ +--- a/_tags 2019-11-03 16:34:40.691766000 +0100 ++++ b/_tags 2019-11-03 16:34:41.850239000 +0100 +@@ -1,7 +1,7 @@ + true: color(always) + true: bin_annot, safe_string, strict_sequence + true: warn(A-4-41-42-44-48-58) +-true: package(bytes), package(result), package(cstruct), package(zarith), package(ptime) ++true: package(bytes), package(result), package(cstruct), package(zarith), package(ptime), package(bigarray-compat) + + : include + +--- a/pkg/META 2019-11-03 16:34:20.947072000 +0100 ++++ b/pkg/META 2019-11-03 16:34:22.050043000 +0100 +@@ -1,6 +1,6 @@ + description = "Embed typed ASN.1 grammars in OCaml" + version = "0.2.0" +-requires = "cstruct zarith ptime" ++requires = "cstruct zarith ptime bigarray-compat" + archive(byte) = "asn1-combinators.cma" + archive(native) = "asn1-combinators.cmxa" + plugin(byte) = "asn1-combinators.cma" +--- a/src/asn_prim.ml.orig 2019-11-03 16:34:00.685635000 +0100 ++++ b/src/asn_prim.ml 2019-11-03 16:34:01.930523000 +0100 +@@ -4,6 +4,7 @@ + open Asn_core + + module Writer = Asn_writer ++module Bigarray = Bigarray_compat + + module type Prim = sig + type t diff --git a/patches/async/disable_warn_error.patch b/patches/async/disable_warn_error.patch new file mode 100644 index 0000000..6a9e2e5 --- /dev/null +++ b/patches/async/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.461656205 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.630904294 -0500 +@@ -574,7 +574,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/async_core/disable_warn_error.patch b/patches/async_core/disable_warn_error.patch new file mode 100644 index 0000000..ce8d608 --- /dev/null +++ b/patches/async_core/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.465655770 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.632903901 -0500 +@@ -574,7 +574,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/async_extra/disable_warn_error.patch b/patches/async_extra/disable_warn_error.patch new file mode 100644 index 0000000..63d22f5 --- /dev/null +++ b/patches/async_extra/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.469655755 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.633903949 -0500 +@@ -574,7 +574,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/async_extra/patch-errno.diff b/patches/async_extra/patch-errno.diff new file mode 100644 index 0000000..b9a7063 --- /dev/null +++ b/patches/async_extra/patch-errno.diff @@ -0,0 +1,10 @@ +--- src/rpc_transport_low_latency_stubs.c ++++ src/rpc_transport_low_latency_stubs.c +@@ -1,6 +1,6 @@ + #include ++#include + #include +-#include + + #include + #include diff --git a/patches/async_unix/disable_warn_error.patch b/patches/async_unix/disable_warn_error.patch new file mode 100644 index 0000000..75415e3 --- /dev/null +++ b/patches/async_unix/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.473656158 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.635903838 -0500 +@@ -574,7 +574,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/atd/atd.install.1.0.2 b/patches/atd/atd.install.1.0.2 new file mode 100644 index 0000000..71e2bc4 --- /dev/null +++ b/patches/atd/atd.install.1.0.2 @@ -0,0 +1 @@ +bin: ["atdcat"] diff --git a/patches/atd/atd.install.1.0.3 b/patches/atd/atd.install.1.0.3 new file mode 100644 index 0000000..71e2bc4 --- /dev/null +++ b/patches/atd/atd.install.1.0.3 @@ -0,0 +1 @@ +bin: ["atdcat"] diff --git a/patches/atd/atd.install.1.1.0 b/patches/atd/atd.install.1.1.0 new file mode 100644 index 0000000..71e2bc4 --- /dev/null +++ b/patches/atd/atd.install.1.1.0 @@ -0,0 +1 @@ +bin: ["atdcat"] diff --git a/patches/atd/atd.install.1.1.1 b/patches/atd/atd.install.1.1.1 new file mode 100644 index 0000000..71e2bc4 --- /dev/null +++ b/patches/atd/atd.install.1.1.1 @@ -0,0 +1 @@ +bin: ["atdcat"] diff --git a/patches/atd/atd.install.1.1.2 b/patches/atd/atd.install.1.1.2 new file mode 100644 index 0000000..71e2bc4 --- /dev/null +++ b/patches/atd/atd.install.1.1.2 @@ -0,0 +1 @@ +bin: ["atdcat"] diff --git a/patches/atd/atd.install.1.2.0 b/patches/atd/atd.install.1.2.0 new file mode 100644 index 0000000..71e2bc4 --- /dev/null +++ b/patches/atd/atd.install.1.2.0 @@ -0,0 +1 @@ +bin: ["atdcat"] diff --git a/patches/atd/atd.install.1.2.1 b/patches/atd/atd.install.1.2.1 new file mode 100644 index 0000000..ce09318 --- /dev/null +++ b/patches/atd/atd.install.1.2.1 @@ -0,0 +1,87 @@ +lib: [ + "_build/install/default/lib/atd/META" {"META"} + "_build/install/default/lib/atd/opam" {"opam"} + "_build/install/default/lib/atd/atd_annot.cmi" + "_build/install/default/lib/atd/atd_annot.cmx" + "_build/install/default/lib/atd/atd_annot.cmt" + "_build/install/default/lib/atd/atd_annot.cmti" + "_build/install/default/lib/atd/atd_annot.mli" + "_build/install/default/lib/atd/atd_ast.cmi" + "_build/install/default/lib/atd/atd_ast.cmx" + "_build/install/default/lib/atd/atd_ast.cmt" + "_build/install/default/lib/atd/atd_ast.cmti" + "_build/install/default/lib/atd/atd_ast.mli" + "_build/install/default/lib/atd/atd_check.cmi" + "_build/install/default/lib/atd/atd_check.cmx" + "_build/install/default/lib/atd/atd_check.cmt" + "_build/install/default/lib/atd/atd_check.ml" + "_build/install/default/lib/atd/atd_doc.cmi" + "_build/install/default/lib/atd/atd_doc.cmx" + "_build/install/default/lib/atd/atd_doc.cmt" + "_build/install/default/lib/atd/atd_doc.cmti" + "_build/install/default/lib/atd/atd_doc.mli" + "_build/install/default/lib/atd/atd_doc_lexer.cmi" + "_build/install/default/lib/atd/atd_doc_lexer.cmx" + "_build/install/default/lib/atd/atd_doc_lexer.cmt" + "_build/install/default/lib/atd/atd_doc_lexer.ml" + "_build/install/default/lib/atd/atd_expand.cmi" + "_build/install/default/lib/atd/atd_expand.cmx" + "_build/install/default/lib/atd/atd_expand.cmt" + "_build/install/default/lib/atd/atd_expand.cmti" + "_build/install/default/lib/atd/atd_expand.mli" + "_build/install/default/lib/atd/atd_indent.cmi" + "_build/install/default/lib/atd/atd_indent.cmx" + "_build/install/default/lib/atd/atd_indent.cmt" + "_build/install/default/lib/atd/atd_indent.cmti" + "_build/install/default/lib/atd/atd_indent.mli" + "_build/install/default/lib/atd/atd_inherit.cmi" + "_build/install/default/lib/atd/atd_inherit.cmx" + "_build/install/default/lib/atd/atd_inherit.cmt" + "_build/install/default/lib/atd/atd_inherit.cmti" + "_build/install/default/lib/atd/atd_inherit.mli" + "_build/install/default/lib/atd/atd_lexer.cmi" + "_build/install/default/lib/atd/atd_lexer.cmx" + "_build/install/default/lib/atd/atd_lexer.cmt" + "_build/install/default/lib/atd/atd_lexer.ml" + "_build/install/default/lib/atd/atd_parser.cmi" + "_build/install/default/lib/atd/atd_parser.cmx" + "_build/install/default/lib/atd/atd_parser.cmt" + "_build/install/default/lib/atd/atd_parser.cmti" + "_build/install/default/lib/atd/atd_parser.mli" + "_build/install/default/lib/atd/atd_predef.cmi" + "_build/install/default/lib/atd/atd_predef.cmx" + "_build/install/default/lib/atd/atd_predef.cmt" + "_build/install/default/lib/atd/atd_predef.ml" + "_build/install/default/lib/atd/atd_print.cmi" + "_build/install/default/lib/atd/atd_print.cmx" + "_build/install/default/lib/atd/atd_print.cmt" + "_build/install/default/lib/atd/atd_print.cmti" + "_build/install/default/lib/atd/atd_print.mli" + "_build/install/default/lib/atd/atd_reflect.cmi" + "_build/install/default/lib/atd/atd_reflect.cmx" + "_build/install/default/lib/atd/atd_reflect.cmt" + "_build/install/default/lib/atd/atd_reflect.cmti" + "_build/install/default/lib/atd/atd_reflect.mli" + "_build/install/default/lib/atd/atd_sort.cmi" + "_build/install/default/lib/atd/atd_sort.cmx" + "_build/install/default/lib/atd/atd_sort.cmt" + "_build/install/default/lib/atd/atd_sort.cmti" + "_build/install/default/lib/atd/atd_sort.mli" + "_build/install/default/lib/atd/atd_util.cmi" + "_build/install/default/lib/atd/atd_util.cmx" + "_build/install/default/lib/atd/atd_util.cmt" + "_build/install/default/lib/atd/atd_util.cmti" + "_build/install/default/lib/atd/atd_util.mli" + "_build/install/default/lib/atd/atd_version.cmi" + "_build/install/default/lib/atd/atd_version.cmx" + "_build/install/default/lib/atd/atd_version.cmt" + "_build/install/default/lib/atd/atd_version.ml" + "_build/install/default/lib/atd/atd.cma" + "_build/install/default/lib/atd/atd.cmxa" + "_build/install/default/lib/atd/atd.a" + "_build/install/default/lib/atd/atd.cmxs" +] +doc: [ + "_build/install/default/doc/atd/README.md" + "_build/install/default/doc/atd/LICENSE" +] diff --git a/patches/atdgen/atdgen.install.1.10.0 b/patches/atdgen/atdgen.install.1.10.0 new file mode 100644 index 0000000..f50dc83 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.10.0 @@ -0,0 +1,6 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} + "atdgen-cppo/atdgen-cppo" + "atdgen-cppo/cppo-json" +] diff --git a/patches/atdgen/atdgen.install.1.2.2 b/patches/atdgen/atdgen.install.1.2.2 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.2.2 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.2.3 b/patches/atdgen/atdgen.install.1.2.3 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.2.3 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.2.4 b/patches/atdgen/atdgen.install.1.2.4 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.2.4 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.3.0 b/patches/atdgen/atdgen.install.1.3.0 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.3.0 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.3.1 b/patches/atdgen/atdgen.install.1.3.1 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.3.1 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.4.0 b/patches/atdgen/atdgen.install.1.4.0 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.4.0 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.4.1 b/patches/atdgen/atdgen.install.1.4.1 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.4.1 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.5.0 b/patches/atdgen/atdgen.install.1.5.0 new file mode 100644 index 0000000..fd40e01 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.5.0 @@ -0,0 +1,4 @@ +bin: [ + "atdgen.run" + "atdgen" +] diff --git a/patches/atdgen/atdgen.install.1.6.0 b/patches/atdgen/atdgen.install.1.6.0 new file mode 100644 index 0000000..20939cd --- /dev/null +++ b/patches/atdgen/atdgen.install.1.6.0 @@ -0,0 +1,4 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} +] diff --git a/patches/atdgen/atdgen.install.1.6.1 b/patches/atdgen/atdgen.install.1.6.1 new file mode 100644 index 0000000..20939cd --- /dev/null +++ b/patches/atdgen/atdgen.install.1.6.1 @@ -0,0 +1,4 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} +] diff --git a/patches/atdgen/atdgen.install.1.7.1 b/patches/atdgen/atdgen.install.1.7.1 new file mode 100644 index 0000000..20939cd --- /dev/null +++ b/patches/atdgen/atdgen.install.1.7.1 @@ -0,0 +1,4 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} +] diff --git a/patches/atdgen/atdgen.install.1.7.2 b/patches/atdgen/atdgen.install.1.7.2 new file mode 100644 index 0000000..20939cd --- /dev/null +++ b/patches/atdgen/atdgen.install.1.7.2 @@ -0,0 +1,4 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} +] diff --git a/patches/atdgen/atdgen.install.1.8.0 b/patches/atdgen/atdgen.install.1.8.0 new file mode 100644 index 0000000..f50dc83 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.8.0 @@ -0,0 +1,6 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} + "atdgen-cppo/atdgen-cppo" + "atdgen-cppo/cppo-json" +] diff --git a/patches/atdgen/atdgen.install.1.9.0 b/patches/atdgen/atdgen.install.1.9.0 new file mode 100644 index 0000000..f50dc83 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.9.0 @@ -0,0 +1,6 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} + "atdgen-cppo/atdgen-cppo" + "atdgen-cppo/cppo-json" +] diff --git a/patches/atdgen/atdgen.install.1.9.1 b/patches/atdgen/atdgen.install.1.9.1 new file mode 100644 index 0000000..f50dc83 --- /dev/null +++ b/patches/atdgen/atdgen.install.1.9.1 @@ -0,0 +1,6 @@ +bin: [ + "src/atdgen.run" {"atdgen.run"} + "src/atdgen" {"atdgen"} + "atdgen-cppo/atdgen-cppo" + "atdgen-cppo/cppo-json" +] diff --git a/patches/atdj/atdj.install b/patches/atdj/atdj.install new file mode 100644 index 0000000..085ff0c --- /dev/null +++ b/patches/atdj/atdj.install @@ -0,0 +1,2 @@ +bin: ["atdj.opt"] + diff --git a/patches/atomic/META.atomic b/patches/atomic/META.atomic new file mode 100644 index 0000000..03355a1 --- /dev/null +++ b/patches/atomic/META.atomic @@ -0,0 +1,4 @@ +name="atomic" +version="[distributed with OCaml 4.12 or above]" +description="dummy backward-compatibility package for Atomic" +requires="" diff --git a/patches/atomic/atomic.install b/patches/atomic/atomic.install new file mode 100644 index 0000000..9185680 --- /dev/null +++ b/patches/atomic/atomic.install @@ -0,0 +1,3 @@ +lib:[ + "META.atomic" {"META"} +] diff --git a/patches/bamboo/bamboo.install b/patches/bamboo/bamboo.install new file mode 100644 index 0000000..12bd3f9 --- /dev/null +++ b/patches/bamboo/bamboo.install @@ -0,0 +1,5 @@ +bin: [ + "?_build/src/exec/bamboo.native" {"bamboo"} + "?_build/src/exec/bamboo.byte" {"bamboo"} +] + diff --git a/patches/bap-ida-python/bap.cfg.in b/patches/bap-ida-python/bap.cfg.in new file mode 100644 index 0000000..ee3276b --- /dev/null +++ b/patches/bap-ida-python/bap.cfg.in @@ -0,0 +1,2 @@ +.default +bap_executable_path %{bap:bin}%/bap diff --git a/patches/bap-llvm/detect.travis b/patches/bap-llvm/detect.travis new file mode 100644 index 0000000..41f7cc2 --- /dev/null +++ b/patches/bap-llvm/detect.travis @@ -0,0 +1,5 @@ +#!/bin/sh + +cat > bap-llvm.config < plugins/x86/x86_llvm_config.ml.ab <. ) (x : float) y = Poly.( > ) x y ++let ( >: ) (x : float) y = Poly.( > ) x y + let ( >=. ) (x : float) y = Poly.( >= ) x y + + (* This needs to be defined as an external so that the compiler can specialize it as a diff --git a/patches/batteries/cloexec.patch b/patches/batteries/cloexec.patch new file mode 100644 index 0000000..05864a3 --- /dev/null +++ b/patches/batteries/cloexec.patch @@ -0,0 +1,15 @@ +diff -ur batteries-2.1/src/batUnix.mliv batteries-2.1-patch/src/batUnix.mliv +--- batteries-2.1/src/batUnix.mliv 2013-07-18 07:02:22.000000000 +0200 ++++ batteries-2.1-patch/src/batUnix.mliv 2013-08-28 15:47:03.632089339 +0200 +@@ -261,6 +261,10 @@ + O_SYNC/O_DSYNC) *) + ##V4## | O_SHARE_DELETE (** OCaml 4 and Windows only: allow the file to be deleted + ##V4## while still open *) ++##V4.1## | O_CLOEXEC (** Set the close-on-exec flag on the ++##V4.1## descriptor returned by {!openfile} ++##V4.1## ++##V4.1## Since OCaml 4.1 *) + (** The flags to {!Unix.openfile}. *) + + +Only in batteries-2.1-patch/src: batUnix.mliv~ diff --git a/patches/bdd/bdd.obuild b/patches/bdd/bdd.obuild new file mode 100644 index 0000000..4a65544 --- /dev/null +++ b/patches/bdd/bdd.obuild @@ -0,0 +1,32 @@ +Name: BDD +Version: 0.3 +Authors: Jean-Christophe Filliatre +License: GPL +Synopsis: quick implementation of a Binary Decision Diagrams (BDD) library +obuild-ver: 1 + +library bdd + oflags: -annot -w +27 -warn-error +8 + modules: Bdd + src-dir: . + +# executable check +# oflags: -annot -w +27 -warn-error +8 +# src-dir: . +# main-is: check.ml + +# executable bench +# oflags: -annot -w +27 -warn-error +8 +# src-dir: . +# main-is: bench_prop.ml + +# executable sat +# oflags: -annot -w +27 -warn-error +8 +# src-dir: . +# main-is: bdd_sat.ml +# build-deps: unix + +# executable queen +# oflags: -annot -w +27 -warn-error +8 +# src-dir: . +# main-is: queen.ml diff --git a/patches/beluga/beluga.install.0.5 b/patches/beluga/beluga.install.0.5 new file mode 100644 index 0000000..2c57331 --- /dev/null +++ b/patches/beluga/beluga.install.0.5 @@ -0,0 +1,2 @@ +bin: ["bin/beluga" {"beluga"}] +share: ["tools/beluga-mode.el"] diff --git a/patches/beluga/beluga.install.0.8 b/patches/beluga/beluga.install.0.8 new file mode 100644 index 0000000..7c4a430 --- /dev/null +++ b/patches/beluga/beluga.install.0.8 @@ -0,0 +1,2 @@ +bin: ["_build/src/beluga/main.native" {"beluga"}] +share: ["tools/beluga-mode.el"] diff --git a/patches/beluga/beluga.install.0.8.1 b/patches/beluga/beluga.install.0.8.1 new file mode 100644 index 0000000..7c4a430 --- /dev/null +++ b/patches/beluga/beluga.install.0.8.1 @@ -0,0 +1,2 @@ +bin: ["_build/src/beluga/main.native" {"beluga"}] +share: ["tools/beluga-mode.el"] diff --git a/patches/beluga/beluga.install.0.8.2 b/patches/beluga/beluga.install.0.8.2 new file mode 100644 index 0000000..7c4a430 --- /dev/null +++ b/patches/beluga/beluga.install.0.8.2 @@ -0,0 +1,2 @@ +bin: ["_build/src/beluga/main.native" {"beluga"}] +share: ["tools/beluga-mode.el"] diff --git a/patches/bes/bes.install b/patches/bes/bes.install new file mode 100644 index 0000000..298f158 --- /dev/null +++ b/patches/bes/bes.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/frontend.byte" {"bes"} + "?_build/src/frontend.native" {"bes"} +] diff --git a/patches/bibtex2html/0001-make-uninstall.patch b/patches/bibtex2html/0001-make-uninstall.patch new file mode 100644 index 0000000..3854d87 --- /dev/null +++ b/patches/bibtex2html/0001-make-uninstall.patch @@ -0,0 +1,29 @@ +From 44baaf74783974ac002b9f77a52a748450652afe Mon Sep 17 00:00:00 2001 +From: Jean-Christophe Filliatre +Date: Fri, 23 Mar 2018 13:38:46 +0100 +Subject: [PATCH] make uninstall + +--- + CHANGES | 2 ++ + Makefile.in | 5 +++++ + 2 files changed, 7 insertions(+) + +diff --git a/Makefile.in b/Makefile.in +index f62b61d..dfeb55a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -95,6 +95,11 @@ install: install-indep + cp bib2bib.byte $(BINDIR)/bib2bib ; \ + fi + ++uninstall: ++ rm -f $(BINDIR)/aux2bib $(BINDIR)/bibtex2html $(BINDIR)/bib2bib ++ rm -f $(MANDIR)/man1/aux2bib.1 $(MANDIR)/man1/bibtex2html.1 \ ++ $(MANDIR)/man1/bib2bib.1 ++ + install-byte: install-indep + cp bibtex2html.byte $(BINDIR)/bibtex2html + cp bib2bib.byte $(BINDIR)/bib2bib +-- +2.16.2 + diff --git a/patches/bibtex2html/make-uninstall.patch b/patches/bibtex2html/make-uninstall.patch new file mode 100644 index 0000000..3854d87 --- /dev/null +++ b/patches/bibtex2html/make-uninstall.patch @@ -0,0 +1,29 @@ +From 44baaf74783974ac002b9f77a52a748450652afe Mon Sep 17 00:00:00 2001 +From: Jean-Christophe Filliatre +Date: Fri, 23 Mar 2018 13:38:46 +0100 +Subject: [PATCH] make uninstall + +--- + CHANGES | 2 ++ + Makefile.in | 5 +++++ + 2 files changed, 7 insertions(+) + +diff --git a/Makefile.in b/Makefile.in +index f62b61d..dfeb55a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -95,6 +95,11 @@ install: install-indep + cp bib2bib.byte $(BINDIR)/bib2bib ; \ + fi + ++uninstall: ++ rm -f $(BINDIR)/aux2bib $(BINDIR)/bibtex2html $(BINDIR)/bib2bib ++ rm -f $(MANDIR)/man1/aux2bib.1 $(MANDIR)/man1/bibtex2html.1 \ ++ $(MANDIR)/man1/bib2bib.1 ++ + install-byte: install-indep + cp bibtex2html.byte $(BINDIR)/bibtex2html + cp bib2bib.byte $(BINDIR)/bib2bib +-- +2.16.2 + diff --git a/patches/bigbro/bigbro.install b/patches/bigbro/bigbro.install new file mode 100644 index 0000000..4deab17 --- /dev/null +++ b/patches/bigbro/bigbro.install @@ -0,0 +1 @@ +bin: ["bigbro"] diff --git a/patches/bigbro/opam.patch b/patches/bigbro/opam.patch new file mode 100644 index 0000000..b67be24 --- /dev/null +++ b/patches/bigbro/opam.patch @@ -0,0 +1,41 @@ +diff -ru bigbro.2.0.4-rev3/Makefile bigbro.2.0.4-rev3/Makefile +--- bigbro.2.0.4-rev3/Makefile 2006-02-13 22:36:08.000000000 +0100 ++++ bigbro.2.0.4-rev3/Makefile 2012-10-05 18:14:40.413300886 +0200 +@@ -28,10 +28,10 @@ + CAMLC=ocamlfind ocamlc + CAMLDEP=ocamldep + CAMLMKTOP=ocamlfind ocamlmktop +-CAMLP4=camlp4o ++CAMLP4=camlp5o + P4INCLUDE:=-I $(shell $(CAMLP4) -where) + INCLUDE=-package "unix threads pcre" +-COMPFLAGS=-thread -g -pp $(CAMLP4) $(INCLUDE) ++COMPFLAGS=-thread -g -pp "$(CAMLP4) -loc _loc" $(INCLUDE) + + # --------------------------------------------------------------------------------------------------------------------- + # The list of bytecode files to be linked. +@@ -98,10 +98,10 @@ + # The usual way to compile O'Caml programs. + + .generated-dependencies: *.ml *.mli +- $(CAMLC) -pp $(CAMLP4) $(P4INCLUDE) -c $(GRAMMAR).ml ++ $(CAMLC) -pp "$(CAMLP4) -loc _loc" $(P4INCLUDE) -c $(GRAMMAR).ml + rm -rf .generated-dependencies + for i in *.mli *.ml ; do \ +- $(CAMLP4) pr_depend.cmo $$i >> .generated-dependencies; \ ++ $(CAMLP4) pr_depend.cmo -loc _loc $$i >> .generated-dependencies; \ + done + + ifneq ($(MAKECMDGOALS),clean) +diff -ru bigbro.2.0.4-rev3/pcreg.ml bigbro.2.0.4-rev3/pcreg.ml +--- bigbro.2.0.4-rev3/pcreg.ml 2006-02-13 22:36:08.000000000 +0100 ++++ bigbro.2.0.4-rev3/pcreg.ml 2012-10-05 18:14:40.449301975 +0200 +@@ -21,7 +21,7 @@ + (* This function allows registering a new global declaration. It can be called within a grammar rule. *) + + let dummy_loc = +- Lexing.dummy_pos, Lexing.dummy_pos ++ Ploc.dummy + + let declare (item : MLast.str_item) = + globals := (item, dummy_loc) :: !globals diff --git a/patches/bin_prot/disable_warn_error.patch b/patches/bin_prot/disable_warn_error.patch new file mode 100644 index 0000000..bfd954e --- /dev/null +++ b/patches/bin_prot/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.476655884 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.636903956 -0500 +@@ -580,7 +580,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + (* We probably will want to set this up in the `configure` script at some diff --git a/patches/bin_prot/fix-arm-double-field.diff b/patches/bin_prot/fix-arm-double-field.diff new file mode 100644 index 0000000..db951f8 --- /dev/null +++ b/patches/bin_prot/fix-arm-double-field.diff @@ -0,0 +1,29 @@ +diff --git a/lib/blit_stubs.c b/lib/blit_stubs.c +index e67d9bc..389335d 100644 +--- a/lib/blit_stubs.c ++++ b/lib/blit_stubs.c +@@ -72,7 +72,11 @@ CAMLprim value bin_prot_blit_buf_stub( + CAMLprim value bin_prot_blit_float_array_buf_stub( + value v_src_pos, value v_arr, value v_dst_pos, value v_buf, value v_len) + { ++#ifdef __arm__ ++ char *arr = (char*)v_arr + Long_val(v_src_pos) * sizeof(double); ++#else + char *arr = (char*)&Double_field(v_arr, Long_val(v_src_pos)); ++#endif + char *buf = get_buf(v_buf, v_dst_pos); + memcpy(buf, arr, (size_t) (Long_val(v_len) * sizeof(double))); + return Val_unit; +@@ -82,7 +86,11 @@ CAMLprim value bin_prot_blit_buf_float_array_stub( + value v_src_pos, value v_buf, value v_dst_pos, value v_arr, value v_len) + { + char *buf = get_buf(v_buf, v_src_pos); ++#ifdef __arm__ ++ char *arr = (char*)v_arr + Long_val(v_dst_pos) * sizeof(double); ++#else + char *arr = (char*)&Double_field(v_arr, Long_val(v_dst_pos)); ++#endif + memcpy(arr, buf, (size_t) (Long_val(v_len) * sizeof(double))); + return Val_unit; + } + diff --git a/patches/biniou/biniou.install.1.0.12 b/patches/biniou/biniou.install.1.0.12 new file mode 100644 index 0000000..252d8c2 --- /dev/null +++ b/patches/biniou/biniou.install.1.0.12 @@ -0,0 +1,4 @@ +bin: [ + "?bdump.byte" {"bdump"} + "?bdump.native" {"bdump"} +] diff --git a/patches/biniou/biniou.install.1.0.13 b/patches/biniou/biniou.install.1.0.13 new file mode 100644 index 0000000..252d8c2 --- /dev/null +++ b/patches/biniou/biniou.install.1.0.13 @@ -0,0 +1,4 @@ +bin: [ + "?bdump.byte" {"bdump"} + "?bdump.native" {"bdump"} +] diff --git a/patches/biniou/biniou.install.1.0.5 b/patches/biniou/biniou.install.1.0.5 new file mode 100644 index 0000000..374757f --- /dev/null +++ b/patches/biniou/biniou.install.1.0.5 @@ -0,0 +1 @@ +bin: ["bdump"] diff --git a/patches/biniou/biniou.install.1.0.6 b/patches/biniou/biniou.install.1.0.6 new file mode 100644 index 0000000..374757f --- /dev/null +++ b/patches/biniou/biniou.install.1.0.6 @@ -0,0 +1 @@ +bin: ["bdump"] diff --git a/patches/biniou/biniou.install.1.0.9 b/patches/biniou/biniou.install.1.0.9 new file mode 100644 index 0000000..374757f --- /dev/null +++ b/patches/biniou/biniou.install.1.0.9 @@ -0,0 +1 @@ +bin: ["bdump"] diff --git a/patches/biniou/biniou.install.1.1.0 b/patches/biniou/biniou.install.1.1.0 new file mode 100644 index 0000000..252d8c2 --- /dev/null +++ b/patches/biniou/biniou.install.1.1.0 @@ -0,0 +1,4 @@ +bin: [ + "?bdump.byte" {"bdump"} + "?bdump.native" {"bdump"} +] diff --git a/patches/bisect/bisect.install b/patches/bisect/bisect.install new file mode 100644 index 0000000..a47e8c0 --- /dev/null +++ b/patches/bisect/bisect.install @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.native" {"bisect-report.opt"} + "_build/src/report/report.byte" {"bisect-report"} +] diff --git a/patches/bisect/install-thread.patch b/patches/bisect/install-thread.patch new file mode 100644 index 0000000..97fe947 --- /dev/null +++ b/patches/bisect/install-thread.patch @@ -0,0 +1,28 @@ +diff --git a/Makefile b/Makefile +index 4a8ce17..3a184a1 100644 +--- a/Makefile ++++ b/Makefile +@@ -89,10 +89,11 @@ install: FORCE + $(PATH_OCAMLFIND) query $(PROJECT_NAME) && $(PATH_OCAMLFIND) remove $(PROJECT_NAME) || true; \ + $(PATH_OCAMLFIND) install $(PROJECT_NAME) META -optional \ + $(PATH_BUILD)/$(PROJECT_NAME)_pp.cmo \ +- $(PATH_BUILD)/src/$(PROJECT_NAME)Thread.cm* \ +- $(PATH_BUILD)/src/$(PROJECT_NAME)Thread.o \ +- $(PATH_BUILD)/src/$(PROJECT_NAME)Thread.jo \ ++ $(PATH_BUILD)/src/threads/$(PROJECT_NAME)Thread.cm* \ ++ $(PATH_BUILD)/src/threads/$(PROJECT_NAME)Thread.o \ ++ $(PATH_BUILD)/src/threads/$(PROJECT_NAME)Thread.jo \ + $(PATH_BUILD)/$(PROJECT_NAME).a \ ++ $(PATH_BUILD)/$(PROJECT_NAME).o \ + $(PATH_BUILD)/$(PROJECT_NAME).cma \ + $(PATH_BUILD)/$(PROJECT_NAME).cmi \ + $(PATH_BUILD)/$(PROJECT_NAME).cmo \ +@@ -106,7 +107,7 @@ install: FORCE + cp $(PATH_BUILD)/$(PROJECT_NAME)_pp.cmo $(PATH_INSTALL); \ + fi; \ + for ext in cmi cmo cmx o cmj jo; do \ +- test -f $(PATH_BUILD)/src/$(PROJECT_NAME)Thread.$$ext && cp $(PATH_BUILD)/src/$(PROJECT_NAME)Thread.$$ext $(PATH_INSTALL) || true; \ ++ test -f $(PATH_BUILD)/src/threads/$(PROJECT_NAME)Thread.$$ext && cp $(PATH_BUILD)/src/threads/$(PROJECT_NAME)Thread.$$ext $(PATH_INSTALL) || true; \ + done; \ + for ext in a cmi cmo cmx cma cmxa cmja ja; do \ + test -f $(PATH_BUILD)/$(PROJECT_NAME).$$ext && cp $(PATH_BUILD)/$(PROJECT_NAME).$$ext $(PATH_INSTALL) || true; \ diff --git a/patches/bisect/opam.patch.1.1 b/patches/bisect/opam.patch.1.1 new file mode 100644 index 0000000..de35a69 --- /dev/null +++ b/patches/bisect/opam.patch.1.1 @@ -0,0 +1,31 @@ +diff -ru bisect.1.1/Makefile bisect.1.1/Makefile +--- bisect.1.1/Makefile 2011-02-12 14:40:23.000000000 +0100 ++++ bisect.1.1/Makefile 2012-10-05 18:14:41.313328109 +0200 +@@ -31,7 +31,7 @@ + # DEFINITIONS + + PROJECT_NAME=bisect +-OCAMLBUILD=$(PATH_OCAML_PREFIX)/bin/ocamlbuild ++OCAMLBUILD=ocamlbuild + OCAMLBUILD_FLAGS=-classic-display -no-links + MODULES_ODOCL=$(PROJECT_NAME).odocl + MODULES_MLPACK=$(PROJECT_NAME).mlpack +@@ -75,7 +75,7 @@ + + install: all + cp $(PATH_BUILD)/src/report/report.byte $(PATH_OCAML_PREFIX)/bin/bisect-report; \ +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PATH_OCAML_PREFIX)/bin/bisect-report.opt || true); \ ++ (which ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PATH_OCAML_PREFIX)/bin/bisect-report.opt || true); \ + if [ -x "$(PATH_OCAMLFIND)" ]; then \ + $(PATH_OCAMLFIND) query $(PROJECT_NAME) && $(PATH_OCAMLFIND) remove $(PROJECT_NAME) || true; \ + $(PATH_OCAMLFIND) install $(PROJECT_NAME) META -optional \ +@@ -101,7 +101,7 @@ + + generate: FORCE + echo '$(PROJECT_NAME).cma' > $(PROJECT_NAME).itarget +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamljava && echo '$(PROJECT_NAME).cmja' >> $(PROJECT_NAME).itarget) || true ++ (which ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true ++ (which ocamljava && echo '$(PROJECT_NAME).cmja' >> $(PROJECT_NAME).itarget) || true + + FORCE: diff --git a/patches/bisect/opam.patch.1.3 b/patches/bisect/opam.patch.1.3 new file mode 100644 index 0000000..c2894fb --- /dev/null +++ b/patches/bisect/opam.patch.1.3 @@ -0,0 +1,49 @@ +diff --git a/Makefile b/Makefile +index b86448a..81e29a0 100644 +--- a/Makefile ++++ b/Makefile +@@ -31,7 +31,7 @@ PATH_INSTALL=$(PATH_OCAML_PREFIX)/lib/ocaml/bisect + # DEFINITIONS + + PROJECT_NAME=bisect +-OCAMLBUILD=$(PATH_OCAML_PREFIX)/bin/ocamlbuild ++OCAMLBUILD=ocamlbuild + OCAMLBUILD_ENV=WARNINGS=$(WARNINGS) PATH_OCAML_PREFIX=$(PATH_OCAML_PREFIX) + OCAMLBUILD_FLAGS=-classic-display -no-links + MODULES_ODOCL=$(PROJECT_NAME).odocl +@@ -84,7 +84,7 @@ install: FORCE + if [ "$(PPX)" = "TRUE" ]; then \ + cp $(PATH_BUILD)/src/syntax/bisect_ppx.byte $(PATH_OCAML_PREFIX)/bin; \ + fi; \ +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PATH_OCAML_PREFIX)/bin/bisect-report.opt || true); \ ++ (which ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PATH_OCAML_PREFIX)/bin/bisect-report.opt || true); \ + if [ -x "$(PATH_OCAMLFIND)" ]; then \ + $(PATH_OCAMLFIND) query $(PROJECT_NAME) && $(PATH_OCAMLFIND) remove $(PROJECT_NAME) || true; \ + $(PATH_OCAMLFIND) install $(PROJECT_NAME) META -optional \ +@@ -115,7 +115,7 @@ install: FORCE + + generate: FORCE + echo '$(PROJECT_NAME).cma' > $(PROJECT_NAME).itarget +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamljava && echo '$(PROJECT_NAME).cmja' >> $(PROJECT_NAME).itarget) || true ++ (which ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true ++ (which ocamljava && echo '$(PROJECT_NAME).cmja' >> $(PROJECT_NAME).itarget) || true + + FORCE: +diff --git a/myocamlbuild.ml b/myocamlbuild.ml +index 8aa25fd..2ef7428 100644 +--- a/myocamlbuild.ml ++++ b/myocamlbuild.ml +@@ -68,11 +68,7 @@ let () = + cp src dst in + dispatch begin function + | After_rules -> +- let camlp4of = +- try +- let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in +- Filename.concat path_bin "camlp4of" +- with _ -> "camlp4of" in ++ let camlp4of = "camlp4of" in + flag ["ocaml"; "compile"; "pp_camlp4of"] (S[A"-pp"; A camlp4of]); + flag ["ocaml"; "pp:dep"; "pp_camlp4of"] (S[A camlp4of]); + flag ["ocaml"; "compile"; "use_compiler_libs"] (S[A"-I"; A"+compiler-libs"]); diff --git a/patches/bisect_ppx/bisect_ppx.install.0.1 b/patches/bisect_ppx/bisect_ppx.install.0.1 new file mode 100644 index 0000000..687a0d8 --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.0.1 @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.0.2 b/patches/bisect_ppx/bisect_ppx.install.0.2 new file mode 100644 index 0000000..687a0d8 --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.0.2 @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.0.2.2 b/patches/bisect_ppx/bisect_ppx.install.0.2.2 new file mode 100644 index 0000000..687a0d8 --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.0.2.2 @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.0.2.3 b/patches/bisect_ppx/bisect_ppx.install.0.2.3 new file mode 100644 index 0000000..687a0d8 --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.0.2.3 @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.0.2.4 b/patches/bisect_ppx/bisect_ppx.install.0.2.4 new file mode 100644 index 0000000..687a0d8 --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.0.2.4 @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.0.2.5 b/patches/bisect_ppx/bisect_ppx.install.0.2.5 new file mode 100644 index 0000000..687a0d8 --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.0.2.5 @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.0.2.6 b/patches/bisect_ppx/bisect_ppx.install.0.2.6 new file mode 100644 index 0000000..687a0d8 --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.0.2.6 @@ -0,0 +1,4 @@ +bin: [ + "_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.1.0.0 b/patches/bisect_ppx/bisect_ppx.install.1.0.0 new file mode 100644 index 0000000..5bf34df --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.1.0.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.1.0.1 b/patches/bisect_ppx/bisect_ppx.install.1.0.1 new file mode 100644 index 0000000..5bf34df --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.1.0.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.1.1.0 b/patches/bisect_ppx/bisect_ppx.install.1.1.0 new file mode 100644 index 0000000..5bf34df --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.1.1.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bisect_ppx/bisect_ppx.install.1.2.0 b/patches/bisect_ppx/bisect_ppx.install.1.2.0 new file mode 100644 index 0000000..5bf34df --- /dev/null +++ b/patches/bisect_ppx/bisect_ppx.install.1.2.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/report/report.byte" {"bisect-ppx-report"} + "?_build/src/report/report.native" {"bisect-ppx-report"} +] diff --git a/patches/bitmasks/82eb7ee561c3e660dc33a6938346abf7354a23d4.patch b/patches/bitmasks/82eb7ee561c3e660dc33a6938346abf7354a23d4.patch new file mode 100644 index 0000000..d6fcb75 --- /dev/null +++ b/patches/bitmasks/82eb7ee561c3e660dc33a6938346abf7354a23d4.patch @@ -0,0 +1,48 @@ +From 82eb7ee561c3e660dc33a6938346abf7354a23d4 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Sat, 16 Dec 2017 11:05:30 +0000 +Subject: [PATCH] Improve documentation installation with opam + +--- + Makefile | 10 +++++++++- + bitmasks.opam | 5 +---- + 2 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/Makefile b/Makefile +index ee30633..c7e317a 100644 +--- a/Makefile ++++ b/Makefile +@@ -31,8 +31,16 @@ JBUILDER=jbuilder + build: + $(JBUILDER) build @install + +-doc: ++bitmasks.install: ++ $(JBUILDER) build $@ ++ ++doc: bitmasks.install + $(JBUILDER) build @doc ++ @sed -e '$$d' $< | fgrep -v _doc > $<.tmp ++ @find _build/default/_doc -type f -not -name .jbuilder-keep | \ ++ sed -e 's/.*/ "\0"/' -e 's/_doc\/\(.*\/.*\)/\0 {"\1}/' >> $<.tmp ++ @echo ']' >> $<.tmp ++ @mv $<.tmp $< + + test: + $(JBUILDER) runtest +diff --git a/bitmasks.opam b/bitmasks.opam +index bbd401d..ec4b7a4 100644 +--- a/bitmasks.opam ++++ b/bitmasks.opam +@@ -7,10 +7,7 @@ homepage: "https://metastack.github.io/bitmasks" + dev-repo: "https://github.com/metastack/bitmasks.git" + bug-reports: "https://github.com/metastack/bitmasks/issues" + build: [ "jbuilder" "build" "@install" ] +-build-doc: [ +- ["jbuilder" "build" "@doc"] +- ["cp" "-r" "_build/default/_doc/bitmasks" "_build/default/_doc/index.html" "_build/default/_doc/odoc.css" "%{doc}%/"] +-] ++build-doc: [make "doc"] + build-test: ["jbuilder" "runtest"] + depends: [ + "jbuilder" {build} diff --git a/patches/bitstring/fix_402.patch b/patches/bitstring/fix_402.patch new file mode 100644 index 0000000..343473d --- /dev/null +++ b/patches/bitstring/fix_402.patch @@ -0,0 +1,341 @@ +commit 5997a66d9b078d75f821eedc9ba615c9df321e98 +Author: Richard W.M. Jones +Date: Wed Jul 30 20:02:02 2014 +0000 + + Stop using allocation trick in fastpath functions (OCaml 4.02). + + In OCaml 4.02, there is a new compiler optimization which means we can + no longer rely on the trick of passing in a newly allocated `zero' + (ie. Int32.zero or Int64.zero) to our fastpath noalloc functions. + + Instead we have to turn these into regular functions, which means they + may be a bit slower. + +diff --git a/bitstring.ml b/bitstring.ml +index bc29a41..4f4ed2c 100644 +--- a/bitstring.ml ++++ b/bitstring.ml +@@ -751,67 +751,67 @@ external extract_fastpath_int24_le_signed : string -> int -> int = "ocaml_bitstr + external extract_fastpath_int24_ne_signed : string -> int -> int = "ocaml_bitstring_extract_fastpath_int24_ne_signed" "noalloc" + *) + +-external extract_fastpath_int32_be_unsigned : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_unsigned" "noalloc" ++external extract_fastpath_int32_be_unsigned : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_unsigned" + +-external extract_fastpath_int32_le_unsigned : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_unsigned" "noalloc" ++external extract_fastpath_int32_le_unsigned : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_unsigned" + +-external extract_fastpath_int32_ne_unsigned : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_unsigned" "noalloc" ++external extract_fastpath_int32_ne_unsigned : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_unsigned" + +-external extract_fastpath_int32_be_signed : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_signed" "noalloc" ++external extract_fastpath_int32_be_signed : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_signed" + +-external extract_fastpath_int32_le_signed : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_signed" "noalloc" ++external extract_fastpath_int32_le_signed : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_signed" + +-external extract_fastpath_int32_ne_signed : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_signed" "noalloc" ++external extract_fastpath_int32_ne_signed : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_signed" + + (* +-external extract_fastpath_int40_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_unsigned" "noalloc" ++external extract_fastpath_int40_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_unsigned" + +-external extract_fastpath_int40_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_unsigned" "noalloc" ++external extract_fastpath_int40_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_unsigned" + +-external extract_fastpath_int40_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_unsigned" "noalloc" ++external extract_fastpath_int40_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_unsigned" + +-external extract_fastpath_int40_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_signed" "noalloc" ++external extract_fastpath_int40_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_signed" + +-external extract_fastpath_int40_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_signed" "noalloc" ++external extract_fastpath_int40_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_signed" + +-external extract_fastpath_int40_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_signed" "noalloc" ++external extract_fastpath_int40_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_signed" + +-external extract_fastpath_int48_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_unsigned" "noalloc" ++external extract_fastpath_int48_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_unsigned" + +-external extract_fastpath_int48_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_unsigned" "noalloc" ++external extract_fastpath_int48_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_unsigned" + +-external extract_fastpath_int48_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_unsigned" "noalloc" ++external extract_fastpath_int48_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_unsigned" + +-external extract_fastpath_int48_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_signed" "noalloc" ++external extract_fastpath_int48_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_signed" + +-external extract_fastpath_int48_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_signed" "noalloc" ++external extract_fastpath_int48_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_signed" + +-external extract_fastpath_int48_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_signed" "noalloc" ++external extract_fastpath_int48_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_signed" + +-external extract_fastpath_int56_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_unsigned" "noalloc" ++external extract_fastpath_int56_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_unsigned" + +-external extract_fastpath_int56_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_unsigned" "noalloc" ++external extract_fastpath_int56_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_unsigned" + +-external extract_fastpath_int56_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_unsigned" "noalloc" ++external extract_fastpath_int56_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_unsigned" + +-external extract_fastpath_int56_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_signed" "noalloc" ++external extract_fastpath_int56_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_signed" + +-external extract_fastpath_int56_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_signed" "noalloc" ++external extract_fastpath_int56_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_signed" + +-external extract_fastpath_int56_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_signed" "noalloc" ++external extract_fastpath_int56_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_signed" + *) + +-external extract_fastpath_int64_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_unsigned" "noalloc" ++external extract_fastpath_int64_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_unsigned" + +-external extract_fastpath_int64_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_unsigned" "noalloc" ++external extract_fastpath_int64_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_unsigned" + +-external extract_fastpath_int64_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_unsigned" "noalloc" ++external extract_fastpath_int64_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_unsigned" + +-external extract_fastpath_int64_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_signed" "noalloc" ++external extract_fastpath_int64_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_signed" + +-external extract_fastpath_int64_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_signed" "noalloc" ++external extract_fastpath_int64_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_signed" + +-external extract_fastpath_int64_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_signed" "noalloc" ++external extract_fastpath_int64_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_signed" + + (*----------------------------------------------------------------------*) + (* Constructor functions. *) +diff --git a/bitstring.mli b/bitstring.mli +index 501e6fb..93113c0 100644 +--- a/bitstring.mli ++++ b/bitstring.mli +@@ -1000,67 +1000,67 @@ external extract_fastpath_int24_le_signed : string -> int -> int = "ocaml_bitstr + external extract_fastpath_int24_ne_signed : string -> int -> int = "ocaml_bitstring_extract_fastpath_int24_ne_signed" "noalloc" + *) + +-external extract_fastpath_int32_be_unsigned : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_unsigned" "noalloc" ++external extract_fastpath_int32_be_unsigned : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_unsigned" + +-external extract_fastpath_int32_le_unsigned : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_unsigned" "noalloc" ++external extract_fastpath_int32_le_unsigned : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_unsigned" + +-external extract_fastpath_int32_ne_unsigned : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_unsigned" "noalloc" ++external extract_fastpath_int32_ne_unsigned : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_unsigned" + +-external extract_fastpath_int32_be_signed : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_signed" "noalloc" ++external extract_fastpath_int32_be_signed : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_be_signed" + +-external extract_fastpath_int32_le_signed : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_signed" "noalloc" ++external extract_fastpath_int32_le_signed : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_le_signed" + +-external extract_fastpath_int32_ne_signed : string -> int -> int32 -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_signed" "noalloc" ++external extract_fastpath_int32_ne_signed : string -> int -> int32 = "ocaml_bitstring_extract_fastpath_int32_ne_signed" + + (* +-external extract_fastpath_int40_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_unsigned" "noalloc" ++external extract_fastpath_int40_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_unsigned" + +-external extract_fastpath_int40_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_unsigned" "noalloc" ++external extract_fastpath_int40_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_unsigned" + +-external extract_fastpath_int40_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_unsigned" "noalloc" ++external extract_fastpath_int40_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_unsigned" + +-external extract_fastpath_int40_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_signed" "noalloc" ++external extract_fastpath_int40_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_be_signed" + +-external extract_fastpath_int40_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_signed" "noalloc" ++external extract_fastpath_int40_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_le_signed" + +-external extract_fastpath_int40_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_signed" "noalloc" ++external extract_fastpath_int40_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int40_ne_signed" + +-external extract_fastpath_int48_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_unsigned" "noalloc" ++external extract_fastpath_int48_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_unsigned" + +-external extract_fastpath_int48_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_unsigned" "noalloc" ++external extract_fastpath_int48_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_unsigned" + +-external extract_fastpath_int48_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_unsigned" "noalloc" ++external extract_fastpath_int48_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_unsigned" + +-external extract_fastpath_int48_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_signed" "noalloc" ++external extract_fastpath_int48_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_be_signed" + +-external extract_fastpath_int48_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_signed" "noalloc" ++external extract_fastpath_int48_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_le_signed" + +-external extract_fastpath_int48_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_signed" "noalloc" ++external extract_fastpath_int48_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int48_ne_signed" + +-external extract_fastpath_int56_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_unsigned" "noalloc" ++external extract_fastpath_int56_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_unsigned" + +-external extract_fastpath_int56_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_unsigned" "noalloc" ++external extract_fastpath_int56_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_unsigned" + +-external extract_fastpath_int56_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_unsigned" "noalloc" ++external extract_fastpath_int56_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_unsigned" + +-external extract_fastpath_int56_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_signed" "noalloc" ++external extract_fastpath_int56_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_be_signed" + +-external extract_fastpath_int56_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_signed" "noalloc" ++external extract_fastpath_int56_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_le_signed" + +-external extract_fastpath_int56_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_signed" "noalloc" ++external extract_fastpath_int56_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int56_ne_signed" + *) + +-external extract_fastpath_int64_be_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_unsigned" "noalloc" ++external extract_fastpath_int64_be_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_unsigned" + +-external extract_fastpath_int64_le_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_unsigned" "noalloc" ++external extract_fastpath_int64_le_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_unsigned" + +-external extract_fastpath_int64_ne_unsigned : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_unsigned" "noalloc" ++external extract_fastpath_int64_ne_unsigned : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_unsigned" + +-external extract_fastpath_int64_be_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_signed" "noalloc" ++external extract_fastpath_int64_be_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_be_signed" + +-external extract_fastpath_int64_le_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_signed" "noalloc" ++external extract_fastpath_int64_le_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_le_signed" + +-external extract_fastpath_int64_ne_signed : string -> int -> int64 -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_signed" "noalloc" ++external extract_fastpath_int64_ne_signed : string -> int -> int64 = "ocaml_bitstring_extract_fastpath_int64_ne_signed" + + (* 'construct' functions are used in BITSTRING constructors. *) + val construct_bit : Buffer.t -> bool -> int -> exn -> unit +diff --git a/bitstring_c.c b/bitstring_c.c +index b9ad109..3ea2547 100644 +--- a/bitstring_c.c ++++ b/bitstring_c.c +@@ -33,6 +33,8 @@ + + #include + #include ++#include ++#include + + /* Fastpath functions. These are used in the common case for reading + * ints where the following conditions are known to be true: +@@ -40,10 +42,10 @@ + * (b) the access in the match is byte-aligned + * (c) the access in the underlying bitstring is byte-aligned + * +- * These functions are all "noalloc" meaning they must not perform +- * any OCaml allocations. For this reason, when the function returns +- * an int32 or int64, the OCaml code passes in the pre-allocated pointer +- * to the return value. ++ * These functions used to all be "noalloc" meaning they must not ++ * perform any OCaml allocations. However starting with OCaml 4.02, a ++ * compiler optimization means that unforunately we now have to use ++ * ordinary alloc functions in some cases. + * + * The final offset in the string is calculated by the OCaml (caller) + * code. All we need to do is to read the string+offset and byteswap, +@@ -87,52 +89,31 @@ fastpath1(16,be,signed,int16_t) + fastpath1(16,le,signed,int16_t) + fastpath1(16,ne,signed,int16_t) + +-#define fastpath2(size,endian,signed,type,rval) \ +- CAMLprim value \ +- ocaml_bitstring_extract_fastpath_int##size##_##endian##_##signed \ +- (value strv, value offv, value rv) \ +- { \ +- type *ptr = (type *) ((void *) String_val (strv) + Int_val (offv)); \ +- type r; \ +- memcpy(&r, ptr, sizeof(r)); \ +- swap_##endian(size,r); \ +- rval(rv) = r; \ +- return rv; \ +- } +- +-fastpath2(32,be,unsigned,uint32_t,Int32_val) +-fastpath2(32,le,unsigned,uint32_t,Int32_val) +-fastpath2(32,ne,unsigned,uint32_t,Int32_val) +-fastpath2(32,be,signed,int32_t,Int32_val) +-fastpath2(32,le,signed,int32_t,Int32_val) +-fastpath2(32,ne,signed,int32_t,Int32_val) +- +-/* Special care needs to be taken on ARCH_ALIGN_INT64 platforms +- (hppa and sparc in Debian). */ +- +-#ifdef ARCH_ALIGN_INT64 +-#include +-#include +-#define fastpath3(size,endian,signed,type,rval) \ ++#define fastpath2(size,endian,signed,type,copy) \ + CAMLprim value \ + ocaml_bitstring_extract_fastpath_int##size##_##endian##_##signed \ +- (value strv, value offv, value rv) \ ++ (value strv, value offv) \ + { \ ++ CAMLparam2 (strv, offv); \ ++ CAMLlocal1 (rv); \ + type *ptr = (type *) ((void *) String_val (strv) + Int_val (offv)); \ + type r; \ +- memcpy(&r, ptr, sizeof(r)); \ ++ memcpy(&r, ptr, sizeof(r)); \ + swap_##endian(size,r); \ +- memcpy(Data_custom_val(rv), &r, sizeof(r)); \ +- return rv; \ ++ rv = copy (r); \ ++ CAMLreturn (rv); \ + } + +-#else +-#define fastpath3 fastpath2 +-#endif ++fastpath2(32,be,unsigned,uint32_t,caml_copy_int32) ++fastpath2(32,le,unsigned,uint32_t,caml_copy_int32) ++fastpath2(32,ne,unsigned,uint32_t,caml_copy_int32) ++fastpath2(32,be,signed,int32_t,caml_copy_int32) ++fastpath2(32,le,signed,int32_t,caml_copy_int32) ++fastpath2(32,ne,signed,int32_t,caml_copy_int32) + +-fastpath3(64,be,unsigned,uint64_t,Int64_val) +-fastpath3(64,le,unsigned,uint64_t,Int64_val) +-fastpath3(64,ne,unsigned,uint64_t,Int64_val) +-fastpath3(64,be,signed,int64_t,Int64_val) +-fastpath3(64,le,signed,int64_t,Int64_val) +-fastpath3(64,ne,signed,int64_t,Int64_val) ++fastpath2(64,be,unsigned,uint64_t,caml_copy_int64) ++fastpath2(64,le,unsigned,uint64_t,caml_copy_int64) ++fastpath2(64,ne,unsigned,uint64_t,caml_copy_int64) ++fastpath2(64,be,signed,int64_t,caml_copy_int64) ++fastpath2(64,le,signed,int64_t,caml_copy_int64) ++fastpath2(64,ne,signed,int64_t,caml_copy_int64) +diff --git a/pa_bitstring.ml b/pa_bitstring.ml +index a5f7c46..313760a 100644 +--- a/pa_bitstring.ml ++++ b/pa_bitstring.ml +@@ -666,17 +666,9 @@ let output_bitmatch _loc bs cases = + | 16 -> + <:expr< Bitstring.$lid:name$ $lid:data$ o >> + | 32 -> +- <:expr< +- (* must allocate a new zero each time *) +- let zero = Int32.of_int 0 in +- Bitstring.$lid:name$ $lid:data$ o zero +- >> ++ <:expr< Bitstring.$lid:name$ $lid:data$ o >> + | 64 -> +- <:expr< +- (* must allocate a new zero each time *) +- let zero = Int64.of_int 0 in +- Bitstring.$lid:name$ $lid:data$ o zero +- >> ++ <:expr< Bitstring.$lid:name$ $lid:data$ o >> + | _ -> assert false in + <:expr< + (* Starting offset within the string. *) diff --git a/patches/bitstring/fix_404.patch b/patches/bitstring/fix_404.patch new file mode 100644 index 0000000..fca3187 --- /dev/null +++ b/patches/bitstring/fix_404.patch @@ -0,0 +1,10 @@ +--- ocaml-bitstring-2.0.4.orig/Makefile.in 2016-08-12 14:47:34.000000000 +0200 ++++ ocaml-bitstring-2.0.4/Makefile.in 2016-08-12 14:50:51.000000000 +0200 +@@ -110,7 +110,7 @@ + -I +camlp4 -pp camlp4of -c $< + + pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma +- $(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \ ++ $(OCAMLFIND) ocamlc -I +camlp4 \ + -pp camlp4of -c $< -o $@ + diff --git a/patches/bitv/META.1.0 b/patches/bitv/META.1.0 new file mode 100644 index 0000000..b842abe --- /dev/null +++ b/patches/bitv/META.1.0 @@ -0,0 +1,5 @@ +name = "bitv" +version = "1.0" +description = "A bit vector library" +archive(byte) = "bitv.cmo" +archive(native) = "bitv.cmx" diff --git a/patches/bitv/bitv.install b/patches/bitv/bitv.install new file mode 100644 index 0000000..7c5e9e2 --- /dev/null +++ b/patches/bitv/bitv.install @@ -0,0 +1,8 @@ +lib: [ + "META" + "bitv.cmi" + "bitv.cmo" + "bitv.cmx" + "bitv.o" + "bitv.mli" +] diff --git a/patches/bolt/opam.bolt.META.patch b/patches/bolt/opam.bolt.META.patch new file mode 100644 index 0000000..cd347a5 --- /dev/null +++ b/patches/bolt/opam.bolt.META.patch @@ -0,0 +1,10 @@ +--- bolt-1.4/META 2012-10-26 21:19:41.000000000 +0200 ++++ bolt-1.4.patched/META 2013-09-30 12:52:31.948110819 +0200 +@@ -1,6 +1,6 @@ + description="logging tool" + requires="camlp4,unix,dynlink" +-version="1.3" ++version="1.4" + + archive(syntax,preprocessor)="bolt_pp.cmo" + diff --git a/patches/bolt/opam.patch.1.2 b/patches/bolt/opam.patch.1.2 new file mode 100644 index 0000000..fb89dce --- /dev/null +++ b/patches/bolt/opam.patch.1.2 @@ -0,0 +1,22 @@ +diff -ru bolt.1.2/Makefile bolt.1.2/Makefile +--- bolt.1.2/Makefile 2011-08-15 16:00:48.000000000 +0200 ++++ bolt.1.2/Makefile 2012-10-05 18:14:41.501333785 +0200 +@@ -31,7 +31,7 @@ + # DEFINITIONS + + PROJECT_NAME=bolt +-OCAMLBUILD=$(PATH_OCAML_PREFIX)/bin/ocamlbuild ++OCAMLBUILD=ocamlbuild + OCAMLBUILD_FLAGS=-classic-display -no-links + MODULES_ODOCL=$(PROJECT_NAME).odocl + MODULES_MLPACK=$(PROJECT_NAME).mlpack +@@ -100,7 +100,7 @@ + + generate: FORCE + echo '$(PROJECT_NAME).cma' > $(PROJECT_NAME).itarget +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true ++ (which ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true ++ (which ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true + + FORCE: diff --git a/patches/bolt/opam.patch.1.3 b/patches/bolt/opam.patch.1.3 new file mode 100644 index 0000000..b048f73 --- /dev/null +++ b/patches/bolt/opam.patch.1.3 @@ -0,0 +1,22 @@ +diff -ru bolt.1.3/Makefile bolt.1.3/Makefile +--- bolt.1.3/Makefile 2012-08-15 19:38:52.000000000 +0200 ++++ bolt.1.3/Makefile 2012-10-05 18:14:41.949347320 +0200 +@@ -31,7 +31,7 @@ + # DEFINITIONS + + PROJECT_NAME=bolt +-OCAMLBUILD=$(PATH_OCAML_PREFIX)/bin/ocamlbuild ++OCAMLBUILD=ocamlbuild + OCAMLBUILD_FLAGS=-classic-display -no-links + MODULES_ODOCL=$(PROJECT_NAME).odocl + MODULES_MLPACK=$(PROJECT_NAME).mlpack +@@ -100,7 +100,7 @@ + + generate: FORCE + echo '$(PROJECT_NAME).cma' > $(PROJECT_NAME).itarget +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true ++ (which ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true ++ (which ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true + + FORCE: diff --git a/patches/bolt/opam.patch.1.4 b/patches/bolt/opam.patch.1.4 new file mode 100644 index 0000000..bfcd66a --- /dev/null +++ b/patches/bolt/opam.patch.1.4 @@ -0,0 +1,21 @@ +--- bolt-1.4/Makefile 2012-10-26 21:19:41.000000000 +0200 ++++ bolt-1.4.patched/Makefile 2013-09-27 15:36:15.556186869 +0200 +@@ -31,7 +31,7 @@ + # DEFINITIONS + + PROJECT_NAME=bolt +-OCAMLBUILD=$(PATH_OCAML_PREFIX)/bin/ocamlbuild ++OCAMLBUILD=ocamlbuild + OCAMLBUILD_ENV=WARNINGS=$(WARNINGS) PATH_OCAML_PREFIX=$(PATH_OCAML_PREFIX) + OCAMLBUILD_FLAGS=-classic-display -no-links + MODULES_ODOCL=$(PROJECT_NAME).odocl +@@ -101,7 +101,7 @@ + + generate: FORCE + echo '$(PROJECT_NAME).cma' > $(PROJECT_NAME).itarget +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true ++ (which ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true ++ (which ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true + + FORCE: diff --git a/patches/boomerang/boomerang.install b/patches/boomerang/boomerang.install new file mode 100644 index 0000000..075d452 --- /dev/null +++ b/patches/boomerang/boomerang.install @@ -0,0 +1,5 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" +] diff --git a/patches/brotli/_oasis_remove_.ml b/patches/brotli/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/brotli/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/brotli/brotli.install b/patches/brotli/brotli.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/brotli/brotli.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/brozip/_oasis_remove_.ml b/patches/brozip/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/brozip/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/brozip/brozip.install b/patches/brozip/brozip.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/brozip/brozip.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/bsdowl/bsdowl.install b/patches/bsdowl/bsdowl.install new file mode 100644 index 0000000..ca32af0 --- /dev/null +++ b/patches/bsdowl/bsdowl.install @@ -0,0 +1,59 @@ +share: [ + "bps/bps.autoconf.mk" + "bps/bps.credentials.mk" + "bps/bps.clean.mk" + "bps/bps.usertarget.mk" + "bps/bps.files.mk" + "bps/bps.init.mk" + "bps/bps.objdir.mk" + "bps/bps.own.mk" + "bps/bps.project.mk" + "bps/bps.subdir.mk" + "misc/conf.freebsd.mk" + "misc/misc.dotfile.mk" + "misc/misc.elisp.mk" + "misc/misc.script.mk" + "noweb/noweb.latex.mk" + "noweb/noweb.main.mk" + "ocaml/ocaml.build.mk" + "ocaml/ocaml.find.mk" + "ocaml/ocaml.depend.mk" + "ocaml/ocaml.init.mk" + "ocaml/ocaml.tools.mk" + "ocaml/ocaml.lex.mk" + "ocaml/ocaml.lib.mk" + "ocaml/ocaml.main.mk" + "ocaml/ocaml.manual.mk" + "ocaml/ocaml.meta.mk" + "ocaml/ocaml.object.mk" + "ocaml/ocaml.odoc.mk" + "ocaml/ocaml.source.mk" + "ocaml/ocaml.pack.mk" + "ocaml/ocaml.prog.mk" + "ocaml/ocaml.compile.mk" + "ocaml/ocaml.dirs.mk" + "ocaml/ocaml.yacc.mk" + "ocaml/ocaml.toplevel.mk" + "test/www/Mk/scroll.mk" + "texmf/latex.bibtex.mk" + "texmf/latex.doc.post.mk" + "texmf/latex.doc.mk" + "texmf/tex.device.pdf.mk" + "texmf/latex.doc.pre.mk" + "texmf/tex.device.dvi.mk" + "texmf/tex.mpost.mk" + "texmf/tex.device.ps.mk" + "texmf/tex.doc.main.mk" + "texmf/tex.doc.mk" + "texmf/tex.doc.post.mk" + "texmf/tex.doc.pre.mk" + "texmf/tex.driver.dvi.mk" + "texmf/tex.driver.dvips.mk" + "texmf/tex.files.main.mk" + "texmf/tex.init.mk" + "texmf/tex.files.mk" + "texmf/texmf.init.mk" + "texmf/tex.driver.pdftex.mk" + "www/www.files.mk" + "www/www.sgml.mk" +] diff --git a/patches/bsdowl/remove.sh.2.2 b/patches/bsdowl/remove.sh.2.2 new file mode 100644 index 0000000..15bfde2 --- /dev/null +++ b/patches/bsdowl/remove.sh.2.2 @@ -0,0 +1,5 @@ +# Usage: remove PREFIX +# Remove BSD OWl +find "$1/share/mk" -type f \ + | xargs grep -l 'This file is part of BSD Owl Scripts' \ + | xargs rm -v -f diff --git a/patches/bsdowl/remove.sh.3.0.0-20150401 b/patches/bsdowl/remove.sh.3.0.0-20150401 new file mode 100644 index 0000000..ae193c7 --- /dev/null +++ b/patches/bsdowl/remove.sh.3.0.0-20150401 @@ -0,0 +1,5 @@ +# Usage: remove PREFIX +# Remove BSD Owl Scripts +find "$1/share/bsdowl" "$1/bin" -type f \ + | xargs grep -l 'This file is part of BSD Owl Scripts' \ + | xargs rm -v -f diff --git a/patches/bsdowl/remove.sh.3.0.0-20150830 b/patches/bsdowl/remove.sh.3.0.0-20150830 new file mode 100644 index 0000000..ae193c7 --- /dev/null +++ b/patches/bsdowl/remove.sh.3.0.0-20150830 @@ -0,0 +1,5 @@ +# Usage: remove PREFIX +# Remove BSD Owl Scripts +find "$1/share/bsdowl" "$1/bin" -type f \ + | xargs grep -l 'This file is part of BSD Owl Scripts' \ + | xargs rm -v -f diff --git a/patches/bt/bt.install b/patches/bt/bt.install new file mode 100644 index 0000000..4442c9d --- /dev/null +++ b/patches/bt/bt.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/otorrent/otorrent.byte" {"otorrent"} + "?_build/otorrent/otorrent.native" {"otorrent"} +] diff --git a/patches/cairo/META.1.2.0 b/patches/cairo/META.1.2.0 new file mode 100644 index 0000000..971dd61 --- /dev/null +++ b/patches/cairo/META.1.2.0 @@ -0,0 +1,24 @@ +version = "1.2.0" +description = "Binding to Cairo, a Vector Graphics Library." +requires = "bigarray" +archive(byte) = "cairo.cma" +archive(native) = "cairo.cmxa" +exists_if = "cairo.cma" + +package "lablgtk2" ( + version = "1.2.0" + description = "Rendering Cairo on Gtk canvas." + requires = "lablgtk2 cairo" + archive(byte) = "cairo_lablgtk.cma" + archive(native) = "cairo_lablgtk.cmxa" + exists_if = "cairo_lablgtk.cma" +) + +package "pango" ( + version = "1.2.0" + description = "interface with pango text rendering library" + requires = "lablgtk2 cairo" + archive(byte) = "pango_cairo.cma" + archive(native) = "pango_cairo.cmxa" + exists_if = "pango_cairo.cma" +) diff --git a/patches/cairo/configure_fontconfig.patch b/patches/cairo/configure_fontconfig.patch new file mode 100644 index 0000000..b04699d --- /dev/null +++ b/patches/cairo/configure_fontconfig.patch @@ -0,0 +1,23 @@ +diff --git a/configure.ac b/configure.ac +index 6c8c4e9..b539ca6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -32,6 +32,18 @@ PKG_CHECK_MODULES(LIBSVG_CAIRO, libsvg-cairo, use_libsvg_cairo=yes, use_libsvg_c + # Optional pango-cairo support + PKG_CHECK_MODULES(LIBPANGOCAIRO, pangocairo, use_libpangocairo=yes, use_libpangocairo=no) + ++# Optional fontconfig support ++CFLAGS=$CAIRO_CFLAGS ++AC_CHECK_DECL(CAIRO_HAS_FT_FONT, ++ [require_fontconfig=yes],[require_fontconfig=no], ++ [[#include ]]) ++ ++if test $require_fontconfig = yes ; then ++ unset CAIRO_LIBS ++ unset CAIRO_CFLAGS ++ PKG_CHECK_MODULES(CAIRO, cairo >= 1.2 freetype2 fontconfig) ++fi ++ + echo + echo " GTK+ support: $use_gtk" + echo " libsvg-cairo support: $use_libsvg_cairo" diff --git a/patches/cairo/configure_lablgtkdir.patch b/patches/cairo/configure_lablgtkdir.patch new file mode 100644 index 0000000..bcf0f1a --- /dev/null +++ b/patches/cairo/configure_lablgtkdir.patch @@ -0,0 +1,13 @@ +diff --git a/config.make.in b/config.make.in +index 0b4af37..d7b93b2 100644 +--- a/config.make.in ++++ b/config.make.in +@@ -11,7 +11,7 @@ OCAMLDEP = @OCAMLDEP@ + INSTALLDIR = $(OCAMLLIB)/cairo + + LABLGTKDIR = @LABLGTKDIR@ +-C_LABLGTKDIR = $(subst +,$(OCAMLLIB)/,$(LABLGTKDIR)) ++C_LABLGTKDIR = $(LABLGTKDIR) + + # stop ocamlmklib moaning + FILT = -Wl,--export-dynamic diff --git a/patches/cairo/opam.patch b/patches/cairo/opam.patch new file mode 100644 index 0000000..ea65c4c --- /dev/null +++ b/patches/cairo/opam.patch @@ -0,0 +1,12 @@ +diff -ru cairo.0.4.1/setup.ml cairo.0.4.1/setup.ml +--- cairo.0.4.1/setup.ml 2011-12-30 17:23:59.000000000 +0100 ++++ cairo.0.4.1/setup.ml 2012-10-05 18:15:15.442359704 +0200 +@@ -5999,7 +5999,7 @@ + | "Unix" | "Cygwin" -> "-o " ^ exe + | "Win32" -> "/Fe" ^ exe + | _ -> assert false in +- let args = o :: stdlib :: (flags @ [tmp]) in ++ let args = o :: stdlib :: (tmp :: flags @ []) in + let f_exit_code e = + if e <> 0 then (compile_err(); Sys.remove tmp; exit 1) in + BaseExec.run cc args ~f_exit_code; diff --git a/patches/cairo/opam.patch.in b/patches/cairo/opam.patch.in new file mode 100644 index 0000000..e635640 --- /dev/null +++ b/patches/cairo/opam.patch.in @@ -0,0 +1,34 @@ +diff -ru cairo1.ocaml-1.2.0/config.make.in cairo1.ocaml-1.2.0/config.make.in +--- cairo1.ocaml-1.2.0/config.make.in 2010-04-11 23:17:32.000000000 +0200 ++++ cairo1.ocaml-1.2.0/config.make.in 2012-10-08 10:55:06.526575701 +0200 +@@ -8,7 +8,7 @@ + OCAMLDOC = @OCAMLDOC@ + OCAMLDEP = @OCAMLDEP@ + +-INSTALLDIR = $(OCAMLLIB)/cairo ++INSTALLDIR=%{lib}%/cairo + + LABLGTKDIR = @LABLGTKDIR@ + C_LABLGTKDIR = $(subst +,$(OCAMLLIB)/,$(LABLGTKDIR)) +diff -ru cairo1.ocaml-1.2.0/src/Makefile cairo1.ocaml-1.2.0/src/Makefile +--- cairo1.ocaml-1.2.0/src/Makefile 2010-04-11 23:17:32.000000000 +0200 ++++ cairo1.ocaml-1.2.0/src/Makefile 2012-10-08 10:55:06.562576790 +0200 +@@ -87,15 +87,15 @@ + $(call mloptobjs,$(pangocairo_SRC)) : INCFLAGS=-I $(LABLGTKDIR) + + install: all +- mkdir -p $(DESTDIR)$(INSTALLDIR) $(DESTDIR)$(OCAMLLIB)/stublibs ++ mkdir -p $(DESTDIR)$(INSTALLDIR) %{prefix}%/lib/stublibs + install -m 644 *.mli *.cmi *.cma lib*.a $(DESTDIR)$(INSTALLDIR) + ifdef OCAMLOPT + install -m644 *.cmxa *.a *.cmx $(DESTDIR)$(INSTALLDIR) + endif + install -m 755 dll*.so $(DESTDIR)$(INSTALLDIR) +- if test -w $(DESTDIR)$(OCAMLLIB)/stublibs ; then \ ++ if test -w %{prefix}%/lib/stublibs ; then \ + for lib in dll*.so ; do \ +- ln -s $(INSTALLDIR)/$$lib $(DESTDIR)$(OCAMLLIB)/stublibs ; done ; fi ++ ln -s $(INSTALLDIR)/$$lib %{prefix}%/lib/stublibs ; done ; fi + + DOCFILES = cairo.mli cairo_bigarray.mli cairo_png.mli cairo_pdf.mli cairo_ps.mli cairo_ft.mli + ifdef LABLGTKDIR diff --git a/patches/caml2html/caml2html.install b/patches/caml2html/caml2html.install new file mode 100644 index 0000000..762a60b --- /dev/null +++ b/patches/caml2html/caml2html.install @@ -0,0 +1 @@ +bin: ["caml2html"] diff --git a/patches/camlhighlight/camlhighlight.install b/patches/camlhighlight/camlhighlight.install new file mode 100644 index 0000000..9b4f66c --- /dev/null +++ b/patches/camlhighlight/camlhighlight.install @@ -0,0 +1 @@ +share: ["data/sexp.outlang"] diff --git a/patches/camlhighlight/sexp-dir.patch.in.3.0 b/patches/camlhighlight/sexp-dir.patch.in.3.0 new file mode 100644 index 0000000..c86e5e3 --- /dev/null +++ b/patches/camlhighlight/sexp-dir.patch.in.3.0 @@ -0,0 +1,12 @@ +diff -u a/src/source-highlight_stubs.c b/src/source-highlight_stubs.c +--- a/src/source-highlight_stubs.c 2014-08-15 16:58:13.314376902 +0100 ++++ b/src/source-highlight_stubs.c 2014-08-15 17:03:42.894374193 +0100 +@@ -30,7 +30,7 @@ + /* Module variables and constants. */ + /********************************************************************************/ + +-static string outlang ("sexp.outlang"); // Default outlang definition file. ++static string outlang ("%{share}%/camlhighlight/sexp.outlang"); // Default outlang definition file. + static string langmap ("lang.map"); // Default language map file. + static SourceHighlight *hiliter = 0; // The global hiliter. + static LangMap *mapper = 0; // The global mapper. diff --git a/patches/camlhighlight/sexp-dir.patch.in.4.0 b/patches/camlhighlight/sexp-dir.patch.in.4.0 new file mode 100644 index 0000000..cbae64e --- /dev/null +++ b/patches/camlhighlight/sexp-dir.patch.in.4.0 @@ -0,0 +1,12 @@ +diff -u a/src/source-highlight_stubs.c b/src/source-highlight_stubs.c +--- a/src/source-highlight_stubs.c 2016-01-26 17:10:28.866470714 +0000 ++++ b/src/source-highlight_stubs.c 2016-01-26 17:10:34.018419272 +0000 +@@ -30,7 +30,7 @@ + /* Module variables and constants. */ + /********************************************************************************/ + +-static string outlang ("sexp.outlang"); // Default outlang definition file. ++static string outlang ("%{share}%/camlhighlight/sexp.outlang"); // Default outlang definition file. + static string langmap ("lang.map"); // Default language map file. + static SourceHighlight *hiliter = 0; // The global hiliter. + static LangMap *mapper = 0; // The global mapper. diff --git a/patches/camlhighlight/sexp-dir.patch.in.5.0 b/patches/camlhighlight/sexp-dir.patch.in.5.0 new file mode 100644 index 0000000..cbae64e --- /dev/null +++ b/patches/camlhighlight/sexp-dir.patch.in.5.0 @@ -0,0 +1,12 @@ +diff -u a/src/source-highlight_stubs.c b/src/source-highlight_stubs.c +--- a/src/source-highlight_stubs.c 2016-01-26 17:10:28.866470714 +0000 ++++ b/src/source-highlight_stubs.c 2016-01-26 17:10:34.018419272 +0000 +@@ -30,7 +30,7 @@ + /* Module variables and constants. */ + /********************************************************************************/ + +-static string outlang ("sexp.outlang"); // Default outlang definition file. ++static string outlang ("%{share}%/camlhighlight/sexp.outlang"); // Default outlang definition file. + static string langmap ("lang.map"); // Default language map file. + static SourceHighlight *hiliter = 0; // The global hiliter. + static LangMap *mapper = 0; // The global mapper. diff --git a/patches/camlidl/META.1.05 b/patches/camlidl/META.1.05 new file mode 100644 index 0000000..9f3eab5 --- /dev/null +++ b/patches/camlidl/META.1.05 @@ -0,0 +1,4 @@ +description = "Stub generator" +version = "1.05" +archive(byte,plugin) = "com.cma" +archive(native) = "com.cmxa" diff --git a/patches/camlidl/META.1.07 b/patches/camlidl/META.1.07 new file mode 100644 index 0000000..6a425e8 --- /dev/null +++ b/patches/camlidl/META.1.07 @@ -0,0 +1,4 @@ +description = "Stub generator" +version = "1.07" +archive(byte,plugin) = "com.cma" +archive(native) = "com.cmxa" diff --git a/patches/camlidl/META.1.09 b/patches/camlidl/META.1.09 new file mode 100644 index 0000000..2fa78bb --- /dev/null +++ b/patches/camlidl/META.1.09 @@ -0,0 +1,5 @@ +description = "Stub generator from IDL description" +version = "1.09" +archive(byte) = "com.cma" +archive(byte,plugin) = "com.cma" +archive(native) = "com.cmxa" diff --git a/patches/camlidl/META.1.10 b/patches/camlidl/META.1.10 new file mode 100644 index 0000000..b866610 --- /dev/null +++ b/patches/camlidl/META.1.10 @@ -0,0 +1,5 @@ +description = "Stub generator from IDL description" +version = "1.10" +archive(byte) = "com.cma" +archive(byte,plugin) = "com.cma" +archive(native) = "com.cmxa" diff --git a/patches/camlidl/META.1.11 b/patches/camlidl/META.1.11 new file mode 100644 index 0000000..4553065 --- /dev/null +++ b/patches/camlidl/META.1.11 @@ -0,0 +1,5 @@ +description = "Stub generator from IDL description" +version = "1.11" +archive(byte) = "com.cma" +archive(byte,plugin) = "com.cma" +archive(native) = "com.cmxa" diff --git a/patches/camlidl/META.1.12 b/patches/camlidl/META.1.12 new file mode 100644 index 0000000..3d7310b --- /dev/null +++ b/patches/camlidl/META.1.12 @@ -0,0 +1,5 @@ +description = "Stub generator from IDL description" +version = "1.12" +archive(byte) = "com.cma" +archive(byte,plugin) = "com.cma" +archive(native) = "com.cmxa" diff --git a/patches/camlidl/build-dll.diff b/patches/camlidl/build-dll.diff new file mode 100644 index 0000000..8a3124a --- /dev/null +++ b/patches/camlidl/build-dll.diff @@ -0,0 +1,24 @@ +diff -Naur camlidl-1.05/runtime/Makefile.unix camlidl-1.05-patched/runtime/Makefile.unix +--- camlidl-1.05/runtime/Makefile.unix 2000-08-19 12:05:00.000000000 +0100 ++++ camlidl-1.05-patched/runtime/Makefile.unix 2016-12-02 11:26:21.847071889 +0000 +@@ -14,7 +14,11 @@ + + OBJS=idlalloc.o comintf.o comerror.o + +-all: libcamlidl.a ++all: dllcamlidl.so libcamlidl.a ++ ++dllcamlidl.so: $(OBJS) ++ - rm -f $@ ++ ocamlmklib -o camlidl $(OBJS) + + libcamlidl.a: $(OBJS) + - rm -f $@ +@@ -24,6 +28,7 @@ + install: + cp camlidlruntime.h $(OCAMLLIB)/caml/camlidlruntime.h + cp libcamlidl.a $(OCAMLLIB)/libcamlidl.a ++ cp dllcamlidl.so $(OCAMLLIB)/stublibs/dllcamlidl.so + cd $(OCAMLLIB); $(RANLIB) libcamlidl.a + + clean: diff --git a/patches/camlidl/camlidl.install.1.05 b/patches/camlidl/camlidl.install.1.05 new file mode 100644 index 0000000..a4abb65 --- /dev/null +++ b/patches/camlidl/camlidl.install.1.05 @@ -0,0 +1,19 @@ +bin: [ + "?compiler/camlidl" + "?compiler/camlidl.exe" +] +lib: [ + "META" + "lib/com.cma" + "lib/com.cmxa" + "lib/com.cmi" + "?lib/com.a" + "?lib/com.lib" + "?runtime/libcamlidl.a" + "?runtime/libcamlidl.lib" + "?runtime/cfactory.obj" + "runtime/camlidlruntime.h" { "caml/camlidlruntime.h" } +] +stublibs: [ + "?runtime/dllcamlidl.so" +] diff --git a/patches/camlidl/camlidl.install.1.07 b/patches/camlidl/camlidl.install.1.07 new file mode 100644 index 0000000..89d2748 --- /dev/null +++ b/patches/camlidl/camlidl.install.1.07 @@ -0,0 +1,21 @@ +bin: [ + "?compiler/camlidl" + "?compiler/camlidl.exe" +] +lib: [ + "META" + "lib/com.cma" + "lib/com.cmxa" + "lib/com.cmi" + "?lib/com.a" + "?lib/com.lib" + "?runtime/libcamlidl.a" + "?runtime/libcamlidl.lib" + "?runtime/cfactory.obj" + "?runtime/cfactory.o" + "runtime/camlidlruntime.h" { "caml/camlidlruntime.h" } +] +stublibs: [ + "?runtime/dllcamlidl.so" + "?runtime/dllcamlidl.dll" +] diff --git a/patches/camlidl/camlidl.install.1.09 b/patches/camlidl/camlidl.install.1.09 new file mode 100644 index 0000000..89d2748 --- /dev/null +++ b/patches/camlidl/camlidl.install.1.09 @@ -0,0 +1,21 @@ +bin: [ + "?compiler/camlidl" + "?compiler/camlidl.exe" +] +lib: [ + "META" + "lib/com.cma" + "lib/com.cmxa" + "lib/com.cmi" + "?lib/com.a" + "?lib/com.lib" + "?runtime/libcamlidl.a" + "?runtime/libcamlidl.lib" + "?runtime/cfactory.obj" + "?runtime/cfactory.o" + "runtime/camlidlruntime.h" { "caml/camlidlruntime.h" } +] +stublibs: [ + "?runtime/dllcamlidl.so" + "?runtime/dllcamlidl.dll" +] diff --git a/patches/camlidl/camlidl.install.1.10 b/patches/camlidl/camlidl.install.1.10 new file mode 100644 index 0000000..89d2748 --- /dev/null +++ b/patches/camlidl/camlidl.install.1.10 @@ -0,0 +1,21 @@ +bin: [ + "?compiler/camlidl" + "?compiler/camlidl.exe" +] +lib: [ + "META" + "lib/com.cma" + "lib/com.cmxa" + "lib/com.cmi" + "?lib/com.a" + "?lib/com.lib" + "?runtime/libcamlidl.a" + "?runtime/libcamlidl.lib" + "?runtime/cfactory.obj" + "?runtime/cfactory.o" + "runtime/camlidlruntime.h" { "caml/camlidlruntime.h" } +] +stublibs: [ + "?runtime/dllcamlidl.so" + "?runtime/dllcamlidl.dll" +] diff --git a/patches/camlidl/camlidl.install.1.11 b/patches/camlidl/camlidl.install.1.11 new file mode 100644 index 0000000..89d2748 --- /dev/null +++ b/patches/camlidl/camlidl.install.1.11 @@ -0,0 +1,21 @@ +bin: [ + "?compiler/camlidl" + "?compiler/camlidl.exe" +] +lib: [ + "META" + "lib/com.cma" + "lib/com.cmxa" + "lib/com.cmi" + "?lib/com.a" + "?lib/com.lib" + "?runtime/libcamlidl.a" + "?runtime/libcamlidl.lib" + "?runtime/cfactory.obj" + "?runtime/cfactory.o" + "runtime/camlidlruntime.h" { "caml/camlidlruntime.h" } +] +stublibs: [ + "?runtime/dllcamlidl.so" + "?runtime/dllcamlidl.dll" +] diff --git a/patches/camlidl/camlidl.install.1.12 b/patches/camlidl/camlidl.install.1.12 new file mode 100644 index 0000000..89d2748 --- /dev/null +++ b/patches/camlidl/camlidl.install.1.12 @@ -0,0 +1,21 @@ +bin: [ + "?compiler/camlidl" + "?compiler/camlidl.exe" +] +lib: [ + "META" + "lib/com.cma" + "lib/com.cmxa" + "lib/com.cmi" + "?lib/com.a" + "?lib/com.lib" + "?runtime/libcamlidl.a" + "?runtime/libcamlidl.lib" + "?runtime/cfactory.obj" + "?runtime/cfactory.o" + "runtime/camlidlruntime.h" { "caml/camlidlruntime.h" } +] +stublibs: [ + "?runtime/dllcamlidl.so" + "?runtime/dllcamlidl.dll" +] diff --git a/patches/camlidl/cpp-location.diff b/patches/camlidl/cpp-location.diff new file mode 100644 index 0000000..a9770fb --- /dev/null +++ b/patches/camlidl/cpp-location.diff @@ -0,0 +1,15 @@ +diff -Naur camlidl-1.05/config/Makefile.unix camlidl-1.05-patched/config/Makefile.unix +--- camlidl-1.05/config/Makefile.unix 2002-04-22 12:50:46.000000000 +0100 ++++ camlidl-1.05-patched/config/Makefile.unix 2013-04-09 13:43:56.751790572 +0100 +@@ -19,9 +19,9 @@ + + # How to invoke the C preprocessor + # Works on most Unix systems: +-CPP=/lib/cpp ++CPP=cpp + # Alternatives: +-# CPP=cpp ++# CPP=/lib/cpp + # CPP=/usr/ccs/lib/cpp + # CPP=gcc -x c -E + diff --git a/patches/camlidl/disable-fatal-warn-31.diff b/patches/camlidl/disable-fatal-warn-31.diff new file mode 100644 index 0000000..a3c4f2b --- /dev/null +++ b/patches/camlidl/disable-fatal-warn-31.diff @@ -0,0 +1,24 @@ +diff -Naur camlidl-1.05/config/Makefile.unix camlidl-1.05-patched/config/Makefile.unix +--- camlidl-1.05/config/Makefile.unix 2002-04-22 12:50:46.000000000 +0100 ++++ camlidl-1.05-patched/config/Makefile.unix 2016-05-04 13:10:23.370704022 +0100 +@@ -37,7 +37,7 @@ + BINDIR=/usr/local/bin + + # The Objective Caml compilers (the defaults below should be OK) +-OCAMLC=ocamlc -g ++OCAMLC=ocamlc -g -warn-error -31 + OCAMLOPT=ocamlopt + OCAMLYACC=ocamlyacc -v + OCAMLLEX=ocamllex +diff -Naur camlidl-1.05/config/Makefile.win32 camlidl-1.05-patched/config/Makefile.win32 +--- camlidl-1.05/config/Makefile.win32 2004-07-08 13:21:58.000000000 +0100 ++++ camlidl-1.05-patched/config/Makefile.win32 2016-05-04 13:10:23.370704022 +0100 +@@ -35,7 +35,7 @@ + BINDIR=C:/ocaml/bin + + # The Objective Caml compilers (the defaults below should be OK) +-OCAMLC=ocamlc -g ++OCAMLC=ocamlc -g -warn-error -31 + OCAMLOPT=ocamlopt + OCAMLDEP=ocamldep + OCAMLYACC=ocamlyacc -v diff --git a/patches/camlimages/camlimages.4.1.0.build_fix.patch b/patches/camlimages/camlimages.4.1.0.build_fix.patch new file mode 100644 index 0000000..c70bd4b --- /dev/null +++ b/patches/camlimages/camlimages.4.1.0.build_fix.patch @@ -0,0 +1,12 @@ +diff -r a2601916858d -r 7577cdfdb47b OMakefile +--- a/OMakefile Fri Jun 09 16:58:14 2017 +0900 ++++ b/OMakefile Wed Aug 23 16:32:06 2017 +0900 +@@ -214,7 +214,7 @@ + + # PS + SUPPORT_PS=false +- $(Check_prog_in_path gs) ++ DUMMY=$(Check_prog_in_path gs) + PATH_GS=$(WHERE) + LDFLAGS_ps= + if $(true_if_not_defined ARG_WANT_GS) diff --git a/patches/camlmix/camlmix.install b/patches/camlmix/camlmix.install new file mode 100644 index 0000000..a42e765 --- /dev/null +++ b/patches/camlmix/camlmix.install @@ -0,0 +1 @@ +bin: ["camlmix"] diff --git a/patches/camlp4/f0ea53725465260556832398096cef8d3f20b49d.patch b/patches/camlp4/f0ea53725465260556832398096cef8d3f20b49d.patch new file mode 100644 index 0000000..56b87ed --- /dev/null +++ b/patches/camlp4/f0ea53725465260556832398096cef8d3f20b49d.patch @@ -0,0 +1,28 @@ +From f0ea53725465260556832398096cef8d3f20b49d Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Mon, 8 Jan 2018 12:59:08 +0000 +Subject: [PATCH] Fix make byte for systems with no natdynlink + +2a31a83 builds a native-code preprocessor if ocamlbuild supports native +code. However, it's possible to have systems which support native code but +don't have natdynlink (e.g. Cygwin without flexdll support) and in this +case the build fails. + +Signed-off-by: David Allsopp +--- + myocamlbuild.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/myocamlbuild.ml b/myocamlbuild.ml +index 7264df134..ecaac916f 100644 +--- a/myocamlbuild.ml ++++ b/myocamlbuild.ml +@@ -76,7 +76,7 @@ let () = + else + let exe = + "camlp4boot" ^ +- if !Options.native_plugin then ++ if C.ocamlnat then + (* If we are using a native plugin, we might as well use a native + preprocessor. *) + ".native" diff --git a/patches/camlp4/safe-string.patch b/patches/camlp4/safe-string.patch new file mode 100644 index 0000000..1fdb2a6 --- /dev/null +++ b/patches/camlp4/safe-string.patch @@ -0,0 +1,79 @@ +diff --git a/_tags b/_tags +index 7a29e8aa4..e2124eaa5 100644 +--- a/_tags ++++ b/_tags +@@ -17,6 +17,9 @@ + # We want -g everywhere it's possible + true: debug + ++# Enforce safe-string ++true: safe_string ++ + : use_import + : use_dynlink + : use_ocamlcommon +diff --git a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml +index c7e57a1b3..8e270af21 100644 +--- a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml ++++ b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml +@@ -77,15 +77,16 @@ module Make (Ast : Sig.Camlp4Ast) = struct + ; + + value remove_underscores s = +- let l = String.length s in ++ let s = Bytes.of_string s in ++ let l = Bytes.length s in + let rec remove src dst = + if src >= l then +- if dst >= l then s else String.sub s 0 dst ++ if dst >= l then s else Bytes.sub s 0 dst + else +- match s.[src] with ++ match Bytes.get s src with + [ '_' -> remove (src + 1) dst + | c -> do { Bytes.set s dst c; remove (src + 1) (dst + 1) } ] +- in remove 0 0 ++ in Bytes.to_string (remove 0 0) + ; + + value mkloc = Loc.to_ocaml_location; +diff --git a/camlp4/Camlp4Parsers/Camlp4AstLoader.ml b/camlp4/Camlp4Parsers/Camlp4AstLoader.ml +index 7347a15e0..dfc60053b 100644 +--- a/camlp4/Camlp4Parsers/Camlp4AstLoader.ml ++++ b/camlp4/Camlp4Parsers/Camlp4AstLoader.ml +@@ -32,9 +32,8 @@ module Make (Ast : Camlp4.Sig.Ast) = struct + let () = Stream.iter (Buffer.add_char buf) strm + in Buffer.contents buf in + let magic_len = String.length ast_magic in +- let buffer = String.create magic_len in + do { +- String.blit str 0 buffer 0 magic_len; ++ let buffer = String.sub str 0 magic_len; + if buffer = ast_magic then () + else failwith (Format.sprintf "Bad magic: %S vs %S" buffer ast_magic); + Marshal.from_string str magic_len; +diff --git a/camlp4/boot/Camlp4.ml b/camlp4/boot/Camlp4.ml +index 44dfe6c39..2adc84762 100644 +--- a/camlp4/boot/Camlp4.ml ++++ b/camlp4/boot/Camlp4.ml +@@ -15410,15 +15410,16 @@ module Struct = + with | (Failure _ as exn) -> Loc.raise loc exn + + let remove_underscores s = +- let l = String.length s in ++ let s = Bytes.of_string s in ++ let l = Bytes.length s in + let rec remove src dst = + if src >= l +- then if dst >= l then s else String.sub s 0 dst ++ then if dst >= l then s else Bytes.sub s 0 dst + else +- (match s.[src] with ++ (match Bytes.get s src with + | '_' -> remove (src + 1) dst + | c -> (Bytes.set s dst c; remove (src + 1) (dst + 1))) +- in remove 0 0 ++ in Bytes.to_string (remove 0 0) + + let mkloc = Loc.to_ocaml_location + diff --git a/patches/camlp4/termux.patch b/patches/camlp4/termux.patch new file mode 100644 index 0000000..271191a --- /dev/null +++ b/patches/camlp4/termux.patch @@ -0,0 +1,40 @@ +diff --git a/Makefile b/Makefile +index 1210145..b9225f6 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,18 +10,18 @@ default: byte + + .PHONY: byte + byte: +- $(OB) `./build/camlp4-byte-only.sh` ++ $(OB) `sh ./build/camlp4-byte-only.sh` + + .PHONY: native + native: +- $(OB) `./build/camlp4-native-only.sh` ++ $(OB) `sh ./build/camlp4-native-only.sh` + + .PHONY: all + all: byte native + + .PHONY: install + install: +- env DESTDIR=$(DESTDIR) ./build/install.sh ++ env DESTDIR=$(DESTDIR) sh ./build/install.sh + + .PHONY: install-META + install-META: camlp4/META +@@ -33,11 +33,11 @@ camlp4/META: camlp4/META.in + + .PHONY: bootstrap + bootstrap: +- ./build/camlp4-bootstrap.sh ++ sh ./build/camlp4-bootstrap.sh + + .PHONY: Camlp4Ast + Camlp4Ast: +- ./build/camlp4-mkCamlp4Ast.sh ++ sh ./build/camlp4-mkCamlp4Ast.sh + + .PHONY: clean + clean: diff --git a/patches/camlp5/camlp5.install.6.04 b/patches/camlp5/camlp5.install.6.04 new file mode 100644 index 0000000..618242c --- /dev/null +++ b/patches/camlp5/camlp5.install.6.04 @@ -0,0 +1,11 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] diff --git a/patches/camlp5/camlp5.install.6.06 b/patches/camlp5/camlp5.install.6.06 new file mode 100644 index 0000000..618242c --- /dev/null +++ b/patches/camlp5/camlp5.install.6.06 @@ -0,0 +1,11 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] diff --git a/patches/camlp5/camlp5.install.6.07 b/patches/camlp5/camlp5.install.6.07 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.07 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.6.11 b/patches/camlp5/camlp5.install.6.11 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.11 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.6.12 b/patches/camlp5/camlp5.install.6.12 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.12 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.6.13 b/patches/camlp5/camlp5.install.6.13 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.13 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.6.14 b/patches/camlp5/camlp5.install.6.14 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.14 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.6.15 b/patches/camlp5/camlp5.install.6.15 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.15 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.6.16 b/patches/camlp5/camlp5.install.6.16 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.16 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.6.17 b/patches/camlp5/camlp5.install.6.17 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.6.17 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.7.00 b/patches/camlp5/camlp5.install.7.00 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.7.00 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.7.01 b/patches/camlp5/camlp5.install.7.01 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.7.01 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.7.03 b/patches/camlp5/camlp5.install.7.03 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.7.03 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.7.05 b/patches/camlp5/camlp5.install.7.05 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.7.05 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.7.06 b/patches/camlp5/camlp5.install.7.06 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.7.06 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.7.06.10-g84ce6cc4 b/patches/camlp5/camlp5.install.7.06.10-g84ce6cc4 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.7.06.10-g84ce6cc4 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlp5/camlp5.install.7.08 b/patches/camlp5/camlp5.install.7.08 new file mode 100644 index 0000000..6033034 --- /dev/null +++ b/patches/camlp5/camlp5.install.7.08 @@ -0,0 +1,12 @@ +bin: [ + "ocpp/ocpp" {"ocpp5"} + "etc/mkcamlp5.opt.sh" {"mkcamlp5.opt"} + "etc/mkcamlp5.sh" {"mkcamlp5"} + "etc/camlp5sch" + "meta/camlp5r.opt" + "boot/camlp5r" + "compile/camlp5o.fast.opt" {"camlp5o.opt"} + "etc/camlp5o" + "boot/camlp5" +] +lib: ["etc/META"] diff --git a/patches/camlpdf/int.patch b/patches/camlpdf/int.patch new file mode 100644 index 0000000..7370dd9 --- /dev/null +++ b/patches/camlpdf/int.patch @@ -0,0 +1,20 @@ +--- a/flatestubs.c 2016-03-13 20:03:44.000000000 +0000 ++++ b/flatestubs.c 2016-03-13 20:02:13.000000000 +0000 +@@ -19,6 +19,8 @@ + + #include "miniz.c" //Modified to use miniz.c rather than zlib + ++#include ++ + #include + #include + #include +@@ -170,7 +172,7 @@ + + value camlzip_update_crc32(value crc, value buf, value pos, value len) + { +- return copy_int32(crc32((uint32) Int32_val(crc), ++ return copy_int32(crc32((uint32_t) Int32_val(crc), + &Byte_u(buf, Long_val(pos)), + Long_val(len))); + } diff --git a/patches/camlpdf/unsafe_string.patch b/patches/camlpdf/unsafe_string.patch new file mode 100644 index 0000000..61143e8 --- /dev/null +++ b/patches/camlpdf/unsafe_string.patch @@ -0,0 +1,13 @@ +--- ../Makefile.orig 2018-04-21 20:13:49.022952632 +0200 ++++ ../Makefile 2018-04-21 20:14:10.727065199 +0200 +@@ -15,8 +15,8 @@ + dllcamlpdf_stubs.* $(foreach x,$(PDFMODS),$x.mli) \ + $(foreach x,$(PDFMODS),$x.cmi) $(foreach x,$(PDFMODS),$x.cmx) + +-OCAMLNCFLAGS = -g -annot -w -3 +-OCAMLBCFLAGS = -g -annot -w -3 ++OCAMLNCFLAGS = -g -annot -w -3 -unsafe-string ++OCAMLBCFLAGS = -g -annot -w -3 -unsafe-string + OCAMLLDFLAGS = -g + + all : native-code-library byte-code-library htdoc diff --git a/patches/camltc/osx.patch b/patches/camltc/osx.patch new file mode 100644 index 0000000..58a1cae --- /dev/null +++ b/patches/camltc/osx.patch @@ -0,0 +1,31 @@ +diff --git a/src/dune b/src/dune +index be85e03..05d61a4 100644 +--- a/src/dune ++++ b/src/dune +@@ -9,6 +9,7 @@ + (flags -w -27) + (c_names otc_wrapper) + (c_flags -O2 -I 3rd-party/tokyocabinet) ++ (modes native) + ) + + (library +@@ -16,15 +17,15 @@ + (public_name camltc.tc) + (self_build_stubs_archive (tc)) + (modules) ++ (modes native) + ) + + (rule +- (targets libtc_stubs.a dlltc_stubs.so) ++ (targets libtc_stubs.a) + (action + (bash " + (../../../src/3rd-party/tokyocabinet/configure --disable-bzip --disable-zlib +- make libtokyocabinet.so libtokyocabinet.a -j $(nproc)) > /dev/null 2>&1 +- cp libtokyocabinet.so dlltc_stubs.so ++ make libtokyocabinet.a) > /dev/null 2>&1 + cp libtokyocabinet.a libtc_stubs.a ") + ) + ) diff --git a/patches/camlzip/META.1.04 b/patches/camlzip/META.1.04 new file mode 100644 index 0000000..8477cae --- /dev/null +++ b/patches/camlzip/META.1.04 @@ -0,0 +1,7 @@ +name="zip" +version="1.04" +description="reading and writing ZIP, JAR and GZIP files" +requires="unix" +archive(byte)="zip.cma" +archive(native)="zip.cmxa" +archive(native,plugin)="zip.cmxs" \ No newline at end of file diff --git a/patches/camlzip/build_with_trunk.patch.1.05 b/patches/camlzip/build_with_trunk.patch.1.05 new file mode 100644 index 0000000..63be17e --- /dev/null +++ b/patches/camlzip/build_with_trunk.patch.1.05 @@ -0,0 +1,33 @@ +Seulement dans camlzip-1.05_/: dllcamlzip.so +diff -ru camlzip-1.05/zip.ml camlzip-1.05_/zip.ml +--- camlzip-1.05/zip.ml 2012-10-12 05:36:07.000000000 +0200 ++++ camlzip-1.05_/zip.ml 2015-02-27 15:03:45.184500352 +0100 +@@ -73,8 +73,6 @@ + mutable of_entries: entry list; + of_comment: string } + +-exception Error of string * string * string +- + (* Return the position of the last occurrence of s1 in s2, or -1 if not + found. *) + +diff -ru camlzip-1.05/zlibstubs.c camlzip-1.05_/zlibstubs.c +--- camlzip-1.05/zlibstubs.c 2012-10-12 05:36:07.000000000 +0200 ++++ camlzip-1.05_/zlibstubs.c 2015-02-27 15:02:49.160684643 +0100 +@@ -16,6 +16,7 @@ + /* Stub code to interface with Zlib */ + + #include ++#include + + #include + #include +@@ -168,7 +169,7 @@ + + value camlzip_update_crc32(value crc, value buf, value pos, value len) + { +- return caml_copy_int32(crc32((uint32) Int32_val(crc), ++ return caml_copy_int32(crc32((uint32_t) Int32_val(crc), + &Byte_u(buf, Long_val(pos)), + Long_val(len))); + } diff --git a/patches/camlzip/build_with_trunk.patch.1.06 b/patches/camlzip/build_with_trunk.patch.1.06 new file mode 100644 index 0000000..a25f1a5 --- /dev/null +++ b/patches/camlzip/build_with_trunk.patch.1.06 @@ -0,0 +1,33 @@ +From ef04e8b8b440a7012f5eb21b55eb89d138758097 Mon Sep 17 00:00:00 2001 +From: Etienne Millon +Date: Thu, 1 Sep 2016 11:14:25 +0200 +Subject: [PATCH 2/2] build_with_trunk + +--- + zlibstubs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/zlibstubs.c b/zlibstubs.c +index 661729a..b4e6c61 100644 +--- a/zlibstubs.c ++++ b/zlibstubs.c +@@ -17,6 +17,7 @@ + + #include + #include ++#include + + #include + #include +@@ -169,7 +170,7 @@ value camlzip_inflateEnd(value vzs) + + value camlzip_update_crc32(value crc, value buf, value pos, value len) + { +- return caml_copy_int32(crc32((uint32_t) Int32_val(crc), ++ return caml_copy_int32(crc32((uint32_t) Int32_val(crc), + &Byte_u(buf, Long_val(pos)), + Long_val(len))); + } +-- +2.9.3 + diff --git a/patches/camlzip/camlzip-install.diff b/patches/camlzip/camlzip-install.diff new file mode 100644 index 0000000..7687d2d --- /dev/null +++ b/patches/camlzip/camlzip-install.diff @@ -0,0 +1,42 @@ +--- Makefile.orig 2012-10-10 10:52:34.000000000 -0700 ++++ Makefile 2012-10-12 16:10:07.957606060 -0700 +@@ -25,7 +25,7 @@ + + all: libcamlzip.a zip.cma + +-allopt: libcamlzip.a zip.cmxa ++allopt: libcamlzip.a zip.cmxa zip.cmxs + + zip.cma: $(OBJS) + $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS) \ +@@ -35,6 +35,9 @@ + $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS:.cmo=.cmx) \ + -L$(ZLIB_LIBDIR) $(ZLIB_LIB) + ++zip.cmxs: zip.cmxa ++ $(OCAMLOPT) -I . -shared -linkall -o zip.cmxs zip.cmxa ++ + libcamlzip.a: $(C_OBJS) + $(OCAMLMKLIB) -oc camlzip $(C_OBJS) \ + -L$(ZLIB_LIBDIR) $(ZLIB_LIB) +@@ -55,18 +58,8 @@ + rm -f *.o *.a + + install: +- mkdir -p $(INSTALLDIR) +- cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR) +- if test -f dllcamlzip.so; then \ +- cp dllcamlzip.so $(INSTALLDIR); \ +- ldconf=`$(OCAMLC) -where`/ld.conf; \ +- installdir=$(INSTALLDIR); \ +- if test `grep -s -c $$installdir'$$' $$ldconf || :` = 0; \ +- then echo $$installdir >> $$ldconf; fi \ +- fi +- +-installopt: +- cp zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR) ++ ocamlfind install camlzip META zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a \ ++ -optional dllcamlzip.so zip.cmxa zip.cmxs zip.a zip.cmx gzip.cmx + + depend: + gcc -MM -I$(ZLIB_INCLUDE) *.c > .depend \ No newline at end of file diff --git a/patches/camlzip/camlzip.install b/patches/camlzip/camlzip.install new file mode 100644 index 0000000..782e9a1 --- /dev/null +++ b/patches/camlzip/camlzip.install @@ -0,0 +1,5 @@ +lib: [ + "META" + "zlib.cmi" + "zlib.cmx" +] diff --git a/patches/camlzip/fix-install.patch.1.05 b/patches/camlzip/fix-install.patch.1.05 new file mode 100644 index 0000000..923bcff --- /dev/null +++ b/patches/camlzip/fix-install.patch.1.05 @@ -0,0 +1,63 @@ +diff --git a/META b/META +index 9ea2d10..1d993e4 100644 +--- a/META ++++ b/META +@@ -2,3 +2,4 @@ version="1.05" + requires="unix" + archive(byte)="zip.cma" + archive(native)="zip.cmxa" ++archive(native,plugin)="zip.cmxs" +diff --git a/Makefile b/Makefile +index a9f7178..736b427 100644 +--- a/Makefile ++++ b/Makefile +@@ -23,9 +23,15 @@ OCAMLMKLIB=ocamlmklib + OBJS=zlib.cmo zip.cmo gzip.cmo + C_OBJS=zlibstubs.o + ++NATDYNLINK := $(shell if [ -f `ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi) ++ ++ifeq "${NATDYNLINK}" "YES" ++CMXS = zip.cmxs ++endif ++ + all: libcamlzip.a zip.cma + +-allopt: libcamlzip.a zip.cmxa ++allopt: libcamlzip.a zip.cmxa $(CMXS) + + zip.cma: $(OBJS) + $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS) \ +@@ -35,6 +41,9 @@ zip.cmxa: $(OBJS:.cmo=.cmx) + $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS:.cmo=.cmx) \ + -L$(ZLIB_LIBDIR) $(ZLIB_LIB) + ++zip.cmxs: zip.cmxa ++ $(OCAMLOPT) -shared -linkall -I ./ -o $@ $^ ++ + libcamlzip.a: $(C_OBJS) + $(OCAMLMKLIB) -oc camlzip $(C_OBJS) \ + -L$(ZLIB_LIBDIR) $(ZLIB_LIB) +@@ -56,7 +65,7 @@ clean: + + install: + mkdir -p $(INSTALLDIR) +- cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR) ++ cp zip.cma zip.cmi gzip.cmi zlib.cmi zip.mli gzip.mli zlib.mli libcamlzip.a $(INSTALLDIR) + if test -f dllcamlzip.so; then \ + cp dllcamlzip.so $(INSTALLDIR); \ + ldconf=`$(OCAMLC) -where`/ld.conf; \ +@@ -66,10 +75,11 @@ install: + fi + + installopt: +- cp zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR) ++ cp zip.cmxa $(CMXS) zip.a zip.cmx gzip.cmx zlib.cmx $(INSTALLDIR) + + install-findlib: +- ocamlfind install zip META *.mli *.a *.cmi *.cma $(wildcard *.cmxa) $(wildcard *.so) ++ ocamlfind install zip META *.mli *.a *.cmi *.cma $(wildcard *.cmx) $(wildcard *.cmxa) $(wildcard *.cmxs) $(wildcard *.so) ++ echo 'directory="../zip"' >> META && ocamlfind install camlzip META + + depend: + gcc -MM -I$(ZLIB_INCLUDE) *.c > .depend diff --git a/patches/camlzip/fix-install.patch.1.06 b/patches/camlzip/fix-install.patch.1.06 new file mode 100644 index 0000000..e6a0790 --- /dev/null +++ b/patches/camlzip/fix-install.patch.1.06 @@ -0,0 +1,76 @@ +From e13f6c12aa9f4a17111b21d0874a78d207e0244b Mon Sep 17 00:00:00 2001 +From: Etienne Millon +Date: Thu, 1 Sep 2016 11:13:41 +0200 +Subject: [PATCH 1/2] fix-install + +--- + META | 1 + + Makefile | 18 ++++++++++++++---- + 2 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/META b/META +index cc4c1b3..05c85fa 100644 +--- a/META ++++ b/META +@@ -2,3 +2,4 @@ version="1.06" + requires="unix" + archive(byte)="zip.cma" + archive(native)="zip.cmxa" ++archive(native,plugin)="zip.cmxs" +diff --git a/Makefile b/Makefile +index 1e1503f..8f2fba9 100644 +--- a/Makefile ++++ b/Makefile +@@ -25,9 +25,15 @@ OCAMLMKLIB=ocamlmklib + OBJS=zlib.cmo zip.cmo gzip.cmo + C_OBJS=zlibstubs.o + ++NATDYNLINK := $(shell if [ -f `ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi) ++ ++ifeq "${NATDYNLINK}" "YES" ++CMXS = zip.cmxs ++endif ++ + all: libcamlzip.a zip.cma + +-allopt: libcamlzip.a zip.cmxa ++allopt: libcamlzip.a zip.cmxa $(CMXS) + + zip.cma: $(OBJS) + $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS) \ +@@ -37,6 +43,9 @@ zip.cmxa: $(OBJS:.cmo=.cmx) + $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS:.cmo=.cmx) \ + -L$(ZLIB_LIBDIR) $(ZLIB_LIB) + ++zip.cmxs: zip.cmxa ++ $(OCAMLOPT) -shared -linkall -I ./ -o $@ $^ ++ + libcamlzip.a: $(C_OBJS) + $(OCAMLMKLIB) -oc camlzip $(C_OBJS) \ + -L$(ZLIB_LIBDIR) $(ZLIB_LIB) +@@ -58,7 +67,7 @@ clean: + + install: + mkdir -p $(INSTALLDIR) +- cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR) ++ cp zip.cma zip.cmi gzip.cmi zlib.cmi zip.mli gzip.mli zlib.mli libcamlzip.a $(INSTALLDIR) + if test -f dllcamlzip.so; then \ + cp dllcamlzip.so $(INSTALLDIR); \ + ldconf=`$(OCAMLC) -where`/ld.conf; \ +@@ -68,10 +77,11 @@ install: + fi + + installopt: +- cp zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR) ++ cp zip.cmxa $(CMXS) zip.a zip.cmx gzip.cmx zlib.cmx $(INSTALLDIR) + + install-findlib: +- ocamlfind install zip META *.mli *.a *.cmi *.cma $(wildcard *.cmxa) $(wildcard *.so) ++ ocamlfind install zip META *.mli *.a *.cmi *.cma $(wildcard *.cmx) $(wildcard *.cmxa) $(wildcard *.cmxs) $(wildcard *.so) ++ echo 'directory="../zip"' >> META && ocamlfind install camlzip META + + depend: + gcc -MM -I$(ZLIB_INCLUDE) *.c > .depend +-- +2.9.3 + diff --git a/patches/camlzip/no-L.patch b/patches/camlzip/no-L.patch new file mode 100644 index 0000000..1196334 --- /dev/null +++ b/patches/camlzip/no-L.patch @@ -0,0 +1,52 @@ +commit 66bf764adf66ded8c47717b816742fbf2df09b12 +Author: Thomas Gazagnaire +Date: Tue Nov 15 10:40:40 2016 +0000 + + Do not add -L to the cm{x}a + + This breaks on OSX when using libffi and ctypes, as ctypes requires + the version of libffi installed by brew, not the system one (installed + in /usr/lib`). + + As we have no way to keep the order of linker flags (due to + https://caml.inria.fr/mantis/view.php?id=7150) it is safer to just not + use -L if possible. In the case of camlzip, this doesn't seem needed. + +diff --git a/Makefile b/Makefile +index 8f2fba9..37daba2 100644 +--- a/Makefile ++++ b/Makefile +@@ -3,10 +3,6 @@ + # The name of the Zlib library. Usually -lz + ZLIB_LIB=-lz + +-# The directory containing the Zlib library (libz.a or libz.so) +-ZLIB_LIBDIR=/usr/lib +-# ZLIB_LIBDIR=/usr/local/lib +- + # The directory containing the Zlib header file (zlib.h) + ZLIB_INCLUDE=/usr/include + # ZLIB_INCLUDE=/usr/local/include +@@ -36,19 +32,16 @@ all: libcamlzip.a zip.cma + allopt: libcamlzip.a zip.cmxa $(CMXS) + + zip.cma: $(OBJS) +- $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS) \ +- -L$(ZLIB_LIBDIR) $(ZLIB_LIB) ++ $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS) $(ZLIB_LIB) + + zip.cmxa: $(OBJS:.cmo=.cmx) +- $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS:.cmo=.cmx) \ +- -L$(ZLIB_LIBDIR) $(ZLIB_LIB) ++ $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS:.cmo=.cmx) $(ZLIB_LIB) + + zip.cmxs: zip.cmxa + $(OCAMLOPT) -shared -linkall -I ./ -o $@ $^ + + libcamlzip.a: $(C_OBJS) +- $(OCAMLMKLIB) -oc camlzip $(C_OBJS) \ +- -L$(ZLIB_LIBDIR) $(ZLIB_LIB) ++ $(OCAMLMKLIB) -oc camlzip $(C_OBJS) $(ZLIB_LIB) + + .SUFFIXES: .mli .ml .cmo .cmi .cmx + diff --git a/patches/camomile/4.05-typing-fix.patch b/patches/camomile/4.05-typing-fix.patch new file mode 100644 index 0000000..178e4d1 --- /dev/null +++ b/patches/camomile/4.05-typing-fix.patch @@ -0,0 +1,43 @@ +From 0fa0a19f15998e89e4b04150dd74529bbd406f42 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Fri, 24 Feb 2017 22:30:23 -0500 +Subject: [PATCH] 4.05 compatibility: use explicit module signatures + +In 4.05, checking for non-generalizable inference variable ('_a) +(forbidden in toplevel modules and functors) happens before checking +the .ml file against the .mli signature, so non-generalizable +variables that were previously resolved through the .mli constraint +are now underspecified and result in a compilation failure +(see MPR#7414, GPR#929). This commit adds enough annotations to avoid +such underspecified variables in functors. +--- + internal/unimap.ml | 2 +- + public/uCharInfo.ml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/internal/unimap.ml b/internal/unimap.ml +index b6fdbde..6a7cc30 100644 +--- a/internal/unimap.ml ++++ b/internal/unimap.ml +@@ -58,7 +58,7 @@ val of_name : string -> t + end + + +-module Make (Config : ConfigInt.Type) = struct ++module Make (Config : ConfigInt.Type) : Type = struct + + type mapping = {no_char : int; tbl : Tbl31.Bytes.t} + +diff --git a/public/uCharInfo.ml b/public/uCharInfo.ml +index 69bf141..6a0337a 100644 +--- a/public/uCharInfo.ml ++++ b/public/uCharInfo.ml +@@ -298,7 +298,7 @@ val load_composition_exclusion_tbl : unit -> UCharTbl.Bool.t + + end + +-module Make (Config : ConfigInt.Type) = struct ++module Make (Config : ConfigInt.Type) : Type = struct + include Unidata.Make(Config) + + (* General category *) diff --git a/patches/camomile/cmx.patch b/patches/camomile/cmx.patch new file mode 100644 index 0000000..b9ff0d1 --- /dev/null +++ b/patches/camomile/cmx.patch @@ -0,0 +1,15 @@ +diff --git a/Makefile.in b/Makefile.in +index 56a2597..f24253b 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -399,8 +399,8 @@ install-without-ocamlfind: + if [ -f camomile.a ]; then cp -f camomile.a '$(OCAMLLIB)'; fi + + install-with-ocamlfind: +- files= &&\ +- if [ -f camomileLibrary.cmx ]; then files=camomileLibrary.cmx; fi && \ ++ files="$(wildcard public/*.cmx internal/*.cmx)" &&\ ++ if [ -f camomileLibrary.cmx ]; then files="camomileLibrary.cmx $$files"; fi && \ + if [ -f camomileLibrary.cma ]; then files="camomileLibrary.cma $$files"; fi && \ + if [ -f camomileLibrary.cmxa ]; then files="camomileLibrary.cmxa $$files"; fi && \ + if [ -f camomileLibraryDefault.cmx ]; then files="camomileLibraryDefault.cmx $$files"; fi && \ diff --git a/patches/camomile/cmxs.patch b/patches/camomile/cmxs.patch new file mode 100644 index 0000000..bed9673 --- /dev/null +++ b/patches/camomile/cmxs.patch @@ -0,0 +1,57 @@ +diff --git a/META.in b/META.in +index a231f19..18a8229 100644 +--- a/META.in ++++ b/META.in +@@ -5,4 +5,5 @@ requires="bigarray" + + archive(byte)="camomile.cma" + archive(native)="camomile.cmxa" ++archive(native, plugin)="camomile.cmxs" + +diff --git a/Makefile.in b/Makefile.in +index 7afe20f..9dc8862 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -121,7 +121,7 @@ internal/uReStrParser.cmo : internal/uReStrParser.cmi + internal/uReStrParser.cmx : internal/uReStrParser.cmi + + byte : camomile.cma camomileLibrary.cma +-opt : camomile.cmxa camomileLibrary.cmxa ++opt : camomile.cmxa camomile.cmxs camomileLibrary.cmxa + + $(NOOBJ_INT:.cmi=.cmo) : %.cmo : %.mli %.cmi + $(OCAMLC) -c $(BFLAGS) -impl $< +@@ -139,6 +139,8 @@ camomile.cma : $(OBJECTS) camomileLibrary.cmo camomileLibraryDefault.cmo camomil + $(OCAMLC) -a -o camomile.cma $(OBJECTS) camomileLibrary.cmo camomileLibraryDefault.cmo camomileLibraryDyn.cmo + camomile.cmxa : $(OPTOBJECTS) camomileLibrary.cmx camomileLibraryDefault.cmx camomileLibraryDyn.cmx + $(OCAMLOPT) -a -o camomile.cmxa $(OPTOBJECTS) camomileLibrary.cmx camomileLibraryDefault.cmx camomileLibraryDyn.cmx ++camomile.cmxs : camomile.cmxa ++ $(OCAMLOPT) -shared -linkall -o camomile.cmxs camomile.cmxa + + camomileLibrary.cma : $(OBJECTS) camomileLibrary.cmo + $(OCAMLC) -a -o camomileLibrary.cma $(OBJECTS) camomileLibrary.cmo +@@ -401,6 +403,7 @@ install-without-ocamlfind: + if [ -f camomileLibraryDyn.cmx ]; then cp -f camomileLibraryDyn.cmx '$(OCAMLLIB)'; fi + if [ -f camomile.cma ]; then cp -f camomile.cma '$(OCAMLLIB)'; fi + if [ -f camomile.cmxa ]; then cp -f camomile.cmxa '$(OCAMLLIB)'; fi ++ if [ -f camomile.cmxs ]; then cp -f camomile.cmxs '$(OCAMLLIB)'; fi + if [ -f camomile.a ]; then cp -f camomile.a '$(OCAMLLIB)'; fi + + install-with-ocamlfind: +@@ -412,6 +415,7 @@ install-with-ocamlfind: + if [ -f camomileLibraryDyn.cmx ]; then files="camomileLibraryDyn.cmx $$files"; fi && \ + if [ -f camomile.cma ]; then files="camomile.cma $$files"; fi&& \ + if [ -f camomile.cmxa ]; then files="camomile.cmxa $$files"; fi&& \ ++ if [ -f camomile.cmxs ]; then files="camomile.cmxs $$files"; fi&& \ + if [ -f camomile.a ]; then files="camomile.a $$files"; fi && \ + ocamlfind install camomile $$files META $(MLI) camomileLibrary.cmi camomileLibraryDefault.cmi camomileLibraryDyn.cmi + +@@ -508,7 +512,7 @@ tags : + otags */*.ml */*.mli *.ml *.mli + + clean : +- rm -f *.cm[ioxa] *.cmxa *.o *.so *.a */*.cm[iox] */*.o pocaml\ ++ rm -f *.cm[ioxa] *.cmxa *.cmxs *.o *.so *.a */*.cm[iox] */*.o pocaml\ + */*.byte */*.opt + rm -f database/*.mar + rm -f charmaps/*.mar diff --git a/patches/camomile/no-camlp4.patch b/patches/camomile/no-camlp4.patch new file mode 100644 index 0000000..40288b5 --- /dev/null +++ b/patches/camomile/no-camlp4.patch @@ -0,0 +1,757 @@ +diff -urN camomile-0.8.5-orig/configure camomile-0.8.5/configure +--- camomile-0.8.5-orig/configure 2013-09-15 11:07:31.000000000 +0400 ++++ camomile-0.8.5/configure 2014-10-22 17:15:05.785847212 +0400 +@@ -2341,10 +2341,6 @@ + fi + + +-if test "$CAMLP4O" = no ; then +- as_fn_error $? "Cannot find camlp4o." "$LINENO" 5 +-fi +- + # Extract the first word of "ocamlfind", so it can be a program name with args. + set dummy ocamlfind; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +diff -urN camomile-0.8.5-orig/Makefile.in camomile-0.8.5/Makefile.in +--- camomile-0.8.5-orig/Makefile.in 2013-09-15 11:48:38.000000000 +0400 ++++ camomile-0.8.5/Makefile.in 2014-10-22 16:39:34.633832673 +0400 +@@ -41,7 +41,6 @@ + OCAMLLIB = @OCAMLLIB@ + OCAMLBEST= @OCAMLBEST@ + OCAMLVERSION = @OCAMLVERSION@ +-CAMLP4O = -pp "@CAMLP4O@ -I $(OCAMLLIB)" + INSTALL = @OCAMLINSTALL@ + UNINSTALL = un@OCAMLINSTALL@ + OCAMLDOC = @OCAMLDOC@ +@@ -214,12 +213,6 @@ + $(OPTTOOLS) : %.opt : toolslib.cmxa %.cmx + $(OCAMLOPT) $(OFLAGS) -o $@ $(OPTTOOLSLIB) $*.cmx + +-tools/camomilelocaledef.cmo : tools/camomilelocaledef.ml +- $(OCAMLC) $(CAMLP4O) -c $(BFLAGS) tools/camomilelocaledef.ml +- +-tools/camomilelocaledef.cmx : tools/camomilelocaledef.ml +- $(OCAMLOPT) $(CAMLP4O) -c $(OFLAGS) tools/camomilelocaledef.ml +- + # Compile unidata + ################################################################### + +@@ -536,7 +529,7 @@ + mappings/*.ml mappings/*.mli \ + toolslib/*.ml toolslib/*.mli \ + > .depend +- $(OCAMLDEP) $(CAMLP4O) $(SUBDIR) \ ++ $(OCAMLDEP) $(SUBDIR) \ + tools/$(TOOLS:.byte=.ml) >> .depend + + include .depend +diff -urN camomile-0.8.5-orig/tools/camomilelocaledef.ml camomile-0.8.5/tools/camomilelocaledef.ml +--- camomile-0.8.5-orig/tools/camomilelocaledef.ml 2012-10-12 15:51:14.000000000 +0400 ++++ camomile-0.8.5/tools/camomilelocaledef.ml 2014-10-22 16:30:25.000000000 +0400 +@@ -1,12 +1,9 @@ + (** Locale definition compiler *) +- + (* Copyright (C) 2002, 2003, 2011 Yamagata Yoriyuki *) +- + (* This library is free software; you can redistribute it and/or *) + (* modify it under the terms of the GNU Lesser General Public License *) + (* as published by the Free Software Foundation; either version 2 of *) + (* the License, or (at your option) any later version. *) +- + (* As a special exception to the GNU Library General Public License, you *) + (* may link, statically or dynamically, a "work that uses this library" *) + (* with a publicly distributed version of this library to produce an *) +@@ -20,221 +17,312 @@ + (* License. This exception does not however invalidate any other reasons *) + (* why the executable file might be covered by the GNU Library General *) + (* Public License . *) +- + (* This library is distributed in the hope that it will be useful, *) + (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) + (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *) + (* Lesser General Public License for more details. *) +- + (* You should have received a copy of the GNU Lesser General Public *) + (* License along with this library; if not, write to the Free Software *) + (* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *) + (* USA *) +- + (* You can contact the authour by sending email to *) + (* yori@users.sourceforge.net *) +- +- + open Toolslib ++ + open AbsCe ++ + module CE = CharEncoding.Configure(Camomileconfig) ++ + module Info = UCharInfo.Make(Camomileconfig) +- +-let enc, readfile, dir = ++ ++let (enc, readfile, dir) = + let enc = ref CE.utf8 in + let readfile = ref stdin in +- let dir = ref Filename.current_dir_name in +- Arg.parse +- ["--enc", Arg.String (fun encname -> +- enc := CE.of_name encname), "Encoding name"; +- "--file", Arg.String (fun filename -> +- readfile := open_in_bin filename), "Reading file"] +- (fun dirname -> dir := dirname) +- "camomilelocaledef --enc ENCNAME --file INPUTFILE DIRECTORY:\n\ ++ let dir = ref Filename.current_dir_name ++ in ++ (Arg.parse ++ [ ("--enc", (Arg.String (fun encname -> enc := CE.of_name encname)), ++ "Encoding name"); ++ ("--file", ++ (Arg.String (fun filename -> readfile := open_in_bin filename)), ++ "Reading file") ] ++ (fun dirname -> dir := dirname) ++ "camomilelocaledef --enc ENCNAME --file INPUTFILE DIRECTORY:\n\ + Read the localedef INPUTFILE using the encoding ENCNAME \ + and put the compiled data into DIRECTORY. \ + If ENCNAME is ommited, UTF-8 is used. \ + If INPUTFILE is ommited, reading from stdin. \ + If DIRECTORY is ommited, the current directory is used."; +- !enc, !readfile, !dir +- ++ ((!enc), (!readfile), (!dir))) ++ + module Utf8Buffer = UTF8.Buf ++ + module Utf8NF = UNF.Make(Camomileconfig)(UTF8) +- +-let ff = 0x000c (*form feed*) ++ ++let ff = 0x000c ++ ++(*form feed*) + let cr = Char.code '\r' ++ + let lf = Char.code '\n' ++ + let nel = 0x0085 ++ + let tab = Char.code '\t' +- ++ + let backslash = Char.code '\\' ++ + let sq = Char.code '\\' ++ + let dq = Char.code '"' +- ++ + let backslash = Str.regexp "\\\\\\\\" +-let literal_1 = Str.regexp +- "\\\\[u]\\([0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]\\)" +- +-let literal_2 = Str.regexp ++ ++let literal_1 = ++ Str.regexp "\\\\[u]\\([0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]\\)" ++ ++let literal_2 = ++ Str.regexp + "\\\\[v]\\([0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]\\)" +- ++ + let unescape s = +- let s = +- Str.global_substitute literal_1 (fun _ -> +- let n = int_of_string (Str.replace_matched "0x\\1" s) in +- UTF8.init 1 (fun _ -> (UChar.chr_of_uint n))) +- s in +- let s = +- Str.global_substitute literal_2 (fun _ -> +- let n = int_of_string (Str.replace_matched "0x\\1" s) in +- UTF8.init 1 (fun _ -> (UChar.chr_of_uint n))) ++ let s = ++ Str.global_substitute literal_1 ++ (fun _ -> ++ let n = int_of_string (Str.replace_matched "0x\\1" s) ++ in UTF8.init 1 (fun _ -> UChar.chr_of_uint n)) + s in +- Str.global_replace backslash "\\\\" s +- +-let rec stream_to_list_aux a s = (parser +- [< 'e; rest >] -> stream_to_list_aux (e :: a) rest +- | [< >] -> List.rev a) s +- ++ let s = ++ Str.global_substitute literal_2 ++ (fun _ -> ++ let n = int_of_string (Str.replace_matched "0x\\1" s) ++ in UTF8.init 1 (fun _ -> UChar.chr_of_uint n)) ++ s ++ in Str.global_replace backslash "\\\\" s ++ ++let rec stream_to_list_aux a s = ++ (fun (__strm : _ Stream.t) -> ++ match Stream.peek __strm with ++ | Some e -> (Stream.junk __strm; stream_to_list_aux (e :: a) __strm) ++ | _ -> List.rev a) ++ s ++ + let stream_to_list s = stream_to_list_aux [] s ++ ++type token = | Text of string | Brace_r | Brace_l | Colon | Comma + +-type token = +- Text of string +- | Brace_r +- | Brace_l +- | Colon +- | Comma +- +-let rec prep = parser +- [< 'u; rest >] -> +- let c = try Some (UChar.char_of u) with _ -> None in +- (match Info.general_category u with +- `Cc | `Cf when c <> Some '\n' -> prep rest +- | ct -> [< '(c, ct, u); prep rest >]) +- | [< >] -> [< >] +- +-let rec remove_comment = parser +- [< '( Some '/', _, _) as data; rest >] -> +- (parser +- [< '(Some '/', _, _); rest >] -> comment rest +- | [< '(Some '*', _, _); rest >] -> comment2 rest +- | [< rest >] -> [< 'data; remove_comment rest >]) +- rest +- | [< '( Some '"', _, _) as data; rest >] -> +- [< 'data; in_quote rest >] +- | [< 'data; rest >] -> [< 'data; remove_comment rest >] +- | [< >] -> [< >] +-and comment = parser +- [< '( Some ('\r' | '\n' | '\133'), _, _) | ( _, (`Zl | `Zp), _); rest >] +- -> remove_comment rest +- | [< 'data; rest >] -> comment rest +- | [< >] -> [< >] +-and comment2 = parser +- [< '( Some '*', _, _) as data; rest >] -> (parser +- [< '(Some '/', _, _); rest >] -> remove_comment rest +- | [< rest >] -> comment2 rest) rest +- | [< 'data; rest >] -> comment2 rest +- | [< >] -> [< >] +-and in_quote = parser +- [< '( Some '\\', _, _) as data1; 'data2; rest >] -> +- [< 'data1; 'data2; in_quote rest >] +- | [< '( Some '"', _, _) as data; rest >] -> +- [<' data; remove_comment rest >] +- | [< 'data; rest >] -> [< 'data; in_quote rest >] +- | [< >] -> [< >] +- +-let rec merge_text = parser +- [< 'Text s; rest >] -> do_merge s rest +- | [< 'e; rest >] -> [< 'e; merge_text rest >] +- | [< >] -> [< >] +-and do_merge s = parser +- [< 'Text s'; rest >] -> do_merge (s ^ s') rest +- | [< 'e; rest >] -> [< 'Text s; 'e; merge_text rest >] +- | [< >] -> [< >] +- ++let rec prep (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some u -> ++ (Stream.junk __strm; ++ let rest = __strm in ++ let c = (try Some (UChar.char_of u) with | _ -> None) ++ in ++ (match Info.general_category u with ++ | `Cc | `Cf when c <> (Some '\n') -> prep rest ++ | ct -> ++ Stream.lcons (fun _ -> (c, ct, u)) ++ (Stream.slazy (fun _ -> prep rest)))) ++ | _ -> Stream.sempty ++ ++let rec remove_comment (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some (((Some '/', _, _) as data)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in ++ (fun (__strm : _ Stream.t) -> ++ match Stream.peek __strm with ++ | Some ((Some '/', _, _)) -> (Stream.junk __strm; comment __strm) ++ | Some ((Some '*', _, _)) -> ++ (Stream.junk __strm; comment2 __strm) ++ | _ -> ++ let rest = __strm ++ in ++ Stream.icons data ++ (Stream.slazy (fun _ -> remove_comment rest))) ++ rest) ++ | Some (((Some '"', _, _) as data)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons data (Stream.slazy (fun _ -> in_quote rest))) ++ | Some data -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons data (Stream.slazy (fun _ -> remove_comment rest))) ++ | _ -> Stream.sempty ++and comment (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some ((Some ('\r' | '\n' | '\133'), _, _) | (_, (`Zl | `Zp), _)) -> ++ (Stream.junk __strm; remove_comment __strm) ++ | Some data -> (Stream.junk __strm; comment __strm) ++ | _ -> Stream.sempty ++and comment2 (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some (((Some '*', _, _) as data)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in ++ (fun (__strm : _ Stream.t) -> ++ match Stream.peek __strm with ++ | Some ((Some '/', _, _)) -> ++ (Stream.junk __strm; remove_comment __strm) ++ | _ -> comment2 __strm) ++ rest) ++ | Some data -> (Stream.junk __strm; comment2 __strm) ++ | _ -> Stream.sempty ++and in_quote (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some (((Some '\\', _, _) as data1)) -> ++ (Stream.junk __strm; ++ (match Stream.peek __strm with ++ | Some data2 -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in ++ Stream.icons data1 ++ (Stream.icons data2 (Stream.slazy (fun _ -> in_quote rest)))) ++ | _ -> raise (Stream.Error ""))) ++ | Some (((Some '"', _, _) as data)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons data (Stream.slazy (fun _ -> remove_comment rest))) ++ | Some data -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons data (Stream.slazy (fun _ -> in_quote rest))) ++ | _ -> Stream.sempty ++ ++let rec merge_text (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some (Text s) -> (Stream.junk __strm; do_merge s __strm) ++ | Some e -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons e (Stream.slazy (fun _ -> merge_text rest))) ++ | _ -> Stream.sempty ++and do_merge s (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some (Text s') -> (Stream.junk __strm; do_merge (s ^ s') __strm) ++ | Some e -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in ++ Stream.icons (Text s) ++ (Stream.icons e (Stream.slazy (fun _ -> merge_text rest)))) ++ | _ -> Stream.sempty ++ + let lexer s = +- let rec parse = parser +- [< '( Some '{', _, _); rest >] -> [< 'Brace_l; parse rest >] +- | [< '( Some '}', _, _); rest >] -> [< 'Brace_r; parse rest >] +- | [< '( Some ':', _, _); rest >] -> [< 'Colon; parse rest >] +- | [< '( Some ',', _, _); rest >] -> [< 'Comma; parse rest >] +- | [< '( Some '"', _, _); rest >] -> quote rest +- | [< '( Some ('\r' | '\n' | '\133' | '\t'), _, _) +- | ( _, (`Zs | `Zl | `Zp), _) ; rest >] -> +- parse rest +- | [< 'e; rest >] -> text [< 'e; rest >] +- | [< >] -> [< >] ++ let rec parse (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some ((Some '{', _, _)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons Brace_l (Stream.slazy (fun _ -> parse rest))) ++ | Some ((Some '}', _, _)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons Brace_r (Stream.slazy (fun _ -> parse rest))) ++ | Some ((Some ':', _, _)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons Colon (Stream.slazy (fun _ -> parse rest))) ++ | Some ((Some ',', _, _)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in Stream.icons Comma (Stream.slazy (fun _ -> parse rest))) ++ | Some ((Some '"', _, _)) -> (Stream.junk __strm; quote __strm) ++ | Some ++ ((Some ('\r' | '\n' | '\133' | '\t'), _, _) | ++ (_, (`Zs | `Zl | `Zp), _)) ++ -> (Stream.junk __strm; parse __strm) ++ | Some e -> ++ (Stream.junk __strm; let rest = __strm in text (Stream.icons e rest)) ++ | _ -> Stream.sempty + and quote s = + let buf = Utf8Buffer.create 16 in +- let rec loop = parser +- [< '( Some '\\', _, u1); '(_, _, u2); rest >] -> +- Utf8Buffer.add_char buf u1; +- Utf8Buffer.add_char buf u2; +- loop rest +- | [< '( Some '"', _, _); rest >] -> +- let s = Utf8Buffer.contents buf in +- let s' = unescape s in +- [< 'Text s'; parse rest >] +- | [< '( _, _, u); rest >] -> +- Utf8Buffer.add_char buf u; +- loop rest +- | [< >] -> failwith "A quote is not enclosed." +- in +- loop s ++ let rec loop (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some ((Some '\\', _, u1)) -> ++ (Stream.junk __strm; ++ (match Stream.peek __strm with ++ | Some ((_, _, u2)) -> ++ (Stream.junk __strm; ++ let rest = __strm ++ in ++ (Utf8Buffer.add_char buf u1; ++ Utf8Buffer.add_char buf u2; ++ loop rest)) ++ | _ -> raise (Stream.Error ""))) ++ | Some ((Some '"', _, _)) -> ++ (Stream.junk __strm; ++ let rest = __strm in ++ let s = Utf8Buffer.contents buf in ++ let s' = unescape s ++ in Stream.icons (Text s') (Stream.slazy (fun _ -> parse rest))) ++ | Some ((_, _, u)) -> ++ (Stream.junk __strm; ++ let rest = __strm in (Utf8Buffer.add_char buf u; loop rest)) ++ | _ -> failwith "A quote is not enclosed." ++ in loop s + and text s = + let buf = Utf8Buffer.create 16 in +- let rec loop = parser +- [<'( Some ('\r' | '\n' | '\133' | '\t'), _, _) | +- ( _, (`Zs | `Zl | `Zp), _) ; rest >] -> +- let s = Utf8Buffer.contents buf in +- let s' = unescape s in +- [< 'Text s'; parse rest >] +- | [< '( Some ('{' | '}' | ':' | ','| '"'), _, _) as e; rest >] -> +- let s = Utf8Buffer.contents buf in +- let s' = unescape s in +- [< 'Text s'; parse [< 'e; rest >] >] +- | [< '( _, _, u); rest >] -> +- Utf8Buffer.add_char buf u; +- loop rest +- | [< >] -> +- let s = Utf8Buffer.contents buf in +- let s' = unescape s in +- [< 'Text s' >] +- in +- loop s +- in ++ let rec loop (__strm : _ Stream.t) = ++ match Stream.peek __strm with ++ | Some ++ ((Some ('\r' | '\n' | '\133' | '\t'), _, _) | ++ (_, (`Zs | `Zl | `Zp), _)) ++ -> ++ (Stream.junk __strm; ++ let rest = __strm in ++ let s = Utf8Buffer.contents buf in ++ let s' = unescape s ++ in Stream.icons (Text s') (Stream.slazy (fun _ -> parse rest))) ++ | Some (((Some ('{' | '}' | ':' | ',' | '"'), _, _) as e)) -> ++ (Stream.junk __strm; ++ let rest = __strm in ++ let s = Utf8Buffer.contents buf in ++ let s' = unescape s ++ in ++ Stream.icons (Text s') ++ (Stream.slazy (fun _ -> parse (Stream.icons e rest)))) ++ | Some ((_, _, u)) -> ++ (Stream.junk __strm; ++ let rest = __strm in (Utf8Buffer.add_char buf u; loop rest)) ++ | _ -> ++ let s = Utf8Buffer.contents buf in ++ let s' = unescape s in Stream.ising (Text s') ++ in loop s in + let p = prep s in + let p1 = remove_comment p in + let tokens = parse p1 in +- let tokens1 = merge_text tokens in +- let l = stream_to_list tokens1 in l +- ++ let tokens1 = merge_text tokens in let l = stream_to_list tokens1 in l ++ + let string_to_binary s = +- let n = String.length s / 2 in +- let b = String.create n in +- for i = 0 to n - 1 do +- let d = int_of_string ("0x" ^ (String.sub s (i * 2) 2)) in +- b.[i] <- Char.chr d +- done; +- b +- ++ let n = (String.length s) / 2 in ++ let b = String.create n ++ in ++ (for i = 0 to n - 1 do ++ (let d = int_of_string ("0x" ^ (String.sub s (i * 2) 2)) ++ in b.[i] <- Char.chr d) ++ done; ++ b) ++ + let root = ref "" +- ++ + let load_file filename = + let file = +- if Filename.is_implicit filename then +- Filename.concat !root filename else +- filename +- in ++ if Filename.is_implicit filename ++ then Filename.concat !root filename ++ else filename in + let c = open_in_bin file in +- let buf = Buffer.create 16 in +- try begin while true do +- Buffer.add_channel buf c 1 +- done; assert false end +- with End_of_file -> +- Buffer.contents buf +- +-type data = +- Table of (string, data) Hashtbl.t ++ let buf = Buffer.create 16 ++ in ++ try (while true do Buffer.add_channel buf c 1 done; assert false) ++ with | End_of_file -> Buffer.contents buf ++ ++type data = ++ | Table of (string, data) Hashtbl.t + | Array_data of data array + | String_data of string + | Binary of string +@@ -244,125 +332,119 @@ + + let rec parse_intvect l a = + match l with +- Text num :: Comma :: rest -> ++ | Text num :: Comma :: rest -> + parse_intvect rest ((int_of_string num) :: a) + | Text num :: rest -> +- Intvect (Array.of_list (List.rev ((int_of_string num) :: a))), rest +- | _ -> +- Intvect (Array.of_list (List.rev a)), l +- ++ ((Intvect (Array.of_list (List.rev ((int_of_string num) :: a)))), rest) ++ | _ -> ((Intvect (Array.of_list (List.rev a))), l) ++ + let rec parse_table l a = + match parse l with +- Some d, rest -> parse_table rest (d :: a) +- | None, rest -> ++ | (Some d, rest) -> parse_table rest (d :: a) ++ | (None, rest) -> + let tbl = Hashtbl.create (List.length a) in + let proc ent = +- match ent with +- Tagged (name, data) -> +- Hashtbl.add tbl name data +- | _ -> failwith "A broken table entry." +- in +- List.iter proc a; +- Table tbl, rest +- ++ (match ent with ++ | Tagged (name, data) -> Hashtbl.add tbl name data ++ | _ -> failwith "A broken table entry.") ++ in (List.iter proc a; ((Table tbl), rest)) + and parse_array l a = + match l with +- Brace_l :: rest -> +- let data, rest = parse_unknown rest in +- (match rest with +- Brace_r :: Comma :: rest -> +- parse_array rest (data :: a) +- | Brace_r :: rest -> +- parse_array rest (data :: a) +- | _ -> failwith "A brace is not enclosed.") +- | Text text :: Comma :: rest -> +- parse_array rest ((String_data text) :: a) ++ | Brace_l :: rest -> ++ let (data, rest) = parse_unknown rest ++ in ++ (match rest with ++ | Brace_r :: Comma :: rest -> parse_array rest (data :: a) ++ | Brace_r :: rest -> parse_array rest (data :: a) ++ | _ -> failwith "A brace is not enclosed.") ++ | Text text :: Comma :: rest -> parse_array rest ((String_data text) :: a) + | Text text :: rest -> +- Array_data (Array.of_list (List.rev ((String_data text) :: a))), rest +- | _ -> +- Array_data (Array.of_list (List.rev a)), l +- ++ ((Array_data (Array.of_list (List.rev ((String_data text) :: a)))), ++ rest) ++ | _ -> ((Array_data (Array.of_list (List.rev a))), l) + and parse_unknown l = + match l with +- Text text :: Brace_r :: rest -> +- String_data text, Brace_r :: rest ++ | Text text :: Brace_r :: rest -> ((String_data text), (Brace_r :: rest)) + | Text text :: Comma :: rest -> parse_array l [] + | Text text :: rest -> parse_table l [] + | _ -> parse_array l [] +- +-and parse l = match l with +- Text tname :: Colon :: Text "table" :: Brace_l :: rest -> +- let data, rest = parse_table rest [] in +- (match rest with +- Brace_r :: rest -> +- Some (Tagged (tname, data)), rest +- | _ -> failwith "A brace is not enclosed.") ++and parse l = ++ match l with ++ | Text tname :: Colon :: Text "table" :: Brace_l :: rest -> ++ let (data, rest) = parse_table rest [] ++ in ++ (match rest with ++ | Brace_r :: rest -> ((Some (Tagged (tname, data))), rest) ++ | _ -> failwith "A brace is not enclosed.") + | Text tname :: Colon :: Text "array" :: Brace_l :: rest -> +- let data, rest = parse_array rest [] in +- (match rest with +- Brace_r :: rest -> +- Some (Tagged (tname, data)), rest +- | _ -> failwith "A brace is not enclosed.") +- | Text tname :: Colon :: Text "string" :: Brace_l :: +- Text data :: Brace_r :: rest -> +- Some (Tagged (tname, String_data data)), rest +- | Text tname :: Colon :: Text "bin" :: Brace_l :: +- Text data :: Brace_r :: rest -> +- let b = string_to_binary data in +- Some (Tagged (tname, Binary b)), rest +- | Text tname :: Colon :: Text "import" :: Brace_l :: +- Text filename :: Brace_r :: rest -> +- prerr_endline "Warning : file loading is not supported."; +- Some (Tagged (tname, Binary "")), rest +- | Text tname :: Colon :: Text "int" :: Brace_l :: +- Text num :: Brace_r :: rest -> +- let n = int_of_string num in +- Some (Tagged (tname, Int n)), rest ++ let (data, rest) = parse_array rest [] ++ in ++ (match rest with ++ | Brace_r :: rest -> ((Some (Tagged (tname, data))), rest) ++ | _ -> failwith "A brace is not enclosed.") ++ | Text tname :: Colon :: Text "string" :: Brace_l :: Text data :: ++ Brace_r :: rest -> ((Some (Tagged (tname, (String_data data)))), rest) ++ | Text tname :: Colon :: Text "bin" :: Brace_l :: Text data :: Brace_r :: ++ rest -> ++ let b = string_to_binary data ++ in ((Some (Tagged (tname, (Binary b)))), rest) ++ | Text tname :: Colon :: Text "import" :: Brace_l :: Text filename :: ++ Brace_r :: rest -> ++ (prerr_endline "Warning : file loading is not supported."; ++ ((Some (Tagged (tname, (Binary "")))), rest)) ++ | Text tname :: Colon :: Text "int" :: Brace_l :: Text num :: Brace_r :: ++ rest -> ++ let n = int_of_string num in ((Some (Tagged (tname, (Int n)))), rest) + | Text tname :: Colon :: Text "intvector" :: Brace_l :: rest -> +- let data, rest = parse_intvect rest [] in +- (match rest with +- Brace_r :: rest -> +- Some (Tagged (tname, data)), rest +- | _ -> failwith "A brace is not enclosed.") ++ let (data, rest) = parse_intvect rest [] ++ in ++ (match rest with ++ | Brace_r :: rest -> ((Some (Tagged (tname, data))), rest) ++ | _ -> failwith "A brace is not enclosed.") + | Text name :: Brace_l :: rest -> +- let data, rest = parse_unknown rest in +- (match rest with +- Brace_r :: rest -> +- Some (Tagged (name, data)), rest +- | _ -> failwith "A brace is not enclosed.") +- | _ -> None, l +- ++ let (data, rest) = parse_unknown rest ++ in ++ (match rest with ++ | Brace_r :: rest -> ((Some (Tagged (name, data))), rest) ++ | _ -> failwith "A brace is not enclosed.") ++ | _ -> (None, l) ++ + let col_parse s = + let s = Utf8NF.nfd s in + let lexbuf = Lexing.from_string s in +- let ace_info = ColParser.main ColLexer.token lexbuf in +- cetbl_of ace_info +- +-let localedef = function Table tbl -> +- let col_info = try +- Some (match Hashtbl.find tbl "CollationElements" with +- Table tbl -> +- (match Hashtbl.find tbl "Sequence" with +- String_data s -> col_parse s +- | _ -> assert false) +- | _ -> assert false) +- with Not_found -> None +- in +- {Unidata.col_info = col_info} ++ let ace_info = ColParser.main ColLexer.token lexbuf in cetbl_of ace_info ++ ++let localedef = ++ function ++ | Table tbl -> ++ let col_info = ++ (try ++ Some ++ (match Hashtbl.find tbl "CollationElements" with ++ | Table tbl -> ++ (match Hashtbl.find tbl "Sequence" with ++ | String_data s -> col_parse s ++ | _ -> assert false) ++ | _ -> assert false) ++ with | Not_found -> None) ++ in { Unidata.col_info = col_info; } + | _ -> assert false +- ++ + let main () = + let cs = Stream.of_channel readfile in + let stream = CE.ustream_of enc cs in + let lexed = lexer stream in +- let data, rest = parse_table lexed [] in +- if rest <> [] then failwith "Strange trailing data."; +- let proc key entry = +- let locale_info = localedef entry in +- Database.write dir "mar" output_value key locale_info ++ let (data, rest) = parse_table lexed [] + in +- (match data with +- Table tbl -> Hashtbl.iter proc tbl +- | _ -> failwith "Broken data.") +- ++ (if rest <> [] then failwith "Strange trailing data." else (); ++ let proc key entry = ++ let locale_info = localedef entry ++ in Database.write dir "mar" output_value key locale_info ++ in ++ match data with ++ | Table tbl -> Hashtbl.iter proc tbl ++ | _ -> failwith "Broken data.") ++ + let _ = main () ++ ++ diff --git a/patches/caradoc/caradoc.install b/patches/caradoc/caradoc.install new file mode 100644 index 0000000..ad3dbd6 --- /dev/null +++ b/patches/caradoc/caradoc.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/main.byte" {"caradoc"} + "?_build/src/main.native" {"caradoc"} +] diff --git a/patches/caradoc/no_warn_error.patch b/patches/caradoc/no_warn_error.patch new file mode 100644 index 0000000..3704e92 --- /dev/null +++ b/patches/caradoc/no_warn_error.patch @@ -0,0 +1,10 @@ +diff --git a/Makefile b/Makefile +index 70233f3..e2083ff 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,4 @@ +-OCAML_OPTS=-w,+a-3-4-32..39,-warn-error,+a,-strict-sequence,-noautolink ++OCAML_OPTS=-w,+a-3-4-32..39,-strict-sequence,-noautolink + + PROGRAM=caradoc + diff --git a/patches/cca/cca.install.0.1 b/patches/cca/cca.install.0.1 new file mode 100644 index 0000000..f4f5e3e --- /dev/null +++ b/patches/cca/cca.install.0.1 @@ -0,0 +1,21 @@ +bin: [ + "src/ast/analyzing/bin/parsesrc.opt" { "parsesrc" } + "src/ast/analyzing/bin/simast.opt" { "simast" } + "src/ast/analyzing/bin/ogit.opt" { "ogit" } + "src/ast/analyzing/bin/diffast.opt" { "diffast" } + "src/ast/analyzing/bin/patchast.opt" { "patchast" } +] +libexec: [ + "src/ast/analyzing/langs/astml/Mastml.cmxs" { "modules/Mastml.cmxs" } + "src/ast/analyzing/langs/astml/Mastml_p.cmxs" { "modules/Mastml_p.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp.cmxs" { "modules/Mcpp.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp_p.cmxs" { "modules/Mcpp_p.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran.cmxs" { "modules/Mfortran.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran_p.cmxs" { "modules/Mfortran_p.cmxs" } + "src/ast/analyzing/langs/java/Mjava.cmxs" { "modules/Mjava.cmxs" } + "src/ast/analyzing/langs/java/Mjava_p.cmxs" { "modules/Mjava_p.cmxs" } + "src/ast/analyzing/langs/python/Mpython.cmxs" { "modules/Mpython.cmxs" } + "src/ast/analyzing/langs/python/Mpython_p.cmxs" { "modules/Mpython_p.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog.cmxs" { "modules/Mverilog.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog_p.cmxs" { "modules/Mverilog_p.cmxs" } +] diff --git a/patches/cca/cca.install.0.2 b/patches/cca/cca.install.0.2 new file mode 100644 index 0000000..f4f5e3e --- /dev/null +++ b/patches/cca/cca.install.0.2 @@ -0,0 +1,21 @@ +bin: [ + "src/ast/analyzing/bin/parsesrc.opt" { "parsesrc" } + "src/ast/analyzing/bin/simast.opt" { "simast" } + "src/ast/analyzing/bin/ogit.opt" { "ogit" } + "src/ast/analyzing/bin/diffast.opt" { "diffast" } + "src/ast/analyzing/bin/patchast.opt" { "patchast" } +] +libexec: [ + "src/ast/analyzing/langs/astml/Mastml.cmxs" { "modules/Mastml.cmxs" } + "src/ast/analyzing/langs/astml/Mastml_p.cmxs" { "modules/Mastml_p.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp.cmxs" { "modules/Mcpp.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp_p.cmxs" { "modules/Mcpp_p.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran.cmxs" { "modules/Mfortran.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran_p.cmxs" { "modules/Mfortran_p.cmxs" } + "src/ast/analyzing/langs/java/Mjava.cmxs" { "modules/Mjava.cmxs" } + "src/ast/analyzing/langs/java/Mjava_p.cmxs" { "modules/Mjava_p.cmxs" } + "src/ast/analyzing/langs/python/Mpython.cmxs" { "modules/Mpython.cmxs" } + "src/ast/analyzing/langs/python/Mpython_p.cmxs" { "modules/Mpython_p.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog.cmxs" { "modules/Mverilog.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog_p.cmxs" { "modules/Mverilog_p.cmxs" } +] diff --git a/patches/cca/cca.install.0.4 b/patches/cca/cca.install.0.4 new file mode 100644 index 0000000..f4f5e3e --- /dev/null +++ b/patches/cca/cca.install.0.4 @@ -0,0 +1,21 @@ +bin: [ + "src/ast/analyzing/bin/parsesrc.opt" { "parsesrc" } + "src/ast/analyzing/bin/simast.opt" { "simast" } + "src/ast/analyzing/bin/ogit.opt" { "ogit" } + "src/ast/analyzing/bin/diffast.opt" { "diffast" } + "src/ast/analyzing/bin/patchast.opt" { "patchast" } +] +libexec: [ + "src/ast/analyzing/langs/astml/Mastml.cmxs" { "modules/Mastml.cmxs" } + "src/ast/analyzing/langs/astml/Mastml_p.cmxs" { "modules/Mastml_p.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp.cmxs" { "modules/Mcpp.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp_p.cmxs" { "modules/Mcpp_p.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran.cmxs" { "modules/Mfortran.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran_p.cmxs" { "modules/Mfortran_p.cmxs" } + "src/ast/analyzing/langs/java/Mjava.cmxs" { "modules/Mjava.cmxs" } + "src/ast/analyzing/langs/java/Mjava_p.cmxs" { "modules/Mjava_p.cmxs" } + "src/ast/analyzing/langs/python/Mpython.cmxs" { "modules/Mpython.cmxs" } + "src/ast/analyzing/langs/python/Mpython_p.cmxs" { "modules/Mpython_p.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog.cmxs" { "modules/Mverilog.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog_p.cmxs" { "modules/Mverilog_p.cmxs" } +] diff --git a/patches/cca/cca.install.0.5 b/patches/cca/cca.install.0.5 new file mode 100644 index 0000000..f4f5e3e --- /dev/null +++ b/patches/cca/cca.install.0.5 @@ -0,0 +1,21 @@ +bin: [ + "src/ast/analyzing/bin/parsesrc.opt" { "parsesrc" } + "src/ast/analyzing/bin/simast.opt" { "simast" } + "src/ast/analyzing/bin/ogit.opt" { "ogit" } + "src/ast/analyzing/bin/diffast.opt" { "diffast" } + "src/ast/analyzing/bin/patchast.opt" { "patchast" } +] +libexec: [ + "src/ast/analyzing/langs/astml/Mastml.cmxs" { "modules/Mastml.cmxs" } + "src/ast/analyzing/langs/astml/Mastml_p.cmxs" { "modules/Mastml_p.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp.cmxs" { "modules/Mcpp.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp_p.cmxs" { "modules/Mcpp_p.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran.cmxs" { "modules/Mfortran.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran_p.cmxs" { "modules/Mfortran_p.cmxs" } + "src/ast/analyzing/langs/java/Mjava.cmxs" { "modules/Mjava.cmxs" } + "src/ast/analyzing/langs/java/Mjava_p.cmxs" { "modules/Mjava_p.cmxs" } + "src/ast/analyzing/langs/python/Mpython.cmxs" { "modules/Mpython.cmxs" } + "src/ast/analyzing/langs/python/Mpython_p.cmxs" { "modules/Mpython_p.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog.cmxs" { "modules/Mverilog.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog_p.cmxs" { "modules/Mverilog_p.cmxs" } +] diff --git a/patches/cca/cca.install.0.6.2 b/patches/cca/cca.install.0.6.2 new file mode 100644 index 0000000..f4f5e3e --- /dev/null +++ b/patches/cca/cca.install.0.6.2 @@ -0,0 +1,21 @@ +bin: [ + "src/ast/analyzing/bin/parsesrc.opt" { "parsesrc" } + "src/ast/analyzing/bin/simast.opt" { "simast" } + "src/ast/analyzing/bin/ogit.opt" { "ogit" } + "src/ast/analyzing/bin/diffast.opt" { "diffast" } + "src/ast/analyzing/bin/patchast.opt" { "patchast" } +] +libexec: [ + "src/ast/analyzing/langs/astml/Mastml.cmxs" { "modules/Mastml.cmxs" } + "src/ast/analyzing/langs/astml/Mastml_p.cmxs" { "modules/Mastml_p.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp.cmxs" { "modules/Mcpp.cmxs" } + "src/ast/analyzing/langs/cpp/Mcpp_p.cmxs" { "modules/Mcpp_p.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran.cmxs" { "modules/Mfortran.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran_p.cmxs" { "modules/Mfortran_p.cmxs" } + "src/ast/analyzing/langs/java/Mjava.cmxs" { "modules/Mjava.cmxs" } + "src/ast/analyzing/langs/java/Mjava_p.cmxs" { "modules/Mjava_p.cmxs" } + "src/ast/analyzing/langs/python/Mpython.cmxs" { "modules/Mpython.cmxs" } + "src/ast/analyzing/langs/python/Mpython_p.cmxs" { "modules/Mpython_p.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog.cmxs" { "modules/Mverilog.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog_p.cmxs" { "modules/Mverilog_p.cmxs" } +] diff --git a/patches/cca/cca.install.0.7 b/patches/cca/cca.install.0.7 new file mode 100644 index 0000000..cb4709b --- /dev/null +++ b/patches/cca/cca.install.0.7 @@ -0,0 +1,21 @@ +bin: [ + "src/ast/analyzing/bin/parsesrc.opt" { "parsesrc" } + "src/ast/analyzing/bin/simast.opt" { "simast" } + "src/ast/analyzing/bin/ogit.opt" { "ogit" } + "src/ast/analyzing/bin/diffast.opt" { "diffast" } + "src/ast/analyzing/bin/patchast.opt" { "patchast" } +] +libexec: [ + "src/ast/analyzing/langs/astml/Mastml.cmxs" { "modules/Mastml.cmxs" } + "src/ast/analyzing/langs/astml/Mastml_p.cmxs" { "modules/Mastml_p.cmxs" } + "?src/ast/analyzing/langs/cpp/Mcpp.cmxs" { "modules/Mcpp.cmxs" } + "?src/ast/analyzing/langs/cpp/Mcpp_p.cmxs" { "modules/Mcpp_p.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran.cmxs" { "modules/Mfortran.cmxs" } + "src/ast/analyzing/langs/fortran/Mfortran_p.cmxs" { "modules/Mfortran_p.cmxs" } + "src/ast/analyzing/langs/java/Mjava.cmxs" { "modules/Mjava.cmxs" } + "src/ast/analyzing/langs/java/Mjava_p.cmxs" { "modules/Mjava_p.cmxs" } + "src/ast/analyzing/langs/python/Mpython.cmxs" { "modules/Mpython.cmxs" } + "src/ast/analyzing/langs/python/Mpython_p.cmxs" { "modules/Mpython_p.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog.cmxs" { "modules/Mverilog.cmxs" } + "src/ast/analyzing/langs/verilog/Mverilog_p.cmxs" { "modules/Mverilog_p.cmxs" } +] diff --git a/patches/cduce/cduce.install b/patches/cduce/cduce.install new file mode 100644 index 0000000..e2de4d8 --- /dev/null +++ b/patches/cduce/cduce.install @@ -0,0 +1 @@ +bin: ["cduce"] diff --git a/patches/cgi/ocamlfind.patch b/patches/cgi/ocamlfind.patch new file mode 100644 index 0000000..e9d8ece --- /dev/null +++ b/patches/cgi/ocamlfind.patch @@ -0,0 +1,56 @@ +diff -u -r -N cgi-0.8-orig/META cgi-0.8/META +--- cgi-0.8-orig/META 1970-01-01 01:00:00.000000000 +0100 ++++ cgi-0.8/META 2013-02-18 13:29:47.000000000 +0100 +@@ -0,0 +1,5 @@ ++description = "Objective Caml library for writing CGIs" ++version = "0.8" ++requires = "str" ++archive(byte) = "cgi.cmo" ++archive(native) = "cgi.cmx" +diff -u -r -N cgi-0.8-orig/Makefile.in cgi-0.8/Makefile.in +--- cgi-0.8-orig/Makefile.in 2013-02-18 13:29:26.000000000 +0100 ++++ cgi-0.8/Makefile.in 2013-02-18 13:30:40.000000000 +0100 +@@ -3,8 +3,6 @@ + # Configuration part + ################################################################### + +-TARGETDIR = @OCAMLLIB@ +- + CAMLC = @OCAMLC@ -g + CAMLOPT = @OCAMLOPT@ + CAMLDEP = @OCAMLDEP@ +@@ -28,20 +26,17 @@ + # Installation and export + ################################################################### + +-COMMFILES = $(MLI) $(CMI) ++COMMFILES = META $(MLI) $(CMI) + BYTEFILES = cgi.cmo + OPTFILES = cgi.cmx cgi.o + + install: install-@OCAMLBEST@ + +-install-common: +- cp $(COMMFILES) $(TARGETDIR) +- +-install-byte: install-common +- cp $(BYTEFILES) $(TARGETDIR) ++install-byte: ++ ocamlfind install cgi $(COMMFILES) $(BYTEFILES) + +-install-opt: install-common install-byte +- cp $(OPTFILES) $(TARGETDIR) ++install-opt: ++ ocamlfind install cgi $(COMMFILES) $(BYTEFILES) $(OPTFILES) + + MAJORVN=0 + MINORVN=8 +diff -u -r -N cgi-0.8-orig/cgi-0.8/META cgi-0.8/cgi-0.8/META +--- cgi-0.8-orig/cgi-0.8/META 1970-01-01 01:00:00.000000000 +0100 ++++ cgi-0.8/cgi-0.8/META 2013-02-18 13:29:44.000000000 +0100 +@@ -0,0 +1,5 @@ ++description = "Objective Caml library for writing CGIs" ++version = "0.8" ++requires = "str" ++archive(byte) = "cgi.cmo" ++archive(native) = "cgi.cmx" diff --git a/patches/chamo/chamo.install b/patches/chamo/chamo.install new file mode 100644 index 0000000..8d6c1e3 --- /dev/null +++ b/patches/chamo/chamo.install @@ -0,0 +1,5 @@ +bin: [ + "?src/chamo" + "?src/chamo.byte" + "src/mk-chamo" +] diff --git a/patches/checkseum/mirage.patch b/patches/checkseum/mirage.patch new file mode 100644 index 0000000..7d11b5a --- /dev/null +++ b/patches/checkseum/mirage.patch @@ -0,0 +1,8 @@ +diff --git a/_build/default/META.checkseum b/_build/default/META.checkseum +--- a/_build/default/META.checkseum ++++ b/_build/default/META.checkseum +@@ -58,0 +58,3 @@ ++ ++xen_linkopts = "-l:laolao/xen/liblaolao_xen_stubs.a" ++freestanding_linkopts = "-l:laolao/freestanding/liblaolao_freestanding_stubs.a" +-- diff --git a/patches/choice/ocamldoc-3.12.1-fix.patch b/patches/choice/ocamldoc-3.12.1-fix.patch new file mode 100644 index 0000000..4e44a7c --- /dev/null +++ b/patches/choice/ocamldoc-3.12.1-fix.patch @@ -0,0 +1,48 @@ +commit d883bc9d8488e1d9ba090f14bcd2b3299cfaf868 +Author: Gabriel Scherer +Date: Fri Aug 12 16:53:34 2016 +0200 + + minor document change to fix an ocamldoc failure under OCaml 3.12.1 + + ``` + + /home/gasche/.opam/3.12.1/bin/ocamlfind ocamldoc -dump choice.odoc choice.mli + /tmp/choice/_build/choice.mli : Syntax error in text: + Call the function to get alternative choices. + Example: + {[let r = ref 0 in Choice.run_n 10 + (Choice.filter + (Choice.from_fun (fun () -> incr r; Some !r)) (fun x -> x mod 3 = 0));; + - : int list = [30; 27; 24; 21; 18; 15; 12; 9; 6; 3] ]} + line 5, character 8: + - : int list = [30; 27; 24; 21; 18; 15; 12; 9; 6; 3] ]} + ^ + /tmp/choice/_build/choice.mli : Syntax error in text: + Call the function to get alternative choices. + Example: + {[let r = ref 0 in Choice.run_n 10 + (Choice.filter + (Choice.from_fun (fun () -> incr r; Some !r)) (fun x -> x mod 3 = 0));; + - : int list = [30; 27; 24; 21; 18; 15; 12; 9; 6; 3] ]} + line 5, character 8: + - : int list = [30; 27; 24; 21; 18; 15; 12; 9; 6; 3] ]} + ^ + 2 error(s) encountered + Command exited with code 1. + ``` + +diff --git a/choice.mli b/choice.mli +index 06e804a..463b0c0 100644 +--- a/choice.mli ++++ b/choice.mli +@@ -85,8 +85,9 @@ val from_fun : (unit -> 'a option) -> 'a t + Example: + {[let r = ref 0 in Choice.run_n 10 + (Choice.filter +- (Choice.from_fun (fun () -> incr r; Some !r)) (fun x -> x mod 3 = 0));; +- - : int list = [30; 27; 24; 21; 18; 15; 12; 9; 6; 3] ]} *) ++ (Choice.from_fun (fun () -> incr r; Some !r)) (fun x -> x mod 3 = 0));;]} ++ yields ++ {[- : int list = [30; 27; 24; 21; 18; 15; 12; 9; 6; 3] ]} *) + + val delay : (unit -> 'a t) -> 'a t + (** Delay the computation (the closure will be called in each branch diff --git a/patches/cil/cil.install b/patches/cil/cil.install new file mode 100644 index 0000000..2a62454 --- /dev/null +++ b/patches/cil/cil.install @@ -0,0 +1 @@ +bin: ["bin/cilly"] diff --git a/patches/cil/format-obj-magic.patch b/patches/cil/format-obj-magic.patch new file mode 100644 index 0000000..af77199 --- /dev/null +++ b/patches/cil/format-obj-magic.patch @@ -0,0 +1,13 @@ +diff --git a/ocamlutil/pretty.ml b/ocamlutil/pretty.ml +index 9f2fc43..4118097 100644 +--- a/ocamlutil/pretty.ml ++++ b/ocamlutil/pretty.ml +@@ -640,7 +640,7 @@ external format_float: string -> float -> string = "caml_format_float" + + let gprintf (finish : doc -> 'b) + (format : ('a, unit, doc, 'b) format4) : 'a = +- let format = (Obj.magic format : string) in ++ let format = string_of_format format in + + (* Record the starting align depth *) + let startAlignDepth = !alignDepth in diff --git a/patches/clangml/build_with_bigger_stack_size.sh b/patches/clangml/build_with_bigger_stack_size.sh new file mode 100644 index 0000000..588eeb4 --- /dev/null +++ b/patches/clangml/build_with_bigger_stack_size.sh @@ -0,0 +1,7 @@ +#!/bin/bash +hard_limit="$(ulimit -H -s)" +if [ "$hard_limit" == "unlimited" ]; then + hard_limit=65536 +fi +ulimit -S -s "$hard_limit" +exec "$@" diff --git a/patches/clangml/clangml.install b/patches/clangml/clangml.install new file mode 100644 index 0000000..b7a6088 --- /dev/null +++ b/patches/clangml/clangml.install @@ -0,0 +1,3 @@ +bin: [ + "_build/consumer/processor.native" {"clangml-processor"} +] diff --git a/patches/cmdliner/backport_pre_4_00_0.patch b/patches/cmdliner/backport_pre_4_00_0.patch new file mode 100644 index 0000000..663d4db --- /dev/null +++ b/patches/cmdliner/backport_pre_4_00_0.patch @@ -0,0 +1,30 @@ +diff -Naur cmdliner-0.9.7/src/cmdliner.ml cmdliner-0.9.7.patched/src/cmdliner.ml +--- cmdliner-0.9.7/src/cmdliner.ml 2015-02-06 11:33:44.000000000 +0100 ++++ cmdliner-0.9.7.patched/src/cmdliner.ml 2015-02-18 23:04:04.000000000 +0100 +@@ -830,7 +830,7 @@ + | None -> if names = [] then "ARGUMENTS" else "OPTIONS" + | Some s -> s + in +- { id = arg_id (); absent = Val (Lazy.from_val ""); ++ { id = arg_id (); absent = Val (lazy ""); + doc = doc; docv = docv; docs = docs; + p_kind = All; o_kind = Flag; o_names = List.rev_map dash names; + o_all = false; } +@@ -924,7 +924,7 @@ + + let opt_all ?vopt (parse, print) v a = + if is_pos a then invalid_arg err_not_opt else +- let a = { a with absent = Val (Lazy.from_val ""); o_all = true; ++ let a = { a with absent = Val (lazy ""); o_all = true; + o_kind = match vopt with + | None -> Opt | Some dv -> Opt_vopt (str_of_pp print dv) } + in +@@ -949,7 +949,7 @@ + let pos ?(rev = false) k (parse, print) v a = + if is_opt a then invalid_arg err_not_pos else + let a = { a with p_kind = Nth (rev, k); +- absent = Val (Lazy.from_val (str_of_pp print v)) } ++ absent = Val (lazy (str_of_pp print v)) } + in + let convert _ cl = match Cmdline.pos_arg cl a with + | [] -> v diff --git a/patches/coccinelle/install-python-fix.patch b/patches/coccinelle/install-python-fix.patch new file mode 100644 index 0000000..83a6a4a --- /dev/null +++ b/patches/coccinelle/install-python-fix.patch @@ -0,0 +1,24 @@ +From 730dbb034559b3e549ec0b2973cd0400a3fa072f Mon Sep 17 00:00:00 2001 +From: Markus Boehme +Date: Tue, 18 Aug 2020 11:53:15 +0200 +Subject: [PATCH] Makefile: Ensure target directory exists for `install-python` + +Fixes: #196 + +Signed-off-by: Markus Boehme +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile b/Makefile +index 48c42e3cb..e25174413 100644 +--- a/Makefile ++++ b/Makefile +@@ -329,6 +329,7 @@ install-spgen : tools/spgen/source/spgen$(TOOLS_SUFFIX) + + .PHONY : install-python + install-python: ++ $(MKDIR_P) $(DESTDIR)$(LIBDIR)/python/coccilib + $(INSTALL_DATA) python/coccilib/*.py \ + $(DESTDIR)$(LIBDIR)/python/coccilib + diff --git a/patches/coccinelle/opam.patch b/patches/coccinelle/opam.patch new file mode 100644 index 0000000..00e6d17 --- /dev/null +++ b/patches/coccinelle/opam.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile b/Makefile +index 8700df5..25a434e 100644 +--- a/Makefile ++++ b/Makefile +@@ -538,30 +538,12 @@ install-opt: + $(INSTALL_PROGRAM) scripts/spatch.opt $(DESTDIR)$(BINDIR)/spatch.opt + + uninstall: +- rm -f $(DESTDIR)$(BINDIR)/spatch +- rm -f $(DESTDIR)$(BINDIR)/spatch.opt +- rm -f $(DESTDIR)$(BINDIR)/spatch.byte +- rm -f $(DESTDIR)$(SHAREDIR)/dllpycaml_stubs.so +- rm -f $(DESTDIR)$(SHAREDIR)/dllpcre_stubs.so +- rm -f $(DESTDIR)$(SHAREDIR)/spatch +- rm -f $(DESTDIR)$(SHAREDIR)/spatch.opt +- rm -f $(DESTDIR)$(SHAREDIR)/standard.h +- rm -f $(DESTDIR)$(SHAREDIR)/standard.iso +- rm -f $(DESTDIR)$(SHAREDIR)/ocaml/coccilib.cmi +- rm -f $(DESTDIR)$(SHAREDIR)/parsing_c/*.cmi +- rm -f $(DESTDIR)$(SHAREDIR)/commons/*.cmi +- rm -f $(DESTDIR)$(SHAREDIR)/globals/*.cmi +- rm -f $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui/* +- rm -f $(DESTDIR)$(SHAREDIR)/python/coccilib/*.py +- rmdir --ignore-fail-on-non-empty -p \ +- $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui +- rmdir $(DESTDIR)$(SHAREDIR)/globals +- rmdir $(DESTDIR)$(SHAREDIR)/commons +- rmdir $(DESTDIR)$(SHAREDIR)/parsing_c +- rmdir $(DESTDIR)$(SHAREDIR)/ocaml +- rmdir $(DESTDIR)$(SHAREDIR) +- rm -f $(DESTDIR)$(MANDIR)/man1/spatch.1 +- rm -f $(DESTDIR)$(MANDIR)/man3/Coccilib.3cocci ++ rm -f $(DESTDIR)$(BINDIR)/spatch ++ rm -f $(DESTDIR)$(BINDIR)/spatch.opt ++ rm -f $(DESTDIR)$(BINDIR)/spatch.byte ++ rm -rf $(DESTDIR)$(SHAREDIR) ++ rm -f $(DESTDIR)$(MANDIR)/man1/spatch.1 ++ rm -f $(DESTDIR)$(MANDIR)/man3/Coccilib.3cocci + + uninstall-bash: + rm -f $(DESTDIR)$(BASH_COMPLETION_DIR)/spatch diff --git a/patches/cohttp/0001-revert-header-change.patch b/patches/cohttp/0001-revert-header-change.patch new file mode 100644 index 0000000..e6f367a --- /dev/null +++ b/patches/cohttp/0001-revert-header-change.patch @@ -0,0 +1,44 @@ +From e0ede41da2d0d518b950a4ef652b216195b7f7dd Mon Sep 17 00:00:00 2001 +From: Marcello Seri +Date: Mon, 20 Jul 2020 11:07:52 +0200 +Subject: revert header change + +Signed-off-by: Marcello Seri +--- + cohttp/src/header.ml | 4 +--- + cohttp/src/header.mli | 4 ++-- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/cohttp/src/header.ml b/cohttp/src/header.ml +index 00fad5a..dc86226 100644 +--- a/cohttp/src/header.ml ++++ b/cohttp/src/header.ml +@@ -77,9 +77,7 @@ let remove h k = + + let replace h k v = + let k = LString.of_string k in +- if StringMap.mem k h +- then StringMap.add k [v] h +- else h ++ StringMap.add k [v] h + + let get h k = + let k = LString.of_string k in +diff --git a/cohttp/src/header.mli b/cohttp/src/header.mli +index 9868832..c3cff88 100644 +--- a/cohttp/src/header.mli ++++ b/cohttp/src/header.mli +@@ -56,8 +56,8 @@ val add_opt_unless_exists : t option -> string -> string -> t + original header parameter is not modified. *) + val remove : t -> string -> t + +-(** Replace the value of a key from the header map if it exists. The +- original header parameter is not modified. *) ++(** Replace the value of a key from the header map if it exists, otherwise it ++ adds it to the header map. The original header parameter is not modified. *) + val replace : t -> string -> string -> t + + (** Check if a key exists in the header. *) +-- +2.24.3 (Apple Git-128) + diff --git a/patches/colibrics/big_constant.patch b/patches/colibrics/big_constant.patch new file mode 100644 index 0000000..83844cb --- /dev/null +++ b/patches/colibrics/big_constant.patch @@ -0,0 +1,23 @@ +commit f5f6c9bb104525a44db53d1230fdf7ffab1345de +Author: François Bobot +Date: Sun Jun 19 20:10:41 2022 +0200 + + Remove large integer constant in colibrics + +diff --git a/src/bin/options.ml b/src/bin/options.ml +index 721859b3..bd5a281c 100644 +--- a/src/bin/options.ml ++++ b/src/bin/options.ml +@@ -152,12 +152,10 @@ let parse_time arg = + let size_string f = + let n = int_of_float f in + let aux n div = n / div, n mod div in +- let n_tera, n = aux n 1_000_000_000_000 in + let n_giga, n = aux n 1_000_000_000 in + let n_mega, n = aux n 1_000_000 in + let n_kilo, n = aux n 1_000 in + let print_aux s n = if n <> 0 then (string_of_int n) ^ s else "" in +- (print_aux "To" n_tera) ^ + (print_aux "Go" n_giga) ^ + (print_aux "Mo" n_mega) ^ + (print_aux "ko" n_kilo) ^ diff --git a/patches/combine/META.0.42 b/patches/combine/META.0.42 new file mode 100644 index 0000000..4081d31 --- /dev/null +++ b/patches/combine/META.0.42 @@ -0,0 +1,5 @@ +name = "combine" +version = "0.42" +description = "A library for combinatorics problems" +archive(byte) = "combine.cma" +archive(native) = "combine.cmxa" \ No newline at end of file diff --git a/patches/combine/combine.install b/patches/combine/combine.install new file mode 100644 index 0000000..7c85df4 --- /dev/null +++ b/patches/combine/combine.install @@ -0,0 +1 @@ +lib: ["META"] diff --git a/patches/combine/install.diff b/patches/combine/install.diff new file mode 100644 index 0000000..bb1a3ce --- /dev/null +++ b/patches/combine/install.diff @@ -0,0 +1,21 @@ +diff --git a/Makefile.in b/Makefile.in +index ed3e41d..5a1549c 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -46,7 +46,6 @@ OCAMLOPT = @OCAMLOPT@ + OCAMLDEP = @OCAMLDEP@ + OCAMLLEX = @OCAMLLEX@ + MENHIR = menhir # developers should have menhir installed +-OCAMLLIB = @OCAMLLIB@ + OCAMLBEST= @OCAMLBEST@ + OCAMLVERSION = @OCAMLVERSION@ + OCAMLWEB = @OCAMLWEB@ +@@ -141,7 +140,7 @@ queens.opt: $(CMXA) queens.cmx + # installation + ############## + +-INSTALL_LIBDIR=$(OCAMLLIB)/combine ++INSTALL_LIBDIR=$(prefix)/lib/combine + + install-indep: + mkdir -p $(BINDIR) diff --git a/patches/commonjs_of_ocaml/_oasis_remove_.ml b/patches/commonjs_of_ocaml/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/commonjs_of_ocaml/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/commonjs_of_ocaml/commonjs_of_ocaml.install b/patches/commonjs_of_ocaml/commonjs_of_ocaml.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/commonjs_of_ocaml/commonjs_of_ocaml.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/comparelib/disable_warn_error.patch b/patches/comparelib/disable_warn_error.patch new file mode 100644 index 0000000..466d260 --- /dev/null +++ b/patches/comparelib/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.480655310 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.638903913 -0500 +@@ -575,7 +575,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/conf-bap-llvm/configure b/patches/conf-bap-llvm/configure new file mode 100644 index 0000000..5121d09 --- /dev/null +++ b/patches/conf-bap-llvm/configure @@ -0,0 +1,45 @@ +#!/bin/sh + +# if LLVM_CONFIG variable doesn't explicitly specify which llvm-config +# we should use, then we will search across all possible llvm-configs +# that might work for us. Our search strategy is to try to pick up +# 3.4, then 3.8, and, if neither found, fallback to any llvm-config. +# +# Note1 - suffix `-mp-` stands for macports, and will work on macs +# ifused with macports. +# +# Note2 - the LLVM_CONFIG variable is a fallback for debugging or +# workarounds. The recommended way to install a desired of +# llvm is to use `llvm-conf.` package. + + +configs="llvm-config-3.4 llvm-config-mp-3.4 llvm-config-3.8 llvm-config-mp-3.8 llvm-config" + +config=`opam config var llvm-config 2>/dev/null` || true +if [ -z $config ]; then + config=$LLVM_CONFIG +fi + +if ! which "$config"; then + for c in $configs; do + if which $c; then + config=$c + break + fi + done +fi + +if ! which "$config" ; then + exit 1 +else + version=`$config --version` +fi + +filename="conf-bap-llvm.config" +cat > $filename < Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let of_opam_config () = + let cfg = "%{llvm-config}%" in + if cfg = "" then None + else Some cfg + +let of_env () = + try Some (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let (/) = Filename.concat + +let normalize ver = + let ver = + if String.length ver >= 3 then + String.sub ver 0 3 + else ver in + if ver > "3.8" then String.sub ver 0 1 + else ver + +let brew_config ver = + match cmd "brew --cellar" with + | None -> None + | Some cellar -> + match cmd "ls %s | grep %s" cellar (normalize ver) with + | None -> None + | Some p -> + cmd "find %s/%s -name \"llvm-config\"" cellar p + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let configs ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + "llvm-config"; + ] in + match "%{os}%" with + | "macos" -> + let configs = match brew_config ver with + | None -> configs + | Some b -> b :: configs in + macports_config ver :: configs + | _ -> configs + +let find_opt ~f xs = + try Some (List.find f xs) + with Not_found -> None + +let versions_equal v v' = + normalize v = normalize v' + +let locate () = + let versions = ["4.0"; "3.8"; "3.4"] in + List.fold_left (fun cfg ver -> + match cfg with + | Some _ -> cfg + | None -> + let configs = configs ver in + find_opt (fun cfg -> + match cmd "which %s" cfg with + | None -> false + | Some cfg -> + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> + List.exists (versions_equal ver') versions) configs) + None versions + +let rec find_map fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find_map fs + | x -> x + +let () = + try + let path = match find_map [of_opam_config; of_env; locate] with + | Some cfg -> cmd "which %s" cfg + | None -> None in + match path with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-bap-llvm/find-llvm.ml.in.1.2 b/patches/conf-bap-llvm/find-llvm.ml.in.1.2 new file mode 100644 index 0000000..f13696d --- /dev/null +++ b/patches/conf-bap-llvm/find-llvm.ml.in.1.2 @@ -0,0 +1,148 @@ +#load "unix.cma" + +open Printf + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let of_opam_config () = + let cfg = "%{llvm-config}%" in + if cfg = "" then None + else Some cfg + +let of_env () = + try Some (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let (/) = Filename.concat + +let normalize ver = + let ver = + if String.length ver >= 3 then + String.sub ver 0 3 + else ver in + if ver > "3.8" then String.sub ver 0 1 + else ver + +let brew_config ver = + match cmd "brew --cellar" with + | None -> None + | Some cellar -> + match cmd "ls %s | grep %s" cellar (normalize ver) with + | None -> None + | Some p -> + cmd "find %s/%s -name \"llvm-config\"" cellar p + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let configs ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + "llvm-config"; + ] in + match "%{os}%" with + | "macos" -> + let configs = match brew_config ver with + | None -> configs + | Some b -> b :: configs in + macports_config ver :: configs + | _ -> configs + +let find_opt ~f xs = + try Some (List.find f xs) + with Not_found -> None + +let versions_equal v v' = + normalize v = normalize v' + +let locate () = + let versions = ["5.0"; "4.0"; "3.8"; "3.4"] in + List.fold_left (fun cfg ver -> + match cfg with + | Some _ -> cfg + | None -> + let configs = configs ver in + find_opt (fun cfg -> + match cmd "which %s" cfg with + | None -> false + | Some cfg -> + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> + List.exists (versions_equal ver') versions) configs) + None versions + +let rec find_map fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find_map fs + | x -> x + +let () = + try + let path = match find_map [of_opam_config; of_env; locate] with + | Some cfg -> cmd "which %s" cfg + | None -> None in + match path with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-bap-llvm/find-llvm.ml.in.1.3 b/patches/conf-bap-llvm/find-llvm.ml.in.1.3 new file mode 100644 index 0000000..e5ce214 --- /dev/null +++ b/patches/conf-bap-llvm/find-llvm.ml.in.1.3 @@ -0,0 +1,148 @@ +#load "unix.cma" + +open Printf + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let of_opam_config () = + let cfg = "%{llvm-config}%" in + if cfg = "" then None + else Some cfg + +let of_env () = + try Some (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let (/) = Filename.concat + +let normalize ver = + let ver = + if String.length ver >= 3 then + String.sub ver 0 3 + else ver in + if ver > "3.8" then String.sub ver 0 1 + else ver + +let brew_config ver = + match cmd "brew --cellar" with + | None -> None + | Some cellar -> + match cmd "ls %s | grep %s" cellar (normalize ver) with + | None -> None + | Some p -> + cmd "find %s/%s -name \"llvm-config\"" cellar p + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let configs ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + "llvm-config"; + ] in + match "%{os}%" with + | "macos" -> + let configs = match brew_config ver with + | None -> configs + | Some b -> b :: configs in + macports_config ver :: configs + | _ -> configs + +let find_opt ~f xs = + try Some (List.find f xs) + with Not_found -> None + +let versions_equal v v' = + normalize v = normalize v' + +let locate () = + let versions = ["7.0"; "6.0"; "5.0"; "4.0"; "3.8"; "3.4"] in + List.fold_left (fun cfg ver -> + match cfg with + | Some _ -> cfg + | None -> + let configs = configs ver in + find_opt (fun cfg -> + match cmd "which %s" cfg with + | None -> false + | Some cfg -> + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> + List.exists (versions_equal ver') versions) configs) + None versions + +let rec find_map fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find_map fs + | x -> x + +let () = + try + let path = match find_map [of_opam_config; of_env; locate] with + | Some cfg -> cmd "which %s" cfg + | None -> None in + match path with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-bap-llvm/find-llvm.ml.in.1.4 b/patches/conf-bap-llvm/find-llvm.ml.in.1.4 new file mode 100644 index 0000000..795b3ad --- /dev/null +++ b/patches/conf-bap-llvm/find-llvm.ml.in.1.4 @@ -0,0 +1,148 @@ +#load "unix.cma" + +open Printf + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let of_opam_config () = + let cfg = "%{llvm-config}%" in + if cfg = "" then None + else Some cfg + +let of_env () = + try Some (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let (/) = Filename.concat + +let normalize ver = + let ver = + if String.length ver >= 3 then + String.sub ver 0 3 + else ver in + if ver > "3.8" then String.sub ver 0 1 + else ver + +let brew_config ver = + match cmd "brew --cellar" with + | None -> None + | Some cellar -> + match cmd "ls %s | grep %s" cellar (normalize ver) with + | None -> None + | Some p -> + cmd "find %s/%s -name \"llvm-config\"" cellar p + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let configs ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + "llvm-config"; + ] in + match "%{os}%" with + | "macos" -> + let configs = match brew_config ver with + | None -> configs + | Some b -> b :: configs in + macports_config ver :: configs + | _ -> configs + +let find_opt ~f xs = + try Some (List.find f xs) + with Not_found -> None + +let versions_equal v v' = + normalize v = normalize v' + +let locate () = + let versions = ["8.0"; "7.0"; "6.0"; "5.0"; "4.0"; "3.8"; "3.4"] in + List.fold_left (fun cfg ver -> + match cfg with + | Some _ -> cfg + | None -> + let configs = configs ver in + find_opt (fun cfg -> + match cmd "which %s" cfg with + | None -> false + | Some cfg -> + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> + List.exists (versions_equal ver') versions) configs) + None versions + +let rec find_map fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find_map fs + | x -> x + +let () = + try + let path = match find_map [of_opam_config; of_env; locate] with + | Some cfg -> cmd "which %s" cfg + | None -> None in + match path with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-bap-llvm/find-llvm.ml.in.1.5 b/patches/conf-bap-llvm/find-llvm.ml.in.1.5 new file mode 100644 index 0000000..4c9ef6d --- /dev/null +++ b/patches/conf-bap-llvm/find-llvm.ml.in.1.5 @@ -0,0 +1,146 @@ +#load "unix.cma" + +open Printf + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> None in + ksprintf run fmt + +let of_opam_config () = + let cfg = "%{llvm-config}%" in + if cfg = "" then None + else Some cfg + +let of_env () = + try Some (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let (/) = Filename.concat + +let normalize ver = + let ver = + if String.length ver >= 3 then + String.sub ver 0 3 + else ver in + if ver > "3.8" then String.sub ver 0 1 + else ver + +let brew_config ver = + match cmd "brew --cellar" with + | None -> None + | Some cellar -> + match cmd "ls %s | grep %s" cellar (normalize ver) with + | None -> None + | Some p -> + cmd "find %s/%s -name \"llvm-config\"" cellar p + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let configs ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + "llvm-config"; + ] in + match "%{os}%" with + | "macos" -> + let configs = match brew_config ver with + | None -> configs + | Some b -> b :: configs in + macports_config ver :: configs + | _ -> configs + +let find_opt ~f xs = + try Some (List.find f xs) + with Not_found -> None + +let versions_equal v v' = + normalize v = normalize v' + +let locate () = + let versions = ["9.0"; "8.0"; "7.0"; "6.0"; "5.0"; "4.0"; "3.8"; "3.4"] in + List.fold_left (fun cfg ver -> + match cfg with + | Some _ -> cfg + | None -> + let configs = configs ver in + find_opt (fun cfg -> + match cmd "which %s" cfg with + | None -> false + | Some cfg -> + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> + List.exists (versions_equal ver') versions) configs) + None versions + +let rec find_map fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find_map fs + | x -> x + +let () = + try + let path = match find_map [of_opam_config; of_env; locate] with + | Some cfg -> cmd "which %s" cfg + | None -> None in + match path with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-bap-llvm/find-llvm.ml.in.1.6 b/patches/conf-bap-llvm/find-llvm.ml.in.1.6 new file mode 100644 index 0000000..95dda71 --- /dev/null +++ b/patches/conf-bap-llvm/find-llvm.ml.in.1.6 @@ -0,0 +1,155 @@ +#load "unix.cma" + +open Printf + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let of_opam_config () = + let cfg = "%{llvm-config}%" in + if cfg = "" then None + else Some cfg + +let of_env () = + try Some (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let (/) = Filename.concat + + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let major_version ver = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i + +let normalize ver = + match major_version ver with + | "3" -> + if String.length ver >= 3 then + String.sub ver 0 3 + else ver + | x -> x + +let brew_config ver = + match cmd "brew --cellar" with + | None -> None + | Some cellar -> + match cmd "ls %s | grep %s" cellar (normalize ver) with + | None -> None + | Some p -> + cmd "find %s/%s -name \"llvm-config\"" cellar p + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + + +let configs ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + sprintf "llvm-config-%s" (major_version ver); + "llvm-config"; + ] in + match "%{os}%" with + | "macos" -> + let configs = match brew_config ver with + | None -> configs + | Some b -> b :: configs in + macports_config ver :: configs + | _ -> configs + +let find_opt ~f xs = + try Some (List.find f xs) + with Not_found -> None + +let versions_equal v v' = + normalize v = normalize v' + +let locate () = + let versions = ["10.0"; "9.0"; "8.0"; "7.0"; "6.0"; "5.0"; "4.0"; "3.8"; "3.4"] in + List.fold_left (fun cfg ver -> + match cfg with + | Some _ -> cfg + | None -> + let configs = configs ver in + find_opt (fun cfg -> + match cmd "which %s" cfg with + | None -> false + | Some cfg -> + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> + List.exists (versions_equal ver') versions) configs) + None versions + +let rec find_map fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find_map fs + | x -> x + +let () = + try + let path = match find_map [of_opam_config; of_env; locate] with + | Some cfg -> cmd "which %s" cfg + | None -> None in + match path with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-bap-llvm/find-llvm.ml.in.1.7 b/patches/conf-bap-llvm/find-llvm.ml.in.1.7 new file mode 100644 index 0000000..910c1c0 --- /dev/null +++ b/patches/conf-bap-llvm/find-llvm.ml.in.1.7 @@ -0,0 +1,183 @@ +open Printf +open StdLabels + +let versions = ["12.0"; "11.0"; "10.0"; "9.0"; "8.0"; "7.0"; "6.0"] + +let (/) = Filename.concat + +let input_all ch = + let buf = Buffer.create 4096 in + let rec read () = Buffer.add_channel buf ch 4096; read () in + try read () + with End_of_file -> String.trim @@ Buffer.contents buf + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = input_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> None in + ksprintf run fmt + +let which c = cmd "which %s" c + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let major_version ver = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i + +let versions_equal v v' = + String.equal (major_version v) (major_version v') + +let is_supported_version cfg = + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> List.exists (versions_equal ver') versions + +let of_opam_config () = + match "%{llvm-config}%" with + | "" -> None + | cfg -> which cfg + +let of_env () = + try which (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let has_prefix str pref = + let len = String.length pref in + len <= String.length str && + String.sub str 0 len = pref + +let is_llvm_config file = + has_prefix (Filename.basename file) "llvm-config" && + is_supported_version file + +let opendir path = + try Some (Unix.opendir path) + with Unix.Unix_error _ -> None + +let next dir = + try Some (Unix.readdir dir) + with End_of_file -> None + +let is_dir path = + Sys.file_exists path && Sys.is_directory path + +let search path = + let is_parent p = p = Filename.parent_dir_name in + let is_hidden p = String.length p > 0 && p.[0] = '.' in + let leave dir result = + Unix.closedir dir; + result in + let rec read current dir = + match next dir with + | None -> leave dir None + | Some entry when is_parent entry || is_hidden entry -> + read current dir + | Some entry when is_dir (current / entry) -> + begin + let path = current / entry in + match opendir path with + | None -> read current dir + | Some subdir -> match read path subdir with + | None -> read current dir + | found -> leave dir found + end + | Some entry -> + let path = current / entry in + if is_llvm_config path + then leave dir (Some path) + else read current dir in + match opendir path with + | None -> None + | Some dir -> read path dir + +let find_in_cellar () = match cmd "brew --cellar" with + | None -> None + | Some cellar -> search cellar + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + +let configs_of_version ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + sprintf "llvm-config-%s" (major_version ver)] in + match "%{os}%" with + | "macos" -> macports_config ver :: configs + | _ -> configs + +let locate_by_version () = + let rec find = function + | [] -> None + | cfg :: cfgs -> match which cfg with + | Some _ as path -> path + | None -> find cfgs in + find @@ + List.fold_left versions ~init:[] ~f:(fun acc ver -> + acc @ configs_of_version ver) + +let which_llvm_config () = match which "llvm-config" with + | None -> None + | Some cfg -> + if is_supported_version cfg then Some cfg + else None + +let rec first_success fs = + match fs with + | [] -> None + | f :: fs -> match f () with + | None -> first_success fs + | x -> x + +let () = + try + let base = [ of_opam_config; of_env; locate_by_version; + which_llvm_config;] in + let os_specific = match "%{os}%" with + | "macos" -> [find_in_cellar] + | _ -> [] in + match first_success (base @ os_specific) with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-bap-llvm/find-llvm.ml.in.1.8 b/patches/conf-bap-llvm/find-llvm.ml.in.1.8 new file mode 100644 index 0000000..b2ca290 --- /dev/null +++ b/patches/conf-bap-llvm/find-llvm.ml.in.1.8 @@ -0,0 +1,183 @@ +open Printf +open StdLabels + +let versions = ["14.0"; "13.0"; "12.0"; "11.0"; "10.0"; "9.0"; "8.0"; "7.0"; "6.0"] + +let (/) = Filename.concat + +let input_all ch = + let buf = Buffer.create 4096 in + let rec read () = Buffer.add_channel buf ch 4096; read () in + try read () + with End_of_file -> String.trim @@ Buffer.contents buf + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = input_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> None in + ksprintf run fmt + +let which c = cmd "which %s" c + +let index_opt str c = + try Some (String.index str '.') + with Not_found -> None + +let major_version ver = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i + +let versions_equal v v' = + String.equal (major_version v) (major_version v') + +let is_supported_version cfg = + match cmd "%s --version" cfg with + | None -> false + | Some ver' -> List.exists (versions_equal ver') versions + +let of_opam_config () = + match "%{llvm-config}%" with + | "" -> None + | cfg -> which cfg + +let of_env () = + try which (Sys.getenv "LLVM_CONFIG") + with Not_found -> None + +let write path version = + let digest = Digest.to_hex (Digest.file path) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +file-depends: [ [ %S %S ] ] +variables { + config: %S + package-version: "%s" +} +|} path digest path version; + close_out oc + +let has_prefix str pref = + let len = String.length pref in + len <= String.length str && + String.sub str 0 len = pref + +let is_llvm_config file = + has_prefix (Filename.basename file) "llvm-config" && + is_supported_version file + +let opendir path = + try Some (Unix.opendir path) + with Unix.Unix_error _ -> None + +let next dir = + try Some (Unix.readdir dir) + with End_of_file -> None + +let is_dir path = + Sys.file_exists path && Sys.is_directory path + +let search path = + let is_parent p = p = Filename.parent_dir_name in + let is_hidden p = String.length p > 0 && p.[0] = '.' in + let leave dir result = + Unix.closedir dir; + result in + let rec read current dir = + match next dir with + | None -> leave dir None + | Some entry when is_parent entry || is_hidden entry -> + read current dir + | Some entry when is_dir (current / entry) -> + begin + let path = current / entry in + match opendir path with + | None -> read current dir + | Some subdir -> match read path subdir with + | None -> read current dir + | found -> leave dir found + end + | Some entry -> + let path = current / entry in + if is_llvm_config path + then leave dir (Some path) + else read current dir in + match opendir path with + | None -> None + | Some dir -> read path dir + +let find_in_cellar () = match cmd "brew --cellar" with + | None -> None + | Some cellar -> search cellar + +let macports_config ver = sprintf "llvm-config-mp-%s" ver + +let configs_of_version ver = + let ver' = match index_opt ver '.' with + | None -> ver + | Some i -> String.sub ver 0 i ^ String.sub ver (i + 1) 1 in + let configs = [ + sprintf "llvm-config-%s" ver; + sprintf "llvm-config-%s" ver'; + sprintf "llvm-config-%s" (major_version ver)] in + match "%{os}%" with + | "macos" -> macports_config ver :: configs + | _ -> configs + +let locate_by_version () = + let rec find = function + | [] -> None + | cfg :: cfgs -> match which cfg with + | Some _ as path -> path + | None -> find cfgs in + find @@ + List.fold_left versions ~init:[] ~f:(fun acc ver -> + acc @ configs_of_version ver) + +let which_llvm_config () = match which "llvm-config" with + | None -> None + | Some cfg -> + if is_supported_version cfg then Some cfg + else None + +let rec first_success fs = + match fs with + | [] -> None + | f :: fs -> match f () with + | None -> first_success fs + | x -> x + +let () = + try + let base = [ of_opam_config; of_env; locate_by_version; + which_llvm_config;] in + let os_specific = match "%{os}%" with + | "macos" -> [find_in_cellar] + | _ -> [] in + match first_success (base @ os_specific) with + | None -> eprintf "LLVM not found"; exit 1 + | Some path -> + match cmd "%s --version" path with + | None -> eprintf "'%s --version' failed\n" path; exit 1 + | Some version -> write path version + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-binutils/find-binutils.ml.in.0.1 b/patches/conf-binutils/find-binutils.ml.in.0.1 new file mode 100644 index 0000000..3e3d09d --- /dev/null +++ b/patches/conf-binutils/find-binutils.ml.in.0.1 @@ -0,0 +1,132 @@ +#load "unix.cma" + +open Printf + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +let split_on_char sep s = + let r = ref [] in + let j = ref (String.length s) in + for i = String.length s - 1 downto 0 do + if String.get s i = sep then begin + r := String.sub s (i + 1) (!j - i - 1) :: !r; + j := i + end + done; + String.sub s 0 !j :: !r + +let split str = + List.map String.trim (split_on_char '\n' str) |> + List.filter (fun s -> s <> "") + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let split_results fmt = + let run c = + match cmd "%s" c with + | None -> [] + | Some s -> split s in + ksprintf run fmt + +let string_of_targets targets = + List.fold_left (fun acc x -> + sprintf "%s\"%s\"; " acc x) "[" targets ^ "]" + +let write objdump targets = + let digest path = Digest.to_hex (Digest.file path) in + let depends = function + | None -> "" + | Some file -> + sprintf "[ %S %S ]" file (digest file) in + let get x = match x with + | None -> "" + | Some x -> x in + let file_depends = + let deps = depends objdump in + if deps = "" then "" + else sprintf "file-depends: [ %s ]" deps in + let targets = string_of_targets targets in + let oc = open_out "%{_:name}%.config" in + let objdump = get objdump in + fprintf oc {| +opam-version: "2.0" +%s +variables { + objdump: %S + targets: %S +} +|} file_depends objdump targets; + close_out oc + +let collect_objdumps () = + let find where = + split_results + "find %s -name \"*objdump\" -executable -type f" where in + find "/bin" @ find "/usr" + +let collect_targets objdumps = + let has_prefix str pref = + let len = String.length pref in + len <= String.length str && + String.(sub str 0 len = pref) in + List.fold_left (fun acc obj -> + let file = Filename.basename obj in + if file = "objdump" || file = "gobjdump" || has_prefix file "llvm" + then acc + else + if Filename.check_suffix file "-objdump" then + Filename.chop_suffix file "-objdump" :: acc + else acc) [] objdumps + +let which = cmd "which %s" + +let () = + try + match "%{os}%" with + | "linux" -> + let objdump = which "objdump" in + let objdumps = collect_objdumps () in + let targets = collect_targets objdumps in + write objdump targets + | "macos" -> + let objdump= which "gobjdump" in + let objdumps = split_results "mdfind -name objdump" in + let objdumps = List.filter (fun x -> not (Sys.is_directory x)) objdumps in + let targets = collect_targets objdumps in + write objdump targets + | s -> + eprintf "unsupported OS %s\n" s; + exit 1 + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-binutils/find-binutils.ml.in.0.2 b/patches/conf-binutils/find-binutils.ml.in.0.2 new file mode 100644 index 0000000..7413d97 --- /dev/null +++ b/patches/conf-binutils/find-binutils.ml.in.0.2 @@ -0,0 +1,146 @@ +#load "unix.cma" + +open Printf + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +let split_on_char sep s = + let r = ref [] in + let j = ref (String.length s) in + for i = String.length s - 1 downto 0 do + if String.get s i = sep then begin + r := String.sub s (i + 1) (!j - i - 1) :: !r; + j := i + end + done; + String.sub s 0 !j :: !r + +let split str = + List.map String.trim (split_on_char '\n' str) |> + List.filter (fun s -> s <> "") + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let split_results fmt = + let run c = + match cmd "%s" c with + | None -> [] + | Some s -> split s in + ksprintf run fmt + +let string_of_targets targets = + List.fold_left (fun acc x -> + sprintf "%s\"%s\"; " acc x) "[" targets ^ "]" + +let is_none = function + | None -> true + | _ -> false + +let failed_to_find cmd = + eprintf "%s not found\n" cmd; + exit 1 + +let write objdump cxxfilt targets = + if is_none objdump then failed_to_find "objdump"; + if is_none cxxfilt then failed_to_find "cxxfilt"; + let digest path = Digest.to_hex (Digest.file path) in + let depends = function + | None -> "" + | Some file -> + sprintf "[ %S %S ]" file (digest file) in + let get x = match x with + | None -> "" + | Some x -> x in + let file_depends = + let deps = String.concat " " [depends objdump; depends cxxfilt] in + if deps = "" then "" + else sprintf "file-depends: [ %s ]" deps in + let targets = string_of_targets targets in + let oc = open_out "%{_:name}%.config" in + let cxxfilt = get cxxfilt in + let objdump = get objdump in + fprintf oc {| +opam-version: "2.0" +%s +variables { + cxxfilt: %S + objdump: %S + targets: %S +} +|} file_depends cxxfilt objdump targets; + close_out oc + +let collect_objdumps () = + let find where = + split_results + "find %s -name \"*objdump\" -executable -type f" where in + find "/bin" @ find "/usr" + +let collect_targets objdumps = + let has_prefix str pref = + let len = String.length pref in + len <= String.length str && + String.(sub str 0 len = pref) in + List.fold_left (fun acc obj -> + let file = Filename.basename obj in + if file = "objdump" || file = "gobjdump" || has_prefix file "llvm" + then acc + else + if Filename.check_suffix file "-objdump" then + Filename.chop_suffix file "-objdump" :: acc + else acc) [] objdumps + +let which = cmd "which %s" + +let () = + try + match "%{os}%" with + | "linux" -> + let objdump = which "objdump" in + let cxxfilt = which "c++filt" in + let objdumps = collect_objdumps () in + let targets = collect_targets objdumps in + write objdump cxxfilt targets + | "macos" -> + let objdump= which "gobjdump" in + let cxxfilt = which "c++filt" in + let objdumps = split_results "mdfind -name objdump" in + let objdumps = List.filter (fun x -> not (Sys.is_directory x)) objdumps in + let targets = collect_targets objdumps in + write objdump cxxfilt targets + | s -> + eprintf "unsupported OS %s\n" s; + exit 1 + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-binutils/find-binutils.ml.in.0.3 b/patches/conf-binutils/find-binutils.ml.in.0.3 new file mode 100644 index 0000000..e29c3a1 --- /dev/null +++ b/patches/conf-binutils/find-binutils.ml.in.0.3 @@ -0,0 +1,221 @@ +open Printf +open StdLabels + +type file = { + path : string; + dgst : string; +} + +type tool = { + test : string -> bool; + main : file option; + files : file list; +} + +module Digests = Set.Make(String) +module Names = Map.Make(String) + +type t = tool Names.t + +let (/) = Filename.concat + +let digest path = Digest.to_hex (Digest.file path) + +let input_all ch = + let buf = Buffer.create 4096 in + let rec read () = Buffer.add_channel buf ch 4096; read () in + try read () + with End_of_file -> String.trim @@ Buffer.contents buf + +let split_on_char sep s = + let r = ref [] in + let j = ref (String.length s) in + for i = String.length s - 1 downto 0 do + if s.[i] = sep then begin + r := String.sub s (i + 1) (!j - i - 1) :: !r; + j := i + end + done; + String.sub s 0 !j :: !r + +let split ~on str = + List.map String.trim (split_on_char on str) |> + List.filter ~f:(fun s -> s <> "") + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = input_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let string_of_files xs = + List.fold_left xs ~f:(fun s {path} -> + sprintf "%s\"%s\"; " s path) ~init:"[" ^ "]" + +let is_none = function + | None -> true + | _ -> false + +let failed_to_find cmd = + eprintf "%s not found\n" cmd; + exit 1 + +let dedup main files = + fst @@ + List.fold_left files + ~init:([], Digests.add main.dgst Digests.empty) + ~f:(fun ((files, digests) as acc) ({dgst} as file) -> + if Digests.mem dgst digests + then acc + else file :: files, Digests.add dgst digests) + +let dependencies ~init files = + List.fold_left files ~init ~f:(fun depends {path; dgst} -> + sprintf " [ %S %S ] " path dgst :: depends) + +let write t = + let deps, vars = + Names.fold (fun name {main; files} (deps, vars) -> + let main, files = match main, files with + | None, [] -> failed_to_find name + | None, main :: files -> main, files + | Some main, files -> main, files in + let files = dedup main files in + let files = main :: files in + let deps = dependencies ~init:deps files in + let files = sprintf "%s: %S" name (string_of_files files) in + deps, files :: vars) t ([], []) in + let oc = open_out "%{_:name}%.config" in + let deps = String.concat "\n" deps in + let vars = String.concat "\n" vars in + fprintf oc {| +opam-version: "2.0" +file-depends: [ %s ] +variables { +%s +} +|} deps vars; + close_out oc + +let of_env var () = + try Some (Sys.getenv var) + with Not_found -> None + +let of_opam_config var () = match var with + | "" -> None + | x -> Some x + +let match_files path files test = + Array.fold_left files ~init:[] ~f:(fun acc file -> + if test file then + let path = path / file in + {path; dgst = digest path} :: acc + else acc) + +let update t path = + if Sys.is_directory path then + let files = Sys.readdir path in + Names.fold (fun name tool t -> + let files = match_files path files tool.test in + Names.add name {tool with files = tool.files @ files} t) t t + else t + +let collect t paths = List.fold_left paths ~f:update ~init:t + +let search t path = + let rec loop t path = + if Sys.is_directory path + then + Sys.readdir path |> + Array.fold_left ~init:t ~f:(fun t file -> loop t @@ path / file) + else + Names.fold (fun name tool t -> + if tool.test (Filename.basename path) + then + let file = {path; dgst = digest path} in + Names.add name {tool with files = tool.files @ [file]} t + else t) t t in + loop t path + +let rec first_success = function + | [] -> None + | f :: fs -> match f () with + | None -> first_success fs + | r -> r + +let is_dir p = Sys.file_exists p && Sys.is_directory p + +let all_paths () = + match of_env "PATH" () with + | None -> [] + | Some r -> List.filter ~f:is_dir (split r ~on:':') + +let has_prefix str pref = + let len = String.length pref in + len <= String.length str && + String.sub str 0 len = pref + +let is_llvm_tool file = has_prefix file "llvm" + +let check ~suffix file = + Filename.check_suffix file suffix && + not (is_llvm_tool file) + +let add_var name ?(opam="") ?(env="") ~suffix t = + let main = + match first_success [of_opam_config opam; of_env env] with + | None -> None + | Some path -> Some {path; dgst = digest path } in + Names.add name {test = check ~suffix; main; files = []} t + +let t = + add_var "objdumps" + ~opam:"%{objdump-path}%" + ~env:"OBJDUMP_PATH" + ~suffix:"objdump" + Names.empty |> + add_var "cxxfilts" + ~opam:"%{cxxfilt-path}%" + ~env:"CXXFILT_PATH" + ~suffix:"c++filt" |> + add_var "readelfs" + ~opam:"%{readelf-path}%" + ~env:"READELF_PATH" + ~suffix:"readelf" + + +let () = + try + match "%{os}%" with + | "linux" | "freebsd" -> write @@ collect t @@ all_paths () + | "macos" -> + let t = match cmd "brew --cellar" with + | None -> t + | Some cellar -> search t cellar in + write @@ collect t @@ all_paths () + | s -> + eprintf "unsupported OS %s\n" s; + exit 1 + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-blas/test-win.sh b/patches/conf-blas/test-win.sh new file mode 100644 index 0000000..27902f3 --- /dev/null +++ b/patches/conf-blas/test-win.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +cc=$(ocamlc -config | awk '/^bytecomp_c_compiler/ {$1="";sub(/^ /, ""); print}') +$cc $CFLAGS test.c ${LACAML_LIBS:--lblas} diff --git a/patches/conf-blas/test.c b/patches/conf-blas/test.c new file mode 100644 index 0000000..0e48509 --- /dev/null +++ b/patches/conf-blas/test.c @@ -0,0 +1,10 @@ +extern double dnrm2_(int *N, double *X, int *INCX); + +int main(int argc, char **argv) +{ + int N = 3; + double X[] = { 1, 2, 3 }; + int INCX = 1; + double res = dnrm2_(&N, X, &INCX); + return 0; +} diff --git a/patches/conf-bluetooth/test-unix.c b/patches/conf-bluetooth/test-unix.c new file mode 100644 index 0000000..23dd3ce --- /dev/null +++ b/patches/conf-bluetooth/test-unix.c @@ -0,0 +1,13 @@ +#include +#include + +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); + return 0; +} diff --git a/patches/conf-bmake/detect_program.sh b/patches/conf-bmake/detect_program.sh new file mode 100644 index 0000000..b5fb082 --- /dev/null +++ b/patches/conf-bmake/detect_program.sh @@ -0,0 +1,43 @@ +### detect_program.sh -- Detect program and save its path + +wlog() +{ + { printf "$@"; printf '\n'; } 1>&2 +} + +detect_which() +{ + ( IFS=':' + for path_elt in ${PATH}; do + wlog 'Debug: Looking for %s in %s' "$1" "${path_elt}" + if [ -x "${path_elt}/$1" ]; then + printf '%s' "${path_elt}/$1" + exit 0 + fi + done + + printf 'false' + exit 1 ) +} + +detect_config() +{ + local program_path + + program_path=$(detect_which "$2") + + if [ "${program_path}" = 'false' ]; then + wlog 'Debug: %s: Not found in PATH.' "$2" + exit 1 + fi + + cat > "$1" <> conf-cmake.config diff --git a/patches/conf-dbm/test_gdbm.c b/patches/conf-dbm/test_gdbm.c new file mode 100644 index 0000000..b9365e8 --- /dev/null +++ b/patches/conf-dbm/test_gdbm.c @@ -0,0 +1,7 @@ +#include + +int main() { + GDBM_FILE db = gdbm_open("conf-dbm-testdb", 512, GDBM_WRCREAT, 0600, 0); + gdbm_close (db); + return 0; +} diff --git a/patches/conf-dbm/test_ndbm.c b/patches/conf-dbm/test_ndbm.c new file mode 100644 index 0000000..f6b21b7 --- /dev/null +++ b/patches/conf-dbm/test_ndbm.c @@ -0,0 +1,8 @@ +#include +#include + +int main() { + DBM *db = dbm_open("conf-dbm-testdb", O_CREAT | O_RDWR, 0600); + dbm_close (db); + return 0; +} diff --git a/patches/conf-env-travis/configure b/patches/conf-env-travis/configure new file mode 100644 index 0000000..a4ccf01 --- /dev/null +++ b/patches/conf-env-travis/configure @@ -0,0 +1,22 @@ +#!/bin/sh + +cat > conf-env-travis.config < + +int main(void) { + return 0; +} diff --git a/patches/conf-fts/test.c b/patches/conf-fts/test.c new file mode 100644 index 0000000..72b08bb --- /dev/null +++ b/patches/conf-fts/test.c @@ -0,0 +1,6 @@ +#include + +int main(void) +{ + return 0; +} diff --git a/patches/conf-gmp-paths/test-gmp.c b/patches/conf-gmp-paths/test-gmp.c new file mode 100644 index 0000000..842d981 --- /dev/null +++ b/patches/conf-gmp-paths/test-gmp.c @@ -0,0 +1,7 @@ +#include +int main () { + mpz_t n; + mpz_init (n); + mpz_clear (n); + return 1; +} diff --git a/patches/conf-gmp-powm-sec/test.c.1 b/patches/conf-gmp-powm-sec/test.c.1 new file mode 100644 index 0000000..439a9b9 --- /dev/null +++ b/patches/conf-gmp-powm-sec/test.c.1 @@ -0,0 +1,11 @@ +#include +#ifndef __GMP_H__ +#error "No GMP header" +#endif +#if __GNU_MP_VERSION < 5 +#error "GMP >= 5 is required to support mpz_powm_sec" +#endif + +void test(void) { + __gmp_init(); +} diff --git a/patches/conf-gmp-powm-sec/test.c.2 b/patches/conf-gmp-powm-sec/test.c.2 new file mode 100644 index 0000000..009fbaf --- /dev/null +++ b/patches/conf-gmp-powm-sec/test.c.2 @@ -0,0 +1,26 @@ +#include +#ifndef __GMP_H__ +#error "No GMP header" +#endif +#if __GNU_MP_VERSION < 5 +#error "GMP >= 5 is required to support mpz_powm_sec" +#endif + +void test(void) { + mpz_t base; + mpz_t exp; + mpz_t mod; + mpz_t rop; + + mpz_init_set_ui(base, 2u); + mpz_init_set_ui(exp, 4u); + mpz_init_set_ui(mod, 3u); + mpz_init(rop); + + mpz_powm_sec(rop, base, exp, mod); + + mpz_clear(base); + mpz_clear(exp); + mpz_clear(mod); + mpz_clear(rop); +} diff --git a/patches/conf-gmp-powm-sec/test.c.3 b/patches/conf-gmp-powm-sec/test.c.3 new file mode 100644 index 0000000..009fbaf --- /dev/null +++ b/patches/conf-gmp-powm-sec/test.c.3 @@ -0,0 +1,26 @@ +#include +#ifndef __GMP_H__ +#error "No GMP header" +#endif +#if __GNU_MP_VERSION < 5 +#error "GMP >= 5 is required to support mpz_powm_sec" +#endif + +void test(void) { + mpz_t base; + mpz_t exp; + mpz_t mod; + mpz_t rop; + + mpz_init_set_ui(base, 2u); + mpz_init_set_ui(exp, 4u); + mpz_init_set_ui(mod, 3u); + mpz_init(rop); + + mpz_powm_sec(rop, base, exp, mod); + + mpz_clear(base); + mpz_clear(exp); + mpz_clear(mod); + mpz_clear(rop); +} diff --git a/patches/conf-gmp/test.c.1 b/patches/conf-gmp/test.c.1 new file mode 100644 index 0000000..74e2843 --- /dev/null +++ b/patches/conf-gmp/test.c.1 @@ -0,0 +1,8 @@ +#include +#ifndef __GMP_H__ +#error "No GMP header" +#endif + +void test(void) { + __gmp_init(); +} diff --git a/patches/conf-gmp/test.c.2 b/patches/conf-gmp/test.c.2 new file mode 100644 index 0000000..da9c0b5 --- /dev/null +++ b/patches/conf-gmp/test.c.2 @@ -0,0 +1,10 @@ +#include +#ifndef __GMP_H__ +#error "No GMP header" +#endif + +void test(void) { + mpz_t n; + mpz_init(n); + mpz_clear(n); +} diff --git a/patches/conf-gmp/test.c.3 b/patches/conf-gmp/test.c.3 new file mode 100644 index 0000000..da9c0b5 --- /dev/null +++ b/patches/conf-gmp/test.c.3 @@ -0,0 +1,10 @@ +#include +#ifndef __GMP_H__ +#error "No GMP header" +#endif + +void test(void) { + mpz_t n; + mpz_init(n); + mpz_clear(n); +} diff --git a/patches/conf-gmp/test.c.4 b/patches/conf-gmp/test.c.4 new file mode 100644 index 0000000..da9c0b5 --- /dev/null +++ b/patches/conf-gmp/test.c.4 @@ -0,0 +1,10 @@ +#include +#ifndef __GMP_H__ +#error "No GMP header" +#endif + +void test(void) { + mpz_t n; + mpz_init(n); + mpz_clear(n); +} diff --git a/patches/conf-ida/find-ida.ml.in.0.1 b/patches/conf-ida/find-ida.ml.in.0.1 new file mode 100644 index 0000000..d3200ef --- /dev/null +++ b/patches/conf-ida/find-ida.ml.in.0.1 @@ -0,0 +1,156 @@ +#load "unix.cma" + +open Printf + +type sys = + | MacOs + | Linux + | Other of string + +let os = match "%{os}%" with + | "macos" -> MacOs + | "linux" -> Linux + | s -> Other s + +let (/) = Filename.concat + +let getenv_opt var = + try Some (Sys.getenv var) + with Not_found -> None + +let headless = os = Linux && getenv_opt "DISPLAY" = None + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +let split_on_char sep s = + let r = ref [] in + let j = ref (String.length s) in + for i = String.length s - 1 downto 0 do + if String.get s i = sep then begin + r := String.sub s (i + 1) (!j - i - 1) :: !r; + j := i + end + done; + String.sub s 0 !j :: !r + +let split str = + List.map String.trim (split_on_char '\n' str) |> + List.filter (fun s -> s <> "") + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let which_ida () = cmd "which idaq64" + +let find_idaq64 path = + cmd + "find %s -executable -type f -name \"idaq64\" 2>/dev/null | sort -n -r" path + |> function + | None -> None + | Some s -> + match split s with + | [] -> None + | hd :: _ -> Some hd + +let find_at_home () = + match getenv_opt "HOME" with + | None -> None + | Some home -> find_idaq64 home + +let locate_linux () = + match find_at_home () with + | None -> find_idaq64 "/" + | x -> x + +let locate_macos () = + match cmd "mdfind -name idaq | sort -n -r" with + | None -> None + | Some result -> + let pathes = split result in + try + let path = + List.find (fun p -> Filename.basename p = "idaq.app") pathes in + Some (sprintf "%s/Contents/MacOS/" path) + with Not_found -> None + +let rec find fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find fs + | x -> x + +let locate () = + match os with + | MacOs -> find [which_ida; locate_macos] + | Linux -> find [which_ida; locate_linux] + | Other system -> + eprintf + "warning: we don't know how to find programs on %s!\n" system; + exit 1 + +let write path = + let dir, file_depends = + if Sys.is_directory path then path, "" + else + Filename.dirname path, + sprintf "file-depends: [ [ %S %S ] ]\n" + path (Digest.to_hex (Digest.file path)) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +%s +variables { + path: %S + headless: %b +} +|} file_depends dir headless; + close_out oc + +let of_config () = + let path = "%{ida-path}%" in + if path = "" then None + else Some path + +let of_env () = getenv_opt "IDA_PATH" + +let () = + try + match find [ of_config; of_env; locate; ] with + | Some path -> write path + | None -> + eprintf "failed to locate IDA Pro\n"; + exit 1 + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-ida/find-ida.ml.in.0.2 b/patches/conf-ida/find-ida.ml.in.0.2 new file mode 100644 index 0000000..4111892 --- /dev/null +++ b/patches/conf-ida/find-ida.ml.in.0.2 @@ -0,0 +1,173 @@ +#load "unix.cma" + +open Printf + +type sys = + | MacOs + | Linux + | Other of string + +let os = match "%{os}%" with + | "macos" -> MacOs + | "linux" -> Linux + | s -> Other s + +let (/) = Filename.concat + +let getenv_opt var = + try Some (Sys.getenv var) + with Not_found -> None + +let headless = os = Linux && getenv_opt "DISPLAY" = None + +let read_all ch = + let buf = Buffer.create 16 in + let rec loop () = + match input_char ch with + | ch -> Buffer.add_char buf ch; loop () + | exception End_of_file -> String.trim (Buffer.contents buf) in + loop () + +let split_on_char sep s = + let r = ref [] in + let j = ref (String.length s) in + for i = String.length s - 1 downto 0 do + if String.get s i = sep then begin + r := String.sub s (i + 1) (!j - i - 1) :: !r; + j := i + end + done; + String.sub s 0 !j :: !r + +let split str = + List.map String.trim (split_on_char '\n' str) |> + List.filter (fun s -> s <> "") + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let cmd fmt = + let run c = + try + let inp = Unix.open_process_in c in + let res = read_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None in + ksprintf run fmt + +let find_map xs ~f = + let rec loop = function + | [] -> None + | hd :: tl -> + match f hd with + | None -> loop tl + | x -> x in + loop xs + +let known_names = ["ida"; "idaq"] + +let which_ida64 () = find_map known_names ~f:(cmd "which %s64") + +let find_ida64 path = + cmd + "find %s -executable -type f -name \"ida*64\" 2>/dev/null | sort -n -r" + path |> function + | None -> None + | Some idas -> + match split idas with + | [] -> None + | idas -> + let known = List.map (fun x -> x ^ "64") known_names in + find_map idas ~f:(fun file -> + if List.mem (Filename.basename file) known then + Some file + else None) + +let find_at_home () = + match getenv_opt "HOME" with + | None -> None + | Some home -> find_ida64 home + +let locate_linux () = + match find_at_home () with + | None -> find_ida64 "/" + | x -> x + +let locate_macos () = + find_map known_names ~f:(fun name -> + match cmd "mdfind -name %s | sort -n -r" name with + | None -> None + | Some result -> + let pathes = split result in + try + let path = + List.find (fun p -> Filename.basename p = name ^ ".app") pathes in + Some (sprintf "%s/Contents/MacOS/" path) + with Not_found -> None) + +let rec find fs = + match fs with + | [] -> None + | f :: fs -> + match f () with + | None -> find fs + | x -> x + +let locate () = + match os with + | MacOs -> find [which_ida64; locate_macos] + | Linux -> find [which_ida64; locate_linux] + | Other system -> + eprintf + "warning: we don't know how to find programs on %s!\n" system; + exit 1 + +let write path = + let dir, file_depends = + if Sys.is_directory path then path, "" + else + Filename.dirname path, + sprintf "file-depends: [ [ %S %S ] ]\n" + path (Digest.to_hex (Digest.file path)) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +%s +variables { + path: %S + headless: %b +} +|} file_depends dir headless; + close_out oc + +let of_config () = + let path = "%{ida-path}%" in + if path = "" then None + else Some path + +let of_env () = getenv_opt "IDA_PATH" + +let () = + try + match find [ of_config; of_env; locate; ] with + | Some path -> write path + | None -> + eprintf "failed to locate IDA Pro\n"; + exit 1 + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-ida/find-ida.ml.in.0.3 b/patches/conf-ida/find-ida.ml.in.0.3 new file mode 100644 index 0000000..59ee3a0 --- /dev/null +++ b/patches/conf-ida/find-ida.ml.in.0.3 @@ -0,0 +1,246 @@ +open Printf +open StdLabels + +module Array = struct + include Array + + let find t ~f = + let length = length t in + let rec loop i = + if i >= length then None + else if f t.(i) then Some t.(i) + else loop (i + 1) in + loop 0 + + let find_map t ~f = + let length = length t in + let rec loop i = + if i >= length then None + else match f t.(i) with + | None -> loop (i + 1) + | Some _ as res -> res in + loop 0 +end + +module List = struct + include List + + let find_map xs ~f = + let rec loop = function + | [] -> None + | hd :: tl -> + match f hd with + | None -> loop tl + | x -> x in + loop xs +end + +let max_depth = 4 +let max_paths = 1024 + +type sys = + | MacOs + | Linux + | Other of string + +let os = match "%{os}%" with + | "macos" -> MacOs + | "linux" -> Linux + | s -> Other s + +let (/) = Filename.concat + +let getenv_opt var = + try Some (Sys.getenv var) + with Not_found -> None + +let headless = os = Linux && getenv_opt "DISPLAY" = None + +let input_all ch = + let buf = Buffer.create 4096 in + let rec read () = Buffer.add_channel buf ch 4096; read () in + try read () + with End_of_file -> String.trim @@ Buffer.contents buf + +let split_on_char sep s = + let r = ref [] in + let j = ref (String.length s) in + for i = String.length s - 1 downto 0 do + if s.[i] = sep then begin + r := String.sub s (i + 1) (!j - i - 1) :: !r; + j := i + end + done; + String.sub s 0 !j :: !r + +let split ~on str = + List.map ~f:String.trim (split_on_char on str) |> + List.filter ~f:(fun s -> s <> "") + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let run c = + try + let inp = Unix.open_process_in c in + let res = input_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None + +let cmd fmt = ksprintf run fmt + +let rec first_success = function + | [] -> None + | f :: fs -> match f () with + | None -> first_success fs + | x -> x + + +let idas = [ "ida64"; "idaq64"] +let ida_apps = ["ida64.app"; "ida.app"; "idaq64.app"; "idaq.app"] + +let which name () = cmd "which %s" name + +let which_ida64 () = + first_success @@ List.map idas ~f:which + +let is_dir x = Sys.file_exists x && Sys.is_directory x + +let contains_ida64 path = + Array.exists (Sys.readdir path) + ~f:(fun file -> List.mem ~set:idas file) + +let opendir path = + try Some (Unix.opendir path) + with Unix.Unix_error _ -> None + +let next dir = + try Some (Unix.readdir dir) + with End_of_file -> None + +let is_some = function + | None -> false + | Some _ -> true + +let find path test = + let is_parent p = p = Filename.parent_dir_name in + let is_hidden p = String.length p > 0 && p.[0] = '.' in + let leave dir result entries = + Unix.closedir dir; + result,entries in + let rec read depth entries current dir = + if depth > max_depth || entries > max_paths + then leave dir None entries + else match next dir with + | None -> leave dir None entries + | Some entry when is_parent entry || is_hidden entry -> + read depth entries current dir + | Some entry when is_dir (current / entry) -> + let entries = entries + 1 in + let path = current / entry in + if test path + then leave dir (Some path) entries + else begin match opendir path with + | None -> read depth entries current dir + | Some subdir -> + let found, entries = read (depth + 1) entries path subdir in + if is_some found + then leave dir found entries + else read depth entries current dir + end + | Some e -> read depth (entries + 1) current dir in + match opendir path with + | None -> None + | Some dir -> fst @@ read 0 0 path dir + + +let find_at_home () = match getenv_opt "HOME" with + | None -> None + | Some home -> find home contains_ida64 + +let locate_linux () = find_at_home () + +let has_prefix str pref = + let len = String.length pref in + len <= String.length str && + String.(sub str 0 len = pref) + +let is_ida_app path = + List.exists ida_apps ~f:(Filename.check_suffix path) + +let find_app path () = + match find path is_ida_app with + | None -> None + | Some path -> + let path = path / "Contents/MacOS/" in + if is_dir path then Some path + else None + +let locate_macos () = + let home = match getenv_opt "HOME" with + | None -> "" + | Some home -> home in + first_success [ + find_app "/Applications"; + find_app (home / "Applications"); + find_app home; + ] + +let locate () = + match os with + | MacOs -> first_success [which_ida64; locate_macos] + | Linux -> first_success [which_ida64; locate_linux] + | Other system -> + eprintf + "warning: we don't know how to find programs on %s!\n" system; + exit 1 + +let write path = + let dir, file_depends = + if Sys.is_directory path then path, "" + else + Filename.dirname path, + sprintf "file-depends: [ [ %S %S ] ]\n" + path (Digest.to_hex (Digest.file path)) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +%s +variables { + path: %S + headless: %b +} +|} file_depends dir headless; + close_out oc + +let of_config () = + let path = "%{ida-path}%" in + if path = "" then None + else Some path + +let of_env () = getenv_opt "IDA_PATH" + +let () = + try + match first_success [ of_config; of_env; locate; ] with + | Some path -> write path + | None -> + eprintf "failed to locate IDA Pro\n"; + exit 1 + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-lapack/test-win.sh b/patches/conf-lapack/test-win.sh new file mode 100644 index 0000000..31981ae --- /dev/null +++ b/patches/conf-lapack/test-win.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +cc=$(ocamlc -config | awk '/^bytecomp_c_compiler/ {$1="";sub(/^ /, ""); print}') +$cc $CFLAGS test.c ${LACAML_LIBS:--llapack} diff --git a/patches/conf-lapack/test.c b/patches/conf-lapack/test.c new file mode 100644 index 0000000..c5c6f02 --- /dev/null +++ b/patches/conf-lapack/test.c @@ -0,0 +1,8 @@ +extern double dlamch_(char *CMACH); + +int main(int argc, char **argv) +{ + char CMACH = 'E'; + double res = dlamch_(&CMACH); + return 0; +} diff --git a/patches/conf-leveldb/test.cc b/patches/conf-leveldb/test.cc new file mode 100644 index 0000000..b8c8cf8 --- /dev/null +++ b/patches/conf-leveldb/test.cc @@ -0,0 +1,14 @@ +#include +#ifndef STORAGE_LEVELDB_INCLUDE_DB_H_ +#error "No LevelDB headers" +#endif + +using namespace leveldb; + +void test(void) { + leveldb::DB* db; + leveldb::Options options; + options.create_if_missing = true; + leveldb::Status status = leveldb::DB::Open(options, "/tmp/testdb", &db); + assert(status.ok()); +} diff --git a/patches/conf-libclang/configure.sh.1.0.0 b/patches/conf-libclang/configure.sh.1.0.0 new file mode 100644 index 0000000..716488a --- /dev/null +++ b/patches/conf-libclang/configure.sh.1.0.0 @@ -0,0 +1,88 @@ +#!/bin/bash -ex + +find_llvm_config () { + # Locate llvm-config (taken from conf-llvm's configure.sh file) + + shopt -s nullglob + for version in 9 8 7 6 5 4 3; do + if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config + fi + for llvm_config in \ + llvm-config-${version} llvm-config-${version}.0 \ + llvm-config${version}0 llvm-config-mp-$version \ + llvm-config-mp-${version}.0 $brew_llvm_config \ + /usr/lib64/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm/${version}/bin/llvm-config \ + llvm-config; do + llvm_version="`$llvm_config --version`" || continue + return + done + done + + echo "Error: LLVM is not installed." + exit 1 +} + +find_llvm_config + +LLVM_CFLAGS="`\"$llvm_config\" --cflags`" +LLVM_LDFLAGS="`\"$llvm_config\" --ldflags`" +LLVM_LIBDIR="`\"$llvm_config\" --libdir`" + +# These filters enable compilation with gcc. +# Filter -Wstring-conversion for OpenSUSE +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wstring-conversion\\ //`" + +# Filter -Werror=unguarded-availability-new and -Wcovered-switch-default +# (which appear with LLVM 7) +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Werror=unguarded-availability-new\\ //`" +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wcovered-switch-default\\ //`" + +# Filter "-Wdelete-non-virtual-dtor" (warning only) +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wdelete-non-virtual-dtor\\ //`" + +tempdir="`mktemp -d`" + +clean_tempdir () { + rm -f "$tempdir/test_libclang.c" "$tempdir/test_libclang.o" \ + "$tempdir/test_libclang" + rmdir "$tempdir" +} + +cat >"$tempdir/test_libclang.c" < +#include + +int +main(int argc, char *argv[]) +{ + CXIndex idx = clang_createIndex(1, 1); + clang_disposeIndex(idx); + return EXIT_SUCCESS; +} +EOF +CC=cc +"$CC" -o "$tempdir/test_libclang.o" -c $LLVM_CFLAGS \ + "$tempdir/test_libclang.c" || \ + ( clean_tempdir; echo "Error: cannot compile libclang test."; exit 1 ) +"$CC" -o "$tempdir/test_libclang" \ + $LLVM_LDFLAGS "$tempdir/test_libclang.o" \ + "-lclang" "-Wl,-rpath,$LLVM_LIBDIR" || \ + ( clean_tempdir; echo "Error: cannot link libclang test."; exit 1 ) +"$tempdir/test_libclang" || \ + ( clean_tempdir; echo "Error: cannot execute libclang test."; exit 1 ) +clean_tempdir + +# $equivalent_version is used by clangml.4.0.1, which does not recognize +# Clang/LLVM 9.0.1, but there is no change in API between Clang 9.0.0 and +# Clang 9.0.1. +if [ "$llvm_version" = 9.0.1 ]; then + equivalent_version=9.0.0 +else + equivalent_version= +fi + +echo "config: \"$llvm_config\"" >> conf-libclang.config +echo "version: \"$llvm_version\"" >> conf-libclang.config +echo "equivalent_version: \"$equivalent_version\"" >> conf-libclang.config diff --git a/patches/conf-libclang/configure.sh.10 b/patches/conf-libclang/configure.sh.10 new file mode 100644 index 0000000..8664c70 --- /dev/null +++ b/patches/conf-libclang/configure.sh.10 @@ -0,0 +1,79 @@ +#!/bin/bash -ex + +find_llvm_config () { + # Locate llvm-config (taken from conf-llvm's configure.sh file) + + shopt -s nullglob + for version in 10 9 8 7 6 5 4 3; do + if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config + fi + for llvm_config in \ + llvm-config-${version} llvm-config-${version}.0 \ + llvm-config${version}0 llvm-config${version} \ + llvm-config-mp-$version \ + llvm-config-mp-${version}.0 $brew_llvm_config \ + /usr/lib64/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm/${version}/bin/llvm-config \ + llvm-config; do + llvm_version="`$llvm_config --version`" || continue + return + done + done + + echo "Error: LLVM is not installed." + exit 1 +} + +find_llvm_config + +LLVM_CFLAGS="`\"$llvm_config\" --cflags`" +LLVM_LDFLAGS="`\"$llvm_config\" --ldflags`" +LLVM_LIBDIR="`\"$llvm_config\" --libdir`" + +# These filters enable compilation with gcc. +# Filter -Wstring-conversion for OpenSUSE +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wstring-conversion\\ //`" + +# Filter -Werror=unguarded-availability-new and -Wcovered-switch-default +# (which appear with LLVM 7) +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Werror=unguarded-availability-new\\ //`" +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wcovered-switch-default\\ //`" + +# Filter "-Wdelete-non-virtual-dtor" (warning only) +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wdelete-non-virtual-dtor\\ //`" + +tempdir="`mktemp -d`" + +clean_tempdir () { + rm -f "$tempdir/test_libclang.c" "$tempdir/test_libclang.o" \ + "$tempdir/test_libclang" + rmdir "$tempdir" +} + +cat >"$tempdir/test_libclang.c" < +#include + +int +main(int argc, char *argv[]) +{ + CXIndex idx = clang_createIndex(1, 1); + clang_disposeIndex(idx); + return EXIT_SUCCESS; +} +EOF +CC=cc +"$CC" -o "$tempdir/test_libclang.o" -c $LLVM_CFLAGS \ + "$tempdir/test_libclang.c" || \ + ( clean_tempdir; echo "Error: cannot compile libclang test."; exit 1 ) +"$CC" -o "$tempdir/test_libclang" \ + $LLVM_LDFLAGS "$tempdir/test_libclang.o" \ + "-lclang" "-Wl,-rpath,$LLVM_LIBDIR" || \ + ( clean_tempdir; echo "Error: cannot link libclang test."; exit 1 ) +"$tempdir/test_libclang" || \ + ( clean_tempdir; echo "Error: cannot execute libclang test."; exit 1 ) +clean_tempdir + +echo "config: \"$llvm_config\"" >> conf-libclang.config +echo "version: \"$llvm_version\"" >> conf-libclang.config diff --git a/patches/conf-libclang/configure.sh.11 b/patches/conf-libclang/configure.sh.11 new file mode 100644 index 0000000..42722d2 --- /dev/null +++ b/patches/conf-libclang/configure.sh.11 @@ -0,0 +1,80 @@ +#!/bin/bash -ex + +find_llvm_config () { + # Locate llvm-config (taken from conf-llvm's configure.sh file) + + shopt -s nullglob + for version in 11 10 9 8 7 6 5 4 3; do + if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config + fi + for llvm_config in \ + llvm-config-${version} llvm-config-${version}.0 \ + llvm-config${version}0 llvm-config${version} \ + llvm-config-${version}-32 llvm-config-${version}-64 \ + llvm-config-mp-$version \ + llvm-config-mp-${version}.0 $brew_llvm_config \ + /usr/lib64/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm/${version}/bin/llvm-config \ + llvm-config; do + llvm_version="`$llvm_config --version`" || continue + return + done + done + + echo "Error: LLVM is not installed." + exit 1 +} + +find_llvm_config + +LLVM_CFLAGS="`\"$llvm_config\" --cflags`" +LLVM_LDFLAGS="`\"$llvm_config\" --ldflags`" +LLVM_LIBDIR="`\"$llvm_config\" --libdir`" + +# These filters enable compilation with gcc. +# Filter -Wstring-conversion for OpenSUSE +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wstring-conversion\\ //`" + +# Filter -Werror=unguarded-availability-new and -Wcovered-switch-default +# (which appear with LLVM 7) +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Werror=unguarded-availability-new\\ //`" +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wcovered-switch-default\\ //`" + +# Filter "-Wdelete-non-virtual-dtor" (warning only) +LLVM_CFLAGS="`echo $LLVM_CFLAGS | sed s/-Wdelete-non-virtual-dtor\\ //`" + +tempdir="`mktemp -d`" + +clean_tempdir () { + rm -f "$tempdir/test_libclang.c" "$tempdir/test_libclang.o" \ + "$tempdir/test_libclang" + rmdir "$tempdir" +} + +cat >"$tempdir/test_libclang.c" < +#include + +int +main(int argc, char *argv[]) +{ + CXIndex idx = clang_createIndex(1, 1); + clang_disposeIndex(idx); + return EXIT_SUCCESS; +} +EOF +CC=cc +"$CC" -o "$tempdir/test_libclang.o" -c $LLVM_CFLAGS \ + "$tempdir/test_libclang.c" || \ + ( clean_tempdir; echo "Error: cannot compile libclang test."; exit 1 ) +"$CC" -o "$tempdir/test_libclang" \ + $LLVM_LDFLAGS "$tempdir/test_libclang.o" \ + "-lclang" "-Wl,-rpath,$LLVM_LIBDIR" || \ + ( clean_tempdir; echo "Error: cannot link libclang test."; exit 1 ) +"$tempdir/test_libclang" || \ + ( clean_tempdir; echo "Error: cannot execute libclang test."; exit 1 ) +clean_tempdir + +echo "config: \"$llvm_config\"" >> conf-libclang.config +echo "version: \"$llvm_version\"" >> conf-libclang.config diff --git a/patches/conf-libclang/configure.sh.12 b/patches/conf-libclang/configure.sh.12 new file mode 100644 index 0000000..472a8b5 --- /dev/null +++ b/patches/conf-libclang/configure.sh.12 @@ -0,0 +1,96 @@ +#!/bin/bash -ex + +clean_tempdir () { + rm -f "$tempdir/test_libclang.c" "$tempdir/test_libclang.o" \ + "$tempdir/test_libclang" + rmdir "$tempdir" +} + +shopt -s nullglob +for version in default 12 11 10 9 8 7 6 5 4 3; do + if [ "$version" = default ]; then + llvm_config=llvm-config + llvm_version="$($llvm_config --version)" || continue + if [ $(printf "${llvm_version%%.*}\n13" | sort -n | head -n1) = 13 ]; then + continue + fi + else + if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config + fi + for llvm_config in \ + llvm-config-${version} llvm-config-${version}.0 \ + llvm-config${version}0 llvm-config${version} \ + llvm-config-${version}-32 llvm-config-${version}-64 \ + llvm-config-mp-$version \ + llvm-config-mp-${version}.0 $brew_llvm_config \ + /usr/lib64/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm/${version}/bin/llvm-config; do + llvm_version="$($llvm_config --version)" || continue + break + done + if [ -z "$llvm_version" ]; then + continue + fi + fi + + if [ "$llvm_version" = "12.0.1" ]; then + clangml440_configure_options="--with-llvm-version=12.0.0" # clangml.4.4.0 does not recognize 12.0.1 + else + clangml440_configure_options="" # rely on clangml's ./configure autodetection + fi + + LLVM_CFLAGS="$($llvm_config --cflags)" + LLVM_LDFLAGS="$($llvm_config --ldflags)" + LLVM_LIBDIR="$($llvm_config --libdir)" + + # These filters enable compilation with gcc. + # Filter -Wstring-conversion for OpenSUSE + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wstring-conversion //')" + + # Filter -Werror=unguarded-availability-new and -Wcovered-switch-default + # (which appear with LLVM 7) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Werror=unguarded-availability-new //')" + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wcovered-switch-default //')" + + # Filter "-Wdelete-non-virtual-dtor" (warning only) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wdelete-non-virtual-dtor //')" + + tempdir="$(mktemp -d)" + cat >"$tempdir/test_libclang.c" < +#include + +int +main(int argc, char *argv[]) +{ + CXIndex idx = clang_createIndex(1, 1); + clang_disposeIndex(idx); + return EXIT_SUCCESS; +} +EOF + + CC=cc + if "$CC" -o "$tempdir/test_libclang.o" -c $LLVM_CFLAGS \ + "$tempdir/test_libclang.c" && + "$CC" -o "$tempdir/test_libclang" \ + $LLVM_LDFLAGS "$tempdir/test_libclang.o" \ + "-lclang" "-Wl,-rpath,$LLVM_LIBDIR" && + "$tempdir/test_libclang"; then + true + else + clean_tempdir + continue + fi + + clean_tempdir + + echo "config: \"$llvm_config\"" >> conf-libclang.config + echo "version: \"$llvm_version\"" >> conf-libclang.config + echo "clangml440_configure_options: \"$clangml440_configure_options\"" >> conf-libclang.config + exit 0 +done + +echo "Error: No usable version of LLVM <=12.0.x found." +exit 1 + diff --git a/patches/conf-libclang/configure.sh.13 b/patches/conf-libclang/configure.sh.13 new file mode 100644 index 0000000..c5bbb21 --- /dev/null +++ b/patches/conf-libclang/configure.sh.13 @@ -0,0 +1,92 @@ +#!/bin/bash -ex + +clean_tempdir () { + rm -f "$tempdir/test_libclang.c" "$tempdir/test_libclang.o" \ + "$tempdir/test_libclang" + rmdir "$tempdir" +} + +shopt -s nullglob +for version in default 13 12 11 10 9 8 7 6 5 4 3; do + if [ "$version" = default ]; then + llvm_config=llvm-config + llvm_version="$($llvm_config --version)" || continue + if [ $(printf "${llvm_version%%.*}\n14" | sort -n | head -n1) = 14 ]; then + continue + fi + else + if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config || true + brew_llvm_config_at="$(brew --cellar)"/llvm@${version}/${version}*/bin/llvm-config || true + fi + llvm_version="" + for llvm_config in \ + llvm-config-${version} llvm-config-${version}.0 \ + llvm-config${version}0 llvm-config${version} \ + llvm-config-${version}-32 llvm-config-${version}-64 \ + llvm-config-mp-$version \ + llvm-config-mp-${version}.0 $brew_llvm_config $brew_llvm_config_at \ + /usr/lib64/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm${version}/bin/llvm-config; do + llvm_version="$($llvm_config --version)" || continue + break + done + if [ -z "$llvm_version" ]; then + continue + fi + fi + + LLVM_CFLAGS="$($llvm_config --cflags)" + LLVM_LDFLAGS="$($llvm_config --ldflags)" + LLVM_LIBDIR="$($llvm_config --libdir)" + + # These filters enable compilation with gcc. + # Filter -Wstring-conversion for OpenSUSE + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wstring-conversion //')" + + # Filter -Werror=unguarded-availability-new and -Wcovered-switch-default + # (which appear with LLVM 7) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Werror=unguarded-availability-new //')" + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wcovered-switch-default //')" + + # Filter "-Wdelete-non-virtual-dtor" (warning only) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wdelete-non-virtual-dtor //')" + + tempdir="$(mktemp -d)" + cat >"$tempdir/test_libclang.c" < +#include + +int +main(int argc, char *argv[]) +{ + CXIndex idx = clang_createIndex(1, 1); + clang_disposeIndex(idx); + return EXIT_SUCCESS; +} +EOF + + CC=cc + if "$CC" -o "$tempdir/test_libclang.o" -c $LLVM_CFLAGS \ + "$tempdir/test_libclang.c" && + "$CC" -o "$tempdir/test_libclang" \ + $LLVM_LDFLAGS "$tempdir/test_libclang.o" \ + "-lclang" "-Wl,-rpath,$LLVM_LIBDIR" && + "$tempdir/test_libclang"; then + true + else + clean_tempdir + continue + fi + + clean_tempdir + + echo "config: \"$llvm_config\"" >> conf-libclang.config + echo "version: \"$llvm_version\"" >> conf-libclang.config + exit 0 +done + +echo "Error: No usable version of LLVM <=13.0.x found." +exit 1 + diff --git a/patches/conf-libclang/configure.sh.14 b/patches/conf-libclang/configure.sh.14 new file mode 100644 index 0000000..5dfdbf5 --- /dev/null +++ b/patches/conf-libclang/configure.sh.14 @@ -0,0 +1,143 @@ +#!/bin/bash -ex + +clean_tempdir () { + rm -f "$tempdir/test_libclang.c" "$tempdir/test_libclang.o" \ + "$tempdir/test_libclang" + rmdir "$tempdir" +} + +maximum_version=14 + +shopt -s nullglob +for version in default $(seq $maximum_version -1 3); do + if [ "$version" = default ]; then + for kind in system brew none; do + case $kind in + system) + llvm_config=$(command -v llvm-config) || continue + ;; + brew) + llvm_config="$(brew --prefix)/opt/llvm/bin/llvm-config" || continue + ;; + none) + break + ;; + esac + llvm_version="$($llvm_config --version)" || continue + next_version=$((maximum_version + 1)) + if [\ + $(printf "${llvm_version%%.*}\n$next_version" | sort -n | head -n1)\ + = $next_version ]; then + continue + fi + break + done + if [ "$kind" == none ]; then + continue + fi + else + if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar llvm)"/${version}*/bin/llvm-config || true + brew_llvm_config_at="$(brew --cellar llvm@${version})"/${version}*/bin/llvm-config || true + fi + llvm_version="" + for llvm_config in \ + llvm-config-${version} llvm-config-${version}.0 \ + llvm-config${version}0 llvm-config${version} \ + llvm-config-${version}-32 llvm-config-${version}-64 \ + llvm-config-mp-$version \ + llvm-config-mp-${version}.0 $brew_llvm_config $brew_llvm_config_at \ + /usr/lib64/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm${version}/bin/llvm-config; do + llvm_config="$(command -v $llvm_config)" || continue + llvm_version="$($llvm_config --version)" || continue + break + done + if [ -z "$llvm_version" ]; then + continue + fi + fi + + LLVM_CFLAGS="$($llvm_config --cflags)" + LLVM_LDFLAGS="$($llvm_config --ldflags)" + LLVM_LIBDIR="$($llvm_config --libdir)" + + # These filters enable compilation with gcc. + # Filter -Wstring-conversion for OpenSUSE + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wstring-conversion //')" + + # Filter -Werror=unguarded-availability-new and -Wcovered-switch-default + # (which appear with LLVM 7) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Werror=unguarded-availability-new //')" + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wcovered-switch-default //')" + + # Filter "-Wdelete-non-virtual-dtor" (warning only) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wdelete-non-virtual-dtor //')" + + tempdir="$(mktemp -d)" + cat >"$tempdir/test_libclang.c" < +#include + +int +main(int argc, char *argv[]) +{ + CXIndex idx = clang_createIndex(1, 1); + clang_disposeIndex(idx); + return EXIT_SUCCESS; +} +EOF + + CC=cc + if "$CC" -o "$tempdir/test_libclang.o" -c $LLVM_CFLAGS \ + "$tempdir/test_libclang.c" && + "$CC" -o "$tempdir/test_libclang" \ + $LLVM_LDFLAGS "$tempdir/test_libclang.o" \ + "-lclang" "-Wl,-rpath,$LLVM_LIBDIR" && + "$tempdir/test_libclang"; then + true + else + clean_tempdir + continue + fi + + clean_tempdir + checksum= + for hasher in \ + "sha512:sha512sum" \ + "sha512:shasum -a 512" \ + "md5:md5sum" \ + "md5:md5 -q"; do + hasher_output=$(${hasher#*:} "$llvm_config") || continue + checksum="${hasher%%:*}=${hasher_output%% *}" + break + done + if [ -z "$checksum" ]; then + echo "Error: Unable to find a hasher" + exit 1 + fi + + case "$llvm_version" in + 14*) + clangml460_configure_options="--with-llvm-version=14.0.0" # clangml.4.4.0 does not recognize 14.0.x with x>=4 + ;; + *) + clangml460_configure_options="" # rely on clangml's ./configure autodetection + ;; + esac + + cat >"conf-libclang.config" </dev/null; then + brew_llvm_config="$(brew --cellar llvm)"/${version}*/bin/llvm-config || true + brew_llvm_config_at="$(brew --cellar llvm@${version})"/${version}*/bin/llvm-config || true + fi + for llvm_config in \ + llvm-config-${version} llvm-config-${version}.0 \ + llvm-config${version}0 llvm-config${version} \ + llvm-config-${version}-32 llvm-config-${version}-64 \ + llvm-config-mp-$version \ + llvm-config-mp-${version}.0 $brew_llvm_config $brew_llvm_config_at \ + /usr/lib64/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm/${version}/bin/llvm-config \ + /usr/lib/llvm${version}/bin/llvm-config; do + llvm_config="$(command -v $llvm_config)" || continue + llvm_version="$($llvm_config --version)" || continue + break + done + if [ -z "$llvm_version" ]; then + continue + fi + fi + + LLVM_CFLAGS="$($llvm_config --cflags)" + LLVM_LDFLAGS="$($llvm_config --ldflags)" + LLVM_LIBDIR="$($llvm_config --libdir)" + + # These filters enable compilation with gcc. + # Filter -Wstring-conversion for OpenSUSE + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wstring-conversion //')" + + # Filter -Werror=unguarded-availability-new and -Wcovered-switch-default + # (which appear with LLVM 7) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Werror=unguarded-availability-new //')" + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wcovered-switch-default //')" + + # Filter "-Wdelete-non-virtual-dtor" (warning only) + LLVM_CFLAGS="$(echo $LLVM_CFLAGS | sed 's/-Wdelete-non-virtual-dtor //')" + + tempdir="$(mktemp -d)" + cat >"$tempdir/test_libclang.c" < +#include + +int +main(int argc, char *argv[]) +{ + CXIndex idx = clang_createIndex(1, 1); + clang_disposeIndex(idx); + return EXIT_SUCCESS; +} +EOF + + CC=cc + if "$CC" -o "$tempdir/test_libclang.o" -c $LLVM_CFLAGS \ + "$tempdir/test_libclang.c" && + "$CC" -o "$tempdir/test_libclang" \ + $LLVM_LDFLAGS "$tempdir/test_libclang.o" \ + "-lclang" "-Wl,-rpath,$LLVM_LIBDIR" && + "$tempdir/test_libclang"; then + true + else + clean_tempdir + continue + fi + + clean_tempdir + checksum= + for hasher in \ + "sha512:sha512sum" \ + "sha512:shasum -a 512" \ + "md5:md5sum" \ + "md5:md5 -q"; do + hasher_output=$(${hasher#*:} "$llvm_config") || continue + checksum="${hasher%%:*}=${hasher_output%% *}" + break + done + if [ -z "$checksum" ]; then + echo "Error: Unable to find a hasher" + exit 1 + fi + cat >"conf-libclang.config" <= l then + List.rev acc + else + match (source.[current] = sep, current = prev, current = l - 1) with + | (true, true, _) -> loop (current + 1) (current + 1) acc + | (true, _, _) -> loop (current + 1) (current + 1) ((copy_part prev current)::acc) + | (false, _, true) -> loop (current + 1) (current + 1) ((copy_part prev (current + 1))::acc) + | _ -> loop prev (current + 1) acc + in loop 0 0 [] + +let uniq lst = + let unique_set = Hashtbl.create (List.length lst) in + List.iter (fun x -> Hashtbl.replace unique_set x ()) lst; + Hashtbl.fold (fun x () xs -> x :: xs) unique_set [] + +let get_paths env_name = + try + let paths = Sys.getenv env_name in + let dirs = string_split ':' paths in + List.map (fun dir -> + let components = string_split '/' dir in + "/" ^ (String.concat "/" (cut_tail components)) + ) dirs + with Not_found -> [] + +let env_paths = List.append (get_paths "LIBRARY_PATH") (get_paths "C_INCLUDE_PATH") + +(* Keep that in sync with the list in myocamlbuild.ml *) +let search_paths = uniq (List.append [ + "/usr"; + "/usr/local"; + "/opt"; + "/opt/local"; + "/sw"; + "/mingw";] env_paths) + +open Printf + +(* +-----------------------------------------------------------------+ + | Test codes | + +-----------------------------------------------------------------+ *) + +let caml_code = " +external test : unit -> unit = \"lwt_test\" +let () = test () +" + + +let libev_code = " +#include +#include + +CAMLprim value lwt_test() +{ + ev_default_loop(0); + return Val_unit; +} +" +(* +-----------------------------------------------------------------+ + | Compilation | + +-----------------------------------------------------------------+ *) + +let ocamlc = ref "ocamlc" +let ext_obj = ref ".o" +let exec_name = ref "a.out" + +let log_file = ref "" +let caml_file = ref "" + +(* Search for a header file in standard directories. *) +let search_header header = + let rec loop = function + | [] -> + None + | dir :: dirs -> + if Sys.file_exists (dir ^ "/include/" ^ header) then + Some dir + else + loop dirs + in + loop search_paths + +let c_args = + let flags path = Printf.sprintf "-ccopt -I%s/include -ccopt -L%s/lib" path path in + match search_header "ev.h" with + | None -> "" + | Some path -> flags path + +let compile c_args args stub_file = + let cmd = sprintf "%s -custom %s %s %s %s > %s 2>&1" + !ocamlc + c_args + (Filename.quote stub_file) + args + (Filename.quote !caml_file) + (Filename.quote !log_file) in + Sys.command cmd = 0 + +let safe_remove file_name = + try + Sys.remove file_name + with exn -> + () + +let test_code args stub_code = + let stub_file, oc = Filename.open_temp_file "lwt_stub" ".c" in + let cleanup () = + safe_remove stub_file; + safe_remove (Filename.chop_extension (Filename.basename stub_file) ^ !ext_obj) + in + try + output_string oc stub_code; + flush oc; + close_out oc; + let result = compile "" args stub_file || compile c_args args stub_file in + cleanup (); + result + with exn -> + (try close_out oc with _ -> ()); + cleanup (); + raise exn + +let config = open_out "lwt_config.h" +let config_ml = open_out "lwt_config.ml" + +let test_feature ?(do_check = true) name macro ?(args="") code = + if do_check then begin + printf "testing for %s:%!" name; + if test_code args code then begin + fprintf config "#define %s\n" macro; + fprintf config_ml "#let %s = true\n" macro; + printf " %s available\n%!" (String.make (34 - String.length name) '.'); + true + end else begin + fprintf config "//#define %s\n" macro; + fprintf config_ml "#let %s = false\n" macro; + printf " %s unavailable\n%!" (String.make (34 - String.length name) '.'); + false + end + end else begin + printf "not checking for %s\n%!" name; + fprintf config "//#define %s\n" macro; + fprintf config_ml "#let %s = false\n" macro; + true + end + +(* +-----------------------------------------------------------------+ + | Entry point | + +-----------------------------------------------------------------+ *) + +let () = + let args = [ + "-ocamlc", Arg.Set_string ocamlc, " ocamlc"; + "-ext-obj", Arg.Set_string ext_obj, " C object files extension"; + "-exec-name", Arg.Set_string exec_name, " name of the executable produced by ocamlc"; + ] in + Arg.parse args ignore "check for external C libraries and available features\noptions are:"; + + (* Put the caml code into a temporary file. *) + let file, oc = Filename.open_temp_file "lwt_caml" ".ml" in + caml_file := file; + output_string oc caml_code; + close_out oc; + + log_file := Filename.temp_file "lwt_output" ".log"; + + (* Cleanup things on exit. *) + at_exit (fun () -> + (try close_out config with _ -> ()); + (try close_out config_ml with _ -> ()); + safe_remove !log_file; + safe_remove !exec_name; + safe_remove !caml_file; + safe_remove (Filename.chop_extension !caml_file ^ ".cmi"); + safe_remove (Filename.chop_extension !caml_file ^ ".cmo")); + + let missing = [] in + let missing = if test_feature "libev" "HAVE_LIBEV" ~args:"-cclib -lev" libev_code then missing else "libev" :: missing in + + if missing <> [] then begin + printf " + The following recquired C libraries are missing: %s. +Please install them and retry. If they are installed in a non-standard location, set the environment variables C_INCLUDE_PATH and LIBRARY_PATH accordingly and retry. + +For example, if they are installed in /opt/local, you can type: + +export C_INCLUDE_PATH=/opt/local/include +export LIBRARY_PATH=/opt/local/lib + +To compile without libev support, use ./configure --disable-libev ... +" (String.concat ", " missing); + exit 1 + end; + +(* + ignore (test_feature "eventfd" "HAVE_EVENTFD" eventfd_code); + ignore (test_feature "fd passing" "HAVE_FD_PASSING" fd_passing_code); + ignore (test_feature "sched_getcpu" "HAVE_GETCPU" getcpu_code); + ignore (test_feature "affinity getting/setting" "HAVE_AFFINITY" affinity_code); + ignore (test_feature "credentials getting" "HAVE_GET_CREDENTIALS" get_credentials_code); + ignore (test_feature "fdatasync" "HAVE_FDATASYNC" fdatasync_code) +*) diff --git a/patches/conf-libev/discover.ml.4-12 b/patches/conf-libev/discover.ml.4-12 new file mode 100644 index 0000000..c41db2d --- /dev/null +++ b/patches/conf-libev/discover.ml.4-12 @@ -0,0 +1,235 @@ +(* Lightweight thread library for Objective Caml + * http://www.ocsigen.org/lwt + * Program discover + * Copyright (C) 2010 Jérémie Dimino + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, with linking exceptions; + * either version 2.1 of the License, or (at your option) any later + * version. See COPYING file for details. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + *) + +(* Discover available features *) + +let cut_tail l = List.rev (List.tl (List.rev l)) + +let string_split sep source = + let copy_part index offset = + String.sub source index (offset - index) + in + let l = String.length source in + let rec loop prev current acc = + if current >= l then + List.rev acc + else + match (source.[current] = sep, current = prev, current = l - 1) with + | (true, true, _) -> loop (current + 1) (current + 1) acc + | (true, _, _) -> loop (current + 1) (current + 1) ((copy_part prev current)::acc) + | (false, _, true) -> loop (current + 1) (current + 1) ((copy_part prev (current + 1))::acc) + | _ -> loop prev (current + 1) acc + in loop 0 0 [] + +let uniq lst = + let unique_set = Hashtbl.create (List.length lst) in + List.iter (fun x -> Hashtbl.replace unique_set x ()) lst; + Hashtbl.fold (fun x () xs -> x :: xs) unique_set [] + +let get_paths env_name = + try + let paths = Sys.getenv env_name in + let dirs = string_split ':' paths in + List.map (fun dir -> + let components = string_split '/' dir in + "/" ^ (String.concat "/" (cut_tail components)) + ) dirs + with Not_found -> [] + +let env_paths = List.append (get_paths "LIBRARY_PATH") (get_paths "C_INCLUDE_PATH") + +(* Keep that in sync with the list in myocamlbuild.ml *) +let search_paths = uniq (List.append [ + "/usr"; + "/usr/local"; + "/opt"; + "/opt/local"; + "/opt/homebrew"; + "/sw"; + "/mingw";] env_paths) + +open Printf + +(* +-----------------------------------------------------------------+ + | Test codes | + +-----------------------------------------------------------------+ *) + +let caml_code = " +external test : unit -> unit = \"lwt_test\" +let () = test () +" + + +let libev_code = " +#include +#include + +CAMLprim value lwt_test() +{ + ev_default_loop(0); + return Val_unit; +} +" +(* +-----------------------------------------------------------------+ + | Compilation | + +-----------------------------------------------------------------+ *) + +let ocamlc = ref "ocamlc" +let ext_obj = ref ".o" +let exec_name = ref "a.out" + +let log_file = ref "" +let caml_file = ref "" + +(* Search for a header file in standard directories. *) +let search_header header = + let rec loop = function + | [] -> + None + | dir :: dirs -> + if Sys.file_exists (dir ^ "/include/" ^ header) then + Some dir + else + loop dirs + in + loop search_paths + +let c_args = + let flags path = Printf.sprintf "-ccopt -I%s/include -ccopt -L%s/lib" path path in + match search_header "ev.h" with + | None -> "" + | Some path -> flags path + +let compile c_args args stub_file = + let cmd = sprintf "%s -custom %s %s %s %s > %s 2>&1" + !ocamlc + c_args + (Filename.quote stub_file) + args + (Filename.quote !caml_file) + (Filename.quote !log_file) in + Sys.command cmd = 0 + +let safe_remove file_name = + try + Sys.remove file_name + with exn -> + () + +let test_code args stub_code = + let stub_file, oc = Filename.open_temp_file "lwt_stub" ".c" in + let cleanup () = + safe_remove stub_file; + safe_remove (Filename.chop_extension (Filename.basename stub_file) ^ !ext_obj) + in + try + output_string oc stub_code; + flush oc; + close_out oc; + let result = compile "" args stub_file || compile c_args args stub_file in + cleanup (); + result + with exn -> + (try close_out oc with _ -> ()); + cleanup (); + raise exn + +let config = open_out "lwt_config.h" +let config_ml = open_out "lwt_config.ml" + +let test_feature ?(do_check = true) name macro ?(args="") code = + if do_check then begin + printf "testing for %s:%!" name; + if test_code args code then begin + fprintf config "#define %s\n" macro; + fprintf config_ml "#let %s = true\n" macro; + printf " %s available\n%!" (String.make (34 - String.length name) '.'); + true + end else begin + fprintf config "//#define %s\n" macro; + fprintf config_ml "#let %s = false\n" macro; + printf " %s unavailable\n%!" (String.make (34 - String.length name) '.'); + false + end + end else begin + printf "not checking for %s\n%!" name; + fprintf config "//#define %s\n" macro; + fprintf config_ml "#let %s = false\n" macro; + true + end + +(* +-----------------------------------------------------------------+ + | Entry point | + +-----------------------------------------------------------------+ *) + +let () = + let args = [ + "-ocamlc", Arg.Set_string ocamlc, " ocamlc"; + "-ext-obj", Arg.Set_string ext_obj, " C object files extension"; + "-exec-name", Arg.Set_string exec_name, " name of the executable produced by ocamlc"; + ] in + Arg.parse args ignore "check for external C libraries and available features\noptions are:"; + + (* Put the caml code into a temporary file. *) + let file, oc = Filename.open_temp_file "lwt_caml" ".ml" in + caml_file := file; + output_string oc caml_code; + close_out oc; + + log_file := Filename.temp_file "lwt_output" ".log"; + + (* Cleanup things on exit. *) + at_exit (fun () -> + (try close_out config with _ -> ()); + (try close_out config_ml with _ -> ()); + safe_remove !log_file; + safe_remove !exec_name; + safe_remove !caml_file; + safe_remove (Filename.chop_extension !caml_file ^ ".cmi"); + safe_remove (Filename.chop_extension !caml_file ^ ".cmo")); + + let missing = [] in + let missing = if test_feature "libev" "HAVE_LIBEV" ~args:"-cclib -lev" libev_code then missing else "libev" :: missing in + + if missing <> [] then begin + printf " + The following recquired C libraries are missing: %s. +Please install them and retry. If they are installed in a non-standard location, set the environment variables C_INCLUDE_PATH and LIBRARY_PATH accordingly and retry. + +For example, if they are installed in /opt/local, you can type: + +export C_INCLUDE_PATH=/opt/local/include +export LIBRARY_PATH=/opt/local/lib + +To compile without libev support, use ./configure --disable-libev ... +" (String.concat ", " missing); + exit 1 + end; + +(* + ignore (test_feature "eventfd" "HAVE_EVENTFD" eventfd_code); + ignore (test_feature "fd passing" "HAVE_FD_PASSING" fd_passing_code); + ignore (test_feature "sched_getcpu" "HAVE_GETCPU" getcpu_code); + ignore (test_feature "affinity getting/setting" "HAVE_AFFINITY" affinity_code); + ignore (test_feature "credentials getting" "HAVE_GET_CREDENTIALS" get_credentials_code); + ignore (test_feature "fdatasync" "HAVE_FDATASYNC" fdatasync_code) +*) diff --git a/patches/conf-libportmidi/check.sh b/patches/conf-libportmidi/check.sh new file mode 100644 index 0000000..14f2922 --- /dev/null +++ b/patches/conf-libportmidi/check.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# portmidi doesn't have an entry on my ubuntu pkg-config so fall back to +# probing for the header file + +pkg-config --exists portmidi \ + || pkg-config --exists libportmidi \ + || ls /usr/include/portmidi.h diff --git a/patches/conf-libssl/homebrew.sh.3 b/patches/conf-libssl/homebrew.sh.3 new file mode 100644 index 0000000..7352f44 --- /dev/null +++ b/patches/conf-libssl/homebrew.sh.3 @@ -0,0 +1,30 @@ +#!/bin/sh -ex + +# check the openssl installation +# and symlink the homebrew pkg-config files for openssl to the opam local pkgconfig directory + +brew_pkg_config=$(brew --prefix openssl)/lib/pkgconfig + +case "$1" in +check) + if test "$#" != 1; then + echo "Usage: $0 check" + exit 1 + fi + export PKG_CONFIG_PATH=$brew_pkg_config:$PKG_CONFIG_PATH + pkg-config --print-errors --exists openssl;; +install) + if test "$#" != 2; then + echo "Usage: $0 install " + exit 1 + fi + cd "$brew_pkg_config" + for file in $(ls *.pc); do + if test -f "$file"; then + ln -s "$brew_pkg_config/$file" "$2/pkgconfig/$file" + fi + done;; +*) + echo "Usage: $0 " + exit 1;; +esac diff --git a/patches/conf-libssl/homebrew.sh.4 b/patches/conf-libssl/homebrew.sh.4 new file mode 100644 index 0000000..9b46ab5 --- /dev/null +++ b/patches/conf-libssl/homebrew.sh.4 @@ -0,0 +1,34 @@ +#!/bin/sh -ex + +# check the openssl installation +# and symlink the homebrew pkg-config files for openssl to the opam local pkgconfig directory + +brew_pkg_config=$(brew --prefix openssl)/lib/pkgconfig + +case "$1" in + check) + if test "$#" != 1; then + echo "Usage: $0 check" + exit 1 + fi + export PKG_CONFIG_PATH="$brew_pkg_config:$PKG_CONFIG_PATH" + pkg-config --print-errors --exists openssl + ;; + install) + if test "$#" != 2; then + echo "Usage: $0 install " + exit 1 + fi + for fpath in "$brew_pkg_config"/*.pc; do + test -e "$fpath" || break + fname=$(basename "$fpath") + tdir="$2/pkgconfig" + mkdir -p "$tdir" + ln -s "$fpath" "$tdir/$fname" + done + ;; + *) + echo "Usage: $0 " + exit 1 + ;; +esac diff --git a/patches/conf-libssl/osx-build.sh b/patches/conf-libssl/osx-build.sh new file mode 100644 index 0000000..13410a2 --- /dev/null +++ b/patches/conf-libssl/osx-build.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +# Try just executing pkg-config openssl before looking +# explicitly for Nix -> Homebrew -> MacPorts. +# This handles the case where the user has set +# PKG_CONFIG_PATH themselves. +res=$(pkg-config openssl) +if [ $? -eq 0 ]; then + echo $res + exit 0 +fi + +if [ -e "$HOME/.nix-profile/lib/pkgconfig/openssl.pc" ]; then + # Nix on macOS + res=$(env PKG_CONFIG_PATH=$HOME/.nix-profile/lib/pkgconfig pkg-config openssl) + if [ $? -eq 0 ]; then + echo $res + exit 0 + fi +fi + +if [ -e "/usr/local/opt/openssl/lib/pkgconfig/openssl.pc" ]; then + # Homebrew (legacy try) + res=$(env PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig pkg-config openssl) + if [ $? -eq 0 ]; then + echo $res + exit 0 + fi +fi + +if [ -e "$(brew --prefix openssl)/lib/pkgconfig/openssl.pc" ]; then + # Homebrew (new try) + res=$(env PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig pkg-config openssl) + if [ $? -eq 0 ]; then + echo $res + exit 0 + fi +fi + +# MacPorts +PKG_CONFIG_PATH=/opt/local/lib/pkgconfig pkg-config openssl diff --git a/patches/conf-libsvm/test.c b/patches/conf-libsvm/test.c new file mode 100644 index 0000000..e2a0ba2 --- /dev/null +++ b/patches/conf-libsvm/test.c @@ -0,0 +1,17 @@ +#include +#include +#if defined DARWIN || defined __FreeBSD__ +#include +#else +#include +#endif + +void print(const char * s) { + puts(s); + return; +} + +int main(void) { + svm_set_print_string_function(print); + return 0; +} diff --git a/patches/conf-llvm/configure b/patches/conf-llvm/configure new file mode 100644 index 0000000..5b1361e --- /dev/null +++ b/patches/conf-llvm/configure @@ -0,0 +1,26 @@ +#!/bin/bash -ex + +version="$1" + +config=${LLVM_CONFIG} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in $config llvm-config-$version llvm-config${version//./} llvm-config-mp-$version $brew_llvm_config llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.10.0.0 b/patches/conf-llvm/configure.sh.10.0.0 new file mode 100644 index 0000000..d88f6ed --- /dev/null +++ b/patches/conf-llvm/configure.sh.10.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config $brew_llvm_config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.11.0.0 b/patches/conf-llvm/configure.sh.11.0.0 new file mode 100644 index 0000000..446117b --- /dev/null +++ b/patches/conf-llvm/configure.sh.11.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config $brew_llvm_config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.12.0.1 b/patches/conf-llvm/configure.sh.12.0.1 new file mode 100644 index 0000000..446117b --- /dev/null +++ b/patches/conf-llvm/configure.sh.12.0.1 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config $brew_llvm_config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.13.0.0 b/patches/conf-llvm/configure.sh.13.0.0 new file mode 100644 index 0000000..446117b --- /dev/null +++ b/patches/conf-llvm/configure.sh.13.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config $brew_llvm_config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.14.0.6 b/patches/conf-llvm/configure.sh.14.0.6 new file mode 100644 index 0000000..446117b --- /dev/null +++ b/patches/conf-llvm/configure.sh.14.0.6 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config $brew_llvm_config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.15 b/patches/conf-llvm/configure.sh.15 new file mode 100644 index 0000000..1212754 --- /dev/null +++ b/patches/conf-llvm/configure.sh.15 @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e +set -x + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config $brew_llvm_config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.16 b/patches/conf-llvm/configure.sh.16 new file mode 100644 index 0000000..f2377ed --- /dev/null +++ b/patches/conf-llvm/configure.sh.16 @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e +set -x + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config${version} llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config $brew_llvm_config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.3.8 b/patches/conf-llvm/configure.sh.3.8 new file mode 100644 index 0000000..06227ac --- /dev/null +++ b/patches/conf-llvm/configure.sh.3.8 @@ -0,0 +1,26 @@ +#!/bin/bash -ex + +version="$1" + +config=${LLVM_CONFIG} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in $config llvm-config-$version llvm-config${version//./} llvm-config-mp-$version llvm${version}-config $brew_llvm_config llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.3.9 b/patches/conf-llvm/configure.sh.3.9 new file mode 100644 index 0000000..06227ac --- /dev/null +++ b/patches/conf-llvm/configure.sh.3.9 @@ -0,0 +1,26 @@ +#!/bin/bash -ex + +version="$1" + +config=${LLVM_CONFIG} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in $config llvm-config-$version llvm-config${version//./} llvm-config-mp-$version llvm${version}-config $brew_llvm_config llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.4.0.0 b/patches/conf-llvm/configure.sh.4.0.0 new file mode 100644 index 0000000..a527d89 --- /dev/null +++ b/patches/conf-llvm/configure.sh.4.0.0 @@ -0,0 +1,26 @@ +#!/bin/bash -ex + +version=${1/%.?/} + +config=${LLVM_CONFIG} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in $config llvm-config-$version llvm-config${version//./} llvm-config-mp-$version llvm${version}-config $brew_llvm_config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.5.0.0 b/patches/conf-llvm/configure.sh.5.0.0 new file mode 100644 index 0000000..bd0d7c6 --- /dev/null +++ b/patches/conf-llvm/configure.sh.5.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config${version//./} llvm-config-mp-$version llvm${version}-config $brew_llvm_config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.6.0.0 b/patches/conf-llvm/configure.sh.6.0.0 new file mode 100644 index 0000000..bd0d7c6 --- /dev/null +++ b/patches/conf-llvm/configure.sh.6.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config${version//./} llvm-config-mp-$version llvm${version}-config $brew_llvm_config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.7.0.0 b/patches/conf-llvm/configure.sh.7.0.0 new file mode 100644 index 0000000..d88f6ed --- /dev/null +++ b/patches/conf-llvm/configure.sh.7.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config $brew_llvm_config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.8.0.0 b/patches/conf-llvm/configure.sh.8.0.0 new file mode 100644 index 0000000..d88f6ed --- /dev/null +++ b/patches/conf-llvm/configure.sh.8.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config $brew_llvm_config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-llvm/configure.sh.9.0.0 b/patches/conf-llvm/configure.sh.9.0.0 new file mode 100644 index 0000000..d88f6ed --- /dev/null +++ b/patches/conf-llvm/configure.sh.9.0.0 @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +version=${1/%.?.?/} + +if hash brew 2>/dev/null; then + brew_llvm_config="$(brew --cellar)"/llvm*/${version}*/bin/llvm-config +fi + +shopt -s nullglob +for llvm_config in llvm-config-$version llvm-config-${version}.0 llvm-config${version}0 llvm-config-mp-$version llvm-config-mp-${version}.0 llvm${version}-config $brew_llvm_config llvm-config-${version}-32 llvm-config-${version}-64 llvm-config; do + llvm_version="`$llvm_config --version`" || true + case $llvm_version in + $version*) + echo "config: \"$llvm_config\"" >> conf-llvm.config + echo "version: \"$llvm_version\"" >> conf-llvm.config + exit 0;; + *) + echo "Note: '$llvm_config' doesn't match the required version. Got '$llvm_version' but required '$version'." + continue;; + esac +done + +echo "Error: LLVM ${version} is not installed." +exit 1 diff --git a/patches/conf-mbedtls/test.c b/patches/conf-mbedtls/test.c new file mode 100644 index 0000000..404d90d --- /dev/null +++ b/patches/conf-mbedtls/test.c @@ -0,0 +1,7 @@ +#include +#include + +int main (void) { + printf ("%s\n", MBEDTLS_VERSION_STRING); + return 0; +} diff --git a/patches/conf-mecab/test.c b/patches/conf-mecab/test.c new file mode 100644 index 0000000..ab6824b --- /dev/null +++ b/patches/conf-mecab/test.c @@ -0,0 +1,9 @@ +#include + +int main () { + void * a = (void *) mecab_version; + void * b = (void *) mecab_lattice_new; // since v0.99 + void * c = (void *) mecab_lattice_set_boundary_constraint; // since v0.995 + void * d = (void *) mecab_lattice_set_result; // since v0.996 + return 0; +} diff --git a/patches/conf-mpfr-paths/test-mpfr.c b/patches/conf-mpfr-paths/test-mpfr.c new file mode 100644 index 0000000..ac80fb4 --- /dev/null +++ b/patches/conf-mpfr-paths/test-mpfr.c @@ -0,0 +1,9 @@ +#include +#include + +int main (void) { + printf ("MPFR library: %-12s\nMPFR header: %s (based on %d.%d.%d)\n", + mpfr_get_version (), MPFR_VERSION_STRING, MPFR_VERSION_MAJOR, + MPFR_VERSION_MINOR, MPFR_VERSION_PATCHLEVEL); + return 0; +} diff --git a/patches/conf-mpfr/test.c b/patches/conf-mpfr/test.c new file mode 100644 index 0000000..d090c90 --- /dev/null +++ b/patches/conf-mpfr/test.c @@ -0,0 +1,11 @@ +#include +#include + +// compile with: gcc test.c -lmpfr -lgmp + +int main (void) { + printf ("MPFR library: %-12s\nMPFR header: %s (based on %d.%d.%d)\n", + mpfr_get_version (), MPFR_VERSION_STRING, MPFR_VERSION_MAJOR, + MPFR_VERSION_MINOR, MPFR_VERSION_PATCHLEVEL); + return 0; +} diff --git a/patches/conf-mpi/configure b/patches/conf-mpi/configure new file mode 100644 index 0000000..16f1ea8 --- /dev/null +++ b/patches/conf-mpi/configure @@ -0,0 +1,83 @@ +#!/bin/sh -e + +write() { +cat > conf-mpi.config </dev/null | head -n 1) + MPICH_INCDIR=$(ls -d -1 /usr/include/mpich* 2>/dev/null | head -n 1) + if [ -d "${OPENMPI_INCDIR}" ] + then + MPI_INC_DIR=${OPENMPI_INCDIR} + MPI32=/usr/lib/openmpi + MPI64=/usr/lib64/openmpi + if [ -d ${MPI32} ] + then + MPI=${MPI32} + elif [ -d ${MPI64} ] + then + MPI=${MPI64} + fi + if [ -d "${MPI}" ] + then + MPI_LIB_DIR=${MPI}/lib + MPI_BIN_PATH=${MPI}/bin/ + write + fi + elif [ -d "${MPICH_INCDIR}" ] + then + MPI_INC_DIR=${MPICH_INCDIR} + MPI32=/usr/lib/mpich + MPI64=/usr/lib64/mpich + if [ -d ${MPI32} ] + then + MPI=${MPI32} + elif [ -d "${MPI64}" ] + then + MPI=${MPI64} + fi + if [ -d "${MPI}" ] + then + MPI_LIB_DIR=${MPI}/lib + MPI_BIN_PATH=${MPI}/bin/ + write + fi + fi +fi + +if [ ! -f conf-mpi.config ] +then + echo "Unable to locate a valid MPI installation (openmpi or mpich)." + echo + echo "If you have one and it is not detected, you may manually set" + echo "the following variables and restart this script:" + echo "* MPI_INC_DIR: include directory containing 'mpi.h', e.g., /usr/include/openmpi" + echo "* MPI_LIB_DIR: library directory containing 'libmpi.{so,dll}', e.g., /usr/lib/openmpi/lib" + echo "* MPI_BIN_PATH: path to the 'mpicc' and 'mpirun' binaries, e.g., /usr/lib/openmpi/bin" + echo + echo "To install MPI, try: opam depext conf-mpi" + exit 2 +fi + diff --git a/patches/conf-netsnmp/test.c b/patches/conf-netsnmp/test.c new file mode 100644 index 0000000..14fb351 --- /dev/null +++ b/patches/conf-netsnmp/test.c @@ -0,0 +1,11 @@ +#include +#include + +#ifndef NET_SNMP_MIB_API_H +#error "No NetSNMP header" +#endif + +void test(void) +{ + netsnmp_init_mib(); +} diff --git a/patches/conf-openblas/centos_install.sh b/patches/conf-openblas/centos_install.sh new file mode 100644 index 0000000..5b300e3 --- /dev/null +++ b/patches/conf-openblas/centos_install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +yes | yum update +yes | yum install git +yes | yum install gcc gcc-c++ gcc-gfortran make kernel-devel + +git clone https://github.com/xianyi/OpenBLAS.git +cd OpenBLAS +make && make install +cd .. +rm -rf OpenBLAS diff --git a/patches/conf-openblas/test.c.0.1 b/patches/conf-openblas/test.c.0.1 new file mode 100644 index 0000000..cd7190b --- /dev/null +++ b/patches/conf-openblas/test.c.0.1 @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char **argv) +{ + int N = 3; + double X[] = { 1, 2, 3 }; + int INCX = 1; + double res = cblas_dnrm2(N, X, INCX); + return 0; +} diff --git a/patches/conf-openblas/test.c.0.2.0 b/patches/conf-openblas/test.c.0.2.0 new file mode 100644 index 0000000..cd7190b --- /dev/null +++ b/patches/conf-openblas/test.c.0.2.0 @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char **argv) +{ + int N = 3; + double X[] = { 1, 2, 3 }; + int INCX = 1; + double res = cblas_dnrm2(N, X, INCX); + return 0; +} diff --git a/patches/conf-openblas/test.c.0.2.1 b/patches/conf-openblas/test.c.0.2.1 new file mode 100644 index 0000000..d9dab94 --- /dev/null +++ b/patches/conf-openblas/test.c.0.2.1 @@ -0,0 +1,12 @@ +#define _GNU_SOURCE +#include +#include + +int main(int argc, char **argv) +{ + int N = 3; + double X[] = { 1, 2, 3 }; + int INCX = 1; + double res = cblas_dnrm2(N, X, INCX); + return 0; +} diff --git a/patches/conf-openblas/test.c.0.2.2 b/patches/conf-openblas/test.c.0.2.2 new file mode 100644 index 0000000..d9dab94 --- /dev/null +++ b/patches/conf-openblas/test.c.0.2.2 @@ -0,0 +1,12 @@ +#define _GNU_SOURCE +#include +#include + +int main(int argc, char **argv) +{ + int N = 3; + double X[] = { 1, 2, 3 }; + int INCX = 1; + double res = cblas_dnrm2(N, X, INCX); + return 0; +} diff --git a/patches/conf-opencc0/test.c b/patches/conf-opencc0/test.c new file mode 100644 index 0000000..03b2213 --- /dev/null +++ b/patches/conf-opencc0/test.c @@ -0,0 +1,3 @@ +int main(void) { + return 0; +} diff --git a/patches/conf-opencc1/test.c b/patches/conf-opencc1/test.c new file mode 100644 index 0000000..03b2213 --- /dev/null +++ b/patches/conf-opencc1/test.c @@ -0,0 +1,3 @@ +int main(void) { + return 0; +} diff --git a/patches/conf-opencc1_1/test.c b/patches/conf-opencc1_1/test.c new file mode 100644 index 0000000..03b2213 --- /dev/null +++ b/patches/conf-opencc1_1/test.c @@ -0,0 +1,3 @@ +int main(void) { + return 0; +} diff --git a/patches/conf-openimageio/test.cpp b/patches/conf-openimageio/test.cpp new file mode 100644 index 0000000..162a58c --- /dev/null +++ b/patches/conf-openimageio/test.cpp @@ -0,0 +1,5 @@ +#include + +#if OIIO_VERSION_MAJOR < 2 +#error "OpenImageIO (>= 2.0) is not accessible" +#endif diff --git a/patches/conf-pam/main.c b/patches/conf-pam/main.c new file mode 100644 index 0000000..9c149ab --- /dev/null +++ b/patches/conf-pam/main.c @@ -0,0 +1,4 @@ +#include +#include +static int missing_on_bsd = PAM_XDISPLAY; +int main() { return 0; } diff --git a/patches/conf-pic-switch/check.sh b/patches/conf-pic-switch/check.sh new file mode 100644 index 0000000..d39c609 --- /dev/null +++ b/patches/conf-pic-switch/check.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +opam_root=`opam config var root` +ocaml_version=`opam config var ocaml-version` +pic_comp_switch=$opam_root'/'$ocaml_version'+PIC' + +test -d $pic_comp_switch || \ +(echo "the "$pic_comp_switch" opam compiler switch is not installed" && exit 1) diff --git a/patches/conf-ppl/test.c b/patches/conf-ppl/test.c new file mode 100644 index 0000000..b8e5e6e --- /dev/null +++ b/patches/conf-ppl/test.c @@ -0,0 +1,9 @@ +#include +#ifndef PPL_VERSION_MAJOR +#error "No PPL header" +#endif + +int main() { + ppl_initialize(); + return ppl_finalize(); +} diff --git a/patches/conf-python-2-7-dev/test.c b/patches/conf-python-2-7-dev/test.c new file mode 100644 index 0000000..3ca9d4c --- /dev/null +++ b/patches/conf-python-2-7-dev/test.c @@ -0,0 +1,5 @@ +#include "python2.7/Python.h" + +int main() { + return 0; +} diff --git a/patches/conf-python-2-7/test.py b/patches/conf-python-2-7/test.py new file mode 100644 index 0000000..9aba9b0 --- /dev/null +++ b/patches/conf-python-2-7/test.py @@ -0,0 +1 @@ +print 'python-2.7 OK' diff --git a/patches/conf-python-3-7/configure.sh b/patches/conf-python-3-7/configure.sh new file mode 100644 index 0000000..fce943a --- /dev/null +++ b/patches/conf-python-3-7/configure.sh @@ -0,0 +1,8 @@ +for version in 3.11 3.10 3.9 3.8 3.7; do + python_exe="python$version" + if "$python_exe" test.py; then + echo "python3: \"$python_exe\"" >> conf-python-3-7.config + exit 0 + fi +done +exit 1 diff --git a/patches/conf-python-3-7/test.py b/patches/conf-python-3-7/test.py new file mode 100644 index 0000000..a45974e --- /dev/null +++ b/patches/conf-python-3-7/test.py @@ -0,0 +1,2 @@ +import sys +assert(sys.hexversion >= 0x03070000) diff --git a/patches/conf-python-3-dev/Makefile b/patches/conf-python-3-dev/Makefile new file mode 100644 index 0000000..1195405 --- /dev/null +++ b/patches/conf-python-3-dev/Makefile @@ -0,0 +1,2 @@ +build: + cc `python3-config --includes` -o test test.c diff --git a/patches/conf-python-3-dev/test.c b/patches/conf-python-3-dev/test.c new file mode 100644 index 0000000..9390551 --- /dev/null +++ b/patches/conf-python-3-dev/test.c @@ -0,0 +1,5 @@ +#include "Python.h" + +int main() { + return 0; +} diff --git a/patches/conf-python-3/test.py b/patches/conf-python-3/test.py new file mode 100644 index 0000000..7b9ec15 --- /dev/null +++ b/patches/conf-python-3/test.py @@ -0,0 +1 @@ +print('python-3 OK') diff --git a/patches/conf-qt/configure.sh b/patches/conf-qt/configure.sh new file mode 100644 index 0000000..32f71b9 --- /dev/null +++ b/patches/conf-qt/configure.sh @@ -0,0 +1,29 @@ +#!/bin/sh +set -x + +MINVERSION=unknown +if [ "$#" -eq 2 ]; then + MINVERSION=$1 + SUFFIX=$2 +elif [ "$#" -eq 1 ]; then + MINVERSION=$1 + SUFFIX= +else + echo "Usage: $0 version [prefix]" >&2 + exit 1 +fi + +QMAKE=qmake$SUFFIX + +which $QMAKE || exit 1 +$QMAKE --version || exit 1 +#echo "Your Qt version is `qmake -query QT_VERSION`" + +cur=`$QMAKE -query QT_VERSION`; +res=`printf "$MINVERSION\\n$cur\\n" | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -n | head -n 1`; +echo $res +if [ "$res" = "$MINVERSION" ]; then + exit 0 +else + exit 1 +fi diff --git a/patches/conf-r/check.r b/patches/conf-r/check.r new file mode 100644 index 0000000..d780d0a --- /dev/null +++ b/patches/conf-r/check.r @@ -0,0 +1 @@ +quit(status=0) diff --git a/patches/conf-radare2/find-radare2.ml.in b/patches/conf-radare2/find-radare2.ml.in new file mode 100644 index 0000000..5b63633 --- /dev/null +++ b/patches/conf-radare2/find-radare2.ml.in @@ -0,0 +1,60 @@ +open Printf + +exception Command_failed of Unix.process_status + +let process_status_to_string s = + let open Unix in + match s with + | WEXITED i -> sprintf "exit status %d" 1 + | WSTOPPED i -> sprintf "proccess was stopped by signal %d" i + | WSIGNALED i -> sprintf "proccess was killed by signal %d" i + +let exn_to_string = function + | Command_failed s -> sprintf "%s" (process_status_to_string s) + | e -> Printexc.to_string e + +let input_all ch = + let buf = Buffer.create 4096 in + let rec read () = Buffer.add_channel buf ch 4096; read () in + try read () + with End_of_file -> String.trim @@ Buffer.contents buf + +let run c = + try + let inp = Unix.open_process_in c in + let res = input_all inp in + match Unix.close_process_in inp with + | Unix.WEXITED 0 -> Some res + | s -> raise (Command_failed s) + with e -> + eprintf "command %s failed: %s\n" c (exn_to_string e); + None + +let cmd fmt = ksprintf run fmt + +let which name = cmd "which %s" name + +let write path = + let file_depends = + sprintf "file-depends: [ [ %S %S ] ]\n" + path (Digest.to_hex (Digest.file path)) in + let oc = open_out "%{_:name}%.config" in + fprintf oc {| +opam-version: "2.0" +%s +variables { + path: %S +} +|} file_depends path; + close_out oc + +let () = + try + match which "radare2" with + | Some path -> write path + | None -> + eprintf "failed to locate radare2\n"; + exit 1 + with e -> + eprintf "build failed: %s\n" (Printexc.to_string e); + exit 1 diff --git a/patches/conf-rdkit/test.cpp b/patches/conf-rdkit/test.cpp new file mode 100644 index 0000000..54f2b50 --- /dev/null +++ b/patches/conf-rdkit/test.cpp @@ -0,0 +1,9 @@ +#include +#include "rdkit/RDGeneral/versions.h" + +// compile with: c++ test.cpp -o test -l RDGeneral + +int main() { + printf("%s\n", RDKit::rdkitVersion); + return 0; +} diff --git a/patches/conf-rocksdb/main.c b/patches/conf-rocksdb/main.c new file mode 100644 index 0000000..76e8197 --- /dev/null +++ b/patches/conf-rocksdb/main.c @@ -0,0 +1 @@ +int main() { return 0; } diff --git a/patches/conf-rust-2018/test.rs b/patches/conf-rust-2018/test.rs new file mode 100644 index 0000000..f328e4d --- /dev/null +++ b/patches/conf-rust-2018/test.rs @@ -0,0 +1 @@ +fn main() {} diff --git a/patches/conf-rust-2021/test.rs b/patches/conf-rust-2021/test.rs new file mode 100644 index 0000000..f328e4d --- /dev/null +++ b/patches/conf-rust-2021/test.rs @@ -0,0 +1 @@ +fn main() {} diff --git a/patches/conf-snappy/test.cpp b/patches/conf-snappy/test.cpp new file mode 100644 index 0000000..849b7dc --- /dev/null +++ b/patches/conf-snappy/test.cpp @@ -0,0 +1,14 @@ +#include +#include +using namespace std; + +int main() { + string input = "Hello World, Hello World, Hello World!"; + string compressed; + snappy::Compress(input.data(), input.size(), &compressed); + cout << input.size() << " => " << compressed.size() << endl; + string output; + snappy::Uncompress(compressed.data(), compressed.size(), &output); + cout << output << endl; + return 0; +} diff --git a/patches/conf-sundials/test.c b/patches/conf-sundials/test.c new file mode 100644 index 0000000..fd96980 --- /dev/null +++ b/patches/conf-sundials/test.c @@ -0,0 +1 @@ +#include diff --git a/patches/conf-tcl/check.sh b/patches/conf-tcl/check.sh new file mode 100644 index 0000000..c17852d --- /dev/null +++ b/patches/conf-tcl/check.sh @@ -0,0 +1,6 @@ +pkg-config tcl || \ +cc -o /dev/null \ + -I/usr/include/tcl \ + -I/usr/local/include/tcl \ + -I/usr/local/include/tcl8.6 \ + compiletest.c diff --git a/patches/conf-tcl/compiletest.c b/patches/conf-tcl/compiletest.c new file mode 100644 index 0000000..970b67a --- /dev/null +++ b/patches/conf-tcl/compiletest.c @@ -0,0 +1,6 @@ +#include +#include +int main (){ + puts(TCL_VERSION); + return 0; +} diff --git a/patches/conf-tidy/test.c b/patches/conf-tidy/test.c new file mode 100644 index 0000000..f3641c5 --- /dev/null +++ b/patches/conf-tidy/test.c @@ -0,0 +1,5 @@ +#include + +int main(void) { + return 0; +} diff --git a/patches/conf-tk/check.sh b/patches/conf-tk/check.sh new file mode 100644 index 0000000..2b8e9dd --- /dev/null +++ b/patches/conf-tk/check.sh @@ -0,0 +1,9 @@ +pkg-config tk || \ +cc -o /dev/null \ + -I/usr/include/tk \ + -I/usr/local/include/tk \ + -I/usr/local/include/tcl8.6 \ + -I/usr/local/include/tk8.6 \ + -I/usr/local/include \ + -I/opt/X11/include \ + compiletest.c diff --git a/patches/conf-tk/compiletest.c b/patches/conf-tk/compiletest.c new file mode 100644 index 0000000..8a81c19 --- /dev/null +++ b/patches/conf-tk/compiletest.c @@ -0,0 +1,6 @@ +#include +#include +int main (){ + puts(TK_VERSION); + return 0; +} diff --git a/patches/conf-trexio/test.c b/patches/conf-trexio/test.c new file mode 100644 index 0000000..d31c24f --- /dev/null +++ b/patches/conf-trexio/test.c @@ -0,0 +1,7 @@ +#include + +// compile with: gcc test.c -ltrexio + +int main () { + return 0; +} diff --git a/patches/conf-xen/test.c b/patches/conf-xen/test.c new file mode 100644 index 0000000..8804695 --- /dev/null +++ b/patches/conf-xen/test.c @@ -0,0 +1,5 @@ +#include + +int main(void) { + return 0; +} diff --git a/patches/conf-zmq/test.c b/patches/conf-zmq/test.c new file mode 100644 index 0000000..fc4e31b --- /dev/null +++ b/patches/conf-zmq/test.c @@ -0,0 +1,7 @@ +#include + +// compile with: gcc test.c -lzmq + +int main () { + return 0; +} diff --git a/patches/coq-serapi/coq-serapi.install b/patches/coq-serapi/coq-serapi.install new file mode 100644 index 0000000..b0565bc --- /dev/null +++ b/patches/coq-serapi/coq-serapi.install @@ -0,0 +1,4 @@ +bin: [ + "_build/sertop/sertop.native" { "sertop" } + "_build/sertop/sercomp.native" { "sercomp" } +] diff --git a/patches/coq/0001_make_install_static_plug.patch b/patches/coq/0001_make_install_static_plug.patch new file mode 100644 index 0000000..c8d9c75 --- /dev/null +++ b/patches/coq/0001_make_install_static_plug.patch @@ -0,0 +1,45 @@ +diff --git a/META.coq b/META.coq +index 139dda5ee..044b689e5 100644 +--- a/META.coq ++++ b/META.coq +@@ -47,13 +47,17 @@ package "vm" ( + + directory = "kernel/byterun" + +-# We should generate this file at configure time for local byte builds +-# to work properly. +- +-# Enable this setting for local byte builds, disabling the one below. ++# We could generate this file at configure time for the share byte ++# build path to work properly. ++# ++# Enable this setting for local byte builds if you want dynamic linking: ++# + # linkopts(byte) = "-dllpath path_to_coq/kernel/byterun/ -dllib -lcoqrun" + +- linkopts(byte) = "-dllib -lcoqrun" ++# We currently prefer static linking of the VM. ++ archive(byte) = "libcoqrun.a" ++ linkopts(byte) = "-custom" ++ + linkopts(native) = "-cclib -lcoqrun" + + ) +diff --git a/Makefile.install b/Makefile.install +index e7f368020..0cd61b579 100644 +--- a/Makefile.install ++++ b/Makefile.install +@@ -109,9 +109,10 @@ install-devfiles: + $(INSTALLBIN) $(COQMKTOP) $(FULLBINDIR) + $(MKDIR) $(FULLCOQLIB) + $(INSTALLSH) $(FULLCOQLIB) $(GRAMMARCMA) +- $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMI) +- $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMX) +- $(INSTALLSH) $(FULLCOQLIB) $(PLUGINSCMO:.cmo=.o) ++ $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMI) # Regular CMI files ++ $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMX) # To avoid warning 58 "-opaque" ++ $(INSTALLSH) $(FULLCOQLIB) $(PLUGINSCMO:.cmo=.cmx) # For static linking of plugins ++ $(INSTALLSH) $(FULLCOQLIB) $(PLUGINSCMO:.cmo=.o) # For static linking of plugins + $(INSTALLSH) $(FULLCOQLIB) $(TOOLS_HELPERS) + ifeq ($(BEST),opt) + $(INSTALLSH) $(FULLCOQLIB) $(LINKCMX) $(CORECMA:.cma=.a) $(STATICPLUGINS:.cma=.a) diff --git a/patches/coq/0002_alpine_linux.patch b/patches/coq/0002_alpine_linux.patch new file mode 100644 index 0000000..34d04fe --- /dev/null +++ b/patches/coq/0002_alpine_linux.patch @@ -0,0 +1,27 @@ +diff --git a/Makefile.build b/Makefile.build +index 550b511c3..79fecf3ec 100644 +--- a/Makefile.build ++++ b/Makefile.build +@@ -734,7 +734,8 @@ $(MICROMEGAV:.v=.vo) $(MICROMEGAV:.v=.glob) : $(MICROMEGAV) theories/Init/Prelud + $(SHOW)'COQC $<' + $(HIDE)rm -f $*.glob + $(HIDE)$(BOOTCOQC) $< | sed -e '$$d' > $(MICROMEGAGEN) +- $(HIDE)diff -u --strip-trailing-cr $(MICROMEGAML) $(MICROMEGAGEN) || \ ++ # Alpine's Linux diff is quite restricted, hence the -b -B ++ $(HIDE)diff -u -b -B $(MICROMEGAML) $(MICROMEGAGEN) || \ + (2>&1 echo "Error: $(MICROMEGAML) and the code generated by $(MICROMEGAV) differ !" && false) + + # The general rule for building .vo files : +diff --git a/configure.ml b/configure.ml +index 3dab3d414..d17a5f527 100644 +--- a/configure.ml ++++ b/configure.ml +@@ -897,6 +897,8 @@ let strip = + let md5sum = + select_command "Don’t know how to compute MD5 checksums…" [ + "md5sum", [], [ "--version" ]; ++ (* Alpine Linux md5sum is really limited... *) ++ "md5sum", [], [ "Makefile" ]; + "md5", ["-q"], [ "-s" ; "''" ]; + ] + diff --git a/patches/coq/0003_fix_num_ocamlfind_detection.patch b/patches/coq/0003_fix_num_ocamlfind_detection.patch new file mode 100644 index 0000000..9b83844 --- /dev/null +++ b/patches/coq/0003_fix_num_ocamlfind_detection.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.build b/Makefile.build +index 6209fdde394..53de722ce31 100644 +--- a/Makefile.build ++++ b/Makefile.build +@@ -600,10 +600,26 @@ COND_BYTEFLAGS= \ + COND_OPTFLAGS= \ + $(if $(filter tools/fake_ide% tools/coq_makefile%,$<), -I ide,) $(MLINCLUDES) $(OPTFLAGS) + ++plugins/micromega/%.cmi: plugins/micromega/%.mli ++ $(SHOW)'OCAMLC $<' ++ $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< ++ ++plugins/nsatz/%.cmi: plugins/nsatz/%.mli ++ $(SHOW)'OCAMLC $<' ++ $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< ++ + %.cmi: %.mli + $(SHOW)'OCAMLC $<' + $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -c $< + ++plugins/micromega/%.cmo: plugins/micromega/%.ml ++ $(SHOW)'OCAMLC $<' ++ $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< ++ ++plugins/nsatz/%.cmo: plugins/nsatz/%.ml ++ $(SHOW)'OCAMLC $<' ++ $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< ++ + %.cmo: %.ml + $(SHOW)'OCAMLC $<' + $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -c $< +@@ -637,6 +653,14 @@ plugins/micromega/sos_FORPACK:= + plugins/micromega/sos_print_FORPACK:= + plugins/micromega/csdpcert_FORPACK:= + ++plugins/micromega/%.cmx: plugins/micromega/%.ml ++ $(SHOW)'OCAMLOPT $<' ++ $(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -package unix,num -c $< ++ ++plugins/nsatz/%.cmx: plugins/nsatz/%.ml ++ $(SHOW)'OCAMLOPT $<' ++ $(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -package unix,num -c $< ++ + plugins/%.cmx: plugins/%.ml + $(SHOW)'OCAMLOPT $<' + $(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -c $< diff --git a/patches/coq/0004_fix_more_num.patch b/patches/coq/0004_fix_more_num.patch new file mode 100644 index 0000000..077946b --- /dev/null +++ b/patches/coq/0004_fix_more_num.patch @@ -0,0 +1,34 @@ +diff --git a/Makefile.build b/Makefile.build +index b0e754611..312ce53dd 100644 +--- a/Makefile.build ++++ b/Makefile.build +@@ -530,7 +530,7 @@ CSDPCERTCMO:=lib/clib.cma $(addprefix plugins/micromega/, \ + + $(CSDPCERT): $(call bestobj, $(CSDPCERTCMO)) + $(SHOW)'OCAMLBEST -o $@' +- $(HIDE)$(call bestocaml,,nums unix) ++ $(HIDE)$(call bestocaml,-linkpkg -package num -package unix,) + + ########################################################################### + # tests +diff --git a/tools/coqmktop.ml b/tools/coqmktop.ml +index 950ed53cc..c387c8798 100644 +--- a/tools/coqmktop.ml ++++ b/tools/coqmktop.ml +@@ -108,7 +108,7 @@ let incl_all_subdirs dir opts = + + (** OCaml + CamlpX libraries *) + +-let ocaml_libs = ["str.cma";"unix.cma";"nums.cma";"dynlink.cma";"threads.cma"] ++let ocaml_libs = ["str.cma";"dynlink.cma"] + let camlp4_libs = ["gramlib.cma"] + let libobjs = ocaml_libs @ camlp4_libs + +@@ -289,6 +289,7 @@ let main () = + List.filter ((<>) "") (split_on_char ' ' Coq_config.caml_flags) in + let args = + coq_camlflags @ "-linkall" :: "-w" :: "-31" :: flags @ copts @ options @ ++ ["-linkpkg"; "-package"; "num"] @ + (std_includes basedir) @ tolink @ [ main_file ] @ topstart + in + if !echo then begin diff --git a/patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl1 b/patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl1 new file mode 100644 index 0000000..8095d2d --- /dev/null +++ b/patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl1 @@ -0,0 +1,11 @@ +--- coq.8.4pl1/configure 2012-12-22 11:06:16.000000000 +0100 ++++ coq.8.4pl1/configure 2013-01-18 16:30:02.110785838 +0100 +@@ -887,7 +887,7 @@ + */true/*/*) COQRUNBYTEFLAGS="-dllib -lcoqrun -dllpath '$COQTOP'/kernel/byterun";; + *) + COQRUNBYTEFLAGS="-dllib -lcoqrun -dllpath '$LIBDIR'" +- BUILDLDPATH="export CAML_LD_LIBRARY_PATH='$COQTOP'/kernel/byterun";; ++ BUILDLDPATH="export CAML_LD_LIBRARY_PATH='$COQTOP'/kernel/byterun:$CAML_LD_LIBRARY_PATH";; + esac + case $coqtoolsbyteflags_spec/$custom_spec/$CUSTOM_OS in + yes/*/*) COQTOOLSBYTEFLAGS="$coqtoolsbyteflags";; diff --git a/patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl2 b/patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl2 new file mode 100644 index 0000000..5643a71 --- /dev/null +++ b/patches/coq/CAML_LD_LIBRARY_PATH.patch.8.4pl2 @@ -0,0 +1,11 @@ +--- coq.8.4pl2/configure 2012-12-22 11:06:16.000000000 +0100 ++++ coq.8.4pl2/configure 2013-01-18 16:30:02.110785838 +0100 +@@ -887,7 +887,7 @@ + */true/*/*) COQRUNBYTEFLAGS="-dllib -lcoqrun -dllpath '$COQTOP'/kernel/byterun";; + *) + COQRUNBYTEFLAGS="-dllib -lcoqrun -dllpath '$LIBDIR'" +- BUILDLDPATH="export CAML_LD_LIBRARY_PATH='$COQTOP'/kernel/byterun";; ++ BUILDLDPATH="export CAML_LD_LIBRARY_PATH='$COQTOP'/kernel/byterun:$CAML_LD_LIBRARY_PATH";; + esac + case $coqtoolsbyteflags_spec/$custom_spec/$CUSTOM_OS in + yes/*/*) COQTOOLSBYTEFLAGS="$coqtoolsbyteflags";; diff --git a/patches/coq/Makefile.checker.patch b/patches/coq/Makefile.checker.patch new file mode 100644 index 0000000..0d31ea4 --- /dev/null +++ b/patches/coq/Makefile.checker.patch @@ -0,0 +1,19 @@ +--- a/Makefile.checker 2019-01-26 13:41:24.000000000 +0100 ++++ b/Makefile.checker 2019-01-26 13:40:59.000000000 +0100 +@@ -37,16 +37,12 @@ + # Copied files + checker/esubst.mli: kernel/esubst.mli + cp -a $< $@ +- sed -i.bak '1i(* AUTOGENERATED FILE: DO NOT EDIT *)\n\n\n\n\n\n\n\n' $@ && rm $@.bak + checker/esubst.ml: kernel/esubst.ml + cp -a $< $@ +- sed -i.bak '1i(* AUTOGENERATED FILE: DO NOT EDIT *)\n\n\n\n\n\n\n\n' $@ && rm $@.bak + checker/names.mli: kernel/names.mli + cp -a $< $@ +- sed -i.bak '1i(* AUTOGENERATED FILE: DO NOT EDIT *)\n\n\n\n\n\n\n\n' $@ && rm $@.bak + checker/names.ml: kernel/names.ml + cp -a $< $@ +- sed -i.bak '1i(* AUTOGENERATED FILE: DO NOT EDIT *)\n\n\n\n\n\n\n\n' $@ && rm $@.bak + + ifeq ($(BEST),opt) + $(CHICKEN): checker/check.cmxa checker/main.mli checker/main.ml diff --git a/patches/coq/build_with_trunk.patch b/patches/coq/build_with_trunk.patch new file mode 100644 index 0000000..d166e5e --- /dev/null +++ b/patches/coq/build_with_trunk.patch @@ -0,0 +1,330 @@ +diff -ru coq-8.4pl5/kernel/byterun/coq_fix_code.c coq-8.4pl5_patched/kernel/byterun/coq_fix_code.c +--- coq-8.4pl5/kernel/byterun/coq_fix_code.c 2015-02-23 18:44:01.580258761 +0100 ++++ coq-8.4pl5_patched/kernel/byterun/coq_fix_code.c 2015-02-24 17:22:36.242153692 +0100 +@@ -13,6 +13,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -154,7 +155,7 @@ + }; + *q++ = VALINSTR(instr); + if (instr == SWITCH) { +- uint32 i, sizes, const_size, block_size; ++ uint32_t i, sizes, const_size, block_size; + COPY32(q,p); p++; + sizes=*q++; + const_size = sizes & 0xFFFF; +@@ -162,13 +163,13 @@ + sizes = const_size + block_size; + for(i=0; i + #include ++#include + #include "coq_gc.h" + #include "coq_instruct.h" + #include "coq_fix_code.h" +@@ -30,9 +31,9 @@ + #endif + + /* spiwack: I append here a few macros for value/number manipulation */ +-#define uint32_of_value(val) (((uint32)val >> 1)) +-#define value_of_uint32(i) ((value)(((uint32)(i) << 1) | 1)) +-#define UI64_of_uint32(lo) ((uint64)(I64_literal(0,(uint32)(lo)))) ++#define uint32_of_value(val) (((uint32_t)val >> 1)) ++#define value_of_uint32(i) ((value)(((uint32_t)(i) << 1) | 1)) ++#define UI64_of_uint32(lo) ((uint64_t)(I64_literal(0,(uint32_t)(lo)))) + #define UI64_of_value(val) (UI64_of_uint32(uint32_of_value(val))) + /* /spiwack */ + +@@ -788,7 +789,7 @@ + /* Access to components of blocks */ + + Instruct(SWITCH) { +- uint32 sizes = *pc++; ++ uint32_t sizes = *pc++; + print_instr("SWITCH"); + print_int(sizes & 0xFFFF); + if (Is_block(accu)) { +@@ -1074,7 +1075,7 @@ + the one ontop of the stack (which is poped)*/ + print_instr("ADDINT31"); + accu = +- (value)((uint32) accu + (uint32) *sp++ - 1); ++ (value)((uint32_t) accu + (uint32_t) *sp++ - 1); + /* nota,unlike CaML we don't want + to have a different behavior depending on the + architecture. Thus we cast the operand to uint32 */ +@@ -1084,9 +1085,9 @@ + Instruct (ADDCINT31) { + print_instr("ADDCINT31"); + /* returns the sum with a carry */ +- uint32 s; +- s = (uint32)accu + (uint32)*sp++ - 1; +- if( (uint32)s < (uint32)accu ) { ++ uint32_t s; ++ s = (uint32_t)accu + (uint32_t)*sp++ - 1; ++ if( (uint32_t)s < (uint32_t)accu ) { + /* carry */ + Alloc_small(accu, 1, 2); /* ( _ , arity, tag ) */ + } +@@ -1101,10 +1102,10 @@ + Instruct (ADDCARRYCINT31) { + print_instr("ADDCARRYCINT31"); + /* returns the sum plus one with a carry */ +- uint32 s; +- s = (uint32)accu + (uint32)*sp++ + 1; ++ uint32_t s; ++ s = (uint32_t)accu + (uint32_t)*sp++ + 1; + value block; +- if( (uint32)s <= (uint32)accu ) { ++ if( (uint32_t)s <= (uint32_t)accu ) { + /* carry */ + Alloc_small(accu, 1, 2); /* ( _ , arity, tag ) */ + } +@@ -1120,18 +1121,18 @@ + print_instr("SUBINT31"); + /* returns the subtraction */ + accu = +- (value)((uint32) accu - (uint32) *sp++ + 1); ++ (value)((uint32_t) accu - (uint32_t) *sp++ + 1); + Next; + } + + Instruct (SUBCINT31) { + print_instr("SUBCINT31"); + /* returns the subtraction with a carry */ +- uint32 b; +- uint32 s; +- b = (uint32)*sp++; +- s = (uint32)accu - b + 1; +- if( (uint32)accu < b ) { ++ uint32_t b; ++ uint32_t s; ++ b = (uint32_t)*sp++; ++ s = (uint32_t)accu - b + 1; ++ if( (uint32_t)accu < b ) { + /* carry */ + Alloc_small(accu, 1, 2); /* ( _ , arity, tag ) */ + } +@@ -1146,11 +1147,11 @@ + Instruct (SUBCARRYCINT31) { + print_instr("SUBCARRYCINT31"); + /* returns the subtraction minus one with a carry */ +- uint32 b; +- uint32 s; +- b = (uint32)*sp++; +- s = (value)((uint32)accu - b - 1); +- if( (uint32)accu <= b ) { ++ uint32_t b; ++ uint32_t s; ++ b = (uint32_t)*sp++; ++ s = (value)((uint32_t)accu - b - 1); ++ if( (uint32_t)accu <= b ) { + /* carry */ + Alloc_small(accu, 1, 2); /* ( _ , arity, tag ) */ + } +@@ -1174,7 +1175,7 @@ + /*returns the multiplication on a double size word + (special case for 0) */ + print_instr("MULCINT31"); +- uint64 p; ++ uint64_t p; + /*accu = 2v+1, *sp=2w+1 ==> p = 2v*w */ + p = I64_mul (UI64_of_value (accu), UI64_of_uint32 ((*sp++)^1)); + if ( I64_is_zero(p) ) { +@@ -1197,10 +1198,10 @@ + /* spiwack: takes three int31 (the two first ones represent an + int62) and performs the euclidian division of the + int62 by the int31 */ +- uint64 bigint; ++ uint64_t bigint; + bigint = UI64_of_value(accu); + bigint = I64_or(I64_lsl(bigint, 31),UI64_of_value(*sp++)); +- uint64 divisor; ++ uint64_t divisor; + divisor = UI64_of_value(*sp++); + Alloc_small(accu, 2, 1); /* ( _ , arity, tag ) */ + if (I64_is_zero (divisor)) { +@@ -1208,7 +1209,7 @@ + Field(accu, 1) = 1; /* 2*0+1 */ + } + else { +- uint64 quo, mod; ++ uint64_t quo, mod; + I64_udivmod(bigint, divisor, &quo, &mod); + Field(accu, 0) = value_of_uint32(I64_to_int32(quo)); + Field(accu, 1) = value_of_uint32(I64_to_int32(mod)); +@@ -1221,7 +1222,7 @@ + /* spiwack: a priori no need of the NON_STANDARD_DIV_MOD flag + since it probably only concerns negative number. + needs to be checked at this point */ +- uint32 divisor; ++ uint32_t divisor; + divisor = uint32_of_value(*sp++); + if (divisor == 0) { + Alloc_small(accu, 2, 1); /* ( _ , arity, tag ) */ +@@ -1229,7 +1230,7 @@ + Field(accu, 1) = 1; /* 2*0+1 */ + } + else { +- uint32 modulus; ++ uint32_t modulus; + modulus = uint32_of_value(accu); + Alloc_small(accu, 2, 1); /* ( _ , arity, tag ) */ + Field(accu, 0) = value_of_uint32(modulus/divisor); +@@ -1241,7 +1242,7 @@ + Instruct (ADDMULDIVINT31) { + print_instr("ADDMULDIVINT31"); + /* higher level shift (does shifts and cycles and such) */ +- uint32 shiftby; ++ uint32_t shiftby; + shiftby = uint32_of_value(accu); + if (shiftby > 31) { + if (shiftby < 62) { +@@ -1256,7 +1257,7 @@ + /* *sp = 2*x+1 --> accu = 2^(shiftby+1)*x */ + accu = (value)(((*sp++)^1) << shiftby); + /* accu = 2^(shiftby+1)*x --> 2^(shifby+1)*x+2*y/2^(31-shiftby)+1 */ +- accu = (value)((accu | (((uint32)(*sp++)) >> (31-shiftby)))|1); ++ accu = (value)((accu | (((uint32_t)(*sp++)) >> (31-shiftby)))|1); + } + Next; + } +@@ -1265,11 +1266,11 @@ + /* returns Eq if equal, Lt if accu is less than *sp, Gt otherwise */ + /* assumes Inudctive _ : _ := Eq | Lt | Gt */ + print_instr("COMPAREINT31"); +- if ((uint32)accu == (uint32)*sp) { ++ if ((uint32_t)accu == (uint32_t)*sp) { + accu = 1; /* 2*0+1 */ + sp++; + } +- else{if ((uint32)accu < (uint32)(*sp++)) { ++ else{if ((uint32_t)accu < (uint32_t)(*sp++)) { + accu = 3; /* 2*1+1 */ + } + else{ +@@ -1280,9 +1281,9 @@ + + Instruct (HEAD0INT31) { + int r = 0; +- uint32 x; ++ uint32_t x; + print_instr("HEAD0INT31"); +- x = (uint32) accu; ++ x = (uint32_t) accu; + if (!(x & 0xFFFF0000)) { x <<= 16; r += 16; } + if (!(x & 0xFF000000)) { x <<= 8; r += 8; } + if (!(x & 0xF0000000)) { x <<= 4; r += 4; } +@@ -1295,9 +1296,9 @@ + + Instruct (TAIL0INT31) { + int r = 0; +- uint32 x; ++ uint32_t x; + print_instr("TAIL0INT31"); +- x = (((uint32) accu >> 1) | 0x80000000); ++ x = (((uint32_t) accu >> 1) | 0x80000000); + if (!(x & 0xFFFF)) { x >>= 16; r += 16; } + if (!(x & 0x00FF)) { x >>= 8; r += 8; } + if (!(x & 0x000F)) { x >>= 4; r += 4; } +@@ -1347,7 +1348,7 @@ + /*accu=accu or accu = (value)((unsigned long)1-accu) if bool + is used for the bits */ + for(i=0; i < 30; i++) { +- accu = (value) ((((uint32)accu-1) << 1) | *sp++); ++ accu = (value) ((((uint32_t)accu-1) << 1) | *sp++); + /* -1 removes the tag bit, << 1 multiplies the value by 2, + | *sp++ pops the last value and add it (no carry involved) + not that it reintroduces a tag bit */ +@@ -1367,7 +1368,7 @@ + for(i = 30; i >= 0; i--) { + Field(block, i) = (value)(accu & 3); /* two last bits of the accumulator */ + //Field(block, i) = 3; +- accu = (value) ((uint32)accu >> 1) | 1; /* last bit must be a one */ ++ accu = (value) ((uint32_t)accu >> 1) | 1; /* last bit must be a one */ + }; + accu = block; + Next; +diff -ru coq-8.4pl5/kernel/byterun/int64_native.h coq-8.4pl5_patched/kernel/byterun/int64_native.h +--- coq-8.4pl5/kernel/byterun/int64_native.h 2015-02-23 18:44:03.856246133 +0100 ++++ coq-8.4pl5_patched/kernel/byterun/int64_native.h 2015-02-23 17:22:34.320002821 +0100 +@@ -18,9 +18,9 @@ + #ifndef CAML_INT64_NATIVE_H + #define CAML_INT64_NATIVE_H + +-#define I64_literal(hi,lo) ((int64)(hi) << 32 | (lo)) ++#define I64_literal(hi,lo) ((int64_t)(hi) << 32 | (lo)) + #define I64_compare(x,y) (((x) > (y)) - ((x) < (y))) +-#define I64_ult(x,y) ((uint64)(x) < (uint64)(y)) ++#define I64_ult(x,y) ((uint64_t)(x) < (uint64_t)(y)) + #define I64_neg(x) (-(x)) + #define I64_add(x,y) ((x) + (y)) + #define I64_sub(x,y) ((x) - (y)) +@@ -30,19 +30,19 @@ + #define I64_div(x,y) ((x) / (y)) + #define I64_mod(x,y) ((x) % (y)) + #define I64_udivmod(x,y,quo,rem) \ +- (*(rem) = (uint64)(x) % (uint64)(y), \ +- *(quo) = (uint64)(x) / (uint64)(y)) ++ (*(rem) = (uint64_t)(x) % (uint64_t)(y), \ ++ *(quo) = (uint64_t)(x) / (uint64_t)(y)) + #define I64_and(x,y) ((x) & (y)) + #define I64_or(x,y) ((x) | (y)) + #define I64_xor(x,y) ((x) ^ (y)) + #define I64_lsl(x,y) ((x) << (y)) + #define I64_asr(x,y) ((x) >> (y)) +-#define I64_lsr(x,y) ((uint64)(x) >> (y)) ++#define I64_lsr(x,y) ((uint64_t)(x) >> (y)) + #define I64_to_intnat(x) ((intnat) (x)) + #define I64_of_intnat(x) ((intnat) (x)) +-#define I64_to_int32(x) ((int32) (x)) +-#define I64_of_int32(x) ((int64) (x)) ++#define I64_to_int32(x) ((int32_t) (x)) ++#define I64_of_int32(x) ((int64_t) (x)) + #define I64_to_double(x) ((double)(x)) +-#define I64_of_double(x) ((int64)(x)) ++#define I64_of_double(x) ((int64_t)(x)) + + #endif /* CAML_INT64_NATIVE_H */ +diff -ru coq-8.4pl5/plugins/subtac/subtac_obligations.ml coq-8.4pl5_patched/plugins/subtac/subtac_obligations.ml +--- coq-8.4pl5/plugins/subtac/subtac_obligations.ml 2015-02-23 18:44:04.868240689 +0100 ++++ coq-8.4pl5_patched/plugins/subtac/subtac_obligations.ml 2015-02-23 17:24:59.398722514 +0100 +@@ -683,12 +683,12 @@ + obls; + ignore(update_obls prg obls 0) + +-exception Found of int ++exception Found' of int + + let array_find f arr = +- try Array.iteri (fun i x -> if f x then raise (Found i)) arr; ++ try Array.iteri (fun i x -> if f x then raise (Found' i)) arr; + raise Not_found +- with Found i -> i ++ with Found' i -> i + + let next_obligation n tac = + let prg = get_prog_err n in diff --git a/patches/coq/configure.patch.8.3 b/patches/coq/configure.patch.8.3 new file mode 100644 index 0000000..28622cb --- /dev/null +++ b/patches/coq/configure.patch.8.3 @@ -0,0 +1,11 @@ +--- coq.8.3/configure 2014-04-14 22:28:39.174177924 +0200 ++++ coq.8.3/configure 2014-04-14 22:29:23.253025166 +0200 +@@ -335,7 +335,7 @@ + MAKEVERSION=`$MAKE -v | head -1 | cut -d" " -f3` + MAKEVERSIONMAJOR=`echo $MAKEVERSION | cut -d. -f1` + MAKEVERSIONMINOR=`echo $MAKEVERSION | cut -d. -f2` +- if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ]; then ++ if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ] || [ "$MAKEVERSIONMAJOR" -ge 4 ] ; then + echo "You have GNU Make $MAKEVERSION. Good!" + else + OK="no" diff --git a/patches/coq/configure.patch.8.4pl1 b/patches/coq/configure.patch.8.4pl1 new file mode 100644 index 0000000..ef8bf7d --- /dev/null +++ b/patches/coq/configure.patch.8.4pl1 @@ -0,0 +1,11 @@ +--- coq.8.4pl1/configure 2014-04-14 22:28:39.174177924 +0200 ++++ coq.8.4pl1/configure 2014-04-14 22:29:23.253025166 +0200 +@@ -335,7 +335,7 @@ + MAKEVERSION=`$MAKE -v | head -1 | cut -d" " -f3` + MAKEVERSIONMAJOR=`echo $MAKEVERSION | cut -d. -f1` + MAKEVERSIONMINOR=`echo $MAKEVERSION | cut -d. -f2` +- if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ]; then ++ if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ] || [ "$MAKEVERSIONMAJOR" -ge 4 ] ; then + echo "You have GNU Make $MAKEVERSION. Good!" + else + OK="no" diff --git a/patches/coq/configure.patch.8.4pl2 b/patches/coq/configure.patch.8.4pl2 new file mode 100644 index 0000000..f145eb1 --- /dev/null +++ b/patches/coq/configure.patch.8.4pl2 @@ -0,0 +1,11 @@ +--- coq.8.4pl2/configure 2014-04-14 22:28:39.174177924 +0200 ++++ coq.8.4pl2/configure 2014-04-14 22:29:23.253025166 +0200 +@@ -335,7 +335,7 @@ + MAKEVERSION=`$MAKE -v | head -1 | cut -d" " -f3` + MAKEVERSIONMAJOR=`echo $MAKEVERSION | cut -d. -f1` + MAKEVERSIONMINOR=`echo $MAKEVERSION | cut -d. -f2` +- if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ]; then ++ if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ] || [ "$MAKEVERSIONMAJOR" -ge 4 ] ; then + echo "You have GNU Make $MAKEVERSION. Good!" + else + OK="no" diff --git a/patches/coq/coq.install.8.10.0 b/patches/coq/coq.install.8.10.0 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.10.0 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.10.1 b/patches/coq/coq.install.8.10.1 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.10.1 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.10.2 b/patches/coq/coq.install.8.10.2 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.10.2 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.11.0 b/patches/coq/coq.install.8.11.0 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.11.0 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.11.1 b/patches/coq/coq.install.8.11.1 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.11.1 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.11.2 b/patches/coq/coq.install.8.11.2 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.11.2 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.12.0 b/patches/coq/coq.install.8.12.0 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.12.0 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.12.1 b/patches/coq/coq.install.8.12.1 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.12.1 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.12.2 b/patches/coq/coq.install.8.12.2 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.12.2 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.13.0 b/patches/coq/coq.install.8.13.0 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.13.0 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.13.1 b/patches/coq/coq.install.8.13.1 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.13.1 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.13.2 b/patches/coq/coq.install.8.13.2 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.13.2 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.3 b/patches/coq/coq.install.8.3 new file mode 100644 index 0000000..246164d --- /dev/null +++ b/patches/coq/coq.install.8.3 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop.opt" {"coqtop"} + "bin/coqmktop.opt" {"coqmktop"} + "?bin/coqide.opt" {"coqide"} + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk.opt" {"coqchk"} + "bin/coqc.opt" {"coqc"} + "bin/coq_makefile" + "bin/coq-tex" +] diff --git a/patches/coq/coq.install.8.4.5 b/patches/coq/coq.install.8.4.5 new file mode 100644 index 0000000..246164d --- /dev/null +++ b/patches/coq/coq.install.8.4.5 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop.opt" {"coqtop"} + "bin/coqmktop.opt" {"coqmktop"} + "?bin/coqide.opt" {"coqide"} + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk.opt" {"coqchk"} + "bin/coqc.opt" {"coqc"} + "bin/coq_makefile" + "bin/coq-tex" +] diff --git a/patches/coq/coq.install.8.4.6 b/patches/coq/coq.install.8.4.6 new file mode 100644 index 0000000..ad7b9da --- /dev/null +++ b/patches/coq/coq.install.8.4.6 @@ -0,0 +1,17 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop.opt" {"coqtop"} + "bin/coqmktop.opt" {"coqmktop"} + "?bin/coqide.opt" {"coqide"} + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk.opt" {"coqchk"} + "bin/coqc.opt" {"coqc"} + "bin/coq_makefile" + "bin/coq-tex" +] + +share: [ + "ide/coq.png" {"coq.png"} +] diff --git a/patches/coq/coq.install.8.4.6~camlp4 b/patches/coq/coq.install.8.4.6~camlp4 new file mode 100644 index 0000000..ad7b9da --- /dev/null +++ b/patches/coq/coq.install.8.4.6~camlp4 @@ -0,0 +1,17 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop.opt" {"coqtop"} + "bin/coqmktop.opt" {"coqmktop"} + "?bin/coqide.opt" {"coqide"} + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk.opt" {"coqchk"} + "bin/coqc.opt" {"coqc"} + "bin/coq_makefile" + "bin/coq-tex" +] + +share: [ + "ide/coq.png" {"coq.png"} +] diff --git a/patches/coq/coq.install.8.4pl1 b/patches/coq/coq.install.8.4pl1 new file mode 100644 index 0000000..246164d --- /dev/null +++ b/patches/coq/coq.install.8.4pl1 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop.opt" {"coqtop"} + "bin/coqmktop.opt" {"coqmktop"} + "?bin/coqide.opt" {"coqide"} + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk.opt" {"coqchk"} + "bin/coqc.opt" {"coqc"} + "bin/coq_makefile" + "bin/coq-tex" +] diff --git a/patches/coq/coq.install.8.4pl2 b/patches/coq/coq.install.8.4pl2 new file mode 100644 index 0000000..246164d --- /dev/null +++ b/patches/coq/coq.install.8.4pl2 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop.opt" {"coqtop"} + "bin/coqmktop.opt" {"coqmktop"} + "?bin/coqide.opt" {"coqide"} + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk.opt" {"coqchk"} + "bin/coqc.opt" {"coqc"} + "bin/coq_makefile" + "bin/coq-tex" +] diff --git a/patches/coq/coq.install.8.4pl4 b/patches/coq/coq.install.8.4pl4 new file mode 100644 index 0000000..246164d --- /dev/null +++ b/patches/coq/coq.install.8.4pl4 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop.opt" {"coqtop"} + "bin/coqmktop.opt" {"coqmktop"} + "?bin/coqide.opt" {"coqide"} + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk.opt" {"coqchk"} + "bin/coqc.opt" {"coqc"} + "bin/coq_makefile" + "bin/coq-tex" +] diff --git a/patches/coq/coq.install.8.5.0 b/patches/coq/coq.install.8.5.0 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.5.0 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.5.0~camlp4 b/patches/coq/coq.install.8.5.0~camlp4 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.5.0~camlp4 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.5.1 b/patches/coq/coq.install.8.5.1 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.5.1 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.5.2 b/patches/coq/coq.install.8.5.2 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.5.2 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.5.2~camlp4 b/patches/coq/coq.install.8.5.2~camlp4 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.5.2~camlp4 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.5.3 b/patches/coq/coq.install.8.5.3 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.5.3 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.6 b/patches/coq/coq.install.8.6 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.6 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.6.1 b/patches/coq/coq.install.8.6.1 new file mode 100644 index 0000000..36f8111 --- /dev/null +++ b/patches/coq/coq.install.8.6.1 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.7.0 b/patches/coq/coq.install.8.7.0 new file mode 100644 index 0000000..a2f75a9 --- /dev/null +++ b/patches/coq/coq.install.8.7.0 @@ -0,0 +1,14 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.7.1 b/patches/coq/coq.install.8.7.1 new file mode 100644 index 0000000..a2f75a9 --- /dev/null +++ b/patches/coq/coq.install.8.7.1 @@ -0,0 +1,14 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.7.1+1 b/patches/coq/coq.install.8.7.1+1 new file mode 100644 index 0000000..a2f75a9 --- /dev/null +++ b/patches/coq/coq.install.8.7.1+1 @@ -0,0 +1,14 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.7.1+2 b/patches/coq/coq.install.8.7.1+2 new file mode 100644 index 0000000..a2f75a9 --- /dev/null +++ b/patches/coq/coq.install.8.7.1+2 @@ -0,0 +1,14 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.7.2 b/patches/coq/coq.install.8.7.2 new file mode 100644 index 0000000..a2f75a9 --- /dev/null +++ b/patches/coq/coq.install.8.7.2 @@ -0,0 +1,14 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqmktop" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.8.0 b/patches/coq/coq.install.8.8.0 new file mode 100644 index 0000000..7dfdd21 --- /dev/null +++ b/patches/coq/coq.install.8.8.0 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.8.1 b/patches/coq/coq.install.8.8.1 new file mode 100644 index 0000000..7dfdd21 --- /dev/null +++ b/patches/coq/coq.install.8.8.1 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.8.2 b/patches/coq/coq.install.8.8.2 new file mode 100644 index 0000000..7dfdd21 --- /dev/null +++ b/patches/coq/coq.install.8.8.2 @@ -0,0 +1,13 @@ +bin: [ + "bin/gallina" + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.9.0 b/patches/coq/coq.install.8.9.0 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.9.0 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coq.install.8.9.1 b/patches/coq/coq.install.8.9.1 new file mode 100644 index 0000000..5642d88 --- /dev/null +++ b/patches/coq/coq.install.8.9.1 @@ -0,0 +1,12 @@ +bin: [ + "bin/coqwc" + "bin/coqtop" + "bin/coqtop.byte" + "bin/coqdoc" + "bin/coqdep" + "bin/coqchk" + "bin/coqc" + "bin/coq_makefile" + "bin/coq-tex" + "bin/coqworkmgr" +] diff --git a/patches/coq/coqmktop.patch b/patches/coq/coqmktop.patch new file mode 100644 index 0000000..e48dbf4 --- /dev/null +++ b/patches/coq/coqmktop.patch @@ -0,0 +1,12 @@ +--- coq.8.4pl1/scripts/coqmktop.ml 2012/12/04 13:40:45 16015 ++++ coq.8.4pl1/scripts/coqmktop.ml 2013/01/12 19:12:14 16122 +@@ -45,8 +45,7 @@ + [ "Camlp4Top.cmo"; + "Camlp4Parsers/Camlp4OCamlRevisedParser.cmo"; + "Camlp4Parsers/Camlp4OCamlParser.cmo"; +- "Camlp4Parsers/Camlp4GrammarParser.cmo"; +- "q_util.cmo"; "q_coqast.cmo" ] ++ "Camlp4Parsers/Camlp4GrammarParser.cmo" ] + let topobjs = camlp4topobjs + + let gramobjs = [] diff --git a/patches/coq/disable_warn_70.patch.8.13.0 b/patches/coq/disable_warn_70.patch.8.13.0 new file mode 100644 index 0000000..a404803 --- /dev/null +++ b/patches/coq/disable_warn_70.patch.8.13.0 @@ -0,0 +1,13 @@ +diff --git a/configure.ml b/configure.ml +index b04834edc6..0ae32dbd62 100644 +--- a/configure.ml ++++ b/configure.ml +@@ -634,7 +634,7 @@ let camltag = match caml_version_list with + 58: "no cmx file was found in path": See https://github.com/ocaml/num/issues/9 + 67: "unused functor parameter" seems totally bogus + *) +-let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67" ++let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67-70" + let coq_warn_error = + if !prefs.warn_error + then "-warn-error +a" diff --git a/patches/coq/disable_warn_70.patch.8.13.1 b/patches/coq/disable_warn_70.patch.8.13.1 new file mode 100644 index 0000000..22360e7 --- /dev/null +++ b/patches/coq/disable_warn_70.patch.8.13.1 @@ -0,0 +1,13 @@ +diff --git a/configure.ml b/configure.ml +index c14a069c49..40c75eb418 100644 +--- a/configure.ml ++++ b/configure.ml +@@ -634,7 +634,7 @@ let camltag = match caml_version_list with + 58: "no cmx file was found in path": See https://github.com/ocaml/num/issues/9 + 67: "unused functor parameter" seems totally bogus + *) +-let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67" ++let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67-70" + let coq_warn_error = + if !prefs.warn_error + then "-warn-error +a" diff --git a/patches/coq/disable_warn_70.patch.8.13.2 b/patches/coq/disable_warn_70.patch.8.13.2 new file mode 100644 index 0000000..ee8a9cb --- /dev/null +++ b/patches/coq/disable_warn_70.patch.8.13.2 @@ -0,0 +1,13 @@ +diff --git a/configure.ml b/configure.ml +index 26511e0f8f..3ae125f1b7 100644 +--- a/configure.ml ++++ b/configure.ml +@@ -634,7 +634,7 @@ let camltag = match caml_version_list with + 58: "no cmx file was found in path": See https://github.com/ocaml/num/issues/9 + 67: "unused functor parameter" seems totally bogus + *) +-let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67" ++let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67-70" + let coq_warn_error = + if !prefs.warn_error + then "-warn-error +a" diff --git a/patches/coq/disable_warn_70.patch.8.14.0 b/patches/coq/disable_warn_70.patch.8.14.0 new file mode 100644 index 0000000..eee3416 --- /dev/null +++ b/patches/coq/disable_warn_70.patch.8.14.0 @@ -0,0 +1,13 @@ +diff --git a/tools/configure/configure.ml b/tools/configure/configure.ml +index 6f4787269b..ff83872f5e 100644 +--- a/tools/configure/configure.ml ++++ b/tools/configure/configure.ml +@@ -616,7 +616,7 @@ let camltag = match caml_version_list with + 67: "unused functor parameter" seems totally bogus + 68: "This pattern depends on mutable state" no idea what it means, dune builds don't display it + *) +-let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67-68" ++let coq_warnings = "-w +a-4-9-27-41-42-44-45-48-58-67-68-70" + let coq_warn_error = + if !prefs.warn_error + then "-warn-error +a" diff --git a/patches/coq/dune-install-set-root.patch b/patches/coq/dune-install-set-root.patch new file mode 100644 index 0000000..5e97604 --- /dev/null +++ b/patches/coq/dune-install-set-root.patch @@ -0,0 +1,37 @@ +diff --git a/Makefile.common b/Makefile.common +index d3dadef1c5..e23f3a4dff 100644 +--- a/Makefile.common ++++ b/Makefile.common +@@ -35,7 +35,7 @@ _DBUILD_DEPS+=$(FLOCK) + + $(FLOCK): tools/flock/coq_flock.ml tools/flock/flock.c + $(SHOW)'DUNE $@' +- $(HIDE)dune build $@ ++ $(HIDE)dune build --root . $@ + else + FLOCK:=flock + endif +diff --git a/Makefile.install b/Makefile.install +index 18a3e39177..c8df10a3c6 100644 +--- a/Makefile.install ++++ b/Makefile.install +@@ -53,8 +53,8 @@ endif + # We ought to improve this, as of today the case of an opam-built dune + # installing to a global prefix such as /usr/local/ may not follow the FHS + install-dune: $(BCONTEXT)/coq-core.install $(BCONTEXT)/coqide-server.install +- dune install --display quiet $(DESTDIRARG) --mandir="$(MANDIR)" --prefix="$(COQPREFIX)" coq-core +- dune install --display quiet $(DESTDIRARG) --mandir="$(MANDIR)" --prefix="$(COQPREFIX)" coqide-server ++ dune install $(_DOPT) $(DESTDIRARG) --mandir="$(MANDIR)" --prefix="$(COQPREFIX)" coq-core ++ dune install $(_DOPT) $(DESTDIRARG) --mandir="$(MANDIR)" --prefix="$(COQPREFIX)" coqide-server + + install-coq: install-dune install-library + +@@ -87,7 +87,7 @@ ifeq ($(HASCOQIDE),no) + install-coqide: + else + install-coqide: $(BCONTEXT)/coqide.install +- dune install --display quiet $(DESTDIRARG) --mandir="$(MANDIR)" --prefix="$(COQPREFIX)" coqide ++ dune install $(_DOPT) $(DESTDIRARG) --mandir="$(MANDIR)" --prefix="$(COQPREFIX)" coqide + endif + + # For emacs: diff --git a/patches/coq/ephemeron-rename.patch b/patches/coq/ephemeron-rename.patch new file mode 100644 index 0000000..bf42ea2 --- /dev/null +++ b/patches/coq/ephemeron-rename.patch @@ -0,0 +1,726 @@ +commit 2bd33495267e1d5c7eae507c25d4d7a49b3b61f4 +Author: Maxime Dénès +Date: Fri Mar 4 17:40:10 2016 +0100 + + Rename Ephemeron -> CEphemeron. + + Fixes compilation of Coq with OCaml 4.03 beta 1. + +diff --git a/checker/check.mllib b/checker/check.mllib +index 0d36e3a..902ab9d 100644 +--- a/checker/check.mllib ++++ b/checker/check.mllib +@@ -32,7 +32,7 @@ CStack + Util + Ppstyle + Errors +-Ephemeron ++CEphemeron + Future + CUnix + System +diff --git a/dev/printers.mllib b/dev/printers.mllib +index ab7e9fc..ad9a5d7 100644 +--- a/dev/printers.mllib ++++ b/dev/printers.mllib +@@ -48,7 +48,7 @@ Rtree + Heap + Genarg + Stateid +-Ephemeron ++CEphemeron + Future + RemoteCounter + Monad +diff --git a/kernel/csymtable.ml b/kernel/csymtable.ml +index fc7e1b9..7e1a5d5 100644 +--- a/kernel/csymtable.ml ++++ b/kernel/csymtable.ml +@@ -131,8 +131,8 @@ let key rk = + match !rk with + | None -> raise NotEvaluated + | Some k -> +- try Ephemeron.get k +- with Ephemeron.InvalidKey -> raise NotEvaluated ++ try CEphemeron.get k ++ with CEphemeron.InvalidKey -> raise NotEvaluated + + (************************) + (* traduction des patch *) +@@ -171,7 +171,7 @@ let rec slot_for_getglobal env kn = + | BCconstant -> set_global (val_of_constant kn) + in + (*Pp.msgnl(str"value stored at: "++int pos);*) +- rk := Some (Ephemeron.create pos); ++ rk := Some (CEphemeron.create pos); + pos + + and slot_for_fv env fv = +diff --git a/kernel/entries.mli b/kernel/entries.mli +index b2a77dd..f94068f 100644 +--- a/kernel/entries.mli ++++ b/kernel/entries.mli +@@ -104,7 +104,7 @@ type side_eff = + | SEscheme of (inductive * constant * Declarations.constant_body * seff_env) list * string + + type side_effect = { +- from_env : Declarations.structure_body Ephemeron.key; ++ from_env : Declarations.structure_body CEphemeron.key; + eff : side_eff; + } + +diff --git a/kernel/pre_env.ml b/kernel/pre_env.ml +index e1fe025..df34955 100644 +--- a/kernel/pre_env.ml ++++ b/kernel/pre_env.ml +@@ -25,7 +25,7 @@ open Declarations + (* The key attached to each constant is used by the VM to retrieve previous *) + (* evaluations of the constant. It is essentially an index in the symbols table *) + (* used by the VM. *) +-type key = int Ephemeron.key option ref ++type key = int CEphemeron.key option ref + + (** Linking information for the native compiler. *) + +@@ -50,17 +50,17 @@ type stratification = { + } + + type val_kind = +- | VKvalue of (values * Id.Set.t) Ephemeron.key ++ | VKvalue of (values * Id.Set.t) CEphemeron.key + | VKnone + + type lazy_val = val_kind ref + + let force_lazy_val vk = match !vk with + | VKnone -> None +-| VKvalue v -> try Some (Ephemeron.get v) with Ephemeron.InvalidKey -> None ++| VKvalue v -> try Some (CEphemeron.get v) with CEphemeron.InvalidKey -> None + + let dummy_lazy_val () = ref VKnone +-let build_lazy_val vk key = vk := VKvalue (Ephemeron.create key) ++let build_lazy_val vk key = vk := VKvalue (CEphemeron.create key) + + type named_vals = (Id.t * lazy_val) list + +diff --git a/kernel/pre_env.mli b/kernel/pre_env.mli +index 23f9a3f..99d3e2e 100644 +--- a/kernel/pre_env.mli ++++ b/kernel/pre_env.mli +@@ -19,7 +19,7 @@ type link_info = + | LinkedInteractive of string + | NotLinked + +-type key = int Ephemeron.key option ref ++type key = int CEphemeron.key option ref + + type constant_key = constant_body * (link_info ref * key) + +diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml +index 4c32648..0926d35 100644 +--- a/kernel/safe_typing.ml ++++ b/kernel/safe_typing.ml +@@ -231,11 +231,11 @@ let constant_entry_of_private_constant = function + + let private_con_of_con env c = + let cbo = Environ.lookup_constant c env.env in +- { Entries.from_env = Ephemeron.create env.revstruct; ++ { Entries.from_env = CEphemeron.create env.revstruct; + Entries.eff = Entries.SEsubproof (c,cbo,get_opaque_body env.env cbo) } + + let private_con_of_scheme ~kind env cl = +- { Entries.from_env = Ephemeron.create env.revstruct; ++ { Entries.from_env = CEphemeron.create env.revstruct; + Entries.eff = Entries.SEscheme( + List.map (fun (i,c) -> + let cbo = Environ.lookup_constant c env.env in +diff --git a/kernel/term_typing.ml b/kernel/term_typing.ml +index 510f435..fdbd1e3 100644 +--- a/kernel/term_typing.ml ++++ b/kernel/term_typing.ml +@@ -126,14 +126,14 @@ let check_signatures curmb sl = + | None -> None, None + | Some curmb -> + try +- let mb = Ephemeron.get mb in ++ let mb = CEphemeron.get mb in + match sl with + | None -> sl, None + | Some n -> + if List.length mb >= how_many && CList.skipn how_many mb == curmb + then Some (n + how_many), Some mb + else None, None +- with Ephemeron.InvalidKey -> None, None in ++ with CEphemeron.InvalidKey -> None, None in + let sl, _ = List.fold_left is_direct_ancestor (Some 0,Some curmb) sl in + sl + +diff --git a/lib/cEphemeron.ml b/lib/cEphemeron.ml +new file mode 100644 +index 0000000..a38ea11 +--- /dev/null ++++ b/lib/cEphemeron.ml +@@ -0,0 +1,89 @@ ++(************************************************************************) ++(* v * The Coq Proof Assistant / The Coq Development Team *) ++(* boxed_key = ++ (* TODO: take a random value here. Is there a random function in OCaml? *) ++ let bid = ref 0 in ++ (* According to OCaml Gc module documentation, Pervasives.ref is one of the ++ few ways of getting a boxed value the compiler will never alias. *) ++ fun () -> incr bid; Pervasives.ref (Pervasives.ref !bid) ++ ++(* A phantom type to preserve type safety *) ++type 'a key = boxed_key ++ ++(* Comparing keys with == grants that if a key is unmarshalled (in the same ++ process where it was created or in another one) it is not mistaken for ++ an already existing one (unmarshal has no right to alias). If the initial ++ value of bid is taken at random, then one also avoids potential collisions *) ++module HT = Hashtbl.Make(struct ++ type t = key_type ref ++ let equal k1 k2 = k1 == k2 ++ let hash id = !id ++end) ++ ++(* A key is the (unique) value inside a boxed key, hence it does not ++ keep its corresponding boxed key reachable (replacing key_type by boxed_key ++ would make the key always reachable) *) ++let values : Obj.t HT.t = HT.create 1001 ++ ++(* To avoid a race contidion between the finalization function and ++ get/create on the values hashtable, the finalization function just ++ enqueues in an imperative list the item to be collected. Being the list ++ imperative, even if the Gc enqueue an item while run_collection is operating, ++ the tail of the list is eventually set to Empty on completion. ++ Kudos to the authors of Why3 that came up with this solution for their ++ implementation of weak hash tables! *) ++type imperative_list = cell ref ++and cell = Empty | Item of key_type ref * imperative_list ++ ++let collection_queue : imperative_list ref = ref (ref Empty) ++ ++let enqueue x = collection_queue := ref (Item (!x, !collection_queue)) ++ ++let run_collection () = ++ let rec aux l = match !l with ++ | Empty -> () ++ | Item (k, tl) -> HT.remove values k; aux tl in ++ let l = !collection_queue in ++ aux l; ++ l := Empty ++ ++(* The only reference to the boxed key is the one returned, when the user drops ++ it the value eventually disappears from the values table above *) ++let create (v : 'a) : 'a key = ++ run_collection (); ++ let k = mk_key () in ++ HT.add values !k (Obj.repr v); ++ Gc.finalise enqueue k; ++ k ++ ++(* Avoid raising Not_found *) ++exception InvalidKey ++let get (k : 'a key) : 'a = ++ run_collection (); ++ try Obj.obj (HT.find values !k) ++ with Not_found -> raise InvalidKey ++ ++(* Simple utils *) ++let default k v = ++ try get k ++ with InvalidKey -> v ++ ++let iter_opt k f = ++ match ++ try Some (get k) ++ with InvalidKey -> None ++ with ++ | None -> () ++ | Some v -> f v ++ ++let clear () = run_collection () +diff --git a/lib/cEphemeron.mli b/lib/cEphemeron.mli +new file mode 100644 +index 0000000..1200e4e +--- /dev/null ++++ b/lib/cEphemeron.mli +@@ -0,0 +1,52 @@ ++(************************************************************************) ++(* v * The Coq Proof Assistant / The Coq Development Team *) ++(* 'a key ++ ++(* May raise InvalidKey *) ++exception InvalidKey ++val get : 'a key -> 'a ++ ++(* These never fail. *) ++val iter_opt : 'a key -> ('a -> unit) -> unit ++val default : 'a key -> 'a -> 'a ++ ++val clear : unit -> unit +diff --git a/lib/ephemeron.ml b/lib/ephemeron.ml +deleted file mode 100644 +index a38ea11..0000000 +--- a/lib/ephemeron.ml ++++ /dev/null +@@ -1,89 +0,0 @@ +-(************************************************************************) +-(* v * The Coq Proof Assistant / The Coq Development Team *) +-(* boxed_key = +- (* TODO: take a random value here. Is there a random function in OCaml? *) +- let bid = ref 0 in +- (* According to OCaml Gc module documentation, Pervasives.ref is one of the +- few ways of getting a boxed value the compiler will never alias. *) +- fun () -> incr bid; Pervasives.ref (Pervasives.ref !bid) +- +-(* A phantom type to preserve type safety *) +-type 'a key = boxed_key +- +-(* Comparing keys with == grants that if a key is unmarshalled (in the same +- process where it was created or in another one) it is not mistaken for +- an already existing one (unmarshal has no right to alias). If the initial +- value of bid is taken at random, then one also avoids potential collisions *) +-module HT = Hashtbl.Make(struct +- type t = key_type ref +- let equal k1 k2 = k1 == k2 +- let hash id = !id +-end) +- +-(* A key is the (unique) value inside a boxed key, hence it does not +- keep its corresponding boxed key reachable (replacing key_type by boxed_key +- would make the key always reachable) *) +-let values : Obj.t HT.t = HT.create 1001 +- +-(* To avoid a race contidion between the finalization function and +- get/create on the values hashtable, the finalization function just +- enqueues in an imperative list the item to be collected. Being the list +- imperative, even if the Gc enqueue an item while run_collection is operating, +- the tail of the list is eventually set to Empty on completion. +- Kudos to the authors of Why3 that came up with this solution for their +- implementation of weak hash tables! *) +-type imperative_list = cell ref +-and cell = Empty | Item of key_type ref * imperative_list +- +-let collection_queue : imperative_list ref = ref (ref Empty) +- +-let enqueue x = collection_queue := ref (Item (!x, !collection_queue)) +- +-let run_collection () = +- let rec aux l = match !l with +- | Empty -> () +- | Item (k, tl) -> HT.remove values k; aux tl in +- let l = !collection_queue in +- aux l; +- l := Empty +- +-(* The only reference to the boxed key is the one returned, when the user drops +- it the value eventually disappears from the values table above *) +-let create (v : 'a) : 'a key = +- run_collection (); +- let k = mk_key () in +- HT.add values !k (Obj.repr v); +- Gc.finalise enqueue k; +- k +- +-(* Avoid raising Not_found *) +-exception InvalidKey +-let get (k : 'a key) : 'a = +- run_collection (); +- try Obj.obj (HT.find values !k) +- with Not_found -> raise InvalidKey +- +-(* Simple utils *) +-let default k v = +- try get k +- with InvalidKey -> v +- +-let iter_opt k f = +- match +- try Some (get k) +- with InvalidKey -> None +- with +- | None -> () +- | Some v -> f v +- +-let clear () = run_collection () +diff --git a/lib/ephemeron.mli b/lib/ephemeron.mli +deleted file mode 100644 +index 1200e4e..0000000 +--- a/lib/ephemeron.mli ++++ /dev/null +@@ -1,52 +0,0 @@ +-(************************************************************************) +-(* v * The Coq Proof Assistant / The Coq Development Team *) +-(* 'a key +- +-(* May raise InvalidKey *) +-exception InvalidKey +-val get : 'a key -> 'a +- +-(* These never fail. *) +-val iter_opt : 'a key -> ('a -> unit) -> unit +-val default : 'a key -> 'a -> 'a +- +-val clear : unit -> unit +diff --git a/lib/future.ml b/lib/future.ml +index 5cd2beb..e8f33db 100644 +--- a/lib/future.ml ++++ b/lib/future.ml +@@ -62,7 +62,7 @@ and 'a comp = + | Exn of Exninfo.iexn (* Invariant: this exception is always "fixed" as in fix_exn *) + + and 'a comput = +- | Ongoing of string * (UUID.t * fix_exn * 'a comp ref) Ephemeron.key ++ | Ongoing of string * (UUID.t * fix_exn * 'a comp ref) CEphemeron.key + | Finished of 'a + + and 'a computation = 'a comput ref +@@ -70,13 +70,13 @@ and 'a computation = 'a comput ref + let unnamed = "unnamed" + + let create ?(name=unnamed) ?(uuid=UUID.fresh ()) f x = +- ref (Ongoing (name, Ephemeron.create (uuid, f, Pervasives.ref x))) ++ ref (Ongoing (name, CEphemeron.create (uuid, f, Pervasives.ref x))) + let get x = + match !x with + | Finished v -> unnamed, UUID.invalid, id, ref (Val (v,None)) + | Ongoing (name, x) -> +- try let uuid, fix, c = Ephemeron.get x in name, uuid, fix, c +- with Ephemeron.InvalidKey -> ++ try let uuid, fix, c = CEphemeron.get x in name, uuid, fix, c ++ with CEphemeron.InvalidKey -> + name, UUID.invalid, id, ref (Exn (NotHere name, Exninfo.null)) + + type 'a value = [ `Val of 'a | `Exn of Exninfo.iexn ] +diff --git a/lib/lib.mllib b/lib/lib.mllib +index f3f6ad8..6805ce4 100644 +--- a/lib/lib.mllib ++++ b/lib/lib.mllib +@@ -15,6 +15,6 @@ Rtree + Heap + Unionfind + Genarg +-Ephemeron ++CEphemeron + Future + RemoteCounter +diff --git a/plugins/funind/functional_principles_types.ml b/plugins/funind/functional_principles_types.ml +index c47602b..1820030 100644 +--- a/plugins/funind/functional_principles_types.ml ++++ b/plugins/funind/functional_principles_types.ml +@@ -291,7 +291,7 @@ let build_functional_principle (evd:Evd.evar_map ref) interactive_proof old_prin + (* let dur1 = System.time_difference tim1 tim2 in *) + (* Pp.msgnl (str ("Time to compute proof: ") ++ str (string_of_float dur1)); *) + (* end; *) +- get_proof_clean true, Ephemeron.create hook ++ get_proof_clean true, CEphemeron.create hook + end + + +diff --git a/plugins/funind/indfun_common.ml b/plugins/funind/indfun_common.ml +index aa47e26..2449678 100644 +--- a/plugins/funind/indfun_common.ml ++++ b/plugins/funind/indfun_common.ml +@@ -163,7 +163,7 @@ let save with_clean id const (locality,_,kind) hook = + (locality, ConstRef kn) + in + if with_clean then Pfedit.delete_current_proof (); +- Ephemeron.iter_opt hook (fun f -> Lemmas.call_hook fix_exn f l r); ++ CEphemeron.iter_opt hook (fun f -> Lemmas.call_hook fix_exn f l r); + definition_message id + + +diff --git a/plugins/funind/indfun_common.mli b/plugins/funind/indfun_common.mli +index 23f1da1..e5c756f 100644 +--- a/plugins/funind/indfun_common.mli ++++ b/plugins/funind/indfun_common.mli +@@ -47,7 +47,7 @@ val jmeq : unit -> Term.constr + val jmeq_refl : unit -> Term.constr + + val save : bool -> Id.t -> Safe_typing.private_constants Entries.definition_entry -> Decl_kinds.goal_kind -> +- unit Lemmas.declaration_hook Ephemeron.key -> unit ++ unit Lemmas.declaration_hook CEphemeron.key -> unit + + (* [get_proof_clean do_reduce] : returns the proof name, definition, kind and hook and + abort the proof +diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml +index f22cdbc..541f299 100644 +--- a/proofs/proof_global.ml ++++ b/proofs/proof_global.ml +@@ -36,7 +36,7 @@ let find_proof_mode n = + Errors.error (Format.sprintf "No proof mode named \"%s\"." n) + + let register_proof_mode ({name = n} as m) = +- Hashtbl.add proof_modes n (Ephemeron.create m) ++ Hashtbl.add proof_modes n (CEphemeron.create m) + + (* initial mode: standard mode *) + let standard = { name = "No" ; set = (fun ()->()) ; reset = (fun () -> ()) } +@@ -52,7 +52,7 @@ let _ = + optname = "default proof mode" ; + optkey = ["Default";"Proof";"Mode"] ; + optread = begin fun () -> +- (Ephemeron.default !default_proof_mode standard).name ++ (CEphemeron.default !default_proof_mode standard).name + end; + optwrite = begin fun n -> + default_proof_mode := find_proof_mode n +@@ -83,12 +83,12 @@ type closed_proof = proof_object * proof_terminator + + type pstate = { + pid : Id.t; +- terminator : proof_terminator Ephemeron.key; ++ terminator : proof_terminator CEphemeron.key; + endline_tactic : Tacexpr.raw_tactic_expr option; + section_vars : Context.section_context option; + proof : Proof.proof; + strength : Decl_kinds.goal_kind; +- mode : proof_mode Ephemeron.key; ++ mode : proof_mode CEphemeron.key; + universe_binders: universe_binders option; + } + +@@ -103,11 +103,11 @@ let current_proof_mode = ref !default_proof_mode + let update_proof_mode () = + match !pstates with + | { mode = m } :: _ -> +- Ephemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); ++ CEphemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); + current_proof_mode := m; +- Ephemeron.iter_opt !current_proof_mode (fun x -> x.set ()) ++ CEphemeron.iter_opt !current_proof_mode (fun x -> x.set ()) + | _ -> +- Ephemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); ++ CEphemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); + current_proof_mode := find_proof_mode "No" + + (* combinators for the current_proof lists *) +@@ -215,9 +215,9 @@ let set_proof_mode mn = + set_proof_mode (find_proof_mode mn) (get_current_proof_name ()) + + let activate_proof_mode mode = +- Ephemeron.iter_opt (find_proof_mode mode) (fun x -> x.set ()) ++ CEphemeron.iter_opt (find_proof_mode mode) (fun x -> x.set ()) + let disactivate_proof_mode mode = +- Ephemeron.iter_opt (find_proof_mode mode) (fun x -> x.reset ()) ++ CEphemeron.iter_opt (find_proof_mode mode) (fun x -> x.reset ()) + + (** [start_proof sigma id str goals terminator] starts a proof of name + [id] with goals [goals] (a list of pairs of environment and +@@ -230,7 +230,7 @@ let disactivate_proof_mode mode = + let start_proof sigma id ?pl str goals terminator = + let initial_state = { + pid = id; +- terminator = Ephemeron.create terminator; ++ terminator = CEphemeron.create terminator; + proof = Proof.start sigma goals; + endline_tactic = None; + section_vars = None; +@@ -242,7 +242,7 @@ let start_proof sigma id ?pl str goals terminator = + let start_dependent_proof id ?pl str goals terminator = + let initial_state = { + pid = id; +- terminator = Ephemeron.create terminator; ++ terminator = CEphemeron.create terminator; + proof = Proof.dependent_start goals; + endline_tactic = None; + section_vars = None; +@@ -375,7 +375,7 @@ let close_proof ~keep_body_ucst_separate ?feedback_id ~now fpl = + in + { id = pid; entries = entries; persistence = strength; + universes = (universes, binders) }, +- fun pr_ending -> Ephemeron.get terminator pr_ending ++ fun pr_ending -> CEphemeron.get terminator pr_ending + + type closed_proof_output = (Term.constr * Safe_typing.private_constants) list * Evd.evar_universe_context + +@@ -423,11 +423,11 @@ let close_proof ~keep_body_ucst_separate fix_exn = + + (** Gets the current terminator without checking that the proof has + been completed. Useful for the likes of [Admitted]. *) +-let get_terminator () = Ephemeron.get ( cur_pstate() ).terminator ++let get_terminator () = CEphemeron.get ( cur_pstate() ).terminator + let set_terminator hook = + match !pstates with + | [] -> raise NoCurrentProof +- | p :: ps -> pstates := { p with terminator = Ephemeron.create hook } :: ps ++ | p :: ps -> pstates := { p with terminator = CEphemeron.create hook } :: ps + + + +diff --git a/stm/asyncTaskQueue.ml b/stm/asyncTaskQueue.ml +index cc97326..5f018ec 100644 +--- a/stm/asyncTaskQueue.ml ++++ b/stm/asyncTaskQueue.ml +@@ -314,7 +314,7 @@ module Make(T : Task) = struct + let response = slave_respond request in + report_status "Idle"; + marshal_response (Option.get !slave_oc) response; +- Ephemeron.clear () ++ CEphemeron.clear () + with + | MarshalError s -> + pr_err ("Fatal marshal error: " ^ s); flush_all (); exit 2 +diff --git a/toplevel/obligations.ml b/toplevel/obligations.ml +index 314789c..26aa7f9 100644 +--- a/toplevel/obligations.ml ++++ b/toplevel/obligations.ml +@@ -323,11 +323,11 @@ type program_info_aux = { + prg_sign: named_context_val; + } + +-type program_info = program_info_aux Ephemeron.key ++type program_info = program_info_aux CEphemeron.key + + let get_info x = +- try Ephemeron.get x +- with Ephemeron.InvalidKey -> ++ try CEphemeron.get x ++ with CEphemeron.InvalidKey -> + Errors.anomaly Pp.(str "Program obligation can't be accessed by a worker") + + let assumption_message = Declare.assumption_message +@@ -460,7 +460,7 @@ let subst_deps_obl obls obl = + + module ProgMap = Map.Make(Id) + +-let map_replace k v m = ProgMap.add k (Ephemeron.create v) (ProgMap.remove k m) ++let map_replace k v m = ProgMap.add k (CEphemeron.create v) (ProgMap.remove k m) + + let map_keys m = ProgMap.fold (fun k _ l -> k :: l) m [] + +@@ -674,7 +674,7 @@ let init_prog_info ?(opaque = false) sign n b t ctx deps fixkind notations obls + let map_cardinal m = + let i = ref 0 in + ProgMap.iter (fun _ v -> +- if snd (Ephemeron.get v).prg_obligations > 0 then incr i) m; ++ if snd (CEphemeron.get v).prg_obligations > 0 then incr i) m; + !i + + exception Found of program_info +@@ -682,7 +682,7 @@ exception Found of program_info + let map_first m = + try + ProgMap.iter (fun _ v -> +- if snd (Ephemeron.get v).prg_obligations > 0 then ++ if snd (CEphemeron.get v).prg_obligations > 0 then + raise (Found v)) m; + assert(false) + with Found x -> x +@@ -1008,7 +1008,7 @@ let add_definition n ?term t ctx ?(implicits=[]) ?(kind=Global,false,Definition) + else ( + let len = Array.length obls in + let _ = Flags.if_verbose msg_info (info ++ str ", generating " ++ int len ++ str " obligation(s)") in +- progmap_add n (Ephemeron.create prg); ++ progmap_add n (CEphemeron.create prg); + let res = auto_solve_obligations (Some n) tactic in + match res with + | Remain rem -> Flags.if_verbose (fun () -> show_obligations ~msg:false (Some n)) (); res +@@ -1022,7 +1022,7 @@ let add_mutual_definitions l ctx ?tactic ?(kind=Global,false,Definition) ?(reduc + (fun (n, b, t, imps, obls) -> + let prg = init_prog_info sign ~opaque n (Some b) t ctx deps (Some fixkind) + notations obls imps kind reduce hook +- in progmap_add n (Ephemeron.create prg)) l; ++ in progmap_add n (CEphemeron.create prg)) l; + let _defined = + List.fold_left (fun finished x -> + if finished then finished diff --git a/patches/coq/fix-meta-plugin.patch b/patches/coq/fix-meta-plugin.patch new file mode 100644 index 0000000..f85de5d --- /dev/null +++ b/patches/coq/fix-meta-plugin.patch @@ -0,0 +1,182 @@ +diff --git a/META.coq.in b/META.coq.in +index ef5de8da2b..9f4ee2cd81 100644 +--- a/META.coq.in ++++ b/META.coq.in +@@ -277,6 +277,8 @@ package "plugins" ( + archive(byte) = "ltac_plugin.cmo" + archive(native) = "ltac_plugin.cmx" + ++ plugin(byte) = "ltac_plugin.cmo" ++ plugin(native) = "ltac_plugin.cmxs" + ) + + package "tauto" ( +@@ -289,6 +291,9 @@ package "plugins" ( + + archive(byte) = "tauto_plugin.cmo" + archive(native) = "tauto_plugin.cmx" ++ ++ plugin(byte) = "tauto_plugin.cmo" ++ plugin(native) = "tauto_plugin.cmxs" + ) + + package "omega" ( +@@ -301,6 +306,9 @@ package "plugins" ( + + archive(byte) = "omega_plugin.cmo" + archive(native) = "omega_plugin.cmx" ++ ++ plugin(byte) = "omega_plugin.cmo" ++ plugin(native) = "omega_plugin.cmxs" + ) + + package "micromega" ( +@@ -313,6 +321,9 @@ package "plugins" ( + + archive(byte) = "micromega_plugin.cmo" + archive(native) = "micromega_plugin.cmx" ++ ++ plugin(byte) = "micromega_plugin.cmo" ++ plugin(native) = "micromega_plugin.cmxs" + ) + + package "setoid_ring" ( +@@ -325,6 +336,9 @@ package "plugins" ( + + archive(byte) = "newring_plugin.cmo" + archive(native) = "newring_plugin.cmx" ++ ++ plugin(byte) = "newring_plugin.cmo" ++ plugin(native) = "newring_plugin.cmxs" + ) + + package "extraction" ( +@@ -337,6 +351,9 @@ package "plugins" ( + + archive(byte) = "extraction_plugin.cmo" + archive(native) = "extraction_plugin.cmx" ++ ++ plugin(byte) = "extraction_plugin.cmo" ++ plugin(native) = "extraction_plugin.cmxs" + ) + + package "cc" ( +@@ -349,6 +366,9 @@ package "plugins" ( + + archive(byte) = "cc_plugin.cmo" + archive(native) = "cc_plugin.cmx" ++ ++ plugin(byte) = "cc_plugin.cmo" ++ plugin(native) = "cc_plugin.cmxs" + ) + + package "firstorder" ( +@@ -361,6 +381,9 @@ package "plugins" ( + + archive(byte) = "ground_plugin.cmo" + archive(native) = "ground_plugin.cmx" ++ ++ plugin(byte) = "ground_plugin.cmo" ++ plugin(native) = "ground_plugin.cmxs" + ) + + package "rtauto" ( +@@ -373,6 +396,9 @@ package "plugins" ( + + archive(byte) = "rtauto_plugin.cmo" + archive(native) = "rtauto_plugin.cmx" ++ ++ plugin(byte) = "rtauto_plugin.cmo" ++ plugin(native) = "rtauto_plugin.cmxs" + ) + + package "btauto" ( +@@ -385,6 +411,9 @@ package "plugins" ( + + archive(byte) = "btauto_plugin.cmo" + archive(native) = "btauto_plugin.cmx" ++ ++ plugin(byte) = "btauto_plugin.cmo" ++ plugin(native) = "btauto_plugin.cmxs" + ) + + package "funind" ( +@@ -397,6 +426,9 @@ package "plugins" ( + + archive(byte) = "recdef_plugin.cmo" + archive(native) = "recdef_plugin.cmx" ++ ++ plugin(byte) = "recdef_plugin.cmo" ++ plugin(native) = "recdef_plugin.cmxs" + ) + + package "nsatz" ( +@@ -409,6 +441,9 @@ package "plugins" ( + + archive(byte) = "nsatz_plugin.cmo" + archive(native) = "nsatz_plugin.cmx" ++ ++ plugin(byte) = "nsatz_plugin.cmo" ++ plugin(native) = "nsatz_plugin.cmxs" + ) + + package "rsyntax" ( +@@ -421,6 +456,9 @@ package "plugins" ( + + archive(byte) = "r_syntax_plugin.cmo" + archive(native) = "r_syntax_plugin.cmx" ++ ++ plugin(byte) = "r_syntax_plugin.cmo" ++ plugin(native) = "r_syntax_plugin.cmxs" + ) + + package "int63syntax" ( +@@ -433,6 +471,9 @@ package "plugins" ( + + archive(byte) = "int63_syntax_plugin.cmo" + archive(native) = "int63_syntax_plugin.cmx" ++ ++ plugin(byte) = "int63_syntax_plugin.cmo" ++ plugin(native) = "int63_syntax_plugin.cmxs" + ) + + package "string_notation" ( +@@ -445,6 +486,9 @@ package "plugins" ( + + archive(byte) = "string_notation_plugin.cmo" + archive(native) = "string_notation_plugin.cmx" ++ ++ plugin(byte) = "string_notation_plugin.cmo" ++ plugin(native) = "string_notation_plugin.cmxs" + ) + + package "derive" ( +@@ -457,6 +501,9 @@ package "plugins" ( + + archive(byte) = "derive_plugin.cmo" + archive(native) = "derive_plugin.cmx" ++ ++ plugin(byte) = "derive_plugin.cmo" ++ plugin(native) = "derive_plugin.cmxs" + ) + + package "ssrmatching" ( +@@ -469,6 +516,9 @@ package "plugins" ( + + archive(byte) = "ssrmatching_plugin.cmo" + archive(native) = "ssrmatching_plugin.cmx" ++ ++ plugin(byte) = "ssrmatching_plugin.cmo" ++ plugin(native) = "ssrmatching_plugin.cmxs" + ) + + package "ssreflect" ( +@@ -481,5 +531,8 @@ package "plugins" ( + + archive(byte) = "ssreflect_plugin.cmo" + archive(native) = "ssreflect_plugin.cmx" ++ ++ plugin(byte) = "ssreflect_plugin.cmo" ++ plugin(native) = "ssreflect_plugin.cmxs" + ) + ) diff --git a/patches/coq/fix-parallel-make.patch b/patches/coq/fix-parallel-make.patch new file mode 100644 index 0000000..5d7b487 --- /dev/null +++ b/patches/coq/fix-parallel-make.patch @@ -0,0 +1,72 @@ +commit d25990e2da7e5e84034b927cdab9ea4019c56a30 +Author: Enrico Tassi +Date: Fri Oct 11 13:43:20 2019 +0200 + + [make] separate generated gramlib ml files from mli files (fix #10864) + + (cherry picked from commit b0210638366d6584b709496b0f0eeeecb17c3fae) + +diff --git a/Makefile b/Makefile +index 2b5d2cea16..74b23f97aa 100644 +--- a/Makefile ++++ b/Makefile +@@ -101,15 +101,18 @@ EXISTINGMLI := $(call find, '*.mli') + + ## Files that will be generated + +-GENMLGFILES:= $(MLGFILES:.mlg=.ml) + # GRAMFILES must be in linking order + GRAMFILES=$(addprefix gramlib/.pack/gramlib__,Ploc Plexing Gramext Grammar) +-GRAMMLFILES := $(addsuffix .ml, $(GRAMFILES)) $(addsuffix .mli, $(GRAMFILES)) +-GENGRAMFILES := $(GRAMMLFILES) gramlib/.pack/gramlib.ml +-GENMLFILES:=$(LEXFILES:.mll=.ml) $(YACCFILES:.mly=.ml) $(GENMLGFILES) ide/coqide_os_specific.ml kernel/copcodes.ml kernel/uint63.ml ++GRAMMLFILES := $(addsuffix .ml, $(GRAMFILES)) ++GRAMMLIFILES := $(addsuffix .mli, $(GRAMFILES)) ++GENGRAMMLFILES := $(GRAMMLFILES) gramlib/.pack/gramlib.ml # why is gramlib.ml not in GRAMMLFILES? ++ ++GENMLGFILES:= $(MLGFILES:.mlg=.ml) ++GENMLFILES:=$(LEXFILES:.mll=.ml) $(YACCFILES:.mly=.ml) $(GENMLGFILES) $(GENGRAMMLFILES) ide/coqide_os_specific.ml kernel/copcodes.ml kernel/uint63.ml ++GENMLIFILES:=$(GRAMMLIFILES) + GENHFILES:=kernel/byterun/coq_instruct.h kernel/byterun/coq_jumptbl.h + GENFILES:=$(GENMLFILES) $(GENMLIFILES) $(GENHFILES) +-COQ_EXPORTED += GRAMFILES GRAMMLFILES GENGRAMFILES GENMLFILES GENHFILES GENFILES ++COQ_EXPORTED += GRAMFILES GRAMMLFILES GRAMMLIFILES GENMLFILES GENHFILES GENFILES + + ## More complex file lists + +diff --git a/Makefile.build b/Makefile.build +index 47f1b02c6e..4fbd4bfffd 100644 +--- a/Makefile.build ++++ b/Makefile.build +@@ -779,9 +779,9 @@ OCAMLDEP = $(OCAMLFIND) ocamldep -slash -ml-synonym .mlpack + MAINMLFILES := $(filter-out gramlib/.pack/% checker/% plugins/%, $(MLFILES) $(MLIFILES)) + MAINMLLIBFILES := $(filter-out gramlib/.pack/% checker/% plugins/%, $(MLLIBFILES) $(MLPACKFILES)) + +-$(MLDFILE).d: $(D_DEPEND_BEFORE_SRC) $(MAINMLFILES) $(D_DEPEND_AFTER_SRC) $(GENFILES) $(GENGRAMFILES) ++$(MLDFILE).d: $(D_DEPEND_BEFORE_SRC) $(MAINMLFILES) $(D_DEPEND_AFTER_SRC) $(GENFILES) + $(SHOW)'OCAMLDEP MLFILES MLIFILES' +- $(HIDE)$(OCAMLDEP) $(DEPFLAGS) -passrest $(MAINMLFILES) -open Gramlib $(GRAMMLFILES) $(TOTARGET) ++ $(HIDE)$(OCAMLDEP) $(DEPFLAGS) -passrest $(MAINMLFILES) -open Gramlib $(GRAMMLFILES) $(GRAMMLIFILES) $(TOTARGET) + #NB: -passrest is needed to avoid ocamlfind reordering the -open Gramlib + + $(MLLIBDFILE).d: $(D_DEPEND_BEFORE_SRC) $(MAINMLLIBFILES) $(D_DEPEND_AFTER_SRC) $(OCAMLLIBDEP) $(GENFILES) +diff --git a/Makefile.install b/Makefile.install +index 5b5e548f9c..51017b7c3a 100644 +--- a/Makefile.install ++++ b/Makefile.install +@@ -92,13 +92,13 @@ install-tools: + + INSTALLCMI = $(sort \ + $(filter-out checker/% ide/% tools/%, $(MLIFILES:.mli=.cmi)) \ +- $(filter %.cmi, $(GRAMMLFILES:.mli=.cmi)) gramlib/.pack/gramlib.cmi \ ++ $(GRAMMLIFILES:.mli=.cmi) gramlib/.pack/gramlib.cmi \ + $(foreach lib,$(CORECMA), $(addsuffix .cmi,$($(lib:.cma=_MLLIB_DEPENDENCIES))))) \ + $(PLUGINS:.cmo=.cmi) + + INSTALLCMX = $(sort $(filter-out checker/% ide/% tools/% dev/% \ + configure.cmx toplevel/coqtop_byte_bin.cmx plugins/extraction/big.cmx, \ +- $(filter %.cmx, $(GRAMMLFILES:.ml=.cmx)) $(MLFILES:.ml=.cmx))) ++ $(GRAMMLFILES:.ml=.cmx) $(MLFILES:.ml=.cmx))) + + install-devfiles: + $(MKDIR) $(FULLBINDIR) diff --git a/patches/coq/ld_stricter.patch b/patches/coq/ld_stricter.patch new file mode 100644 index 0000000..1b5244e --- /dev/null +++ b/patches/coq/ld_stricter.patch @@ -0,0 +1,14 @@ +diff --git a/kernel/nativelib.ml b/kernel/nativelib.ml +index 55a8e2433b..9992235c02 100644 +--- a/kernel/nativelib.ml ++++ b/kernel/nativelib.ml +@@ -59,7 +59,8 @@ let get_include_dirs () = + let coqcorelib = Envars.coqcorelib () in + [ coqcorelib / "kernel" ; coqcorelib / "kernel/.kernel.objs/byte/" + ; coqcorelib / "library"; coqcorelib / "library/.library.objs/byte/" +- ] ++ ] |> ++ List.filter Sys.file_exists + | _::_ as l -> l + in + if Lazy.is_val my_temp_dir diff --git a/patches/coq/ocaml408_compat.patch b/patches/coq/ocaml408_compat.patch new file mode 100644 index 0000000..9a3e555 --- /dev/null +++ b/patches/coq/ocaml408_compat.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.build b/Makefile.build +index ed29e21c82..02a92cd404 100644 +--- a/Makefile.build ++++ b/Makefile.build +@@ -262,7 +262,7 @@ endef + CAMLP5DEPS:=grammar/grammar.cma + CAMLP5USE=pa_extend.cmo q_MLast.cmo pa_macro.cmo -D$(CAMLVERSION) + +-PR_O := $(if $(READABLE_ML4),pr_o.cmo,pr_dump.cmo) ++PR_O := $(if $(READABLE_ML4),pr_o.cmo,) + + # Main packages linked by Coq. + SYSMOD:=-package num,str,unix,dynlink,threads diff --git a/patches/coqide/CAML_LD_LIBRARY_PATH.patch b/patches/coqide/CAML_LD_LIBRARY_PATH.patch new file mode 100644 index 0000000..66294ca --- /dev/null +++ b/patches/coqide/CAML_LD_LIBRARY_PATH.patch @@ -0,0 +1,11 @@ +--- coqide.8.4pl2/configure 2012-12-22 11:06:16.000000000 +0100 ++++ coqide.8.4pl2/configure 2013-01-18 16:30:02.110785838 +0100 +@@ -887,7 +887,7 @@ + */true/*/*) COQRUNBYTEFLAGS="-dllib -lcoqrun -dllpath '$COQTOP'/kernel/byterun";; + *) + COQRUNBYTEFLAGS="-dllib -lcoqrun -dllpath '$LIBDIR'" +- BUILDLDPATH="export CAML_LD_LIBRARY_PATH='$COQTOP'/kernel/byterun";; ++ BUILDLDPATH="export CAML_LD_LIBRARY_PATH='$COQTOP'/kernel/byterun:$CAML_LD_LIBRARY_PATH";; + esac + case $coqtoolsbyteflags_spec/$custom_spec/$CUSTOM_OS in + yes/*/*) COQTOOLSBYTEFLAGS="$coqtoolsbyteflags";; diff --git a/patches/coqide/CONFIGURE_allow_make4.patch b/patches/coqide/CONFIGURE_allow_make4.patch new file mode 100644 index 0000000..2f0b2c6 --- /dev/null +++ b/patches/coqide/CONFIGURE_allow_make4.patch @@ -0,0 +1,15 @@ +$NetBSD: patch-configure,v 1.1 2013/10/26 19:44:34 asau Exp $ + +Accept GNU Make 4 and later. + +--- coqide.8.4pl2/configure.orig 2013-10-26 19:28:30.000000000 +0000 ++++ coqide.8.4pl2/configure +@@ -335,7 +335,7 @@ if [ "$MAKE" != "" ]; then + MAKEVERSION=`$MAKE -v | head -1 | cut -d" " -f3` + MAKEVERSIONMAJOR=`echo $MAKEVERSION | cut -d. -f1` + MAKEVERSIONMINOR=`echo $MAKEVERSION | cut -d. -f2` +- if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ]; then ++ if [ "$MAKEVERSIONMAJOR" -gt 3 -o "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ]; then + echo "You have GNU Make $MAKEVERSION. Good!" + else + OK="no" diff --git a/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.5 b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.5 new file mode 100644 index 0000000..65520ad --- /dev/null +++ b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.5 @@ -0,0 +1,50 @@ +--- coqide.8.4.5/Makefile 2012-05-29 13:22:26.000000000 +0200 ++++ coqide.8.4.5/Makefile 2013-04-12 19:02:49.019720957 +0200 +@@ -96,7 +96,7 @@ + $(strip $(foreach f, $(1), $(if $(filter $(f),$(2)),,$f))) + endef + +-export MLEXTRAFILES := $(GENMLFILES) $(GENML4FILES) $(GENPLUGINSMOD) ++export MLEXTRAFILES := $(GENMLFILES) + export MLSTATICFILES := $(call diff, $(EXISTINGML), $(MLEXTRAFILES)) + export MLIFILES := $(sort $(GENMLIFILES) $(EXISTINGMLI)) + +--- coqide.8.4.5/Makefile.build 2012-10-29 15:46:37.000000000 +0100 ++++ coqide.8.4.5/Makefile.build 2013-04-12 18:59:45.199717036 +0200 +@@ -39,7 +39,8 @@ + MLFILES:=$(MLSTATICFILES) $(MLEXTRAFILES) + + ALLDEPS:=$(addsuffix .d, \ +- $(ML4FILES) $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES) $(VFILES)) ++ $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES)) ++ + + .SECONDARY: $(ALLDEPS) $(GENFILES) $(ML4FILES:.ml4=.ml) + +@@ -327,13 +328,13 @@ + coqide-opt: $(COQIDEBYTE) $(COQIDEOPT) $(COQIDE) + coqide-files: $(IDEFILES) + +-$(COQIDEOPT): $(LINKIDEOPT) | $(COQTOPOPT) ++$(COQIDEOPT): $(LINKIDEOPT) | $(LIBCOQRUN) + $(SHOW)'OCAMLOPT -o $@' + $(HIDE)$(OCAMLOPT) $(COQIDEFLAGS) $(OPTFLAGS) -o $@ unix.cmxa threads.cmxa \ + lablgtk.cmxa $(IDEOPTFLAGS) gtkThread.cmx str.cmxa $(LINKIDEOPT) + $(STRIP) $@ + +-$(COQIDEBYTE): $(LINKIDE) | $(COQTOPBYTE) ++$(COQIDEBYTE): $(LINKIDE) | $(LIBCOQRUN) + $(SHOW)'OCAMLC -o $@' + $(HIDE)$(OCAMLC) $(COQIDEFLAGS) $(BYTEFLAGS) -o $@ unix.cma threads.cma lablgtk.cma gtkThread.cmo\ + str.cma $(COQRUNBYTEFLAGS) $(LINKIDE) +--- coqide.8.4.5/Makefile.common 2012-10-29 15:46:40.000000000 +0100 ++++ coqide.8.4.5/Makefile.common 2013-04-12 19:00:55.099718527 +0200 +@@ -269,7 +269,7 @@ + + ## we now retrieve the names of .vo file to compile in */vo.itarget files + +-cat_vo_itarget = $(addprefix $(1)/,$(shell cat $(1)/vo.itarget)) ++cat_vo_itarget = + + ## Theories + diff --git a/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.6 b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.6 new file mode 100644 index 0000000..f37b0be --- /dev/null +++ b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4.6 @@ -0,0 +1,50 @@ +--- coqide.8.4.6/Makefile 2012-05-29 13:22:26.000000000 +0200 ++++ coqide.8.4.6/Makefile 2013-04-12 19:02:49.019720957 +0200 +@@ -96,7 +96,7 @@ + $(strip $(foreach f, $(1), $(if $(filter $(f),$(2)),,$f))) + endef + +-export MLEXTRAFILES := $(GENMLFILES) $(GENML4FILES) $(GENPLUGINSMOD) ++export MLEXTRAFILES := $(GENMLFILES) + export MLSTATICFILES := $(call diff, $(EXISTINGML), $(MLEXTRAFILES)) + export MLIFILES := $(sort $(GENMLIFILES) $(EXISTINGMLI)) + +--- coqide.8.4.6/Makefile.build 2012-10-29 15:46:37.000000000 +0100 ++++ coqide.8.4.6/Makefile.build 2013-04-12 18:59:45.199717036 +0200 +@@ -39,7 +39,8 @@ + MLFILES:=$(MLSTATICFILES) $(MLEXTRAFILES) + + ALLDEPS:=$(addsuffix .d, \ +- $(ML4FILES) $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES) $(VFILES)) ++ $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES)) ++ + + .SECONDARY: $(ALLDEPS) $(GENFILES) $(ML4FILES:.ml4=.ml) + +@@ -327,13 +328,13 @@ + coqide-opt: $(COQIDEBYTE) $(COQIDEOPT) $(COQIDE) + coqide-files: $(IDEFILES) + +-$(COQIDEOPT): $(LINKIDEOPT) | $(COQTOPOPT) ++$(COQIDEOPT): $(LINKIDEOPT) | $(LIBCOQRUN) + $(SHOW)'OCAMLOPT -o $@' + $(HIDE)$(OCAMLOPT) $(COQIDEFLAGS) $(OPTFLAGS) -o $@ unix.cmxa threads.cmxa \ + lablgtk.cmxa $(IDEOPTFLAGS) gtkThread.cmx str.cmxa $(LINKIDEOPT) + $(STRIP) $@ + +-$(COQIDEBYTE): $(LINKIDE) | $(COQTOPBYTE) ++$(COQIDEBYTE): $(LINKIDE) | $(LIBCOQRUN) + $(SHOW)'OCAMLC -o $@' + $(HIDE)$(OCAMLC) $(COQIDEFLAGS) $(BYTEFLAGS) -o $@ unix.cma threads.cma lablgtk.cma gtkThread.cmo\ + str.cma $(COQRUNBYTEFLAGS) $(LINKIDE) +--- coqide.8.4.6/Makefile.common 2012-10-29 15:46:40.000000000 +0100 ++++ coqide.8.4.6/Makefile.common 2013-04-12 19:00:55.099718527 +0200 +@@ -269,7 +269,7 @@ + + ## we now retrieve the names of .vo file to compile in */vo.itarget files + +-cat_vo_itarget = $(addprefix $(1)/,$(shell cat $(1)/vo.itarget)) ++cat_vo_itarget = + + ## Theories + diff --git a/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl2 b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl2 new file mode 100644 index 0000000..ed726f6 --- /dev/null +++ b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl2 @@ -0,0 +1,50 @@ +--- coqide.8.4pl2/Makefile 2012-05-29 13:22:26.000000000 +0200 ++++ coqide.8.4pl2/Makefile 2013-04-12 19:02:49.019720957 +0200 +@@ -96,7 +96,7 @@ + $(strip $(foreach f, $(1), $(if $(filter $(f),$(2)),,$f))) + endef + +-export MLEXTRAFILES := $(GENMLFILES) $(GENML4FILES) $(GENPLUGINSMOD) ++export MLEXTRAFILES := $(GENMLFILES) + export MLSTATICFILES := $(call diff, $(EXISTINGML), $(MLEXTRAFILES)) + export MLIFILES := $(sort $(GENMLIFILES) $(EXISTINGMLI)) + +--- coqide.8.4pl2/Makefile.build 2012-10-29 15:46:37.000000000 +0100 ++++ coqide.8.4pl2/Makefile.build 2013-04-12 18:59:45.199717036 +0200 +@@ -39,7 +39,8 @@ + MLFILES:=$(MLSTATICFILES) $(MLEXTRAFILES) + + ALLDEPS:=$(addsuffix .d, \ +- $(ML4FILES) $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES) $(VFILES)) ++ $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES)) ++ + + .SECONDARY: $(ALLDEPS) $(GENFILES) $(ML4FILES:.ml4=.ml) + +@@ -327,13 +328,13 @@ + coqide-opt: $(COQIDEBYTE) $(COQIDEOPT) $(COQIDE) + coqide-files: $(IDEFILES) + +-$(COQIDEOPT): $(LINKIDEOPT) | $(COQTOPOPT) ++$(COQIDEOPT): $(LINKIDEOPT) | $(LIBCOQRUN) + $(SHOW)'OCAMLOPT -o $@' + $(HIDE)$(OCAMLOPT) $(COQIDEFLAGS) $(OPTFLAGS) -o $@ unix.cmxa threads.cmxa \ + lablgtk.cmxa $(IDEOPTFLAGS) gtkThread.cmx str.cmxa $(LINKIDEOPT) + $(STRIP) $@ + +-$(COQIDEBYTE): $(LINKIDE) | $(COQTOPBYTE) ++$(COQIDEBYTE): $(LINKIDE) | $(LIBCOQRUN) + $(SHOW)'OCAMLC -o $@' + $(HIDE)$(OCAMLC) $(COQIDEFLAGS) $(BYTEFLAGS) -o $@ unix.cma threads.cma lablgtk.cma gtkThread.cmo\ + str.cma $(COQRUNBYTEFLAGS) $(LINKIDE) +--- coqide.8.4pl2/Makefile.common 2012-10-29 15:46:40.000000000 +0100 ++++ coqide.8.4pl2/Makefile.common 2013-04-12 19:00:55.099718527 +0200 +@@ -269,7 +269,7 @@ + + ## we now retrieve the names of .vo file to compile in */vo.itarget files + +-cat_vo_itarget = $(addprefix $(1)/,$(shell cat $(1)/vo.itarget)) ++cat_vo_itarget = + + ## Theories + diff --git a/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl4 b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl4 new file mode 100644 index 0000000..eace1c6 --- /dev/null +++ b/patches/coqide/MAKEFILE_remove_useless_for_coqide.patch.8.4pl4 @@ -0,0 +1,50 @@ +--- coqide.8.4pl4/Makefile 2012-05-29 13:22:26.000000000 +0200 ++++ coqide.8.4pl4/Makefile 2013-04-12 19:02:49.019720957 +0200 +@@ -96,7 +96,7 @@ + $(strip $(foreach f, $(1), $(if $(filter $(f),$(2)),,$f))) + endef + +-export MLEXTRAFILES := $(GENMLFILES) $(GENML4FILES) $(GENPLUGINSMOD) ++export MLEXTRAFILES := $(GENMLFILES) + export MLSTATICFILES := $(call diff, $(EXISTINGML), $(MLEXTRAFILES)) + export MLIFILES := $(sort $(GENMLIFILES) $(EXISTINGMLI)) + +--- coqide.8.4pl4/Makefile.build 2012-10-29 15:46:37.000000000 +0100 ++++ coqide.8.4pl4/Makefile.build 2013-04-12 18:59:45.199717036 +0200 +@@ -39,7 +39,8 @@ + MLFILES:=$(MLSTATICFILES) $(MLEXTRAFILES) + + ALLDEPS:=$(addsuffix .d, \ +- $(ML4FILES) $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES) $(VFILES)) ++ $(MLFILES) $(MLIFILES) $(CFILES) $(MLLIBFILES)) ++ + + .SECONDARY: $(ALLDEPS) $(GENFILES) $(ML4FILES:.ml4=.ml) + +@@ -327,13 +328,13 @@ + coqide-opt: $(COQIDEBYTE) $(COQIDEOPT) $(COQIDE) + coqide-files: $(IDEFILES) + +-$(COQIDEOPT): $(LINKIDEOPT) | $(COQTOPOPT) ++$(COQIDEOPT): $(LINKIDEOPT) | $(LIBCOQRUN) + $(SHOW)'OCAMLOPT -o $@' + $(HIDE)$(OCAMLOPT) $(COQIDEFLAGS) $(OPTFLAGS) -o $@ unix.cmxa threads.cmxa \ + lablgtk.cmxa $(IDEOPTFLAGS) gtkThread.cmx str.cmxa $(LINKIDEOPT) + $(STRIP) $@ + +-$(COQIDEBYTE): $(LINKIDE) | $(COQTOPBYTE) ++$(COQIDEBYTE): $(LINKIDE) | $(LIBCOQRUN) + $(SHOW)'OCAMLC -o $@' + $(HIDE)$(OCAMLC) $(COQIDEFLAGS) $(BYTEFLAGS) -o $@ unix.cma threads.cma lablgtk.cma gtkThread.cmo\ + str.cma $(COQRUNBYTEFLAGS) $(LINKIDE) +--- coqide.8.4pl4/Makefile.common 2012-10-29 15:46:40.000000000 +0100 ++++ coqide.8.4pl4/Makefile.common 2013-04-12 19:00:55.099718527 +0200 +@@ -269,7 +269,7 @@ + + ## we now retrieve the names of .vo file to compile in */vo.itarget files + +-cat_vo_itarget = $(addprefix $(1)/,$(shell cat $(1)/vo.itarget)) ++cat_vo_itarget = + + ## Theories + diff --git a/patches/coqide/coq-coqide.install b/patches/coqide/coq-coqide.install new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coq-coqide.install @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.10.0 b/patches/coqide/coqide.install.8.10.0 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.10.0 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.10.1 b/patches/coqide/coqide.install.8.10.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.10.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.10.2 b/patches/coqide/coqide.install.8.10.2 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.10.2 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.11.0 b/patches/coqide/coqide.install.8.11.0 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.11.0 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.11.1 b/patches/coqide/coqide.install.8.11.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.11.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.11.2 b/patches/coqide/coqide.install.8.11.2 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.11.2 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.12.0 b/patches/coqide/coqide.install.8.12.0 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.12.0 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.12.1 b/patches/coqide/coqide.install.8.12.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.12.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.12.2 b/patches/coqide/coqide.install.8.12.2 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.12.2 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.13.0 b/patches/coqide/coqide.install.8.13.0 new file mode 100644 index 0000000..3180fdf --- /dev/null +++ b/patches/coqide/coqide.install.8.13.0 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coqide/coq.lang" {"coq/coq.lang"} + "ide/coqide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coqide/coq.png" {"coq/coq.png"} + "ide/coqide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.13.1 b/patches/coqide/coqide.install.8.13.1 new file mode 100644 index 0000000..3180fdf --- /dev/null +++ b/patches/coqide/coqide.install.8.13.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coqide/coq.lang" {"coq/coq.lang"} + "ide/coqide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coqide/coq.png" {"coq/coq.png"} + "ide/coqide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.13.2 b/patches/coqide/coqide.install.8.13.2 new file mode 100644 index 0000000..3180fdf --- /dev/null +++ b/patches/coqide/coqide.install.8.13.2 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coqide/coq.lang" {"coq/coq.lang"} + "ide/coqide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coqide/coq.png" {"coq/coq.png"} + "ide/coqide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.5.1 b/patches/coqide/coqide.install.8.5.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.5.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.5.2 b/patches/coqide/coqide.install.8.5.2 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.5.2 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.5.3 b/patches/coqide/coqide.install.8.5.3 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.5.3 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.6 b/patches/coqide/coqide.install.8.6 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.6 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.6.1 b/patches/coqide/coqide.install.8.6.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.6.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.7.0 b/patches/coqide/coqide.install.8.7.0 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.7.0 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.7.1 b/patches/coqide/coqide.install.8.7.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.7.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.7.2 b/patches/coqide/coqide.install.8.7.2 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.7.2 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.8.0 b/patches/coqide/coqide.install.8.8.0 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.8.0 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.8.1 b/patches/coqide/coqide.install.8.8.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.8.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.8.2 b/patches/coqide/coqide.install.8.8.2 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.8.2 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.9.0 b/patches/coqide/coqide.install.8.9.0 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.9.0 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/coqide.install.8.9.1 b/patches/coqide/coqide.install.8.9.1 new file mode 100644 index 0000000..5c89b14 --- /dev/null +++ b/patches/coqide/coqide.install.8.9.1 @@ -0,0 +1,9 @@ +bin: [ + "bin/coqide" +] +share_root: [ + "ide/coq.lang" {"coq/coq.lang"} + "ide/coq-ssreflect.lang" {"coq/coq-ssreflect.lang"} + "ide/coq.png" {"coq/coq.png"} + "ide/coq_style.xml" {"coq/coq_style.xml"} +] diff --git a/patches/coqide/ephemeron-rename.patch b/patches/coqide/ephemeron-rename.patch new file mode 100644 index 0000000..bf42ea2 --- /dev/null +++ b/patches/coqide/ephemeron-rename.patch @@ -0,0 +1,726 @@ +commit 2bd33495267e1d5c7eae507c25d4d7a49b3b61f4 +Author: Maxime Dénès +Date: Fri Mar 4 17:40:10 2016 +0100 + + Rename Ephemeron -> CEphemeron. + + Fixes compilation of Coq with OCaml 4.03 beta 1. + +diff --git a/checker/check.mllib b/checker/check.mllib +index 0d36e3a..902ab9d 100644 +--- a/checker/check.mllib ++++ b/checker/check.mllib +@@ -32,7 +32,7 @@ CStack + Util + Ppstyle + Errors +-Ephemeron ++CEphemeron + Future + CUnix + System +diff --git a/dev/printers.mllib b/dev/printers.mllib +index ab7e9fc..ad9a5d7 100644 +--- a/dev/printers.mllib ++++ b/dev/printers.mllib +@@ -48,7 +48,7 @@ Rtree + Heap + Genarg + Stateid +-Ephemeron ++CEphemeron + Future + RemoteCounter + Monad +diff --git a/kernel/csymtable.ml b/kernel/csymtable.ml +index fc7e1b9..7e1a5d5 100644 +--- a/kernel/csymtable.ml ++++ b/kernel/csymtable.ml +@@ -131,8 +131,8 @@ let key rk = + match !rk with + | None -> raise NotEvaluated + | Some k -> +- try Ephemeron.get k +- with Ephemeron.InvalidKey -> raise NotEvaluated ++ try CEphemeron.get k ++ with CEphemeron.InvalidKey -> raise NotEvaluated + + (************************) + (* traduction des patch *) +@@ -171,7 +171,7 @@ let rec slot_for_getglobal env kn = + | BCconstant -> set_global (val_of_constant kn) + in + (*Pp.msgnl(str"value stored at: "++int pos);*) +- rk := Some (Ephemeron.create pos); ++ rk := Some (CEphemeron.create pos); + pos + + and slot_for_fv env fv = +diff --git a/kernel/entries.mli b/kernel/entries.mli +index b2a77dd..f94068f 100644 +--- a/kernel/entries.mli ++++ b/kernel/entries.mli +@@ -104,7 +104,7 @@ type side_eff = + | SEscheme of (inductive * constant * Declarations.constant_body * seff_env) list * string + + type side_effect = { +- from_env : Declarations.structure_body Ephemeron.key; ++ from_env : Declarations.structure_body CEphemeron.key; + eff : side_eff; + } + +diff --git a/kernel/pre_env.ml b/kernel/pre_env.ml +index e1fe025..df34955 100644 +--- a/kernel/pre_env.ml ++++ b/kernel/pre_env.ml +@@ -25,7 +25,7 @@ open Declarations + (* The key attached to each constant is used by the VM to retrieve previous *) + (* evaluations of the constant. It is essentially an index in the symbols table *) + (* used by the VM. *) +-type key = int Ephemeron.key option ref ++type key = int CEphemeron.key option ref + + (** Linking information for the native compiler. *) + +@@ -50,17 +50,17 @@ type stratification = { + } + + type val_kind = +- | VKvalue of (values * Id.Set.t) Ephemeron.key ++ | VKvalue of (values * Id.Set.t) CEphemeron.key + | VKnone + + type lazy_val = val_kind ref + + let force_lazy_val vk = match !vk with + | VKnone -> None +-| VKvalue v -> try Some (Ephemeron.get v) with Ephemeron.InvalidKey -> None ++| VKvalue v -> try Some (CEphemeron.get v) with CEphemeron.InvalidKey -> None + + let dummy_lazy_val () = ref VKnone +-let build_lazy_val vk key = vk := VKvalue (Ephemeron.create key) ++let build_lazy_val vk key = vk := VKvalue (CEphemeron.create key) + + type named_vals = (Id.t * lazy_val) list + +diff --git a/kernel/pre_env.mli b/kernel/pre_env.mli +index 23f9a3f..99d3e2e 100644 +--- a/kernel/pre_env.mli ++++ b/kernel/pre_env.mli +@@ -19,7 +19,7 @@ type link_info = + | LinkedInteractive of string + | NotLinked + +-type key = int Ephemeron.key option ref ++type key = int CEphemeron.key option ref + + type constant_key = constant_body * (link_info ref * key) + +diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml +index 4c32648..0926d35 100644 +--- a/kernel/safe_typing.ml ++++ b/kernel/safe_typing.ml +@@ -231,11 +231,11 @@ let constant_entry_of_private_constant = function + + let private_con_of_con env c = + let cbo = Environ.lookup_constant c env.env in +- { Entries.from_env = Ephemeron.create env.revstruct; ++ { Entries.from_env = CEphemeron.create env.revstruct; + Entries.eff = Entries.SEsubproof (c,cbo,get_opaque_body env.env cbo) } + + let private_con_of_scheme ~kind env cl = +- { Entries.from_env = Ephemeron.create env.revstruct; ++ { Entries.from_env = CEphemeron.create env.revstruct; + Entries.eff = Entries.SEscheme( + List.map (fun (i,c) -> + let cbo = Environ.lookup_constant c env.env in +diff --git a/kernel/term_typing.ml b/kernel/term_typing.ml +index 510f435..fdbd1e3 100644 +--- a/kernel/term_typing.ml ++++ b/kernel/term_typing.ml +@@ -126,14 +126,14 @@ let check_signatures curmb sl = + | None -> None, None + | Some curmb -> + try +- let mb = Ephemeron.get mb in ++ let mb = CEphemeron.get mb in + match sl with + | None -> sl, None + | Some n -> + if List.length mb >= how_many && CList.skipn how_many mb == curmb + then Some (n + how_many), Some mb + else None, None +- with Ephemeron.InvalidKey -> None, None in ++ with CEphemeron.InvalidKey -> None, None in + let sl, _ = List.fold_left is_direct_ancestor (Some 0,Some curmb) sl in + sl + +diff --git a/lib/cEphemeron.ml b/lib/cEphemeron.ml +new file mode 100644 +index 0000000..a38ea11 +--- /dev/null ++++ b/lib/cEphemeron.ml +@@ -0,0 +1,89 @@ ++(************************************************************************) ++(* v * The Coq Proof Assistant / The Coq Development Team *) ++(* boxed_key = ++ (* TODO: take a random value here. Is there a random function in OCaml? *) ++ let bid = ref 0 in ++ (* According to OCaml Gc module documentation, Pervasives.ref is one of the ++ few ways of getting a boxed value the compiler will never alias. *) ++ fun () -> incr bid; Pervasives.ref (Pervasives.ref !bid) ++ ++(* A phantom type to preserve type safety *) ++type 'a key = boxed_key ++ ++(* Comparing keys with == grants that if a key is unmarshalled (in the same ++ process where it was created or in another one) it is not mistaken for ++ an already existing one (unmarshal has no right to alias). If the initial ++ value of bid is taken at random, then one also avoids potential collisions *) ++module HT = Hashtbl.Make(struct ++ type t = key_type ref ++ let equal k1 k2 = k1 == k2 ++ let hash id = !id ++end) ++ ++(* A key is the (unique) value inside a boxed key, hence it does not ++ keep its corresponding boxed key reachable (replacing key_type by boxed_key ++ would make the key always reachable) *) ++let values : Obj.t HT.t = HT.create 1001 ++ ++(* To avoid a race contidion between the finalization function and ++ get/create on the values hashtable, the finalization function just ++ enqueues in an imperative list the item to be collected. Being the list ++ imperative, even if the Gc enqueue an item while run_collection is operating, ++ the tail of the list is eventually set to Empty on completion. ++ Kudos to the authors of Why3 that came up with this solution for their ++ implementation of weak hash tables! *) ++type imperative_list = cell ref ++and cell = Empty | Item of key_type ref * imperative_list ++ ++let collection_queue : imperative_list ref = ref (ref Empty) ++ ++let enqueue x = collection_queue := ref (Item (!x, !collection_queue)) ++ ++let run_collection () = ++ let rec aux l = match !l with ++ | Empty -> () ++ | Item (k, tl) -> HT.remove values k; aux tl in ++ let l = !collection_queue in ++ aux l; ++ l := Empty ++ ++(* The only reference to the boxed key is the one returned, when the user drops ++ it the value eventually disappears from the values table above *) ++let create (v : 'a) : 'a key = ++ run_collection (); ++ let k = mk_key () in ++ HT.add values !k (Obj.repr v); ++ Gc.finalise enqueue k; ++ k ++ ++(* Avoid raising Not_found *) ++exception InvalidKey ++let get (k : 'a key) : 'a = ++ run_collection (); ++ try Obj.obj (HT.find values !k) ++ with Not_found -> raise InvalidKey ++ ++(* Simple utils *) ++let default k v = ++ try get k ++ with InvalidKey -> v ++ ++let iter_opt k f = ++ match ++ try Some (get k) ++ with InvalidKey -> None ++ with ++ | None -> () ++ | Some v -> f v ++ ++let clear () = run_collection () +diff --git a/lib/cEphemeron.mli b/lib/cEphemeron.mli +new file mode 100644 +index 0000000..1200e4e +--- /dev/null ++++ b/lib/cEphemeron.mli +@@ -0,0 +1,52 @@ ++(************************************************************************) ++(* v * The Coq Proof Assistant / The Coq Development Team *) ++(* 'a key ++ ++(* May raise InvalidKey *) ++exception InvalidKey ++val get : 'a key -> 'a ++ ++(* These never fail. *) ++val iter_opt : 'a key -> ('a -> unit) -> unit ++val default : 'a key -> 'a -> 'a ++ ++val clear : unit -> unit +diff --git a/lib/ephemeron.ml b/lib/ephemeron.ml +deleted file mode 100644 +index a38ea11..0000000 +--- a/lib/ephemeron.ml ++++ /dev/null +@@ -1,89 +0,0 @@ +-(************************************************************************) +-(* v * The Coq Proof Assistant / The Coq Development Team *) +-(* boxed_key = +- (* TODO: take a random value here. Is there a random function in OCaml? *) +- let bid = ref 0 in +- (* According to OCaml Gc module documentation, Pervasives.ref is one of the +- few ways of getting a boxed value the compiler will never alias. *) +- fun () -> incr bid; Pervasives.ref (Pervasives.ref !bid) +- +-(* A phantom type to preserve type safety *) +-type 'a key = boxed_key +- +-(* Comparing keys with == grants that if a key is unmarshalled (in the same +- process where it was created or in another one) it is not mistaken for +- an already existing one (unmarshal has no right to alias). If the initial +- value of bid is taken at random, then one also avoids potential collisions *) +-module HT = Hashtbl.Make(struct +- type t = key_type ref +- let equal k1 k2 = k1 == k2 +- let hash id = !id +-end) +- +-(* A key is the (unique) value inside a boxed key, hence it does not +- keep its corresponding boxed key reachable (replacing key_type by boxed_key +- would make the key always reachable) *) +-let values : Obj.t HT.t = HT.create 1001 +- +-(* To avoid a race contidion between the finalization function and +- get/create on the values hashtable, the finalization function just +- enqueues in an imperative list the item to be collected. Being the list +- imperative, even if the Gc enqueue an item while run_collection is operating, +- the tail of the list is eventually set to Empty on completion. +- Kudos to the authors of Why3 that came up with this solution for their +- implementation of weak hash tables! *) +-type imperative_list = cell ref +-and cell = Empty | Item of key_type ref * imperative_list +- +-let collection_queue : imperative_list ref = ref (ref Empty) +- +-let enqueue x = collection_queue := ref (Item (!x, !collection_queue)) +- +-let run_collection () = +- let rec aux l = match !l with +- | Empty -> () +- | Item (k, tl) -> HT.remove values k; aux tl in +- let l = !collection_queue in +- aux l; +- l := Empty +- +-(* The only reference to the boxed key is the one returned, when the user drops +- it the value eventually disappears from the values table above *) +-let create (v : 'a) : 'a key = +- run_collection (); +- let k = mk_key () in +- HT.add values !k (Obj.repr v); +- Gc.finalise enqueue k; +- k +- +-(* Avoid raising Not_found *) +-exception InvalidKey +-let get (k : 'a key) : 'a = +- run_collection (); +- try Obj.obj (HT.find values !k) +- with Not_found -> raise InvalidKey +- +-(* Simple utils *) +-let default k v = +- try get k +- with InvalidKey -> v +- +-let iter_opt k f = +- match +- try Some (get k) +- with InvalidKey -> None +- with +- | None -> () +- | Some v -> f v +- +-let clear () = run_collection () +diff --git a/lib/ephemeron.mli b/lib/ephemeron.mli +deleted file mode 100644 +index 1200e4e..0000000 +--- a/lib/ephemeron.mli ++++ /dev/null +@@ -1,52 +0,0 @@ +-(************************************************************************) +-(* v * The Coq Proof Assistant / The Coq Development Team *) +-(* 'a key +- +-(* May raise InvalidKey *) +-exception InvalidKey +-val get : 'a key -> 'a +- +-(* These never fail. *) +-val iter_opt : 'a key -> ('a -> unit) -> unit +-val default : 'a key -> 'a -> 'a +- +-val clear : unit -> unit +diff --git a/lib/future.ml b/lib/future.ml +index 5cd2beb..e8f33db 100644 +--- a/lib/future.ml ++++ b/lib/future.ml +@@ -62,7 +62,7 @@ and 'a comp = + | Exn of Exninfo.iexn (* Invariant: this exception is always "fixed" as in fix_exn *) + + and 'a comput = +- | Ongoing of string * (UUID.t * fix_exn * 'a comp ref) Ephemeron.key ++ | Ongoing of string * (UUID.t * fix_exn * 'a comp ref) CEphemeron.key + | Finished of 'a + + and 'a computation = 'a comput ref +@@ -70,13 +70,13 @@ and 'a computation = 'a comput ref + let unnamed = "unnamed" + + let create ?(name=unnamed) ?(uuid=UUID.fresh ()) f x = +- ref (Ongoing (name, Ephemeron.create (uuid, f, Pervasives.ref x))) ++ ref (Ongoing (name, CEphemeron.create (uuid, f, Pervasives.ref x))) + let get x = + match !x with + | Finished v -> unnamed, UUID.invalid, id, ref (Val (v,None)) + | Ongoing (name, x) -> +- try let uuid, fix, c = Ephemeron.get x in name, uuid, fix, c +- with Ephemeron.InvalidKey -> ++ try let uuid, fix, c = CEphemeron.get x in name, uuid, fix, c ++ with CEphemeron.InvalidKey -> + name, UUID.invalid, id, ref (Exn (NotHere name, Exninfo.null)) + + type 'a value = [ `Val of 'a | `Exn of Exninfo.iexn ] +diff --git a/lib/lib.mllib b/lib/lib.mllib +index f3f6ad8..6805ce4 100644 +--- a/lib/lib.mllib ++++ b/lib/lib.mllib +@@ -15,6 +15,6 @@ Rtree + Heap + Unionfind + Genarg +-Ephemeron ++CEphemeron + Future + RemoteCounter +diff --git a/plugins/funind/functional_principles_types.ml b/plugins/funind/functional_principles_types.ml +index c47602b..1820030 100644 +--- a/plugins/funind/functional_principles_types.ml ++++ b/plugins/funind/functional_principles_types.ml +@@ -291,7 +291,7 @@ let build_functional_principle (evd:Evd.evar_map ref) interactive_proof old_prin + (* let dur1 = System.time_difference tim1 tim2 in *) + (* Pp.msgnl (str ("Time to compute proof: ") ++ str (string_of_float dur1)); *) + (* end; *) +- get_proof_clean true, Ephemeron.create hook ++ get_proof_clean true, CEphemeron.create hook + end + + +diff --git a/plugins/funind/indfun_common.ml b/plugins/funind/indfun_common.ml +index aa47e26..2449678 100644 +--- a/plugins/funind/indfun_common.ml ++++ b/plugins/funind/indfun_common.ml +@@ -163,7 +163,7 @@ let save with_clean id const (locality,_,kind) hook = + (locality, ConstRef kn) + in + if with_clean then Pfedit.delete_current_proof (); +- Ephemeron.iter_opt hook (fun f -> Lemmas.call_hook fix_exn f l r); ++ CEphemeron.iter_opt hook (fun f -> Lemmas.call_hook fix_exn f l r); + definition_message id + + +diff --git a/plugins/funind/indfun_common.mli b/plugins/funind/indfun_common.mli +index 23f1da1..e5c756f 100644 +--- a/plugins/funind/indfun_common.mli ++++ b/plugins/funind/indfun_common.mli +@@ -47,7 +47,7 @@ val jmeq : unit -> Term.constr + val jmeq_refl : unit -> Term.constr + + val save : bool -> Id.t -> Safe_typing.private_constants Entries.definition_entry -> Decl_kinds.goal_kind -> +- unit Lemmas.declaration_hook Ephemeron.key -> unit ++ unit Lemmas.declaration_hook CEphemeron.key -> unit + + (* [get_proof_clean do_reduce] : returns the proof name, definition, kind and hook and + abort the proof +diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml +index f22cdbc..541f299 100644 +--- a/proofs/proof_global.ml ++++ b/proofs/proof_global.ml +@@ -36,7 +36,7 @@ let find_proof_mode n = + Errors.error (Format.sprintf "No proof mode named \"%s\"." n) + + let register_proof_mode ({name = n} as m) = +- Hashtbl.add proof_modes n (Ephemeron.create m) ++ Hashtbl.add proof_modes n (CEphemeron.create m) + + (* initial mode: standard mode *) + let standard = { name = "No" ; set = (fun ()->()) ; reset = (fun () -> ()) } +@@ -52,7 +52,7 @@ let _ = + optname = "default proof mode" ; + optkey = ["Default";"Proof";"Mode"] ; + optread = begin fun () -> +- (Ephemeron.default !default_proof_mode standard).name ++ (CEphemeron.default !default_proof_mode standard).name + end; + optwrite = begin fun n -> + default_proof_mode := find_proof_mode n +@@ -83,12 +83,12 @@ type closed_proof = proof_object * proof_terminator + + type pstate = { + pid : Id.t; +- terminator : proof_terminator Ephemeron.key; ++ terminator : proof_terminator CEphemeron.key; + endline_tactic : Tacexpr.raw_tactic_expr option; + section_vars : Context.section_context option; + proof : Proof.proof; + strength : Decl_kinds.goal_kind; +- mode : proof_mode Ephemeron.key; ++ mode : proof_mode CEphemeron.key; + universe_binders: universe_binders option; + } + +@@ -103,11 +103,11 @@ let current_proof_mode = ref !default_proof_mode + let update_proof_mode () = + match !pstates with + | { mode = m } :: _ -> +- Ephemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); ++ CEphemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); + current_proof_mode := m; +- Ephemeron.iter_opt !current_proof_mode (fun x -> x.set ()) ++ CEphemeron.iter_opt !current_proof_mode (fun x -> x.set ()) + | _ -> +- Ephemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); ++ CEphemeron.iter_opt !current_proof_mode (fun x -> x.reset ()); + current_proof_mode := find_proof_mode "No" + + (* combinators for the current_proof lists *) +@@ -215,9 +215,9 @@ let set_proof_mode mn = + set_proof_mode (find_proof_mode mn) (get_current_proof_name ()) + + let activate_proof_mode mode = +- Ephemeron.iter_opt (find_proof_mode mode) (fun x -> x.set ()) ++ CEphemeron.iter_opt (find_proof_mode mode) (fun x -> x.set ()) + let disactivate_proof_mode mode = +- Ephemeron.iter_opt (find_proof_mode mode) (fun x -> x.reset ()) ++ CEphemeron.iter_opt (find_proof_mode mode) (fun x -> x.reset ()) + + (** [start_proof sigma id str goals terminator] starts a proof of name + [id] with goals [goals] (a list of pairs of environment and +@@ -230,7 +230,7 @@ let disactivate_proof_mode mode = + let start_proof sigma id ?pl str goals terminator = + let initial_state = { + pid = id; +- terminator = Ephemeron.create terminator; ++ terminator = CEphemeron.create terminator; + proof = Proof.start sigma goals; + endline_tactic = None; + section_vars = None; +@@ -242,7 +242,7 @@ let start_proof sigma id ?pl str goals terminator = + let start_dependent_proof id ?pl str goals terminator = + let initial_state = { + pid = id; +- terminator = Ephemeron.create terminator; ++ terminator = CEphemeron.create terminator; + proof = Proof.dependent_start goals; + endline_tactic = None; + section_vars = None; +@@ -375,7 +375,7 @@ let close_proof ~keep_body_ucst_separate ?feedback_id ~now fpl = + in + { id = pid; entries = entries; persistence = strength; + universes = (universes, binders) }, +- fun pr_ending -> Ephemeron.get terminator pr_ending ++ fun pr_ending -> CEphemeron.get terminator pr_ending + + type closed_proof_output = (Term.constr * Safe_typing.private_constants) list * Evd.evar_universe_context + +@@ -423,11 +423,11 @@ let close_proof ~keep_body_ucst_separate fix_exn = + + (** Gets the current terminator without checking that the proof has + been completed. Useful for the likes of [Admitted]. *) +-let get_terminator () = Ephemeron.get ( cur_pstate() ).terminator ++let get_terminator () = CEphemeron.get ( cur_pstate() ).terminator + let set_terminator hook = + match !pstates with + | [] -> raise NoCurrentProof +- | p :: ps -> pstates := { p with terminator = Ephemeron.create hook } :: ps ++ | p :: ps -> pstates := { p with terminator = CEphemeron.create hook } :: ps + + + +diff --git a/stm/asyncTaskQueue.ml b/stm/asyncTaskQueue.ml +index cc97326..5f018ec 100644 +--- a/stm/asyncTaskQueue.ml ++++ b/stm/asyncTaskQueue.ml +@@ -314,7 +314,7 @@ module Make(T : Task) = struct + let response = slave_respond request in + report_status "Idle"; + marshal_response (Option.get !slave_oc) response; +- Ephemeron.clear () ++ CEphemeron.clear () + with + | MarshalError s -> + pr_err ("Fatal marshal error: " ^ s); flush_all (); exit 2 +diff --git a/toplevel/obligations.ml b/toplevel/obligations.ml +index 314789c..26aa7f9 100644 +--- a/toplevel/obligations.ml ++++ b/toplevel/obligations.ml +@@ -323,11 +323,11 @@ type program_info_aux = { + prg_sign: named_context_val; + } + +-type program_info = program_info_aux Ephemeron.key ++type program_info = program_info_aux CEphemeron.key + + let get_info x = +- try Ephemeron.get x +- with Ephemeron.InvalidKey -> ++ try CEphemeron.get x ++ with CEphemeron.InvalidKey -> + Errors.anomaly Pp.(str "Program obligation can't be accessed by a worker") + + let assumption_message = Declare.assumption_message +@@ -460,7 +460,7 @@ let subst_deps_obl obls obl = + + module ProgMap = Map.Make(Id) + +-let map_replace k v m = ProgMap.add k (Ephemeron.create v) (ProgMap.remove k m) ++let map_replace k v m = ProgMap.add k (CEphemeron.create v) (ProgMap.remove k m) + + let map_keys m = ProgMap.fold (fun k _ l -> k :: l) m [] + +@@ -674,7 +674,7 @@ let init_prog_info ?(opaque = false) sign n b t ctx deps fixkind notations obls + let map_cardinal m = + let i = ref 0 in + ProgMap.iter (fun _ v -> +- if snd (Ephemeron.get v).prg_obligations > 0 then incr i) m; ++ if snd (CEphemeron.get v).prg_obligations > 0 then incr i) m; + !i + + exception Found of program_info +@@ -682,7 +682,7 @@ exception Found of program_info + let map_first m = + try + ProgMap.iter (fun _ v -> +- if snd (Ephemeron.get v).prg_obligations > 0 then ++ if snd (CEphemeron.get v).prg_obligations > 0 then + raise (Found v)) m; + assert(false) + with Found x -> x +@@ -1008,7 +1008,7 @@ let add_definition n ?term t ctx ?(implicits=[]) ?(kind=Global,false,Definition) + else ( + let len = Array.length obls in + let _ = Flags.if_verbose msg_info (info ++ str ", generating " ++ int len ++ str " obligation(s)") in +- progmap_add n (Ephemeron.create prg); ++ progmap_add n (CEphemeron.create prg); + let res = auto_solve_obligations (Some n) tactic in + match res with + | Remain rem -> Flags.if_verbose (fun () -> show_obligations ~msg:false (Some n)) (); res +@@ -1022,7 +1022,7 @@ let add_mutual_definitions l ctx ?tactic ?(kind=Global,false,Definition) ?(reduc + (fun (n, b, t, imps, obls) -> + let prg = init_prog_info sign ~opaque n (Some b) t ctx deps (Some fixkind) + notations obls imps kind reduce hook +- in progmap_add n (Ephemeron.create prg)) l; ++ in progmap_add n (CEphemeron.create prg)) l; + let _defined = + List.fold_left (fun finished x -> + if finished then finished diff --git a/patches/coqide/fix-idedeps-double-linking.patch b/patches/coqide/fix-idedeps-double-linking.patch new file mode 100644 index 0000000..82ec114 --- /dev/null +++ b/patches/coqide/fix-idedeps-double-linking.patch @@ -0,0 +1,54 @@ +commit 1cc70be070e1df522b1539892958496a77710331 +Author: Gabriel Scherer +Date: Tue Jun 28 14:45:37 2016 -0400 + + fix coqide double module linking (error on OCaml 4.03) + + Linking the same module twice in OCaml can have problematic unintended + consequences and lead to hard-to-understand bugs, see + http://caml.inria.fr/mantis/view.php?id=4231 + http://caml.inria.fr/mantis/view.php?id=5461 + + OCaml has long warned when double-linking happens + + Warning 31: files FOO and BAR both define a module named Baz + + In 4.03 this error was turned into a warning by default. + + Coqide does double-linking by passing both + xml_{lexer,parser,printer}.cmo and lib/clib.cma that already contains + these compilation units to bin/coqide.byte. To fix compilation of + Coqide under 4.03, the present patch removes the .cmo from the + command-line arguments. + + P.S.: I checked that this patch applies cleanly to the current trunk + (b161ad97fdc01ac8816341a089365657cebc6d2b). It should also be possible + to add it as a patch on top of the 8.5 archives (for example those + distributed through OPAM) to make them compile under 4.03. + +diff --git a/Makefile.build b/Makefile.build +index 0f85608..b5c933a 100644 +--- a/Makefile.build ++++ b/Makefile.build +@@ -653,7 +653,7 @@ $(COQWORKMGR): $(addsuffix $(BESTOBJ), stm/coqworkmgrApi tools/coqworkmgr) \ + # fake_ide : for debugging or test-suite purpose, a fake ide simulating + # a connection to coqtop -ideslave + +-$(FAKEIDE): lib/clib$(BESTLIB) lib/xml_lexer$(BESTOBJ) lib/xml_parser$(BESTOBJ) lib/xml_printer$(BESTOBJ) lib/errors$(BESTOBJ) lib/spawn$(BESTOBJ) ide/document$(BESTOBJ) ide/xmlprotocol$(BESTOBJ) tools/fake_ide$(BESTOBJ) | $(IDETOPLOOPCMA:.cma=$(BESTDYN)) ++$(FAKEIDE): lib/clib$(BESTLIB) lib/errors$(BESTOBJ) lib/spawn$(BESTOBJ) ide/document$(BESTOBJ) ide/xmlprotocol$(BESTOBJ) tools/fake_ide$(BESTOBJ) | $(IDETOPLOOPCMA:.cma=$(BESTDYN)) + $(SHOW)'OCAMLBEST -o $@' + $(HIDE)$(call bestocaml,-I ide,str unix threads) + +diff --git a/Makefile.common b/Makefile.common +index 1a90353..0dfd5de 100644 +--- a/Makefile.common ++++ b/Makefile.common +@@ -231,7 +231,7 @@ endif + LINKCMO:=$(CORECMA) $(STATICPLUGINS) + LINKCMX:=$(CORECMA:.cma=.cmxa) $(STATICPLUGINS:.cma=.cmxa) + +-IDEDEPS:=lib/clib.cma lib/xml_lexer.cmo lib/xml_parser.cmo lib/xml_printer.cmo lib/errors.cmo lib/spawn.cmo ++IDEDEPS:=lib/clib.cma lib/errors.cmo lib/spawn.cmo + IDECMA:=ide/ide.cma + IDETOPLOOPCMA=ide/coqidetop.cma + diff --git a/patches/coqide/fix-parallel-make.patch b/patches/coqide/fix-parallel-make.patch new file mode 100644 index 0000000..5d7b487 --- /dev/null +++ b/patches/coqide/fix-parallel-make.patch @@ -0,0 +1,72 @@ +commit d25990e2da7e5e84034b927cdab9ea4019c56a30 +Author: Enrico Tassi +Date: Fri Oct 11 13:43:20 2019 +0200 + + [make] separate generated gramlib ml files from mli files (fix #10864) + + (cherry picked from commit b0210638366d6584b709496b0f0eeeecb17c3fae) + +diff --git a/Makefile b/Makefile +index 2b5d2cea16..74b23f97aa 100644 +--- a/Makefile ++++ b/Makefile +@@ -101,15 +101,18 @@ EXISTINGMLI := $(call find, '*.mli') + + ## Files that will be generated + +-GENMLGFILES:= $(MLGFILES:.mlg=.ml) + # GRAMFILES must be in linking order + GRAMFILES=$(addprefix gramlib/.pack/gramlib__,Ploc Plexing Gramext Grammar) +-GRAMMLFILES := $(addsuffix .ml, $(GRAMFILES)) $(addsuffix .mli, $(GRAMFILES)) +-GENGRAMFILES := $(GRAMMLFILES) gramlib/.pack/gramlib.ml +-GENMLFILES:=$(LEXFILES:.mll=.ml) $(YACCFILES:.mly=.ml) $(GENMLGFILES) ide/coqide_os_specific.ml kernel/copcodes.ml kernel/uint63.ml ++GRAMMLFILES := $(addsuffix .ml, $(GRAMFILES)) ++GRAMMLIFILES := $(addsuffix .mli, $(GRAMFILES)) ++GENGRAMMLFILES := $(GRAMMLFILES) gramlib/.pack/gramlib.ml # why is gramlib.ml not in GRAMMLFILES? ++ ++GENMLGFILES:= $(MLGFILES:.mlg=.ml) ++GENMLFILES:=$(LEXFILES:.mll=.ml) $(YACCFILES:.mly=.ml) $(GENMLGFILES) $(GENGRAMMLFILES) ide/coqide_os_specific.ml kernel/copcodes.ml kernel/uint63.ml ++GENMLIFILES:=$(GRAMMLIFILES) + GENHFILES:=kernel/byterun/coq_instruct.h kernel/byterun/coq_jumptbl.h + GENFILES:=$(GENMLFILES) $(GENMLIFILES) $(GENHFILES) +-COQ_EXPORTED += GRAMFILES GRAMMLFILES GENGRAMFILES GENMLFILES GENHFILES GENFILES ++COQ_EXPORTED += GRAMFILES GRAMMLFILES GRAMMLIFILES GENMLFILES GENHFILES GENFILES + + ## More complex file lists + +diff --git a/Makefile.build b/Makefile.build +index 47f1b02c6e..4fbd4bfffd 100644 +--- a/Makefile.build ++++ b/Makefile.build +@@ -779,9 +779,9 @@ OCAMLDEP = $(OCAMLFIND) ocamldep -slash -ml-synonym .mlpack + MAINMLFILES := $(filter-out gramlib/.pack/% checker/% plugins/%, $(MLFILES) $(MLIFILES)) + MAINMLLIBFILES := $(filter-out gramlib/.pack/% checker/% plugins/%, $(MLLIBFILES) $(MLPACKFILES)) + +-$(MLDFILE).d: $(D_DEPEND_BEFORE_SRC) $(MAINMLFILES) $(D_DEPEND_AFTER_SRC) $(GENFILES) $(GENGRAMFILES) ++$(MLDFILE).d: $(D_DEPEND_BEFORE_SRC) $(MAINMLFILES) $(D_DEPEND_AFTER_SRC) $(GENFILES) + $(SHOW)'OCAMLDEP MLFILES MLIFILES' +- $(HIDE)$(OCAMLDEP) $(DEPFLAGS) -passrest $(MAINMLFILES) -open Gramlib $(GRAMMLFILES) $(TOTARGET) ++ $(HIDE)$(OCAMLDEP) $(DEPFLAGS) -passrest $(MAINMLFILES) -open Gramlib $(GRAMMLFILES) $(GRAMMLIFILES) $(TOTARGET) + #NB: -passrest is needed to avoid ocamlfind reordering the -open Gramlib + + $(MLLIBDFILE).d: $(D_DEPEND_BEFORE_SRC) $(MAINMLLIBFILES) $(D_DEPEND_AFTER_SRC) $(OCAMLLIBDEP) $(GENFILES) +diff --git a/Makefile.install b/Makefile.install +index 5b5e548f9c..51017b7c3a 100644 +--- a/Makefile.install ++++ b/Makefile.install +@@ -92,13 +92,13 @@ install-tools: + + INSTALLCMI = $(sort \ + $(filter-out checker/% ide/% tools/%, $(MLIFILES:.mli=.cmi)) \ +- $(filter %.cmi, $(GRAMMLFILES:.mli=.cmi)) gramlib/.pack/gramlib.cmi \ ++ $(GRAMMLIFILES:.mli=.cmi) gramlib/.pack/gramlib.cmi \ + $(foreach lib,$(CORECMA), $(addsuffix .cmi,$($(lib:.cma=_MLLIB_DEPENDENCIES))))) \ + $(PLUGINS:.cmo=.cmi) + + INSTALLCMX = $(sort $(filter-out checker/% ide/% tools/% dev/% \ + configure.cmx toplevel/coqtop_byte_bin.cmx plugins/extraction/big.cmx, \ +- $(filter %.cmx, $(GRAMMLFILES:.ml=.cmx)) $(MLFILES:.ml=.cmx))) ++ $(GRAMMLFILES:.ml=.cmx) $(MLFILES:.ml=.cmx))) + + install-devfiles: + $(MKDIR) $(FULLBINDIR) diff --git a/patches/core/4.01cloexec.diff b/patches/core/4.01cloexec.diff new file mode 100644 index 0000000..ca699a5 --- /dev/null +++ b/patches/core/4.01cloexec.diff @@ -0,0 +1,25 @@ +diff --git a/lib/core_unix.ml b/lib/core_unix.ml +index 7eb2427..4dd1496 100644 +--- a/lib/core_unix.ml ++++ b/lib/core_unix.ml +@@ -890,6 +890,7 @@ Unix.open_flag = + | O_SYNC + | O_RSYNC + | O_SHARE_DELETE ++| O_CLOEXEC + with sexp + + type file_perm = int with of_sexp +diff --git a/lib/core_unix.mli b/lib/core_unix.mli +index 890d7ec..a367a9b 100644 +--- a/lib/core_unix.mli ++++ b/lib/core_unix.mli +@@ -305,6 +305,7 @@ type open_flag = + | O_SYNC (** Writes complete as `Synchronised I/O file integrity completion' *) + | O_RSYNC (** Reads complete as writes (depending on O_SYNC/O_DSYNC) *) + | O_SHARE_DELETE (** Windows only: allow the file to be deleted while still open *) ++ | O_CLOEXEC (** Set the close-on-exec flag on the descriptor returned by {!openfile} *) + with sexp + + (** The type of file access rights. *) + diff --git a/patches/core/build_with_trunk.patch b/patches/core/build_with_trunk.patch new file mode 100644 index 0000000..8fa6405 --- /dev/null +++ b/patches/core/build_with_trunk.patch @@ -0,0 +1,67 @@ +From 9a1e3d35ea11f422a1fff864eb12d6bcc1d12873 Mon Sep 17 00:00:00 2001 +From: Pierre Chambart +Date: Thu, 18 Dec 2014 20:04:30 +0100 +Subject: [PATCH] Build with trunk + +* uint32 and int64 are not defined in ocaml headers anymore. +--- + lib/backtrace_stubs.c | 7 ++++--- + lib/ocaml_utils.h | 3 ++- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/lib/backtrace_stubs.c b/lib/backtrace_stubs.c +index 647114d..61fc17c 100644 +--- a/lib/backtrace_stubs.c ++++ b/lib/backtrace_stubs.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #ifndef __x86_64__ + #error "backtrace_stubs.c is for x86-64 only" +@@ -127,7 +128,7 @@ static void extract_location_info(frame_descr * d, + /*out*/ struct loc_info * li) + { + uintnat infoptr; +- uint32 info1, info2; ++ uint32_t info1, info2; + + /* If no debugging information available, print nothing. + When everything is compiled with -g, this corresponds to +@@ -142,8 +143,8 @@ static void extract_location_info(frame_descr * d, + sizeof(char *) + sizeof(short) + sizeof(short) + + sizeof(short) * d->num_live + sizeof(frame_descr *) - 1) + & -sizeof(frame_descr *); +- info1 = ((uint32 *)infoptr)[0]; +- info2 = ((uint32 *)infoptr)[1]; ++ info1 = ((uint32_t *)infoptr)[0]; ++ info2 = ((uint32_t *)infoptr)[1]; + /* Format of the two info words: + llllllllllllllllllll aaaaaaaa bbbbbbbbbb nnnnnnnnnnnnnnnnnnnnnnnn kk + 44 36 26 2 0 +diff --git a/lib/ocaml_utils.h b/lib/ocaml_utils.h +index 125b6b5..23cbddd 100644 +--- a/lib/ocaml_utils.h ++++ b/lib/ocaml_utils.h +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + #define XSTR(S) STR(S) + #define STR(S) #S +@@ -24,7 +25,7 @@ + # define Int63_val(v) Int64_val(v) + #endif + +-typedef int64 int63; ++typedef int64_t int63; + + #define DEFINE_INT63_CONSTANT(name,z) \ + CAMLprim value name(value __unused v_unit) { return caml_alloc_int63(z); } +-- +2.1.3 + diff --git a/patches/core/core.install.109.32.00 b/patches/core/core.install.109.32.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.32.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.34.00 b/patches/core/core.install.109.34.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.34.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.35.00 b/patches/core/core.install.109.35.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.35.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.36.00 b/patches/core/core.install.109.36.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.36.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.37.00 b/patches/core/core.install.109.37.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.37.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.38.00 b/patches/core/core.install.109.38.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.38.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.40.00 b/patches/core/core.install.109.40.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.40.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.41.00 b/patches/core/core.install.109.41.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.41.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.42.00 b/patches/core/core.install.109.42.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.42.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.45.00 b/patches/core/core.install.109.45.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.45.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.47.00 b/patches/core/core.install.109.47.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.47.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.53.00 b/patches/core/core.install.109.53.00 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.53.00 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.53.01 b/patches/core/core.install.109.53.01 new file mode 100644 index 0000000..e36fb25 --- /dev/null +++ b/patches/core/core.install.109.53.01 @@ -0,0 +1 @@ +bin: ["corebuild"] diff --git a/patches/core/core.install.109.55.00 b/patches/core/core.install.109.55.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.109.55.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.109.55.02 b/patches/core/core.install.109.55.02 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.109.55.02 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.109.58.00 b/patches/core/core.install.109.58.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.109.58.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.109.60.00 b/patches/core/core.install.109.60.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.109.60.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.110.01.00 b/patches/core/core.install.110.01.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.110.01.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.03.00 b/patches/core/core.install.111.03.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.03.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.06.00 b/patches/core/core.install.111.06.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.06.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.08.00 b/patches/core/core.install.111.08.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.08.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.11.00 b/patches/core/core.install.111.11.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.11.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.11.01 b/patches/core/core.install.111.11.01 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.11.01 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.13.00 b/patches/core/core.install.111.13.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.13.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.17.00 b/patches/core/core.install.111.17.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.17.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.21.00 b/patches/core/core.install.111.21.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.21.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.25.00 b/patches/core/core.install.111.25.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.25.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.28.00 b/patches/core/core.install.111.28.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.28.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.111.28.01 b/patches/core/core.install.111.28.01 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.111.28.01 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.01.00 b/patches/core/core.install.112.01.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.01.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.01.01 b/patches/core/core.install.112.01.01 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.01.01 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.06.00 b/patches/core/core.install.112.06.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.06.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.06.01 b/patches/core/core.install.112.06.01 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.06.01 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.06.02 b/patches/core/core.install.112.06.02 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.06.02 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.17.00 b/patches/core/core.install.112.17.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.17.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.24.00 b/patches/core/core.install.112.24.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.24.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.24.01 b/patches/core/core.install.112.24.01 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.24.01 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.35.00 b/patches/core/core.install.112.35.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.35.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.112.35.01 b/patches/core/core.install.112.35.01 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.112.35.01 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/core.install.113.00.00 b/patches/core/core.install.113.00.00 new file mode 100644 index 0000000..f25eea5 --- /dev/null +++ b/patches/core/core.install.113.00.00 @@ -0,0 +1 @@ +bin: ["corebuild" "coretop"] diff --git a/patches/core/corebuild b/patches/core/corebuild new file mode 100644 index 0000000..d654561 --- /dev/null +++ b/patches/core/corebuild @@ -0,0 +1,18 @@ +#!/bin/sh + +ocamlbuild \ + -use-ocamlfind \ + -classic-display \ + -syntax camlp4o \ + -pkg core \ + -pkg sexplib.syntax,comparelib.syntax,fieldslib.syntax,variantslib.syntax \ + -pkg bin_prot.syntax \ + -tag thread \ + -tag debug \ + -tag annot \ + -tag bin_annot \ + -tag short_paths \ + -cflags "-w A-4-33-41-42-43-34-44" \ + -cflags -strict-sequence \ + -cflags -principal \ + $@ diff --git a/patches/core/disable_warn_error.patch b/patches/core/disable_warn_error.patch new file mode 100644 index 0000000..5ec11df --- /dev/null +++ b/patches/core/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.484655713 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.639904031 -0500 +@@ -587,7 +587,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/core/fix_META.patch.108.08.00 b/patches/core/fix_META.patch.108.08.00 new file mode 100644 index 0000000..653b639 --- /dev/null +++ b/patches/core/fix_META.patch.108.08.00 @@ -0,0 +1,11 @@ +--- lib/META.prev 2012-12-13 15:56:02.910434809 -0500 ++++ lib/META 2012-12-13 15:56:39.167260697 -0500 +@@ -3,7 +3,7 @@ + version = "108.08.00" + description = "Jane Street Capital's standard library overlay" + requires = +-"variantslib variantslib.syntax sexplib.syntax sexplib fieldslib.syntax fieldslib bin_prot bin_prot.syntax bigarray comparelib.syntax pa_ounit pa_pipebang res unix threads" ++"variantslib sexplib fieldslib bin_prot bigarray oUnit res unix threads" + archive(byte) = "core.cma" + archive(byte, plugin) = "core.cma" + archive(native) = "core.cmxa" diff --git a/patches/core/fix_META.patch.109.07.00 b/patches/core/fix_META.patch.109.07.00 new file mode 100644 index 0000000..57eb6f6 --- /dev/null +++ b/patches/core/fix_META.patch.109.07.00 @@ -0,0 +1,11 @@ +--- lib/META.prev 2012-12-13 15:56:02.910434809 -0500 ++++ lib/META 2012-12-13 15:56:39.167260697 -0500 +@@ -3,7 +3,7 @@ + version = "109.07.00" + description = "Jane Street Capital's standard library overlay" + requires = +-"variantslib variantslib.syntax sexplib.syntax sexplib fieldslib.syntax fieldslib bin_prot bin_prot.syntax bigarray comparelib.syntax pa_ounit pa_pipebang res unix threads" ++"variantslib sexplib fieldslib bin_prot bigarray oUnit res unix threads" + archive(byte) = "core.cma" + archive(byte, plugin) = "core.cma" + archive(native) = "core.cmxa" diff --git a/patches/core_extended/disable_warn_error.patch b/patches/core_extended/disable_warn_error.patch new file mode 100644 index 0000000..cdcbca9 --- /dev/null +++ b/patches/core_extended/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.488656046 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.641903848 -0500 +@@ -589,7 +589,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/core_extended/fix_META.patch.108.08.00 b/patches/core_extended/fix_META.patch.108.08.00 new file mode 100644 index 0000000..8786de7 --- /dev/null +++ b/patches/core_extended/fix_META.patch.108.08.00 @@ -0,0 +1,11 @@ +--- lib/META.prev 2012-12-13 16:05:41.644185169 -0500 ++++ lib/META 2012-12-13 16:06:15.268184976 -0500 +@@ -3,7 +3,7 @@ + version = "108.08.00" + description = "Jane Street Capital's standard library overlay" + requires = +-"sexplib.syntax sexplib fieldslib.syntax fieldslib bin_prot bin_prot.syntax pa_ounit pa_pipebang core bigarray pcre res unix threads" ++" sexplib fieldslib bin_prot oUnit core bigarray pcre res unix threads" + archive(byte) = "core_extended.cma" + archive(byte, plugin) = "core_extended.cma" + archive(native) = "core_extended.cmxa" diff --git a/patches/core_extended/fix_META.patch.109.07.00 b/patches/core_extended/fix_META.patch.109.07.00 new file mode 100644 index 0000000..af4c44d --- /dev/null +++ b/patches/core_extended/fix_META.patch.109.07.00 @@ -0,0 +1,11 @@ +--- lib/META.prev 2012-12-13 16:05:41.644185169 -0500 ++++ lib/META 2012-12-13 16:06:15.268184976 -0500 +@@ -3,7 +3,7 @@ + version = "109.07.00" + description = "Jane Street Capital's standard library overlay" + requires = +-"sexplib.syntax sexplib fieldslib.syntax fieldslib bin_prot bin_prot.syntax pa_ounit pa_pipebang core bigarray pcre res unix threads comparelib.syntax" ++" sexplib fieldslib bin_prot oUnit core bigarray pcre res unix threads" + archive(byte) = "core_extended.cma" + archive(byte, plugin) = "core_extended.cma" + archive(native) = "core_extended.cmxa" diff --git a/patches/core_extended/openbsd-quota-disable.diff.112.06.00 b/patches/core_extended/openbsd-quota-disable.diff.112.06.00 new file mode 100644 index 0000000..1977bae --- /dev/null +++ b/patches/core_extended/openbsd-quota-disable.diff.112.06.00 @@ -0,0 +1,64 @@ +diff --git a/lib/extended_unix_stubs.c b/lib/extended_unix_stubs.c +index 40b4d10..cbede42 100644 +--- a/lib/extended_unix_stubs.c ++++ b/lib/extended_unix_stubs.c +@@ -12,7 +12,10 @@ + #include + #include + #include ++#if (defined _LINUX_QUOTA_VERSION) + #include ++#endif ++#include + #include + + #ifndef __USE_ISOC99 +@@ -117,17 +120,24 @@ CAMLprim value getloadavg_stub (value v_unit __unused) + #endif + + int quota_command (value v_user_or_group, int command) { ++#ifdef USRQUOTA + if (v_user_or_group == caml_hash_variant("User")) + return QCMD(command, USRQUOTA); ++#endif + ++#ifdef GRPQUOTA + if (v_user_or_group == caml_hash_variant("Group")) + return QCMD(command, GRPQUOTA); ++#endif + + caml_failwith("Unix.Quota: I only know about `User and `Group"); + } + + CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + { ++#ifndef Q_GETQUOTA ++ caml_failwith("quota_query not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + int64_t bytes_used, bytes_soft, bytes_hard; +@@ -162,11 +172,15 @@ CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + Store_field(v_ret, 3, caml_alloc_int63(quota.dqb_curinodes)); + + CAMLreturn(v_ret); ++#endif + } + + CAMLprim value quota_modify (value v_user_or_group, value v_id, + value v_path, value v_bytes_limit, value v_inodes_limit) + { ++#ifndef Q_SETQUOTA ++ caml_failwith("quota_modify not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + CAMLparam5(v_user_or_group, v_id, v_path, v_bytes_limit, v_inodes_limit); +@@ -190,6 +204,7 @@ CAMLprim value quota_modify (value v_user_or_group, value v_id, + unix_error(errno, "Unix.Quota: unable to set quota", v_path); + + CAMLreturn(Val_unit); ++#endif + } + + CAMLprim value extended_ml_htonl (value v_num) { diff --git a/patches/core_extended/openbsd-quota-disable.diff.112.17.00 b/patches/core_extended/openbsd-quota-disable.diff.112.17.00 new file mode 100644 index 0000000..1977bae --- /dev/null +++ b/patches/core_extended/openbsd-quota-disable.diff.112.17.00 @@ -0,0 +1,64 @@ +diff --git a/lib/extended_unix_stubs.c b/lib/extended_unix_stubs.c +index 40b4d10..cbede42 100644 +--- a/lib/extended_unix_stubs.c ++++ b/lib/extended_unix_stubs.c +@@ -12,7 +12,10 @@ + #include + #include + #include ++#if (defined _LINUX_QUOTA_VERSION) + #include ++#endif ++#include + #include + + #ifndef __USE_ISOC99 +@@ -117,17 +120,24 @@ CAMLprim value getloadavg_stub (value v_unit __unused) + #endif + + int quota_command (value v_user_or_group, int command) { ++#ifdef USRQUOTA + if (v_user_or_group == caml_hash_variant("User")) + return QCMD(command, USRQUOTA); ++#endif + ++#ifdef GRPQUOTA + if (v_user_or_group == caml_hash_variant("Group")) + return QCMD(command, GRPQUOTA); ++#endif + + caml_failwith("Unix.Quota: I only know about `User and `Group"); + } + + CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + { ++#ifndef Q_GETQUOTA ++ caml_failwith("quota_query not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + int64_t bytes_used, bytes_soft, bytes_hard; +@@ -162,11 +172,15 @@ CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + Store_field(v_ret, 3, caml_alloc_int63(quota.dqb_curinodes)); + + CAMLreturn(v_ret); ++#endif + } + + CAMLprim value quota_modify (value v_user_or_group, value v_id, + value v_path, value v_bytes_limit, value v_inodes_limit) + { ++#ifndef Q_SETQUOTA ++ caml_failwith("quota_modify not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + CAMLparam5(v_user_or_group, v_id, v_path, v_bytes_limit, v_inodes_limit); +@@ -190,6 +204,7 @@ CAMLprim value quota_modify (value v_user_or_group, value v_id, + unix_error(errno, "Unix.Quota: unable to set quota", v_path); + + CAMLreturn(Val_unit); ++#endif + } + + CAMLprim value extended_ml_htonl (value v_num) { diff --git a/patches/core_extended/openbsd-quota-disable.diff.112.24.00 b/patches/core_extended/openbsd-quota-disable.diff.112.24.00 new file mode 100644 index 0000000..1977bae --- /dev/null +++ b/patches/core_extended/openbsd-quota-disable.diff.112.24.00 @@ -0,0 +1,64 @@ +diff --git a/lib/extended_unix_stubs.c b/lib/extended_unix_stubs.c +index 40b4d10..cbede42 100644 +--- a/lib/extended_unix_stubs.c ++++ b/lib/extended_unix_stubs.c +@@ -12,7 +12,10 @@ + #include + #include + #include ++#if (defined _LINUX_QUOTA_VERSION) + #include ++#endif ++#include + #include + + #ifndef __USE_ISOC99 +@@ -117,17 +120,24 @@ CAMLprim value getloadavg_stub (value v_unit __unused) + #endif + + int quota_command (value v_user_or_group, int command) { ++#ifdef USRQUOTA + if (v_user_or_group == caml_hash_variant("User")) + return QCMD(command, USRQUOTA); ++#endif + ++#ifdef GRPQUOTA + if (v_user_or_group == caml_hash_variant("Group")) + return QCMD(command, GRPQUOTA); ++#endif + + caml_failwith("Unix.Quota: I only know about `User and `Group"); + } + + CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + { ++#ifndef Q_GETQUOTA ++ caml_failwith("quota_query not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + int64_t bytes_used, bytes_soft, bytes_hard; +@@ -162,11 +172,15 @@ CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + Store_field(v_ret, 3, caml_alloc_int63(quota.dqb_curinodes)); + + CAMLreturn(v_ret); ++#endif + } + + CAMLprim value quota_modify (value v_user_or_group, value v_id, + value v_path, value v_bytes_limit, value v_inodes_limit) + { ++#ifndef Q_SETQUOTA ++ caml_failwith("quota_modify not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + CAMLparam5(v_user_or_group, v_id, v_path, v_bytes_limit, v_inodes_limit); +@@ -190,6 +204,7 @@ CAMLprim value quota_modify (value v_user_or_group, value v_id, + unix_error(errno, "Unix.Quota: unable to set quota", v_path); + + CAMLreturn(Val_unit); ++#endif + } + + CAMLprim value extended_ml_htonl (value v_num) { diff --git a/patches/core_extended/openbsd-quota-disable.diff.112.35.00 b/patches/core_extended/openbsd-quota-disable.diff.112.35.00 new file mode 100644 index 0000000..3298393 --- /dev/null +++ b/patches/core_extended/openbsd-quota-disable.diff.112.35.00 @@ -0,0 +1,64 @@ +diff --git a/lib/extended_unix_stubs.c b/lib/extended_unix_stubs.c +index 40b4d10..cbede42 100644 +--- a/src/extended_unix_stubs.c ++++ b/src/extended_unix_stubs.c +@@ -12,7 +12,10 @@ + #include + #include + #include ++#if (defined _LINUX_QUOTA_VERSION) + #include ++#endif ++#include + #include + + #ifndef __USE_ISOC99 +@@ -117,17 +120,24 @@ CAMLprim value getloadavg_stub (value v_unit __unused) + #endif + + int quota_command (value v_user_or_group, int command) { ++#ifdef USRQUOTA + if (v_user_or_group == caml_hash_variant("User")) + return QCMD(command, USRQUOTA); ++#endif + ++#ifdef GRPQUOTA + if (v_user_or_group == caml_hash_variant("Group")) + return QCMD(command, GRPQUOTA); ++#endif + + caml_failwith("Unix.Quota: I only know about `User and `Group"); + } + + CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + { ++#ifndef Q_GETQUOTA ++ caml_failwith("quota_query not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + int64_t bytes_used, bytes_soft, bytes_hard; +@@ -162,11 +172,15 @@ CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + Store_field(v_ret, 3, caml_alloc_int63(quota.dqb_curinodes)); + + CAMLreturn(v_ret); ++#endif + } + + CAMLprim value quota_modify (value v_user_or_group, value v_id, + value v_path, value v_bytes_limit, value v_inodes_limit) + { ++#ifndef Q_SETQUOTA ++ caml_failwith("quota_modify not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + CAMLparam5(v_user_or_group, v_id, v_path, v_bytes_limit, v_inodes_limit); +@@ -190,6 +204,7 @@ CAMLprim value quota_modify (value v_user_or_group, value v_id, + unix_error(errno, "Unix.Quota: unable to set quota", v_path); + + CAMLreturn(Val_unit); ++#endif + } + + CAMLprim value extended_ml_htonl (value v_num) { diff --git a/patches/core_extended/openbsd-quota-disable.diff.113.00.00 b/patches/core_extended/openbsd-quota-disable.diff.113.00.00 new file mode 100644 index 0000000..1977bae --- /dev/null +++ b/patches/core_extended/openbsd-quota-disable.diff.113.00.00 @@ -0,0 +1,64 @@ +diff --git a/lib/extended_unix_stubs.c b/lib/extended_unix_stubs.c +index 40b4d10..cbede42 100644 +--- a/lib/extended_unix_stubs.c ++++ b/lib/extended_unix_stubs.c +@@ -12,7 +12,10 @@ + #include + #include + #include ++#if (defined _LINUX_QUOTA_VERSION) + #include ++#endif ++#include + #include + + #ifndef __USE_ISOC99 +@@ -117,17 +120,24 @@ CAMLprim value getloadavg_stub (value v_unit __unused) + #endif + + int quota_command (value v_user_or_group, int command) { ++#ifdef USRQUOTA + if (v_user_or_group == caml_hash_variant("User")) + return QCMD(command, USRQUOTA); ++#endif + ++#ifdef GRPQUOTA + if (v_user_or_group == caml_hash_variant("Group")) + return QCMD(command, GRPQUOTA); ++#endif + + caml_failwith("Unix.Quota: I only know about `User and `Group"); + } + + CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + { ++#ifndef Q_GETQUOTA ++ caml_failwith("quota_query not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + int64_t bytes_used, bytes_soft, bytes_hard; +@@ -162,11 +172,15 @@ CAMLprim value quota_query (value v_user_or_group, value v_id, value v_path) + Store_field(v_ret, 3, caml_alloc_int63(quota.dqb_curinodes)); + + CAMLreturn(v_ret); ++#endif + } + + CAMLprim value quota_modify (value v_user_or_group, value v_id, + value v_path, value v_bytes_limit, value v_inodes_limit) + { ++#ifndef Q_SETQUOTA ++ caml_failwith("quota_modify not implemented on this OS"); ++#else + int id, cmd; + struct dqblk quota; + CAMLparam5(v_user_or_group, v_id, v_path, v_bytes_limit, v_inodes_limit); +@@ -190,6 +204,7 @@ CAMLprim value quota_modify (value v_user_or_group, value v_id, + unix_error(errno, "Unix.Quota: unable to set quota", v_path); + + CAMLreturn(Val_unit); ++#endif + } + + CAMLprim value extended_ml_htonl (value v_num) { diff --git a/patches/core_kernel/build_with_trunk.patch b/patches/core_kernel/build_with_trunk.patch new file mode 100644 index 0000000..01e3db5 --- /dev/null +++ b/patches/core_kernel/build_with_trunk.patch @@ -0,0 +1,58 @@ +From 5fe3abec566770b4efcce86adb4cb338cd8fb774 Mon Sep 17 00:00:00 2001 +From: Pierre Chambart +Date: Thu, 18 Dec 2014 18:58:11 +0100 +Subject: [PATCH] Build with trunk + +* uint32 is not defined anymore in OCaml headers. Replace it with uint32_t + that should be defined by any reasonnable compiler. +* trunk forbid the redeclaration of exceptions. Remove the redeclaration + of Binary_packing.Pack_signed_32_argument_out_of_range that looks like + a typo. +--- + lib/binary_packing.ml | 1 - + lib/hash_stubs.c | 5 +++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/binary_packing.ml b/lib/binary_packing.ml +index b61ba03..e0bc311 100644 +--- a/lib/binary_packing.ml ++++ b/lib/binary_packing.ml +@@ -324,7 +324,6 @@ let check_signed_32_in_range n = + raise (Pack_signed_32_argument_out_of_range n) + ENDIF + +-exception Pack_signed_32_argument_out_of_range of int with sexp + let pack_signed_32_int ~byte_order ~buf ~pos n = + assert (Sys.word_size = 64); + check_signed_32_in_range n; +diff --git a/lib/hash_stubs.c b/lib/hash_stubs.c +index 2a48588..938b34d 100644 +--- a/lib/hash_stubs.c ++++ b/lib/hash_stubs.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + + /* Final mix and return from the hash.c implementation from INRIA */ + #define FINAL_MIX_AND_RETURN(h) \ +@@ -12,14 +13,14 @@ + + CAMLprim value caml_hash_string (value string) + { +- uint32 h; ++ uint32_t h; + h = caml_hash_mix_string (0, string); + FINAL_MIX_AND_RETURN(h) + } + + CAMLprim value caml_hash_double (value d) + { +- uint32 h; ++ uint32_t h; + h = caml_hash_mix_double (0, Double_val(d)); + FINAL_MIX_AND_RETURN (h); + } +-- +2.1.3 + diff --git a/patches/core_kernel/include_compatibility.patch b/patches/core_kernel/include_compatibility.patch new file mode 100644 index 0000000..95e3863 --- /dev/null +++ b/patches/core_kernel/include_compatibility.patch @@ -0,0 +1,25 @@ +From 025f7a0695bf51317b23750c23f7c7824a0f9af1 Mon Sep 17 00:00:00 2001 +From: Pierre Chambart +Date: Wed, 14 Jan 2015 14:41:08 +0100 +Subject: [PATCH] Fix build with trunk + +Internal global variable where renamed and a compatibility macro was +added in caml/compatibility.h +--- + lib/core_gc_stubs.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/core_gc_stubs.c b/lib/core_gc_stubs.c +index 3e5431b..96d391e 100644 +--- a/lib/core_gc_stubs.c ++++ b/lib/core_gc_stubs.c +@@ -1,4 +1,6 @@ + #include ++#define CAML_NAME_SPACE ++#include + + extern double caml_stat_minor_words; + extern double caml_stat_promoted_words; +-- +2.1.4 + diff --git a/patches/cpdf/cpdf.install b/patches/cpdf/cpdf.install new file mode 100644 index 0000000..2144b0c --- /dev/null +++ b/patches/cpdf/cpdf.install @@ -0,0 +1 @@ +bin: ["cpdf"] diff --git a/patches/cppo/cppo.install b/patches/cppo/cppo.install new file mode 100644 index 0000000..68e6e05 --- /dev/null +++ b/patches/cppo/cppo.install @@ -0,0 +1 @@ +bin: ["cppo"] diff --git a/patches/cryptokit/aesni-align.patch b/patches/cryptokit/aesni-align.patch new file mode 100644 index 0000000..e9b89a8 --- /dev/null +++ b/patches/cryptokit/aesni-align.patch @@ -0,0 +1,63 @@ +From ac8c748268091d98d341ad38a5a8a83832f53a46 Mon Sep 17 00:00:00 2001 +From: Etienne Millon +Date: Mon, 21 Nov 2016 15:32:32 +0100 +Subject: [PATCH] Align key_schedule on a 16 byte boundary + +Memory access to/from XMM registers require the memory operand to be +aligned in order to have good performance (using the `MOVDQA` +operation). To ensure that, the compiler is supposed to align stack +variables, but it can not always do that. In particular, old GCC +versions (4.4.7, present in Centos 6) fail to do that. It is thus +necessary to align it manually using extra space. +--- + src/aesni.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/src/aesni.c b/src/aesni.c +index f2ff483..fde8669 100644 +--- a/src/aesni.c ++++ b/src/aesni.c +@@ -19,6 +19,7 @@ + #ifdef __AES__ + #include + #include ++#include + + int aesni_available = -1; + +@@ -216,11 +217,21 @@ static int aesni_key_expansion(const unsigned char * userkey, + } + } + ++static __m128i *align16(__m128i *p) ++{ ++ uintptr_t n = (uintptr_t) p; ++ if (n & 0xf) { ++ n = n + 16 - (n & 0xf); ++ } ++ return (__m128i *) n; ++} ++ + int aesniKeySetupEnc(unsigned char * ckey, + const unsigned char * key, + int keylength) + { +- __m128i key_schedule[15]; ++ __m128i unaligned_key_schedule[15 + 15]; ++ __m128i *key_schedule = align16(unaligned_key_schedule); + int nrounds, i; + + nrounds = aesni_key_expansion(key, keylength, key_schedule); +@@ -234,7 +245,8 @@ int aesniKeySetupDec(unsigned char * ckey, + const unsigned char * key, + int keylength) + { +- __m128i key_schedule[15]; ++ __m128i unaligned_key_schedule[15 + 15]; ++ __m128i *key_schedule = align16(unaligned_key_schedule); + int nrounds, i; + + nrounds = aesni_key_expansion(key, keylength, key_schedule); +-- +2.10.2 + diff --git a/patches/cryptokit/aesni-detect.patch b/patches/cryptokit/aesni-detect.patch new file mode 100644 index 0000000..5a1cb0f --- /dev/null +++ b/patches/cryptokit/aesni-detect.patch @@ -0,0 +1,46 @@ +From 933fcba1f1851dc3a0e254746373c5c8fb87131c Mon Sep 17 00:00:00 2001 +From: Etienne Millon +Date: Fri, 18 Nov 2016 16:15:56 +0100 +Subject: [PATCH] Reliably detect AES-NI + +As reported in [1], the original detection code fails on 32 bit +targets. This improves the patch a bit by falling back to the software +implementation if CPUID fails. + +[1]: https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=1646&group_id=133&atid=628 +--- + src/aesni.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/src/aesni.c b/src/aesni.c +index 57a8ae7..f2ff483 100644 +--- a/src/aesni.c ++++ b/src/aesni.c +@@ -18,16 +18,19 @@ + + #ifdef __AES__ + #include ++#include + + int aesni_available = -1; + + int aesni_check_available(void) + { +- unsigned int ax, bx, cx, dx; +- __asm__ __volatile__ ("cpuid" +- : "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) +- : "a" (1)); +- return (aesni_available = (cx & 0x2000000) != 0); ++ unsigned int eax, ebx, ecx, edx; ++ if(__get_cpuid(1, &eax, &ebx, &ecx, &edx)) { ++ aesni_available = (ecx & 0x2000000) != 0; ++ } else { ++ aesni_available = 0; ++ } ++ return aesni_available; + } + + static inline __m128i aesni_128_assist(__m128i t1, __m128i t2) +-- +2.10.2 + diff --git a/patches/csdp/csdp.install b/patches/csdp/csdp.install new file mode 100644 index 0000000..efadfcd --- /dev/null +++ b/patches/csdp/csdp.install @@ -0,0 +1,8 @@ +bin: [ + "solver/csdp" + "theta/theta" + "theta/graphtoprob" + "theta/complement" + "theta/rand_graph" +] + diff --git a/patches/csv/_oasis_remove_.ml b/patches/csv/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/csv/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/csv/csv.install.1.2.6 b/patches/csv/csv.install.1.2.6 new file mode 100644 index 0000000..ed3a060 --- /dev/null +++ b/patches/csv/csv.install.1.2.6 @@ -0,0 +1,4 @@ +bin: [ + "?_build/examples/csvtool.byte" {"csvtool"} + "?_build/examples/csvtool.native" {"csvtool"} +] diff --git a/patches/csv/csv.install.1.3.0 b/patches/csv/csv.install.1.3.0 new file mode 100644 index 0000000..ed3a060 --- /dev/null +++ b/patches/csv/csv.install.1.3.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/examples/csvtool.byte" {"csvtool"} + "?_build/examples/csvtool.native" {"csvtool"} +] diff --git a/patches/csv/csv.install.1.3.1 b/patches/csv/csv.install.1.3.1 new file mode 100644 index 0000000..ed3a060 --- /dev/null +++ b/patches/csv/csv.install.1.3.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/examples/csvtool.byte" {"csvtool"} + "?_build/examples/csvtool.native" {"csvtool"} +] diff --git a/patches/csv/csv.install.1.3.2 b/patches/csv/csv.install.1.3.2 new file mode 100644 index 0000000..ed3a060 --- /dev/null +++ b/patches/csv/csv.install.1.3.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/examples/csvtool.byte" {"csvtool"} + "?_build/examples/csvtool.native" {"csvtool"} +] diff --git a/patches/csv/csv.install.1.3.3 b/patches/csv/csv.install.1.3.3 new file mode 100644 index 0000000..ed3a060 --- /dev/null +++ b/patches/csv/csv.install.1.3.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/examples/csvtool.byte" {"csvtool"} + "?_build/examples/csvtool.native" {"csvtool"} +] diff --git a/patches/csv/csv.install.1.3.4 b/patches/csv/csv.install.1.3.4 new file mode 100644 index 0000000..ed3a060 --- /dev/null +++ b/patches/csv/csv.install.1.3.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/examples/csvtool.byte" {"csvtool"} + "?_build/examples/csvtool.native" {"csvtool"} +] diff --git a/patches/csv/csv.install.1.4 b/patches/csv/csv.install.1.4 new file mode 100644 index 0000000..ed3a060 --- /dev/null +++ b/patches/csv/csv.install.1.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/examples/csvtool.byte" {"csvtool"} + "?_build/examples/csvtool.native" {"csvtool"} +] diff --git a/patches/csv/csv.install.1.4.1 b/patches/csv/csv.install.1.4.1 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/csv/csv.install.1.4.1 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/csv/csv.install.1.4.2 b/patches/csv/csv.install.1.4.2 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/csv/csv.install.1.4.2 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/ctypes/build_with_trunk.patch b/patches/ctypes/build_with_trunk.patch new file mode 100644 index 0000000..290f068 --- /dev/null +++ b/patches/ctypes/build_with_trunk.patch @@ -0,0 +1,21 @@ +diff -ru ctypes.0.3.4/src/ctypes/type_info_stubs.c ctypes.0.3.4_/src/ctypes/type_info_stubs.c +--- ctypes.0.3.4/src/ctypes/type_info_stubs.c 2014-12-23 01:11:05.000000000 +0100 ++++ ctypes.0.3.4_/src/ctypes/type_info_stubs.c 2015-02-27 15:43:17.232556328 +0100 +@@ -48,7 +48,7 @@ + case Uint8_t: b = ctypes_copy_uint8(*(uint8_t *)buf); break; + case Uint16_t: b = ctypes_copy_uint16(*(uint16_t *)buf); break; + case Uint32_t: b = ctypes_copy_uint32(*(uint32_t *)buf); break; +- case Uint64_t: b = ctypes_copy_uint64(*(uint64 *)buf); break; ++ case Uint64_t: b = ctypes_copy_uint64(*(uint64_t *)buf); break; + case Camlint: b = Val_int(*(intnat *)buf); break; + case Nativeint: b = caml_copy_nativeint(*(intnat *)buf); break; + case Float: b = caml_copy_double(*(float *)buf); break; +@@ -89,7 +89,7 @@ + case Uint8_t: *(uint8_t *)buf = Uint8_val(v); break; + case Uint16_t: *(uint16_t *)buf = Uint16_val(v); break; + case Uint32_t: *(uint32_t *)buf = Uint32_val(v); break; +- case Uint64_t: *(uint64 *)buf = Uint64_val(v); break; ++ case Uint64_t: *(uint64_t *)buf = Uint64_val(v); break; + case Camlint: *(intnat *)buf = Int_val(v); break; + case Nativeint: *(intnat *)buf = Nativeint_val(v); break; + case Float: *(float *)buf = Double_val(v); break; diff --git a/patches/cubicle/cubicle.install b/patches/cubicle/cubicle.install new file mode 100644 index 0000000..9c0dded --- /dev/null +++ b/patches/cubicle/cubicle.install @@ -0,0 +1 @@ +bin: ["cubicle.opt" {"cubicle"}] diff --git a/patches/cubicle/patch_syntax_ocaml_4_03_0.patch b/patches/cubicle/patch_syntax_ocaml_4_03_0.patch new file mode 100644 index 0000000..c2f8b31 --- /dev/null +++ b/patches/cubicle/patch_syntax_ocaml_4_03_0.patch @@ -0,0 +1,13 @@ +diff --git a/enumerative.ml b/enumerative.ml +index 31e6054..1374cd7 100644 +--- a/enumerative.ml ++++ b/enumerative.ml +@@ -285,7 +285,7 @@ let init_tables procs s = + let ht = HT.create (nb_vars + nb_consts) in + let i = ref 0 in + Term.Set.iter (fun t -> HT.add ht t !i; incr i) var_terms; +- let max_id_vars = !i - 1in ++ let max_id_vars = !i - 1 in + let proc_ids = ref [] in + let first_proc = !i in + List.iter (fun t -> HT.add ht t !i; proc_ids := !i :: !proc_ids; incr i) diff --git a/patches/cudf/META.0.6.3 b/patches/cudf/META.0.6.3 new file mode 100644 index 0000000..11bdd3f --- /dev/null +++ b/patches/cudf/META.0.6.3 @@ -0,0 +1,4 @@ +version = "0.6.3" +requires = "extlib" +archive(byte) = "cudf.cma" +archive(native) = "cudf.cmxa" \ No newline at end of file diff --git a/patches/cudf/cudf.install b/patches/cudf/cudf.install new file mode 100644 index 0000000..9fc29b2 --- /dev/null +++ b/patches/cudf/cudf.install @@ -0,0 +1,19 @@ +lib: [ + "META" + "_obuild/cudf/cudf.cma" + "_obuild/cudf/cudf.cmi" + "_obuild/cudf/cudf.cmxa" + "_obuild/cudf/cudf.a" + "_obuild/cudf/cudf_822_lexer.cmi" + "_obuild/cudf/cudf_checker.cmi" + "_obuild/cudf/cudf_parser.cmi" + "_obuild/cudf/cudf_type_parser.cmi" + "_obuild/cudf/cudf_822_parser.cmi" + "_obuild/cudf/cudf.cmi" + "_obuild/cudf/cudf_printer.cmi" + "_obuild/cudf/cudf_types.cmi" + "_obuild/cudf/cudf_c.cmi" + "_obuild/cudf/cudf_conf.cmi" + "_obuild/cudf/cudf_type_lexer.cmi" + "_obuild/cudf/cudf_types_pp.cmi" +] diff --git a/patches/cudf/cudf.ocp.in b/patches/cudf/cudf.ocp.in new file mode 100644 index 0000000..94b2398 --- /dev/null +++ b/patches/cudf/cudf.ocp.in @@ -0,0 +1,25 @@ +begin library "extLib" + dirname = "%{lib}%/extlib" + generated = true +end + +begin library "cudf" + sort = true + files = [ + "cudf_types_pp.ml" + "cudf_types.ml" + "cudf_type_parser.mly" + "cudf_type_lexer.mll" + "cudf_printer.ml" + "cudf_parser.ml" + "cudf_conf.ml" + "cudf_checker.ml" + "cudf_c.ml" + "cudf_822_parser.mly" + "cudf_822_lexer.mll" + "cudf.ml" + ] + requires = [ + "extLib" + ] +end diff --git a/patches/datakit-bridge-github/fmt.tty-is-used-by-datakit-log.patch b/patches/datakit-bridge-github/fmt.tty-is-used-by-datakit-log.patch new file mode 100644 index 0000000..445c2e6 --- /dev/null +++ b/patches/datakit-bridge-github/fmt.tty-is-used-by-datakit-log.patch @@ -0,0 +1,22 @@ +From 9a7ec63d4993856ec4cf862f02fb5b051dd073c4 Mon Sep 17 00:00:00 2001 +From: Rudi Grinberg +Date: Tue, 27 Feb 2018 02:52:58 +0700 +Subject: [PATCH] fmt.tty is used by datakit-log + +--- + src/datakit-log/jbuild | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/datakit-log/jbuild b/src/datakit-log/jbuild +index 86ed620..3a8465b 100644 +--- a/src/datakit-log/jbuild ++++ b/src/datakit-log/jbuild +@@ -4,4 +4,4 @@ + ((name datakit_log) + (wrapped false) + (libraries (cmdliner fmt logs.cli prometheus-app.unix mtime mtime.clock.os +- win-eventlog asl logs.fmt)))) ++ win-eventlog asl logs.fmt fmt.tty)))) +-- +2.16.3 + diff --git a/patches/dbforge/dbforge.install b/patches/dbforge/dbforge.install new file mode 100644 index 0000000..9708b74 --- /dev/null +++ b/patches/dbforge/dbforge.install @@ -0,0 +1,6 @@ +bin: [ + "?src/dbforge" + "?src/dbforge.byte" + "?src/dbforge-gtk" + "?src/dbforge-gtk.byte" +] diff --git a/patches/dbm/hasgotfix.patch b/patches/dbm/hasgotfix.patch new file mode 100644 index 0000000..a165996 --- /dev/null +++ b/patches/dbm/hasgotfix.patch @@ -0,0 +1,13 @@ +Index: camldbm-1.0/configure +=================================================================== +--- camldbm-1.0.orig/configure ++++ camldbm-1.0/configure +@@ -35,7 +35,7 @@ hasgot() { + ${CC:-cc} -I$1 -o hasgot.exe hasgot.c $3 $4 + res=$? + rm -f hasgot.c hasgot.exe +- return $? ++ return $res + } + + dbm_include="not found" diff --git a/patches/dbm/include_fix.patch b/patches/dbm/include_fix.patch new file mode 100644 index 0000000..93e7b5a --- /dev/null +++ b/patches/dbm/include_fix.patch @@ -0,0 +1,13 @@ +Index: camldbm-1.0/Makefile +=================================================================== +--- camldbm-1.0.orig/Makefile ++++ camldbm-1.0/Makefile +@@ -51,7 +51,7 @@ libcamldbm.$(A): cldbm.$(O) + $(OCAMLOPT) -c $(COMPFLAGS) $< + + .c.$(O): +- $(OCAMLC) -c -ccopt "$(DBM_INCLUDE)" -ccopt "$(DBM_DEFINES)" $< ++ $(OCAMLC) -c -ccopt "$(DBM_INCLUDES)" -ccopt "$(DBM_DEFINES)" $< + + depend: + $(OCAMLDEP) *.ml *.mli > .depend diff --git a/patches/dbm/include_local_fix.patch b/patches/dbm/include_local_fix.patch new file mode 100644 index 0000000..6eba857 --- /dev/null +++ b/patches/dbm/include_local_fix.patch @@ -0,0 +1,26 @@ +From 6c11b9255e5fc116714f7ee4fd3d7f9175b262f5 Mon Sep 17 00:00:00 2001 +From: Ion Alberdi +Date: Mon, 8 May 2017 21:23:37 +0200 +Subject: [PATCH] Look for ndbm.h in /usr/local/include too + +In macOS 10.12.4 +% brew install gdbm --with-libgdbm-compat + +puts ndbm.h in /usr/local/include. +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 7786275..00b763f 100755 +--- a/configure ++++ b/configure +@@ -42,7 +42,7 @@ dbm_include="not found" + dbm_link="not found" + dbm_defines="" + +-for dir in /usr/include /usr/include/db1 /usr/include/gdbm; do ++for dir in /usr/include /usr/include/db1 /usr/include/gdbm /usr/local/include; do + if test -f $dir/ndbm.h; then + dbm_include=$dir + if hasgot $dir ndbm.h; then diff --git a/patches/dbm/mkdir-stublibs.patch b/patches/dbm/mkdir-stublibs.patch new file mode 100644 index 0000000..ca5dd81 --- /dev/null +++ b/patches/dbm/mkdir-stublibs.patch @@ -0,0 +1,17 @@ +diff -C 2 -r -w camldbm-1.0.orig/Makefile camldbm-1.0/Makefile +*** camldbm-1.0.orig/Makefile 2011-11-22 16:56:49.000000000 +0100 +--- camldbm-1.0/Makefile 2016-03-18 15:26:56.032475666 +0100 +*************** +*** 58,62 **** + + install:: +! if test -f dllcamldbm.$(SO); then cp dllcamldbm.$(SO) $(STUBLIBDIR)/; fi + cp libcamldbm.$(A) $(LIBDIR)/ + cd $(LIBDIR) && ranlib libcamldbm.$(A) +--- 58,62 ---- + + install:: +! if test -f dllcamldbm.$(SO); then mkdir $(STUBLIBDIR) || echo Ok; cp dllcamldbm.$(SO) $(STUBLIBDIR)/; fi + cp libcamldbm.$(A) $(LIBDIR)/ + cd $(LIBDIR) && ranlib libcamldbm.$(A) +Only in camldbm-1.0: Makefile~ diff --git a/patches/dose/0001-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch b/patches/dose/0001-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch new file mode 100644 index 0000000..2f50cef --- /dev/null +++ b/patches/dose/0001-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch @@ -0,0 +1,28 @@ +From efb8135cb5283c18233324c490d8fae750f05978 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 18 Jul 2014 15:50:24 +0200 +Subject: [PATCH] Removed hard failure cases, in favor of finer diagnostics + +--- + algo/depsolver.ml | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/algo/depsolver.ml b/algo/depsolver.ml +index 754b44e..4c83464 100644 +--- a/algo/depsolver.ml ++++ b/algo/depsolver.ml +@@ -37,11 +37,6 @@ let reason map universe = + let globalid = Cudf.universe_size universe in + List.filter_map (function + |Diagnostic_int.Dependency(i,vl,il) when i = globalid -> None +- |Diagnostic_int.Missing(i,vl) when i = globalid -> +- fatal "the package encoding global constraints can't be missing" +- |Diagnostic_int.Conflict(i,j,vpkg) when i = globalid || j = globalid -> +- fatal "the package encoding global constraints can't be in conflict" +- + |Diagnostic_int.Dependency(i,vl,il) -> Some ( + Diagnostic.Dependency(from_sat (map#inttovar i),vl,List.map (fun i -> from_sat (map#inttovar i)) il) + ) +-- +2.1.4 + diff --git a/patches/dose/0002-ocamlgraph-1.8.6.diff b/patches/dose/0002-ocamlgraph-1.8.6.diff new file mode 100644 index 0000000..b1d858a --- /dev/null +++ b/patches/dose/0002-ocamlgraph-1.8.6.diff @@ -0,0 +1,13 @@ +diff --git a/algo/dominators.ml b/algo/dominators.ml +index d24ae09..8681b96 100644 +--- a/algo/dominators.ml ++++ b/algo/dominators.ml +@@ -99,7 +99,7 @@ let dominators_tarjan graph = + ) graph; + + Util.Timer.start tjntimer; +- let module Dom = Dominator.Make(G) in ++ let module Dom = Dominator.Make_graph(G) in + let idom = Dom.compute_all graph start_pkg in + let domgr = idom.Dom.dom_graph () in + Util.Timer.stop tjntimer (); diff --git a/patches/dose/0003-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch b/patches/dose/0003-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch new file mode 100644 index 0000000..3b985e5 --- /dev/null +++ b/patches/dose/0003-Removed-hard-failure-cases-in-favor-of-finer-diagnos.patch @@ -0,0 +1,28 @@ +From b93f8b64c86ded96b31b49b983beabfd8d7280f2 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 18 Jul 2014 15:50:24 +0200 +Subject: [PATCH] Removed hard failure cases, in favor of finer diagnostics + +--- + algo/depsolver.ml | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/algo/depsolver.ml b/algo/depsolver.ml +index f93fb86..a812ede 100644 +--- a/algo/depsolver.ml ++++ b/algo/depsolver.ml +@@ -37,11 +37,6 @@ let reason map universe = + let globalid = Cudf.universe_size universe in + List.filter_map (function + |Diagnostic_int.Dependency(i,vl,il) when i = globalid -> None +- |Diagnostic_int.Missing(i,vl) when i = globalid -> +- fatal "the package encoding global constraints can't be missing" +- |Diagnostic_int.Conflict(i,j,vpkg) when i = globalid || j = globalid -> +- fatal "the package encoding global constraints can't be in conflict" +- + |Diagnostic_int.Dependency(i,vl,il) -> Some ( + Diagnostic.Dependency(from_sat (map#inttovar i),vl,List.map (fun i -> from_sat (map#inttovar i)) il) + ) +-- +2.0.1 + diff --git a/patches/dose/0004-Remove-broken-assert.patch b/patches/dose/0004-Remove-broken-assert.patch new file mode 100644 index 0000000..582bad7 --- /dev/null +++ b/patches/dose/0004-Remove-broken-assert.patch @@ -0,0 +1,26 @@ +From 06c50a5050aa82c41b1c5f614716fad7a1e0b98d Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Tue, 29 Jul 2014 17:53:45 +0200 +Subject: [PATCH] Remove broken assert + +A timer may be stopped by an exception, in which case it's not stopped. +On the next call, the assert fails at timer start. +--- + common/util.ml | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/common/util.ml b/common/util.ml +index 707f159..dc64451 100644 +--- a/common/util.ml ++++ b/common/util.ml +@@ -266,7 +266,6 @@ module Timer = struct + let available () = Hashtbl.fold (fun k _ acc -> k::acc) timers [] + + let start c = +- assert(not c.is_in); + c.is_in <- true; + c.last <- !gettimeofday() + +-- +2.0.1 + diff --git a/patches/dose/0005-Add-a-check_request-function-allowing-more-control-o.patch b/patches/dose/0005-Add-a-check_request-function-allowing-more-control-o.patch new file mode 100644 index 0000000..ca157f6 --- /dev/null +++ b/patches/dose/0005-Add-a-check_request-function-allowing-more-control-o.patch @@ -0,0 +1,83 @@ +From 652059c78bf3d745563a725786b3dce2a7529f57 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Wed, 30 Jul 2014 12:38:45 +0200 +Subject: [PATCH 5/5] Add a check_request function allowing more control over + the underlying process + +--- + algo/depsolver.ml | 27 ++++++++++++++++++--------- + algo/depsolver.mli | 9 +++++++++ + 2 files changed, 27 insertions(+), 9 deletions(-) + +diff --git a/algo/depsolver.ml b/algo/depsolver.ml +index f93fb86..754b44e 100644 +--- a/algo/depsolver.ml ++++ b/algo/depsolver.ml +@@ -369,9 +369,7 @@ let upgrade_constr universe name = + let p = List.hd(List.sort ~cmp:Cudf.(>%) pl) + in (name,Some(`Geq,p.Cudf.version)) + +-(** check if a cudf request is satisfiable. we do not care about +- * universe consistency . We try to install a dummy package *) +-let check_request ?cmd ?callback ?criteria ?(explain=false) (pre,universe,request) = ++let check_request_using ?call_solver ?callback ?criteria ?(explain=false) (pre,universe,request) = + let intSolver ?(explain=false) universe request = + + let deps = +@@ -413,19 +411,30 @@ let check_request ?cmd ?callback ?criteria ?(explain=false) (pre,universe,reques + let criteria_array = Array.of_list (criteria_parser (Option.get criteria)) in + minimize ?callback criteria_array universe dummy + in +- if Option.is_none cmd then begin ++ match call_solver with ++ | None -> + let d = intSolver universe request in + if Diagnostic.is_solution d then + let is = Diagnostic.get_installationset d in + Sat (Some pre,Cudf.load_universe is) + else + if explain then Unsat (Some d) else Unsat None +- end else begin +- let cmd = Option.get cmd in +- let criteria = if Option.is_none criteria then "-removed,-new" else Option.get criteria in +- try Sat(CudfSolver.execsolver cmd criteria (pre,universe,request)) with ++ | Some call_solver -> ++ try Sat(call_solver (pre,universe,request)) with + |CudfSolver.Unsat when not explain -> Unsat None + |CudfSolver.Unsat when explain -> Unsat (Some (intSolver ~explain universe request)) + |CudfSolver.Error s -> Error s +- end ++ ++(** check if a cudf request is satisfiable. we do not care about ++ * universe consistency . We try to install a dummy package *) ++let check_request ?cmd ?callback ?criteria ?explain cudf = ++ let call_solver = ++ match cmd with ++ | Some cmd -> ++ let criteria = Option.default "-removed,-new" criteria in ++ Some (CudfSolver.execsolver cmd criteria) ++ | None -> None ++ in ++ check_request_using ?call_solver ?callback ?explain cudf ++ + ;; +diff --git a/algo/depsolver.mli b/algo/depsolver.mli +index 6c6c397..546a140 100644 +--- a/algo/depsolver.mli ++++ b/algo/depsolver.mli +@@ -135,3 +135,12 @@ type solver_result = + *) + val check_request : ?cmd : string -> ?callback:(int array * Diagnostic.diagnosis -> unit) -> + ?criteria:string -> ?explain : bool -> Cudf.cudf -> solver_result ++ ++(** Same as [check_request], but allows to specify any function to call the ++ external solver. It should raise [Depsolver.Unsat] on failure *) ++val check_request_using: ++ ?call_solver:(Cudf.cudf -> Cudf.preamble option * Cudf.universe) -> ++ ?callback:(int array * Diagnostic.diagnosis -> unit) -> ++ ?criteria:string -> ++ ?explain : bool -> ++ Cudf.cudf -> solver_result +-- +2.0.1 + diff --git a/patches/dose/META.dose b/patches/dose/META.dose new file mode 100644 index 0000000..3237029 --- /dev/null +++ b/patches/dose/META.dose @@ -0,0 +1,3 @@ +archive(byte) = "dose.cma" +requires = "unix, cudf, extlib, re.pcre, ocamlgraph" +archive(native) = "dose.cmxa" \ No newline at end of file diff --git a/patches/dose/META.dose3 b/patches/dose/META.dose3 new file mode 100644 index 0000000..1707c17 --- /dev/null +++ b/patches/dose/META.dose3 @@ -0,0 +1,4 @@ +directory = "../dose" +archive(byte) = "dose.cma" +requires = "unix, cudf, extlib, re.pcre, ocamlgraph" +archive(native) = "dose.cmxa" \ No newline at end of file diff --git a/patches/dose/dose.install b/patches/dose/dose.install new file mode 100644 index 0000000..15607d3 --- /dev/null +++ b/patches/dose/dose.install @@ -0,0 +1,9 @@ +lib: [ + "META" + "_obuild/dose/dose.cma" + "_obuild/dose/dose.cmxa" + "_obuild/dose/dose.a" + "_obuild/dose/Debian.cmi" + "_obuild/dose/Common.cmi" + "_obuild/dose/Algo.cmi" +] diff --git a/patches/dose/dose.ocp.in b/patches/dose/dose.ocp.in new file mode 100644 index 0000000..d447fb6 --- /dev/null +++ b/patches/dose/dose.ocp.in @@ -0,0 +1,84 @@ +begin library "re_perl" + dirname = "%{lib}%/re" + generated = true +end + +begin library "extLib" + dirname = "%{lib}%/extlib" + generated = true +end + +begin library "cudf" + dirname = "%{lib}%/cudf" + generated = true + requires = [ "re_perl" "extLib" ] +end + +begin library "graph" + dirname = "%{lib}%/ocamlgraph" + generated = true +end + + +begin library "unix" + version = "[distributed with Ocaml]" + dirname = [ "%{lib}%/ocaml" ] + generated = true +end + +begin library "dose" + sort = true + files = [ + pack Common [ + "common/util.ml" + "common/url.ml" + "common/input.ml" + "common/cudfDiff.ml" + "common/cudfAdd.ml" + "common/edosSolver.ml" + "common/cudfSolver.ml" +(* "common/minisatSolver.ml" *) + ] + + pack Debian [ + "deb/format822_parser.mly" + "deb/format822_lexer.mll" + "deb/format822.ml" + "deb/debcudf.ml" + "deb/packages_parser.mly" + "deb/packages_lexer.mll" + "deb/packages.ml" + "deb/version.ml" + "deb/sources.ml" + "deb/release.ml" + "deb/evolution.ml" + "deb/edsp.ml" + "deb/debutil.ml" + "deb/architecture.ml" + "deb/apt.ml" + ] + + pack Algo [ + "algo/strongdeps_int.ml" + "algo/strongdeps.ml" + "algo/strongconflicts_int.ml" + "algo/strongconflicts.ml" + "algo/statistics.ml" + "algo/flatten.ml" + "algo/dominator.ml" + "algo/dominators.ml" + "algo/diagnostic_int.ml" + "algo/diagnostic.ml" + "algo/depsolver_int.ml" + "algo/depsolver.ml" + "algo/defaultgraphs.ml" + ]] + + requires = [ + "re_perl" + "extLib" + "cudf" + "graph" + "unix" + ] +end diff --git a/patches/dose/patches/0001-Added-portable-invocation-of-mktemp-for-Linux-and-BS.patch b/patches/dose/patches/0001-Added-portable-invocation-of-mktemp-for-Linux-and-BS.patch new file mode 100644 index 0000000..9655fb7 --- /dev/null +++ b/patches/dose/patches/0001-Added-portable-invocation-of-mktemp-for-Linux-and-BS.patch @@ -0,0 +1,25 @@ +From 5d5d1d4a39830a9f852714ad6b14fec27a9ba0a5 Mon Sep 17 00:00:00 2001 +From: Roberto Di Cosmo +Date: Sun, 12 Jan 2014 22:54:38 +0100 +Subject: [PATCH 01/10] Added portable invocation of mktemp for Linux and *BSD + +--- + common/cudfSolver.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/cudfSolver.ml b/common/cudfSolver.ml +index 9b71147..8638f12 100644 +--- a/common/cudfSolver.ml ++++ b/common/cudfSolver.ml +@@ -27,7 +27,7 @@ let check_fail file = + (** see mktemp(1) for the syntax of [tmp_pattern] *) + let mktmpdir tmp_pattern = + let ic = +- Unix.open_process_in (Printf.sprintf "mktemp --tmpdir -d %s" tmp_pattern) in ++ Unix.open_process_in (Printf.sprintf "(mktemp --tmpdir -d %s || mktemp -d -t %s) 2>/dev/null" tmp_pattern tmp_pattern) in + let path = input_line ic in + ignore (Unix.close_process_in ic); + path +-- +1.8.5.3 + diff --git a/patches/dose/patches/0002-Sanitize-the-string-containing-the-criteria-before-p.patch b/patches/dose/patches/0002-Sanitize-the-string-containing-the-criteria-before-p.patch new file mode 100644 index 0000000..53f9962 --- /dev/null +++ b/patches/dose/patches/0002-Sanitize-the-string-containing-the-criteria-before-p.patch @@ -0,0 +1,33 @@ +From 0a9dda72d9bbb7f1b7888ec5c506336181ae19b5 Mon Sep 17 00:00:00 2001 +From: Roberto Di Cosmo +Date: Thu, 16 Jan 2014 11:34:53 +0100 +Subject: [PATCH 02/10] Sanitize the string containing the criteria before + passing it to the shell. + +--- + common/cudfSolver.ml | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/common/cudfSolver.ml b/common/cudfSolver.ml +index 8638f12..6d21dd6 100644 +--- a/common/cudfSolver.ml ++++ b/common/cudfSolver.ml +@@ -53,10 +53,14 @@ let rec input_all_lines acc chan = + (** Solver "exec:" line. Contains three named wildcards to be interpolated: + "$in", "$out", and "$pref"; corresponding to, respectively, input CUDF + document, output CUDF universe, user preferences. *) ++ ++(* quote string for the shell, after removing all characters disallowed in criteria *) ++let sanitize s = Printf.sprintf "\"%s\"" (Pcre.substitute ~rex:(Pcre.regexp "[^+()a-z,\"-]") ~subst:(fun _ -> "") s);; ++ + let interpolate_solver_pat exec cudf_in cudf_out pref = + let _, exec = String.replace ~str:exec ~sub:"$in" ~by:cudf_in in + let _, exec = String.replace ~str:exec ~sub:"$out" ~by:cudf_out in +- let _, exec = String.replace ~str:exec ~sub:"$pref" ~by:pref in ++ let _, exec = String.replace ~str:exec ~sub:"$pref" ~by:(sanitize pref) in + exec + ;; + +-- +1.8.5.3 + diff --git a/patches/dose/patches/0003-Modified-pattern-interpolation-to-ensure-only-one-is.patch b/patches/dose/patches/0003-Modified-pattern-interpolation-to-ensure-only-one-is.patch new file mode 100644 index 0000000..4156e50 --- /dev/null +++ b/patches/dose/patches/0003-Modified-pattern-interpolation-to-ensure-only-one-is.patch @@ -0,0 +1,38 @@ +From d26a67f13bc445463ba474d578c2ea8ee4a9dd0c Mon Sep 17 00:00:00 2001 +From: Roberto Di Cosmo +Date: Fri, 17 Jan 2014 13:55:30 +0100 +Subject: [PATCH 03/10] Modified pattern interpolation to ensure only one " is + used around arguments. + +--- + common/cudfSolver.ml | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/common/cudfSolver.ml b/common/cudfSolver.ml +index 6d21dd6..43e1680 100644 +--- a/common/cudfSolver.ml ++++ b/common/cudfSolver.ml +@@ -55,13 +55,15 @@ let rec input_all_lines acc chan = + document, output CUDF universe, user preferences. *) + + (* quote string for the shell, after removing all characters disallowed in criteria *) +-let sanitize s = Printf.sprintf "\"%s\"" (Pcre.substitute ~rex:(Pcre.regexp "[^+()a-z,\"-]") ~subst:(fun _ -> "") s);; ++let quote s = Printf.sprintf "\"%s\"" s;; ++let sanitize s = quote (Pcre.substitute ~rex:(Pcre.regexp "[^+()a-z,\"-]") ~subst:(fun _ -> "") s);; + + let interpolate_solver_pat exec cudf_in cudf_out pref = +- let _, exec = String.replace ~str:exec ~sub:"$in" ~by:cudf_in in +- let _, exec = String.replace ~str:exec ~sub:"$out" ~by:cudf_out in +- let _, exec = String.replace ~str:exec ~sub:"$pref" ~by:(sanitize pref) in +- exec ++ let (|>) f g = fun x -> g(f x) in ++ let dequote s = Pcre.regexp ("\"*"^(Pcre.quote s)^"\"*") in ++ (Pcre.substitute ~rex:(dequote "$in") ~subst: (fun _ -> (quote cudf_in)) |> ++ Pcre.substitute ~rex:(dequote "$out") ~subst: (fun _ -> (quote cudf_out)) |> ++ Pcre.substitute ~rex:(dequote "$pref") ~subst: (fun _ -> (sanitize pref))) exec + ;; + + exception Error of string +-- +1.8.5.3 + diff --git a/patches/dose/patches/0004-All-errors-from-cudfsolver-are-now-exceptions-and-no.patch b/patches/dose/patches/0004-All-errors-from-cudfsolver-are-now-exceptions-and-no.patch new file mode 100644 index 0000000..c658c29 --- /dev/null +++ b/patches/dose/patches/0004-All-errors-from-cudfsolver-are-now-exceptions-and-no.patch @@ -0,0 +1,56 @@ +From 2f396d2bae904472347519f8d797882081ea6b58 Mon Sep 17 00:00:00 2001 +From: Pietro Abate +Date: Tue, 4 Mar 2014 13:06:55 +0100 +Subject: [PATCH 04/10] All errors from cudfsolver are now exceptions and not + fatal errors + +Conflicts: + common/cudfSolver.ml +--- + common/cudfSolver.ml | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/common/cudfSolver.ml b/common/cudfSolver.ml +index 43e1680..41509e1 100644 +--- a/common/cudfSolver.ml ++++ b/common/cudfSolver.ml +@@ -38,13 +38,6 @@ let rmtmpdir path = + ignore (Unix.system (Printf.sprintf "rm -rf %s" path)) + ;; + +-let check_exit_status cmd = function +- |Unix.WEXITED 0 -> () +- |Unix.WEXITED i -> fatal "command '%s' failed with code %d" cmd i +- |Unix.WSIGNALED i -> fatal "command '%s' killed by signal %d" cmd i +- |Unix.WSTOPPED i -> fatal "command '%s' stopped by signal %d" cmd i +-;; +- + let rec input_all_lines acc chan = + try input_all_lines ((input_line chan)::acc) chan + with End_of_file -> acc +@@ -75,6 +68,13 @@ let fatal fmt = + ) fmt + ;; + ++let check_exit_status cmd = function ++ |Unix.WEXITED 0 -> () ++ |Unix.WEXITED i -> fatal "command '%s' failed with code %d" cmd i ++ |Unix.WSIGNALED i -> fatal "command '%s' killed by signal %d" cmd i ++ |Unix.WSTOPPED i -> fatal "command '%s' stopped by signal %d" cmd i ++;; ++ + (** [execsolver] execute an external cudf solver. + exec_pat : execution string + cudf : a cudf document (preamble, universe, request) +@@ -92,8 +92,6 @@ let execsolver exec_pat criteria cudf = + let solver_out = Filename.concat tmpdir "out-cudf" in + let cmd = interpolate_solver_pat exec_pat solver_in solver_out criteria in + +- debug "%s" cmd; +- + let env = Unix.environment () in + let (cin,cout,cerr) = Unix.open_process_full cmd env in + +-- +1.8.5.3 + diff --git a/patches/dose/patches/0005-Fix-upgrade-bug-in-the-check_request-function.patch b/patches/dose/patches/0005-Fix-upgrade-bug-in-the-check_request-function.patch new file mode 100644 index 0000000..81cee63 --- /dev/null +++ b/patches/dose/patches/0005-Fix-upgrade-bug-in-the-check_request-function.patch @@ -0,0 +1,41 @@ +From 5a3daaaddbdc8ca2816bb00164a24a2b74a81b26 Mon Sep 17 00:00:00 2001 +From: Pietro Abate +Date: Thu, 19 Sep 2013 12:14:54 +0200 +Subject: [PATCH 05/10] Fix upgrade bug in the check_request function + +the upgrade request is not correctly encoded and passed to +the edos solver. + +Conflicts: + cudf +--- + algo/depsolver.ml | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/algo/depsolver.ml b/algo/depsolver.ml +index 869d153..6c5092a 100644 +--- a/algo/depsolver.ml ++++ b/algo/depsolver.ml +@@ -337,7 +337,18 @@ let check_request ?cmd ?criteria ?(explain=false) (pre,universe,request) = + else acc + ) [] universe + in +- let l = request.Cudf.install @ request.Cudf.upgrade in ++ let il = request.Cudf.install in ++ let ul = ++ List.filter_map (function (name,None) -> ++ match Cudf.get_installed universe name with ++ |[] -> Some((name,None)) ++ |[p] -> Some(name,Some(`Geq,p.Cudf.version)) ++ |pl -> ++ let p = List.hd(List.sort ~cmp:Cudf.(>%) pl) in ++ Some(name,Some(`Geq,p.Cudf.version)) ++ ) request.Cudf.upgrade ++ in ++ let l = il @ ul in + debug "request consistency (keep %d) (install %d) (upgrade %d) (remove %d) (# %d)" + (List.length k) (List.length request.Cudf.install) + (List.length request.Cudf.upgrade) +-- +1.8.5.3 + diff --git a/patches/dose/patches/0006-Fix-compilation-problems-with-ocaml-4.0.1.patch b/patches/dose/patches/0006-Fix-compilation-problems-with-ocaml-4.0.1.patch new file mode 100644 index 0000000..d149620 --- /dev/null +++ b/patches/dose/patches/0006-Fix-compilation-problems-with-ocaml-4.0.1.patch @@ -0,0 +1,170 @@ +From 4a789f7a785a9b5134e10263dd0f9cd0a85d431d Mon Sep 17 00:00:00 2001 +From: Pietro Abate +Date: Fri, 6 Dec 2013 13:46:52 +0100 +Subject: [PATCH 06/10] Fix compilation problems with ocaml 4.0.1 + +Conflicts: + doc/manpages/ceve.pod +--- + _tags.in | 12 +++---- + doc/manpages/ceve.pod | 95 +++++++++++++++++++++++++++++++++++---------------- + 2 files changed, 72 insertions(+), 35 deletions(-) + +diff --git a/_tags.in b/_tags.in +index 8937afa..643209f 100644 +--- a/_tags.in ++++ b/_tags.in +@@ -31,12 +31,12 @@ true: -traverse + : @USE_RPM@ + : @LINK_RPM@ + +-: for-pack(Common) +-: for-pack(Algo) +-: for-pack(Debian) +-: for-pack(Eclipse) +-: for-pack(Csw) +-: for-pack(Rpm) ++ and not : for-pack(Common) ++ and not : for-pack(Algo) ++ and not : for-pack(Debian) ++ and not : for-pack(Eclipse) ++ and not : for-pack(Csw) ++ and not : for-pack(Rpm) + + <{applications,experimental}/*>: use_common, use_debian, use_eclipse, use_csw + <{applications,experimental}/*>: package(extlib), package(pcre), package(unix) +diff --git a/doc/manpages/ceve.pod b/doc/manpages/ceve.pod +index a014345..b0fba34 100644 +--- a/doc/manpages/ceve.pod ++++ b/doc/manpages/ceve.pod +@@ -53,11 +53,50 @@ In combination with the B<-e>, B<-c> or B<-r> options, this + specifies the maximum depth for the transitive closure. + =item B<-t >I + +-Specifies +-the output format to use. Possible values are B for a graph output in +-Dot/GraphViz format, B for an output in CNF format, B for an output +-in the DIMACS format for CNF formulae, and B for a pretty-print output +-in an RFC 822-like format. This option can also be specified as --outtype=I.I<> ++Specifies the output format to use. Possible values are B for a graph ++output in Dot/GraphViz format, B for an output in CNF format, B ++for an output in the DIMACS format for CNF formulae, and B for a ++pretty-print output in an RFC 822-like format. ++ ++=item B<-t >I ++ ++Select the input type. ++ ++=item B<--request >I ++ ++Specifies an installation request of the form "B I" or ++"B I" or "B I" where I is a list of (real) ++packages possibly associated with a constraint. Ex.: bash (< 2.0), exim (= ++3.1-debian1). This option can be repeated to specify install, remove and ++upgrade actions. ++ ++Examples: ++ ++=item --request "install: bash (< 2.0), exim (= 3.1-debian1)" --request "upgrade: apt-cudf" ++ ++=item B<-G >I ++ ++Specifies the graph type format to compute. This option must be used together ++with the option B<-T >I. Possible values are: ++ ++=item . ++ ++B for the syntactic graph where disjunctions nodes and conflicts are ++explicitely added to the graph. ++ ++=item . ++ ++B for the package graph where all dependencies are threated uniformely and ++conflicts are not added to the graph. ++ ++=item . ++ ++B the strong dependency graph. ++ ++=item . ++ ++B the conjunctive graph where only conjunctive dependencies are ++considered. + + =item B<-o >I + +@@ -65,49 +104,47 @@ Instead of stdout, send output to the file I. This option + can also be specified as --outfile=I.I<> + =item I + +-This is a URL specifying +-both the input format and the file to get the input from. Possible schemes +-are: +-=item * ++This is a URL specifying both the input format and the file to get the input ++from. Possible schemes are: ++ ++=item . + + B for cudf files + =item * + +-B for Debian package files (possibly compressed +-with L or L, depending on compile-time options for dose3) +-=item * ++=item . + +-B +-for Debian package files read from standard input +-=item * ++B for Debian package files (possibly compressed with L or ++L, depending on compile-time options for dose3) + +-B for Eclipse (p2) +-package files +-=item * ++=item . + +-B for PostgreSQL databasess +-=item * ++B for Debian package files read from standard input + +-B for sqlite databases ++=item . + +-=item * ++B for apt-get External Dependency Solver Protocol ++ ++=item . ++ ++B for Eclipse (p2) package files ++ ++=item . + + B for RPM hdlists +-=item * ++ ++=item . + + B for urpmi synthesis hdlists + Some examples + of URLs: + +-=item * ++=item . + + deb://Packages.gz (the Debian file packages.gz in the current directory) + +-=item * ++=item . + + cudf:///home/examples/cudf/test.cudf (the CUDF file /home/examples/cudf/test.cudf) + +-=item * +- +-psql://user@db.mancoosi.org:723/packages (the database I on host I +-on port 723, accessed as user I) ++=back +-- +1.8.5.3 + diff --git a/patches/dose/patches/0007-Fixed-code-for-computing-upgrade-constraints-handle-.patch b/patches/dose/patches/0007-Fixed-code-for-computing-upgrade-constraints-handle-.patch new file mode 100644 index 0000000..94bae8b --- /dev/null +++ b/patches/dose/patches/0007-Fixed-code-for-computing-upgrade-constraints-handle-.patch @@ -0,0 +1,59 @@ +From 5241aed77b87d34555ef96f0307aa323b7b60f6c Mon Sep 17 00:00:00 2001 +From: Roberto Di Cosmo +Date: Wed, 12 Mar 2014 17:25:06 +0100 +Subject: [PATCH 07/10] Fixed code for computing upgrade constraints: handle + user constraints properly. + +--- + algo/depsolver.ml | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +diff --git a/algo/depsolver.ml b/algo/depsolver.ml +index 6c5092a..71189a5 100644 +--- a/algo/depsolver.ml ++++ b/algo/depsolver.ml +@@ -322,8 +322,18 @@ type solver_result = + |Unsat of Diagnostic.diagnosis option + |Error of string + ++ ++(* add a version constraint to ensure name is upgraded *) ++let upgrade_constr universe name = ++ match Cudf.get_installed universe name with ++ | [] -> name,None ++ |[p] -> name,Some(`Geq,p.Cudf.version) ++ | pl -> let p = List.hd(List.sort ~cmp:Cudf.(>%) pl) in ++ name,Some(`Geq,p.Cudf.version) ++ + (** check if a cudf request is satisfiable. we do not care about + * universe consistency . We try to install a dummy package *) ++ + let check_request ?cmd ?criteria ?(explain=false) (pre,universe,request) = + let intSolver universe request = + let deps = +@@ -338,17 +348,11 @@ let check_request ?cmd ?criteria ?(explain=false) (pre,universe,request) = + ) [] universe + in + let il = request.Cudf.install in +- let ul = +- List.filter_map (function (name,None) -> +- match Cudf.get_installed universe name with +- |[] -> Some((name,None)) +- |[p] -> Some(name,Some(`Geq,p.Cudf.version)) +- |pl -> +- let p = List.hd(List.sort ~cmp:Cudf.(>%) pl) in +- Some(name,Some(`Geq,p.Cudf.version)) +- ) request.Cudf.upgrade +- in +- let l = il @ ul in ++ ++ (* we preserve the user defined constraints, while adding the upgrade constraint *) ++ let ulc = List.filter (function (_,Some _) -> true | _ -> false) request.Cudf.upgrade in ++ let ulnc = List.map (fun (name,_) -> upgrade_constr universe name) request.Cudf.upgrade in ++ let l = il @ ulc @ ulnc in + debug "request consistency (keep %d) (install %d) (upgrade %d) (remove %d) (# %d)" + (List.length k) (List.length request.Cudf.install) + (List.length request.Cudf.upgrade) +-- +1.8.5.3 + diff --git a/patches/dose/patches/0008-Use-re.pcre-instead-of-pcre.patch b/patches/dose/patches/0008-Use-re.pcre-instead-of-pcre.patch new file mode 100644 index 0000000..d2c8917 --- /dev/null +++ b/patches/dose/patches/0008-Use-re.pcre-instead-of-pcre.patch @@ -0,0 +1,295 @@ +From 4fa17051073d73319bd01394984e159fb41bbb8d Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 7 Mar 2014 10:22:39 +0100 +Subject: [PATCH 7/7] Use re.pcre instead of pcre-ocaml + +(original patch on OPAM by samoht) +--- + common/cudfAdd.ml | 8 ++++---- + common/cudfSolver.ml | 10 +++++----- + common/extBenchmark.ml | 6 +++--- + common/tests.ml | 2 +- + deb/apt.ml | 42 +++++++++++++++++++++--------------------- + deb/edsp.ml | 2 +- + deb/version.ml | 4 ++-- + eclipse/version.ml | 4 ++-- + opencsw/packages.ml | 2 +- + opencsw/version.ml | 4 ++-- + rpm/packages.ml | 2 +- + 11 files changed, 43 insertions(+), 43 deletions(-) + +diff --git a/common/cudfAdd.ml b/common/cudfAdd.ml +index dbd38dd..a3f8049 100644 +--- a/common/cudfAdd.ml ++++ b/common/cudfAdd.ml +@@ -109,18 +109,18 @@ init_hashtables enc_ht dec_ht;; + + (* encode *) + let encode_single s = EncodingHashtable.find enc_ht s;; +-let not_allowed_regexp = Pcre.regexp "[^a-zA-Z0-9@/+().-]";; ++let not_allowed_regexp = Re_pcre.regexp "[^a-zA-Z0-9@/+().-]";; + + let encode s = +- Pcre.substitute ~rex:not_allowed_regexp ~subst:encode_single s ++ Re_pcre.substitute ~rex:not_allowed_regexp ~subst:encode_single s + ;; + + (* decode *) + let decode_single s = DecodingHashtable.find dec_ht s;; +-let encoded_char_regexp = Pcre.regexp "%[0-9a-f][0-9a-f]";; ++let encoded_char_regexp = Re_pcre.regexp "%[0-9a-f][0-9a-f]";; + + let decode s = +- Pcre.substitute ~rex:encoded_char_regexp ~subst:decode_single s ++ Re_pcre.substitute ~rex:encoded_char_regexp ~subst:decode_single s + ;; + + (* formatting *) +diff --git a/common/cudfSolver.ml b/common/cudfSolver.ml +index 41509e1..0f6b43f 100644 +--- a/common/cudfSolver.ml ++++ b/common/cudfSolver.ml +@@ -49,14 +49,14 @@ let rec input_all_lines acc chan = + + (* quote string for the shell, after removing all characters disallowed in criteria *) + let quote s = Printf.sprintf "\"%s\"" s;; +-let sanitize s = quote (Pcre.substitute ~rex:(Pcre.regexp "[^+()a-z,\"-]") ~subst:(fun _ -> "") s);; ++let sanitize s = quote (Re_pcre.substitute ~rex:(Re_pcre.regexp "[^+()a-z,\"-]") ~subst:(fun _ -> "") s);; + + let interpolate_solver_pat exec cudf_in cudf_out pref = + let (|>) f g = fun x -> g(f x) in +- let dequote s = Pcre.regexp ("\"*"^(Pcre.quote s)^"\"*") in +- (Pcre.substitute ~rex:(dequote "$in") ~subst: (fun _ -> (quote cudf_in)) |> +- Pcre.substitute ~rex:(dequote "$out") ~subst: (fun _ -> (quote cudf_out)) |> +- Pcre.substitute ~rex:(dequote "$pref") ~subst: (fun _ -> (sanitize pref))) exec ++ let dequote s = Re_pcre.regexp ("\"*"^(Re_pcre.quote s)^"\"*") in ++ (Re_pcre.substitute ~rex:(dequote "$in") ~subst: (fun _ -> (quote cudf_in)) |> ++ Re_pcre.substitute ~rex:(dequote "$out") ~subst: (fun _ -> (quote cudf_out)) |> ++ Re_pcre.substitute ~rex:(dequote "$pref") ~subst: (fun _ -> (sanitize pref))) exec + ;; + + exception Error of string +diff --git a/common/extBenchmark.ml b/common/extBenchmark.ml +index 839b12e..333755f 100644 +--- a/common/extBenchmark.ml ++++ b/common/extBenchmark.ml +@@ -108,10 +108,10 @@ let parse_sample s = + (* "parse_date s" extracts the date from a date-string of a specific format. + e.g. parse_date "date 12345" = 12345 *) + let parse_date s = +- let date_regexp = Pcre.regexp "^date ([0-9]+)$" in ++ let date_regexp = Re_pcre.regexp "^date ([0-9]+)$" in + try +- let substrings = Pcre.exec ~rex:date_regexp s in +- float_of_string(Pcre.get_substring substrings 1) ++ let substrings = Re_pcre.exec ~rex:date_regexp s in ++ float_of_string(Re_pcre.get_substring substrings 1) + with Not_found -> failwith (Printf.sprintf "invalid date %s" s) + + let parse_benchmark filename = +diff --git a/common/tests.ml b/common/tests.ml +index 21869e9..e29f9d4 100644 +--- a/common/tests.ml ++++ b/common/tests.ml +@@ -140,7 +140,7 @@ let test_lookup_packages = + let (test_encode, test_decode) = + (* Some useful very long strings for testing encoding and decoding. *) + let a_lot_of = (* a huge number *) +- (Pcre.config_match_limit + 111) ++ (Re_pcre.config_match_limit + 111) + in + let a_lot_of_a = String.make a_lot_of 'a' + (* This test takes too much time... +diff --git a/deb/apt.ml b/deb/apt.ml +index 6b8a2f2..599daa8 100644 +--- a/deb/apt.ml ++++ b/deb/apt.ml +@@ -17,7 +17,7 @@ open Common + + include Util.Logging(struct let label = __FILE__ end) ;; + +-let blank_regexp = Pcre.regexp "[ \t]+" ;; ++let blank_regexp = Re_pcre.regexp "[ \t]+" ;; + + (* parse the output of "dpkg -l" *) + let parse_inst ch = +@@ -25,7 +25,7 @@ let parse_inst ch = + try + while true do + let s = (input_line ch) in +- match Pcre.split ~rex:blank_regexp s with ++ match Re_pcre.split ~rex:blank_regexp s with + |status::name::version::_ when status = "ii"-> Hashtbl.add h (name,version) () + |_ -> () + done ; +@@ -48,7 +48,7 @@ let parse_inst_from_file file = + + (* parse the a popcon file *) + let parse_popcon s = +- match Pcre.split ~rex:blank_regexp s with ++ match Re_pcre.split ~rex:blank_regexp s with + |rank::name::inst::_ -> (int_of_string rank,name,int_of_string inst) + |_ -> fatal "Parse error %s\n" s + +@@ -107,7 +107,7 @@ let parse_request_apt s = + let reqlist = ref [] in + let anon s = reqlist := s :: !reqlist in + begin +- begin try Arg.parse_argv ~current:(ref 0) (Array.of_list (Pcre.split ~rex:blank_regexp s)) options anon "" ++ begin try Arg.parse_argv ~current:(ref 0) (Array.of_list (Re_pcre.split ~rex:blank_regexp s)) options anon "" + with Arg.Bad s -> fatal "%s" s end ; + match List.rev !reqlist with + |"install" :: tl -> Install(List.map (parse_pkg_req !suite) tl) +@@ -140,7 +140,7 @@ let parse_request_aptitude s = + let reqlist = ref [] in + let anon s = reqlist := s :: !reqlist in + begin +- begin try Arg.parse_argv ~current:(ref 0) (Array.of_list (Pcre.split ~rex:blank_regexp s)) options anon "" ++ begin try Arg.parse_argv ~current:(ref 0) (Array.of_list (Re_pcre.split ~rex:blank_regexp s)) options anon "" + with Arg.Bad s -> fatal "%s" s end ; + match List.rev !reqlist with + |"install" :: tl -> Install(List.map (parse_pkg_req !suite) tl) +@@ -174,36 +174,36 @@ module Pref = struct + + end + +-let comma_regexp = Pcre.regexp "[ \t]*,[ \t]*" ;; +-let eq_regexp = Pcre.regexp "[ \t]*=[ \t]*" ;; +-let di_regexp = Pcre.regexp "[0-9.]+" ;; +-let al_regexp = Pcre.regexp "[a-zA-Z]+" ;; ++let comma_regexp = Re_pcre.regexp "[ \t]*,[ \t]*" ;; ++let eq_regexp = Re_pcre.regexp "[ \t]*=[ \t]*" ;; ++let di_regexp = Re_pcre.regexp "[0-9.]+" ;; ++let al_regexp = Re_pcre.regexp "[a-zA-Z]+" ;; + + let parse_pref_labels s = + List.map (fun s' -> +- match Pcre.split ~rex:eq_regexp s' with +- |[v] when (Pcre.pmatch ~rex:di_regexp v) -> ("v",v) +- |[v] when (Pcre.pmatch ~rex:al_regexp v) -> ("a",v) ++ match Re_pcre.split ~rex:eq_regexp s' with ++ |[v] when (Re_pcre.pmatch ~rex:di_regexp v) -> ("v",v) ++ |[v] when (Re_pcre.pmatch ~rex:al_regexp v) -> ("a",v) + |[l;v] -> (l,v) + |_ -> fatal "To many '=' in label %s" s +- ) (Pcre.split ~rex:comma_regexp s) ++ ) (Re_pcre.split ~rex:comma_regexp s) + +-let general_regexp = Pcre.regexp "^[ \t]*[*][ \t]*$" ;; ++let general_regexp = Re_pcre.regexp "^[ \t]*[*][ \t]*$" ;; + + let parse_pref_package (_,s) = +- if Pcre.pmatch ~rex:general_regexp s then Pref.Star ++ if Re_pcre.pmatch ~rex:general_regexp s then Pref.Star + else Pref.Package (Packages.parse_name (Format822.dummy_loc,s)) + +-let pin_regexp = Pcre.regexp "^([A-Za-z]+)[ \t]+(.*)$" ;; ++let pin_regexp = Re_pcre.regexp "^([A-Za-z]+)[ \t]+(.*)$" ;; + + let parse_pin (_,s) = + try +- let substrings = Pcre.exec ~rex:pin_regexp s ++ let substrings = Re_pcre.exec ~rex:pin_regexp s + in +- match Pcre.get_substring substrings 1 with +- |"release" -> Pref.Release (parse_pref_labels (Pcre.get_substring substrings 2)) +- |"version" -> Pref.Version (Pcre.get_substring substrings 2) +- |"origin" -> Pref.Origin (Pcre.get_substring substrings 2) ++ match Re_pcre.get_substring substrings 1 with ++ |"release" -> Pref.Release (parse_pref_labels (Re_pcre.get_substring substrings 2)) ++ |"version" -> Pref.Version (Re_pcre.get_substring substrings 2) ++ |"origin" -> Pref.Origin (Re_pcre.get_substring substrings 2) + |s -> fatal "Unknown pin type %s" s + with Not_found -> fatal "Unknown pin format %s" s + +diff --git a/deb/edsp.ml b/deb/edsp.ml +index bc656a6..cbc4e7e 100644 +--- a/deb/edsp.ml ++++ b/deb/edsp.ml +@@ -62,7 +62,7 @@ let parse_string (_,s) = s + let parse_int_s (_,s) = string_of_int(int_of_string s) + let parse_req (loc,s) = + let aux = Packages.lexbuf_wrapper Packages_parser.vpkg_top in +- let l = Pcre.split ~rex:Apt.blank_regexp s in ++ let l = Re_pcre.split ~rex:Apt.blank_regexp s in + List.map (fun s -> aux (loc,s)) l + + let parse_request_stanza par = +diff --git a/deb/version.ml b/deb/version.ml +index d85207b..07aa45b 100644 +--- a/deb/version.ml ++++ b/deb/version.ml +@@ -180,10 +180,10 @@ type version_analysis = + (* epoch,upstream,revision,binnmu *) + ;; + +-let binnmu_regexp = Pcre.regexp "^(.*)\\+(b[\\d]+)$" ;; ++let binnmu_regexp = Re_pcre.regexp "^(.*)\\+(b[\\d]+)$" ;; + let extract_binnmu v = + try +- let subs = Pcre.extract ~rex:binnmu_regexp v ++ let subs = Re_pcre.extract ~rex:binnmu_regexp v + in (subs.(1),subs.(2)) + with Not_found -> (v,"") + ;; +diff --git a/eclipse/version.ml b/eclipse/version.ml +index 984f386..779fe8d 100644 +--- a/eclipse/version.ml ++++ b/eclipse/version.ml +@@ -23,9 +23,9 @@ open Common + + include Util.Logging(struct let label = __FILE__ end) ;; + +-let rex = Pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; ++let rex = Re_pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; + let parse_version s = +- if not(Pcre.pmatch ~rex s) then ++ if not(Re_pcre.pmatch ~rex s) then + warning "bad version '%s'" s; + s + ;; +diff --git a/opencsw/packages.ml b/opencsw/packages.ml +index b626e5f..99b05de 100644 +--- a/opencsw/packages.ml ++++ b/opencsw/packages.ml +@@ -86,7 +86,7 @@ let parse_paragraph pkg ch = + Some + { pkg with + name = a.(2); +- version = List.hd(Pcre.split ~rex:(Pcre.regexp ",") a.(1)); ++ version = List.hd(Re_pcre.split ~rex:(Re_pcre.regexp ",") a.(1)); + depends = catcherr a 6; + conflicts = catcherr a 8 + } +diff --git a/opencsw/version.ml b/opencsw/version.ml +index 984f386..779fe8d 100644 +--- a/opencsw/version.ml ++++ b/opencsw/version.ml +@@ -23,9 +23,9 @@ open Common + + include Util.Logging(struct let label = __FILE__ end) ;; + +-let rex = Pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; ++let rex = Re_pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; + let parse_version s = +- if not(Pcre.pmatch ~rex s) then ++ if not(Re_pcre.pmatch ~rex s) then + warning "bad version '%s'" s; + s + ;; +diff --git a/rpm/packages.ml b/rpm/packages.ml +index 7b89c0c..6e0a9cb 100644 +--- a/rpm/packages.ml ++++ b/rpm/packages.ml +@@ -156,7 +156,7 @@ module Synthesis = struct + with IO.No_more_input -> raise Eof | End_of_file -> assert false + in + try +- match List.tl (Pcre.split ~rex:(Pcre.regexp "@") line) with ++ match List.tl (Re_pcre.split ~rex:(Re_pcre.regexp "@") line) with + |"provides"::l -> parse_paragraph {pkg with provides = parse_deps l} ch + |"requires"::l -> parse_paragraph {pkg with depends = parse_deps l} ch + |"obsoletes"::l -> parse_paragraph {pkg with obsoletes = parse_deps l} ch +-- +1.8.5.3 + diff --git a/patches/dose/patches/0009-Hardcode-__FILE__-macros.patch b/patches/dose/patches/0009-Hardcode-__FILE__-macros.patch new file mode 100644 index 0000000..a3f1fcd --- /dev/null +++ b/patches/dose/patches/0009-Hardcode-__FILE__-macros.patch @@ -0,0 +1,617 @@ +From 495ba5cb2699a1ce3b6aac9d3df1fff98293ed6f Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 14 Mar 2014 17:52:41 +0100 +Subject: [PATCH 09/10] Hardcode __FILE__ macros + +Needed to get rid of the camlp4 dependency. + +Done using: +``` +for f in $(git ls-files \*.ml \*.mli); do echo $f; sed -i 's%__FILE__%"'$f'"%g' $f; git add $f; done +``` +experimental/ excluded because it's not in the release tarball + +Not sure if we'd rather add this in the build scripts of opam and of the opam package ? +--- + algo/defaultgraphs.ml | 2 +- + algo/depsolver.ml | 2 +- + algo/depsolver_int.ml | 2 +- + algo/diagnostic.ml | 2 +- + algo/dominators.ml | 2 +- + algo/flatten.ml | 2 +- + algo/statistics.ml | 2 +- + algo/strongconflicts.ml | 2 +- + algo/strongconflicts_int.ml | 2 +- + algo/strongdeps.ml | 2 +- + algo/strongdeps_int.ml | 2 +- + applications/ceve.ml | 2 +- + applications/challenged.ml | 4 ++-- + applications/deb-buildcheck.ml | 2 +- + applications/distcheck.ml | 2 +- + applications/dominators-graph.ml | 2 +- + applications/outdated.ml | 4 ++-- + applications/smallworld.ml | 2 +- + applications/strong-deps.ml | 2 +- + common/cudfAdd.ml | 2 +- + common/cudfSolver.ml | 2 +- + common/edosSolver.ml | 2 +- + common/input.ml | 2 +- + common/url.ml | 2 +- + common/util.ml | 2 +- + common/util.mli | 2 +- + deb/apt.ml | 2 +- + deb/debcudf.ml | 2 +- + deb/debutil.ml | 2 +- + deb/edsp.ml | 2 +- + deb/format822.ml | 2 +- + deb/packages.ml | 2 +- + deb/sources.ml | 2 +- + doseparse/boilerplate.ml | 2 +- + eclipse/packages.ml | 2 +- + eclipse/version.ml | 2 +- + opencsw/packages.ml | 4 ++-- + opencsw/version.ml | 2 +- + rpm/hdlists.ml | 2 +- + rpm/packages.ml | 2 +- + rpm/rpmcudf.ml | 2 +- + 41 files changed, 44 insertions(+), 44 deletions(-) + +diff --git a/algo/defaultgraphs.ml b/algo/defaultgraphs.ml +index c6a9fb5..69b0c85 100644 +--- a/algo/defaultgraphs.ml ++++ b/algo/defaultgraphs.ml +@@ -15,7 +15,7 @@ + open Graph + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/defaultgraphs.ml" end) ;; + + let tr_timer = Util.Timer.create "Defaultgraph.GraphOper.transitive_reduction" + let trbar = Util.Progress.create "Defaultgraph.GraphOper.transitive_reduction" +diff --git a/algo/depsolver.ml b/algo/depsolver.ml +index 71189a5..9597ae8 100644 +--- a/algo/depsolver.ml ++++ b/algo/depsolver.ml +@@ -14,7 +14,7 @@ open ExtLib + open Common + open CudfAdd + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/depsolver.ml" end) ;; + + type solver = Depsolver_int.solver + +diff --git a/algo/depsolver_int.ml b/algo/depsolver_int.ml +index 84451e6..554ad97 100644 +--- a/algo/depsolver_int.ml ++++ b/algo/depsolver_int.ml +@@ -32,7 +32,7 @@ open Common + let progressbar_init = Util.Progress.create "Depsolver_int.init_solver" + let progressbar_univcheck = Util.Progress.create "Depsolver_int.univcheck" + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/depsolver_int.ml" end) ;; + + module R = struct type reason = Diagnostic_int.reason end + module S = EdosSolver.M(R) +diff --git a/algo/diagnostic.ml b/algo/diagnostic.ml +index dbb8584..80c3dbe 100644 +--- a/algo/diagnostic.ml ++++ b/algo/diagnostic.ml +@@ -14,7 +14,7 @@ module OcamlHash = Hashtbl + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/diagnostic.ml" end) ;; + + (** One un-installability reason for a package *) + type reason = +diff --git a/algo/dominators.ml b/algo/dominators.ml +index d24ae09..eb484f3 100644 +--- a/algo/dominators.ml ++++ b/algo/dominators.ml +@@ -23,7 +23,7 @@ let crtimer = Util.Timer.create "Algo.Dominators.cycle_reduction" + let sdtrtimer = Util.Timer.create "Algo.Dominators.sd_transitive_reduction" + let domtrtimer = Util.Timer.create "Algo.Dominators.dom_transitive_reduction" + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/dominators.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.GraphOper(G) +diff --git a/algo/flatten.ml b/algo/flatten.ml +index bd99528..7640eee 100644 +--- a/algo/flatten.ml ++++ b/algo/flatten.ml +@@ -6,7 +6,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/flatten.ml" end) ;; + + let print_list fmt pr sep l = + match l with +diff --git a/algo/statistics.ml b/algo/statistics.ml +index 1962dfc..54b63e7 100644 +--- a/algo/statistics.ml ++++ b/algo/statistics.ml +@@ -22,7 +22,7 @@ open Graph + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/statistics.ml" end) ;; + + module Make (G: Sig.I ) = struct + module VS = Set.Make (G.V) +diff --git a/algo/strongconflicts.ml b/algo/strongconflicts.ml +index 71226e5..471bd3e 100644 +--- a/algo/strongconflicts.ml ++++ b/algo/strongconflicts.ml +@@ -14,7 +14,7 @@ open Common + open CudfAdd + open Defaultgraphs + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongconflicts.ml" end) ;; + + module ICG = Strongconflicts_int.CG + +diff --git a/algo/strongconflicts_int.ml b/algo/strongconflicts_int.ml +index 8cb910d..36023d6 100644 +--- a/algo/strongconflicts_int.ml ++++ b/algo/strongconflicts_int.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongconflicts_int.ml" end) ;; + + module SG = Defaultgraphs.IntPkgGraph.G + module PkgV = Defaultgraphs.IntPkgGraph.PkgV +diff --git a/algo/strongdeps.ml b/algo/strongdeps.ml +index d8f1772..e8807b4 100644 +--- a/algo/strongdeps.ml ++++ b/algo/strongdeps.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongdeps.ml" end) ;; + + (** [strongdeps u l] build the strong dependency graph of all packages in + [l] wrt the universe [u] *) +diff --git a/algo/strongdeps_int.ml b/algo/strongdeps_int.ml +index 965574d..7aa2599 100644 +--- a/algo/strongdeps_int.ml ++++ b/algo/strongdeps_int.ml +@@ -20,7 +20,7 @@ let conjbar = Util.Progress.create "Strongdeps_int.conj" + let strongtimer = Util.Timer.create "Strongdeps_int.strong" + let conjtimer = Util.Timer.create "Strongdeps_int.conjdep" + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongdeps_int.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.PackageGraph.O +diff --git a/applications/ceve.ml b/applications/ceve.ml +index cdf0fb4..5cd4ee7 100644 +--- a/applications/ceve.ml ++++ b/applications/ceve.ml +@@ -15,7 +15,7 @@ open ExtLib + open Common + open Algo + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/ceve.ml" end) ;; + + IFDEF HASOCAMLGRAPH THEN + module DGraph = Defaultgraphs.SyntacticDependencyGraph +diff --git a/applications/challenged.ml b/applications/challenged.ml +index bd99b83..41236d1 100644 +--- a/applications/challenged.ml ++++ b/applications/challenged.ml +@@ -19,7 +19,7 @@ open Algo + module Boilerplate = BoilerplateNoRpm + + let predbar = Util.Progress.create "challenged" ;; +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/challenged.ml" end) ;; + + module Options = struct + open OptParse +@@ -328,5 +328,5 @@ let main () = + + Boilerplate.if_application + ~alternatives:["dose-challenged";"dose3-challenged";"edos-challenged";"deb-challenged"] +-__FILE__ main ;; ++"applications/challenged.ml" main ;; + +diff --git a/applications/deb-buildcheck.ml b/applications/deb-buildcheck.ml +index 18bf507..53a3693 100644 +--- a/applications/deb-buildcheck.ml ++++ b/applications/deb-buildcheck.ml +@@ -50,7 +50,7 @@ module Options = struct + + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/deb-buildcheck.ml" end) ;; + + let timer = Util.Timer.create "Solver" + +diff --git a/applications/distcheck.ml b/applications/distcheck.ml +index 768c5e0..5b327d0 100644 +--- a/applications/distcheck.ml ++++ b/applications/distcheck.ml +@@ -67,7 +67,7 @@ module Options = struct + + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/distcheck.ml" end) ;; + + let timer = Util.Timer.create "Solver" + +diff --git a/applications/dominators-graph.ml b/applications/dominators-graph.ml +index c5afe5a..30bc083 100644 +--- a/applications/dominators-graph.ml ++++ b/applications/dominators-graph.ml +@@ -37,7 +37,7 @@ end + + (* ----------------------------------- *) + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/dominators-graph.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.PackageGraph.O +diff --git a/applications/outdated.ml b/applications/outdated.ml +index 583f8be..910480f 100644 +--- a/applications/outdated.ml ++++ b/applications/outdated.ml +@@ -19,7 +19,7 @@ open Common + open Algo + module Boilerplate=BoilerplateNoRpm + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/outdated.ml" end) ;; + + module Options = struct + open OptParse +@@ -313,5 +313,5 @@ let main () = + + Boilerplate.if_application + ~alternatives:["dose-outdated";"dose3-outdated";"edos-outdated";"deb-outdated"] +-__FILE__ main ;; ++"applications/outdated.ml" main ;; + +diff --git a/applications/smallworld.ml b/applications/smallworld.ml +index f772ebb..4405371 100644 +--- a/applications/smallworld.ml ++++ b/applications/smallworld.ml +@@ -50,7 +50,7 @@ module Options = struct + add options ~long_name:"trim" ~help:"Consider only installable packages" trim; + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/smallworld.ml" end) ;; + + (**********************************) + +diff --git a/applications/strong-deps.ml b/applications/strong-deps.ml +index be62018..ed36391 100644 +--- a/applications/strong-deps.ml ++++ b/applications/strong-deps.ml +@@ -34,7 +34,7 @@ module Options = struct + include Boilerplate.MakeDistribOptions(struct let options = options end);; + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/strong-deps.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.GraphOper(G) +diff --git a/common/cudfAdd.ml b/common/cudfAdd.ml +index c47dca6..da29a86 100644 +--- a/common/cudfAdd.ml ++++ b/common/cudfAdd.ml +@@ -20,7 +20,7 @@ module Pcre = Re_pcre + open ExtLib + + (* Include internal debugging functions for this module (debug, info, warning, fatal). *) +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/cudfAdd.ml" end) ;; + + let equal = Cudf.(=%) + let compare = Cudf.(<%) +diff --git a/common/cudfSolver.ml b/common/cudfSolver.ml +index a40f4b6..1531dd0 100644 +--- a/common/cudfSolver.ml ++++ b/common/cudfSolver.ml +@@ -15,7 +15,7 @@ + module Pcre = Re_pcre + + open ExtLib +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/cudfSolver.ml" end) ;; + + let check_fail file = + let ic = open_in file in +diff --git a/common/edosSolver.ml b/common/edosSolver.ml +index c55a26a..8200a59 100644 +--- a/common/edosSolver.ml ++++ b/common/edosSolver.ml +@@ -43,7 +43,7 @@ module type T = sig + val stats : state -> unit + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/edosSolver.ml" end) ;; + + module IntHash = + Hashtbl.Make (struct +diff --git a/common/input.ml b/common/input.ml +index 9f82211..c6af980 100644 +--- a/common/input.ml ++++ b/common/input.ml +@@ -12,7 +12,7 @@ + + open ExtLib + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/input.ml" end) ;; + + IFDEF HASZIP THEN + let gzip_open_file file = +diff --git a/common/url.ml b/common/url.ml +index ce37920..c8ac767 100644 +--- a/common/url.ml ++++ b/common/url.ml +@@ -12,7 +12,7 @@ + + exception Invalid_url of string;; + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/url.ml" end) ;; + + (***********************************************************************) + (* Input schemes *******************************************************) +diff --git a/common/util.ml b/common/util.ml +index 80b68d2..32ea495 100644 +--- a/common/util.ml ++++ b/common/util.ml +@@ -143,7 +143,7 @@ module Logging(X : sig val label : string end) = struct + Printf.kprintf (fun s -> Printf.eprintf "%s\n %s\n%!" l s; exit (64)) fmt + end + +-include Logging(struct let label = __FILE__ end) ;; ++include Logging(struct let label = "common/util.ml" end) ;; + + (** Printf bars are printed immediately on stderr. + * they can be enabled or disabled (default) *) +diff --git a/common/util.mli b/common/util.mli +index 836ad99..ae5ffb3 100644 +--- a/common/util.mli ++++ b/common/util.mli +@@ -81,7 +81,7 @@ module Info : Messages + *) + + (* +- include Util.Logging(struct let label = __FILE__ end) ;; ++ include Util.Logging(struct let label = "common/util.mli" end) ;; + *) + module Logging : + functor (X : sig val label : string end) -> +diff --git a/deb/apt.ml b/deb/apt.ml +index 47821af..cc8c2f6 100644 +--- a/deb/apt.ml ++++ b/deb/apt.ml +@@ -17,7 +17,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/apt.ml" end) ;; + + let blank_regexp = Pcre.regexp "[ \t]+" ;; + +diff --git a/deb/debcudf.ml b/deb/debcudf.ml +index 096a03b..e04c805 100644 +--- a/deb/debcudf.ml ++++ b/deb/debcudf.ml +@@ -18,7 +18,7 @@ open ExtLib + open Common + open Packages + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/debcudf.ml" end) ;; + module SMap = Map.Make (String) + + type tables = { +diff --git a/deb/debutil.ml b/deb/debutil.ml +index 0cf9e67..5f70eda 100644 +--- a/deb/debutil.ml ++++ b/deb/debutil.ml +@@ -13,7 +13,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/debutil.ml" end) ;; + + let get_source pkg = + match pkg.Packages.source with +diff --git a/deb/edsp.ml b/deb/edsp.ml +index 553afcf..f01fc0f 100644 +--- a/deb/edsp.ml ++++ b/deb/edsp.ml +@@ -17,7 +17,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/edsp.ml" end) ;; + + type request = { + request : string; +diff --git a/deb/format822.ml b/deb/format822.ml +index 88a9a06..caefea7 100644 +--- a/deb/format822.ml ++++ b/deb/format822.ml +@@ -13,7 +13,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/format822.ml" end) ;; + + type loc = Lexing.position * Lexing.position + let dummy_loc: loc = Lexing.dummy_pos, Lexing.dummy_pos +diff --git a/deb/packages.ml b/deb/packages.ml +index 33e5166..b460767 100644 +--- a/deb/packages.ml ++++ b/deb/packages.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/packages.ml" end) ;; + + (** debian package format *) + type package = { +diff --git a/deb/sources.ml b/deb/sources.ml +index 1fe8388..ec5210c 100644 +--- a/deb/sources.ml ++++ b/deb/sources.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/sources.ml" end) ;; + + type source = { + name : Format822.name; +diff --git a/doseparse/boilerplate.ml b/doseparse/boilerplate.ml +index 3e3fd2a..a7a0b23 100644 +--- a/doseparse/boilerplate.ml ++++ b/doseparse/boilerplate.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "doseparse/boilerplate.ml" end) ;; + + (*************************************************************) + (* Options *) +diff --git a/eclipse/packages.ml b/eclipse/packages.ml +index 59a4499..19f0e8e 100644 +--- a/eclipse/packages.ml ++++ b/eclipse/packages.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "eclipse/packages.ml" end) ;; + + (** strip down version of the debian package format *) + type package = { +diff --git a/eclipse/version.ml b/eclipse/version.ml +index f94e87a..d6909d1 100644 +--- a/eclipse/version.ml ++++ b/eclipse/version.ml +@@ -23,7 +23,7 @@ open Common + alpha ::= [a..zA..Z] + *) + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "eclipse/version.ml" end) ;; + + let rex = Pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; + let parse_version s = +diff --git a/opencsw/packages.ml b/opencsw/packages.ml +index e69c7cf..a4e0057 100644 +--- a/opencsw/packages.ml ++++ b/opencsw/packages.ml +@@ -17,7 +17,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "opencsw/packages.ml" end) ;; + + type name = string + type version = string +@@ -45,7 +45,7 @@ module Set = Set.Make(struct + end) + + let input_raw_priv parse_packages files = +- let timer = Util.Timer.create __FILE__ in ++ let timer = Util.Timer.create "opencsw/packages.ml" in + Util.Timer.start timer; + if List.length files > 1 then info "Merging input lists" ; + let s = +diff --git a/opencsw/version.ml b/opencsw/version.ml +index f94e87a..10586b1 100644 +--- a/opencsw/version.ml ++++ b/opencsw/version.ml +@@ -23,7 +23,7 @@ open Common + alpha ::= [a..zA..Z] + *) + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "opencsw/version.ml" end) ;; + + let rex = Pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; + let parse_version s = +diff --git a/rpm/hdlists.ml b/rpm/hdlists.ml +index 0302a38..a7a7a1d 100644 +--- a/rpm/hdlists.ml ++++ b/rpm/hdlists.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "rpm/hdlists.ml" end) ;; + + let progressbar = Util.Progress.create "Rpm.Parse.Hdlists.parse_822_iter" ;; + Util.Progress.set_total progressbar 8000 (* estimate *) ; +diff --git a/rpm/packages.ml b/rpm/packages.ml +index fff6035..7547690 100644 +--- a/rpm/packages.ml ++++ b/rpm/packages.ml +@@ -15,7 +15,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "rpm/packages.ml" end) ;; + + type name = string + type version = string +diff --git a/rpm/rpmcudf.ml b/rpm/rpmcudf.ml +index 2397880..0c2d1aa 100644 +--- a/rpm/rpmcudf.ml ++++ b/rpm/rpmcudf.ml +@@ -14,7 +14,7 @@ open ExtLib + open ExtString + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "rpm/rpmcudf.ml" end) ;; + + type tables = { + units : (Packages.name, (int * (Packages.rel * string)) list) Hashtbl.t; +-- +1.8.5.3 + diff --git a/patches/dose/patches/0010-Hardcode-IFDEF-macros-assuming-false.patch b/patches/dose/patches/0010-Hardcode-IFDEF-macros-assuming-false.patch new file mode 100644 index 0000000..2518eda --- /dev/null +++ b/patches/dose/patches/0010-Hardcode-IFDEF-macros-assuming-false.patch @@ -0,0 +1,396 @@ +From 4f0510eaa4818b202ab8067a3ec8405cb0126055 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 14 Mar 2014 18:32:59 +0100 +Subject: [PATCH 10/10] Hardcode IFDEF macros (assuming false) + +the quick-and-dirty way: +``` +sed -i -nre ' +/\bIFDEF\b/{ + :LOOP + s/.*\bELSE\b(.*)/\1/p; t ELSE + s/.*\bEND\b(.*)/\1/p; t END + n; b LOOP + :ELSE + s/.*\bEND\b(.*)/\1/p; t END + p; n; b ELSE + :END +}; p' +``` +on all ml/mli files. +Same remarks as for __FILE__ +--- + applications/ceve.ml | 52 ++++++++++++--------------------- + applications/challenged.ml | 27 ++++++----------- + common/input.ml | 51 +++++++++----------------------- + common/input.mli | 14 +++------ + db/backend.ml | 8 ++++-- + doseparse/boilerplate.ml | 72 ++++++++++++++++------------------------------ + 6 files changed, 73 insertions(+), 151 deletions(-) + +diff --git a/applications/ceve.ml b/applications/ceve.ml +index 5cd4ee7..551d4ca 100644 +--- a/applications/ceve.ml ++++ b/applications/ceve.ml +@@ -17,9 +17,8 @@ open Algo + + include Util.Logging(struct let label = "applications/ceve.ml" end) ;; + +-IFDEF HASOCAMLGRAPH THEN +- module DGraph = Defaultgraphs.SyntacticDependencyGraph +-END ++ ++ + + module Options = struct + open OptParse +@@ -62,23 +61,11 @@ end;; + (* -------------------------------- *) + + let output_to_sqlite args = +-IFDEF HASDB THEN +- begin +- let pl = List.unique (List.flatten (List.map (function u -> +- match Input.parse_uri u with +- | ("deb", (_, _, _, _, f), _) -> Debian.Packages.input_raw [f] +- | _ -> failwith "Other file formats than Debian are not yet supported for SQLite insertion" +- ) args)) in +- let db = Backend.open_database "sqlite" (None, None, Some "localhost", None, "cudf") in +- Backend.create_tables db; +- List.iter (fun p -> +- Backend.insert_package db p +- ) pl; +- (* !Sql.database.close_db db.Backend.connection; *) +- end +-ELSE ++ ++ + failwith "DB not available" +-END ++ ++ + ;; + + let nr_conflicts univ = +@@ -193,30 +180,27 @@ let main () = + in + begin match OptParse.Opt.get Options.out_type with + |"dot" -> +-IFDEF HASOCAMLGRAPH THEN +- DGraph.DotPrinter.output_graph oc (DGraph.dependency_graph u) +-ELSE ++ ++ + failwith ("dot not supported: needs ocamlgraph") +-END ++ ++ + |"gml" -> +-IFDEF HASOCAMLGRAPH THEN +- let fmt = Format.formatter_of_out_channel oc in +- DGraph.GmlPrinter.print fmt (DGraph.dependency_graph u) +-ELSE ++ ++ + failwith ("dot not supported: needs ocamlgraph") +-END ++ ++ + + |"cnf" -> Printf.fprintf oc "%s" (Depsolver.output_clauses ~global_constraints ~enc:Depsolver.Cnf u) + |"dimacs" -> Printf.fprintf oc "%s" (Depsolver.output_clauses ~global_constraints ~enc:Depsolver.Dimacs u) + |"cudf" -> output_cudf oc preamble u + |"table" -> +-IFDEF HASOCAMLGRAPH THEN +- Printf.fprintf oc "%d\t%d\t%d\n" +- (Cudf.universe_size u) (DGraph.G.nb_edges (DGraph.dependency_graph u)) +- (nr_conflicts u) +-ELSE ++ ++ + failwith ("table not supported: needs ocamlgraph") +-END ++ ++ + |_ -> assert false + end ; + close_out oc; +diff --git a/applications/challenged.ml b/applications/challenged.ml +index 41236d1..9407146 100644 +--- a/applications/challenged.ml ++++ b/applications/challenged.ml +@@ -30,18 +30,12 @@ module Options = struct + let brokenlist = StdOpt.store_true () + let downgrades = StdOpt.store_true () + let cluster = StdOpt.store_true () +-IFDEF HASPARMAP THEN +- let ncores = StdOpt.int_option ~default:1 () +- let chunksize = StdOpt.int_option () +-END ++ ++ + open OptParser ;; + +-IFDEF HASPARMAP THEN +- add options ~long_name:"ncores" +- ~help:"Number of cores to use on a multicore" ncores; +- add options ~long_name:"chunksize" +- ~help:"Size of each task executed by the workers (controls granularity)" chunksize; +-END ++ ++ + + add options ~long_name:"checkonly" + ~help:"Check only these package ex. (sn1,sv1),(sn2,sv2)" checkonly; +@@ -224,16 +218,11 @@ let challenged + (* computing *) + let results = + let map f l = +-IFDEF HASPARMAP THEN +- let ncores = OptParse.Opt.get Options.ncores in +- match OptParse.Opt.opt Options.chunksize with +- None -> +- Parmap.parmap ~ncores f (Parmap.L l) +- | Some chunksize -> +- Parmap.parmap ~ncores ~chunksize f (Parmap.L l) +-ELSE ++ ++ + List.map f l +-END ++ ++ + in + map (fun ((sn,sv,version),(cluster,vl,constr)) -> + let startd=Unix.gettimeofday() in +diff --git a/common/input.ml b/common/input.ml +index c6af980..2ae132d 100644 +--- a/common/input.ml ++++ b/common/input.ml +@@ -14,36 +14,11 @@ open ExtLib + + include Util.Logging(struct let label = "common/input.ml" end) ;; + +-IFDEF HASZIP THEN +-let gzip_open_file file = +- let ch = Gzip.open_in file in +- let input_char ch = try Gzip.input_char ch with End_of_file -> raise IO.No_more_input in +- let read ch = try Gzip.input ch with End_of_file -> raise IO.No_more_input in +- IO.create_in +- ~read:(fun () -> input_char ch) +- ~input:(read ch) +- ~close:(fun () -> Gzip.close_in ch) +-;; +-END +- +-IFDEF HASBZ2 THEN +-let bzip_open_file file = +- let s = " " in +- let ch = Bz2.open_in (open_in file) in +- let input_char ch = +- try ignore (Bz2.read ch s 0 1) ; s.[0] +- with End_of_file -> raise IO.No_more_input +- in +- let read ch s pos len = +- try Bz2.read ch s pos len +- with End_of_file -> raise IO.No_more_input +- in +- IO.create_in +- ~read:(fun () -> input_char ch) +- ~input:(read ch) +- ~close:(fun () -> Bz2.close_in ch) +-;; +-END ++ ++ ++ ++ ++ + + let std_open_file file = IO.input_channel (open_in file) + let open_ch ch = IO.input_channel ch +@@ -52,18 +27,18 @@ let close_ch ch = IO.close_in ch + let open_file file = + if (Unix.stat file).Unix.st_size = 0 then fatal "Input file %s is empty" file; + if Filename.check_suffix file ".gz" || Filename.check_suffix file ".cz" then +-IFDEF HASZIP THEN +- gzip_open_file file +-ELSE ++ ++ + fatal "gzip not supported. re-configure with --with-zip" +-END ++ ++ + else + if Filename.check_suffix file ".bz2" then +-IFDEF HASBZ2 THEN +- bzip_open_file file +-ELSE ++ ++ + fatal "bzip not supported. re-configure with --with-bz2" +-END ++ ++ + else + std_open_file file + ;; +diff --git a/common/input.mli b/common/input.mli +index 4fcca69..5ddb0e4 100644 +--- a/common/input.mli ++++ b/common/input.mli +@@ -14,17 +14,11 @@ + + open ExtLib + +-IFDEF HASZIP THEN +-(** load a file in gzip format +- @return ExtLib.IO.input channel *) +-val gzip_open_file : string -> IO.input +-END + +-IFDEF HASBZ2 THEN +-(** load a file in bzip format - Not implemented yet +- @return ExtLib.IO.input channel *) +-val bzip_open_file : string -> IO.input +-END ++ ++ ++ ++ + + (** load a non compressed file + @return ExtLib.IO.input channel *) +diff --git a/db/backend.ml b/db/backend.ml +index 8dbf1f5..052982d 100644 +--- a/db/backend.ml ++++ b/db/backend.ml +@@ -233,9 +233,13 @@ let create_view_universe db = + + let late_binding = function + |"pgsql" -> +- IFDEF PGSQL THEN Pgsql.load () ELSE failwith "pgsql not supported" END ++ failwith "pgsql not supported" END ++ ++ + |"sqlite" -> +- IFDEF SQLITE THEN Sqlite.load () ELSE failwith "sqlite not supported" END ++ failwith "sqlite not supported" END ++ ++ + |_ -> failwith "DB late binding failed" + ;; + +diff --git a/doseparse/boilerplate.ml b/doseparse/boilerplate.ml +index a7a0b23..f17cb88 100644 +--- a/doseparse/boilerplate.ml ++++ b/doseparse/boilerplate.ml +@@ -309,21 +309,11 @@ let deb_load_universe options l = + * refactor or not refactor ? *) + (** transform a list of rpm control stanza into a cudf packages list *) + let rpm_load_list dll = +-IFDEF HASRPM THEN +- let tables = Rpm.Rpmcudf.init_tables (List.flatten dll) in +- let cll = +- List.map (fun l -> +- List.map (Rpm.Rpmcudf.tocudf tables) l +- ) dll +- in +- (* Rpm.Rpmcudf.clear tables; *) +- let from_cudf (p,i) = (p,string_of_int i) in +- let to_cudf (p,v) = (p,Rpm.Rpmcudf.get_cudf_version tables (p,v)) in +- let preamble = Rpm.Rpmcudf.preamble in +- (preamble,cll,from_cudf,to_cudf) +-ELSE ++ ++ + failwith "librpm not available. re-configure with --with-rpm" +-END ++ ++ + + (** transform a list of rpm control stanza into a cudf universe *) + let rpm_load_universe l = +@@ -453,39 +443,25 @@ let parse_input ?(options=None) urilist = + |`Csw, None -> csw_parse_input filelist + + |`Hdlist, None -> +-IFDEF HASRPM THEN +- let dll = +- List.map (fun l -> +- let filelist = List.map unpack l in +- Rpm.Packages.Hdlists.input_raw filelist +- ) filelist +- in +- rpm_load_list dll +-ELSE ++ ++ + fatal "hdlist Not supported. re-configure with --with-rpm" +-END ++ ++ + + |`Synthesis, None -> +-IFDEF HASRPM THEN +- let dll = +- List.map (fun l -> +- let filelist = List.map unpack l in +- Rpm.Packages.Synthesis.input_raw filelist +- ) filelist +- in +- rpm_load_list dll +-ELSE ++ ++ + fatal "synthesis input format not supported. re-configure with --with-rpm" +-END ++ ++ + (* + |Some (Url.Pgsql|Url.Sqlite), [((Url.Pgsql|Url.Sqlite) as dbtype,info,(Some query))] -> +-IFDEF HASDB THEN +- let db = Db.Backend.init_database dbtype info (Idbr.parse_query query) in +- let l = Db.Backend.load_selection db (`All) in +- deb_load_list ~extras [l] +-ELSE ++ ++ + fatal "%s Not supported. re-configure with --with-??" (Url.scheme_to_string dbtype) +-END ++ ++ + *) + |s,_ -> fatal "%s Not supported" (Url.scheme_to_string s) + ;; +@@ -493,18 +469,18 @@ END + let supported_formats () = + let standard = ["cudf://";"deb://";"deb://-";"eclipse://"] in + let rpm = +-IFDEF HASRPM THEN +- ["hdlist://";"synthesis://"] +-ELSE ++ ++ + [] +-END ++ ++ + in + let db = +-IFDEF HASDB THEN +- ["pgsql://";"sqlite://"] +-ELSE ++ ++ + [] +-END ++ ++ + in + standard@rpm@db + ;; +-- +1.8.5.3 + diff --git a/patches/dose3/0001-Install-mli-cmx-etc.patch b/patches/dose3/0001-Install-mli-cmx-etc.patch new file mode 100644 index 0000000..41494e7 --- /dev/null +++ b/patches/dose3/0001-Install-mli-cmx-etc.patch @@ -0,0 +1,133 @@ +From b5314c20d8e3caf62fe0dc96ad937a2950158b23 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Thu, 2 Mar 2017 12:19:56 +0100 +Subject: [PATCH] Install mli, cmx, etc. + +--- + Makefile | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/Makefile b/Makefile +index 09464ff..5044d7f 100644 +--- a/Makefile ++++ b/Makefile +@@ -56,7 +56,7 @@ $(DOSELIBS)/cudf.%: + @for i in _build/cudf/cudf.*; do \ + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -67,7 +67,7 @@ $(DOSELIBS)/common.%: common/*.ml common/*.mli + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -78,7 +78,7 @@ $(DOSELIBS)/versioning.%: versioning/*.ml versioning/*.mli + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -88,7 +88,7 @@ $(DOSELIBS)/algo.%: algo/*.ml algo/*.mli $(DOSELIBS)/common.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -98,7 +98,7 @@ $(DOSELIBS)/debian.%: deb/*.ml deb/*.mli $(DOSELIBS)/pef.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -108,7 +108,7 @@ $(DOSELIBS)/opam.%: opam/*.ml opam/*.mli $(DOSELIBS)/pef.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -118,7 +118,7 @@ $(DOSELIBS)/npm.%: npm/*.ml npm/*.mli $(DOSELIBS)/versioning.% $(DOSELIBS)/pef.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -128,7 +128,7 @@ $(DOSELIBS)/rpm.%: rpm/*.ml $(DOSELIBS)/algo.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -138,7 +138,7 @@ $(DOSELIBS)/pef.%: pef/*.ml pef/*.mli + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -148,7 +148,7 @@ $(DOSELIBS)/csw.%: opencsw/*.ml $(DOSELIBS)/versioning.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \ ++ rm -f $(DOSELIBS)/*.mlpack ; \ + fi ; \ + done + +@@ -158,7 +158,7 @@ $(DOSELIBS)/doseparse.%: $(DOSELIBS)/pef.% $(DOSELIBS)/debian.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ; \ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx $(DOSELIBS)/*.ml ; \ ++ rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.ml ; \ + fi ; \ + done + +@@ -168,7 +168,7 @@ $(DOSELIBS)/doseparseNoRpm.%: $(DOSELIBS)/pef.% $(DOSELIBS)/debian.% + if [ -e $$i ]; then \ + cp $$i $(DOSELIBS) ;\ + rm $$i ;\ +- rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ;\ ++ rm -f $(DOSELIBS)/*.mlpack ;\ + fi ; \ + done + +@@ -223,7 +223,7 @@ INSTALL_STUFF_ = META + INSTALL_STUFF_ += $(wildcard _build/doselibs/*.cma _build/doselibs/*.cmi) + INSTALL_STUFF_ += $(wildcard _build/doselibs/*.cmxa _build/doselibs/*.cmxs) + INSTALL_STUFF_ += $(wildcard _build/doselibs/*.a) +-#INSTALL_STUFF_ += $(wildcard _build/*/*.mli) ++INSTALL_STUFF_ += $(wildcard _build/doselibs/*.mli) $(wildcard _build/doselibs/*.cmti) $(wildcard _build/doselibs/*.cmx) + INSTALL_STUFF_ += $(wildcard _build/rpm/*.so) + + exclude_cudf = $(wildcard _build/doselibs/*cudf* _build/cudf/*) +-- +2.11.0 + diff --git a/patches/dose3/0002-dont-make-printconf.patch b/patches/dose3/0002-dont-make-printconf.patch new file mode 100644 index 0000000..84b6a3b --- /dev/null +++ b/patches/dose3/0002-dont-make-printconf.patch @@ -0,0 +1,9 @@ +--- a/configure ++++ b/configure +@@ -6552,6 +6552,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + fi +- +- +-make printconf diff --git a/patches/dose3/0003-Fix-for-ocaml-4.06.patch b/patches/dose3/0003-Fix-for-ocaml-4.06.patch new file mode 100644 index 0000000..2c344af --- /dev/null +++ b/patches/dose3/0003-Fix-for-ocaml-4.06.patch @@ -0,0 +1,52 @@ +From aeca7656f499d7f4595319858f242276920e31bb Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Sat, 2 Dec 2017 12:51:01 +0100 +Subject: [PATCH] Fix for ocaml 4.06 + +--- + common/criteria_lexer.mll | 8 ++++---- + common/util.ml | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/common/criteria_lexer.mll b/common/criteria_lexer.mll +index 71f9178..fc4eae3 100644 +--- a/common/criteria_lexer.mll ++++ b/common/criteria_lexer.mll +@@ -18,7 +18,7 @@ + let c = Lexing.lexeme_char lexbuf 2 in (* the delimiter can be any character *) + (* find the terminating delimiter *) + let endpos = +- try String.index_from lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) c with ++ try Bytes.index_from lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) c with + |Invalid_argument _ -> + raise (Format822.Syntax_error ( + Format822.error lexbuf "String too short")) +@@ -27,9 +27,9 @@ + Format822.error lexbuf (Printf.sprintf "cannot find: %c" c))) + in + let len = endpos - (lexbuf.lex_start_pos + 3) in +- let s = String.sub lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) len in +- lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_start_pos + ((String.length s)+4); +- s ++ let s = Bytes.sub lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) len in ++ lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_start_pos + ((Bytes.length s)+4); ++ Bytes.to_string s + + } + +diff --git a/common/util.ml b/common/util.ml +index 598f266..36ca3d1 100644 +--- a/common/util.ml ++++ b/common/util.ml +@@ -87,7 +87,7 @@ module MakeMessages(X : sig val label : string end) = struct + let clean label = + try + let s = Filename.chop_extension (Filename.basename label) in +- String.capitalize s ++ String.capitalize_ascii s + with Invalid_argument _ -> label + + let create ?(enabled=false) label = +-- +2.11.0 + diff --git a/patches/dose3/0004-Add-unix-as-dependency-to-dose3.common-in-META.in.patch b/patches/dose3/0004-Add-unix-as-dependency-to-dose3.common-in-META.in.patch new file mode 100644 index 0000000..d2cc44c --- /dev/null +++ b/patches/dose3/0004-Add-unix-as-dependency-to-dose3.common-in-META.in.patch @@ -0,0 +1,25 @@ +From b94cf24739818e5aff397e0a83b19ea32dc81f42 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Tue, 6 Feb 2018 10:15:45 +0100 +Subject: [PATCH 3/3] Add "unix" as dependency to dose3.common in META.in + +--- + META.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/META.in b/META.in +index aa2cd8d..0f9d337 100644 +--- a/META.in ++++ b/META.in +@@ -8,7 +8,7 @@ package "common" ( + version = "@PACKAGE_VERSION@" + archive(byte) = "common.cma" + archive(native) = "common.cmxa" +-requires = "extlib, re.pcre, cudf, @ZIP@, @BZ2@" ++requires = "extlib, re.pcre, cudf, unix, @ZIP@, @BZ2@" + ) + + package "algo" ( +-- +2.11.0 + diff --git a/patches/dose3/0005-Fix-compatibility-with-ocamlgraph-2.0.patch b/patches/dose3/0005-Fix-compatibility-with-ocamlgraph-2.0.patch new file mode 100644 index 0000000..c831fa8 --- /dev/null +++ b/patches/dose3/0005-Fix-compatibility-with-ocamlgraph-2.0.patch @@ -0,0 +1,31 @@ +From e26e675690b3aff46c97f8e05a198f337b870823 Mon Sep 17 00:00:00 2001 +From: Kate +Date: Thu, 15 Oct 2020 15:42:32 +0100 +Subject: [PATCH] Fix compatibility with ocamlgraph >= 2.0 + +--- + algo/dominators.ml | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/algo/dominators.ml b/algo/dominators.ml +index 230acd4..27fa96c 100644 +--- a/algo/dominators.ml ++++ b/algo/dominators.ml +@@ -101,7 +101,13 @@ let dominators_tarjan graph = + ) graph; + + Util.Timer.start tjntimer; +-#if OCAMLGRAPHVERSION >= 186 ++#if OCAMLGRAPHVERSION >= 200 ++ let module Dom = Dominator.Make_graph(struct ++ include G ++ let empty () = create () ++ let add_edge g v1 v2 = add_edge g v1 v2; g ++ end) in ++#elif OCAMLGRAPHVERSION >= 186 + let module Dom = Dominator.Make_graph(G) in + #else + let module Dom = Dominator.Make(G) in +-- +2.29.2 + diff --git a/patches/dose3/0006-Grep-carefully-for-ocaml-system.patch b/patches/dose3/0006-Grep-carefully-for-ocaml-system.patch new file mode 100644 index 0000000..9d2fe05 --- /dev/null +++ b/patches/dose3/0006-Grep-carefully-for-ocaml-system.patch @@ -0,0 +1,22 @@ +diff --git a/configure b/configure +index 49c02df..165e210 100755 +--- a/configure ++++ b/configure +@@ -4227,7 +4227,7 @@ if test "$OCAMLBEST" = "opt"; then : + else + OCAMLBESTCC=$OCAMLC + fi +-OCAML_CC="$($OCAMLBESTCC -config | fgrep native_c_compiler | sed -e "s/native_c_compiler: \(.*\) .*/\1/")" ++OCAML_CC="$($OCAMLBESTCC -config | grep "^native_c_compiler:" | sed -e "s/native_c_compiler: \(.*\) .*/\1/")" + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -5315,7 +5315,7 @@ done + HAS_RPM=yes + fi + +-OCAML_SYSTEM="$($OCAMLBESTCC -config | fgrep system | sed -e "s/system: \(.*\)/\1/")" ++OCAML_SYSTEM="$($OCAMLBESTCC -config | grep "^system:" | sed -e "s/system: \(.*\)/\1/")" + + + if test "${OCAML_OS_TYPE}" = "Win32"; then : diff --git a/patches/dune-action-plugin/add-missing-version.patch b/patches/dune-action-plugin/add-missing-version.patch new file mode 100644 index 0000000..5e0dbe5 --- /dev/null +++ b/patches/dune-action-plugin/add-missing-version.patch @@ -0,0 +1,12 @@ +diff --git a/dune-project b/dune-project +index 17a8f9692..cf485c2b7 100644 +--- a/dune-project ++++ b/dune-project +@@ -3,6 +3,7 @@ + ; When changing the version, don't forget to regenerate *.opam files + ; by running [dune build]. + (name dune) ++(version 2.8.0) + + (generate_opam_files true) + diff --git a/patches/dune-build-info/add-missing-version.patch b/patches/dune-build-info/add-missing-version.patch new file mode 100644 index 0000000..5e0dbe5 --- /dev/null +++ b/patches/dune-build-info/add-missing-version.patch @@ -0,0 +1,12 @@ +diff --git a/dune-project b/dune-project +index 17a8f9692..cf485c2b7 100644 +--- a/dune-project ++++ b/dune-project +@@ -3,6 +3,7 @@ + ; When changing the version, don't forget to regenerate *.opam files + ; by running [dune build]. + (name dune) ++(version 2.8.0) + + (generate_opam_files true) + diff --git a/patches/dune-configurator/0001-dune-configurator-for-Dune-2.0.0-on-OCaml-4.06.patch b/patches/dune-configurator/0001-dune-configurator-for-Dune-2.0.0-on-OCaml-4.06.patch new file mode 100644 index 0000000..553fc45 --- /dev/null +++ b/patches/dune-configurator/0001-dune-configurator-for-Dune-2.0.0-on-OCaml-4.06.patch @@ -0,0 +1,176 @@ +From f235e1cd93aa8266b34cdf87ff58b382cd74b394 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 27 Nov 2019 14:15:41 +0000 +Subject: [PATCH] dune-configurator for Dune 2.0.0 on OCaml < 4.06 + +Signed-off-by: David Allsopp +--- + dune-configurator.opam | 38 +++++++++++++++++++++++++++++++++++++ + dune-project | 17 +++++++++++++++++ + src/configurator/dune | 4 ++-- + src/dune_lang/dune | 2 +- + src/ocaml-config/dune | 2 +- + src/ocaml-syntax-shims/dune | 2 +- + src/stdune/caml/dune | 2 +- + src/stdune/dune | 2 +- + src/stdune/result/dune | 2 +- + 9 files changed, 63 insertions(+), 8 deletions(-) + create mode 100644 dune-configurator.opam + +diff --git a/dune-configurator.opam b/dune-configurator.opam +new file mode 100644 +index 00000000..95925e45 +--- /dev/null ++++ b/dune-configurator.opam +@@ -0,0 +1,38 @@ ++# This file is generated by dune, edit dune-project instead ++opam-version: "2.0" ++synopsis: "Helper library for gathering system configuration" ++description: """ ++dune-configurator is a small library that helps writing OCaml scripts that ++test features available on the system, in order to generate config.h ++files for instance. ++Among other things, dune-configurator allows one to: ++- test if a C program compiles ++- query pkg-config ++- import #define from OCaml header files ++- generate config.h file ++""" ++maintainer: ["Jane Street Group, LLC"] ++authors: ["Jane Street Group, LLC"] ++license: "MIT" ++homepage: "https://github.com/ocaml/dune" ++doc: "https://dune.readthedocs.io/" ++bug-reports: "https://github.com/ocaml/dune/issues" ++depends: [ ++ "ocaml" {>= "4.02"} ++ "dune" {>= "2.0.0"} ++] ++build: [ ++ ["dune" "subst"] {pinned} ++ [ ++ "dune" ++ "build" ++ "-p" ++ name ++ "-j" ++ jobs ++ "@install" ++ "@runtest" {with-test} ++ "@doc" {with-doc} ++ ] ++] ++dev-repo: "git+https://github.com/ocaml/dune.git" +diff --git a/dune-project b/dune-project +index 12417baf..30046e88 100644 +--- a/dune-project ++++ b/dune-project +@@ -56,3 +56,20 @@ versions. It supports reporting the version from the version control + system during development to get an precise reference of when the + executable was built. + ")) ++ ++(package ++ (name dune-configurator) ++ (depends ++ (ocaml (>= 4.02)) ++ (dune (>= 2.0.0))) ++ (synopsis "Helper library for gathering system configuration") ++ (description "\ ++dune-configurator is a small library that helps writing OCaml scripts that ++test features available on the system, in order to generate config.h ++files for instance. ++Among other things, dune-configurator allows one to: ++- test if a C program compiles ++- query pkg-config ++- import #define from OCaml header files ++- generate config.h file ++")) +diff --git a/src/configurator/dune b/src/configurator/dune +index f07c589d..20c2a4fd 100644 +--- a/src/configurator/dune ++++ b/src/configurator/dune +@@ -2,7 +2,7 @@ + + (library + (name configurator) +- (public_name dune.configurator) ++ (public_name dune-configurator) + (preprocess future_syntax) +- (libraries stdune ocaml_config dune_lang dune_caml dune._result) ++ (libraries stdune ocaml_config dune_lang dune_caml dune_result) + (flags (:standard -safe-string (:include flags/flags.sexp)))) +diff --git a/src/dune_lang/dune b/src/dune_lang/dune +index 74a46eb0..30660a45 100644 +--- a/src/dune_lang/dune ++++ b/src/dune_lang/dune +@@ -2,7 +2,7 @@ + (name dune_lang) + (synopsis "[Internal] S-expression library") + (libraries stdune) +- (public_name dune._dune_lang) ++ (public_name dune-configurator._dune_lang) + (preprocess future_syntax)) + + (ocamllex dune_lexer jbuild_lexer) +diff --git a/src/ocaml-config/dune b/src/ocaml-config/dune +index 904abcf5..a8836db4 100644 +--- a/src/ocaml-config/dune ++++ b/src/ocaml-config/dune +@@ -1,6 +1,6 @@ + (library + (name ocaml_config) +- (public_name dune._ocaml_config) ++ (public_name dune-configurator._ocaml_config) + (preprocess future_syntax) + (libraries stdune) + (synopsis "[Internal] Interpret the output of 'ocamlc -config'")) +diff --git a/src/ocaml-syntax-shims/dune b/src/ocaml-syntax-shims/dune +index 4ef9fc65..e1ac7d44 100644 +--- a/src/ocaml-syntax-shims/dune ++++ b/src/ocaml-syntax-shims/dune +@@ -1,6 +1,6 @@ + (executable + (name pp) +- (package dune) ++ (package dune-configurator) + (public_name ocaml-syntax-shims) + (libraries compiler-libs.common)) + +diff --git a/src/stdune/caml/dune b/src/stdune/caml/dune +index 765af3b7..332da0c5 100644 +--- a/src/stdune/caml/dune ++++ b/src/stdune/caml/dune +@@ -1,6 +1,6 @@ + (library + (name dune_caml) +- (public_name dune._caml) ++ (public_name dune-configurator._caml) + (libraries dune_result) + (synopsis "[Internal] Wrapped version of the OCaml stdlib")) + +diff --git a/src/stdune/dune b/src/stdune/dune +index 546e9ff6..ba53b55d 100644 +--- a/src/stdune/dune ++++ b/src/stdune/dune +@@ -1,6 +1,6 @@ + (library + (name stdune) +- (public_name dune._stdune) ++ (public_name dune-configurator._stdune) + (synopsis "[Internal] Standard library of Dune") + (preprocess future_syntax) + (libraries dune_caml dune_result unix)) +diff --git a/src/stdune/result/dune b/src/stdune/result/dune +index 0583a22a..ddb94c43 100644 +--- a/src/stdune/result/dune ++++ b/src/stdune/result/dune +@@ -1,4 +1,4 @@ + (library + (name dune_result) +- (public_name dune._result) ++ (public_name dune-configurator._result) + (synopsis "[internal] Compatibility layer for the result type")) +-- +2.20.1 + diff --git a/patches/dune-configurator/add-missing-version.patch b/patches/dune-configurator/add-missing-version.patch new file mode 100644 index 0000000..5e0dbe5 --- /dev/null +++ b/patches/dune-configurator/add-missing-version.patch @@ -0,0 +1,12 @@ +diff --git a/dune-project b/dune-project +index 17a8f9692..cf485c2b7 100644 +--- a/dune-project ++++ b/dune-project +@@ -3,6 +3,7 @@ + ; When changing the version, don't forget to regenerate *.opam files + ; by running [dune build]. + (name dune) ++(version 2.8.0) + + (generate_opam_files true) + diff --git a/patches/dune-glob/add-missing-version.patch b/patches/dune-glob/add-missing-version.patch new file mode 100644 index 0000000..5e0dbe5 --- /dev/null +++ b/patches/dune-glob/add-missing-version.patch @@ -0,0 +1,12 @@ +diff --git a/dune-project b/dune-project +index 17a8f9692..cf485c2b7 100644 +--- a/dune-project ++++ b/dune-project +@@ -3,6 +3,7 @@ + ; When changing the version, don't forget to regenerate *.opam files + ; by running [dune build]. + (name dune) ++(version 2.8.0) + + (generate_opam_files true) + diff --git a/patches/dune-private-libs/add-missing-version.patch b/patches/dune-private-libs/add-missing-version.patch new file mode 100644 index 0000000..5e0dbe5 --- /dev/null +++ b/patches/dune-private-libs/add-missing-version.patch @@ -0,0 +1,12 @@ +diff --git a/dune-project b/dune-project +index 17a8f9692..cf485c2b7 100644 +--- a/dune-project ++++ b/dune-project +@@ -3,6 +3,7 @@ + ; When changing the version, don't forget to regenerate *.opam files + ; by running [dune build]. + (name dune) ++(version 2.8.0) + + (generate_opam_files true) + diff --git a/patches/dune-release/fix-tests.patch b/patches/dune-release/fix-tests.patch new file mode 100644 index 0000000..9a70091 --- /dev/null +++ b/patches/dune-release/fix-tests.patch @@ -0,0 +1,92 @@ +commit 942aec332f06b4faf2811e52ac357f3f2f35241b +Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> +Date: Tue Jan 12 18:59:38 2021 +0100 + + Make git related tests more robust + + This is a cherry-pick of 36ce1df544d93e394c44fef8155bae9fba15afb6 + + * When running git init we also redirect stderr to /dev/null as + newer versions of git print a hint to stderr if there's no default + main branch name set and it is defaulting to 'master'. An alternative + would be to pass -b, but that is not supported by older git versions + as seen on debian, for example. + * after git init we set user.name and user.email for the repository, so + the tests don't fail if they are executed in an environment without a + global git config (CI, sandboxed build systems, …) + +diff --git a/tests/bin/delegate_info/run.t b/tests/bin/delegate_info/run.t +index a36f3ae..0ac7492 100644 +--- a/tests/bin/delegate_info/run.t ++++ b/tests/bin/delegate_info/run.t +@@ -17,7 +17,9 @@ We need a basic opam project skeleton + + We need to set up a git project for dune-release to work properly + +- $ git init > /dev/null ++ $ git init 2> /dev/null > /dev/null ++ $ git config user.name "dune-release-test" ++ $ git config user.email "pseudo@pseudo.invalid" + $ git add CHANGES.md whatever.opam dune-project + $ git commit -m "Initial commit" > /dev/null + $ dune-release tag -y +diff --git a/tests/bin/errors/run.t b/tests/bin/errors/run.t +index 568e43e..d9a4f65 100644 +--- a/tests/bin/errors/run.t ++++ b/tests/bin/errors/run.t +@@ -17,7 +17,9 @@ We need a basic opam project skeleton + + We need to set up a git project for dune-release to work properly + +- $ git init > /dev/null ++ $ git init 2> /dev/null > /dev/null ++ $ git config user.name "dune-release-test" ++ $ git config user.email "pseudo@pseudo.invalid" + $ git add CHANGES.md whatever.opam dune-project + $ git commit -m "Initial commit" > /dev/null + +diff --git a/tests/bin/no_doc/run.t b/tests/bin/no_doc/run.t +index 823f373..a66975f 100644 +--- a/tests/bin/no_doc/run.t ++++ b/tests/bin/no_doc/run.t +@@ -31,7 +31,9 @@ We need a basic opam project skeleton + + We need to set up a git project for dune-release to work properly + +- $ git init > /dev/null ++ $ git init 2> /dev/null > /dev/null ++ $ git config user.name "dune-release-test" ++ $ git config user.email "pseudo@pseudo.invalid" + $ git add CHANGES.md whatever.opam whatever-lib.opam dune-project README LICENSE + $ git commit -m "Initial commit" > /dev/null + $ dune-release tag -y +diff --git a/tests/bin/tag/run.t b/tests/bin/tag/run.t +index 4f131cf..a42b481 100644 +--- a/tests/bin/tag/run.t ++++ b/tests/bin/tag/run.t +@@ -17,7 +17,9 @@ We need a basic opam project skeleton + + We need to set up a git project with two commits to test trying to tag different commits with the same tag name. + +- $ git init > /dev/null ++ $ git init 2> /dev/null > /dev/null ++ $ git config user.name "dune-release-test" ++ $ git config user.email "pseudo@pseudo.invalid" + $ git add whatever.opam dune-project + $ git commit -m "Initial commit" > /dev/null + $ git add CHANGES.md +diff --git a/tests/bin/x-commit-hash/run.t b/tests/bin/x-commit-hash/run.t +index b2f7649..15349ef 100644 +--- a/tests/bin/x-commit-hash/run.t ++++ b/tests/bin/x-commit-hash/run.t +@@ -25,7 +25,9 @@ We need a basic opam project skeleton + + We need to set up a git project for dune-release to work properly + +- $ git init > /dev/null ++ $ git init 2> /dev/null > /dev/null ++ $ git config user.name "dune-release-test" ++ $ git config user.email "pseudo@pseudo.invalid" + $ git add CHANGES.md whatever.opam dune-project README LICENSE + $ git commit -m "Initial commit" > /dev/null + $ dune-release tag -y diff --git a/patches/dune-site/add-missing-version.patch b/patches/dune-site/add-missing-version.patch new file mode 100644 index 0000000..5e0dbe5 --- /dev/null +++ b/patches/dune-site/add-missing-version.patch @@ -0,0 +1,12 @@ +diff --git a/dune-project b/dune-project +index 17a8f9692..cf485c2b7 100644 +--- a/dune-project ++++ b/dune-project +@@ -3,6 +3,7 @@ + ; When changing the version, don't forget to regenerate *.opam files + ; by running [dune build]. + (name dune) ++(version 2.8.0) + + (generate_opam_files true) + diff --git a/patches/dune/add-missing-version.patch b/patches/dune/add-missing-version.patch new file mode 100644 index 0000000..5e0dbe5 --- /dev/null +++ b/patches/dune/add-missing-version.patch @@ -0,0 +1,12 @@ +diff --git a/dune-project b/dune-project +index 17a8f9692..cf485c2b7 100644 +--- a/dune-project ++++ b/dune-project +@@ -3,6 +3,7 @@ + ; When changing the version, don't forget to regenerate *.opam files + ; by running [dune build]. + (name dune) ++(version 2.8.0) + + (generate_opam_files true) + diff --git a/patches/dypgen/dypgen.install b/patches/dypgen/dypgen.install new file mode 100644 index 0000000..acd726d --- /dev/null +++ b/patches/dypgen/dypgen.install @@ -0,0 +1,5 @@ +bin: [ + "dypgen/dypgen.opt" + "dypgen/dypgen" + "dyp2gram.pl" {"dyp2gram"} +] diff --git a/patches/dypgen/install-bsd-compatible.patch b/patches/dypgen/install-bsd-compatible.patch new file mode 100644 index 0000000..9c2cf07 --- /dev/null +++ b/patches/dypgen/install-bsd-compatible.patch @@ -0,0 +1,62 @@ +--- dypgen.20120619-1/Makefile.orig 2013-04-02 16:17:00.000000000 +0200 ++++ dypgen.20120619-1/Makefile 2013-04-02 16:21:59.000000000 +0200 +@@ -22,20 +22,24 @@ + + #install with ocaml-findlib + install: install_opt +- install -D --mode=755 dypgen/dypgen $(BINDIR) +- install -D --mode=755 dyp2gram.pl $(BINDIR)/dyp2gram +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 ++ install -d $(BINDIR) ++ install -m 755 dypgen/dypgen $(BINDIR) ++ install -m 755 dyp2gram.pl $(BINDIR)/dyp2gram ++ install -d $(MANDIR) ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 + cd dyplib; $(MAKE) install + + #install without ocaml-findlib + install2: install_opt +- install -D --mode=755 dypgen/dypgen $(BINDIR) +- install -D --mode=755 dyp2gram.pl $(BINDIR)/dyp2gram +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 ++ install -d $(BINDIR) ++ install -m 755 dypgen/dypgen $(BINDIR) ++ install -m 755 dyp2gram.pl $(BINDIR)/dyp2gram ++ install -d $(MANDIR) ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 + cd dyplib; $(MAKE) install2 + + ifdef CAMLOPT +--- dypgen.20120619-1/dyplib/Makefile.orig 2013-04-02 16:15:48.000000000 +0200 ++++ dypgen.20120619-1/dyplib/Makefile 2013-04-02 16:16:41.000000000 +0200 +@@ -28,15 +28,18 @@ + - $(OCAMLFIND) remove -destdir $(DYPGENLIBDIR) dyp + + install2: install_dyp install_opt +- install -D --mode=644 dyp.cmi $(DYPGENLIBDIR)/dyp ++ install -d $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.cmi $(DYPGENLIBDIR)/dyp + + install_dyp: +- install -D --mode=644 dyp.cma $(DYPGENLIBDIR)/dyp ++ install -d $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.cma $(DYPGENLIBDIR)/dyp + + ifdef CAMLOPT + install_opt: +- install -D --mode=644 dyp.cmxa $(DYPGENLIBDIR)/dyp +- install -D --mode=644 dyp.a $(DYPGENLIBDIR)/dyp ++ install -d $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.cmxa $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.a $(DYPGENLIBDIR)/dyp + else + install_opt: + endif diff --git a/patches/easy-format/easy-format-make.diff b/patches/easy-format/easy-format-make.diff new file mode 100644 index 0000000..3569050 --- /dev/null +++ b/patches/easy-format/easy-format-make.diff @@ -0,0 +1,27 @@ +--- a/Makefile 2012-10-12 16:53:00.101688369 -0700 ++++ b/Makefile 2012-10-12 17:02:33.061706704 -0700 +@@ -6,10 +6,13 @@ + all: + ocamlc -c easy_format.mli + ocamlc -c -dtypes easy_format.ml ++ ocamlmklib -o easy_format easy_format.cmo + touch bytecode + opt: + ocamlc -c easy_format.mli + ocamlopt -c -dtypes easy_format.ml ++ ocamlmklib -o easy_format easy_format.cmx ++ ocamlopt -I . -shared -linkall -o easy_format.cmxs easy_format.cmx + touch nativecode + test: all simple_example.out + ocamlc -o test_easy_format -dtypes easy_format.cmo test_easy_format.ml +@@ -45,8 +48,8 @@ + + + COMMON_INSTALL_FILES = META easy_format.cmi easy_format.mli +-BC_INSTALL_FILES = easy_format.cmo +-NC_INSTALL_FILES = easy_format.cmx easy_format.o ++BC_INSTALL_FILES = easy_format.cmo easy_format.cma ++NC_INSTALL_FILES = easy_format.cmx easy_format.cmxa easy_format.cmxs easy_format.o easy_format.a + + install: + echo "version = \"$(VERSION)\"" > META; cat META.tpl >> META diff --git a/patches/easy-format/meta-tpl.diff b/patches/easy-format/meta-tpl.diff new file mode 100644 index 0000000..3d9a342 --- /dev/null +++ b/patches/easy-format/meta-tpl.diff @@ -0,0 +1,10 @@ +--- a/META.tpl 2012-10-12 17:46:54.701791877 -0700 ++++ b/META.tpl 2012-10-12 17:47:10.653792387 -0700 +@@ -1,4 +1,5 @@ + name = "easy-format" + description = "Indentation made easy(ier)" +-archive(byte) = "easy_format.cmo" +-archive(native) = "easy_format.cmx" ++archive(byte) = "easy_format.cmo" ++archive(native) = "easy_format.cmx" ++archive(native,plugin) = "easy_format.cmxs" diff --git a/patches/eigen/eigen.install.0.0.1 b/patches/eigen/eigen.install.0.0.1 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/eigen/eigen.install.0.0.1 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/eigen/eigen.install.0.0.2 b/patches/eigen/eigen.install.0.0.2 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/eigen/eigen.install.0.0.2 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/eigen/eigen.install.0.0.3 b/patches/eigen/eigen.install.0.0.3 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/eigen/eigen.install.0.0.3 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/eigen/eigen.install.0.0.4 b/patches/eigen/eigen.install.0.0.4 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/eigen/eigen.install.0.0.4 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/eigen/eigen.install.0.0.5 b/patches/eigen/eigen.install.0.0.5 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/eigen/eigen.install.0.0.5 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/eigen/eigen.install.0.0.6 b/patches/eigen/eigen.install.0.0.6 new file mode 100644 index 0000000..7b4c8f4 --- /dev/null +++ b/patches/eigen/eigen.install.0.0.6 @@ -0,0 +1,9 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] +lib: [ + "_build/include/libeigen.a" {"libeigen.a"} +] diff --git a/patches/electrumAnalyzer/_oasis_remove_.ml b/patches/electrumAnalyzer/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/electrumAnalyzer/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/electrumAnalyzer/electrumAnalyzer.install b/patches/electrumAnalyzer/electrumAnalyzer.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/electrumAnalyzer/electrumAnalyzer.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/elf2json/_oasis_remove_.ml b/patches/elf2json/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/elf2json/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/elf2json/elf2json.install b/patches/elf2json/elf2json.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/elf2json/elf2json.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/eliom/build-against-newer-lwt.diff b/patches/eliom/build-against-newer-lwt.diff new file mode 100644 index 0000000..d64ea33 --- /dev/null +++ b/patches/eliom/build-against-newer-lwt.diff @@ -0,0 +1,71 @@ +From f557bbcd771faa98ee746e1bf43dba53181beb5f Mon Sep 17 00:00:00 2001 +From: Mauricio Fernandez +Date: Sun, 26 Apr 2015 13:06:05 +0200 +Subject: [PATCH] Build against newer Lwt, where Lwt_util has been removed. + +--- + src/lib/eliom_state.server.ml | 2 +- + src/lib/server/eliommod_gc.ml | 2 +- + src/lib/server/eliommod_persess.ml | 6 +++--- + src/lib/server/eliommod_sessiongroups.ml | 2 +- + 4 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/lib/eliom_state.server.ml b/src/lib/eliom_state.server.ml +index f7ea0ca..3523fc3 100644 +--- a/src/lib/eliom_state.server.ml ++++ b/src/lib/eliom_state.server.ml +@@ -561,7 +561,7 @@ let set_persistent_data_session_group ?set_max + ?set_max + (fst sitedata.Eliom_common.max_persistent_data_sessions_per_group) + c.Eliom_common.pc_value !grp n in +- lwt () = Lwt_util.iter ++ lwt () = Lwt_list.iter_p + (Eliommod_persess.close_persistent_state2 + ~scope:(scope:>Eliom_common.user_scope) sitedata None) l in + grp := n; +diff --git a/src/lib/server/eliommod_gc.ml b/src/lib/server/eliommod_gc.ml +index 8167d64..bf6133b 100644 +--- a/src/lib/server/eliommod_gc.ml ++++ b/src/lib/server/eliommod_gc.ml +@@ -133,7 +133,7 @@ let gc_timeouted_services now tables = + Lwt.return () + end + in +- Lwt_util.iter_serial ++ Lwt_list.iter_s + (fun (_gen, _prio, t) -> empty_one t) tables.Eliom_common.table_services + >>= fun () -> + tables.Eliom_common.table_services <- +diff --git a/src/lib/server/eliommod_persess.ml b/src/lib/server/eliommod_persess.ml +index 18c0f5b..cba6b17 100644 +--- a/src/lib/server/eliommod_persess.ml ++++ b/src/lib/server/eliommod_persess.ml +@@ -152,9 +152,9 @@ let rec find_or_create_persistent_cookie_ + ?set_max:set_max_in_group + (fst sitedata.Eliom_common.max_persistent_data_sessions_per_group) + c fullsessgrp >>= fun l -> +- Lwt_util.iter (close_persistent_state2 +- ~scope:(cookie_scope :> Eliom_common.user_scope) +- sitedata None) l ++ Lwt_list.iter_p (close_persistent_state2 ++ ~scope:(cookie_scope :> Eliom_common.user_scope) ++ sitedata None) l + >>= fun () -> + Lwt.return + { Eliom_common.pc_value= c; +diff --git a/src/lib/server/eliommod_sessiongroups.ml b/src/lib/server/eliommod_sessiongroups.ml +index e69a62a..b7eb8f7 100644 +--- a/src/lib/server/eliommod_sessiongroups.ml ++++ b/src/lib/server/eliommod_sessiongroups.ml +@@ -475,7 +475,7 @@ module Pers = struct + (* First we close all sessions in the group *) + + find sess_grp >>= fun cl -> +- Lwt_util.iter ++ Lwt_list.iter_p + (close_persistent_session2 + ~cookie_level:(match cookie_level with + | `Client_process _ -> `Client_process | `Session -> `Session) +-- +1.8.5.2 + diff --git a/patches/eliom/eliom.install.2.2.2 b/patches/eliom/eliom.install.2.2.2 new file mode 100644 index 0000000..b7b0c44 --- /dev/null +++ b/patches/eliom/eliom.install.2.2.2 @@ -0,0 +1,7 @@ +bin: [ + "src/tools/eliomc" + "src/tools/eliomcp" + "src/tools/eliomdep" + "src/tools/eliomopt" + "src/tools/js_of_eliom" +] diff --git a/patches/eliom/eliom.install.3.0.0 b/patches/eliom/eliom.install.3.0.0 new file mode 100644 index 0000000..5b9d0c0 --- /dev/null +++ b/patches/eliom/eliom.install.3.0.0 @@ -0,0 +1,8 @@ +bin: [ + "src/tools/eliomc" + "src/tools/eliomcp" + "src/tools/eliomdep" + "src/tools/eliomopt" + "src/tools/js_of_eliom" + "src/tools/eliom-destillery" +] diff --git a/patches/eliom/eliom.install.3.0.1 b/patches/eliom/eliom.install.3.0.1 new file mode 100644 index 0000000..5b9d0c0 --- /dev/null +++ b/patches/eliom/eliom.install.3.0.1 @@ -0,0 +1,8 @@ +bin: [ + "src/tools/eliomc" + "src/tools/eliomcp" + "src/tools/eliomdep" + "src/tools/eliomopt" + "src/tools/js_of_eliom" + "src/tools/eliom-destillery" +] diff --git a/patches/eliom/eliom.install.3.0.2 b/patches/eliom/eliom.install.3.0.2 new file mode 100644 index 0000000..5b9d0c0 --- /dev/null +++ b/patches/eliom/eliom.install.3.0.2 @@ -0,0 +1,8 @@ +bin: [ + "src/tools/eliomc" + "src/tools/eliomcp" + "src/tools/eliomdep" + "src/tools/eliomopt" + "src/tools/js_of_eliom" + "src/tools/eliom-destillery" +] diff --git a/patches/eliom/eliom.install.3.0.3 b/patches/eliom/eliom.install.3.0.3 new file mode 100644 index 0000000..5b9d0c0 --- /dev/null +++ b/patches/eliom/eliom.install.3.0.3 @@ -0,0 +1,8 @@ +bin: [ + "src/tools/eliomc" + "src/tools/eliomcp" + "src/tools/eliomdep" + "src/tools/eliomopt" + "src/tools/js_of_eliom" + "src/tools/eliom-destillery" +] diff --git a/patches/eliom/fix_int64.patch b/patches/eliom/fix_int64.patch new file mode 100644 index 0000000..324dc37 --- /dev/null +++ b/patches/eliom/fix_int64.patch @@ -0,0 +1,123 @@ +diff -rN -u old-eliom.dev/src/client/eliom_client.ml new-eliom.dev/src/client/eliom_client.ml +--- old-eliom.dev/src/client/eliom_client.ml 2013-01-03 03:15:07.065648747 +0100 ++++ new-eliom.dev/src/client/eliom_client.ml 2013-01-03 03:15:07.201642149 +0100 +@@ -72,7 +72,7 @@ + end + + module Client_value : sig +- val find : closure_id:int64 -> instance_id:int -> _ ++ val find : closure_id:int64 -> instance_id:int64 -> _ + val initialize : client_value_datum -> unit + end = struct + +@@ -82,10 +82,10 @@ + Js.string (Int64.to_string closure_id) + + let instance_key instance_id = +- Js.string (string_of_int instance_id) ++ Js.string (Int64.to_string instance_id) + + let find ~closure_id ~instance_id = +- trace "Get client value %Ld/%d" closure_id instance_id; ++ trace "Get client value %Ld/%Ld" closure_id instance_id; + let value = + let instances = + Js.Optdef.get +@@ -105,7 +105,7 @@ + from_poly value + + let initialize {closure_id; instance_id; args} = +- trace "Initialize client value %Ld/%d" closure_id instance_id; ++ trace "Initialize client value %Ld/%Ld" closure_id instance_id; + let closure = + try + Client_closure.find ~closure_id +@@ -202,7 +202,7 @@ + "Code generating the following client values is not linked on the client: %s" + (String.concat "," + (List.map +- (fun d -> Printf.sprintf "%Ld/%d" d.closure_id d.instance_id) ++ (fun d -> Printf.sprintf "%Ld/%Ld" d.closure_id d.instance_id) + data))) + server_sections_data; + Queue.iter +@@ -357,7 +357,7 @@ + let handler = (Eliom_lib.from_poly value : #Dom_html.event Js.t -> unit) in + fun ev -> try handler ev; true with False -> false + with Not_found -> +- error "Client value %Ld/%d not found as event handler" closure_id instance_id ++ error "Client value %Ld/%Ld not found as event handler" closure_id instance_id + + let reify_caml_event node ce : #Dom_html.event Js.t -> bool = match ce with + | Xml.CE_call_service None -> (fun _ -> true) +diff -rN -u old-eliom.dev/src/common/eliom_lib_base.ml new-eliom.dev/src/common/eliom_lib_base.ml +--- old-eliom.dev/src/common/eliom_lib_base.ml 2013-01-03 03:15:07.085647778 +0100 ++++ new-eliom.dev/src/common/eliom_lib_base.ml 2013-01-03 03:15:07.209641761 +0100 +@@ -29,7 +29,7 @@ + end + + let fresh_ix () = +- Oo.id (object end) ++ Int64.of_int (Oo.id (object end)) + + let get_option = function + | Some x -> x +@@ -50,7 +50,7 @@ + + type +'a t = { + closure_id: int64; +- instance_id: int; ++ instance_id: int64; + } + + let create ~closure_id ~instance_id = +@@ -220,7 +220,7 @@ + + type client_value_datum = { + closure_id : int64; +- instance_id : int; ++ instance_id : int64; + args : poly; + } + +@@ -247,7 +247,7 @@ + List.rev !res + + let client_value_datum_to_string cv = +- Printf.sprintf "%Ld/%d" cv.closure_id cv.instance_id ++ Printf.sprintf "%Ld/%Ld" cv.closure_id cv.instance_id + + let list_to_string to_string li = + "["^String.concat " " (List.map to_string li)^"]" +diff -rN -u old-eliom.dev/src/common/eliom_lib_base.mli new-eliom.dev/src/common/eliom_lib_base.mli +--- old-eliom.dev/src/common/eliom_lib_base.mli 2013-01-03 03:15:07.085647778 +0100 ++++ new-eliom.dev/src/common/eliom_lib_base.mli 2013-01-03 03:15:07.209641761 +0100 +@@ -50,16 +50,16 @@ + *) + module Client_value_server_repr : sig + type +'a t +- val create: closure_id:int64 -> instance_id:int -> _ t ++ val create: closure_id:int64 -> instance_id:int64 -> _ t + val closure_id: _ t -> int64 +- val instance_id: _ t -> int ++ val instance_id: _ t -> int64 + end + + (** The representation of escaped values (values injected into client + values) is opaque. *) + type escaped_value = poly + +-val fresh_ix : unit -> int ++val fresh_ix : unit -> int64 + val get_option : 'a option -> 'a + + module RawXML : sig +@@ -148,7 +148,7 @@ + (** Data for initializing one client value *) + type client_value_datum = { + closure_id : int64; +- instance_id : int; ++ instance_id : int64; + args : poly; + } + diff --git a/patches/eliom/makefile_log.patch b/patches/eliom/makefile_log.patch new file mode 100644 index 0000000..f995f36 --- /dev/null +++ b/patches/eliom/makefile_log.patch @@ -0,0 +1,11 @@ +--- eliom-3.0.3/src/server/Makefile.orig 2013-09-01 23:03:58.000000000 +0100 ++++ eliom-3.0.3/src/server/Makefile 2013-09-01 23:04:17.000000000 +0100 +@@ -158,7 +158,7 @@ + ifneq (${DEPEND},no) + + ## Ugly side effect to force ${PREDEP} creation before dependencies calculation +-dummy_var := $(shell $(MAKE) DEPEND=no ${PREDEP} >/tmp/log 2>&1) ++dummy_var := $(shell $(MAKE) DEPEND=no ${PREDEP} >/dev/null 2>&1) + + DEPS := $(patsubst %,.%.deps,${COMMON_FILES}) \ + $(patsubst %,.%.deps,${COMMON_PFILES}) \ diff --git a/patches/elpi/0001-Makefile-pass-DUNE_OPTS-to-dune.patch b/patches/elpi/0001-Makefile-pass-DUNE_OPTS-to-dune.patch new file mode 100644 index 0000000..1d450c3 --- /dev/null +++ b/patches/elpi/0001-Makefile-pass-DUNE_OPTS-to-dune.patch @@ -0,0 +1,64 @@ +From e65cca8392e7c2bf822cf052ff084833d733f2a3 Mon Sep 17 00:00:00 2001 +From: Enrico Tassi +Date: Wed, 30 Oct 2019 10:01:17 +0100 +Subject: [PATCH 1/2] Makefile: pass DUNE_OPTS to dune + +--- + Makefile | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/Makefile b/Makefile +index 888c30e..25a3965 100644 +--- a/Makefile ++++ b/Makefile +@@ -23,10 +23,11 @@ RUNNERS=\ + $(shell if type tjsim >/dev/null 2>&1; then type -P tjsim; else echo; fi) + TIME=--time $(shell if type -P gtime >/dev/null 2>&1; then type -P gtime; else echo /usr/bin/time; fi) + STACK=32768 ++DUNE_OPTS= + + # this is to work around https://github.com/ocaml/dune/issues/1212 + .merlin: +- @dune build .merlin ++ @dune build $(DUNE_OPTS) .merlin + @for ppx in `ls $$PWD/_build/default/.ppx/*/ppx.exe`; do\ + if $$ppx --print-transformations | grep -q trace; then\ + echo PKG ppx_deriving.std ppx_deriving.runtime >> .merlin;\ +@@ -38,20 +39,20 @@ STACK=32768 + + build: + @$(MAKE) --no-print-directory .merlin +- dune build @install; RC=$?; $(MAKE) --no-print-directory .merlin; exit $$RC ++ dune build $(DUNE_OPTS) @install; RC=$?; $(MAKE) --no-print-directory .merlin; exit $$RC + + install: +- dune install ++ dune install $(DUNE_OPTS) + + doc: +- dune build @doc ++ dune build $(DUNE_OPTS) @doc + + clean: + rm -rf _build + + tests: +- dune build $(INSTALL)/bin/elpi +- dune build $(BUILD)/tests/test.exe ++ dune build $(DUNE_OPTS) $(INSTALL)/bin/elpi ++ dune build $(DUNE_OPTS) $(BUILD)/tests/test.exe + ulimit -s $(STACK); \ + $(BUILD)/tests/test.exe \ + --seed $$RANDOM \ +@@ -68,7 +69,7 @@ git/%: + git clone -l . "elpi-$*" + cd "elpi-$*" && git checkout "$*" + cd "elpi-$*" && \ +- if [ -f dune ]; then dune build --root . @install; else make; fi ++ if [ -f dune ]; then dune build --root . $(DUNE_OPTS) @install; else make; fi + cp "elpi-$*/elpi" "elpi.git.$*" || \ + cp "elpi-$*/$(INSTALL)/bin/elpi" "elpi.git.$*" + rm -rf "$$PWD/elpi-$*" +-- +2.17.1 + diff --git a/patches/elpi/use-digest.patch b/patches/elpi/use-digest.patch new file mode 100644 index 0000000..af627f4 --- /dev/null +++ b/patches/elpi/use-digest.patch @@ -0,0 +1,132 @@ +commit 652e8a892963949d6d9245c3e5cb252010b14b78 +Author: Enrico Tassi +Date: Tue Sep 15 21:50:01 2020 +0200 + + backport to the released version + +diff --git a/ppxfindcache/ppxfindcache_aux.ml b/ppxfindcache/ppxfindcache_aux.ml +index 187236e..1e5d932 100644 +--- a/ppxfindcache/ppxfindcache_aux.ml ++++ b/ppxfindcache/ppxfindcache_aux.ml +@@ -63,9 +63,8 @@ let common () = + let flag = !flag in + let cache x = List.mem (path_sanitize x) !cache in + +- let sha = must @@ exec "shasum" [|"-b";file|] in +- let sha = String.sub sha 0 (String.length sha - 1) in +- let sha = Printf.sprintf "(*%s %s*)\n" sha (String.concat " " (Array.to_list flag)) in ++ let sha = Digest.file file |> Digest.to_hex in ++ let sha = Printf.sprintf "(*%s %s %s*)\n" sha file (String.concat " " (Array.to_list flag)) in + + let cachefile = + let open Filename in +diff --git a/src/.ppcache/API.ml b/src/.ppcache/API.ml +index 5318655..19f2e0d 100644 +--- a/src/.ppcache/API.ml ++++ b/src/.ppcache/API.ml +@@ -1,4 +1,4 @@ +-(*5ea7f0e23680dfbc5f0478a3a360ac193a940fde *src/API.ml *) ++(*64d19644c71f086d31e63690c42dfe84 src/API.ml *) + #1 "src/API.ml" + module type Runtime = module type of Runtime_trace_off + let r = ref ((module Runtime_trace_off) : (module Runtime)) +diff --git a/src/.ppcache/API.mli b/src/.ppcache/API.mli +index 02dae16..1893984 100644 +--- a/src/.ppcache/API.mli ++++ b/src/.ppcache/API.mli +@@ -1,4 +1,4 @@ +-(*2417a3f401bc77492de0e537d65272a6bd92bf00 *src/API.mli *) ++(*bdc3c46b9662a45c5d6b274799ef95cc src/API.mli *) + #1 "src/API.mli" + [@@@ocaml.text " This module is the API for clients of the Elpi library. "] + [@@@ocaml.text +diff --git a/src/.ppcache/ast.ml b/src/.ppcache/ast.ml +index 18833f4..a0d7764 100644 +--- a/src/.ppcache/ast.ml ++++ b/src/.ppcache/ast.ml +@@ -1,4 +1,4 @@ +-(*095a98a5f2dbe7a3c5e1d0e961068875adcf026f *src/ast.ml *) ++(*5985c493149e486491278f47254411fe src/ast.ml *) + #1 "src/ast.ml" + open Util + module Func = +diff --git a/src/.ppcache/ast.mli b/src/.ppcache/ast.mli +index cd0c61b..21d91dc 100644 +--- a/src/.ppcache/ast.mli ++++ b/src/.ppcache/ast.mli +@@ -1,4 +1,4 @@ +-(*d1e10e659d2784c096b79ed06927f74b2b885a06 *src/ast.mli *) ++(*e0a52a0856e6cc92109645b89bfa9e88 src/ast.mli *) + #1 "src/ast.mli" + open Util + module Func : +diff --git a/src/.ppcache/compiler.ml b/src/.ppcache/compiler.ml +index b488c4b..f92a380 100644 +--- a/src/.ppcache/compiler.ml ++++ b/src/.ppcache/compiler.ml +@@ -1,4 +1,4 @@ +-(*e09c9ff20cab458722d50e6ca14a5bb19d5a6f73 *src/compiler.ml *) ++(*999f2a943301a3ca03c0f55794abfb64 src/compiler.ml *) + #1 "src/compiler.ml" + open Util + module F = Ast.Func +diff --git a/src/.ppcache/compiler.mli b/src/.ppcache/compiler.mli +index 7391f3d..6a81f4b 100644 +--- a/src/.ppcache/compiler.mli ++++ b/src/.ppcache/compiler.mli +@@ -1,4 +1,4 @@ +-(*d8234deab7c788c119394625649abaddbdc7ad33 *src/compiler.mli *) ++(*dbe59f4d93f12297981da288410c968b src/compiler.mli *) + #1 "src/compiler.mli" + open Util + open Data +diff --git a/src/.ppcache/data.ml b/src/.ppcache/data.ml +index 2744caa..4b20896 100644 +--- a/src/.ppcache/data.ml ++++ b/src/.ppcache/data.ml +@@ -1,4 +1,4 @@ +-(*83d0917ef4644ac288b486b091a03067003847df *src/data.ml *) ++(*5d54139938556e83da50b268b65cc434 src/data.ml *) + #1 "src/data.ml" + module Fmt = Format + module F = Ast.Func +diff --git a/src/.ppcache/runtime_trace_off.ml b/src/.ppcache/runtime_trace_off.ml +index 8c16b48..89b2b17 100644 +--- a/src/.ppcache/runtime_trace_off.ml ++++ b/src/.ppcache/runtime_trace_off.ml +@@ -1,4 +1,4 @@ +-(*d2284b18b7efca3e8e515d7da852773c403f167b *src/runtime_trace_off.ml --cookie elpi_trace="false"*) ++(*a6bae7446f8404ca49ee0c10fb1f7c86 src/runtime_trace_off.ml --cookie elpi_trace="false"*) + #1 "src/runtime_trace_off.ml" + module Fmt = Format + module F = Ast.Func +diff --git a/src/.ppcache/runtime_trace_off.mli b/src/.ppcache/runtime_trace_off.mli +index a87c508..2ff2370 100644 +--- a/src/.ppcache/runtime_trace_off.mli ++++ b/src/.ppcache/runtime_trace_off.mli +@@ -1,4 +1,4 @@ +-(*b993827a8ac92ff43df1206e5aefa0956bfcd36f *src/runtime_trace_off.mli --cookie elpi_trace="false"*) ++(*a2f05b2efbb3b34e64221a6cf8ecaafd src/runtime_trace_off.mli --cookie elpi_trace="false"*) + #1 "src/runtime_trace_off.mli" + open Util + open Data +diff --git a/src/.ppcache/runtime_trace_on.ml b/src/.ppcache/runtime_trace_on.ml +index 1dd6ae0..15f1d1a 100644 +--- a/src/.ppcache/runtime_trace_on.ml ++++ b/src/.ppcache/runtime_trace_on.ml +@@ -1,4 +1,4 @@ +-(*d2284b18b7efca3e8e515d7da852773c403f167b *src/runtime_trace_on.ml --cookie elpi_trace="true"*) ++(*a6bae7446f8404ca49ee0c10fb1f7c86 src/runtime_trace_on.ml --cookie elpi_trace="true"*) + #1 "src/runtime_trace_on.ml" + module Fmt = Format + module F = Ast.Func +diff --git a/src/.ppcache/runtime_trace_on.mli b/src/.ppcache/runtime_trace_on.mli +index a6c2f7d..bd218ad 100644 +--- a/src/.ppcache/runtime_trace_on.mli ++++ b/src/.ppcache/runtime_trace_on.mli +@@ -1,4 +1,4 @@ +-(*b993827a8ac92ff43df1206e5aefa0956bfcd36f *src/runtime_trace_on.mli --cookie elpi_trace="true"*) ++(*a2f05b2efbb3b34e64221a6cf8ecaafd src/runtime_trace_on.mli --cookie elpi_trace="true"*) + #1 "src/runtime_trace_on.mli" + open Util + open Data diff --git a/patches/elpi/win-temp-file.patch b/patches/elpi/win-temp-file.patch new file mode 100644 index 0000000..93cf0c6 --- /dev/null +++ b/patches/elpi/win-temp-file.patch @@ -0,0 +1,32 @@ +--- ./ppxfindcache/ppxfindcache.useppx.ml ++++ ./ppxfindcache/ppxfindcache.useppx.ml +@@ -6,7 +6,7 @@ + flush_all (); + if in_cache cachefile then begin + let tmp = Filename.temp_file "" ".ppfindcache" in +- let tmpfd = Unix.(openfile tmp [O_WRONLY] 00600) in ++ let tmpfd = Unix.(openfile tmp [O_WRONLY;O_SHARE_DELETE] 0o600) in + Unix.dup2 tmpfd Unix.stdout; + Printf.printf "%s#1 \"%s\"\n%!" sha file; + let argv = Array.concat [ [|Sys.executable_name;file|] ; ppx_args ] in +@@ -14,7 +14,12 @@ + flush_all (); + Unix.close tmpfd; + let o = open_out cachefile in +- let text = read_file (open_in tmp) in ++ let text = ++ let ch = open_in tmp in ++ let r = read_file ch in ++ close_in_noerr ch; ++ r ++ in + let text = Re.(Str.global_replace (Str.regexp_string "Ppx_deriving_runtime") "Ppx_deriving_runtime_proxy" text) in + output_fix o text 0 (String.length text); + output_char o '\n'; +@@ -22,4 +27,4 @@ + Sys.remove tmp; + end; + exit 0 +-;; +\ No newline at end of file ++;; diff --git a/patches/erm_xmpp/disable_tests.patch b/patches/erm_xmpp/disable_tests.patch new file mode 100644 index 0000000..7b1e83b --- /dev/null +++ b/patches/erm_xmpp/disable_tests.patch @@ -0,0 +1,43 @@ +diff --git a/setup.ml b/setup.ml +index 795b218..36b36cd 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -5946,7 +5946,11 @@ let setup_t = + cs_plugin_data = []; + }, + { +- bs_build = [(OASISExpr.EBool true, true)]; ++ bs_build = ++ [ ++ (OASISExpr.EBool true, false); ++ (OASISExpr.EFlag "tests", true) ++ ]; + bs_install = [(OASISExpr.EBool true, false)]; + bs_path = "tests"; + bs_compiled_object = Best; +@@ -5973,7 +5977,11 @@ let setup_t = + cs_plugin_data = []; + }, + { +- bs_build = [(OASISExpr.EBool true, true)]; ++ bs_build = ++ [ ++ (OASISExpr.EBool true, false); ++ (OASISExpr.EFlag "tests", true) ++ ]; + bs_install = [(OASISExpr.EBool true, false)]; + bs_path = "tests"; + bs_compiled_object = Best; +@@ -6002,7 +6010,11 @@ let setup_t = + cs_plugin_data = []; + }, + { +- bs_build = [(OASISExpr.EBool true, true)]; ++ bs_build = ++ [ ++ (OASISExpr.EBool true, false); ++ (OASISExpr.EFlag "tests", true) ++ ]; + bs_install = [(OASISExpr.EBool true, false)]; + bs_path = "tests"; + bs_compiled_object = Best; diff --git a/patches/extlib/0001-Add-support-for-OCaml-4.12.patch b/patches/extlib/0001-Add-support-for-OCaml-4.12.patch new file mode 100644 index 0000000..8a2d076 --- /dev/null +++ b/patches/extlib/0001-Add-support-for-OCaml-4.12.patch @@ -0,0 +1,25 @@ +From 3b2073701aed50cd768e0a4cd3c776c7a3a54d7e Mon Sep 17 00:00:00 2001 +From: Kate +Date: Thu, 5 Nov 2020 22:17:24 +0000 +Subject: [PATCH 1/2] Add support for OCaml 4.12 + +--- + src/extList.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/extList.ml b/src/extList.ml +index 4f0057f..a1435ee 100644 +--- a/src/extList.ml ++++ b/src/extList.ml +@@ -380,7 +380,7 @@ let combine l1 l2 = + loop dummy l1 l2; + dummy.tl + +-let sort ?(cmp=compare) = List.sort cmp ++let sort ?(cmp=Pervasives.compare) = List.sort cmp + + #if OCAML < 406 + let rec init size f = +-- +2.30.0 + diff --git a/patches/extlib/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch b/patches/extlib/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch new file mode 100644 index 0000000..59a6843 --- /dev/null +++ b/patches/extlib/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch @@ -0,0 +1,38 @@ +From 574e8eae2d358b6db62c2d062b194a7aa06ac02c Mon Sep 17 00:00:00 2001 +From: Kate +Date: Fri, 6 Nov 2020 14:10:26 +0000 +Subject: [PATCH 2/2] caml_hash_univ_param was removed for OCaml (pre-4.00 + function) + +--- + src/extHashtbl.ml | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/extHashtbl.ml b/src/extHashtbl.ml +index 140e9c2..3c69df4 100644 +--- a/src/extHashtbl.ml ++++ b/src/extHashtbl.ml +@@ -22,7 +22,7 @@ + module Hashtbl = + struct + +-#if OCAML >= 400 ++#if OCAML >= 400 && OCAML < 412 + external old_hash_param : + int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" + #endif +@@ -114,7 +114,11 @@ module Hashtbl = + (* compatibility with old hash tables *) + if Obj.size (Obj.repr h) >= 3 + then (seeded_hash_param 10 100 (h_conv h).seed key) land (Array.length (h_conv h).data - 1) ++ #if OCAML >= 412 ++ else failwith "Old hash function not supported anymore" ++ #else + else (old_hash_param 10 100 key) mod (Array.length (h_conv h).data) ++ #endif + #else + let key_index h key = (hash key) mod (Array.length (h_conv h).data) + #endif +-- +2.30.0 + diff --git a/patches/extlib/extlib.install b/patches/extlib/extlib.install new file mode 100644 index 0000000..cfd3d02 --- /dev/null +++ b/patches/extlib/extlib.install @@ -0,0 +1,26 @@ +lib: [ + "extLib.cma" + "extLib.cmi" + "extLib.cmxa" + "extLib.a" + "base64.cmi" + "dynArray.cmi" + "extHashtbl.cmi" + "extString.cmi" + "option.cmi" + "refList.cmi" + "unzip.cmi" + "bitSet.cmi" + "enum.cmi" + "extLib.cmi" + "global.cmi" + "optParse.cmi" + "std.cmi" + "uTF8.cmi" + "dllist.cmi" + "extArray.cmi" + "extList.cmi" + "IO.cmi" + "pMap.cmi" + "uChar.cmi" +] diff --git a/patches/extlib/extlib.ocp b/patches/extlib/extlib.ocp new file mode 100644 index 0000000..126d9c6 --- /dev/null +++ b/patches/extlib/extlib.ocp @@ -0,0 +1,29 @@ +comp = [ "-g" ] +link = [ "-g" ] + +begin library "extlib" + sort = true + files = [ + "unzip.ml" + "uTF8.ml" + "uChar.ml" + "std.ml" + "refList.ml" + "pMap.ml" + "option.ml" + "optParse.ml" + "install.ml" + "IO.ml" + "global.ml" + "extString.ml" + "extList.ml" + "extLib.ml" + "extHashtbl.ml" + "extArray.ml" + "enum.ml" + "dynArray.ml" + "dllist.ml" + "bitSet.ml" + "base64.ml" + ] +end diff --git a/patches/extlib/opam.patch b/patches/extlib/opam.patch new file mode 100644 index 0000000..870598e --- /dev/null +++ b/patches/extlib/opam.patch @@ -0,0 +1,12 @@ +diff -ru extlib.1.5.2/Makefile extlib.1.5.2/Makefile +--- extlib.1.5.2/Makefile 2011-08-06 16:56:39.000000000 +0200 ++++ extlib.1.5.2/Makefile 2012-10-05 18:15:17.734428987 +0200 +@@ -20,7 +20,7 @@ + cp odoc_style.css doc/style.css + + install: +- ocamlfind install extlib META *.cmi *.cma $(MLI) $(wildcard *.cmxa) $(wildcard *.a) ++ ocamlfind install extlib META extLib.cmxs *.cmi *.cma $(MLI) $(wildcard *.cmxa) $(wildcard *.a) + + uninstall: + ocamlfind remove extlib diff --git a/patches/extprot/no_bin_annot.patch b/patches/extprot/no_bin_annot.patch new file mode 100644 index 0000000..e8f9ebe --- /dev/null +++ b/patches/extprot/no_bin_annot.patch @@ -0,0 +1,13 @@ +diff --git a/OMakefile b/OMakefile +index 568bb34..017f0dc 100644 +--- a/OMakefile ++++ b/OMakefile +@@ -12,7 +12,7 @@ BYTE_ENABLED = true + + ENDIANNESS = LITTLE_ENDIAN + +-OCAMLFLAGS = -bin-annot -w +a-4-6-9-27..29-32..99 -warn-error +a-4-6-7-9-18-27..29-32..99 ++OCAMLFLAGS = -w +a-4-6-9-27..29-32..99 -warn-error +a-4-6-7-9-18-27..29-32..99 + OCAMLOPTFLAGS = -g -inline 100 + OCAMLCFLAGS += -g + diff --git a/patches/ezjsonm/build_with_trunk.patch b/patches/ezjsonm/build_with_trunk.patch new file mode 100644 index 0000000..64f5edb --- /dev/null +++ b/patches/ezjsonm/build_with_trunk.patch @@ -0,0 +1,13 @@ +diff --git a/lib/ezjsonm.mli b/lib/ezjsonm.mli +index e6a51e7..f3f3da6 100644 +--- a/lib/ezjsonm.mli ++++ b/lib/ezjsonm.mli +@@ -123,7 +123,7 @@ val triple: ('a -> value) -> ('b -> value) -> ('c -> value) -> + + (** {2 Accessors} *) + +-exception Parse_error of value * string ++(* exception Parse_error of value * string *) + (** All the following accessor functions expect the provided JSON + document to be of a certain kind. In case this is not the case, + [Parse_error] is raised. *) diff --git a/patches/facile/META.1.1 b/patches/facile/META.1.1 new file mode 100644 index 0000000..91156d6 --- /dev/null +++ b/patches/facile/META.1.1 @@ -0,0 +1,5 @@ +name = "facile" +version = "1.1" +description = "A CSP(Fd) library for OCaml" +archive(byte) = "facile.cma" +archive(native) = "facile.cmxa" \ No newline at end of file diff --git a/patches/facile/bsdmake.patch b/patches/facile/bsdmake.patch new file mode 100644 index 0000000..240b11c --- /dev/null +++ b/patches/facile/bsdmake.patch @@ -0,0 +1,46 @@ +--- a/Makefile.orig 2013-09-01 19:17:45.000000000 +0100 ++++ b/Makefile 2013-09-01 19:17:53.000000000 +0100 +@@ -3,7 +3,7 @@ + include config_Makefile + + compile: +- cd src; make ++ cd src; $(MAKE) + + install: + if test -d $(FACILEDIR); then : ; else mkdir $(FACILEDIR); fi +@@ -14,10 +14,10 @@ + chmod a+r $(FACILEDIR)/facile.a + + clean: +- cd src; make clean ++ cd src; $(MAKE) clean + + distclean uninstall: + rm -fr $(FACILEDIR) + + check: +- cd examples; make FACILEDIR=../src queens.opt; ./queens.opt 8 ++ cd examples; $(MAKE) FACILEDIR=../src queens.opt; ./queens.opt 8 +--- a/src/Makefile.orig 2013-09-01 19:20:47.000000000 +0100 ++++ b/src/Makefile 2013-09-01 19:21:07.000000000 +0100 +@@ -28,7 +28,7 @@ + # Version of the library to be linked with the -p (profiler) option + facile.p.cmxa : $(CSTR) + rm -fr $(CSTRCMX) +- make facile.cmxa OPTOPT=-p ++ $(MAKE) facile.cmxa OPTOPT=-p + rm -fr $(CSTRCMX) + mv facile.cmxa $@ + mv facile.a facile.p.a +@@ -41,8 +41,8 @@ + # Does not work with many modules (e.g. containing class expressions + facile.exp.cmxa : $(CSTR) + rm -fr $(CSTRCMX) +- make fcl_stak.cmx fcl_cstr.cmx fcl_inv.cmx fcl_reify.cmx fcl_arith.cmx fcl_goals.cmx fcl_fdArray.cmx fcl_gcc.cmx fcl_alldiff.cmx fcl_sorting.cmx fcl_interval.cmx facile.cmx +- make facile.cmxa OPTOPT="-pp inline_functors" ++ $(MAKE) fcl_stak.cmx fcl_cstr.cmx fcl_inv.cmx fcl_reify.cmx fcl_arith.cmx fcl_goals.cmx fcl_fdArray.cmx fcl_gcc.cmx fcl_alldiff.cmx fcl_sorting.cmx fcl_interval.cmx facile.cmx ++ $(MAKE) facile.cmxa OPTOPT="-pp inline_functors" + rm -fr $(CSTRCMX) + mv facile.cmxa $@ + mv facile.a facile.exp.a diff --git a/patches/facile/facile.install b/patches/facile/facile.install new file mode 100644 index 0000000..7c85df4 --- /dev/null +++ b/patches/facile/facile.install @@ -0,0 +1 @@ +lib: ["META"] diff --git a/patches/facile/ocaml_4.00.patch b/patches/facile/ocaml_4.00.patch new file mode 100644 index 0000000..429405f --- /dev/null +++ b/patches/facile/ocaml_4.00.patch @@ -0,0 +1,12 @@ +diff -rupN facile-1.1/src/fcl_data.ml facile-1.1-patched//src/fcl_data.ml +--- facile-1.1/src/fcl_data.ml 2004-09-08 11:51:02.000000000 +0200 ++++ facile-1.1-patched//src/fcl_data.ml 2012-12-16 13:49:36.286722670 +0100 +@@ -16,7 +16,7 @@ end + + module Hashtbl = struct + type ('a, 'b) t = ('a, 'b) Hashtbl.t +- let create = Hashtbl.create ++ let create x = Hashtbl.create x + let get h = h + + let add h k d = diff --git a/patches/fieldslib/disable_warn_error.patch b/patches/fieldslib/disable_warn_error.patch new file mode 100644 index 0000000..54645a4 --- /dev/null +++ b/patches/fieldslib/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.491655982 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.642903897 -0500 +@@ -575,7 +575,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/flowtype/flowtype.install b/patches/flowtype/flowtype.install new file mode 100644 index 0000000..5e82408 --- /dev/null +++ b/patches/flowtype/flowtype.install @@ -0,0 +1 @@ +bin: ["bin/flow" {"flow"}] diff --git a/patches/frag/frag.install b/patches/frag/frag.install new file mode 100644 index 0000000..d817710 --- /dev/null +++ b/patches/frag/frag.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/fragment_main.byte" {"frag"} + "?_build/src/fragment_main.native" {"frag"} +] diff --git a/patches/frama-c-base/4.05-support.patch b/patches/frama-c-base/4.05-support.patch new file mode 100644 index 0000000..45540fa --- /dev/null +++ b/patches/frama-c-base/4.05-support.patch @@ -0,0 +1,162 @@ +From 282370281cb8c720620851e339664cc07fd8e4b2 Mon Sep 17 00:00:00 2001 +From: Virgile Prevosto +Date: Mon, 27 Feb 2017 08:50:26 +0100 +Subject: [PATCH] 4.05 compatibility + +--- + src/kernel_services/analysis/dataflow.ml | 2 +- + src/kernel_services/analysis/dataflow2.ml | 2 +- + src/libraries/project/state_builder.ml | 17 ++++++++++++++- + src/libraries/utils/hook.ml | 5 +++-- + src/plugins/wp/qed/src/idxset.ml | 36 +++++++++++++++---------------- + 5 files changed, 39 insertions(+), 23 deletions(-) + +diff --git a/src/kernel_services/analysis/dataflow.ml b/src/kernel_services/analysis/dataflow.ml +index 0f32f24..952d113 100644 +--- a/src/kernel_services/analysis/dataflow.ml ++++ b/src/kernel_services/analysis/dataflow.ml +@@ -83,7 +83,7 @@ end + module StartData(X: sig type t val size: int end) = struct + type data = X.t + open Cil_datatype.Stmt.Hashtbl +- let stmtStartData = create X.size ++ let stmtStartData: data Cil_datatype.Stmt.Hashtbl.t = create X.size + let clear () = clear stmtStartData + let mem = mem stmtStartData + let find = find stmtStartData +diff --git a/src/kernel_services/analysis/dataflow2.ml b/src/kernel_services/analysis/dataflow2.ml +index 0d6eb24..813ef7b 100644 +--- a/src/kernel_services/analysis/dataflow2.ml ++++ b/src/kernel_services/analysis/dataflow2.ml +@@ -60,7 +60,7 @@ end + module StartData(X: sig type t val size: int end) = struct + type data = X.t + open Cil_datatype.Stmt.Hashtbl +- let stmtStartData = create X.size ++ let stmtStartData: data Cil_datatype.Stmt.Hashtbl.t = create X.size + let clear () = clear stmtStartData + let mem = mem stmtStartData + let find = find stmtStartData +diff --git a/src/libraries/project/state_builder.ml b/src/libraries/project/state_builder.ml +index 8d07c0d..781e5ff 100644 +--- a/src/libraries/project/state_builder.ml ++++ b/src/libraries/project/state_builder.ml +@@ -585,8 +585,23 @@ module type Weak_hashtbl = sig + val remove: data -> unit + end + ++module type Sub_caml_weak_hashtbl = ++sig ++ include Datatype.Sub_caml_weak_hashtbl ++ val clear: t -> unit ++ val merge: t -> data -> data ++ val add: t -> data -> unit ++ val count: t -> int ++ val iter: (data->unit) -> t -> unit ++ val fold: (data->'a->'a) -> t -> 'a -> 'a ++ val find: t -> data -> data ++ val find_all: t -> data -> data list ++ val mem: t -> data -> bool ++ val remove: t -> data -> unit ++end ++ + module Weak_hashtbl +- (W: Weak.S) ++ (W: Sub_caml_weak_hashtbl) + (Data: Datatype.S with type t = W.data) + (Info: Info_with_size) = + struct +diff --git a/src/libraries/utils/hook.ml b/src/libraries/utils/hook.ml +index 7c4e762..53021dd 100644 +--- a/src/libraries/utils/hook.ml ++++ b/src/libraries/utils/hook.ml +@@ -54,7 +54,7 @@ let add_once v queue = + let already = Queue.fold (fun b v' -> b || v' == v) false queue in + if not already then Queue.add v queue + +-module Build(P:sig type t end) = struct ++module Build(P:sig type t end): Iter_hook with type param = P.t = struct + type param = P.t + type result = unit + let hooks = Queue.create () +@@ -74,7 +74,8 @@ module Build(P:sig type t end) = struct + let length () = Queue.length hooks + end + +-module Fold(P:sig type t end) = struct ++module Fold(P:sig type t end): S with type param=P.t and type result = P.t = ++struct + type param = P.t + type result = P.t + let hooks = Queue.create () +diff --git a/src/plugins/wp/qed/src/idxset.ml b/src/plugins/wp/qed/src/idxset.ml +index 941384b..54d0b3e 100644 +--- a/src/plugins/wp/qed/src/idxset.ml ++++ b/src/plugins/wp/qed/src/idxset.ml +@@ -69,48 +69,48 @@ struct + (* good sharing *) + let remove x = Intmap.remove (E.id x) + let is_empty = Intmap.is_empty +- let mem x = Intmap.mem (E.id x) +- let find x = Intmap.find (E.id x) ++ let mem x m = Intmap.mem (E.id x) m ++ let find x m = Intmap.find (E.id x) m + let cardinal = Intmap.size +- let compare = Intmap.compare (fun _ _ -> 0) +- let equal = Intmap.equal (fun _ _ -> true) ++ let compare m1 m2 = Intmap.compare (fun _ _ -> 0) m1 m2 ++ let equal m1 m2 = Intmap.equal (fun _ _ -> true) m1 m2 + + let _keep _ x _ = x + let _keepq _ x _ = Some x + let _same _ _ _ = true + + (* good sharing *) +- let union = Intmap.union _keep ++ let union m1 m2 = Intmap.union _keep m1 m2 + + (* good sharing *) +- let inter = Intmap.interq _keepq ++ let inter m1 m2 = Intmap.interq _keepq m1 m2 + + (* good sharing *) +- let diff = Intmap.diffq _keepq +- let subset = Intmap.subset _same +- let intersect = Intmap.intersectf _same ++ let diff m1 m2 = Intmap.diffq _keepq m1 m2 ++ let subset m1 m2 = Intmap.subset _same m1 m2 ++ let intersect m1 m2 = Intmap.intersectf _same m1 m2 + + (* increasing order on id *) +- let iter f = Intmap.iteri (fun _i x -> f x) ++ let iter f m = Intmap.iteri (fun _i x -> f x) m + + (* increasing order on id *) +- let fold f = Intmap.foldi (fun _i x e -> f x e) ++ let fold f m i = Intmap.foldi (fun _i x e -> f x e) m i + + (* good sharing *) +- let filter f = Intmap.filter (fun _i x -> f x) ++ let filter f m = Intmap.filter (fun _i x -> f x) m + + (* good sharing *) +- let partition f = Intmap.partition (fun _i x -> f x) ++ let partition f m = Intmap.partition (fun _i x -> f x) m + +- let for_all f = Intmap.for_all (fun _i x -> f x) +- let exists f = Intmap.exists (fun _i x -> f x) ++ let for_all f m = Intmap.for_all (fun _i x -> f x) m ++ let exists f m = Intmap.exists (fun _i x -> f x) m + + (* increasing order on id *) +- let elements = Intmap.mapl (fun _i x -> x) ++ let elements m = Intmap.mapl (fun _i x -> x) m + + (* good sharing *) +- let mapf f= Intmap.mapq (fun _i x -> f x) ++ let mapf f m = Intmap.mapq (fun _i x -> f x) m + + (* good sharing *) +- let map f = Intmap.mapq (fun _i x -> Some (f x)) ++ let map f m = Intmap.mapq (fun _i x -> Some (f x)) m + end diff --git a/patches/frama-c-base/run_autoconf_if_needed.sh b/patches/frama-c-base/run_autoconf_if_needed.sh new file mode 100644 index 0000000..2b9fc23 --- /dev/null +++ b/patches/frama-c-base/run_autoconf_if_needed.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +if [ ! -f "configure" ]; then + autoconf +fi diff --git a/patches/frama-c-base/wp-ocaml-403.patch b/patches/frama-c-base/wp-ocaml-403.patch new file mode 100644 index 0000000..6a8d8fe --- /dev/null +++ b/patches/frama-c-base/wp-ocaml-403.patch @@ -0,0 +1,11 @@ +--- a/src/plugins/wp/wpo.mli ++++ b/src/plugins/wp/wpo.mli +@@ -127,7 +127,7 @@ type po = t and t = { + + module S : Datatype.S_with_collections with type t = po + module Index : Map.OrderedType with type t = index +-module Gmap : Map.S with type key = index ++module Gmap : FCMap.S with type key = index + + (** Dynamically exported + @since Nitrogen-20111001 diff --git a/patches/frama-c-e-acsl/run_autoconf_if_needed.ml b/patches/frama-c-e-acsl/run_autoconf_if_needed.ml new file mode 100644 index 0000000..a16c6e9 --- /dev/null +++ b/patches/frama-c-e-acsl/run_autoconf_if_needed.ml @@ -0,0 +1,5 @@ + + +let () = + if not (Sys.file_exists "configure") then + exit (Sys.command "autoconf") diff --git a/patches/frama-c/0004-Port-to-OCamlgraph-1.8.5.patch b/patches/frama-c/0004-Port-to-OCamlgraph-1.8.5.patch new file mode 100644 index 0000000..798d17f --- /dev/null +++ b/patches/frama-c/0004-Port-to-OCamlgraph-1.8.5.patch @@ -0,0 +1,254 @@ +From: Mehdi Dogguy +Date: Sun, 27 Apr 2014 13:46:16 +0200 +Subject: Port to OCamlgraph 1.8.5 + +--- + src/impact/reason_graph.ml | 2 +- + src/kernel/stmts_graph.ml | 10 +++++----- + src/logic/property_status.ml | 8 ++++---- + src/misc/service_graph.ml | 4 ++-- + src/pdg_types/pdgTypes.ml | 6 +++--- + src/postdominators/print.ml | 2 +- + src/semantic_callgraph/register.ml | 4 ++-- + src/slicing/printSlice.ml | 10 +++++----- + src/syntactic_callgraph/register.ml | 4 ++-- + src/wp/cil2cfg.ml | 12 ++++++------ + 10 files changed, 31 insertions(+), 31 deletions(-) + +diff --git a/src/impact/reason_graph.ml b/src/impact/reason_graph.ml +index eabacb0..ce19b4a 100644 +--- a/src/impact/reason_graph.ml ++++ b/src/impact/reason_graph.ml +@@ -139,7 +139,7 @@ module Printer (X: AdditionalInfo) = struct + + let graph_attributes _ = [`Label "Impact graph"] + +- let default_vertex_attributes _g = [`Style [`Filled]; `Shape `Box] ++ let default_vertex_attributes _g = [`Style `Filled; `Shape `Box] + let default_edge_attributes _g = [] + + let vertex_attributes v = +diff --git a/src/kernel/stmts_graph.ml b/src/kernel/stmts_graph.ml +index a8fe121..16059c3 100644 +--- a/src/kernel/stmts_graph.ml ++++ b/src/kernel/stmts_graph.ml +@@ -157,12 +157,12 @@ module TP = struct + + let vertex_attributes s = + match s.skind with +- | Loop _ -> [`Color 0xFF0000; `Style [`Filled]] +- | If _ -> [`Color 0x00FF00; `Style [`Filled]; `Shape `Diamond] +- | Return _ -> [`Color 0x0000FF; `Style [`Filled]] ++ | Loop _ -> [`Color 0xFF0000; `Style `Filled] ++ | If _ -> [`Color 0x00FF00; `Style `Filled; `Shape `Diamond] ++ | Return _ -> [`Color 0x0000FF; `Style `Filled] + | Block _ -> [`Shape `Box; `Fontsize 8] +- | Goto _ -> [`Shape `Diamond; `Color 0x00FFFF ; `Style [`Filled]] +- | Instr (Skip _) -> [`Color 0x00FFFF ; `Style [`Filled]] ++ | Goto _ -> [`Shape `Diamond; `Color 0x00FFFF ; `Style `Filled] ++ | Instr (Skip _) -> [`Color 0x00FFFF ; `Style `Filled] + | _ -> [] + let default_vertex_attributes _ = [] + +diff --git a/src/logic/property_status.ml b/src/logic/property_status.ml +index f7c278d..47485f6 100644 +--- a/src/logic/property_status.ml ++++ b/src/logic/property_status.ml +@@ -1481,12 +1481,12 @@ module Consolidation_graph = struct + let s = get_status p in + let color = status_color p s in + let style = match s with +- | Never_tried -> [`Style [`Bold]; `Width 0.8 ] +- | _ -> [`Style [`Filled]] ++ | Never_tried -> [`Style `Bold; `Width 0.8 ] ++ | _ -> [`Style `Filled] + in + style @ [ label v; `Color color; `Shape `Box ] + | Emitter _ as v -> +- [ label v; `Shape `Diamond; `Color 0xb0c4de; `Style [`Filled] ] ++ [ label v; `Shape `Diamond; `Color 0xb0c4de; `Style `Filled ] + | Tuning_parameter _ as v -> + [ label v; (*`Style `Dotted;*) `Color 0xb0c4de; ] + (*| Correctness_parameter _ (*as v*) -> assert false (*[ label v; `Color 0xb0c4de ]*)*) +@@ -1495,7 +1495,7 @@ module Consolidation_graph = struct + | None -> [] + | Some s -> + let c = emitted_status_color s in +- [ `Color c; `Fontcolor c; `Style [`Bold] ] ++ [ `Color c; `Fontcolor c; `Style `Bold ] + + let default_vertex_attributes _ = [] + let default_edge_attributes _ = [] +diff --git a/src/misc/service_graph.ml b/src/misc/service_graph.ml +index 4f866c5..d158028 100644 +--- a/src/misc/service_graph.ml ++++ b/src/misc/service_graph.ml +@@ -289,7 +289,7 @@ Src root:%s in %s (is_root:%b) Dst:%s in %s (is_root:%b) [2d case]" + color e + else + match CallG.E.label e with +- | Inter_services -> [ `Style [`Invis] ] ++ | Inter_services -> [ `Style `Invis ] + | Inter_functions | Both -> color e + + let default_edge_attributes _ = [] +@@ -303,7 +303,7 @@ Src root:%s in %s (is_root:%b) Dst:%s in %s (is_root:%b) [2d case]" + sg_attributes = + [ `Label ("S " ^ cs); + `Color (Extlib.number_to_color id); +- `Style [`Bold] ] } ++ `Style `Bold ] } + + end + +diff --git a/src/pdg_types/pdgTypes.ml b/src/pdg_types/pdgTypes.ml +index 05754e4..74cdebf 100644 +--- a/src/pdg_types/pdgTypes.ml ++++ b/src/pdg_types/pdgTypes.ml +@@ -626,7 +626,7 @@ module Pdg = struct + + let graph_attributes _ = [`Rankdir `TopToBottom ] + +- let default_vertex_attributes _ = [`Style [`Filled]] ++ let default_vertex_attributes _ = [`Style `Filled] + let vertex_name v = string_of_int (Node.id v) + + let vertex_attributes v = +@@ -711,13 +711,13 @@ module Pdg = struct + if Dpd.is_ctrl d then (`Arrowtail `Odot)::attrib else attrib + in + let attrib = +- if Dpd.is_addr d then (`Style [`Dotted])::attrib else attrib ++ if Dpd.is_addr d then (`Style `Dotted)::attrib else attrib + in + attrib + + let get_subgraph v = + let mk_subgraph name attrib = +- let attrib = (`Style [`Filled]) :: attrib in ++ let attrib = (`Style `Filled) :: attrib in + Some { Graph.Graphviz.DotAttributes.sg_name= name; + sg_parent = None; + sg_attributes = attrib } +diff --git a/src/postdominators/print.ml b/src/postdominators/print.ml +index f2e3a25..15f4ff2 100644 +--- a/src/postdominators/print.ml ++++ b/src/postdominators/print.ml +@@ -63,7 +63,7 @@ module Printer = struct + + let graph_attributes (title, _) = [`Label title] + +- let default_vertex_attributes _g = [`Style [`Filled]] ++ let default_vertex_attributes _g = [`Style `Filled] + let default_edge_attributes _g = [] + + let vertex_attributes (s, has_postdom) = +diff --git a/src/semantic_callgraph/register.ml b/src/semantic_callgraph/register.ml +index 1c79dcc..071f061 100644 +--- a/src/semantic_callgraph/register.ml ++++ b/src/semantic_callgraph/register.ml +@@ -102,8 +102,8 @@ module Service = + let name = Kernel_function.get_name + let attributes v = + [ `Style +- [if Kernel_function.is_definition v then `Bold +- else `Dotted] ] ++ (if Kernel_function.is_definition v then `Bold ++ else `Dotted) ] + let entry_point () = + try Some (fst (Globals.entry_point ())) + with Globals.No_such_entry_point _ -> None +diff --git a/src/slicing/printSlice.ml b/src/slicing/printSlice.ml +index c5363f9..211e0bb 100644 +--- a/src/slicing/printSlice.ml ++++ b/src/slicing/printSlice.ml +@@ -227,7 +227,7 @@ module PrintProject = struct + + let graph_attributes (name, _) = [`Label name] + +- let default_vertex_attributes _ = [`Style [`Filled]] ++ let default_vertex_attributes _ = [`Style `Filled] + + let vertex_name v = match v with + | Src fi -> SlicingMacros.fi_name fi +@@ -280,16 +280,16 @@ module PrintProject = struct + + let edge_attributes (e, call) = + let attrib = match e with +- | (Src _, Src _) -> [`Style [`Invis]] +- | (OptSliceCallers _, _) -> [`Style [`Invis]] +- | (_, OptSliceCallers _) -> [`Style [`Invis]] ++ | (Src _, Src _) -> [`Style `Invis] ++ | (OptSliceCallers _, _) -> [`Style `Invis] ++ | (_, OptSliceCallers _) -> [`Style `Invis] + | _ -> [] + in match call with None -> attrib + | Some call -> (`Label (string_of_int call.sid)):: attrib + + let get_subgraph v = + let mk_subgraph name attrib = +- let attrib = (*(`Label name) ::*) (`Style [`Filled]) :: attrib in ++ let attrib = (*(`Label name) ::*) (`Style `Filled) :: attrib in + Some { Graph.Graphviz.DotAttributes.sg_name= name; + sg_parent = None; + sg_attributes = attrib } +diff --git a/src/syntactic_callgraph/register.ml b/src/syntactic_callgraph/register.ml +index d4669c4..d41980e 100644 +--- a/src/syntactic_callgraph/register.ml ++++ b/src/syntactic_callgraph/register.ml +@@ -37,8 +37,8 @@ module Service = + let name v = nodeName v.cnInfo + let attributes v = + [ match v.cnInfo with +- | NIVar (_,b) when not !b -> `Style [`Dotted] +- | _ -> `Style [`Bold] ] ++ | NIVar (_,b) when not !b -> `Style `Dotted ++ | _ -> `Style `Bold ] + let equal v1 v2 = id v1 = id v2 + let compare v1 v2 = + let i1 = id v1 in +diff --git a/src/wp/cil2cfg.ml b/src/wp/cil2cfg.ml +index 6d8cf09..ba5f410 100644 +--- a/src/wp/cil2cfg.ml ++++ b/src/wp/cil2cfg.ml +@@ -1278,9 +1278,9 @@ module Printer (PE : sig val edge_txt : edge -> string end) = struct + | Vstart | Vend | Vexit -> [`Color 0x0000FF; `Shape `Doublecircle] + | VfctIn | VfctOut -> [`Color 0x0000FF; `Shape `Box] + | VblkIn _ | VblkOut _ -> [`Shape `Box] +- | Vloop _ | Vloop2 _ -> [`Color 0xFF0000; `Style [`Filled]] ++ | Vloop _ | Vloop2 _ -> [`Color 0xFF0000; `Style `Filled] + | Vtest _ | Vswitch _ -> +- [`Color 0x00FF00; `Style [`Filled]; `Shape `Diamond] ++ [`Color 0x00FF00; `Style `Filled; `Shape `Diamond] + | Vcall _ | Vstmt _ -> [] + in (`Label (String.escaped label))::attr + +@@ -1290,15 +1290,15 @@ module Printer (PE : sig val edge_txt : edge -> string end) = struct + let attr = [] in + let attr = (`Label (String.escaped (PE.edge_txt e)))::attr in + let attr = +- if is_back_edge e then (`Constraint false)::(`Style [`Bold])::attr ++ if is_back_edge e then (`Constraint false)::(`Style `Bold)::attr + else attr + in + let attr = match (edge_type e) with + | Ethen | EbackThen -> (`Color 0x00FF00)::attr + | Eelse | EbackElse -> (`Color 0xFF0000)::attr +- | Ecase [] -> (`Color 0x0000FF)::(`Style [`Dashed])::attr ++ | Ecase [] -> (`Color 0x0000FF)::(`Style `Dashed)::attr + | Ecase _ -> (`Color 0x0000FF)::attr +- | Enext -> (`Style [`Dotted])::attr ++ | Enext -> (`Style `Dotted)::attr + | Eback -> attr (* see is_back_edge above *) + | Enone -> attr + in +@@ -1308,7 +1308,7 @@ module Printer (PE : sig val edge_txt : edge -> string end) = struct + + let get_subgraph v = + let mk_subgraph name attrib = +- let attrib = (`Style [`Filled]) :: attrib in ++ let attrib = (`Style `Filled) :: attrib in + Some { Graph.Graphviz.DotAttributes.sg_name= name; + sg_parent = None; + sg_attributes = attrib } +-- diff --git a/patches/frama-c/01-tests-cpp-m32.patch b/patches/frama-c/01-tests-cpp-m32.patch new file mode 100644 index 0000000..19d376f --- /dev/null +++ b/patches/frama-c/01-tests-cpp-m32.patch @@ -0,0 +1,45 @@ +--- + tests/syntax/cpp-command.c | 2 +- + tests/syntax/oracle/cpp-command.0.res.oracle | 2 +- + tests/syntax/oracle/cpp-command.1.res.oracle | 2 +- + tests/syntax/oracle/cpp-command.4.res.oracle | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/syntax/cpp-command.c b/tests/syntax/cpp-command.c +index 3b58590a2b..7fc8bf5cf2 100644 +--- a/tests/syntax/cpp-command.c ++++ b/tests/syntax/cpp-command.c +@@ -1,5 +1,5 @@ + /* run.config* +- FILTER: sed "s:/[^ ]*/cpp-command\.[^ ]*\.i:TMPDIR/FILE.i:g; s:$PWD/::" ++ FILTER: sed "s:/[^ ]*/cpp-command\.[^ ]*\.i:TMPDIR/FILE.i:g; s:$PWD/::; s: -m32::" + OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo [\$(basename '%1') \$(basename '%1') \$(basename '%i') \$(basename '%input')] ['%2' '%2' '%o' '%output'] ['%args']" + OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %%1 = \$(basename '%1') %%2 = '%2' %%args = '%args'" + OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "printf \"%s\n\" \"using \\% has no effect : \$(basename \"\%input\")\"" +diff --git a/tests/syntax/oracle/cpp-command.0.res.oracle b/tests/syntax/oracle/cpp-command.0.res.oracle +index 258383ae1d..52bfebffa2 100644 +--- a/tests/syntax/oracle/cpp-command.0.res.oracle ++++ b/tests/syntax/oracle/cpp-command.0.res.oracle +@@ -1,2 +1,2 @@ + [kernel] Parsing tests/syntax/cpp-command.c (with preprocessing) +-[cpp-command.c cpp-command.c cpp-command.c cpp-command.c] [TMPDIR/FILE.i TMPDIR/FILE.i TMPDIR/FILE.i TMPDIR/FILE.i] [ -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32] ++[cpp-command.c cpp-command.c cpp-command.c cpp-command.c] [TMPDIR/FILE.i TMPDIR/FILE.i TMPDIR/FILE.i TMPDIR/FILE.i] [ -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc] +diff --git a/tests/syntax/oracle/cpp-command.1.res.oracle b/tests/syntax/oracle/cpp-command.1.res.oracle +index c53f5fd858..9fa845eca3 100644 +--- a/tests/syntax/oracle/cpp-command.1.res.oracle ++++ b/tests/syntax/oracle/cpp-command.1.res.oracle +@@ -1,2 +1,2 @@ + [kernel] Parsing tests/syntax/cpp-command.c (with preprocessing) +-%1 = cpp-command.c %2 = TMPDIR/FILE.i %args = -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32 ++%1 = cpp-command.c %2 = TMPDIR/FILE.i %args = -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc +diff --git a/tests/syntax/oracle/cpp-command.4.res.oracle b/tests/syntax/oracle/cpp-command.4.res.oracle +index db826509fc..2008e719f9 100644 +--- a/tests/syntax/oracle/cpp-command.4.res.oracle ++++ b/tests/syntax/oracle/cpp-command.4.res.oracle +@@ -1,2 +1,2 @@ + [kernel] Preprocessing command: +- gcc -E -C -I. -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32 'tests/syntax/cpp-command.c' -o 'TMPDIR/FILE.i' ++ gcc -E -C -I. -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc 'tests/syntax/cpp-command.c' -o 'TMPDIR/FILE.i' +-- +2.26.2 + diff --git a/patches/frama-c/02-tests-flamegraph.patch b/patches/frama-c/02-tests-flamegraph.patch new file mode 100644 index 0000000..2c97c4c --- /dev/null +++ b/patches/frama-c/02-tests-flamegraph.patch @@ -0,0 +1,47 @@ +--- + tests/fc_script/main.c | 1 - + tests/fc_script/oracle/flamegraph.err | 0 + tests/fc_script/oracle/flamegraph.html | 10 ---------- + tests/fc_script/oracle/flamegraph.res | 0 + 4 files changed, 11 deletions(-) + delete mode 100644 tests/fc_script/oracle/flamegraph.err + delete mode 100644 tests/fc_script/oracle/flamegraph.html + delete mode 100644 tests/fc_script/oracle/flamegraph.res + +diff --git a/tests/fc_script/main.c b/tests/fc_script/main.c +index d3e15e1b85..288eaca6d5 100644 +--- a/tests/fc_script/main.c ++++ b/tests/fc_script/main.c +@@ -2,7 +2,6 @@ + NOFRAMAC: testing frama-c-script, not frama-c itself + EXECNOW: LOG GNUmakefile LOG make_template.res LOG make_template.err cd @PTEST_DIR@ && PTESTS_TESTING= ../../bin/frama-c-script make-template result < make_template.input > result/make_template.res 2> result/make_template.err + EXECNOW: LOG list_files.res LOG list_files.err bin/frama-c-script list-files @PTEST_DIR@/list_files.json > @PTEST_DIR@/result/list_files.res 2> @PTEST_DIR@/result/list_files.err +- EXECNOW: LOG flamegraph.html LOG flamegraph.res LOG flamegraph.err NOGUI=1 bin/frama-c-script flamegraph @PTEST_DIR@/flamegraph.txt @PTEST_DIR@/result > @PTEST_DIR@/result/flamegraph.res 2> @PTEST_DIR@/result/flamegraph.err && rm -f @PTEST_DIR@/result/flamegraph.svg + EXECNOW: LOG find_fun1.res LOG find_fun1.err bin/frama-c-script find-fun main2 @PTEST_DIR@ > @PTEST_DIR@/result/find_fun1.res 2> @PTEST_DIR@/result/find_fun1.err + EXECNOW: LOG find_fun2.res LOG find_fun2.err bin/frama-c-script find-fun main3 @PTEST_DIR@ > @PTEST_DIR@/result/find_fun2.res 2> @PTEST_DIR@/result/find_fun2.err + EXECNOW: LOG find_fun3.res LOG find_fun3.err bin/frama-c-script find-fun false_positive @PTEST_DIR@ > @PTEST_DIR@/result/find_fun3.res 2> @PTEST_DIR@/result/find_fun3.err +diff --git a/tests/fc_script/oracle/flamegraph.err b/tests/fc_script/oracle/flamegraph.err +deleted file mode 100644 +index e69de29bb2..0000000000 +diff --git a/tests/fc_script/oracle/flamegraph.html b/tests/fc_script/oracle/flamegraph.html +deleted file mode 100644 +index 8414168d8d..0000000000 +--- a/tests/fc_script/oracle/flamegraph.html ++++ /dev/null +@@ -1,10 +0,0 @@ +- +- +- +- +- Eva Flamegraph +- +- +- +- +- +diff --git a/tests/fc_script/oracle/flamegraph.res b/tests/fc_script/oracle/flamegraph.res +deleted file mode 100644 +index e69de29bb2..0000000000 +-- +2.26.2 + diff --git a/patches/frama-c/4.01-compat.patch b/patches/frama-c/4.01-compat.patch new file mode 100644 index 0000000..d719cce --- /dev/null +++ b/patches/frama-c/4.01-compat.patch @@ -0,0 +1,151 @@ +diff -ur frama-c.20130601/external/hptmap.ml ../frama-c.20130601/external/hptmap.ml +--- frama-c.20130601/external/hptmap.ml 2013-06-11 16:15:19.000000000 +0200 ++++ ../frama-c.20130601/external/hptmap.ml 2013-08-27 11:12:04.145187344 +0200 +@@ -357,6 +357,21 @@ + find htr + + ++ let find_key key htr = ++ let id = Key.id key in ++ let rec find htr = ++ match htr with ++ | Empty -> ++ raise Not_found ++ | Leaf (key', _, _) -> ++ if Key.equal key key' then ++ key' ++ else ++ raise Not_found ++ | Branch (_, mask, tree0, tree1, _) -> ++ find (if (id land mask) = 0 then tree0 else tree1) ++ in ++ find htr + + + let mem key htr = +diff -ur frama-c.20130601/external/hptmap.mli ../frama-c.20130601/external/hptmap.mli +--- frama-c.20130601/external/hptmap.mli 2013-06-11 16:15:19.000000000 +0200 ++++ ../frama-c.20130601/external/hptmap.mli 2013-08-27 11:12:30.621238364 +0200 +@@ -84,6 +84,9 @@ + for [k], it is overridden. *) + + val find : key -> t -> V.t ++ ++ val find_key: key -> t -> key ++ + val remove : key -> t -> t + (** [remove k m] returns the map [m] deprived from any binding involving + [k]. *) + +--- frama-c.20130601/src/kernel/file.ml 2013-06-11 16:13:13.000000000 +0200 ++++ ../frama-c.20130601/src/kernel/file.ml 2013-08-27 11:16:41.157719017 +0200 +@@ -322,6 +322,7 @@ + Printer.pp_logic_var lv Printer.pp_varinfo v + + method vlogic_info_decl li = ++ Logic_var.Hashtbl.add known_logic_info li.l_var_info li; + List.iter + (fun lv -> + if lv.lv_kind <> LVFormal then +@@ -769,10 +770,6 @@ + DoChildren + | _ -> DoChildren + +- method vlogic_info_decl li = +- Logic_var.Hashtbl.add known_logic_info li.l_var_info li; +- DoChildren +- + method vlogic_info_use li = + let unknown () = + check_abort "logic function %s has no information" li.l_var_info.lv_name +diff -ur frama-c.20130601/src/lib/hptset.ml ../frama-c.20130601/src/lib/hptset.ml +--- frama-c.20130601/src/lib/hptset.ml 2013-06-11 16:13:42.000000000 +0200 ++++ ../frama-c.20130601/src/lib/hptset.ml 2013-08-27 11:07:26.680649886 +0200 +@@ -26,6 +26,7 @@ + val empty: t + val is_empty: t -> bool + val mem: elt -> t -> bool ++ val find: elt -> t -> elt + val add: elt -> t -> t + val singleton: elt -> t + val remove: elt -> t -> t +@@ -71,6 +72,7 @@ + type elt = X.t + + let add k = add k () ++ let find = find_key + let iter f = iter (fun x () -> f x) + let fold f = fold (fun x () -> f x) + +diff -ur frama-c.20130601/src/lib/hptset.mli ../frama-c.20130601/src/lib/hptset.mli +--- frama-c.20130601/src/lib/hptset.mli 2013-06-11 16:13:42.000000000 +0200 ++++ ../frama-c.20130601/src/lib/hptset.mli 2013-08-27 11:05:03.992371348 +0200 +@@ -50,6 +50,8 @@ + val mem: elt -> t -> bool + (** [mem x s] tests whether [x] belongs to the set [s]. *) + ++ val find: elt -> t -> elt ++ + val add: elt -> t -> t + (** [add x s] returns a set containing all elements of [s], + plus [x]. If [x] was already in [s], [s] is returned unchanged. *) +Seulement dans frama-c.20130601/src/lib: hptset.mli.new +Seulement dans frama-c.20130601/src/lib: hptset.ml.new +Seulement dans frama-c.20130601/src/lib: hptset.ml.old +diff -ur frama-c.20130601/src/lib/setWithNearest.ml ../frama-c.20130601/src/lib/setWithNearest.ml +--- frama-c.20130601/src/lib/setWithNearest.ml 2013-06-11 16:13:42.000000000 +0200 ++++ ../frama-c.20130601/src/lib/setWithNearest.ml 2013-08-27 11:10:45.753036025 +0200 +@@ -165,6 +165,14 @@ + let c = Ord.compare x v in + c = 0 || mem x (if c < 0 then l else r) + ++ let rec find x = function ++ | Empty -> raise Not_found ++ | Node(l, v, r, _) -> ++ match Ord.compare x v with ++ | c when c < 0 -> find x l ++ | 0 -> v ++ | _ -> find x r ++ + let singleton x = Node(Empty, x, Empty, 1) + + let rec remove x = function +diff -ur frama-c.20130601/src/memory_state/cvalue.mli ../frama-c.20130601/src/memory_state/cvalue.mli +--- frama-c.20130601/src/memory_state/cvalue.mli 2013-06-11 16:13:51.000000000 +0200 ++++ ../frama-c.20130601/src/memory_state/cvalue.mli 2013-08-27 11:15:32.077586855 +0200 +@@ -35,8 +35,8 @@ + include module type of Location_Bytes + (* Too many aliases, and OCaml module system is not able to keep track + of all of them. Use some shortcuts *) +- with type z = Location_Bytes.z +- and type M.t = Location_Bytes.M.t ++ with type M.t = Location_Bytes.M.t ++ and type z = Location_Bytes.z + + include Lattice_With_Isotropy.S + with type t := t +Seulement dans ../frama-c.20130601/src/wp/qed: bin +Seulement dans ../frama-c.20130601/src/wp/qed/src: .depend +diff -ur frama-c.20130601/src/wp/qed/src/idxset.ml ../frama-c.20130601/src/wp/qed/src/idxset.ml +--- frama-c.20130601/src/wp/qed/src/idxset.ml 2013-06-11 16:13:23.000000000 +0200 ++++ ../frama-c.20130601/src/wp/qed/src/idxset.ml 2013-08-27 11:22:06.194343180 +0200 +@@ -59,6 +59,8 @@ + + let mem e s = mem_k (E.id e) s + ++ let find e s = if mem e s then e else raise Not_found ++ + let lowest_bit x = x land (-x) + + let branching_bit p0 p1 = lowest_bit (p0 lxor p1) +@@ -360,6 +362,8 @@ + + let mem e s = mem_k (index e) s + ++ let find e s = if mem e s then e else raise Not_found ++ + let mask k m = (k lor (m-1)) land (lnot m) + + (* we first write a naive implementation of [highest_bit] +Seulement dans ../frama-c.20130601/src/wp/qed/src: numbers.ml +Seulement dans ../frama-c.20130601/src/wp/share: .depend diff --git a/patches/frama-c/frama-c.install.7.0 b/patches/frama-c/frama-c.install.7.0 new file mode 100644 index 0000000..5e90de5 --- /dev/null +++ b/patches/frama-c/frama-c.install.7.0 @@ -0,0 +1,5 @@ +bin: [ + "bin/ptests.byte" + "bin/toplevel.byte" {"frama-c.byte"} + "bin/toplevel.opt" {"frama-c"} +] diff --git a/patches/frama-c/frama-c.install.8.0 b/patches/frama-c/frama-c.install.8.0 new file mode 100644 index 0000000..5e90de5 --- /dev/null +++ b/patches/frama-c/frama-c.install.8.0 @@ -0,0 +1,5 @@ +bin: [ + "bin/ptests.byte" + "bin/toplevel.byte" {"frama-c.byte"} + "bin/toplevel.opt" {"frama-c"} +] diff --git a/patches/frama-c/frama-c.install.9.0 b/patches/frama-c/frama-c.install.9.0 new file mode 100644 index 0000000..100cff9 --- /dev/null +++ b/patches/frama-c/frama-c.install.9.0 @@ -0,0 +1,7 @@ +bin: [ + "bin/ptests.byte" + "bin/toplevel.byte" {"frama-c.byte"} + "bin/toplevel.opt" {"frama-c"} + "bin/viewer.byte" {"frama-c-gui.byte"} + "bin/viewer.opt" {"frama-c-gui"} +] diff --git a/patches/frama-c/frama-c.install.9.1 b/patches/frama-c/frama-c.install.9.1 new file mode 100644 index 0000000..5e90de5 --- /dev/null +++ b/patches/frama-c/frama-c.install.9.1 @@ -0,0 +1,5 @@ +bin: [ + "bin/ptests.byte" + "bin/toplevel.byte" {"frama-c.byte"} + "bin/toplevel.opt" {"frama-c"} +] diff --git a/patches/frama-c/macos.patch b/patches/frama-c/macos.patch new file mode 100644 index 0000000..fd58eaf --- /dev/null +++ b/patches/frama-c/macos.patch @@ -0,0 +1,14 @@ +diff --git a/src/plugins/value/gen-api.sh b/src/plugins/value/gen-api.sh +index d00c16fdd4a..a64e6268c2d 100755 +--- a/src/plugins/value/gen-api.sh ++++ b/src/plugins/value/gen-api.sh +@@ -22,7 +22,8 @@ for i in "$@" + do + file=$(basename $i) + module=${file%.*} +- printf '\nmodule %s: sig\n' ${module^} ++ Module="$(echo "${module:0:1}" | tr '[:lower:]' '[:upper:]')${module:1}" ++ printf '\nmodule %s: sig\n' $Module + awk '/\[@@@ api_start\]/{flag=1;next} /\[@@@ api_end\]/{flag=0} flag{ print (NF ? " ":"") $0 }' $i + printf 'end\n' + done diff --git a/patches/frama-c/run_autoconf_if_needed.sh b/patches/frama-c/run_autoconf_if_needed.sh new file mode 100644 index 0000000..2b9fc23 --- /dev/null +++ b/patches/frama-c/run_autoconf_if_needed.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +if [ ! -f "configure" ]; then + autoconf +fi diff --git a/patches/frama-clang/CMakeLists.txt.patch b/patches/frama-clang/CMakeLists.txt.patch new file mode 100644 index 0000000..be6d8a3 --- /dev/null +++ b/patches/frama-clang/CMakeLists.txt.patch @@ -0,0 +1,31 @@ +diff --git a/framaCIRGen_src/CMakeLists.txt b/framaCIRGen_src/CMakeLists.txt +index 6ba2fd3c..b4e9aa32 100644 +--- a/framaCIRGen_src/CMakeLists.txt ++++ b/framaCIRGen_src/CMakeLists.txt +@@ -20,7 +20,7 @@ + # # + ########################################################################## + +-cmake_minimum_required(VERSION 3.6) ++cmake_minimum_required(VERSION 3.20) + + project(FramaCIRGen C CXX) + +@@ -28,6 +28,17 @@ set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + ++find_program(LLVM_CONFIG ++ NAMES $ENV{OPAM_LLVM_CONFIG} llvm-config llvm-config-15 llvm-config-14 ++ llvm-config-13 llvm-config-12 llvm-config-11 ++ REQUIRED) ++ ++execute_process(COMMAND ${LLVM_CONFIG} --cmakedir OUTPUT_VARIABLE CMAKE_LLVM_PREFIX) ++ ++cmake_path(GET CMAKE_LLVM_PREFIX PARENT_PATH CMAKE_LLVM_CLANG_PREFIX) ++set(Clang_DIR ${CMAKE_LLVM_CLANG_PREFIX}/clang) ++set(LLVM_DIR ${CMAKE_LLVM_CLANG_PREFIX}/llvm) ++ + find_package(Clang REQUIRED) + find_package(LLVM REQUIRED) + diff --git a/patches/frama-clang/build.sh.patch.in b/patches/frama-clang/build.sh.patch.in new file mode 100644 index 0000000..e946ffc --- /dev/null +++ b/patches/frama-clang/build.sh.patch.in @@ -0,0 +1,17 @@ +diff --git a/framaCIRGen_src/build.sh b/framaCIRGen_src/build.sh +index cdd9fcd0..d20fcbfb 100755 +--- a/framaCIRGen_src/build.sh ++++ b/framaCIRGen_src/build.sh +@@ -1,4 +1,4 @@ +-#! /usr/bin/bash ++#! /bin/sh + ########################################################################## + # # + # This file is part of Frama-Clang # +@@ -21,5 +21,5 @@ + # # + ########################################################################## + +-cmake . ++OPAM_LLVM_CONFIG=%{conf-llvm:config}% cmake . + make -j diff --git a/patches/freetennis/freetennis b/patches/freetennis/freetennis new file mode 100644 index 0000000..6807eec --- /dev/null +++ b/patches/freetennis/freetennis @@ -0,0 +1,2 @@ +#!/bin/sh +cd $(opam config var share)/freetennis && freetennis.native "$@" diff --git a/patches/freetennis/freetennis.install b/patches/freetennis/freetennis.install new file mode 100644 index 0000000..d0a8be3 --- /dev/null +++ b/patches/freetennis/freetennis.install @@ -0,0 +1,347 @@ +bin: ["freetennis.native" "freetennis"] +share: ["sfx/Ahh.wav" {"sfx/Ahh.wav"} + "sfx/auto search 11025.wav" {"sfx/auto search 11025.wav"} + "sfx/auto search.wav" {"sfx/auto search.wav"} + "sfx/battuta3.wav" {"sfx/battuta3.wav"} + "sfx/better not.wav" {"sfx/better not.wav"} + "sfx/can't reach.wav" {"sfx/can't reach.wav"} + "sfx/colpo.wav" {"sfx/colpo.wav"} + "sfx/contrazione1.wav" {"sfx/contrazione1.wav"} + "sfx/contrazione2.wav" {"sfx/contrazione2.wav"} + "sfx/contrazione4.wav" {"sfx/contrazione4.wav"} + "sfx/contrazione5.wav" {"sfx/contrazione5.wav"} + "sfx/correction.wav" {"sfx/correction.wav"} + "sfx/dive.wav" {"sfx/dive.wav"} + "sfx/fatica.wav" {"sfx/fatica.wav"} + "sfx/fh2.wav" {"sfx/fh2.wav"} + "sfx/fh.wav" {"sfx/fh.wav"} + "sfx/hff.wav" {"sfx/hff.wav"} + "sfx/hm.wav" {"sfx/hm.wav"} + "sfx/last correction.wav" {"sfx/last correction.wav"} + "sfx/menu_back.wav" {"sfx/menu_back.wav"} + "sfx/menu_selezione.wav" {"sfx/menu_selezione.wav"} + "sfx/muro2.wav" {"sfx/muro2.wav"} + "sfx/net.wav" {"sfx/net.wav"} + "sfx/no more corrections.wav" {"sfx/no more corrections.wav"} + "sfx/out.wav" {"sfx/out.wav"} + "sfx/palla leggera.wav" {"sfx/palla leggera.wav"} + "sfx/palla pesante.wav" {"sfx/palla pesante.wav"} + "sfx/palla.wav" {"sfx/palla.wav"} + "sfx/pubblico.wav" {"sfx/pubblico.wav"} + "sfx/rete.wav" {"sfx/rete.wav"} + "sfx/risposta1.wav" {"sfx/risposta1.wav"} + "sfx/spin.wav" {"sfx/spin.wav"} + "sfx/taglio.wav" {"sfx/taglio.wav"} + "sfx/too late.wav" {"sfx/too late.wav"} + "graphics/erba.bmp.png" {"graphics/erba.bmp.png"} + "graphics/terra.bmp.png" {"graphics/terra.bmp.png"} + "graphics/Brovesciovstop/1.bmp.png" {"graphics/Brovesciovstop/1.bmp.png"} + "graphics/adv.png" {"graphics/adv.png"} + "graphics/rete.bmp.png" {"graphics/rete.bmp.png"} + "graphics/Adrittov/6.bmp.png" {"graphics/Adrittov/6.bmp.png"} + "graphics/Adrittov/5.bmp.png" {"graphics/Adrittov/5.bmp.png"} + "graphics/Adrittov/3.bmp.png" {"graphics/Adrittov/3.bmp.png"} + "graphics/Adrittov/2.bmp.png" {"graphics/Adrittov/2.bmp.png"} + "graphics/Adrittov/1.bmp.png" {"graphics/Adrittov/1.bmp.png"} + "graphics/Adrittov/4.bmp.png" {"graphics/Adrittov/4.bmp.png"} + "graphics/Bdrittoback/01.bmp.png" {"graphics/Bdrittoback/01.bmp.png"} + "graphics/Bdrittoback/05.bmp.png" {"graphics/Bdrittoback/05.bmp.png"} + "graphics/Bdrittoback/06.bmp.png" {"graphics/Bdrittoback/06.bmp.png"} + "graphics/Bdrittoback/02.bmp.png" {"graphics/Bdrittoback/02.bmp.png"} + "graphics/Bdrittoback/04.bmp.png" {"graphics/Bdrittoback/04.bmp.png"} + "graphics/Bdrittoback/03.bmp.png" {"graphics/Bdrittoback/03.bmp.png"} + "graphics/Brovescio2mani/01.bmp.png" {"graphics/Brovescio2mani/01.bmp.png"} + "graphics/Brovescio2mani/05.bmp.png" {"graphics/Brovescio2mani/05.bmp.png"} + "graphics/Brovescio2mani/08.bmp.png" {"graphics/Brovescio2mani/08.bmp.png"} + "graphics/Brovescio2mani/06.bmp.png" {"graphics/Brovescio2mani/06.bmp.png"} + "graphics/Brovescio2mani/02.bmp.png" {"graphics/Brovescio2mani/02.bmp.png"} + "graphics/Brovescio2mani/11.bmp.png" {"graphics/Brovescio2mani/11.bmp.png"} + "graphics/Brovescio2mani/09.bmp.png" {"graphics/Brovescio2mani/09.bmp.png"} + "graphics/Brovescio2mani/10.bmp.png" {"graphics/Brovescio2mani/10.bmp.png"} + "graphics/Brovescio2mani/04.bmp.png" {"graphics/Brovescio2mani/04.bmp.png"} + "graphics/Brovescio2mani/03.bmp.png" {"graphics/Brovescio2mani/03.bmp.png"} + "graphics/Brovescio2mani/12.bmp.png" {"graphics/Brovescio2mani/12.bmp.png"} + "graphics/Brovescio2mani/13.bmp.png" {"graphics/Brovescio2mani/13.bmp.png"} + "graphics/Brovescio2mani/07.bmp.png" {"graphics/Brovescio2mani/07.bmp.png"} + "graphics/Bdrittoforwardstretch/01.bmp.png" {"graphics/Bdrittoforwardstretch/01.bmp.png"} + "graphics/Bdrittoforwardstretch/02.png" {"graphics/Bdrittoforwardstretch/02.png"} + "graphics/30.png" {"graphics/30.png"} + "graphics/Adrittovstop/1.bmp.png" {"graphics/Adrittovstop/1.bmp.png"} + "graphics/Bsaltello/1.png" {"graphics/Bsaltello/1.png"} + "graphics/n3.png" {"graphics/n3.png"} + "graphics/n5.png" {"graphics/n5.png"} + "graphics/Brovescio/01.bmp.png" {"graphics/Brovescio/01.bmp.png"} + "graphics/Brovescio/05.bmp.png" {"graphics/Brovescio/05.bmp.png"} + "graphics/Brovescio/08.bmp.png" {"graphics/Brovescio/08.bmp.png"} + "graphics/Brovescio/06.bmp.png" {"graphics/Brovescio/06.bmp.png"} + "graphics/Brovescio/02.bmp.png" {"graphics/Brovescio/02.bmp.png"} + "graphics/Brovescio/14.bmp.png" {"graphics/Brovescio/14.bmp.png"} + "graphics/Brovescio/11.bmp.png" {"graphics/Brovescio/11.bmp.png"} + "graphics/Brovescio/09.bmp.png" {"graphics/Brovescio/09.bmp.png"} + "graphics/Brovescio/10.bmp.png" {"graphics/Brovescio/10.bmp.png"} + "graphics/Brovescio/15.bmp.png" {"graphics/Brovescio/15.bmp.png"} + "graphics/Brovescio/04.bmp.png" {"graphics/Brovescio/04.bmp.png"} + "graphics/Brovescio/03.bmp.png" {"graphics/Brovescio/03.bmp.png"} + "graphics/Brovescio/12.bmp.png" {"graphics/Brovescio/12.bmp.png"} + "graphics/Brovescio/13.bmp.png" {"graphics/Brovescio/13.bmp.png"} + "graphics/Brovescio/07.bmp.png" {"graphics/Brovescio/07.bmp.png"} + "graphics/Adrittoallungov/6.bmp.png" {"graphics/Adrittoallungov/6.bmp.png"} + "graphics/Adrittoallungov/3.bmp.png" {"graphics/Adrittoallungov/3.bmp.png"} + "graphics/Adrittoallungov/4.bmp.png" {"graphics/Adrittoallungov/4.bmp.png"} + "graphics/croce-rossa.bmp.png" {"graphics/croce-rossa.bmp.png"} + "graphics/Bdrittovstop/1.bmp.png" {"graphics/Bdrittovstop/1.bmp.png"} + "graphics/Arovesciovstop/1.bmp.png" {"graphics/Arovesciovstop/1.bmp.png"} + "graphics/Bsinistra/5.bmp.png" {"graphics/Bsinistra/5.bmp.png"} + "graphics/Bsinistra/3.bmp.png" {"graphics/Bsinistra/3.bmp.png"} + "graphics/Bsinistra/2.bmp.png" {"graphics/Bsinistra/2.bmp.png"} + "graphics/Bsinistra/1.bmp.png" {"graphics/Bsinistra/1.bmp.png"} + "graphics/Bsinistra/4.bmp.png" {"graphics/Bsinistra/4.bmp.png"} + "graphics/n9.png" {"graphics/n9.png"} + "graphics/fault.png" {"graphics/fault.png"} + "graphics/Asu/5.bmp.png" {"graphics/Asu/5.bmp.png"} + "graphics/Asu/3.bmp.png" {"graphics/Asu/3.bmp.png"} + "graphics/Asu/2.bmp.png" {"graphics/Asu/2.bmp.png"} + "graphics/Asu/1.bmp.png" {"graphics/Asu/1.bmp.png"} + "graphics/Asu/4.bmp.png" {"graphics/Asu/4.bmp.png"} + "graphics/Adrittoback/6.bmp.png" {"graphics/Adrittoback/6.bmp.png"} + "graphics/Adrittoback/5.bmp.png" {"graphics/Adrittoback/5.bmp.png"} + "graphics/Adrittoback/3.bmp.png" {"graphics/Adrittoback/3.bmp.png"} + "graphics/Adrittoback/2.bmp.png" {"graphics/Adrittoback/2.bmp.png"} + "graphics/Adrittoback/1.bmp.png" {"graphics/Adrittoback/1.bmp.png"} + "graphics/Adrittoback/4.bmp.png" {"graphics/Adrittoback/4.bmp.png"} + "graphics/Arovescio/01.bmp.png" {"graphics/Arovescio/01.bmp.png"} + "graphics/Arovescio/05.bmp.png" {"graphics/Arovescio/05.bmp.png"} + "graphics/Arovescio/08.bmp.png" {"graphics/Arovescio/08.bmp.png"} + "graphics/Arovescio/06.bmp.png" {"graphics/Arovescio/06.bmp.png"} + "graphics/Arovescio/02.bmp.png" {"graphics/Arovescio/02.bmp.png"} + "graphics/Arovescio/14.bmp.png" {"graphics/Arovescio/14.bmp.png"} + "graphics/Arovescio/11.bmp.png" {"graphics/Arovescio/11.bmp.png"} + "graphics/Arovescio/09.bmp.png" {"graphics/Arovescio/09.bmp.png"} + "graphics/Arovescio/10.bmp.png" {"graphics/Arovescio/10.bmp.png"} + "graphics/Arovescio/04.bmp.png" {"graphics/Arovescio/04.bmp.png"} + "graphics/Arovescio/03.bmp.png" {"graphics/Arovescio/03.bmp.png"} + "graphics/Arovescio/12.bmp.png" {"graphics/Arovescio/12.bmp.png"} + "graphics/Arovescio/13.bmp.png" {"graphics/Arovescio/13.bmp.png"} + "graphics/Arovescio/07.bmp.png" {"graphics/Arovescio/07.bmp.png"} + "graphics/Brovescioallungov/6.bmp.png" {"graphics/Brovescioallungov/6.bmp.png"} + "graphics/Brovescioallungov/5.bmp.png" {"graphics/Brovescioallungov/5.bmp.png"} + "graphics/Brovescioallungov/4.bmp.png" {"graphics/Brovescioallungov/4.bmp.png"} + "graphics/Brovesciochop/1.bmp.png" {"graphics/Brovesciochop/1.bmp.png"} + "graphics/Brovescioforwardstretch/2.bmp.png" {"graphics/Brovescioforwardstretch/2.bmp.png"} + "graphics/Brovescioforwardstretch/1.bmp.png" {"graphics/Brovescioforwardstretch/1.bmp.png"} + "graphics/Aservizio/12.png" {"graphics/Aservizio/12.png"} + "graphics/Aservizio/22.png-scal" {"graphics/Aservizio/22.png-scal"} + "graphics/Aservizio/23.png-scal" {"graphics/Aservizio/23.png-scal"} + "graphics/Aservizio/11.png" {"graphics/Aservizio/11.png"} + "graphics/Aservizio/16.png" {"graphics/Aservizio/16.png"} + "graphics/Aservizio/19.png" {"graphics/Aservizio/19.png"} + "graphics/Aservizio/13.png" {"graphics/Aservizio/13.png"} + "graphics/Aservizio/01.png" {"graphics/Aservizio/01.png"} + "graphics/Aservizio/06.png" {"graphics/Aservizio/06.png"} + "graphics/Aservizio/24.png-scal" {"graphics/Aservizio/24.png-scal"} + "graphics/Aservizio/02.png" {"graphics/Aservizio/02.png"} + "graphics/Aservizio/09.png" {"graphics/Aservizio/09.png"} + "graphics/Aservizio/05.png" {"graphics/Aservizio/05.png"} + "graphics/Aservizio/21.png-scal" {"graphics/Aservizio/21.png-scal"} + "graphics/Aservizio/25.png-scal" {"graphics/Aservizio/25.png-scal"} + "graphics/Aservizio/15.png" {"graphics/Aservizio/15.png"} + "graphics/Aservizio/14.png" {"graphics/Aservizio/14.png"} + "graphics/Aservizio/17.png" {"graphics/Aservizio/17.png"} + "graphics/Aservizio/20.png" {"graphics/Aservizio/20.png"} + "graphics/Aservizio/10.png" {"graphics/Aservizio/10.png"} + "graphics/Aservizio/03.png" {"graphics/Aservizio/03.png"} + "graphics/Aservizio/07.png" {"graphics/Aservizio/07.png"} + "graphics/Aservizio/04.png" {"graphics/Aservizio/04.png"} + "graphics/Aservizio/08.png" {"graphics/Aservizio/08.png"} + "graphics/Aservizio/18.png" {"graphics/Aservizio/18.png"} + "graphics/Arovescioforwardstretch/1.png" {"graphics/Arovescioforwardstretch/1.png"} + "graphics/Arovescioforwardstretch/2.png" {"graphics/Arovescioforwardstretch/2.png"} + "graphics/too-late.png" {"graphics/too-late.png"} + "graphics/Aattesa/3.bmp.png" {"graphics/Aattesa/3.bmp.png"} + "graphics/Aattesa/2.bmp.png" {"graphics/Aattesa/2.bmp.png"} + "graphics/Aattesa/1.bmp.png" {"graphics/Aattesa/1.bmp.png"} + "graphics/Aattesa/4.png" {"graphics/Aattesa/4.png"} + "graphics/Bdrittochop/01.bmp.png" {"graphics/Bdrittochop/01.bmp.png"} + "graphics/Arovescioback/6.bmp.png" {"graphics/Arovescioback/6.bmp.png"} + "graphics/Arovescioback/5.bmp.png" {"graphics/Arovescioback/5.bmp.png"} + "graphics/Arovescioback/3.bmp.png" {"graphics/Arovescioback/3.bmp.png"} + "graphics/Arovescioback/2.bmp.png" {"graphics/Arovescioback/2.bmp.png"} + "graphics/Arovescioback/1.bmp.png" {"graphics/Arovescioback/1.bmp.png"} + "graphics/Arovescioback/4.bmp.png" {"graphics/Arovescioback/4.bmp.png"} + "graphics/Arovescioback/7.bmp.png" {"graphics/Arovescioback/7.bmp.png"} + "graphics/Bdestra/6.bmp.png" {"graphics/Bdestra/6.bmp.png"} + "graphics/Bdestra/5.bmp.png" {"graphics/Bdestra/5.bmp.png"} + "graphics/Bdestra/1.png" {"graphics/Bdestra/1.png"} + "graphics/Bdestra/3.png" {"graphics/Bdestra/3.png"} + "graphics/Bdestra/2.png" {"graphics/Bdestra/2.png"} + "graphics/Bdestra/4.bmp.png" {"graphics/Bdestra/4.bmp.png"} + "graphics/Arovescio2mani/8.bmp.png" {"graphics/Arovescio2mani/8.bmp.png"} + "graphics/Arovescio2mani/6.bmp.png" {"graphics/Arovescio2mani/6.bmp.png"} + "graphics/Arovescio2mani/5.bmp.png" {"graphics/Arovescio2mani/5.bmp.png"} + "graphics/Arovescio2mani/3.bmp.png" {"graphics/Arovescio2mani/3.bmp.png"} + "graphics/Arovescio2mani/2.bmp.png" {"graphics/Arovescio2mani/2.bmp.png"} + "graphics/Arovescio2mani/1.bmp.png" {"graphics/Arovescio2mani/1.bmp.png"} + "graphics/Arovescio2mani/4.bmp.png" {"graphics/Arovescio2mani/4.bmp.png"} + "graphics/Arovescio2mani/7.bmp.png" {"graphics/Arovescio2mani/7.bmp.png"} + "graphics/Agiu/5.bmp.png" {"graphics/Agiu/5.bmp.png"} + "graphics/Agiu/3.bmp.png" {"graphics/Agiu/3.bmp.png"} + "graphics/Agiu/2.bmp.png" {"graphics/Agiu/2.bmp.png"} + "graphics/Agiu/1.bmp.png" {"graphics/Agiu/1.bmp.png"} + "graphics/Agiu/4.bmp.png" {"graphics/Agiu/4.bmp.png"} + "graphics/n1.png" {"graphics/n1.png"} + "graphics/Bservizio/12.png" {"graphics/Bservizio/12.png"} + "graphics/Bservizio/11.png" {"graphics/Bservizio/11.png"} + "graphics/Bservizio/13.png" {"graphics/Bservizio/13.png"} + "graphics/Bservizio/01.png" {"graphics/Bservizio/01.png"} + "graphics/Bservizio/06.png" {"graphics/Bservizio/06.png"} + "graphics/Bservizio/02.png" {"graphics/Bservizio/02.png"} + "graphics/Bservizio/09.png" {"graphics/Bservizio/09.png"} + "graphics/Bservizio/05.png" {"graphics/Bservizio/05.png"} + "graphics/Bservizio/14.png" {"graphics/Bservizio/14.png"} + "graphics/Bservizio/10.png" {"graphics/Bservizio/10.png"} + "graphics/Bservizio/03.png" {"graphics/Bservizio/03.png"} + "graphics/Bservizio/07.png" {"graphics/Bservizio/07.png"} + "graphics/Bservizio/04.png" {"graphics/Bservizio/04.png"} + "graphics/Bservizio/08.png" {"graphics/Bservizio/08.png"} + "graphics/sprint.bmp.png" {"graphics/sprint.bmp.png"} + "graphics/n6.png" {"graphics/n6.png"} + "graphics/Adestra/5.bmp.png" {"graphics/Adestra/5.bmp.png"} + "graphics/Adestra/3.bmp.png" {"graphics/Adestra/3.bmp.png"} + "graphics/Adestra/2.bmp.png" {"graphics/Adestra/2.bmp.png"} + "graphics/Adestra/1.bmp.png" {"graphics/Adestra/1.bmp.png"} + "graphics/Adestra/4.bmp.png" {"graphics/Adestra/4.bmp.png"} + "graphics/40.png" {"graphics/40.png"} + "graphics/0.png" {"graphics/0.png"} + "graphics/Bdrittov/6.bmp.png" {"graphics/Bdrittov/6.bmp.png"} + "graphics/Bdrittov/5.bmp.png" {"graphics/Bdrittov/5.bmp.png"} + "graphics/Bdrittov/3.bmp.png" {"graphics/Bdrittov/3.bmp.png"} + "graphics/Bdrittov/2.bmp.png" {"graphics/Bdrittov/2.bmp.png"} + "graphics/Bdrittov/1.bmp.png" {"graphics/Bdrittov/1.bmp.png"} + "graphics/Bdrittov/4.bmp.png" {"graphics/Bdrittov/4.bmp.png"} + "graphics/n7.png" {"graphics/n7.png"} + "graphics/Bdrittoallungov/5.bmp.png" {"graphics/Bdrittoallungov/5.bmp.png"} + "graphics/Bdrittoallungov/3.bmp.png" {"graphics/Bdrittoallungov/3.bmp.png"} + "graphics/Bdrittoallungov/4.bmp.png" {"graphics/Bdrittoallungov/4.bmp.png"} + "graphics/Adritto/01.bmp.png" {"graphics/Adritto/01.bmp.png"} + "graphics/Adritto/05.bmp.png" {"graphics/Adritto/05.bmp.png"} + "graphics/Adritto/08.bmp.png" {"graphics/Adritto/08.bmp.png"} + "graphics/Adritto/06.bmp.png" {"graphics/Adritto/06.bmp.png"} + "graphics/Adritto/02.bmp.png" {"graphics/Adritto/02.bmp.png"} + "graphics/Adritto/11.bmp.png" {"graphics/Adritto/11.bmp.png"} + "graphics/Adritto/09.bmp.png" {"graphics/Adritto/09.bmp.png"} + "graphics/Adritto/10.bmp.png" {"graphics/Adritto/10.bmp.png"} + "graphics/Adritto/04.bmp.png" {"graphics/Adritto/04.bmp.png"} + "graphics/Adritto/03.bmp.png" {"graphics/Adritto/03.bmp.png"} + "graphics/Adritto/07.bmp.png" {"graphics/Adritto/07.bmp.png"} + "graphics/Bdritto/01.bmp.png" {"graphics/Bdritto/01.bmp.png"} + "graphics/Bdritto/05.bmp.png" {"graphics/Bdritto/05.bmp.png"} + "graphics/Bdritto/08.bmp.png" {"graphics/Bdritto/08.bmp.png"} + "graphics/Bdritto/06.bmp.png" {"graphics/Bdritto/06.bmp.png"} + "graphics/Bdritto/02.bmp.png" {"graphics/Bdritto/02.bmp.png"} + "graphics/Bdritto/11.bmp.png" {"graphics/Bdritto/11.bmp.png"} + "graphics/Bdritto/09.bmp.png" {"graphics/Bdritto/09.bmp.png"} + "graphics/Bdritto/10.bmp.png" {"graphics/Bdritto/10.bmp.png"} + "graphics/Bdritto/04.bmp.png" {"graphics/Bdritto/04.bmp.png"} + "graphics/Bdritto/03.bmp.png" {"graphics/Bdritto/03.bmp.png"} + "graphics/Bdritto/12.bmp.png" {"graphics/Bdritto/12.bmp.png"} + "graphics/Bdritto/07.bmp.png" {"graphics/Bdritto/07.bmp.png"} + "graphics/Adrittoallungo/8.bmp.png" {"graphics/Adrittoallungo/8.bmp.png"} + "graphics/Adrittoallungo/6.bmp.png" {"graphics/Adrittoallungo/6.bmp.png"} + "graphics/Adrittoallungo/5.bmp.png" {"graphics/Adrittoallungo/5.bmp.png"} + "graphics/Adrittoallungo/3.bmp.png" {"graphics/Adrittoallungo/3.bmp.png"} + "graphics/Adrittoallungo/2.bmp.png" {"graphics/Adrittoallungo/2.bmp.png"} + "graphics/Adrittoallungo/1.bmp.png" {"graphics/Adrittoallungo/1.bmp.png"} + "graphics/Adrittoallungo/4.bmp.png" {"graphics/Adrittoallungo/4.bmp.png"} + "graphics/Adrittoallungo/7.bmp.png" {"graphics/Adrittoallungo/7.bmp.png"} + "graphics/Asaltello/3.bmp.png" {"graphics/Asaltello/3.bmp.png"} + "graphics/n8.png" {"graphics/n8.png"} + "graphics/Bgiu/5.bmp.png" {"graphics/Bgiu/5.bmp.png"} + "graphics/Bgiu/3.bmp.png" {"graphics/Bgiu/3.bmp.png"} + "graphics/Bgiu/2.bmp.png" {"graphics/Bgiu/2.bmp.png"} + "graphics/Bgiu/1.bmp.png" {"graphics/Bgiu/1.bmp.png"} + "graphics/Bgiu/4.bmp.png" {"graphics/Bgiu/4.bmp.png"} + "graphics/n4.png" {"graphics/n4.png"} + "graphics/Asinistra/5.bmp.png" {"graphics/Asinistra/5.bmp.png"} + "graphics/Asinistra/3.bmp.png" {"graphics/Asinistra/3.bmp.png"} + "graphics/Asinistra/2.bmp.png" {"graphics/Asinistra/2.bmp.png"} + "graphics/Asinistra/1.bmp.png" {"graphics/Asinistra/1.bmp.png"} + "graphics/Asinistra/4.bmp.png" {"graphics/Asinistra/4.bmp.png"} + "graphics/Arovesciochop/1.bmp.png" {"graphics/Arovesciochop/1.bmp.png"} + "graphics/Brovescioallungo/01.bmp.png" {"graphics/Brovescioallungo/01.bmp.png"} + "graphics/Brovescioallungo/05.bmp.png" {"graphics/Brovescioallungo/05.bmp.png"} + "graphics/Brovescioallungo/06.bmp.png" {"graphics/Brovescioallungo/06.bmp.png"} + "graphics/Brovescioallungo/02.bmp.png" {"graphics/Brovescioallungo/02.bmp.png"} + "graphics/Brovescioallungo/04.bmp.png" {"graphics/Brovescioallungo/04.bmp.png"} + "graphics/Brovescioallungo/03.bmp.png" {"graphics/Brovescioallungo/03.bmp.png"} + "graphics/Brovescioallungo/07.bmp.png" {"graphics/Brovescioallungo/07.bmp.png"} + "graphics/paused-remote.png" {"graphics/paused-remote.png"} + "graphics/cemento.bmp.png" {"graphics/cemento.bmp.png"} + "graphics/Brovescioback/8.bmp.png" {"graphics/Brovescioback/8.bmp.png"} + "graphics/Brovescioback/6.bmp.png" {"graphics/Brovescioback/6.bmp.png"} + "graphics/Brovescioback/5.bmp.png" {"graphics/Brovescioback/5.bmp.png"} + "graphics/Brovescioback/3.bmp.png" {"graphics/Brovescioback/3.bmp.png"} + "graphics/Brovescioback/2.bmp.png" {"graphics/Brovescioback/2.bmp.png"} + "graphics/Brovescioback/1.bmp.png" {"graphics/Brovescioback/1.bmp.png"} + "graphics/Brovescioback/4.bmp.png" {"graphics/Brovescioback/4.bmp.png"} + "graphics/Brovescioback/7.bmp.png" {"graphics/Brovescioback/7.bmp.png"} + "graphics/Asmash/5.bmp.png" {"graphics/Asmash/5.bmp.png"} + "graphics/Asmash/3.bmp.png" {"graphics/Asmash/3.bmp.png"} + "graphics/Asmash/2.bmp.png" {"graphics/Asmash/2.bmp.png"} + "graphics/Asmash/1.bmp.png" {"graphics/Asmash/1.bmp.png"} + "graphics/Asmash/4.bmp.png" {"graphics/Asmash/4.bmp.png"} + "graphics/ball-caption.bmp" {"graphics/ball-caption.bmp"} + "graphics/15.png" {"graphics/15.png"} + "graphics/n2.png" {"graphics/n2.png"} + "graphics/ombra-palla.bmp.png" {"graphics/ombra-palla.bmp.png"} + "graphics/Adrittochop/1.bmp.png" {"graphics/Adrittochop/1.bmp.png"} + "graphics/Adrittoforwardstretch/1.bmp.png" {"graphics/Adrittoforwardstretch/1.bmp.png"} + "graphics/Adrittoforwardstretch/2.png" {"graphics/Adrittoforwardstretch/2.png"} + "graphics/Bsu/5.bmp.png" {"graphics/Bsu/5.bmp.png"} + "graphics/Bsu/3.bmp.png" {"graphics/Bsu/3.bmp.png"} + "graphics/Bsu/2.bmp.png" {"graphics/Bsu/2.bmp.png"} + "graphics/Bsu/1.bmp.png" {"graphics/Bsu/1.bmp.png"} + "graphics/Bsu/4.bmp.png" {"graphics/Bsu/4.bmp.png"} + "graphics/palla.bmp.png" {"graphics/palla.bmp.png"} + "graphics/Arovesciov/6.bmp.png" {"graphics/Arovesciov/6.bmp.png"} + "graphics/Arovesciov/5.bmp.png" {"graphics/Arovesciov/5.bmp.png"} + "graphics/Arovesciov/3.bmp.png" {"graphics/Arovesciov/3.bmp.png"} + "graphics/Arovesciov/2.bmp.png" {"graphics/Arovesciov/2.bmp.png"} + "graphics/Arovesciov/1.bmp.png" {"graphics/Arovesciov/1.bmp.png"} + "graphics/Arovesciov/4.bmp.png" {"graphics/Arovesciov/4.bmp.png"} + "graphics/Arovesciov/7.bmp.png" {"graphics/Arovesciov/7.bmp.png"} + "graphics/paused.png" {"graphics/paused.png"} + "graphics/Brovesciov/6.bmp.png" {"graphics/Brovesciov/6.bmp.png"} + "graphics/Brovesciov/5.bmp.png" {"graphics/Brovesciov/5.bmp.png"} + "graphics/Brovesciov/3.bmp.png" {"graphics/Brovesciov/3.bmp.png"} + "graphics/Brovesciov/2.bmp.png" {"graphics/Brovesciov/2.bmp.png"} + "graphics/Brovesciov/1.bmp.png" {"graphics/Brovesciov/1.bmp.png"} + "graphics/Brovesciov/4.bmp.png" {"graphics/Brovesciov/4.bmp.png"} + "graphics/Brovesciov/7.bmp.png" {"graphics/Brovesciov/7.bmp.png"} + "graphics/sprint-level.png" {"graphics/sprint-level.png"} + "graphics/Battesa/1.png" {"graphics/Battesa/1.png"} + "graphics/Battesa/4.png" {"graphics/Battesa/4.png"} + "graphics/Battesa/3.png" {"graphics/Battesa/3.png"} + "graphics/Battesa/2.png" {"graphics/Battesa/2.png"} + "graphics/Arovescioallungov/5.bmp.png" {"graphics/Arovescioallungov/5.bmp.png"} + "graphics/Arovescioallungov/3.bmp.png" {"graphics/Arovescioallungov/3.bmp.png"} + "graphics/Arovescioallungov/4.bmp.png" {"graphics/Arovescioallungov/4.bmp.png"} + "graphics/Bsmash/5.bmp.png" {"graphics/Bsmash/5.bmp.png"} + "graphics/Bsmash/3.bmp.png" {"graphics/Bsmash/3.bmp.png"} + "graphics/Bsmash/2.bmp.png" {"graphics/Bsmash/2.bmp.png"} + "graphics/Bsmash/1.bmp.png" {"graphics/Bsmash/1.bmp.png"} + "graphics/Bsmash/4.bmp.png" {"graphics/Bsmash/4.bmp.png"} + "graphics/Arovescioallungo/6.bmp.png" {"graphics/Arovescioallungo/6.bmp.png"} + "graphics/Arovescioallungo/5.bmp.png" {"graphics/Arovescioallungo/5.bmp.png"} + "graphics/Arovescioallungo/3.bmp.png" {"graphics/Arovescioallungo/3.bmp.png"} + "graphics/Arovescioallungo/2.bmp.png" {"graphics/Arovescioallungo/2.bmp.png"} + "graphics/Arovescioallungo/1.bmp.png" {"graphics/Arovescioallungo/1.bmp.png"} + "graphics/Arovescioallungo/4.bmp.png" {"graphics/Arovescioallungo/4.bmp.png"} + "graphics/Arovescioallungo/7.bmp.png" {"graphics/Arovescioallungo/7.bmp.png"} + "graphics/n0.png" {"graphics/n0.png"} + "graphics/Bdrittoallungo/6.bmp.png" {"graphics/Bdrittoallungo/6.bmp.png"} + "graphics/Bdrittoallungo/5.bmp.png" {"graphics/Bdrittoallungo/5.bmp.png"} + "graphics/Bdrittoallungo/3.bmp.png" {"graphics/Bdrittoallungo/3.bmp.png"} + "graphics/Bdrittoallungo/2.bmp.png" {"graphics/Bdrittoallungo/2.bmp.png"} + "graphics/Bdrittoallungo/1.bmp.png" {"graphics/Bdrittoallungo/1.bmp.png"} + "graphics/Bdrittoallungo/4.bmp.png" {"graphics/Bdrittoallungo/4.bmp.png"} + "graphics/Bdrittoallungo/7.bmp.png" {"graphics/Bdrittoallungo/7.bmp.png"}] \ No newline at end of file diff --git a/patches/fstar/fstar.install b/patches/fstar/fstar.install new file mode 100644 index 0000000..59f9310 --- /dev/null +++ b/patches/fstar/fstar.install @@ -0,0 +1,4 @@ +bin: [ + "?bin/fstar" { "fstar" } + "?bin/fstar.exe" { "fstar.exe" } +] diff --git a/patches/functoria-runtime/num.patch b/patches/functoria-runtime/num.patch new file mode 100644 index 0000000..877e367 --- /dev/null +++ b/patches/functoria-runtime/num.patch @@ -0,0 +1,13 @@ +diff --git a/_tags b/_tags +index 69db3f4..5d39b96 100644 +--- a/_tags ++++ b/_tags +@@ -10,7 +10,7 @@ true: keep_locs + <{lib,app}/*>: package(unix dynlink cmdliner rresult fmt.tty ocamlgraph astring fpath bos logs logs.cli) + + # Force the runtime to be unix-independent. +-: dontlink(unix str num threads) ++: dontlink(unix str threads) + : package(cmdliner fmt) + + : package(oUnit cmdliner fmt.cli rresult astring bos logs logs.cli logs.fmt fmt.tty) diff --git a/patches/fury-puyo/4.05-compatibility.patch b/patches/fury-puyo/4.05-compatibility.patch new file mode 100644 index 0000000..509d1b3 --- /dev/null +++ b/patches/fury-puyo/4.05-compatibility.patch @@ -0,0 +1,29 @@ +From 5e30975c8bb5bb6ed279287c4b2ca2d00a220d3c Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Sat, 25 Feb 2017 17:10:12 -0500 +Subject: [PATCH] Fix a non-generalized variable issue for 4.05 compatibility + +See https://github.com/ocaml/ocaml/pull/929 + +opam-builder report: + http://opam.ocamlpro.com/builder/html/fury-puyo/fury-puyo.0.5/c867894506caedd7d7e8a3406dfc7df5 +--- + IO.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/IO.ml b/IO.ml +index 8f16926..8c1607d 100644 +--- a/IO.ml ++++ b/IO.ml +@@ -317,7 +317,7 @@ module MakeReader(A: ACTION) = struct + let auto = ref KeyMap.empty + let pressed_keys = ref KeyMap.empty + +- let action mapref key acc = ++ let action mapref key acc : A.t list = + try KeyMap.find key !mapref :: acc + with Not_found -> acc + +-- +2.9.3 + diff --git a/patches/fury-puyo/data_dir.patch.in b/patches/fury-puyo/data_dir.patch.in new file mode 100644 index 0000000..b8aee77 --- /dev/null +++ b/patches/fury-puyo/data_dir.patch.in @@ -0,0 +1,33 @@ +diff -ru furypuyo_orig/common.ml furypuyo_patched/common.ml +--- furypuyo_orig/common.ml 2010-01-25 18:13:44.000000000 +0100 ++++ furypuyo_patched/common.ml 2013-08-15 18:28:05.038350670 +0200 +@@ -58,17 +58,7 @@ + ignore (on_quit ()); + IO.close () + +-(* don't use Sys.executable_name because it won't work with symbolic links *) +-let data_directory = +- let ed = Filename.dirname Sys.argv.(0) in +- let ed = +- if Filename.is_relative ed then +- Filename.concat (Sys.getcwd ()) ed +- else +- ed +- in +- let def = Filename.concat ed "data" in +- Config.string config "DATADIR" "Game data directory (sprites, ...)" def ++let data_directory = "%{share}%/fury-puyo/data/" + + let player_name = + Config.string config "PLAYERNAME" "Player name" +diff -ru furypuyo_orig/sprites.ml furypuyo_patched/sprites.ml +--- furypuyo_orig/sprites.ml 2010-01-25 18:13:44.000000000 +0100 ++++ furypuyo_patched/sprites.ml 2013-08-15 18:28:28.810526538 +0200 +@@ -46,7 +46,6 @@ + let load_black = Sprite.load ~transparency: `BLACK + + let file = +- let data_directory = Config.get data_directory in + fun s -> Filename.concat data_directory s + + let sprite_puyo_red = load_alpha (file "red40.png") diff --git a/patches/fury-puyo/fury-puyo.install b/patches/fury-puyo/fury-puyo.install new file mode 100644 index 0000000..129fb1c --- /dev/null +++ b/patches/fury-puyo/fury-puyo.install @@ -0,0 +1,94 @@ +bin: [ + "furypuyo" + "furypuyo_srv" +] +share: [ + "data/allclear.png" {"data/allclear.png"} + "data/background.png" {"data/background.png"} + "data/bigredpuyo.png" {"data/bigredpuyo.png"} + "data/blue40.png" {"data/blue40.png"} + "data/blue.png" {"data/blue.png"} + "data/chain10.png" {"data/chain10.png"} + "data/chain11.png" {"data/chain11.png"} + "data/chain12.png" {"data/chain12.png"} + "data/chain13.png" {"data/chain13.png"} + "data/chain14.png" {"data/chain14.png"} + "data/chain15.png" {"data/chain15.png"} + "data/chain16.png" {"data/chain16.png"} + "data/chain17.png" {"data/chain17.png"} + "data/chain18.png" {"data/chain18.png"} + "data/chain19.png" {"data/chain19.png"} + "data/chain2.png" {"data/chain2.png"} + "data/chain3.png" {"data/chain3.png"} + "data/chain4.png" {"data/chain4.png"} + "data/chain5.png" {"data/chain5.png"} + "data/chain6.png" {"data/chain6.png"} + "data/chain7.png" {"data/chain7.png"} + "data/chain8.png" {"data/chain8.png"} + "data/chain9.png" {"data/chain9.png"} + "data/font_25_0.png" {"data/font_25_0.png"} + "data/font_25_1.png" {"data/font_25_1.png"} + "data/font_25_2.png" {"data/font_25_2.png"} + "data/font_25_3.png" {"data/font_25_3.png"} + "data/font_25_4.png" {"data/font_25_4.png"} + "data/font_25_5.png" {"data/font_25_5.png"} + "data/font_25_6.png" {"data/font_25_6.png"} + "data/font_25_7.png" {"data/font_25_7.png"} + "data/font_25_8.png" {"data/font_25_8.png"} + "data/font_25_9.png" {"data/font_25_9.png"} + "data/font_25_am.png" {"data/font_25_am.png"} + "data/font_25_bm.png" {"data/font_25_bm.png"} + "data/font_25_cm.png" {"data/font_25_cm.png"} + "data/font_25_colon.png" {"data/font_25_colon.png"} + "data/font_25_dm.png" {"data/font_25_dm.png"} + "data/font_25_dot.png" {"data/font_25_dot.png"} + "data/font_25_em.png" {"data/font_25_em.png"} + "data/font_25_fm.png" {"data/font_25_fm.png"} + "data/font_25_gm.png" {"data/font_25_gm.png"} + "data/font_25_hm.png" {"data/font_25_hm.png"} + "data/font_25_im.png" {"data/font_25_im.png"} + "data/font_25_jm.png" {"data/font_25_jm.png"} + "data/font_25_km.png" {"data/font_25_km.png"} + "data/font_25_lm.png" {"data/font_25_lm.png"} + "data/font_25_mm.png" {"data/font_25_mm.png"} + "data/font_25_nm.png" {"data/font_25_nm.png"} + "data/font_25_om.png" {"data/font_25_om.png"} + "data/font_25_plus.png" {"data/font_25_plus.png"} + "data/font_25_pm.png" {"data/font_25_pm.png"} + "data/font_25_qm.png" {"data/font_25_qm.png"} + "data/font_25_rm.png" {"data/font_25_rm.png"} + "data/font_25_sm.png" {"data/font_25_sm.png"} + "data/font_25_star.png" {"data/font_25_star.png"} + "data/font_25_tm.png" {"data/font_25_tm.png"} + "data/font_25_um.png" {"data/font_25_um.png"} + "data/font_25_vm.png" {"data/font_25_vm.png"} + "data/font_25_wm.png" {"data/font_25_wm.png"} + "data/font_25_xm.png" {"data/font_25_xm.png"} + "data/font_25_x.png" {"data/font_25_x.png"} + "data/font_25_ym.png" {"data/font_25_ym.png"} + "data/font_25_zm.png" {"data/font_25_zm.png"} + "data/foreground.png" {"data/foreground.png"} + "data/garbage180.png" {"data/garbage180.png"} + "data/garbage1.png" {"data/garbage1.png"} + "data/garbage30.png" {"data/garbage30.png"} + "data/garbage360.png" {"data/garbage360.png"} + "data/garbage6.png" {"data/garbage6.png"} + "data/garbage720.png" {"data/garbage720.png"} + "data/go.png" {"data/go.png"} + "data/gray40.png" {"data/gray40.png"} + "data/gray.png" {"data/gray.png"} + "data/green40.png" {"data/green40.png"} + "data/green.png" {"data/green.png"} + "data/greenstar.png" {"data/greenstar.png"} + "data/offsetfury.png" {"data/offsetfury.png"} + "data/offset.png" {"data/offset.png"} + "data/purplestar.png" {"data/purplestar.png"} + "data/ready.png" {"data/ready.png"} + "data/red40.png" {"data/red40.png"} + "data/red.png" {"data/red.png"} + "data/redstar.png" {"data/redstar.png"} + "data/set.png" {"data/set.png"} + "data/yellow40.png" {"data/yellow40.png"} + "data/yellow.png" {"data/yellow.png"} + "data/yellowstar.png" {"data/yellowstar.png"} +] diff --git a/patches/gadelac/gadelac.install b/patches/gadelac/gadelac.install new file mode 100644 index 0000000..8f79fc0 --- /dev/null +++ b/patches/gadelac/gadelac.install @@ -0,0 +1 @@ +bin: ["Src/_build/Main.native" {"gadelac"}] \ No newline at end of file diff --git a/patches/gappa/0001-Added-configure-for-c-11.patch b/patches/gappa/0001-Added-configure-for-c-11.patch new file mode 100644 index 0000000..0d3bd78 --- /dev/null +++ b/patches/gappa/0001-Added-configure-for-c-11.patch @@ -0,0 +1,983 @@ +From b3775cbc5711da00c4b6b7edea8029eb8b991a6f Mon Sep 17 00:00:00 2001 +From: Michael Soegtrop <7895506+MSoegtropIMC@users.noreply.github.com> +Date: Mon, 12 Oct 2020 21:20:28 +0200 +Subject: [PATCH] Added configure for c++11 + +--- + configure.in | 1 + + m4/m4_ax_cxx_compile_stdcxx.m4 | 951 +++++++++++++++++++++++++++++++++ + 2 files changed, 952 insertions(+) + create mode 100755 m4/m4_ax_cxx_compile_stdcxx.m4 + +diff --git a/configure.in b/configure.in +index c6e1d59..9b98e43 100644 +--- a/configure.in ++++ b/configure.in +@@ -8,6 +8,7 @@ AC_PROG_CXX + AC_PROG_LEX + AC_PROG_YACC + AX_PROG_CXX_FOR_BUILD ++AX_CXX_COMPILE_STDCXX(11) + + XSLTPROC=xsltproc + AC_ARG_WITH([xsltproc], AS_HELP_STRING([--with-xsltproc=PATH], [location of the xsltproc binary (documentation)]), +diff --git a/m4/m4_ax_cxx_compile_stdcxx.m4 b/m4/m4_ax_cxx_compile_stdcxx.m4 +new file mode 100755 +index 0000000..43087b2 +--- /dev/null ++++ b/m4/m4_ax_cxx_compile_stdcxx.m4 +@@ -0,0 +1,951 @@ ++# =========================================================================== ++# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) ++# ++# DESCRIPTION ++# ++# Check for baseline language coverage in the compiler for the specified ++# version of the C++ standard. If necessary, add switches to CXX and ++# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) ++# or '14' (for the C++14 standard). ++# ++# The second argument, if specified, indicates whether you insist on an ++# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. ++# -std=c++11). If neither is specified, you get whatever works, with ++# preference for an extended mode. ++# ++# The third argument, if specified 'mandatory' or if left unspecified, ++# indicates that baseline support for the specified C++ standard is ++# required and that the macro should error out if no mode with that ++# support is found. If specified 'optional', then configuration proceeds ++# regardless, after defining HAVE_CXX${VERSION} if and only if a ++# supporting mode is found. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Benjamin Kosnik ++# Copyright (c) 2012 Zack Weinberg ++# Copyright (c) 2013 Roy Stogner ++# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov ++# Copyright (c) 2015 Paul Norman ++# Copyright (c) 2015 Moritz Klammler ++# Copyright (c) 2016, 2018 Krzesimir Nowak ++# Copyright (c) 2019 Enji Cooper ++# ++# Copying and distribution of this file, with or without modification, are ++# permitted in any medium without royalty provided the copyright notice ++# and this notice are preserved. This file is offered as-is, without any ++# warranty. ++ ++#serial 11 ++ ++dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro ++dnl (serial version number 13). ++ ++AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl ++ m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], ++ [$1], [14], [ax_cxx_compile_alternatives="14 1y"], ++ [$1], [17], [ax_cxx_compile_alternatives="17 1z"], ++ [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl ++ m4_if([$2], [], [], ++ [$2], [ext], [], ++ [$2], [noext], [], ++ [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl ++ m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], ++ [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], ++ [$3], [optional], [ax_cxx_compile_cxx$1_required=false], ++ [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) ++ AC_LANG_PUSH([C++])dnl ++ ac_success=no ++ ++ m4_if([$2], [noext], [], [dnl ++ if test x$ac_success = xno; then ++ for alternative in ${ax_cxx_compile_alternatives}; do ++ switch="-std=gnu++${alternative}" ++ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) ++ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, ++ $cachevar, ++ [ac_save_CXX="$CXX" ++ CXX="$CXX $switch" ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], ++ [eval $cachevar=yes], ++ [eval $cachevar=no]) ++ CXX="$ac_save_CXX"]) ++ if eval test x\$$cachevar = xyes; then ++ CXX="$CXX $switch" ++ if test -n "$CXXCPP" ; then ++ CXXCPP="$CXXCPP $switch" ++ fi ++ ac_success=yes ++ break ++ fi ++ done ++ fi]) ++ ++ m4_if([$2], [ext], [], [dnl ++ if test x$ac_success = xno; then ++ dnl HP's aCC needs +std=c++11 according to: ++ dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf ++ dnl Cray's crayCC needs "-h std=c++11" ++ for alternative in ${ax_cxx_compile_alternatives}; do ++ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do ++ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) ++ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, ++ $cachevar, ++ [ac_save_CXX="$CXX" ++ CXX="$CXX $switch" ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], ++ [eval $cachevar=yes], ++ [eval $cachevar=no]) ++ CXX="$ac_save_CXX"]) ++ if eval test x\$$cachevar = xyes; then ++ CXX="$CXX $switch" ++ if test -n "$CXXCPP" ; then ++ CXXCPP="$CXXCPP $switch" ++ fi ++ ac_success=yes ++ break ++ fi ++ done ++ if test x$ac_success = xyes; then ++ break ++ fi ++ done ++ fi]) ++ AC_LANG_POP([C++]) ++ if test x$ax_cxx_compile_cxx$1_required = xtrue; then ++ if test x$ac_success = xno; then ++ AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) ++ fi ++ fi ++ if test x$ac_success = xno; then ++ HAVE_CXX$1=0 ++ AC_MSG_NOTICE([No compiler with C++$1 support was found]) ++ else ++ HAVE_CXX$1=1 ++ AC_DEFINE(HAVE_CXX$1,1, ++ [define if the compiler supports basic C++$1 syntax]) ++ fi ++ AC_SUBST(HAVE_CXX$1) ++]) ++ ++ ++dnl Test body for checking C++11 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++) ++ ++ ++dnl Test body for checking C++14 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ++) ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 ++) ++ ++dnl Tests for new features in C++11 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ ++ ++// If the compiler admits that it is not ready for C++11, why torture it? ++// Hopefully, this will speed up the test. ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif __cplusplus < 201103L ++ ++#error "This is not a C++11 compiler" ++ ++#else ++ ++namespace cxx11 ++{ ++ ++ namespace test_static_assert ++ { ++ ++ template ++ struct check ++ { ++ static_assert(sizeof(int) <= sizeof(T), "not big enough"); ++ }; ++ ++ } ++ ++ namespace test_final_override ++ { ++ ++ struct Base ++ { ++ virtual ~Base() {} ++ virtual void f() {} ++ }; ++ ++ struct Derived : public Base ++ { ++ virtual ~Derived() override {} ++ virtual void f() override {} ++ }; ++ ++ } ++ ++ namespace test_double_right_angle_brackets ++ { ++ ++ template < typename T > ++ struct check {}; ++ ++ typedef check single_type; ++ typedef check> double_type; ++ typedef check>> triple_type; ++ typedef check>>> quadruple_type; ++ ++ } ++ ++ namespace test_decltype ++ { ++ ++ int ++ f() ++ { ++ int a = 1; ++ decltype(a) b = 2; ++ return a + b; ++ } ++ ++ } ++ ++ namespace test_type_deduction ++ { ++ ++ template < typename T1, typename T2 > ++ struct is_same ++ { ++ static const bool value = false; ++ }; ++ ++ template < typename T > ++ struct is_same ++ { ++ static const bool value = true; ++ }; ++ ++ template < typename T1, typename T2 > ++ auto ++ add(T1 a1, T2 a2) -> decltype(a1 + a2) ++ { ++ return a1 + a2; ++ } ++ ++ int ++ test(const int c, volatile int v) ++ { ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == false, ""); ++ static_assert(is_same::value == false, ""); ++ auto ac = c; ++ auto av = v; ++ auto sumi = ac + av + 'x'; ++ auto sumf = ac + av + 1.0; ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == false, ""); ++ static_assert(is_same::value == true, ""); ++ return (sumf > 0.0) ? sumi : add(c, v); ++ } ++ ++ } ++ ++ namespace test_noexcept ++ { ++ ++ int f() { return 0; } ++ int g() noexcept { return 0; } ++ ++ static_assert(noexcept(f()) == false, ""); ++ static_assert(noexcept(g()) == true, ""); ++ ++ } ++ ++ namespace test_constexpr ++ { ++ ++ template < typename CharT > ++ unsigned long constexpr ++ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept ++ { ++ return *s ? strlen_c_r(s + 1, acc + 1) : acc; ++ } ++ ++ template < typename CharT > ++ unsigned long constexpr ++ strlen_c(const CharT *const s) noexcept ++ { ++ return strlen_c_r(s, 0UL); ++ } ++ ++ static_assert(strlen_c("") == 0UL, ""); ++ static_assert(strlen_c("1") == 1UL, ""); ++ static_assert(strlen_c("example") == 7UL, ""); ++ static_assert(strlen_c("another\0example") == 7UL, ""); ++ ++ } ++ ++ namespace test_rvalue_references ++ { ++ ++ template < int N > ++ struct answer ++ { ++ static constexpr int value = N; ++ }; ++ ++ answer<1> f(int&) { return answer<1>(); } ++ answer<2> f(const int&) { return answer<2>(); } ++ answer<3> f(int&&) { return answer<3>(); } ++ ++ void ++ test() ++ { ++ int i = 0; ++ const int c = 0; ++ static_assert(decltype(f(i))::value == 1, ""); ++ static_assert(decltype(f(c))::value == 2, ""); ++ static_assert(decltype(f(0))::value == 3, ""); ++ } ++ ++ } ++ ++ namespace test_uniform_initialization ++ { ++ ++ struct test ++ { ++ static const int zero {}; ++ static const int one {1}; ++ }; ++ ++ static_assert(test::zero == 0, ""); ++ static_assert(test::one == 1, ""); ++ ++ } ++ ++ namespace test_lambdas ++ { ++ ++ void ++ test1() ++ { ++ auto lambda1 = [](){}; ++ auto lambda2 = lambda1; ++ lambda1(); ++ lambda2(); ++ } ++ ++ int ++ test2() ++ { ++ auto a = [](int i, int j){ return i + j; }(1, 2); ++ auto b = []() -> int { return '0'; }(); ++ auto c = [=](){ return a + b; }(); ++ auto d = [&](){ return c; }(); ++ auto e = [a, &b](int x) mutable { ++ const auto identity = [](int y){ return y; }; ++ for (auto i = 0; i < a; ++i) ++ a += b--; ++ return x + identity(a + b); ++ }(0); ++ return a + b + c + d + e; ++ } ++ ++ int ++ test3() ++ { ++ const auto nullary = [](){ return 0; }; ++ const auto unary = [](int x){ return x; }; ++ using nullary_t = decltype(nullary); ++ using unary_t = decltype(unary); ++ const auto higher1st = [](nullary_t f){ return f(); }; ++ const auto higher2nd = [unary](nullary_t f1){ ++ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; ++ }; ++ return higher1st(nullary) + higher2nd(nullary)(unary); ++ } ++ ++ } ++ ++ namespace test_variadic_templates ++ { ++ ++ template ++ struct sum; ++ ++ template ++ struct sum ++ { ++ static constexpr auto value = N0 + sum::value; ++ }; ++ ++ template <> ++ struct sum<> ++ { ++ static constexpr auto value = 0; ++ }; ++ ++ static_assert(sum<>::value == 0, ""); ++ static_assert(sum<1>::value == 1, ""); ++ static_assert(sum<23>::value == 23, ""); ++ static_assert(sum<1, 2>::value == 3, ""); ++ static_assert(sum<5, 5, 11>::value == 21, ""); ++ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); ++ ++ } ++ ++ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae ++ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function ++ // because of this. ++ namespace test_template_alias_sfinae ++ { ++ ++ struct foo {}; ++ ++ template ++ using member = typename T::member_type; ++ ++ template ++ void func(...) {} ++ ++ template ++ void func(member*) {} ++ ++ void test(); ++ ++ void test() { func(0); } ++ ++ } ++ ++} // namespace cxx11 ++ ++#endif // __cplusplus >= 201103L ++ ++]]) ++ ++ ++dnl Tests for new features in C++14 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ ++ ++// If the compiler admits that it is not ready for C++14, why torture it? ++// Hopefully, this will speed up the test. ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif __cplusplus < 201402L ++ ++#error "This is not a C++14 compiler" ++ ++#else ++ ++namespace cxx14 ++{ ++ ++ namespace test_polymorphic_lambdas ++ { ++ ++ int ++ test() ++ { ++ const auto lambda = [](auto&&... args){ ++ const auto istiny = [](auto x){ ++ return (sizeof(x) == 1UL) ? 1 : 0; ++ }; ++ const int aretiny[] = { istiny(args)... }; ++ return aretiny[0]; ++ }; ++ return lambda(1, 1L, 1.0f, '1'); ++ } ++ ++ } ++ ++ namespace test_binary_literals ++ { ++ ++ constexpr auto ivii = 0b0000000000101010; ++ static_assert(ivii == 42, "wrong value"); ++ ++ } ++ ++ namespace test_generalized_constexpr ++ { ++ ++ template < typename CharT > ++ constexpr unsigned long ++ strlen_c(const CharT *const s) noexcept ++ { ++ auto length = 0UL; ++ for (auto p = s; *p; ++p) ++ ++length; ++ return length; ++ } ++ ++ static_assert(strlen_c("") == 0UL, ""); ++ static_assert(strlen_c("x") == 1UL, ""); ++ static_assert(strlen_c("test") == 4UL, ""); ++ static_assert(strlen_c("another\0test") == 7UL, ""); ++ ++ } ++ ++ namespace test_lambda_init_capture ++ { ++ ++ int ++ test() ++ { ++ auto x = 0; ++ const auto lambda1 = [a = x](int b){ return a + b; }; ++ const auto lambda2 = [a = lambda1(x)](){ return a; }; ++ return lambda2(); ++ } ++ ++ } ++ ++ namespace test_digit_separators ++ { ++ ++ constexpr auto ten_million = 100'000'000; ++ static_assert(ten_million == 100000000, ""); ++ ++ } ++ ++ namespace test_return_type_deduction ++ { ++ ++ auto f(int& x) { return x; } ++ decltype(auto) g(int& x) { return x; } ++ ++ template < typename T1, typename T2 > ++ struct is_same ++ { ++ static constexpr auto value = false; ++ }; ++ ++ template < typename T > ++ struct is_same ++ { ++ static constexpr auto value = true; ++ }; ++ ++ int ++ test() ++ { ++ auto x = 0; ++ static_assert(is_same::value, ""); ++ static_assert(is_same::value, ""); ++ return x; ++ } ++ ++ } ++ ++} // namespace cxx14 ++ ++#endif // __cplusplus >= 201402L ++ ++]]) ++ ++ ++dnl Tests for new features in C++17 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ ++ ++// If the compiler admits that it is not ready for C++17, why torture it? ++// Hopefully, this will speed up the test. ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif __cplusplus < 201703L ++ ++#error "This is not a C++17 compiler" ++ ++#else ++ ++#include ++#include ++#include ++ ++namespace cxx17 ++{ ++ ++ namespace test_constexpr_lambdas ++ { ++ ++ constexpr int foo = [](){return 42;}(); ++ ++ } ++ ++ namespace test::nested_namespace::definitions ++ { ++ ++ } ++ ++ namespace test_fold_expression ++ { ++ ++ template ++ int multiply(Args... args) ++ { ++ return (args * ... * 1); ++ } ++ ++ template ++ bool all(Args... args) ++ { ++ return (args && ...); ++ } ++ ++ } ++ ++ namespace test_extended_static_assert ++ { ++ ++ static_assert (true); ++ ++ } ++ ++ namespace test_auto_brace_init_list ++ { ++ ++ auto foo = {5}; ++ auto bar {5}; ++ ++ static_assert(std::is_same, decltype(foo)>::value); ++ static_assert(std::is_same::value); ++ } ++ ++ namespace test_typename_in_template_template_parameter ++ { ++ ++ template typename X> struct D; ++ ++ } ++ ++ namespace test_fallthrough_nodiscard_maybe_unused_attributes ++ { ++ ++ int f1() ++ { ++ return 42; ++ } ++ ++ [[nodiscard]] int f2() ++ { ++ [[maybe_unused]] auto unused = f1(); ++ ++ switch (f1()) ++ { ++ case 17: ++ f1(); ++ [[fallthrough]]; ++ case 42: ++ f1(); ++ } ++ return f1(); ++ } ++ ++ } ++ ++ namespace test_extended_aggregate_initialization ++ { ++ ++ struct base1 ++ { ++ int b1, b2 = 42; ++ }; ++ ++ struct base2 ++ { ++ base2() { ++ b3 = 42; ++ } ++ int b3; ++ }; ++ ++ struct derived : base1, base2 ++ { ++ int d; ++ }; ++ ++ derived d1 {{1, 2}, {}, 4}; // full initialization ++ derived d2 {{}, {}, 4}; // value-initialized bases ++ ++ } ++ ++ namespace test_general_range_based_for_loop ++ { ++ ++ struct iter ++ { ++ int i; ++ ++ int& operator* () ++ { ++ return i; ++ } ++ ++ const int& operator* () const ++ { ++ return i; ++ } ++ ++ iter& operator++() ++ { ++ ++i; ++ return *this; ++ } ++ }; ++ ++ struct sentinel ++ { ++ int i; ++ }; ++ ++ bool operator== (const iter& i, const sentinel& s) ++ { ++ return i.i == s.i; ++ } ++ ++ bool operator!= (const iter& i, const sentinel& s) ++ { ++ return !(i == s); ++ } ++ ++ struct range ++ { ++ iter begin() const ++ { ++ return {0}; ++ } ++ ++ sentinel end() const ++ { ++ return {5}; ++ } ++ }; ++ ++ void f() ++ { ++ range r {}; ++ ++ for (auto i : r) ++ { ++ [[maybe_unused]] auto v = i; ++ } ++ } ++ ++ } ++ ++ namespace test_lambda_capture_asterisk_this_by_value ++ { ++ ++ struct t ++ { ++ int i; ++ int foo() ++ { ++ return [*this]() ++ { ++ return i; ++ }(); ++ } ++ }; ++ ++ } ++ ++ namespace test_enum_class_construction ++ { ++ ++ enum class byte : unsigned char ++ {}; ++ ++ byte foo {42}; ++ ++ } ++ ++ namespace test_constexpr_if ++ { ++ ++ template ++ int f () ++ { ++ if constexpr(cond) ++ { ++ return 13; ++ } ++ else ++ { ++ return 42; ++ } ++ } ++ ++ } ++ ++ namespace test_selection_statement_with_initializer ++ { ++ ++ int f() ++ { ++ return 13; ++ } ++ ++ int f2() ++ { ++ if (auto i = f(); i > 0) ++ { ++ return 3; ++ } ++ ++ switch (auto i = f(); i + 4) ++ { ++ case 17: ++ return 2; ++ ++ default: ++ return 1; ++ } ++ } ++ ++ } ++ ++ namespace test_template_argument_deduction_for_class_templates ++ { ++ ++ template ++ struct pair ++ { ++ pair (T1 p1, T2 p2) ++ : m1 {p1}, ++ m2 {p2} ++ {} ++ ++ T1 m1; ++ T2 m2; ++ }; ++ ++ void f() ++ { ++ [[maybe_unused]] auto p = pair{13, 42u}; ++ } ++ ++ } ++ ++ namespace test_non_type_auto_template_parameters ++ { ++ ++ template ++ struct B ++ {}; ++ ++ B<5> b1; ++ B<'a'> b2; ++ ++ } ++ ++ namespace test_structured_bindings ++ { ++ ++ int arr[2] = { 1, 2 }; ++ std::pair pr = { 1, 2 }; ++ ++ auto f1() -> int(&)[2] ++ { ++ return arr; ++ } ++ ++ auto f2() -> std::pair& ++ { ++ return pr; ++ } ++ ++ struct S ++ { ++ int x1 : 2; ++ volatile double y1; ++ }; ++ ++ S f3() ++ { ++ return {}; ++ } ++ ++ auto [ x1, y1 ] = f1(); ++ auto& [ xr1, yr1 ] = f1(); ++ auto [ x2, y2 ] = f2(); ++ auto& [ xr2, yr2 ] = f2(); ++ const auto [ x3, y3 ] = f3(); ++ ++ } ++ ++ namespace test_exception_spec_type_system ++ { ++ ++ struct Good {}; ++ struct Bad {}; ++ ++ void g1() noexcept; ++ void g2(); ++ ++ template ++ Bad ++ f(T*, T*); ++ ++ template ++ Good ++ f(T1*, T2*); ++ ++ static_assert (std::is_same_v); ++ ++ } ++ ++ namespace test_inline_variables ++ { ++ ++ template void f(T) ++ {} ++ ++ template inline T g(T) ++ { ++ return T{}; ++ } ++ ++ template<> inline void f<>(int) ++ {} ++ ++ template<> int g<>(int) ++ { ++ return 5; ++ } ++ ++ } ++ ++} // namespace cxx17 ++ ++#endif // __cplusplus < 201703L ++ ++]]) +-- +2.28.0 + diff --git a/patches/gappa/remake.patch b/patches/gappa/remake.patch new file mode 100644 index 0000000..4a40384 --- /dev/null +++ b/patches/gappa/remake.patch @@ -0,0 +1,22 @@ +diff --git a/remake.cpp b/remake.cpp +index 3a6af80..d5ac424 100644 +--- a/remake.cpp ++++ b/remake.cpp +@@ -450,7 +450,7 @@ enum { INVALID_SOCKET = -1 }; + extern char **environ; + #endif + +-#if defined(WINDOWS) || defined(MACOSX) ++# if (defined(WINDOWS) || defined(MACOSX)) && ! defined(MSG_NOSIGNAL) + enum { MSG_NOSIGNAL = 0 }; + #endif + +@@ -786,7 +786,7 @@ struct log + } + }; + +-static log debug; ++static struct log debug; + + struct log_auto_close + { diff --git a/patches/gasoline/META.0.1 b/patches/gasoline/META.0.1 new file mode 100644 index 0000000..de3be8b --- /dev/null +++ b/patches/gasoline/META.0.1 @@ -0,0 +1,8 @@ +name="gasoline" +version="0.1" +description="Rapid application development package" +requires="camomile" + +archive(byte)="gasoline_appkit.cma" +archive(byte)+="gasoline_authorkit.cma" +archive(byte)+="gasoline_testkit.cma" diff --git a/patches/gasoline/gasoline.install b/patches/gasoline/gasoline.install new file mode 100644 index 0000000..24faec0 --- /dev/null +++ b/patches/gasoline/gasoline.install @@ -0,0 +1,25 @@ +lib: [ + "META" + "appkit/cApplication.cmi" + "appkit/cConfigurationMap.cmi" + "appkit/cMessage.cmi" + "appkit/cType.cmi" + "appkit/configurationMap.cmi" + "appkit/configurationParser.cmi" + "appkit/gasoline_appkit.cma" + "authorkit/gasoline_authorkit.cma" + "testkit/gasoline_testkit.cma" + "appkit/generic_application.cmi" + "appkit/generic_asset.cmi" + "appkit/generic_component.cmi" + "appkit/generic_diagnostic.cmi" + "appkit/generic_message.cmi" + "appkit/generic_type.cmi" + "appkit/getopt.cmi" + "authorkit/loremIpsum.cmi" + "appkit/sysExits.cmi" + "appkit/unicode.cmi" + "testkit/unitTest.cmi" + "authorkit/wHTML.cmi" + "authorkit/wSGML.cmi" +] diff --git a/patches/gdb/gdb.install b/patches/gdb/gdb.install new file mode 100644 index 0000000..1f2435e --- /dev/null +++ b/patches/gdb/gdb.install @@ -0,0 +1,3 @@ +bin: [ + "?_build/src/rmp.native" {"rmp"} +] diff --git a/patches/genlet/META.201406 b/patches/genlet/META.201406 new file mode 100644 index 0000000..b0141a9 --- /dev/null +++ b/patches/genlet/META.201406 @@ -0,0 +1,6 @@ +version = "0.3" +description = "Let insertion for MetaOCaml." +requires = "delimcc" +archive(byte) = "genlet.cma" +archive(native) = "genlet.cmxa" +exists_if = "genlet.cma" diff --git a/patches/genlet/gengenlet.ml b/patches/genlet/gengenlet.ml new file mode 100644 index 0000000..5711f41 --- /dev/null +++ b/patches/genlet/gengenlet.ml @@ -0,0 +1,192 @@ +(* Generic let-insertion: + genlet code +inserts a let expression to bind 'code' as high as possible -- +as high in the scope as still safe (creating no scope extrusion). + +*) + +(* We will be using delimited control. So we load it up and set up *) +(* +#directory "/home/oleg/Cache/ncaml4/caml-shift/";; +#directory "/usr/local/src/ncaml4/caml-shift/";; +#load "delimcc.cma";; +*) + +open Delimcc;; +open Runcode;; (* To run the code *) + +(* If we are going to use delimited control, we need to tell MetaOCaml, + by adjusting its stackmark facility -- provide the implementation of + stackmarks that works with delimcc. +*) +Trx.set_with_stack_mark {Trx.stackmark_region_fn = fun body -> + let p = new_prompt () in + push_prompt p (fun () -> body (fun () -> is_prompt_set p))} +;; + +(* Let-insertion request (with an existential) + We ask to let-bind the code value and return the corresponding + let-bound identifier. + If the response is (c,true), the request was satisfied and + c is the let-bound identifier. + If the response is (c,false), the let-binding was unsuccessful + and c is the original code from the request. +*) +type genlet_req = + | Done: genlet_req + | Req: 'a code * ('a code * bool -> genlet_req) -> genlet_req +;; + +(* The single prompt for let-insertion *) +let p : genlet_req prompt = new_prompt () + +(* Send the let-insertion request for a given code. + If the prompt is not set, just return (c,false) +*) + +let send_req : 'a code -> 'a code * bool = fun c -> + if is_prompt_set p then + shift0 p (fun k -> Req (c,k)) + else (c,false) + +let genlet : 'a code -> 'a code = fun c -> + fst @@ send_req c + +(* We often use mutable variables as `communication channel', to appease + the type-checker. The variable stores the `option' value -- + most of the time, None. One function writes a Some x value, + and another function almost immediately reads the value -- exactly + once. The protocol of using such a variable is a sequence of + one write almost immediately followed by one read. + We use the following helpers to access our `communication channel'. +*) +let from_option = function Some x -> x | None -> failwith "fromoption";; + +let read_answer r = let v = from_option !r in r := None; v (* for safety *) + +(* Check if a piece of code contains free variables that cannot + be bound. We try to incorporate the received piece of code + into a larger piece of code. At this point, MetaOCaml does + the scope extrusion check, throwing an exception if the check fails. +*) +let is_well_scoped : 'a code -> bool = fun c -> + try ignore (..); true with e -> false + +(* The point of inserting let: the handler for genlet_req + Upon receiving the let-binding request and before satsifying + it, we check if the request can be fulfilled by a handler + upstream. + That is, we try to insert let `as high as possible'. + *) +let let_locus : (unit -> 'w code) -> 'w code = fun body -> + let r = ref None in + let rec loop = function + | Done -> read_answer r + | Req (c,k) -> + if not (is_well_scoped c) then loop (k (c,false)) + else (* try higher *) + begin + match send_req c with + | (c,false) -> ..,true)))>. + | x -> loop (k x) (* c is a variable, inserted higher *) + end + in + loop @@ push_prompt p @@ fun () -> + r := Some (body ()); Done + +(* Tests *) +let t1 = .<1 + .~(genlet .<2>.)>. +(* val t1 : int code = .<1 + 2>. *) + +let t2 = . 1 + .~(genlet .<2>.)>. +(* val t2 : ('a -> int) code = . 1 + 2>. *) + +let t3 = let_locus (fun () -> . 1 + .~(genlet .<2>.)>.) +(* val t3 : ('_a -> int) code = . 1 + t_3>. +*) + +let t4 = let_locus (fun () -> . 1 + .~(genlet ..)>.) +(* val t4 : (int -> int) code = . 1 + x_9>. +*) + +let t5 = let_locus (fun () -> + . .~(let_locus (fun () -> + . .~(let_locus (fun () -> + .<1 + .~(genlet .<2+3>.)>.)) + >.)) + >.) +(* +val t5 : ('_a -> '_b -> int) code = .< + let t_12 = 2 + 3 in fun x_10 y_11 -> 1 + t_12>. +*) + +let t51 = let_locus (fun () -> + . .~(let_locus (fun () -> + . .~(let_locus (fun () -> + .<1 + .~(genlet .<2+x>.)>.)) + >.)) + >.) +(* +val t51 : (int -> '_a -> int) code = .< + fun x_13 -> let t_15 = 2 + x_13 in fun y_14 -> 1 + t_15>. +*) +let t52 = let_locus (fun () -> + . .~(let_locus (fun () -> + . .~(let_locus (fun () -> + .<1 + .~(genlet ..)>.)) + >.)) + >.) +(* +val t52 : (int -> int -> int) code = .< + fun x_16 y_17 -> let t_18 = y_17 + x_16 in 1 + t_18>. +*) + + +(* Further examples *) + +(* A simple DSL. See loop_motion_gen.ml for a realistic example *) +module type DSL = sig + val sqr : int code -> int code + val make_incr_fun : (int code -> int code) -> (int -> int) code +end + +(* Sample DSL expressions *) +module DSLExp(S: DSL) = struct + open S + let exp1 = sqr .<2+3>. + let exp2 = make_incr_fun (fun x -> sqr .<2+3>.) + let exp3 = make_incr_fun (fun x -> sqr .<.~x + 3>.) +end + +(* The naive implementation of the DSL *) +module DSL1 = struct + let sqr e = .<.~e * .~e>. + let make_incr_fun body = . x + .~(body ..)>. +end + +let module M = DSLExp(DSL1) in + (M.exp1, M.exp2, M.exp3) +(* +- : int code * (int -> int) code * (int -> int) code = +(.<(2 + 3) * (2 + 3)>. , + . x_14 + ((2 + 3) * (2 + 3))>. , + . x_15 + ((x_15 + 3) * (x_15 + 3))>. ) +*) + +(* Adding let-insertion, trasparently *) +module DSL2 = struct + let sqr e = DSL1.sqr (genlet e) + let make_incr_fun body = + let_locus @@ fun () -> + DSL1.make_incr_fun @@ fun x -> + let_locus @@ fun () -> + body x +end + +let module M = DSLExp(DSL2) in + (M.exp1, M.exp2, M.exp3) +(* +(.<(2 + 3) * (2 + 3)>. , + . x_16 + (t_17 * t_17)>. , + . x_18 + (let t_19 = x_18 + 3 in t_19 * t_19)>. ) +*) diff --git a/patches/genlet/gengenlet.mli b/patches/genlet/gengenlet.mli new file mode 100644 index 0000000..c2c830c --- /dev/null +++ b/patches/genlet/gengenlet.mli @@ -0,0 +1,17 @@ +(* + Safe and modular let-insertion for MetaOCaml. + + See http://okmij.org/ftp/meta-programming/#let-insert + + Example: + let_locus (fun () -> + .< 1 + .~(genlet .< 2 >.) >. + ~> + .< let x = 2 in + 1 + x >. + + [This interface file added by Jeremy Yallop, March 2015.] + *) + +val genlet : 'a code -> 'a code +val let_locus : (unit -> 'w code) -> 'w code diff --git a/patches/genlet/genlet.install b/patches/genlet/genlet.install new file mode 100644 index 0000000..4522624 --- /dev/null +++ b/patches/genlet/genlet.install @@ -0,0 +1,7 @@ +lib: [ + "genlet.a" + "genlet.cma" + "gengenlet.cmi" + "genlet.cmxa" + "META" +] diff --git a/patches/genlet/remove-tests.patch b/patches/genlet/remove-tests.patch new file mode 100644 index 0000000..335ddc8 --- /dev/null +++ b/patches/genlet/remove-tests.patch @@ -0,0 +1,105 @@ +diff --git a/gengenlet.ml b/gengenlet.ml +index 5711f41..d70f2ce 100644 +--- a/gengenlet.ml ++++ b/gengenlet.ml +@@ -93,100 +93,3 @@ let let_locus : (unit -> 'w code) -> 'w code = fun body -> + in + loop @@ push_prompt p @@ fun () -> + r := Some (body ()); Done +- +-(* Tests *) +-let t1 = .<1 + .~(genlet .<2>.)>. +-(* val t1 : int code = .<1 + 2>. *) +- +-let t2 = . 1 + .~(genlet .<2>.)>. +-(* val t2 : ('a -> int) code = . 1 + 2>. *) +- +-let t3 = let_locus (fun () -> . 1 + .~(genlet .<2>.)>.) +-(* val t3 : ('_a -> int) code = . 1 + t_3>. +-*) +- +-let t4 = let_locus (fun () -> . 1 + .~(genlet ..)>.) +-(* val t4 : (int -> int) code = . 1 + x_9>. +-*) +- +-let t5 = let_locus (fun () -> +- . .~(let_locus (fun () -> +- . .~(let_locus (fun () -> +- .<1 + .~(genlet .<2+3>.)>.)) +- >.)) +- >.) +-(* +-val t5 : ('_a -> '_b -> int) code = .< +- let t_12 = 2 + 3 in fun x_10 y_11 -> 1 + t_12>. +-*) +- +-let t51 = let_locus (fun () -> +- . .~(let_locus (fun () -> +- . .~(let_locus (fun () -> +- .<1 + .~(genlet .<2+x>.)>.)) +- >.)) +- >.) +-(* +-val t51 : (int -> '_a -> int) code = .< +- fun x_13 -> let t_15 = 2 + x_13 in fun y_14 -> 1 + t_15>. +-*) +-let t52 = let_locus (fun () -> +- . .~(let_locus (fun () -> +- . .~(let_locus (fun () -> +- .<1 + .~(genlet ..)>.)) +- >.)) +- >.) +-(* +-val t52 : (int -> int -> int) code = .< +- fun x_16 y_17 -> let t_18 = y_17 + x_16 in 1 + t_18>. +-*) +- +- +-(* Further examples *) +- +-(* A simple DSL. See loop_motion_gen.ml for a realistic example *) +-module type DSL = sig +- val sqr : int code -> int code +- val make_incr_fun : (int code -> int code) -> (int -> int) code +-end +- +-(* Sample DSL expressions *) +-module DSLExp(S: DSL) = struct +- open S +- let exp1 = sqr .<2+3>. +- let exp2 = make_incr_fun (fun x -> sqr .<2+3>.) +- let exp3 = make_incr_fun (fun x -> sqr .<.~x + 3>.) +-end +- +-(* The naive implementation of the DSL *) +-module DSL1 = struct +- let sqr e = .<.~e * .~e>. +- let make_incr_fun body = . x + .~(body ..)>. +-end +- +-let module M = DSLExp(DSL1) in +- (M.exp1, M.exp2, M.exp3) +-(* +-- : int code * (int -> int) code * (int -> int) code = +-(.<(2 + 3) * (2 + 3)>. , +- . x_14 + ((2 + 3) * (2 + 3))>. , +- . x_15 + ((x_15 + 3) * (x_15 + 3))>. ) +-*) +- +-(* Adding let-insertion, trasparently *) +-module DSL2 = struct +- let sqr e = DSL1.sqr (genlet e) +- let make_incr_fun body = +- let_locus @@ fun () -> +- DSL1.make_incr_fun @@ fun x -> +- let_locus @@ fun () -> +- body x +-end +- +-let module M = DSLExp(DSL2) in +- (M.exp1, M.exp2, M.exp3) +-(* +-(.<(2 + 3) * (2 + 3)>. , +- . x_16 + (t_17 * t_17)>. , +- . x_18 + (let t_19 = x_18 + 3 in t_19 * t_19)>. ) +-*) diff --git a/patches/getopt/getopt.install b/patches/getopt/getopt.install new file mode 100644 index 0000000..443697c --- /dev/null +++ b/patches/getopt/getopt.install @@ -0,0 +1 @@ +bin: ["_build/sample.byte" {"getopt-sample"}] diff --git a/patches/gettext/gettext.install b/patches/gettext/gettext.install new file mode 100644 index 0000000..d3545b1 --- /dev/null +++ b/patches/gettext/gettext.install @@ -0,0 +1,4 @@ +bin: [ + "_build/bin/ocaml-gettext" + "_build/bin/ocaml-xgettext" +] diff --git a/patches/git/remove-warn-error.diff b/patches/git/remove-warn-error.diff new file mode 100644 index 0000000..ff56975 --- /dev/null +++ b/patches/git/remove-warn-error.diff @@ -0,0 +1,12 @@ +diff --git a/_tags b/_tags +index 9535c69..5d4cbd5 100644 +--- a/_tags ++++ b/_tags +@@ -172,4 +172,5 @@ true: annot, bin_annot + : use_git-unix + # OASIS_STOP + true: debug, bin_annot +-true: warn_error_A, warn(A-4-41-44) ++true: warn(A-4-41-44) ++# true: warn_error_A +\ No newline at end of file diff --git a/patches/gitlab-unix/no-diff-installed.patch b/patches/gitlab-unix/no-diff-installed.patch new file mode 100644 index 0000000..2165736 --- /dev/null +++ b/patches/gitlab-unix/no-diff-installed.patch @@ -0,0 +1,12 @@ +--- a/test/dune 2022-02-02 10:44:47.000000000 +0000 ++++ b/test/dune 2022-02-02 10:45:06.000000000 +0000 +@@ -7,9 +7,7 @@ + ; (source_tree cases))) + + (executable +- (package gitlab-unix) + (libraries gitlab-unix cmdliner) +- (public_name diff) + (modules diff) + (name diff)) + diff --git a/patches/gmp-freestanding/gmp-freestanding.pc.6.0.0 b/patches/gmp-freestanding/gmp-freestanding.pc.6.0.0 new file mode 100644 index 0000000..0bd650e --- /dev/null +++ b/patches/gmp-freestanding/gmp-freestanding.pc.6.0.0 @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.0.0 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/patches/gmp-freestanding/gmp-freestanding.pc.6.0.0-1 b/patches/gmp-freestanding/gmp-freestanding.pc.6.0.0-1 new file mode 100644 index 0000000..0bd650e --- /dev/null +++ b/patches/gmp-freestanding/gmp-freestanding.pc.6.0.0-1 @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.0.0 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2 b/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2 new file mode 100644 index 0000000..bf852be --- /dev/null +++ b/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2 @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.1.2 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-1 b/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-1 new file mode 100644 index 0000000..bf852be --- /dev/null +++ b/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-1 @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.1.2 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-2 b/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-2 new file mode 100644 index 0000000..bf852be --- /dev/null +++ b/patches/gmp-freestanding/gmp-freestanding.pc.6.1.2-2 @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.1.2 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/patches/gmp-freestanding/gmp-freestanding.pc.6.2.0 b/patches/gmp-freestanding/gmp-freestanding.pc.6.2.0 new file mode 100644 index 0000000..a8fff23 --- /dev/null +++ b/patches/gmp-freestanding/gmp-freestanding.pc.6.2.0 @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.2.0 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/patches/gmp-freestanding/gmp-freestanding.pc.6.2.1 b/patches/gmp-freestanding/gmp-freestanding.pc.6.2.1 new file mode 100644 index 0000000..d8459fe --- /dev/null +++ b/patches/gmp-freestanding/gmp-freestanding.pc.6.2.1 @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-freestanding +includedir=${libdir}/include + +Name: gmp-freestanding +Version: 6.2.1 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-freestanding diff --git a/patches/gmp-freestanding/mirage-build.sh.6.0.0 b/patches/gmp-freestanding/mirage-build.sh.6.0.0 new file mode 100644 index 0000000..fa768bd --- /dev/null +++ b/patches/gmp-freestanding/mirage-build.sh.6.0.0 @@ -0,0 +1,37 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=x86_64-unknown-none --enable-fat --disable-shared \ + CC=cc "CPPFLAGS=$(pkg-config --cflags ${PKG_CONFIG_DEPS})" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/patches/gmp-freestanding/mirage-build.sh.6.0.0-1 b/patches/gmp-freestanding/mirage-build.sh.6.0.0-1 new file mode 100644 index 0000000..0265505 --- /dev/null +++ b/patches/gmp-freestanding/mirage-build.sh.6.0.0-1 @@ -0,0 +1,37 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=x86_64-unknown-none --enable-fat --disable-shared --with-pic \ + CC=cc "CPPFLAGS=$(pkg-config --cflags ${PKG_CONFIG_DEPS})" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/patches/gmp-freestanding/mirage-build.sh.6.1.2 b/patches/gmp-freestanding/mirage-build.sh.6.1.2 new file mode 100644 index 0000000..0265505 --- /dev/null +++ b/patches/gmp-freestanding/mirage-build.sh.6.1.2 @@ -0,0 +1,37 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=x86_64-unknown-none --enable-fat --disable-shared --with-pic \ + CC=cc "CPPFLAGS=$(pkg-config --cflags ${PKG_CONFIG_DEPS})" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/patches/gmp-freestanding/mirage-build.sh.6.1.2-1 b/patches/gmp-freestanding/mirage-build.sh.6.1.2-1 new file mode 100644 index 0000000..58648f1 --- /dev/null +++ b/patches/gmp-freestanding/mirage-build.sh.6.1.2-1 @@ -0,0 +1,37 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=$(uname -m)-unknown-none --enable-fat --disable-shared --with-pic \ + CC=cc "CPPFLAGS=$(pkg-config --cflags ${PKG_CONFIG_DEPS})" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/patches/gmp-freestanding/mirage-build.sh.6.1.2-2 b/patches/gmp-freestanding/mirage-build.sh.6.1.2-2 new file mode 100644 index 0000000..c6b20af --- /dev/null +++ b/patches/gmp-freestanding/mirage-build.sh.6.1.2-2 @@ -0,0 +1,43 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +# Further, with the introduction of -fstack-protector-strong in Solo5, override +# this during './configure' to prevent it complaining that the compiler does not +# work, and reinstate it again during 'make'. +# +FREESTANDING_CFLAGS="$(pkg-config --cflags ${PKG_CONFIG_DEPS})" +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=$(uname -m)-unknown-none --enable-fat --disable-shared --with-pic=no \ + CC=cc "CPPFLAGS=${FREESTANDING_CFLAGS} -fno-stack-protector" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CPPFLAGS="${FREESTANDING_CFLAGS}" \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/patches/gmp-freestanding/mirage-build.sh.6.2.0 b/patches/gmp-freestanding/mirage-build.sh.6.2.0 new file mode 100644 index 0000000..c6b20af --- /dev/null +++ b/patches/gmp-freestanding/mirage-build.sh.6.2.0 @@ -0,0 +1,43 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +# Further, with the introduction of -fstack-protector-strong in Solo5, override +# this during './configure' to prevent it complaining that the compiler does not +# work, and reinstate it again during 'make'. +# +FREESTANDING_CFLAGS="$(pkg-config --cflags ${PKG_CONFIG_DEPS})" +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=$(uname -m)-unknown-none --enable-fat --disable-shared --with-pic=no \ + CC=cc "CPPFLAGS=${FREESTANDING_CFLAGS} -fno-stack-protector" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CPPFLAGS="${FREESTANDING_CFLAGS}" \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/patches/gmp-freestanding/mirage-build.sh.6.2.1 b/patches/gmp-freestanding/mirage-build.sh.6.2.1 new file mode 100644 index 0000000..c6b20af --- /dev/null +++ b/patches/gmp-freestanding/mirage-build.sh.6.2.1 @@ -0,0 +1,43 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-freestanding" +fi + +PKG_CONFIG_DEPS="ocaml-freestanding" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +# +# ocaml-freestanding does not provide a real cross compiler, so we fake it: +# +# - set CC to stop configure trying to find a host compiler +# - set CPPFLAGS to ocaml-freestanding CFLAGS, this prevents inclusion of +# system headers +# - manually override tests for missing functions +# - manually trim the components (SUBDIRS) of libgmp we build to the subset +# actually used by zarith-freestanding (our sole dependency) +# - set -Werror=implicit-function-declaration at *build* time to catch any +# undefined symbols +# +# Further, with the introduction of -fstack-protector-strong in Solo5, override +# this during './configure' to prevent it complaining that the compiler does not +# work, and reinstate it again during 'make'. +# +FREESTANDING_CFLAGS="$(pkg-config --cflags ${PKG_CONFIG_DEPS})" +ac_cv_func_obstack_vprintf=no \ +ac_cv_func_localeconv=no \ +./configure \ + --host=$(uname -m)-unknown-none --enable-fat --disable-shared --with-pic=no \ + CC=cc "CPPFLAGS=${FREESTANDING_CFLAGS} -fno-stack-protector" + +make SUBDIRS="mpn mpz mpq mpf" \ + PRINTF_OBJECTS= SCANF_OBJECTS= \ + CPPFLAGS="${FREESTANDING_CFLAGS}" \ + CFLAGS+=-Werror=implicit-function-declaration diff --git a/patches/gmp-freestanding/mirage-install.sh b/patches/gmp-freestanding/mirage-install.sh new file mode 100644 index 0000000..a09b15b --- /dev/null +++ b/patches/gmp-freestanding/mirage-install.sh @@ -0,0 +1,14 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX=`opam config var prefix` +fi +PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig +LIBDIR=${PREFIX}/lib/gmp-freestanding + +mkdir -p ${PKG_CONFIG_PATH} +cp gmp-freestanding.pc ${PKG_CONFIG_PATH} +mkdir -p ${LIBDIR} +cp .libs/libgmp.a ${LIBDIR}/libgmp-freestanding.a +touch ${LIBDIR}/META +mkdir -p ${LIBDIR}/include +cp gmp.h ${LIBDIR}/include diff --git a/patches/gmp-xen/gmp-6a.diff b/patches/gmp-xen/gmp-6a.diff new file mode 100644 index 0000000..6c54c67 --- /dev/null +++ b/patches/gmp-xen/gmp-6a.diff @@ -0,0 +1,20 @@ +--- gmp-6.0.0.orig.orig/config.guess 2014-03-25 14:37:55.000000000 +0000 ++++ gmp-6.0.0.orig/config.guess 2014-09-16 15:46:57.457485087 +0000 +@@ -173,7 +173,7 @@ + ;; + + arm*-*-*) +- cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null` ++ cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo | head -1 2>/dev/null` + case "$cpu_code" in + 0xa10 | 0xa11 | 0xb11) # v4 strongarm/sa1100 + exact_cpu="armsa1";; +@@ -200,7 +200,7 @@ + 0xc15) exact_cpu="armcortexr5";; # v7r + 0xc23) exact_cpu="armcortexm3";; # v7m + esac +- exact_cpu="${exact_cpu}`sed -n 's;^Features.*\(neon\).*;\1;p' /proc/cpuinfo 2>/dev/null`" ++ exact_cpu="${exact_cpu}`sed -n 's;^Features.*\(neon\).*;\1;p' /proc/cpuinfo | head -1 2>/dev/null`" + ;; + + ia64*-*-*) diff --git a/patches/gmp-xen/gmp-xen.pc b/patches/gmp-xen/gmp-xen.pc new file mode 100644 index 0000000..f1c7783 --- /dev/null +++ b/patches/gmp-xen/gmp-xen.pc @@ -0,0 +1,9 @@ +libdir=${pcfiledir}/../gmp-xen +includedir=${libdir}/include + +Name: gmp-xen +Version: 6.0.0 +URL: https://gmplib.org +Description: The GNU Multiple Precision Arithmetic Library +Cflags: -I${includedir} +Libs: -L${libdir} -lgmp-xen diff --git a/patches/gmp-xen/mirage-build.sh.6.0.0 b/patches/gmp-xen/mirage-build.sh.6.0.0 new file mode 100644 index 0000000..f228041 --- /dev/null +++ b/patches/gmp-xen/mirage-build.sh.6.0.0 @@ -0,0 +1,31 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-xen" +fi + +PKG_CONFIG_DEPS="mirage-xen-posix" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +CPPFLAGS="$CPPFLAGS `pkg-config $PKG_CONFIG_DEPS --cflags` -O2 -pedantic -fomit-frame-pointer -fno-builtin -D_FORTIFY_SOURCE=0 -Wmissing-prototypes --std=gnu99" +# Use different --host and --build to trigger cross-compilation mode (don't try to test binaries during configure) +# Set CC to stop it trying to find a separate compiler for HOST. +# Pass CPPFLAGS (not just CFLAGS) to stop it finding the Linux headers (just generates warnings). +# Use -Werror=missing-prototypes because we're not running the tests due to cross-compiling. +HOST="`uname -m`-unknown-none" +BUILD=`./config.guess` +./configure --host="$HOST" --build="$BUILD" --enable-fat CC=gcc --prefix="$PREFIX" --disable-shared CPPFLAGS="$CPPFLAGS" +# Because we're cross-compiling, configurate can't tell whether a function +# actually exists and just assumes they all do. For localeconv, this is wrong. +sed -e '/HAVE_LOCALECONV/d' \ + -e '/HAVE_OBSTACK_VPRINTF/d'\ + -i config.status +./config.status +make diff --git a/patches/gmp-xen/mirage-build.sh.6.0.0-1 b/patches/gmp-xen/mirage-build.sh.6.0.0-1 new file mode 100644 index 0000000..12471bf --- /dev/null +++ b/patches/gmp-xen/mirage-build.sh.6.0.0-1 @@ -0,0 +1,31 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX="`opam config var prefix`/lib/gmp-xen" +fi + +PKG_CONFIG_DEPS="mirage-xen-posix" +check_deps () { + pkg-config --print-errors --exists ${PKG_CONFIG_DEPS} +} + +if ! check_deps 2>/dev/null; then + # rely on `opam` if deps are unavailable + export PKG_CONFIG_PATH="`opam config var prefix`/lib/pkgconfig" +fi +check_deps || exit 1 + +CPPFLAGS="$CPPFLAGS `pkg-config $PKG_CONFIG_DEPS --cflags` -O2 -pedantic -fomit-frame-pointer -fno-builtin -D_FORTIFY_SOURCE=0 -Wmissing-prototypes --std=gnu99" +# Use different --host and --build to trigger cross-compilation mode (don't try to test binaries during configure) +# Set CC to stop it trying to find a separate compiler for HOST. +# Pass CPPFLAGS (not just CFLAGS) to stop it finding the Linux headers (just generates warnings). +# Use -Werror=missing-prototypes because we're not running the tests due to cross-compiling. +HOST="`uname -m`-unknown-none" +BUILD=`./config.guess` +./configure --host="$HOST" --build="$BUILD" --enable-fat CC=gcc --prefix="$PREFIX" --disable-shared CPPFLAGS="$CPPFLAGS" --with-pic +# Because we're cross-compiling, configurate can't tell whether a function +# actually exists and just assumes they all do. For localeconv, this is wrong. +sed -e '/HAVE_LOCALECONV/d' \ + -e '/HAVE_OBSTACK_VPRINTF/d'\ + -i config.status +./config.status +make diff --git a/patches/gmp-xen/mirage-install.sh b/patches/gmp-xen/mirage-install.sh new file mode 100644 index 0000000..56b3d7a --- /dev/null +++ b/patches/gmp-xen/mirage-install.sh @@ -0,0 +1,13 @@ +#!/bin/sh -ex +if [ -z "$PREFIX" ]; then + PREFIX=`opam config var prefix` +fi +LIBDIR="$PREFIX/lib/gmp-xen" +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +make install +mkdir -p "$PKG_CONFIG_PATH" +cp gmp-xen.pc "$PKG_CONFIG_PATH/" +mkdir -p "$LIBDIR" +cp .libs/libgmp.a "$LIBDIR/libgmp-xen.a" diff --git a/patches/goblint-cil/realGccConfigure.patch b/patches/goblint-cil/realGccConfigure.patch new file mode 100644 index 0000000..a639ee8 --- /dev/null +++ b/patches/goblint-cil/realGccConfigure.patch @@ -0,0 +1,15 @@ +diff --git a/bin/realGccConfigure.ml b/bin/realGccConfigure.ml +index 738f419e..90337c2f 100644 +--- a/bin/realGccConfigure.ml ++++ b/bin/realGccConfigure.ml +@@ -13,6 +13,10 @@ let is_real_gcc c gcc = + + let gccs = [ + "gcc"; ++ "gcc-16"; ++ "gcc-15"; ++ "gcc-14"; ++ "gcc-13"; + "gcc-12"; + "gcc-11"; + "gcc-10"; diff --git a/patches/goblint/0001-Fix-deprecated-File.exists-in-update_suite.rb.patch b/patches/goblint/0001-Fix-deprecated-File.exists-in-update_suite.rb.patch new file mode 100644 index 0000000..416f8cb --- /dev/null +++ b/patches/goblint/0001-Fix-deprecated-File.exists-in-update_suite.rb.patch @@ -0,0 +1,39 @@ +From 1128aba94f87b95031bef9929dea7294c78b880f Mon Sep 17 00:00:00 2001 +From: Simmo Saan +Date: Mon, 11 Sep 2023 15:30:40 +0300 +Subject: [PATCH] Fix deprecated File.exists? in update_suite.rb + +--- + scripts/update_suite.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/update_suite.rb b/scripts/update_suite.rb +index aeac52698..ca408a513 100755 +--- a/scripts/update_suite.rb ++++ b/scripts/update_suite.rb +@@ -41,7 +41,7 @@ end + + $goblint = File.join(Dir.getwd,"goblint") + goblintbyte = File.join(Dir.getwd,"goblint.byte") +-if File.exists?(goblintbyte) then ++if File.exist?(goblintbyte) then + puts "Running the byte-code version! Continue? (y/n)" + exit unless $stdin.gets()[0] == 'y' + $goblint = goblintbyte +@@ -50,11 +50,11 @@ elsif not File.exist?($goblint) then + end + $vrsn = `#{$goblint} --version` + +-if not File.exists? "linux-headers" then ++if not File.exist? "linux-headers" then + puts "Missing linux-headers, will download now!" + `make headers` + end +-has_linux_headers = File.exists? "linux-headers" # skip kernel tests if make headers failed (e.g. on opam-repository opam-ci where network is forbidden) ++has_linux_headers = File.exist? "linux-headers" # skip kernel tests if make headers failed (e.g. on opam-repository opam-ci where network is forbidden) + + #Command line parameters + #Either only run a single test, or +-- +2.41.0 + diff --git a/patches/gpr/gpr.install.1.2.1 b/patches/gpr/gpr.install.1.2.1 new file mode 100644 index 0000000..ac3c2b6 --- /dev/null +++ b/patches/gpr/gpr.install.1.2.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/app/ocaml_gpr.byte" {"ocaml_gpr"} + "?_build/app/ocaml_gpr.native" {"ocaml_gpr"} +] diff --git a/patches/gpr/gpr.install.1.2.2 b/patches/gpr/gpr.install.1.2.2 new file mode 100644 index 0000000..075d452 --- /dev/null +++ b/patches/gpr/gpr.install.1.2.2 @@ -0,0 +1,5 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" +] diff --git a/patches/grain_dypgen/dypgen.install b/patches/grain_dypgen/dypgen.install new file mode 100644 index 0000000..acd726d --- /dev/null +++ b/patches/grain_dypgen/dypgen.install @@ -0,0 +1,5 @@ +bin: [ + "dypgen/dypgen.opt" + "dypgen/dypgen" + "dyp2gram.pl" {"dyp2gram"} +] diff --git a/patches/grain_dypgen/install-bsd-compatible.patch b/patches/grain_dypgen/install-bsd-compatible.patch new file mode 100644 index 0000000..9c2cf07 --- /dev/null +++ b/patches/grain_dypgen/install-bsd-compatible.patch @@ -0,0 +1,62 @@ +--- dypgen.20120619-1/Makefile.orig 2013-04-02 16:17:00.000000000 +0200 ++++ dypgen.20120619-1/Makefile 2013-04-02 16:21:59.000000000 +0200 +@@ -22,20 +22,24 @@ + + #install with ocaml-findlib + install: install_opt +- install -D --mode=755 dypgen/dypgen $(BINDIR) +- install -D --mode=755 dyp2gram.pl $(BINDIR)/dyp2gram +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 ++ install -d $(BINDIR) ++ install -m 755 dypgen/dypgen $(BINDIR) ++ install -m 755 dyp2gram.pl $(BINDIR)/dyp2gram ++ install -d $(MANDIR) ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 + cd dyplib; $(MAKE) install + + #install without ocaml-findlib + install2: install_opt +- install -D --mode=755 dypgen/dypgen $(BINDIR) +- install -D --mode=755 dyp2gram.pl $(BINDIR)/dyp2gram +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 +- install -D --mode=644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 ++ install -d $(BINDIR) ++ install -m 755 dypgen/dypgen $(BINDIR) ++ install -m 755 dyp2gram.pl $(BINDIR)/dyp2gram ++ install -d $(MANDIR) ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dypgen.opt.1 ++ install -m 644 doc/dypgen.1 $(MANDIR)/dyp2gram.1 + cd dyplib; $(MAKE) install2 + + ifdef CAMLOPT +--- dypgen.20120619-1/dyplib/Makefile.orig 2013-04-02 16:15:48.000000000 +0200 ++++ dypgen.20120619-1/dyplib/Makefile 2013-04-02 16:16:41.000000000 +0200 +@@ -28,15 +28,18 @@ + - $(OCAMLFIND) remove -destdir $(DYPGENLIBDIR) dyp + + install2: install_dyp install_opt +- install -D --mode=644 dyp.cmi $(DYPGENLIBDIR)/dyp ++ install -d $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.cmi $(DYPGENLIBDIR)/dyp + + install_dyp: +- install -D --mode=644 dyp.cma $(DYPGENLIBDIR)/dyp ++ install -d $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.cma $(DYPGENLIBDIR)/dyp + + ifdef CAMLOPT + install_opt: +- install -D --mode=644 dyp.cmxa $(DYPGENLIBDIR)/dyp +- install -D --mode=644 dyp.a $(DYPGENLIBDIR)/dyp ++ install -d $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.cmxa $(DYPGENLIBDIR)/dyp ++ install -m 644 dyp.a $(DYPGENLIBDIR)/dyp + else + install_opt: + endif diff --git a/patches/graphics/META.3.07 b/patches/graphics/META.3.07 new file mode 100644 index 0000000..6efedb1 --- /dev/null +++ b/patches/graphics/META.3.07 @@ -0,0 +1,6 @@ +version = "3.07" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.07+1 b/patches/graphics/META.3.07+1 new file mode 100644 index 0000000..1ae154e --- /dev/null +++ b/patches/graphics/META.3.07+1 @@ -0,0 +1,6 @@ +version = "3.07+1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.07+2 b/patches/graphics/META.3.07+2 new file mode 100644 index 0000000..125bdaf --- /dev/null +++ b/patches/graphics/META.3.07+2 @@ -0,0 +1,6 @@ +version = "3.07+2" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.08.0 b/patches/graphics/META.3.08.0 new file mode 100644 index 0000000..1e83812 --- /dev/null +++ b/patches/graphics/META.3.08.0 @@ -0,0 +1,6 @@ +version = "3.08.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.08.1 b/patches/graphics/META.3.08.1 new file mode 100644 index 0000000..94a1be9 --- /dev/null +++ b/patches/graphics/META.3.08.1 @@ -0,0 +1,6 @@ +version = "3.08.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.08.2 b/patches/graphics/META.3.08.2 new file mode 100644 index 0000000..1c5d3b8 --- /dev/null +++ b/patches/graphics/META.3.08.2 @@ -0,0 +1,6 @@ +version = "3.08.2" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.08.3 b/patches/graphics/META.3.08.3 new file mode 100644 index 0000000..619f0e5 --- /dev/null +++ b/patches/graphics/META.3.08.3 @@ -0,0 +1,6 @@ +version = "3.08.3" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.08.4 b/patches/graphics/META.3.08.4 new file mode 100644 index 0000000..a91f591 --- /dev/null +++ b/patches/graphics/META.3.08.4 @@ -0,0 +1,6 @@ +version = "3.08.4" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.09.0 b/patches/graphics/META.3.09.0 new file mode 100644 index 0000000..942cc76 --- /dev/null +++ b/patches/graphics/META.3.09.0 @@ -0,0 +1,6 @@ +version = "3.09.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.09.1 b/patches/graphics/META.3.09.1 new file mode 100644 index 0000000..f822458 --- /dev/null +++ b/patches/graphics/META.3.09.1 @@ -0,0 +1,6 @@ +version = "3.09.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.09.2 b/patches/graphics/META.3.09.2 new file mode 100644 index 0000000..63e4ed1 --- /dev/null +++ b/patches/graphics/META.3.09.2 @@ -0,0 +1,6 @@ +version = "3.09.2" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.09.3 b/patches/graphics/META.3.09.3 new file mode 100644 index 0000000..dd545e6 --- /dev/null +++ b/patches/graphics/META.3.09.3 @@ -0,0 +1,6 @@ +version = "3.09.3" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.10.0 b/patches/graphics/META.3.10.0 new file mode 100644 index 0000000..21069bc --- /dev/null +++ b/patches/graphics/META.3.10.0 @@ -0,0 +1,6 @@ +version = "3.10.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.10.1 b/patches/graphics/META.3.10.1 new file mode 100644 index 0000000..27cc80b --- /dev/null +++ b/patches/graphics/META.3.10.1 @@ -0,0 +1,6 @@ +version = "3.10.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.10.2 b/patches/graphics/META.3.10.2 new file mode 100644 index 0000000..5cd8f9f --- /dev/null +++ b/patches/graphics/META.3.10.2 @@ -0,0 +1,6 @@ +version = "3.10.2" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.11.0 b/patches/graphics/META.3.11.0 new file mode 100644 index 0000000..6362423 --- /dev/null +++ b/patches/graphics/META.3.11.0 @@ -0,0 +1,6 @@ +version = "3.11.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.11.1 b/patches/graphics/META.3.11.1 new file mode 100644 index 0000000..4ec7567 --- /dev/null +++ b/patches/graphics/META.3.11.1 @@ -0,0 +1,6 @@ +version = "3.11.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.11.2 b/patches/graphics/META.3.11.2 new file mode 100644 index 0000000..cf1190d --- /dev/null +++ b/patches/graphics/META.3.11.2 @@ -0,0 +1,6 @@ +version = "3.11.2" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.12.0 b/patches/graphics/META.3.12.0 new file mode 100644 index 0000000..d84ab40 --- /dev/null +++ b/patches/graphics/META.3.12.0 @@ -0,0 +1,6 @@ +version = "3.12.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.3.12.1 b/patches/graphics/META.3.12.1 new file mode 100644 index 0000000..27c3d0e --- /dev/null +++ b/patches/graphics/META.3.12.1 @@ -0,0 +1,6 @@ +version = "3.12.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.00.0 b/patches/graphics/META.4.00.0 new file mode 100644 index 0000000..573850f --- /dev/null +++ b/patches/graphics/META.4.00.0 @@ -0,0 +1,6 @@ +version = "4.00.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.00.1 b/patches/graphics/META.4.00.1 new file mode 100644 index 0000000..c294d73 --- /dev/null +++ b/patches/graphics/META.4.00.1 @@ -0,0 +1,6 @@ +version = "4.00.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.01.0 b/patches/graphics/META.4.01.0 new file mode 100644 index 0000000..79af996 --- /dev/null +++ b/patches/graphics/META.4.01.0 @@ -0,0 +1,6 @@ +version = "4.01.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.02.0 b/patches/graphics/META.4.02.0 new file mode 100644 index 0000000..226134c --- /dev/null +++ b/patches/graphics/META.4.02.0 @@ -0,0 +1,6 @@ +version = "4.02.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.02.1 b/patches/graphics/META.4.02.1 new file mode 100644 index 0000000..9cf9eac --- /dev/null +++ b/patches/graphics/META.4.02.1 @@ -0,0 +1,6 @@ +version = "4.02.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.02.2 b/patches/graphics/META.4.02.2 new file mode 100644 index 0000000..fdb5fe5 --- /dev/null +++ b/patches/graphics/META.4.02.2 @@ -0,0 +1,6 @@ +version = "4.02.2" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.02.3 b/patches/graphics/META.4.02.3 new file mode 100644 index 0000000..c512497 --- /dev/null +++ b/patches/graphics/META.4.02.3 @@ -0,0 +1,6 @@ +version = "4.02.3" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.03.0 b/patches/graphics/META.4.03.0 new file mode 100644 index 0000000..982fc46 --- /dev/null +++ b/patches/graphics/META.4.03.0 @@ -0,0 +1,6 @@ +version = "4.03.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.04.0 b/patches/graphics/META.4.04.0 new file mode 100644 index 0000000..9e03e87 --- /dev/null +++ b/patches/graphics/META.4.04.0 @@ -0,0 +1,6 @@ +version = "4.04.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.04.1 b/patches/graphics/META.4.04.1 new file mode 100644 index 0000000..9fbbb4b --- /dev/null +++ b/patches/graphics/META.4.04.1 @@ -0,0 +1,6 @@ +version = "4.04.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.04.2 b/patches/graphics/META.4.04.2 new file mode 100644 index 0000000..f5a1570 --- /dev/null +++ b/patches/graphics/META.4.04.2 @@ -0,0 +1,6 @@ +version = "4.04.2" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.05.0 b/patches/graphics/META.4.05.0 new file mode 100644 index 0000000..af73d93 --- /dev/null +++ b/patches/graphics/META.4.05.0 @@ -0,0 +1,6 @@ +version = "4.05.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.06.0 b/patches/graphics/META.4.06.0 new file mode 100644 index 0000000..407b982 --- /dev/null +++ b/patches/graphics/META.4.06.0 @@ -0,0 +1,6 @@ +version = "4.06.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.06.1 b/patches/graphics/META.4.06.1 new file mode 100644 index 0000000..4200747 --- /dev/null +++ b/patches/graphics/META.4.06.1 @@ -0,0 +1,6 @@ +version = "4.06.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.07.0 b/patches/graphics/META.4.07.0 new file mode 100644 index 0000000..ca3a50f --- /dev/null +++ b/patches/graphics/META.4.07.0 @@ -0,0 +1,6 @@ +version = "4.07.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.07.1 b/patches/graphics/META.4.07.1 new file mode 100644 index 0000000..01c8664 --- /dev/null +++ b/patches/graphics/META.4.07.1 @@ -0,0 +1,6 @@ +version = "4.07.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.08.0 b/patches/graphics/META.4.08.0 new file mode 100644 index 0000000..d26af09 --- /dev/null +++ b/patches/graphics/META.4.08.0 @@ -0,0 +1,6 @@ +version = "4.08.0" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/META.4.08.1 b/patches/graphics/META.4.08.1 new file mode 100644 index 0000000..0540be9 --- /dev/null +++ b/patches/graphics/META.4.08.1 @@ -0,0 +1,6 @@ +version = "4.08.1" +description = "Portable drawing primitives" +archive(byte) = "graphics.cma" +archive(native) = "graphics.cmxa" +plugin(byte) = "graphics.cma" +plugin(native) = "graphics.cmxs" diff --git a/patches/graphics/graphics.install b/patches/graphics/graphics.install new file mode 100644 index 0000000..b248687 --- /dev/null +++ b/patches/graphics/graphics.install @@ -0,0 +1 @@ +share: [ "state" ] diff --git a/patches/graphics/install.sh b/patches/graphics/install.sh new file mode 100644 index 0000000..da8b00e --- /dev/null +++ b/patches/graphics/install.sh @@ -0,0 +1,110 @@ +#!/bin/sh + +VERSION=`ocamlopt -version 2>/dev/null || ocamlc -version` +VERSION=`echo $VERSION | sed -e 's/[+.]//g'` + +# $1 is either build or install +if test "$1" = 'build' ; then + # $2 = 'true' or 'false' (ocaml:preinstalled) + # $3 = value of ocaml:lib + # $4 = value of ocaml:share + # $5 = value of _:share + # $6 = value of make + # $7 = 'allopt' or '' + + # Determine if the graphics library was installed with OCaml. + # This is extremely delicate, as if the this package is being reinstalled then + # the presence of graphics files could because of *this* package's previous + # build. + + STATE="$5/state" + + if test -e "$STATE" ; then + STATE="`cat $STATE`" + else + STATE=built + if test -e "`ocamlopt -where 2>/dev/null || ocamlc -where`/graphics.cmi" ; then + # Graphics library already installed + # This rather dirty inspection of the switch state deals with previous + # versions of this package which didn't write the state file + CHANGES="$OPAM_SWITCH_PREFIX/.opam-switch/install/graphics.changes" + if ! test -e "$CHANGES" || \ + ! grep -F graphics.cm "$CHANGES" >/dev/null ; then + # And it wasn't installed by this package + STATE=preinstalled + fi + fi + fi + + echo "$STATE" > state + + if test "$STATE" = 'preinstalled' ; then + exit 0 + fi + + # For system compilers, use the real OCaml LIBDIR, otherwise use the opam one + if $2 ; then + OCAML_LIBDIR="`ocamlopt -where 2>/dev/null || ocamlc -where`" + else + OCAML_LIBDIR="$3" + fi + + # Configure the source tree + if test $VERSION -ge 3090 ; then + if test $VERSION -ge 4040 ; then + # reconfigure target introduced in 4.04.0 + if test $VERSION -ge 4080 ; then + # config/Makefile became Makefile.config in 4.08.0 + cp "$OCAML_LIBDIR/Makefile.config" Makefile.config + # Makefile.common is now generated in 4.08.0+ + touch Makefile.common + else + cp "$OCAML_LIBDIR/Makefile.config" config/Makefile + fi + if test -e "$4/config.cache" ; then + grep -Fv ac_cv_have_x "$4/config.cache" > config.cache + fi + $6 reconfigure + else + # Otherwise, execute the first line from Makefile.config (which includes + # the arguments used) + `sed -ne '1s/# generated by //p' "$OCAML_LIBDIR/Makefile.config"` + fi + else + # Prior to OCaml 3.09.0, config/Makefile wasn't installed, so we just have + # to make a buest guess + ./configure -libdir "$OCAML_LIBDIR" + fi + + # Build the library + $6 -C otherlibs/graph CAMLC=ocamlc CAMLOPT=ocamlopt MKLIB=ocamlmklib all $7 + + # System compilers must always have META installed; this package is a depopt + # of ocamlfind, so it will be reinstalled if this package is added. + if $2 ; then + echo 'lib: ["META"]' >> graphics.install + fi +elif test -e otherlibs/graph/graphics.cmi ; then + # $2 = 'true' or 'false' (ocaml:preinstalled) + # $3 = value of make + # $4 = value of _:lib + # $5 = value of stublibs + # $6 = 'installopt' or '' + + # Installation variables in the Makefile altered with 4.02.0 + if test $VERSION -ge 4020 ; then + K_LIBDIR=INSTALL_LIBDIR + K_STUBLIBDIR=INSTALL_STUBLIBDIR + else + K_LIBDIR=LIBDIR + K_STUBLIBDIR=STUBLIBDIR + fi + + if $2 ; then + mkdir -p "$4" + mkdir -p "$5" + $3 "$K_LIBDIR=$4" "$K_STUBLIBDIR=$5" -C otherlibs/graph install $6 + else + $3 -C otherlibs/graph install $6 + fi +fi diff --git a/patches/gsl/fixdeps.patch b/patches/gsl/fixdeps.patch new file mode 100644 index 0000000..bc9b1b6 --- /dev/null +++ b/patches/gsl/fixdeps.patch @@ -0,0 +1,20 @@ +From: Stephane Glondu +Date: Sun, 16 Jul 2023 13:26:38 +0200 +Subject: Add gsl_include.sexp to deps of sf.ml* + +--- + src/dune | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dune b/src/dune +index a6d8ce9..4fc42c0 100644 +--- a/src/dune ++++ b/src/dune +@@ -77,6 +77,6 @@ + + (rule + (targets sf.mli sf.ml) +- (deps config/do_sf.exe sf.mli.q) ++ (deps config/do_sf.exe gsl_include.sexp sf.mli.q) + (action (run config/do_sf.exe)) + ) diff --git a/patches/hardcaml-examples/hardcaml-examples.install b/patches/hardcaml-examples/hardcaml-examples.install new file mode 100644 index 0000000..0f26b3d --- /dev/null +++ b/patches/hardcaml-examples/hardcaml-examples.install @@ -0,0 +1,8 @@ +bin: [ +"hccordic.native" {"hardcaml-cordic"} +"hclfsr.native" {"hardcaml-lfsr"} +"hcmul.native" {"hardcaml-mul"} +"hcprefix.native" {"hardcaml-prefix"} +"hcrac.native" {"hardcaml-rac"} +"hcsort.native" {"hardcaml-sort"} +] diff --git a/patches/hardcaml-reedsolomon/hardcaml-reedsolomon.install b/patches/hardcaml-reedsolomon/hardcaml-reedsolomon.install new file mode 100644 index 0000000..49ef002 --- /dev/null +++ b/patches/hardcaml-reedsolomon/hardcaml-reedsolomon.install @@ -0,0 +1,4 @@ +bin: [ +"hcrsencode.native" {"hardcaml-rsencode"} +"hcrsdecode.native" {"hardcaml-rsdecode"} +] diff --git a/patches/headache/headache.install b/patches/headache/headache.install new file mode 100644 index 0000000..a148c3d --- /dev/null +++ b/patches/headache/headache.install @@ -0,0 +1 @@ +bin: ["headache"] diff --git a/patches/heptagon/heptagon.install b/patches/heptagon/heptagon.install new file mode 100644 index 0000000..5f1624d --- /dev/null +++ b/patches/heptagon/heptagon.install @@ -0,0 +1,19 @@ +bin: [ + "compiler/_build/main/heptc.byte" {"heptc"} + "?compiler/_build/main/hepts.byte" {"hepts"} + "?compiler/_build/main/ctrl2ept.byte" {"ctrl2ept"} + "?compiler/_build/main/heptc.native" {"heptc.opt"} + "?compiler/_build/main/hepts.native" {"hepts.opt"} + "?compiler/_build/main/ctrl2ept.native" {"ctrl2ept.opt"} +] +lib: [ + "lib/c/math.c" {"c/math.c"} + "lib/c/math.h" {"c/math.h"} + "lib/c/pervasives.h" {"c/pervasives.h"} + "lib/iostream.epci" {"iostream.epci"} + "lib/iostream.epi" {"iostream.epi"} + "lib/math.epci" {"math.epci"} + "lib/math.epi" {"math.epi"} + "lib/pervasives.epci" {"pervasives.epci"} + "lib/pervasives.epi" {"pervasives.epi"} +] diff --git a/patches/herdtools7/chatouille.patch b/patches/herdtools7/chatouille.patch new file mode 100644 index 0000000..c3d243e --- /dev/null +++ b/patches/herdtools7/chatouille.patch @@ -0,0 +1,13 @@ +diff --git a/dune-defs.sh b/dune-defs.sh +index 400faf5..7ba15be 100644 +--- a/dune-defs.sh ++++ b/dune-defs.sh +@@ -5,7 +5,7 @@ for d + do + awk \ + '/names/ { ok = 1 ; getline ; }\ +- /)/ { ok = 0 ; }\ ++ /[)]/ { ok = 0 ; }\ + { if (ok) print $0; }' $d/dune |\ + while read line + do diff --git a/patches/hevea/hevea.install b/patches/hevea/hevea.install new file mode 100644 index 0000000..d5a999d --- /dev/null +++ b/patches/hevea/hevea.install @@ -0,0 +1,7 @@ +bin: [ + "imagen" + "_build/hevea.native" {"hevea"} + "_build/hacha.native" {"hacha"} + "_build/esponja.native" {"esponja"} + "_build/bibhva.native" {"bibhva"} +] diff --git a/patches/higlo/higlo.install b/patches/higlo/higlo.install new file mode 100644 index 0000000..33923bf --- /dev/null +++ b/patches/higlo/higlo.install @@ -0,0 +1,5 @@ +bin: [ + "higlo" + "higlo.byte" + "mk-higlo" +] diff --git a/patches/hlarp/hlarp.install b/patches/hlarp/hlarp.install new file mode 100644 index 0000000..c4a0564 --- /dev/null +++ b/patches/hlarp/hlarp.install @@ -0,0 +1,3 @@ +bin: [ + "hlarp" +] \ No newline at end of file diff --git a/patches/ibx/async.patch b/patches/ibx/async.patch new file mode 100644 index 0000000..caca3cd --- /dev/null +++ b/patches/ibx/async.patch @@ -0,0 +1,13 @@ +diff --git a/lib_test/test_lib.ml b/lib_test/test_lib.ml +index 6364eff..c878845 100644 +--- a/lib_test/test_lib.ml ++++ b/lib_test/test_lib.ml +@@ -88,7 +88,7 @@ let run name suites = + let num_tests = List.fold suites ~init:0 ~f:(fun sum suite -> + sum + List.length suite.tests) + in +- Printf.printf "Running %d tests for library %s.\n%!" num_tests name; ++ printf "Running %d tests for library %s.\n%!" num_tests name; + let rec loop_suites suites counter failures = + match suites with + | [] -> diff --git a/patches/igvxml/igvxml.install b/patches/igvxml/igvxml.install new file mode 100644 index 0000000..59e1925 --- /dev/null +++ b/patches/igvxml/igvxml.install @@ -0,0 +1,3 @@ +bin: [ + "igvxml" +] \ No newline at end of file diff --git a/patches/imagemagick/fix_build.patch b/patches/imagemagick/fix_build.patch new file mode 100644 index 0000000..ea77132 --- /dev/null +++ b/patches/imagemagick/fix_build.patch @@ -0,0 +1,22 @@ +--- a/Makefile 2015-12-14 16:15:26.261118345 +0100 ++++ b/Makefile 2015-12-14 16:15:32.093254187 +0100 +@@ -21,16 +21,13 @@ + # | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA | + # +-----------------------------------------------------------------+ + +-# path to the MagickCore-config utility +-MAGICK_INSTALLED_BIN := $(shell which MagickCore-config) ++MAGICK_INSTALLED_BIN := pkg-config + +-MAGICK_PREFIX := $(shell $(MAGICK_INSTALLED_BIN) --prefix) +- +-MAGICK_CLIBS := $(shell $(MAGICK_INSTALLED_BIN) --libs) ++MAGICK_CLIBS := $(shell $(MAGICK_INSTALLED_BIN) --libs ImageMagick) + + MAGICK_CLIBS_ := $(shell ocaml mlarg.ml $(MAGICK_CLIBS)) + +-MAGICK_CFLAGS := $(shell $(MAGICK_INSTALLED_BIN) --cflags) ++MAGICK_CFLAGS := $(shell $(MAGICK_INSTALLED_BIN) --cflags ImageMagick) + + OCAML_DIR := $(shell ocamlc -where) + #OCAML_DIR := $(shell ocamlfind printconf stdlib) diff --git a/patches/interval/META.1.3 b/patches/interval/META.1.3 new file mode 100644 index 0000000..58efb90 --- /dev/null +++ b/patches/interval/META.1.3 @@ -0,0 +1,6 @@ +name = "interval" +version = "1.3" +description = "An interval arithmetic library" +archive(byte) = "interval.cma" +archive(native) = "interval.cmxa" +exists_if = "interval.cma" diff --git a/patches/interval/Makefile.patch b/patches/interval/Makefile.patch new file mode 100644 index 0000000..aec3f9f --- /dev/null +++ b/patches/interval/Makefile.patch @@ -0,0 +1,71 @@ +From 350b07d9faa7d6647c19dd8a8ea06f31c09f67ee Mon Sep 17 00:00:00 2001 +From: Christophe Troestler +Date: Thu, 6 Jul 2017 17:17:46 +0200 +Subject: [PATCH 2/2] Improve compilation & install via ocamlfind +Content-Type: text/plain; charset="utf-8" + +--- + Makefile | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/Makefile b/Makefile +index d6d47bf..ee00ad1 100755 +--- a/Makefile ++++ b/Makefile +@@ -1,27 +1,27 @@ + OCAMLDIR:= "$(shell ocamlc -where)" +-CSLC = ocamlc +-CSLOPT = ocamlopt ++CSLC = ocamlc -annot ++CSLOPT = ocamlopt -annot + NORM_OBJS= fpu.cmo fpu_rename_all.cmo fpu_rename.cmo interval.cmo + OPT_OBJS= $(NORM_OBJS:.cmo=.cmx) + CC = gcc + +-all : interval.cma interval.cmxa libinterval.a doc/index.html ocamlfpu ++all : interval.cma interval.cmxa doc/index.html ocamlfpu + +-interval.cma: $(NORM_OBJS) +- $(CSLC) -a -custom -o interval.cma $(NORM_OBJS) + ++interval.cma interval.cmxa: $(NORM_OBJS) $(OPT_OBJS) chcw.o ++ ocamlmklib -o interval -oc interval_ocaml $^ + +-interval.cmxa: $(OPT_OBJS) +- $(CSLOPT) -a -o interval.cmxa $(OPT_OBJS) ++ocamlfpu: interval.cma ++ ocamlmktop -I . -o ocamlfpu interval.cma + +-libinterval.a: chcw.o +- rm -f $@ +- ar rc $@ chcw.o +- ranlib $@ ++install: all ++ ocamlfind install interval $(wildcard META \ ++ *.cmi *.cmti *.cma *.cmx *.cmxa *.mli *.a *.so) + +-ocamlfpu: interval.cma libinterval.a +- ocamlmktop -o ocamlfpu chcw.o interval.cma libinterval.a ++remove: ++ ocamlfind remove interval + ++.PHONY: install remove + + .SUFFIXES: .ml .mli .cmo .cmi .cmx + +@@ -32,10 +32,10 @@ ocamlfpu: interval.cma libinterval.a + .ml.cmx : + $(CSLOPT) -c $< + .c.o : +- $(CC) -W -Wall -O3 -I $(OCAMLDIR)/caml -c $< ++ $(CC) -W -Wall -O3 -I $(OCAMLDIR)/caml -fPIC -c $< + + clean: +- \rm -f *.cmo *.cmi *.cmx *.o *~ *.cma *.cmxa *.a a.out ocamlfpu ocamlfpu.exe ++ $(RM) -f *.cmo *.cmi *.cmx *.o *~ *.cma *.cmxa *.a a.out *.so ocamlfpu ocamlfpu.exe + + doc/index.html: *.mli + ocamldoc -d doc -html *.mli +-- +2.13.2 + diff --git a/patches/iocaml-kernel/4.00.1.patch b/patches/iocaml-kernel/4.00.1.patch new file mode 100644 index 0000000..5625c83 --- /dev/null +++ b/patches/iocaml-kernel/4.00.1.patch @@ -0,0 +1,43 @@ +diff --git a/exec.ml b/exec.ml +index c3958b6..b44e927 100644 +--- a/exec.ml ++++ b/exec.ml +@@ -1,13 +1,22 @@ + type ('a,'b) status = Ok of 'a | Error of 'b + + let get_error_loc = function ++#if ocaml_version > (4,0) + | Syntaxerr.Error(x) -> Some(Syntaxerr.location_of_error x) +- | Lexer.Error(_, loc) +- | Typecore.Error(loc, _, _) ++#endif ++ | Lexer.Error(_, loc) ++#if ocaml_version < (4,1) ++ | Typecore.Error(loc, _) ++ | Typetexp.Error(loc, _) ++ | Typeclass.Error(loc, _) ++ | Typemod.Error(loc, _) ++#else ++ | Typecore.Error(loc, _, _) + | Typetexp.Error(loc, _, _) +- | Typedecl.Error(loc, _) + | Typeclass.Error(loc, _, _) + | Typemod.Error(loc, _, _) ++#endif ++ | Typedecl.Error(loc, _) + | Translcore.Error(loc, _) + | Translclass.Error(loc, _) + | Translmod.Error(loc, _) -> Some(loc) +diff --git a/iocaml_zmq.ml b/iocaml_zmq.ml +index 1195bbe..639c30b 100644 +--- a/iocaml_zmq.ml ++++ b/iocaml_zmq.ml +@@ -152,6 +152,8 @@ module ZMQ = struct + + exception Zmq_exception of int * string * string + ++ let (|>) a f = f a ++ + let raise_if s x = + if x == -1 then + let errno = Stubs.Utils.errno () in diff --git a/patches/iocaml-kernel/iocaml-kernel.install b/patches/iocaml-kernel/iocaml-kernel.install new file mode 100644 index 0000000..8871b8a --- /dev/null +++ b/patches/iocaml-kernel/iocaml-kernel.install @@ -0,0 +1,35 @@ +bin: ["_build/iocaml.top"] +lib: [ + "META" + "_build/iocaml.cmi" + "_build/Ipython_json_t.cmi" + "_build/Ipython_json_j.cmi" + "_build/message.cmi" + "_build/completion.cmi" + "_build/log.cmi" + "_build/sockets.cmi" + "_build/iocaml.cmt" + "_build/Ipython_json_t.cmt" + "_build/Ipython_json_j.cmt" + "_build/message.cmt" + "_build/completion.cmt" + "_build/log.cmt" + "_build/sockets.cmt" + "_build/iocaml.cmti" + "_build/Ipython_json_t.cmti" + "_build/Ipython_json_j.cmti" + "_build/message.cmti" + "_build/completion.cmti" + "_build/log.cmti" + "_build/sockets.cmti" +] +share: [ + "profile/ipython_config.py" {"profile/ipython_config.py"} + "profile/static/custom/custom.js" {"profile/static/custom/custom.js"} + "notebooks/iocaml-development.ipynb" + "notebooks/iocaml-install.ipynb" + "notebooks/iocaml-test-notebook.ipynb" + "notebooks/iocaml-the-core-language.ipynb" + "notebooks/iocaml-using-tyxml.ipynb" + "notebooks/syntax-highlighting.ipynb" +] diff --git a/patches/iocaml/chromium-bug.patch b/patches/iocaml/chromium-bug.patch new file mode 100644 index 0000000..12bd380 --- /dev/null +++ b/patches/iocaml/chromium-bug.patch @@ -0,0 +1,13 @@ +diff --git a/filesys-1.1/static/notebook/js/notebook.js b/filesys-1.1/static/notebook/js/notebook.js +index 488364b..181e6ec 100644 +--- a/filesys-1.1/static/notebook/js/notebook.js ++++ b/filesys-1.1/static/notebook/js/notebook.js +@@ -321,7 +321,7 @@ var IPython = (function (IPython) { + that.split_cell(); + that.control_key_active = false; + return false; +- } else if (that.control_key_active) { ++ } else if (event.which !== 229 && that.control_key_active) { /* work around a chromium bug */ + that.control_key_active = false; + return true; + } diff --git a/patches/iocaml/iocaml.install.0.4.2 b/patches/iocaml/iocaml.install.0.4.2 new file mode 100644 index 0000000..02f771e --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.2 @@ -0,0 +1 @@ +bin: ["_build/iocamlserver.byte" {"iocaml"}] diff --git a/patches/iocaml/iocaml.install.0.4.3 b/patches/iocaml/iocaml.install.0.4.3 new file mode 100644 index 0000000..02f771e --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.3 @@ -0,0 +1 @@ +bin: ["_build/iocamlserver.byte" {"iocaml"}] diff --git a/patches/iocaml/iocaml.install.0.4.4 b/patches/iocaml/iocaml.install.0.4.4 new file mode 100644 index 0000000..1ef3fa7 --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.4 @@ -0,0 +1,3 @@ +bin: [ + "_build/iocamlserver.byte" { "iocaml" } +] diff --git a/patches/iocaml/iocaml.install.0.4.5 b/patches/iocaml/iocaml.install.0.4.5 new file mode 100644 index 0000000..1ef3fa7 --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.5 @@ -0,0 +1,3 @@ +bin: [ + "_build/iocamlserver.byte" { "iocaml" } +] diff --git a/patches/iocaml/iocaml.install.0.4.6 b/patches/iocaml/iocaml.install.0.4.6 new file mode 100644 index 0000000..1ef3fa7 --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.6 @@ -0,0 +1,3 @@ +bin: [ + "_build/iocamlserver.byte" { "iocaml" } +] diff --git a/patches/iocaml/iocaml.install.0.4.7 b/patches/iocaml/iocaml.install.0.4.7 new file mode 100644 index 0000000..1ef3fa7 --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.7 @@ -0,0 +1,3 @@ +bin: [ + "_build/iocamlserver.byte" { "iocaml" } +] diff --git a/patches/iocaml/iocaml.install.0.4.8 b/patches/iocaml/iocaml.install.0.4.8 new file mode 100644 index 0000000..1ef3fa7 --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.8 @@ -0,0 +1,3 @@ +bin: [ + "_build/iocamlserver.byte" { "iocaml" } +] diff --git a/patches/iocaml/iocaml.install.0.4.9 b/patches/iocaml/iocaml.install.0.4.9 new file mode 100644 index 0000000..1ef3fa7 --- /dev/null +++ b/patches/iocaml/iocaml.install.0.4.9 @@ -0,0 +1,3 @@ +bin: [ + "_build/iocamlserver.byte" { "iocaml" } +] diff --git a/patches/iocamljs-kernel/4.00.1.patch b/patches/iocamljs-kernel/4.00.1.patch new file mode 100644 index 0000000..6b2eddc --- /dev/null +++ b/patches/iocamljs-kernel/4.00.1.patch @@ -0,0 +1,40 @@ +diff --git a/exec.ml b/exec.ml +index e989440..b44e927 100644 +--- a/exec.ml ++++ b/exec.ml +@@ -1,13 +1,22 @@ + type ('a,'b) status = Ok of 'a | Error of 'b + + let get_error_loc = function ++#if ocaml_version > (4,0) + | Syntaxerr.Error(x) -> Some(Syntaxerr.location_of_error x) +- | Lexer.Error(_, loc) +- | Typecore.Error(loc, _, _) ++#endif ++ | Lexer.Error(_, loc) ++#if ocaml_version < (4,1) ++ | Typecore.Error(loc, _) ++ | Typetexp.Error(loc, _) ++ | Typeclass.Error(loc, _) ++ | Typemod.Error(loc, _) ++#else ++ | Typecore.Error(loc, _, _) + | Typetexp.Error(loc, _, _) +- | Typedecl.Error(loc, _) + | Typeclass.Error(loc, _, _) + | Typemod.Error(loc, _, _) ++#endif ++ | Typedecl.Error(loc, _) + | Translcore.Error(loc, _) + | Translclass.Error(loc, _) + | Translmod.Error(loc, _) -> Some(loc) +@@ -60,8 +69,7 @@ let run_cell_lb execution_count lb = + | Ok(false) -> Error(Buffer.contents buffer) :: out_messages + | Error(Sys.Break) -> Error("Interrupted.") :: out_messages + | Error(exn) -> +- Error(try get_error_info exn +- with _ -> ("IOcaml execution error: " ^ Printexc.to_string exn)) :: out_messages ++ Error(try get_error_info exn with _ -> "Execution error.") :: out_messages + end + in + List.rev (run [] phrases) diff --git a/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.0 b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.0 new file mode 100644 index 0000000..f53ac4e --- /dev/null +++ b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.0 @@ -0,0 +1,7 @@ +share: [ + "services/kernels/js/kernel.min.js" { "profile/static/services/kernels/js/kernel.min.js" } + "services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.full.js" } + "services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.js" } + "custom/custom.js" { "profile/static/custom/custom.js" } + "custom/iocamljsnblogo.png" { "profile/static/custom/iocamljsnblogo.png" } +] diff --git a/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.3 b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.3 new file mode 100644 index 0000000..dbbff70 --- /dev/null +++ b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.3 @@ -0,0 +1,7 @@ +share: [ + "static/services/kernels/js/kernel.min.js" { "profile/static/services/kernels/js/kernel.min.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.full.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.js" } + "static/custom/custom.js" { "profile/static/custom/custom.js" } + "static/custom/iocamljsnblogo.png" { "profile/static/custom/iocamljsnblogo.png" } +] diff --git a/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.4 b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.4 new file mode 100644 index 0000000..8e4e2ea --- /dev/null +++ b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.4 @@ -0,0 +1,7 @@ +share: [ + "static/services/kernels/js/kernel.min.js" { "profile/static/services/kernels/js/kernel.min.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.full.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.js" } + "static/custom/custom.js" { "profile/static/custom/custom.js" } + "static/custom/iocamljsnblogo.png" { "profile/static/custom/iocamljsnblogo.png" } +] diff --git a/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.5 b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.5 new file mode 100644 index 0000000..8e4e2ea --- /dev/null +++ b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.5 @@ -0,0 +1,7 @@ +share: [ + "static/services/kernels/js/kernel.min.js" { "profile/static/services/kernels/js/kernel.min.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.full.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.js" } + "static/custom/custom.js" { "profile/static/custom/custom.js" } + "static/custom/iocamljsnblogo.png" { "profile/static/custom/iocamljsnblogo.png" } +] diff --git a/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.6 b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.6 new file mode 100644 index 0000000..b927f45 --- /dev/null +++ b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.6 @@ -0,0 +1,15 @@ +share: [ + "static/services/kernels/js/kernel.min.js" { "profile/static/services/kernels/js/kernel.min.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.full.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.js" } + "static/custom/custom.js" { "profile/static/custom/custom.js" } + "static/custom/iocamljsnblogo.png" { "profile/static/custom/iocamljsnblogo.png" } +] +lib: [ + "META" + "exec.cmi" + "iocaml.cmi" + "iocaml_main.cmi" + "iocamljs.cma" + "kernel.js" +] diff --git a/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.8 b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.8 new file mode 100644 index 0000000..b927f45 --- /dev/null +++ b/patches/iocamljs-kernel/iocamljs-kernel.install.0.4.8 @@ -0,0 +1,15 @@ +share: [ + "static/services/kernels/js/kernel.min.js" { "profile/static/services/kernels/js/kernel.min.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.full.js" } + "static/services/kernels/js/kernel.full.js" { "profile/static/services/kernels/js/kernel.js" } + "static/custom/custom.js" { "profile/static/custom/custom.js" } + "static/custom/iocamljsnblogo.png" { "profile/static/custom/iocamljsnblogo.png" } +] +lib: [ + "META" + "exec.cmi" + "iocaml.cmi" + "iocaml_main.cmi" + "iocamljs.cma" + "kernel.js" +] diff --git a/patches/irc-client/obuild-workaround.patch b/patches/irc-client/obuild-workaround.patch new file mode 100644 index 0000000..7329e41 --- /dev/null +++ b/patches/irc-client/obuild-workaround.patch @@ -0,0 +1,8 @@ +--- a/irc-client.obuild ++++ b/irc-client.obuild +@@ -26,4 +26,4 @@ library irc_client.unix + test test_parser + main: test_parser.ml + src-dir: test +- build-deps: oUnit, irc_client ++ build-deps: oUnit, irc_client, unix diff --git a/patches/iri/ocaml-before.4.03.0.patch b/patches/iri/ocaml-before.4.03.0.patch new file mode 100644 index 0000000..1fa461a --- /dev/null +++ b/patches/iri/ocaml-before.4.03.0.patch @@ -0,0 +1,30 @@ +diff --git a/iri_types.ml b/iri_types.ml +index 491720f..1ca8694 100644 +--- a/iri_types.ml ++++ b/iri_types.ml +@@ -492,13 +492,13 @@ let normalize_host s = + let len = String.length s in + if len > 0 then + match String.get s 0 with +- '[' -> String.uppercase_ascii s (* uppercase hexa *) +- | _ -> String.lowercase_ascii s (* lowercase regname *) ++ '[' -> String.uppercase s (* uppercase hexa *) ++ | _ -> String.lowercase s (* lowercase regname *) + else + s + + let normalize_port t = +- match String.lowercase_ascii t.scheme, t.port with ++ match String.lowercase t.scheme, t.port with + "http", Some 80 -> { t with port = None } + | "https", Some 443 -> { t with port = None } + | "ftp", Some 21 -> { t with port = None } +@@ -509,7 +509,7 @@ let normalize_port t = + + let normalize_case t = + { t with +- scheme = String.lowercase_ascii t.scheme ; ++ scheme = String.lowercase t.scheme ; + host = map_opt normalize_host t.host ; + } + diff --git a/patches/javalib/patch-javalib.diff b/patches/javalib/patch-javalib.diff new file mode 100644 index 0000000..a4f89f1 --- /dev/null +++ b/patches/javalib/patch-javalib.diff @@ -0,0 +1,12 @@ +diff -uNr javalib-2.3/src/jBasics.ml javalib-2.3a/src/jBasics.ml +--- javalib-2.3/src/jBasics.ml 2013-10-30 08:35:30.000000000 +0100 ++++ javalib-2.3a/src/jBasics.ml 2015-06-18 15:36:17.000000000 +0200 +@@ -278,8 +278,6 @@ + with _ -> + let cni = cnt.cni_next in + let new_cn = (cni,cn) in +- if not (Str.string_match valid_class_name cn 0) +- then invalid_arg ("Error : " ^ cn ^ " is not a valid name for a class"); + cnt.cni_map <- ClassNameMap.add cn new_cn cnt.cni_map; + cnt.cni_next <- cni + 1; + new_cn diff --git a/patches/jenga/jenga.install b/patches/jenga/jenga.install new file mode 100644 index 0000000..61dcd74 --- /dev/null +++ b/patches/jenga/jenga.install @@ -0,0 +1,6 @@ +bin: [ + "?_build/bin/jenga_progress.byte" {"jenga-progress"} + "?_build/bin/jenga_progress.native" {"jenga-progress"} + "?_build/bin/jenga.byte" {"jenga"} + "?_build/bin/jenga.native" {"jenga"} +] diff --git a/patches/joolog/joolog.install b/patches/joolog/joolog.install new file mode 100644 index 0000000..5ec819b --- /dev/null +++ b/patches/joolog/joolog.install @@ -0,0 +1 @@ +lib: ["default.css"] \ No newline at end of file diff --git a/patches/js_of_ocaml/js_of_ocaml.install.1.2 b/patches/js_of_ocaml/js_of_ocaml.install.1.2 new file mode 100644 index 0000000..c5b2d06 --- /dev/null +++ b/patches/js_of_ocaml/js_of_ocaml.install.1.2 @@ -0,0 +1 @@ +bin: ["compiler/js_of_ocaml"] diff --git a/patches/js_of_ocaml/js_of_ocaml.install.1.3.1 b/patches/js_of_ocaml/js_of_ocaml.install.1.3.1 new file mode 100644 index 0000000..c5b2d06 --- /dev/null +++ b/patches/js_of_ocaml/js_of_ocaml.install.1.3.1 @@ -0,0 +1 @@ +bin: ["compiler/js_of_ocaml"] diff --git a/patches/js_of_ocaml/js_of_ocaml.install.1.3.2 b/patches/js_of_ocaml/js_of_ocaml.install.1.3.2 new file mode 100644 index 0000000..c5b2d06 --- /dev/null +++ b/patches/js_of_ocaml/js_of_ocaml.install.1.3.2 @@ -0,0 +1 @@ +bin: ["compiler/js_of_ocaml"] diff --git a/patches/js_of_ocaml/js_of_ocaml.install.1.4.0 b/patches/js_of_ocaml/js_of_ocaml.install.1.4.0 new file mode 100644 index 0000000..c5b2d06 --- /dev/null +++ b/patches/js_of_ocaml/js_of_ocaml.install.1.4.0 @@ -0,0 +1 @@ +bin: ["compiler/js_of_ocaml"] diff --git a/patches/js_of_ocaml/js_of_ocaml.install.2.0 b/patches/js_of_ocaml/js_of_ocaml.install.2.0 new file mode 100644 index 0000000..132dbf5 --- /dev/null +++ b/patches/js_of_ocaml/js_of_ocaml.install.2.0 @@ -0,0 +1,4 @@ +bin: [ + "compiler/js_of_ocaml" + "compiler/jsoo_minify" +] diff --git a/patches/json-wheel/json-wheel-1.0.6+safe-string.patch b/patches/json-wheel/json-wheel-1.0.6+safe-string.patch new file mode 100644 index 0000000..d176204 --- /dev/null +++ b/patches/json-wheel/json-wheel-1.0.6+safe-string.patch @@ -0,0 +1,22 @@ +diff --git a/jsoncat.ml b/jsoncat.ml +index 0fa25ce..de12a7f 100644 +--- a/jsoncat.ml ++++ b/jsoncat.ml +@@ -38,13 +38,13 @@ let create_samples () = + Json_io.json_of_string + "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ \"Hi!\" + ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" in +- let s = String.make 1_000_000 'x' in ++ let s = Bytes.make 1_000_000 'x' in + for i = 0 to 127 do +- s.[i] <- char_of_int i ++ Bytes.set s i (char_of_int i) + done; +- let x = ++ let x = + objekt [ "array", array (Array.to_list (Array.init 100_000 int)); +- "string", string s; ++ "string", string (Bytes.unsafe_to_string s); + "int", int max_int; + "float", float 1e255; + "deep_array", array (Array.to_list (Array.make 1000 deep)) ] in diff --git a/patches/jsondiff/jsondiff.install b/patches/jsondiff/jsondiff.install new file mode 100644 index 0000000..84d5206 --- /dev/null +++ b/patches/jsondiff/jsondiff.install @@ -0,0 +1 @@ +bin: ["jsondiff"] diff --git a/patches/jsonm/jsonm.install b/patches/jsonm/jsonm.install new file mode 100644 index 0000000..44bf8e7 --- /dev/null +++ b/patches/jsonm/jsonm.install @@ -0,0 +1,6 @@ +bin: [ + "?_build/test/ocamltweets.byte" {"ocamltweets"} + "?_build/test/ocamltweets.native" {"ocamltweets"} + "?_build/test/jsontrip.byte" {"jsontrip"} + "?_build/test/jsontrip.native" {"jsontrip"} +] diff --git a/patches/kaputt/install.patch b/patches/kaputt/install.patch new file mode 100644 index 0000000..0d9245c --- /dev/null +++ b/patches/kaputt/install.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile b/Makefile.diff +index 3f7b5d2..332ae23 100644 +--- a/Makefile ++++ b/Makefile.diff +@@ -84,6 +84,7 @@ install: FORCE + $(PATH_BUILD)/src/extensions/$(PROJECT_NAME)Nums.o \ + $(PATH_BUILD)/src/extensions/$(PROJECT_NAME)Nums.jo \ + $(PATH_BUILD)/$(PROJECT_NAME).a \ ++ $(PATH_BUILD)/$(PROJECT_NAME).o \ + $(PATH_BUILD)/$(PROJECT_NAME).cma \ + $(PATH_BUILD)/$(PROJECT_NAME).cmi \ + $(PATH_BUILD)/$(PROJECT_NAME).cmo \ diff --git a/patches/kaputt/install2.patch b/patches/kaputt/install2.patch new file mode 100644 index 0000000..350782a --- /dev/null +++ b/patches/kaputt/install2.patch @@ -0,0 +1,53 @@ +diff --git a/configure b/configure +index 464daee..8bc0de0 100755 +--- a/configure ++++ b/configure +@@ -23,6 +23,7 @@ ocamlbuild=`which ocamlbuild || echo '/usr/local/bin/ocamlbuild'` + bin_path=`dirname $ocamlbuild` + ocaml_prefix=`dirname $bin_path` + ocamlfind=`which ocamlfind 2> /dev/null || echo ''` ++ocamlopt=`which ocamlopt 2> /dev/null || echo ''` + native_dynlink='TRUE' + devel='FALSE' + +@@ -34,12 +35,14 @@ do + ocaml_prefix="$2"; shift;; + -ocamlfind) + ocamlfind="$2"; shift;; ++ -ocamlopt) ++ ocamlopt="$2"; shift;; + -no-native-dynlink) + native_dynlink='FALSE';; + -devel) + devel='TRUE';; + *) +- echo "usage: $0 [-ocaml-prefix ] [-ocamlfind ] [-no-native-dynlink] [-devel]"; ++ echo "usage: $0 [-ocaml-prefix ] [-ocamlfind ] [-ocamlopt ] [-no-native-dynlink] [-devel]"; + exit 1;; + esac + shift +@@ -56,6 +59,7 @@ EOF` + echo "# timestamp: `date`" > Makefile.config + echo "PATH_OCAML_PREFIX=$ocaml_prefix" >> Makefile.config + echo "PATH_OCAMLFIND=$ocamlfind" >> Makefile.config ++echo "PATH_OCAMLOPT=$ocamlopt" >> Makefile.config + echo "NATIVE_DYNLINK=$native_dynlink" >> Makefile.config + echo "WARNINGS=$devel" >> Makefile.config + echo "MAKE_QUIET=$make_quiet" >> Makefile.config +diff --git a/Makefile b/Makefile +index 332ae23..02cc2ec 100644 +--- a/Makefile ++++ b/Makefile +@@ -106,7 +106,11 @@ install: FORCE + + generate: FORCE + echo '$(PROJECT_NAME).cma' > $(PROJECT_NAME).itarget +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true ++ if [ -x "$(PATH_OCAMLOPT)" ]; then \ ++ echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget; \ ++ else \ ++ (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true; \ ++ fi + (test -x $(PATH_OCAML_PREFIX)/bin/ocamljava && echo '$(PROJECT_NAME).cmja' >> $(PROJECT_NAME).itarget) || true + + FORCE: diff --git a/patches/kaputt/safe_string.patch b/patches/kaputt/safe_string.patch new file mode 100644 index 0000000..bfe4f82 --- /dev/null +++ b/patches/kaputt/safe_string.patch @@ -0,0 +1,34 @@ +diff -rN -u old-kaputt.x9c.fr/src/library/enumerator.ml new-kaputt.x9c.fr/src/library/enumerator.ml +--- old-kaputt.x9c.fr/src/library/enumerator.ml 2018-01-18 17:59:10.553942797 +0100 ++++ new-kaputt.x9c.fr/src/library/enumerator.ml 2018-01-18 17:59:10.553942797 +0100 +@@ -135,11 +135,11 @@ + create_state_based + (fun () -> (Array.init len (fun _ -> ch))) + (fun s -> +- let res = String.create len in ++ let res = Bytes.create len in + for i = 0 to pred len do + res.[i] <- match s.State.curr.(i) with Cons (hd, _) -> hd | _ -> assert false + done; +- res) ++ Bytes.to_string res) + Utils.string_of_string + + let float x y steps = +diff -rN -u old-kaputt.x9c.fr/src/library/generator.ml new-kaputt.x9c.fr/src/library/generator.ml +--- old-kaputt.x9c.fr/src/library/generator.ml 2018-01-18 17:59:10.553942797 +0100 ++++ new-kaputt.x9c.fr/src/library/generator.ml 2018-01-18 17:59:10.557942793 +0100 +@@ -171,11 +171,11 @@ + let string (gen_l, _) (gen_c, _) = + (fun r -> + let len = gen_l r in +- let res = String.create len in ++ let res = Bytes.create len in + for i = 0 to pred len do + res.[i] <- gen_c r + done; +- res), ++ Bytes.to_string res), + Utils.string_of_string + + let strings sep (gen_l, _) (gen_s, _) = diff --git a/patches/lablgl/META.1.04.20120306 b/patches/lablgl/META.1.04.20120306 new file mode 100644 index 0000000..7cc469e --- /dev/null +++ b/patches/lablgl/META.1.04.20120306 @@ -0,0 +1,20 @@ +description = "Bindings for OpenGL graphics engines" +version = "1.04.20120306" +archive(byte) = "lablgl.cma" +archive(native) = "lablgl.cmxa" + +package "togl" ( + description = "OpenGL widget for labltk" + version = "1.01" + requires = "lablgl, labltk" + archive(byte) = "togl.cma" + archive(native) = "togl.cmxa" +) + +package "glut" ( + description = "Platform-independent OpenGL window" + version = "1.01" + requires = "lablgl" + archive(byte) = "lablglut.cma" + archive(native) = "lablglut.cmxa" +) diff --git a/patches/lablgl/META.1.05 b/patches/lablgl/META.1.05 new file mode 100644 index 0000000..4f6822b --- /dev/null +++ b/patches/lablgl/META.1.05 @@ -0,0 +1,20 @@ +description = "Bindings for OpenGL graphics engines" +version = "1.05" +archive(byte) = "lablgl.cma" +archive(native) = "lablgl.cmxa" + +package "togl" ( + description = "OpenGL widget for labltk" + version = "1.01" + requires = "lablgl, labltk" + archive(byte) = "togl.cma" + archive(native) = "togl.cmxa" +) + +package "glut" ( + description = "Platform-independent OpenGL window" + version = "1.01" + requires = "lablgl" + archive(byte) = "lablglut.cma" + archive(native) = "lablglut.cmxa" +) diff --git a/patches/lablgl/META.1.06 b/patches/lablgl/META.1.06 new file mode 100644 index 0000000..82e1a56 --- /dev/null +++ b/patches/lablgl/META.1.06 @@ -0,0 +1,20 @@ +description = "Bindings for OpenGL graphics engines" +version = "1.06" +archive(byte) = "lablgl.cma" +archive(native) = "lablgl.cmxa" + +package "togl" ( + description = "OpenGL widget for labltk" + version = "1.06" + requires = "lablgl, labltk" + archive(byte) = "togl.cma" + archive(native) = "togl.cmxa" +) + +package "glut" ( + description = "Platform-independent OpenGL window" + version = "1.06" + requires = "lablgl" + archive(byte) = "lablglut.cma" + archive(native) = "lablglut.cmxa" +) diff --git a/patches/lablgl/META.1.07 b/patches/lablgl/META.1.07 new file mode 100644 index 0000000..081d9b9 --- /dev/null +++ b/patches/lablgl/META.1.07 @@ -0,0 +1,20 @@ +description = "Bindings for OpenGL graphics engines" +version = "1.07" +archive(byte) = "lablgl.cma" +archive(native) = "lablgl.cmxa" + +package "togl" ( + description = "OpenGL widget for labltk" + version = "1.07" + requires = "lablgl, labltk" + archive(byte) = "togl.cma" + archive(native) = "togl.cmxa" +) + +package "glut" ( + description = "Platform-independent OpenGL window" + version = "1.07" + requires = "lablgl" + archive(byte) = "lablglut.cma" + archive(native) = "lablglut.cmxa" +) diff --git a/patches/lablgl/lablgl.install b/patches/lablgl/lablgl.install new file mode 100644 index 0000000..7c85df4 --- /dev/null +++ b/patches/lablgl/lablgl.install @@ -0,0 +1 @@ +lib: ["META"] diff --git a/patches/lablgtk/lablgldir.patch.2.16.0 b/patches/lablgtk/lablgldir.patch.2.16.0 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.16.0 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.10 b/patches/lablgtk/lablgldir.patch.2.18.10 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.10 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.11 b/patches/lablgtk/lablgldir.patch.2.18.11 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.11 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.12 b/patches/lablgtk/lablgldir.patch.2.18.12 new file mode 100644 index 0000000..00c1a9a --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.12 @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 177e9547..f8a56fe0 100755 +--- a/configure ++++ b/configure +@@ -4925,7 +4925,7 @@ printf %s "checking lablGL directory... " >&6; } + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + printf "%s\n" "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.13 b/patches/lablgtk/lablgldir.patch.2.18.13 new file mode 100644 index 0000000..00c1a9a --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.13 @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 177e9547..f8a56fe0 100755 +--- a/configure ++++ b/configure +@@ -4925,7 +4925,7 @@ printf %s "checking lablGL directory... " >&6; } + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + printf "%s\n" "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.2 b/patches/lablgtk/lablgldir.patch.2.18.2 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.2 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.3 b/patches/lablgtk/lablgldir.patch.2.18.3 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.3 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.4 b/patches/lablgtk/lablgldir.patch.2.18.4 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.4 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.5 b/patches/lablgtk/lablgldir.patch.2.18.5 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.5 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.6 b/patches/lablgtk/lablgldir.patch.2.18.6 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.6 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.7 b/patches/lablgtk/lablgldir.patch.2.18.7 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.7 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.8 b/patches/lablgtk/lablgldir.patch.2.18.8 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.8 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgldir.patch.2.18.9 b/patches/lablgtk/lablgldir.patch.2.18.9 new file mode 100644 index 0000000..14a1fa6 --- /dev/null +++ b/patches/lablgtk/lablgldir.patch.2.18.9 @@ -0,0 +1,12 @@ +diff -Naur lablgtk-2.16.0.orig/configure lablgtk-2.16.0/configure +--- lablgtk-2.16.0.orig/configure 2012-08-23 12:37:48.000000000 +0200 ++++ lablgtk-2.16.0/configure 2013-08-21 11:16:50.707187151 +0200 +@@ -4066,7 +4066,7 @@ + cat > conftest.ml << EOF + open Raw + EOF +- if $CAMLC -c -I "${LABLGLDIR:=+lablGL}" conftest.ml > /dev/null 2>&1 ; then ++ if $CAMLC -c -I "$LABLGLDIR" conftest.ml > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LABLGLDIR" >&5 + $as_echo "$LABLGLDIR" >&6; } + else diff --git a/patches/lablgtk/lablgtk.install b/patches/lablgtk/lablgtk.install new file mode 100644 index 0000000..70e78de --- /dev/null +++ b/patches/lablgtk/lablgtk.install @@ -0,0 +1,5 @@ +bin: [ + "src/lablgtk2" + "src/gdk_pixbuf_mlsource" + "?src/lablgladecc2" +] diff --git a/patches/lablgtk3/dune-project.patch b/patches/lablgtk3/dune-project.patch new file mode 100644 index 0000000..003e794 --- /dev/null +++ b/patches/lablgtk3/dune-project.patch @@ -0,0 +1,8 @@ +diff --git a/dune-project b/dune-project +index 389cd199..da00e4e1 100644 +--- a/dune-project ++++ b/dune-project +@@ -1,2 +1,3 @@ + (lang dune 1.8) + (name lablgtk3) ++(version 3.1.2) diff --git a/patches/lablgtk3/lablgtk.install.0.beta1 b/patches/lablgtk3/lablgtk.install.0.beta1 new file mode 100644 index 0000000..e40a4d4 --- /dev/null +++ b/patches/lablgtk3/lablgtk.install.0.beta1 @@ -0,0 +1,4 @@ +bin: [ + "src/lablgtk3" + "src/gdk_pixbuf_mlsource3" +] diff --git a/patches/lablgtk3/lablgtk.install.0.beta2 b/patches/lablgtk3/lablgtk.install.0.beta2 new file mode 100644 index 0000000..e40a4d4 --- /dev/null +++ b/patches/lablgtk3/lablgtk.install.0.beta2 @@ -0,0 +1,4 @@ +bin: [ + "src/lablgtk3" + "src/gdk_pixbuf_mlsource3" +] diff --git a/patches/lablgtk3/lablgtk.install.0.beta3 b/patches/lablgtk3/lablgtk.install.0.beta3 new file mode 100644 index 0000000..2711323 --- /dev/null +++ b/patches/lablgtk3/lablgtk.install.0.beta3 @@ -0,0 +1,5 @@ +bin: [ + "src/lablgtk3" + "src/lablgladecc3" + "src/gdk_pixbuf_mlsource3" +] diff --git a/patches/lablgtk3/ml_gtk.c.diff b/patches/lablgtk3/ml_gtk.c.diff new file mode 100644 index 0000000..d5a5c70 --- /dev/null +++ b/patches/lablgtk3/ml_gtk.c.diff @@ -0,0 +1,13 @@ +diff --git a/src/ml_gtk.c b/src/ml_gtk.c +index deb1b4c7a9..0dcc104e6f 100644 +--- a/src/ml_gtk.c ++++ b/src/ml_gtk.c +@@ -233,7 +233,7 @@ ML_2 (gtk_style_context_add_class, GtkStyleContext_val, String_val, Unit) + ML_2 (gtk_style_context_remove_class, GtkStyleContext_val, String_val, Unit) + ML_2 (gtk_style_context_has_class, GtkStyleContext_val, String_val, Val_bool) + CAMLprim value ml_gtk_style_context_list_classes(value ctx) +-{ return Val_GList(gtk_style_context_list_classes(GtkStyleContext_val(ctx)), Val_string); } ++{ return Val_GList(gtk_style_context_list_classes(GtkStyleContext_val(ctx)), (value_in)Val_string); } + + /* gtkdata.h */ + diff --git a/patches/labltk/auxlibs-in-META.patch b/patches/labltk/auxlibs-in-META.patch new file mode 100644 index 0000000..248c2dc --- /dev/null +++ b/patches/labltk/auxlibs-in-META.patch @@ -0,0 +1,20 @@ +diff --git b/support/META a/support/META +index 195448a..cc9881f 100644 +--- b/support/META ++++ a/support/META +@@ -7,3 +7,15 @@ archive(byte) = "labltk.cma" + archive(native) = "labltk.cmxa" + linkopts = "" + ++package "jpf" ( ++description = "a 'file selector' and 'balloon help' support for labltk" ++requires = "unix,labltk" ++archive(byte) = "jpflib.cma" ++archive(native) = "jpflib.cmxa" ++) ++package "frx" ( ++description = "Francois Rouaix's widget set library" ++requires = "unix,labltk" ++archive(byte) = "frxlib.cma" ++archive(native) = "frxlib.cmxa" ++) diff --git a/patches/labltk/cltkImg.patch b/patches/labltk/cltkImg.patch new file mode 100644 index 0000000..b0116a6 --- /dev/null +++ b/patches/labltk/cltkImg.patch @@ -0,0 +1,12 @@ +diff --git a/support/cltkImg.c b/support/cltkImg.c +index 310cb27..8bdcb36 100644 +--- a/support/cltkImg.c ++++ b/support/cltkImg.c +@@ -46,6 +46,7 @@ CAMLprim value camltk_getimgdata (value imgname) /* ML */ + #endif + + code = Tk_PhotoGetImage(ph,&pib); /* never fails ? */ ++ (void) code; + size = pib.width * pib.height * pib.pixelSize; + res = alloc_string(size); + diff --git a/patches/labltk/configure.patch b/patches/labltk/configure.patch new file mode 100644 index 0000000..d9fece6 --- /dev/null +++ b/patches/labltk/configure.patch @@ -0,0 +1,63 @@ +diff --git a/configure b/configure +index 8ad5742..4036166 100755 +--- a/configure ++++ b/configure +@@ -158,6 +158,10 @@ fi + + if test $tk_x11 = no; then + has_tk=true ++ # May still need to read headers ++ if test -z "$tk_defs"; then ++ tk_x11_include="-I/usr/local/include" ++ fi + else + # tk_x11_include=`cat $where/Makefile.config | grep '^X11_INCLUDES=' | sed -e 's/^X11_INCLUDES=//'` + # tk_x11_libs=`cat $where/Makefile.config | grep '^X11_LIBS=' | sed -e 's/^X11_LIBS=//'` +@@ -172,7 +176,7 @@ export cc cclibs + + if test $has_tk = true; then + tcl_version='' +- tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` ++ tcl_version=`sh ./runtest $tk_defs tclversion.c` + for tk_incs in \ + "-I/usr/local/include" \ + "-I/opt/local/include" \ +@@ -191,8 +195,8 @@ if test $has_tk = true; then + "-I/usr/local/include/tcl8.2 -I/usr/local/include/tk8.2" \ + "-I/usr/include/tcl8.2 -I/usr/include/tk8.2" + do if test -z "$tcl_version"; then +- tk_defs="$tk_incs" +- tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` ++ tk_defs="$tk_incs $tk_x11_include" ++ tcl_version=`sh ./runtest $tk_defs tclversion.c` + fi; done + if test -n "$tcl_version" && test "x$tcl_version" != "xnone"; then + inf "tcl.h and tk.h version $tcl_version found with \"$tk_defs\"." +@@ -218,12 +222,7 @@ system=`cat $where/Makefile.config | grep '^SYSTEM=' | sed -e 's/^SYSTEM=//'` + + if test $has_tk = true && test -z "$tk_libs"; then + tklibdir="" +- if test -n "$tk_defs"; then +- tkinclude="$tk_defs" +- else +- tkinclude="$tk_x11_include" +- fi +- case "$tkinclude" in ++ case "$tk_defs" in + -I/opt/local/include*) tklibdir="/opt/local/lib" ;; + -I/usr/local/include*) tklibdir="/usr/local/lib" ;; + -I/sw/include*) tklibdir="/sw/lib" ;; +@@ -292,11 +291,10 @@ if test $has_tk = true; then + fi + + if test $has_tk = true; then ++ echo "TK_DEFS=$tk_defs" >> Makefile + if test $tk_x11 = yes; then +- echo "TK_DEFS=$tk_defs "'$(X11_INCLUDES)' >> Makefile +- echo "TK_LINK=$tk_libs "'$(X11_LINK)' >> Makefile ++ echo "TK_LINK=$tk_libs $tk_x11_libs" >> Makefile + else +- echo "TK_DEFS=$tk_defs" >> Makefile + echo "TK_LINK=$tk_libs" >> Makefile + fi + otherlibraries="$otherlibraries labltk" diff --git a/patches/labltk/hasgot.patch b/patches/labltk/hasgot.patch new file mode 100644 index 0000000..0869fc0 --- /dev/null +++ b/patches/labltk/hasgot.patch @@ -0,0 +1,14 @@ +diff --git a/config/auto-aux/hasgot b/config/auto-aux/hasgot +index 53d5786..5248229 100755 +--- a/config/auto-aux/hasgot ++++ b/config/auto-aux/hasgot +@@ -30,7 +30,8 @@ while : ; do + shift + done + +-(echo "main() {" ++(for f in $*; do echo "int $f();"; done ++ echo "int main() {" + for f in $*; do echo " $f();"; done + echo "}") >> hasgot.c + diff --git a/patches/labrys/fix-dune.patch b/patches/labrys/fix-dune.patch new file mode 100644 index 0000000..a46e1b8 --- /dev/null +++ b/patches/labrys/fix-dune.patch @@ -0,0 +1,41 @@ +commit 02017d02af9a87726eda7d30bb3a959c14ea8035 +Author: Kate +Date: Sun Aug 4 18:47:29 2019 +0100 + + Fix compilation with recent dune when promoted file does not exist + +diff --git a/dune-project b/dune-project +index 0b09661..5b3f898 100644 +--- a/dune-project ++++ b/dune-project +@@ -1,2 +1,2 @@ +-(lang dune 1.0) ++(lang dune 1.10) + (using menhir 1.0) +diff --git a/labrys.opam b/labrys.opam +index ca07ca8..1d489f7 100644 +--- a/labrys.opam ++++ b/labrys.opam +@@ -9,7 +9,7 @@ bug-reports: "https://github.com/kit-ty-kate/labrys/issues" + build: ["dune" "build" "-p" name "-j" jobs] + build-test: ["dune" "runtest" "-p" name "-j" jobs] + depends: [ +- "dune" {build} ++ "dune" {>= "1.10"} + "menhir" + "base-unix" + "cmdliner" +diff --git a/stdlib/dune b/stdlib/dune +index b573796..a05d545 100644 +--- a/stdlib/dune ++++ b/stdlib/dune +@@ -1,7 +1,7 @@ + (rule + (targets Prelude.bc Prelude.csfw) + (deps Prelude.sfw Prelude.sfwi) +- (mode promote-until-clean) ++ (mode (promote (until-clean) (only *))) + (action (run labrys build-module --no-prelude --build-dir . Prelude))) + + (install + diff --git a/patches/lambda-term/lambda-term.install.1.10 b/patches/lambda-term/lambda-term.install.1.10 new file mode 100644 index 0000000..c8da97f --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.10 @@ -0,0 +1,8 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] +man: [ + "man/lambda-term-actions.1" + "man/lambda-term-inputrc.5" +] diff --git a/patches/lambda-term/lambda-term.install.1.10.1 b/patches/lambda-term/lambda-term.install.1.10.1 new file mode 100644 index 0000000..c8da97f --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.10.1 @@ -0,0 +1,8 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] +man: [ + "man/lambda-term-actions.1" + "man/lambda-term-inputrc.5" +] diff --git a/patches/lambda-term/lambda-term.install.1.4 b/patches/lambda-term/lambda-term.install.1.4 new file mode 100644 index 0000000..bedc121 --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] diff --git a/patches/lambda-term/lambda-term.install.1.5 b/patches/lambda-term/lambda-term.install.1.5 new file mode 100644 index 0000000..bedc121 --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] diff --git a/patches/lambda-term/lambda-term.install.1.6 b/patches/lambda-term/lambda-term.install.1.6 new file mode 100644 index 0000000..bedc121 --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.6 @@ -0,0 +1,4 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] diff --git a/patches/lambda-term/lambda-term.install.1.7 b/patches/lambda-term/lambda-term.install.1.7 new file mode 100644 index 0000000..bedc121 --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.7 @@ -0,0 +1,4 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] diff --git a/patches/lambda-term/lambda-term.install.1.8 b/patches/lambda-term/lambda-term.install.1.8 new file mode 100644 index 0000000..bedc121 --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.8 @@ -0,0 +1,4 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] diff --git a/patches/lambda-term/lambda-term.install.1.9 b/patches/lambda-term/lambda-term.install.1.9 new file mode 100644 index 0000000..bedc121 --- /dev/null +++ b/patches/lambda-term/lambda-term.install.1.9 @@ -0,0 +1,4 @@ +bin: [ + "?_build/tools/lambda_term_actions.byte" {"lambda-term-actions"} + "?_build/tools/lambda_term_actions.native" {"lambda-term-actions"} +] diff --git a/patches/lambda-term/openbsd.diff b/patches/lambda-term/openbsd.diff new file mode 100644 index 0000000..a8fa49d --- /dev/null +++ b/patches/lambda-term/openbsd.diff @@ -0,0 +1,125 @@ +$OpenBSD: patch-_oasis,v 1.1 2013/01/10 18:55:30 chrisz Exp $ + +Link to libcharset + +--- _oasis.orig Mon Oct 8 11:21:18 2012 ++++ _oasis Fri Jan 4 00:00:04 2013 +@@ -62,6 +62,11 @@ Library "lambda-term" + lTerm_term_stubs.c, + lTerm_unix_stubs.c, + lTerm_windows_stubs.c ++ CCOpt: ++ -I/usr/local/include ++ CCLib: ++ -L/usr/local/lib ++ -lcharset + + # +-------------------------------------------------------------------+ + # | Examples | +$OpenBSD: patch-_tags,v 1.1 2013/01/10 18:55:30 chrisz Exp $ + +autogenerated by oasis + +--- _tags.orig Mon Oct 8 11:21:18 2012 ++++ _tags Fri Jan 4 00:00:12 2013 +@@ -19,6 +19,15 @@ + "_darcs": not_hygienic + # Library lambda-term + "src/lambda-term.cmxs": use_lambda-term ++: oasis_library_lambda_term_ccopt ++"src/lTerm_term_stubs.c": oasis_library_lambda_term_ccopt ++"src/lTerm_unix_stubs.c": oasis_library_lambda_term_ccopt ++"src/lTerm_windows_stubs.c": oasis_library_lambda_term_ccopt ++: oasis_library_lambda_term_cclib ++"src/liblambda-term_stubs.lib": oasis_library_lambda_term_cclib ++"src/dlllambda-term_stubs.dll": oasis_library_lambda_term_cclib ++"src/liblambda-term_stubs.a": oasis_library_lambda_term_cclib ++"src/dlllambda-term_stubs.so": oasis_library_lambda_term_cclib + : use_liblambda-term_stubs + : pkg_lwt + : pkg_lwt.unix +$OpenBSD: patch-myocamlbuild_ml,v 1.1 2013/01/10 18:55:30 chrisz Exp $ + +autogenerated by oasis + +--- myocamlbuild.ml.orig Mon Oct 8 11:21:18 2012 ++++ myocamlbuild.ml Fri Jan 4 00:00:12 2013 +@@ -488,7 +488,25 @@ let package_default = + { + MyOCamlbuildBase.lib_ocaml = [("lambda-term", ["src"])]; + lib_c = [("lambda-term", "src", [])]; +- flags = []; ++ flags = ++ [ ++ (["oasis_library_lambda_term_ccopt"; "compile"], ++ [(OASISExpr.EBool true, S [A "-ccopt"; A "-I/usr/local/include"]) ++ ]); ++ (["oasis_library_lambda_term_cclib"; "link"], ++ [ ++ (OASISExpr.EBool true, ++ S ++ [ ++ A "-cclib"; ++ A "-L/usr/local/lib"; ++ A "-cclib"; ++ A "-lcharset" ++ ]) ++ ]); ++ (["oasis_library_lambda_term_cclib"; "ocamlmklib"; "c"], ++ [(OASISExpr.EBool true, S [A "-L/usr/local/lib"; A "-lcharset"])]) ++ ]; + includes = + [("tools", ["src"]); ("tests", ["src"]); ("examples", ["src"])]; + } +$OpenBSD: patch-setup_ml,v 1.1 2013/01/10 18:55:30 chrisz Exp $ + +autogenerated by oasis + +--- setup.ml.orig Mon Oct 8 11:21:18 2012 ++++ setup.ml Fri Jan 4 00:00:12 2013 +@@ -5964,8 +5964,13 @@ let setup_t = + "lTerm_windows_stubs.c" + ]; + bs_data_files = []; +- bs_ccopt = [(OASISExpr.EBool true, [])]; +- bs_cclib = [(OASISExpr.EBool true, [])]; ++ bs_ccopt = ++ [(OASISExpr.EBool true, ["-I/usr/local/include"])]; ++ bs_cclib = ++ [ ++ (OASISExpr.EBool true, ++ ["-L/usr/local/lib"; "-lcharset"]) ++ ]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; +$OpenBSD: patch-src_lTerm_unix_stubs_c,v 1.1 2013/01/10 18:55:30 chrisz Exp $ + +work around nl_langinfo(CODESET) bug for LC_CTYPE=C +see +http://hackage.haskell.org/trac/ghc/ticket/4080 +http://www.haible.de/bruno/packages-libcharset.html + +--- src/lTerm_unix_stubs.c.orig Thu Dec 13 13:06:26 2012 ++++ src/lTerm_unix_stubs.c Thu Dec 13 13:23:28 2012 +@@ -29,7 +29,7 @@ CAMLprim value lt_unix_get_system_encoding() + + #include + #include +-#include ++#include + + CAMLprim value lt_unix_get_sigwinch() + { +@@ -45,9 +45,9 @@ CAMLprim value lt_unix_get_sigwinch() + CAMLprim value lt_unix_get_system_encoding() + { + /* Set the locale according to environment variables: */ +- char *locale = setlocale(LC_CTYPE, ""); ++ const char *locale = setlocale(LC_CTYPE, ""); + /* Get the codeset used by current locale: */ +- char *codeset = nl_langinfo(CODESET); ++ const char *codeset = locale_charset(); + /* Reset the locale: */ + setlocale(LC_CTYPE, locale); + /* If the encoding cannot be determined, just use ascii: */ diff --git a/patches/lambdoc/lambdoc.install.1.0-beta2 b/patches/lambdoc/lambdoc.install.1.0-beta2 new file mode 100644 index 0000000..09a603f --- /dev/null +++ b/patches/lambdoc/lambdoc.install.1.0-beta2 @@ -0,0 +1,5 @@ +bin: [ + "src/_build/lambcmd/lambcmd.native" + "src/_build/lambcmd/lambcmd.byte" +] + diff --git a/patches/lambdoc/lambdoc.install.1.0-beta3 b/patches/lambdoc/lambdoc.install.1.0-beta3 new file mode 100644 index 0000000..b59b19f --- /dev/null +++ b/patches/lambdoc/lambdoc.install.1.0-beta3 @@ -0,0 +1,81 @@ +share: [ +"css/boxout-warning.png" {"css/boxout-warning.png"} +"css/lambdoc.css" {"css/lambdoc.css"} +"css/boxout-tip.png" {"css/boxout-tip.png"} +"css/src/boxout-warning.svg" {"css/src/boxout-warning.svg"} +"css/src/lambdoc_custom.ccss" {"css/src/lambdoc_custom.ccss"} +"css/src/lambdoc_config.ccss" {"css/src/lambdoc_config.ccss"} +"css/src/lambdoc_valid.ccss" {"css/src/lambdoc_valid.ccss"} +"css/src/lambdoc_invalid.ccss" {"css/src/lambdoc_invalid.ccss"} +"css/src/lambdoc_reset.ccss" {"css/src/lambdoc_reset.ccss"} +"css/src/lambdoc_root.ccss" {"css/src/lambdoc_root.ccss"} +"css/src/boxout-tip.svg" {"css/src/boxout-tip.svg"} +"css/src/Makefile" {"css/src/Makefile"} +"examples/serialisation/sample.lambtex" {"examples/serialisation/sample.lambtex"} +"examples/serialisation/Makefile" {"examples/serialisation/Makefile"} +"examples/serialisation/serialisation_test.ml" {"examples/serialisation/serialisation_test.ml"} +"examples/lambcmd-with-bookaml/language.ml" {"examples/lambcmd-with-bookaml/language.ml"} +"examples/lambcmd-with-bookaml/options.mli" {"examples/lambcmd-with-bookaml/options.mli"} +"examples/lambcmd-with-bookaml/lambcmd.ml" {"examples/lambcmd-with-bookaml/lambcmd.ml"} +"examples/lambcmd-with-bookaml/markup.ml" {"examples/lambcmd-with-bookaml/markup.ml"} +"examples/lambcmd-with-bookaml/Makefile" {"examples/lambcmd-with-bookaml/Makefile"} +"examples/lambcmd-with-bookaml/_tags" {"examples/lambcmd-with-bookaml/_tags"} +"examples/lambcmd-with-bookaml/options.ml" {"examples/lambcmd-with-bookaml/options.ml"} +"examples/markups/lambtex/square.svg" {"examples/markups/lambtex/square.svg"} +"examples/markups/lambtex/triangle.svg" {"examples/markups/lambtex/triangle.svg"} +"examples/markups/lambtex/sample.lambtex" {"examples/markups/lambtex/sample.lambtex"} +"examples/markups/lambtex/circle-big.png" {"examples/markups/lambtex/circle-big.png"} +"examples/markups/lambtex/square-big.png" {"examples/markups/lambtex/square-big.png"} +"examples/markups/lambtex/circle-small.png" {"examples/markups/lambtex/circle-small.png"} +"examples/markups/lambtex/triangle-huge.png" {"examples/markups/lambtex/triangle-huge.png"} +"examples/markups/lambtex/index.html" {"examples/markups/lambtex/index.html"} +"examples/markups/lambtex/Makefile" {"examples/markups/lambtex/Makefile"} +"examples/markups/lambtex/square-small.png" {"examples/markups/lambtex/square-small.png"} +"examples/markups/lambtex/circle.svg" {"examples/markups/lambtex/circle.svg"} +"examples/markups/lambtex/circle-tiny.png" {"examples/markups/lambtex/circle-tiny.png"} +"examples/markups/markdown/sample.md" {"examples/markups/markdown/sample.md"} +"examples/markups/markdown/index.html" {"examples/markups/markdown/index.html"} +"examples/markups/markdown/Makefile" {"examples/markups/markdown/Makefile"} +"examples/markups/lambxml/sample.lambxml" {"examples/markups/lambxml/sample.lambxml"} +"examples/markups/lambxml/index.html" {"examples/markups/lambxml/index.html"} +"examples/markups/lambxml/Makefile" {"examples/markups/lambxml/Makefile"} +"examples/markups/lambwiki/sample.lambwiki" {"examples/markups/lambwiki/sample.lambwiki"} +"examples/markups/lambwiki/index.html" {"examples/markups/lambwiki/index.html"} +"examples/markups/lambwiki/Makefile" {"examples/markups/lambwiki/Makefile"} +"examples/extensions/ocsigen_test.ml" {"examples/extensions/ocsigen_test.ml"} +"examples/extensions/sample.tex" {"examples/extensions/sample.tex"} +"examples/extensions/Makefile" {"examples/extensions/Makefile"} +"examples/extensions/META.ocsigen_test" {"examples/extensions/META.ocsigen_test"} +"examples/extensions/ocsigen.conf" {"examples/extensions/ocsigen.conf"} +"examples/extensions/sample.xml" {"examples/extensions/sample.xml"} +"examples/tutorial/3-multimarkup/ocsigen_test.ml" {"examples/tutorial/3-multimarkup/ocsigen_test.ml"} +"examples/tutorial/3-multimarkup/sample.lambtex" {"examples/tutorial/3-multimarkup/sample.lambtex"} +"examples/tutorial/3-multimarkup/Makefile" {"examples/tutorial/3-multimarkup/Makefile"} +"examples/tutorial/3-multimarkup/META.ocsigen_test" {"examples/tutorial/3-multimarkup/META.ocsigen_test"} +"examples/tutorial/3-multimarkup/ocsigen.conf" {"examples/tutorial/3-multimarkup/ocsigen.conf"} +"examples/tutorial/1-basic/ocsigen_test.ml" {"examples/tutorial/1-basic/ocsigen_test.ml"} +"examples/tutorial/1-basic/sample.lambtex" {"examples/tutorial/1-basic/sample.lambtex"} +"examples/tutorial/1-basic/Makefile" {"examples/tutorial/1-basic/Makefile"} +"examples/tutorial/1-basic/META.ocsigen_test" {"examples/tutorial/1-basic/META.ocsigen_test"} +"examples/tutorial/1-basic/ocsigen.conf" {"examples/tutorial/1-basic/ocsigen.conf"} +"examples/tutorial/2-restricted/ocsigen_test.ml" {"examples/tutorial/2-restricted/ocsigen_test.ml"} +"examples/tutorial/2-restricted/sample.lambtex" {"examples/tutorial/2-restricted/sample.lambtex"} +"examples/tutorial/2-restricted/Makefile" {"examples/tutorial/2-restricted/Makefile"} +"examples/tutorial/2-restricted/META.ocsigen_test" {"examples/tutorial/2-restricted/META.ocsigen_test"} +"examples/tutorial/2-restricted/ocsigen.conf" {"examples/tutorial/2-restricted/ocsigen.conf"} +"examples/tutorial/4-banner-extension/ocsigen_test.ml" {"examples/tutorial/4-banner-extension/ocsigen_test.ml"} +"examples/tutorial/4-banner-extension/sample.lambtex" {"examples/tutorial/4-banner-extension/sample.lambtex"} +"examples/tutorial/4-banner-extension/Makefile" {"examples/tutorial/4-banner-extension/Makefile"} +"examples/tutorial/4-banner-extension/META.ocsigen_test" {"examples/tutorial/4-banner-extension/META.ocsigen_test"} +"examples/tutorial/4-banner-extension/ocsigen.conf" {"examples/tutorial/4-banner-extension/ocsigen.conf"} +"examples/tutorial/6-embedded-markup/ocsigen_test.ml" {"examples/tutorial/6-embedded-markup/ocsigen_test.ml"} +"examples/tutorial/6-embedded-markup/sample.lambtex" {"examples/tutorial/6-embedded-markup/sample.lambtex"} +"examples/tutorial/6-embedded-markup/Makefile" {"examples/tutorial/6-embedded-markup/Makefile"} +"examples/tutorial/6-embedded-markup/META.ocsigen_test" {"examples/tutorial/6-embedded-markup/META.ocsigen_test"} +"examples/tutorial/6-embedded-markup/ocsigen.conf" {"examples/tutorial/6-embedded-markup/ocsigen.conf"} +"examples/tutorial/5-inline-note-extension/ocsigen_test.ml" {"examples/tutorial/5-inline-note-extension/ocsigen_test.ml"} +"examples/tutorial/5-inline-note-extension/sample.lambtex" {"examples/tutorial/5-inline-note-extension/sample.lambtex"} +"examples/tutorial/5-inline-note-extension/Makefile" {"examples/tutorial/5-inline-note-extension/Makefile"} +"examples/tutorial/5-inline-note-extension/META.ocsigen_test" {"examples/tutorial/5-inline-note-extension/META.ocsigen_test"} +"examples/tutorial/5-inline-note-extension/ocsigen.conf" {"examples/tutorial/5-inline-note-extension/ocsigen.conf"} +] diff --git a/patches/lambdoc/lambdoc.install.1.0-beta4 b/patches/lambdoc/lambdoc.install.1.0-beta4 new file mode 100644 index 0000000..519fd2c --- /dev/null +++ b/patches/lambdoc/lambdoc.install.1.0-beta4 @@ -0,0 +1,96 @@ +share: [ +"css/boxout-warning.png" {"css/boxout-warning.png"} +"css/lambdoc.css" {"css/lambdoc.css"} +"css/boxout-tip.png" {"css/boxout-tip.png"} +"css/src/boxout-warning.svg" {"css/src/boxout-warning.svg"} +"css/src/lambdoc_custom.ccss" {"css/src/lambdoc_custom.ccss"} +"css/src/lambdoc_config.ccss" {"css/src/lambdoc_config.ccss"} +"css/src/lambdoc_valid.ccss" {"css/src/lambdoc_valid.ccss"} +"css/src/lambdoc_invalid.ccss" {"css/src/lambdoc_invalid.ccss"} +"css/src/lambdoc_reset.ccss" {"css/src/lambdoc_reset.ccss"} +"css/src/lambdoc_root.ccss" {"css/src/lambdoc_root.ccss"} +"css/src/boxout-tip.svg" {"css/src/boxout-tip.svg"} +"css/src/Makefile" {"css/src/Makefile"} +"examples/serialisation/sample.lambtex" {"examples/serialisation/sample.lambtex"} +"examples/serialisation/Makefile" {"examples/serialisation/Makefile"} +"examples/serialisation/serialisation_test.ml" {"examples/serialisation/serialisation_test.ml"} +"examples/lambcmd-with-bookaml/lambcmd.ml" {"examples/lambcmd-with-bookaml/lambcmd.ml"} +"examples/lambcmd-with-bookaml/language.ml" {"examples/lambcmd-with-bookaml/language.ml"} +"examples/lambcmd-with-bookaml/markup.ml" {"examples/lambcmd-with-bookaml/markup.ml"} +"examples/lambcmd-with-bookaml/options.mli" {"examples/lambcmd-with-bookaml/options.mli"} +"examples/lambcmd-with-bookaml/options.ml" {"examples/lambcmd-with-bookaml/options.ml"} +"examples/lambcmd-with-bookaml/Makefile" {"examples/lambcmd-with-bookaml/Makefile"} +"examples/lambcmd-with-bookaml/_tags" {"examples/lambcmd-with-bookaml/_tags"} +"examples/markups/lambtex/square.svg" {"examples/markups/lambtex/square.svg"} +"examples/markups/lambtex/triangle.svg" {"examples/markups/lambtex/triangle.svg"} +"examples/markups/lambtex/sample.lambtex" {"examples/markups/lambtex/sample.lambtex"} +"examples/markups/lambtex/circle-big.png" {"examples/markups/lambtex/circle-big.png"} +"examples/markups/lambtex/square-big.png" {"examples/markups/lambtex/square-big.png"} +"examples/markups/lambtex/circle-small.png" {"examples/markups/lambtex/circle-small.png"} +"examples/markups/lambtex/triangle-huge.png" {"examples/markups/lambtex/triangle-huge.png"} +"examples/markups/lambtex/index.html" {"examples/markups/lambtex/index.html"} +"examples/markups/lambtex/Makefile" {"examples/markups/lambtex/Makefile"} +"examples/markups/lambtex/square-small.png" {"examples/markups/lambtex/square-small.png"} +"examples/markups/lambtex/circle.svg" {"examples/markups/lambtex/circle.svg"} +"examples/markups/lambtex/circle-tiny.png" {"examples/markups/lambtex/circle-tiny.png"} +"examples/markups/markdown/sample.md" {"examples/markups/markdown/sample.md"} +"examples/markups/markdown/index.html" {"examples/markups/markdown/index.html"} +"examples/markups/markdown/Makefile" {"examples/markups/markdown/Makefile"} +"examples/markups/lambxml/sample.lambxml" {"examples/markups/lambxml/sample.lambxml"} +"examples/markups/lambxml/index.html" {"examples/markups/lambxml/index.html"} +"examples/markups/lambxml/Makefile" {"examples/markups/lambxml/Makefile"} +"examples/markups/lambwiki/sample.lambwiki" {"examples/markups/lambwiki/sample.lambwiki"} +"examples/markups/lambwiki/index.html" {"examples/markups/lambwiki/index.html"} +"examples/markups/lambwiki/Makefile" {"examples/markups/lambwiki/Makefile"} +"examples/extensions/ocsigen_test.ml" {"examples/extensions/ocsigen_test.ml"} +"examples/extensions/sample.tex" {"examples/extensions/sample.tex"} +"examples/extensions/Makefile" {"examples/extensions/Makefile"} +"examples/extensions/META.ocsigen_test" {"examples/extensions/META.ocsigen_test"} +"examples/extensions/ocsigen.conf" {"examples/extensions/ocsigen.conf"} +"examples/extensions/sample.xml" {"examples/extensions/sample.xml"} +"examples/tutorial/01-basic/ocsigen_test.ml" {"examples/tutorial/01-basic/ocsigen_test.ml"} +"examples/tutorial/01-basic/sample.lambtex" {"examples/tutorial/01-basic/sample.lambtex"} +"examples/tutorial/01-basic/Makefile" {"examples/tutorial/01-basic/Makefile"} +"examples/tutorial/01-basic/META.ocsigen_test" {"examples/tutorial/01-basic/META.ocsigen_test"} +"examples/tutorial/01-basic/ocsigen.conf" {"examples/tutorial/01-basic/ocsigen.conf"} +"examples/tutorial/02-restricted/ocsigen_test.ml" {"examples/tutorial/02-restricted/ocsigen_test.ml"} +"examples/tutorial/02-restricted/sample.lambtex" {"examples/tutorial/02-restricted/sample.lambtex"} +"examples/tutorial/02-restricted/Makefile" {"examples/tutorial/02-restricted/Makefile"} +"examples/tutorial/02-restricted/META.ocsigen_test" {"examples/tutorial/02-restricted/META.ocsigen_test"} +"examples/tutorial/02-restricted/ocsigen.conf" {"examples/tutorial/02-restricted/ocsigen.conf"} +"examples/tutorial/03-multimarkup/ocsigen_test.ml" {"examples/tutorial/03-multimarkup/ocsigen_test.ml"} +"examples/tutorial/03-multimarkup/sample.lambtex" {"examples/tutorial/03-multimarkup/sample.lambtex"} +"examples/tutorial/03-multimarkup/Makefile" {"examples/tutorial/03-multimarkup/Makefile"} +"examples/tutorial/03-multimarkup/META.ocsigen_test" {"examples/tutorial/03-multimarkup/META.ocsigen_test"} +"examples/tutorial/03-multimarkup/ocsigen.conf" {"examples/tutorial/03-multimarkup/ocsigen.conf"} +"examples/tutorial/04-banner-extension/ocsigen_test.ml" {"examples/tutorial/04-banner-extension/ocsigen_test.ml"} +"examples/tutorial/04-banner-extension/sample.lambtex" {"examples/tutorial/04-banner-extension/sample.lambtex"} +"examples/tutorial/04-banner-extension/Makefile" {"examples/tutorial/04-banner-extension/Makefile"} +"examples/tutorial/04-banner-extension/META.ocsigen_test" {"examples/tutorial/04-banner-extension/META.ocsigen_test"} +"examples/tutorial/04-banner-extension/ocsigen.conf" {"examples/tutorial/04-banner-extension/ocsigen.conf"} +"examples/tutorial/05-inline-note-extension/ocsigen_test.ml" {"examples/tutorial/05-inline-note-extension/ocsigen_test.ml"} +"examples/tutorial/05-inline-note-extension/sample.lambtex" {"examples/tutorial/05-inline-note-extension/sample.lambtex"} +"examples/tutorial/05-inline-note-extension/Makefile" {"examples/tutorial/05-inline-note-extension/Makefile"} +"examples/tutorial/05-inline-note-extension/META.ocsigen_test" {"examples/tutorial/05-inline-note-extension/META.ocsigen_test"} +"examples/tutorial/05-inline-note-extension/ocsigen.conf" {"examples/tutorial/05-inline-note-extension/ocsigen.conf"} +"examples/tutorial/06-embedded-markup/ocsigen_test.ml" {"examples/tutorial/06-embedded-markup/ocsigen_test.ml"} +"examples/tutorial/06-embedded-markup/sample.lambtex" {"examples/tutorial/06-embedded-markup/sample.lambtex"} +"examples/tutorial/06-embedded-markup/Makefile" {"examples/tutorial/06-embedded-markup/Makefile"} +"examples/tutorial/06-embedded-markup/META.ocsigen_test" {"examples/tutorial/06-embedded-markup/META.ocsigen_test"} +"examples/tutorial/06-embedded-markup/ocsigen.conf" {"examples/tutorial/06-embedded-markup/ocsigen.conf"} +"examples/tutorial/07-bold-counter/ocsigen_test.ml" {"examples/tutorial/07-bold-counter/ocsigen_test.ml"} +"examples/tutorial/07-bold-counter/sample.lambtex" {"examples/tutorial/07-bold-counter/sample.lambtex"} +"examples/tutorial/07-bold-counter/Makefile" {"examples/tutorial/07-bold-counter/Makefile"} +"examples/tutorial/07-bold-counter/META.ocsigen_test" {"examples/tutorial/07-bold-counter/META.ocsigen_test"} +"examples/tutorial/07-bold-counter/ocsigen.conf" {"examples/tutorial/07-bold-counter/ocsigen.conf"} +"examples/tutorial/08-link-validation/ocsigen_test.ml" {"examples/tutorial/08-link-validation/ocsigen_test.ml"} +"examples/tutorial/08-link-validation/sample.lambtex" {"examples/tutorial/08-link-validation/sample.lambtex"} +"examples/tutorial/08-link-validation/Makefile" {"examples/tutorial/08-link-validation/Makefile"} +"examples/tutorial/08-link-validation/META.ocsigen_test" {"examples/tutorial/08-link-validation/META.ocsigen_test"} +"examples/tutorial/08-link-validation/ocsigen.conf" {"examples/tutorial/08-link-validation/ocsigen.conf"} +"examples/tutorial/09-document-transformation/ocsigen_test.ml" {"examples/tutorial/09-document-transformation/ocsigen_test.ml"} +"examples/tutorial/09-document-transformation/sample.lambtex" {"examples/tutorial/09-document-transformation/sample.lambtex"} +"examples/tutorial/09-document-transformation/Makefile" {"examples/tutorial/09-document-transformation/Makefile"} +"examples/tutorial/09-document-transformation/META.ocsigen_test" {"examples/tutorial/09-document-transformation/META.ocsigen_test"} +"examples/tutorial/09-document-transformation/ocsigen.conf" {"examples/tutorial/09-document-transformation/ocsigen.conf"} +] diff --git a/patches/lbfgs/setup.patch b/patches/lbfgs/setup.patch new file mode 100644 index 0000000..019f30d --- /dev/null +++ b/patches/lbfgs/setup.patch @@ -0,0 +1,31 @@ +diff --git a/setup.ml b/setup.ml +index b638f37..ff88aea 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -5244,7 +5244,7 @@ let fortran_lib = + (String.concat ", " fortran_compilers); + exit 1 + +-let _ = BaseEnv.var_define "fortran_library" (lazy fortran_lib) ++let _ = BaseEnv.var_define "fortran_library" (fun () -> fortran_lib) + + let lbfgsb_ver = + if Sys.file_exists "src/Lbfgsb.3.0/lbfgsb.f" then "3.0" +@@ -5256,14 +5256,14 @@ let lbfgsb_ver = + exit 1 + ) + +-let _ = BaseEnv.var_define "lbfgsb_ver" (lazy lbfgsb_ver) ++let _ = BaseEnv.var_define "lbfgsb_ver" (fun () -> lbfgsb_ver) + let _ = BaseEnv.var_define "lbfgsb_wa_coef_n1" (* function of [m] *) +- (lazy (match lbfgsb_ver with ++ (fun () -> (match lbfgsb_ver with + | "2.1" -> "(2 * m + 4)" + | "3.0" -> "(2 * m + 5)" + | _ -> assert false)) + let _ = BaseEnv.var_define "lbfgsb_wa_coef_n0" (* function of [m] *) +- (lazy (match lbfgsb_ver with ++ (fun () -> (match lbfgsb_ver with + | "2.1" -> "12 * m * (m + 1)" + | "3.0" -> "m * (11 * m + 8)" + | _ -> assert false)) diff --git a/patches/lbfgs/string.patch b/patches/lbfgs/string.patch new file mode 100644 index 0000000..6b414cd --- /dev/null +++ b/patches/lbfgs/string.patch @@ -0,0 +1,20 @@ +diff --git a/src/lbfgs.mli b/src/lbfgs.mli +index 7b432a7..0049f01 100644 +--- a/src/lbfgs.mli ++++ b/src/lbfgs.mli +@@ -106,13 +106,13 @@ sig + + @param factr tolerance in the termination test for the algorithm. + The iteration will stop when +- [(f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= factr*epsilon_float]. ++ [(f^k - f^{k+1})/max{ |f^k|,|f^{k+1}|, 1 } <= factr*epsilon_float]. + Set e.g. [factr] to [1e12] for low accuracy, [1e7] for moderate + accuracy and [1e1] for extremely high accuracy. Setting [factr] to + [0.] suppresses this termination test. Default: [1e7]. + + @param pgtol The iteration will stop when +- [max{|proj g_i| : i = 1,..., n} <= pgtol] ++ [max{ |proj g_i| : i = 1,..., n} <= pgtol] + where [proj g_i] is the ith component of the projected gradient. + Setting [pgtol] to [0.] suppresses this termination test. + Default: [1e-5]. diff --git a/patches/lbvs_consent/lbvs_consent.install b/patches/lbvs_consent/lbvs_consent.install new file mode 100644 index 0000000..ca87bd6 --- /dev/null +++ b/patches/lbvs_consent/lbvs_consent.install @@ -0,0 +1,7 @@ +bin: [ + "lbvs_consent" + "src/lbvs_consent_ob_maccs" + "bin/lbvs_consent_ecfp4.py" + "lbvs_consent_mop2di" + "lbvs_consent_mop2de" +] diff --git a/patches/lbvs_consent/makefile.patch b/patches/lbvs_consent/makefile.patch new file mode 100644 index 0000000..092e649 --- /dev/null +++ b/patches/lbvs_consent/makefile.patch @@ -0,0 +1,28 @@ +From 72b06302f05f20ae6eb9fb045bacc651c0c2257c Mon Sep 17 00:00:00 2001 +From: Jan Midtgaard +Date: Thu, 26 Oct 2023 09:46:09 +0200 +Subject: [PATCH] Support openbabel-2.0 and openbabel-3 via pkg-config + +--- + src/Makefile | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index c075908..0e8b4f5 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -1,6 +1,9 @@ ++CFLAGS := `pkg-config --silence-errors --cflags openbabel-2.0 || pkg-config --cflags openbabel-3` ++LDFLAGS := `pkg-config --silence-errors --libs openbabel-2.0 || pkg-config --libs openbabel-3` ++ + ob_maccs: ob_maccs.cpp +- c++ -W -Wall -I/usr/include/openbabel-2.0 ob_maccs.cpp \ +- -o lbvs_consent_ob_maccs -lopenbabel -Wl,-R/usr/lib ++ c++ -W -Wall $(CFLAGS) ob_maccs.cpp \ ++ -o lbvs_consent_ob_maccs $(LDFLAGS) -Wl,-R/usr/lib + + clean: + \rm -f lbvs_consent_ob_maccs +-- +2.34.1 + diff --git a/patches/ledit/ledit.install.2.03 b/patches/ledit/ledit.install.2.03 new file mode 100644 index 0000000..3189920 --- /dev/null +++ b/patches/ledit/ledit.install.2.03 @@ -0,0 +1 @@ +bin: ["ledit.out" {"ledit"}] diff --git a/patches/ledit/ledit.install.2.04 b/patches/ledit/ledit.install.2.04 new file mode 100644 index 0000000..51f2cb3 --- /dev/null +++ b/patches/ledit/ledit.install.2.04 @@ -0,0 +1,2 @@ +bin: ["ledit.out" {"ledit"}] +man: ["ledit.1"] diff --git a/patches/ledit/ledit.install.2.05 b/patches/ledit/ledit.install.2.05 new file mode 100644 index 0000000..51f2cb3 --- /dev/null +++ b/patches/ledit/ledit.install.2.05 @@ -0,0 +1,2 @@ +bin: ["ledit.out" {"ledit"}] +man: ["ledit.1"] diff --git a/patches/ledit/ledit.install.2.06 b/patches/ledit/ledit.install.2.06 new file mode 100644 index 0000000..51f2cb3 --- /dev/null +++ b/patches/ledit/ledit.install.2.06 @@ -0,0 +1,2 @@ +bin: ["ledit.out" {"ledit"}] +man: ["ledit.1"] diff --git a/patches/leveldb/fix_snappy_link_issue.patch b/patches/leveldb/fix_snappy_link_issue.patch new file mode 100644 index 0000000..cb3238e --- /dev/null +++ b/patches/leveldb/fix_snappy_link_issue.patch @@ -0,0 +1,13 @@ +diff --git a/src/OMakefile b/src/OMakefile +index 142a0df..3f3a166 100644 +--- a/src/OMakefile ++++ b/src/OMakefile +@@ -11,7 +11,7 @@ section + leveldb.cma leveldb.cmxa leveldb.a libcamlleveldb.a dllcamlleveldb.so: \ + leveldb_stubs.o levelDB.cmo levelDB.cmx + ocamlmklib \ +- -oc camlleveldb -o leveldb -lsnappy -lleveldb -lstdc++ -lm \ ++ -oc camlleveldb -o leveldb -lsnappy -lleveldb -lstdc++ -lsnappy -lm \ + leveldb_stubs.o levelDB.cmo levelDB.cmx + + .DEFAULT: leveldb.cma leveldb.cmxa diff --git a/patches/leveldb/link_against_extra_libs.patch b/patches/leveldb/link_against_extra_libs.patch new file mode 100644 index 0000000..6b887aa --- /dev/null +++ b/patches/leveldb/link_against_extra_libs.patch @@ -0,0 +1,13 @@ +diff --git a/src/OMakefile b/src/OMakefile +index ece98cd..242176a 100644 +--- a/src/OMakefile ++++ b/src/OMakefile +@@ -10,7 +10,7 @@ section + leveldb.cma leveldb.cmxa leveldb.a libcamlleveldb.a dllcamlleveldb.so: \ + leveldb_stubs.o levelDB.cmo levelDB.cmx + ocamlmklib \ +- -oc camlleveldb -o leveldb -lsnappy -lleveldb \ ++ -oc camlleveldb -o leveldb -lsnappy -lleveldb -lstdc++ -lsnappy -lm \ + leveldb_stubs.o levelDB.cmo levelDB.cmx + + .DEFAULT: leveldb.cma leveldb.cmxa diff --git a/patches/leveldb/warn_error.patch b/patches/leveldb/warn_error.patch new file mode 100644 index 0000000..e38c461 --- /dev/null +++ b/patches/leveldb/warn_error.patch @@ -0,0 +1,11 @@ +diff --git a/OMakefile b/OMakefile +index 7ede325..900feb2 100644 +--- a/OMakefile ++++ b/OMakefile +@@ -1,5 +1,5 @@ + +-OCAMLFLAGS = -w +a-4-6-9-27-28-30..99 -warn-error +a-4-6-9-18-27-28-30..99 -annot -thread ++OCAMLFLAGS = -w +a-4-6-9-27-28-30..99 -warn-error +a-3-6-9-18-27-28-30..99 -annot -thread + OCAMLOPTFLAGS += -inline 100 + + HAS_NATDYNLINK = false diff --git a/patches/libres3/depfix.patch b/patches/libres3/depfix.patch new file mode 100644 index 0000000..bcc194a --- /dev/null +++ b/patches/libres3/depfix.patch @@ -0,0 +1,22 @@ +diff --git a/detect.ml b/detect.ml +index 18d99aa..0688b24 100755 +--- a/detect.ml ++++ b/detect.ml +@@ -770,7 +770,7 @@ let pkg_ssl = + + let pkg_ocamlnet = + ocaml_dependency "ocamlnet" ~findlibnames:[ +- "netstring";"netstring-pcre";"netsys";"netcgi2";"netclient";"equeue.ssl" ++ "netstring";"netstring-pcre";"netsys";"netcgi2";"netclient";"equeue-ssl" + ] ~version:(fun ver -> ver >? "3.7.3") ~cmi:("netstring","netstring_str.cmi") + (Build (fun _ -> { + source = "3rdparty/libs/ocamlnet"; +@@ -856,7 +856,7 @@ let pkg_ocsigenserver = ocaml_dependency "ocsigenserver" + "--staticpagesdir";Filename.concat prefix_var "www/ocsigenserver"; + "--datadir";Filename.concat prefix_var "lib/ocsigenserver" + ] ~findlibnames:["ocsigenserver"] +-)) ~version:(fun _ -> false) (* always build *) ++)) ~version:(fun v -> v >=? "2.4.0") (* always build *) + ~deps:[ + gnu_make_dep; camlp4_dep; pkg_findlib; pkg_pcre; pkg_ocamlnet; pkg_react; pkg_ssl; pkg_lwt; pkg_cryptokit; pkg_tyxml + ] diff --git a/patches/libres3/libres3.install.0.1 b/patches/libres3/libres3.install.0.1 new file mode 100644 index 0000000..e4436be --- /dev/null +++ b/patches/libres3/libres3.install.0.1 @@ -0,0 +1,13 @@ +sbin: [ + "libres3/_build/src/ocsigen/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3" + "libres3/src/files/sbin/libres3_env.sh" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" +] +doc: [ + "libres3/README" +] diff --git a/patches/libres3/libres3.install.0.2 b/patches/libres3/libres3.install.0.2 new file mode 100644 index 0000000..97352fd --- /dev/null +++ b/patches/libres3/libres3.install.0.2 @@ -0,0 +1,14 @@ +sbin: [ + "libres3/_build/src/ocsigen/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3" + "libres3/src/files/sbin/libres3_env.sh" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" + "libres3/src/files/conf/mime.types" +] +doc: [ + "libres3/README" +] diff --git a/patches/libres3/libres3.install.0.3 b/patches/libres3/libres3.install.0.3 new file mode 100644 index 0000000..0eb7944 --- /dev/null +++ b/patches/libres3/libres3.install.0.3 @@ -0,0 +1,17 @@ +sbin: [ + "libres3/_build/src/server/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/server/libres3_report.native" {"libres3_report"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3_certgen" + "libres3/src/files/sbin/libres3" + "libres3/src/files/sbin/libres3_env.sh" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" + "libres3/src/files/conf/mime.types" +] +doc: [ + "libres3/README" + "libres3/src/files/s3genlink.py" +] diff --git a/patches/libres3/libres3.install.0.9 b/patches/libres3/libres3.install.0.9 new file mode 100644 index 0000000..0eb7944 --- /dev/null +++ b/patches/libres3/libres3.install.0.9 @@ -0,0 +1,17 @@ +sbin: [ + "libres3/_build/src/server/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/server/libres3_report.native" {"libres3_report"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3_certgen" + "libres3/src/files/sbin/libres3" + "libres3/src/files/sbin/libres3_env.sh" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" + "libres3/src/files/conf/mime.types" +] +doc: [ + "libres3/README" + "libres3/src/files/s3genlink.py" +] diff --git a/patches/libres3/libres3.install.1.0 b/patches/libres3/libres3.install.1.0 new file mode 100644 index 0000000..35afde1 --- /dev/null +++ b/patches/libres3/libres3.install.1.0 @@ -0,0 +1,18 @@ +sbin: [ + "libres3/_build/src/server/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/server/libres3_report.native" {"libres3_report"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3_certgen" + "libres3/src/files/sbin/libres3" + "libres3/src/files/sbin/libres3_env.sh" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" + "libres3/src/files/conf/mime.types" +] +doc: [ + "libres3/README" + "libres3/src/files/s3genlink.py" + "libres3/doc/manual/manual.pdf" +] diff --git a/patches/libres3/libres3.install.1.1 b/patches/libres3/libres3.install.1.1 new file mode 100644 index 0000000..f1c73b7 --- /dev/null +++ b/patches/libres3/libres3.install.1.1 @@ -0,0 +1,17 @@ +sbin: [ + "libres3/_build/src/server/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/server/libres3_report.native" {"libres3_report"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3_certgen" + "libres3/src/files/sbin/libres3" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" + "libres3/src/files/conf/mime.types" +] +doc: [ + "libres3/README" + "libres3/src/files/s3genlink.py" + "libres3/doc/manual/manual.pdf" +] diff --git a/patches/libres3/libres3.install.1.2 b/patches/libres3/libres3.install.1.2 new file mode 100644 index 0000000..f1c73b7 --- /dev/null +++ b/patches/libres3/libres3.install.1.2 @@ -0,0 +1,17 @@ +sbin: [ + "libres3/_build/src/server/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/server/libres3_report.native" {"libres3_report"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3_certgen" + "libres3/src/files/sbin/libres3" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" + "libres3/src/files/conf/mime.types" +] +doc: [ + "libres3/README" + "libres3/src/files/s3genlink.py" + "libres3/doc/manual/manual.pdf" +] diff --git a/patches/libres3/libres3.install.1.3 b/patches/libres3/libres3.install.1.3 new file mode 100644 index 0000000..f1c73b7 --- /dev/null +++ b/patches/libres3/libres3.install.1.3 @@ -0,0 +1,17 @@ +sbin: [ + "libres3/_build/src/server/libres3_setup.native" {"libres3_setup"} + "libres3/_build/src/server/libres3_report.native" {"libres3_report"} + "libres3/_build/src/ocsigen/libres3_ocsigen.native" {"libres3_ocsigen"} + "libres3/src/files/sbin/libres3_certgen" + "libres3/src/files/sbin/libres3" +] +etc: [ + "libres3/src/files/conf/libres3.sample.s3cfg" + "libres3/src/files/conf/libres3-insecure.sample.s3cfg" + "libres3/src/files/conf/mime.types" +] +doc: [ + "libres3/README" + "libres3/src/files/s3genlink.py" + "libres3/doc/manual/manual.pdf" +] diff --git a/patches/libsvm/calc_scc_fix.patch b/patches/libsvm/calc_scc_fix.patch new file mode 100644 index 0000000..e8c7ebc --- /dev/null +++ b/patches/libsvm/calc_scc_fix.patch @@ -0,0 +1,28 @@ +diff -crB libsvm-ocaml-0.8.3.orig/lib/libsvm.ml libsvm-ocaml-0.8.3/lib/libsvm.ml +*** libsvm-ocaml-0.8.3.orig/lib/libsvm.ml 2013-03-01 23:04:00.689977974 +0100 +--- libsvm-ocaml-0.8.3/lib/libsvm.ml 2013-03-01 23:04:56.694277823 +0100 +*************** +*** 543,553 **** + let sum_yy = ref 0. in + let sum_xy = ref 0. in + Array.iter2_exn array_x array_y ~f:(fun x y -> +! sum_x := !sum_x +. x; +! sum_y := !sum_y +. y; +! sum_xx := x *. x; +! sum_yy := y *. y; +! sum_xy := x *. y; + ); + let sqr x = x *. x in + let l = float (Vec.dim expected) in +--- 543,553 ---- + let sum_yy = ref 0. in + let sum_xy = ref 0. in + Array.iter2_exn array_x array_y ~f:(fun x y -> +! sum_x := !sum_x +. x; +! sum_y := !sum_y +. y; +! sum_xx := !sum_xx +. x *. x; +! sum_yy := !sum_yy +. y *. y; +! sum_xy := !sum_xy +. x *. y; + ); + let sqr x = x *. x in + let l = float (Vec.dim expected) in diff --git a/patches/libsvm/svm_cli_fix.patch b/patches/libsvm/svm_cli_fix.patch new file mode 100644 index 0000000..8465efd --- /dev/null +++ b/patches/libsvm/svm_cli_fix.patch @@ -0,0 +1,32 @@ +diff -crB libsvm-ocaml-0.8.3.orig/examples/svm_cli.ml libsvm-ocaml-0.8.3/examples/svm_cli.ml +*** libsvm-ocaml-0.8.3.orig/examples/svm_cli.ml 2013-03-01 21:25:49.894623050 +0100 +--- libsvm-ocaml-0.8.3/examples/svm_cli.ml 2013-03-01 21:26:19.808249078 +0100 +*************** +*** 13,25 **** + + let read_scale_parameters file = + let conv_line line = +! sscanf line "%d %g %g" (fun _index min max -> min, max) + in + In_channel.with_file file ~f:(fun ic -> + match In_channel.input_line ic with + | None -> failwith "no data" + | Some line -> +! let lower, upper = sscanf line "%g %g" Tuple2.create in + let lines = In_channel.input_lines ic in + let min_feats, max_feats = + List.map lines ~f:conv_line +--- 13,25 ---- + + let read_scale_parameters file = + let conv_line line = +! Scanf.sscanf line "%d %g %g" (fun _index min max -> min, max) + in + In_channel.with_file file ~f:(fun ic -> + match In_channel.input_line ic with + | None -> failwith "no data" + | Some line -> +! let lower, upper = Scanf.sscanf line "%g %g" Tuple2.create in + let lines = In_channel.input_lines ic in + let min_feats, max_feats = + List.map lines ~f:conv_line diff --git a/patches/libwasmer/config.toml b/patches/libwasmer/config.toml new file mode 100644 index 0000000..0236928 --- /dev/null +++ b/patches/libwasmer/config.toml @@ -0,0 +1,5 @@ +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" diff --git a/patches/libwasmer/libwasmer.install b/patches/libwasmer/libwasmer.install new file mode 100644 index 0000000..0ee7c9b --- /dev/null +++ b/patches/libwasmer/libwasmer.install @@ -0,0 +1,6 @@ +lib: [ + "?package/lib/libwasmer.so" + "?package/lib/libwasmer.dylib" + "?package/lib/libwasmer.dll" + "?package/lib/libwasmer.dll.lib" +] diff --git a/patches/lilis/lilis.install b/patches/lilis/lilis.install new file mode 100644 index 0000000..7786406 --- /dev/null +++ b/patches/lilis/lilis.install @@ -0,0 +1 @@ +bin: ["?glilis_ex.native" {"glilis"}] diff --git a/patches/liquidsoap/camomile.patch b/patches/liquidsoap/camomile.patch new file mode 100644 index 0000000..b9e05a1 --- /dev/null +++ b/patches/liquidsoap/camomile.patch @@ -0,0 +1,108 @@ +--- a/configure 2018-04-06 00:23:56.000000000 -0500 ++++ b/configure 2018-04-06 00:24:07.000000000 -0500 +@@ -12403,8 +12391,8 @@ + + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ocaml camomile module" >&5 +-$as_echo_n "checking for ocaml camomile module... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ocaml camomile module >= 1.0.0" >&5 ++$as_echo_n "checking for ocaml camomile module >= 1.0.0... " >&6; } + + OCAML_CHECK="${OCAMLFIND} query camomile" + +@@ -12433,11 +12421,11 @@ + $as_echo "Not found." >&6; } + else + CAMOMILE_version="`${OCAMLFIND} query -format "%v" camomile 2>/dev/null`" +- if test -z "" ; then ++ if test -z "1.0.0" ; then + VERSION_OK=yes + else + as_arg_v1=${CAMOMILE_version} +-as_arg_v2= ++as_arg_v2=1.0.0 + awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null + case $? in #( + 1) : +@@ -12451,8 +12439,8 @@ + esac + fi + if test -z "${VERSION_OK}"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: requires version >= found ${CAMOMILE_version}." >&5 +-$as_echo "requires version >= found ${CAMOMILE_version}." >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: requires version >= 1.0.0 found ${CAMOMILE_version}." >&5 ++$as_echo "requires version >= 1.0.0 found ${CAMOMILE_version}." >&6; } + else + if test -z "${CAMOMILE_SHARED}"; then + CAMOMILE_PACKAGES="`${OCAMLFIND} query -separator " " -format "-package %p" $BINDING_PKGS 2>/dev/null`" +@@ -12474,11 +12462,11 @@ + if test -r ${with_camomile_dir}/META >/dev/null 2>&1; then + # Grab version + CAMOMILE_version=`cat "${with_camomile_dir}/META" | grep version | cut -d'=' -f 2 | tr -d ' ' | tr -d '"' | head -n 1` +- if test -z "" ; then ++ if test -z "1.0.0" ; then + VERSION_OK=yes + else + as_arg_v1=${CAMOMILE_version} +-as_arg_v2= ++as_arg_v2=1.0.0 + awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null + case $? in #( + 1) : +@@ -12492,15 +12480,15 @@ + esac + fi + if test -z "${VERSION_OK}"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: requires version >= found ${CAMOMILE_version}." >&5 +-$as_echo "requires version >= found ${CAMOMILE_version}." >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: requires version >= 1.0.0 found ${CAMOMILE_version}." >&5 ++$as_echo "requires version >= 1.0.0 found ${CAMOMILE_version}." >&6; } + CAMOMILE_STOP_CHECK=yes + fi + CAMOMILE_requires=`cat "${with_camomile_dir}/META" | grep 'requires' | cut -d '=' -f 2 | tr -d '"'` + CAMOMILE_path="${with_camomile_dir}" + else + CAMOMILE_path=`${OCAMLFIND} -query camomile 2>/dev/null` +- if ! test -z ""; then ++ if ! test -z "1.0.0"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find version from META file." >&5 + $as_echo "cannot find version from META file." >&6; } + CAMOMILE_STOP_CHECK=yes +@@ -12561,17 +12549,9 @@ + as_fn_error $? "Camomile provides charset detection and conversions. It is strongly advised to enable those features. If you really don't want this, use --disable-camomile." "$LINENO" 5 + fi + else +- camdir=`$OCAMLFIND query camomile -l | \ +- grep location | tr -d ' ' | cut -d':' -f 2` +- camencoding=Camomile.CharEncoding +- # Use Camomile with environment variables if +- # available +- if test -f $camdir/camomileLibraryDyn.cmi ; then +- if test -z "$w_CUSTOM_PATH"; then +- camencoding=CamomileLibraryDyn.$camencoding +- else +- camencoding="CamomileLibrary.CharEncoding.Configure(CamomileConfig)" +- cat >> src/configure.ml <> src/configure.ml <> src/configure.ml < +Date: Sun Jan 2 10:19:50 2022 -0600 + + Bump windows ffmpeg packages, install tsdl-image with fix in docker images, fix type for last_metadata. + +diff --git a/src/lang/lang.ml b/src/lang/lang.ml +index 2dc4e28e..490ef04a 100644 +--- a/src/lang/lang.ml ++++ b/src/lang/lang.ml +@@ -608,7 +608,7 @@ let source_methods = + initialized.", + fun s -> val_fun [] (fun _ -> bool s#is_ready) ); + ( "last_metadata", +- ([], fun_t [(false, "", fun_t [] (nullable_t metadata_t))] unit_t), ++ ([], fun_t [] (nullable_t metadata_t)), + "Return the last metadata from the source.", + fun s -> + val_fun [] (fun _ -> diff --git a/patches/liquidsoap/fix_4.05.patch b/patches/liquidsoap/fix_4.05.patch new file mode 100644 index 0000000..67cca84 --- /dev/null +++ b/patches/liquidsoap/fix_4.05.patch @@ -0,0 +1,11 @@ +--- liquidsoap/src/harbor/harbor.ml ++++ liquidsoap/src/harbor/harbor.ml +@@ -69,7 +69,7 @@ + let buf = Bytes.create len in + let n = Unix.read socket buf 0 len in (buf, n) + +- let accept = Unix.accept ++ let accept fd = Unix.accept fd + + let close = Unix.close + diff --git a/patches/liquidsoap/fix_process_output.patch b/patches/liquidsoap/fix_process_output.patch new file mode 100644 index 0000000..0c24e62 --- /dev/null +++ b/patches/liquidsoap/fix_process_output.patch @@ -0,0 +1,25 @@ +--- liquidsoap/src/lang/lang_builtins.ml ++++ liquidsoap/src/lang/lang_builtins.ml +@@ -1727,13 +1727,16 @@ let () = + let ((in_chan,out_ch,err_chan) as p) = Unix.open_process_full cmd env in + close_out out_ch; + let pull buf ch = +- let rec f () = +- try +- Buffer.add_channel buf ch buflen; +- f () +- with End_of_file -> () ++ let tmp = Bytes.create 1024 in ++ let rec aux () = ++ let n = input ch tmp 0 1024 in ++ if n = 0 then () else ++ begin ++ Buffer.add_substring buf tmp 0 n; ++ aux() ++ end + in +- f () ++ aux () + in + pull out_buf in_chan; + pull err_buf err_chan; diff --git a/patches/liquidsoap/ignore-bash-completion-install-errors.patch b/patches/liquidsoap/ignore-bash-completion-install-errors.patch new file mode 100644 index 0000000..5d11137 --- /dev/null +++ b/patches/liquidsoap/ignore-bash-completion-install-errors.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile b/Makefile +index 4dc8c797..c2c4c409 100644 +--- a/Makefile ++++ b/Makefile +@@ -83,7 +83,7 @@ endif + $(INSTALL_DATA) examples/radio.liq ${sysconfdir}/liquidsoap/radio.liq.example + $(INSTALL_DIRECTORY) ${sysconfdir}/logrotate.d + $(INSTALL_DATA) scripts/liquidsoap.logrotate ${sysconfdir}/logrotate.d/liquidsoap +- $(INSTALL_DIRECTORY) ${bashcompdir} +- $(INSTALL_DATA) scripts/bash-completion ${bashcompdir}/liquidsoap ++ -$(INSTALL_DIRECTORY) ${bashcompdir} ++ -$(INSTALL_DATA) scripts/bash-completion ${bashcompdir}/liquidsoap + $(INSTALL_DIRECTORY) ${emacsdir} + $(INSTALL_DATA) scripts/liquidsoap-mode.el ${emacsdir}/ diff --git a/patches/liquidsoap/lang_builtins.patch b/patches/liquidsoap/lang_builtins.patch new file mode 100644 index 0000000..3a537a6 --- /dev/null +++ b/patches/liquidsoap/lang_builtins.patch @@ -0,0 +1,13 @@ +diff --git a/src/lang/lang_builtins.ml b/src/lang/lang_builtins.ml +index 5512adf..e48fbde 100644 +--- a/src/lang/lang_builtins.ml ++++ b/src/lang/lang_builtins.ml +@@ -1289,7 +1289,7 @@ let () = + Shutdown.restart := true ; + Tutils.shutdown () ; + Lang.unit); +- add_builtin "exit" ~cat:Sys ~flags:[Hidden] ++ add_builtin "exit" ~cat:Sys ~flags:[Lang.Hidden] + ~descr:"Immediately stop the application. This should only be used in extreme cases or to specify an exit value. The recommended way of stopping Liquidsoap is to use shutdown." + ["", Lang.int_t, None, Some "Exit value."] Lang.unit_t + (fun p -> diff --git a/patches/llvm/D24354.diff b/patches/llvm/D24354.diff new file mode 100644 index 0000000..071a556 --- /dev/null +++ b/patches/llvm/D24354.diff @@ -0,0 +1,77 @@ +Index: bindings/ocaml/backends/CMakeLists.txt +=================================================================== +--- a/bindings/ocaml/backends/CMakeLists.txt ++++ b/bindings/ocaml/backends/CMakeLists.txt +@@ -23,5 +23,5 @@ + "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}") + + install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}" +- DESTINATION lib/ocaml) ++ DESTINATION "${LLVM_OCAML_INSTALL_PATH}") + endforeach() +Index: bindings/ocaml/backends/META.llvm_backend.in +=================================================================== +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -4,4 +4,4 @@ + requires = "llvm" + archive(byte) = "llvm_@TARGET@.cma" + archive(native) = "llvm_@TARGET@.cmxa" +-directory = "." ++directory = "llvm" +Index: bindings/ocaml/llvm/CMakeLists.txt +=================================================================== +--- a/bindings/ocaml/llvm/CMakeLists.txt ++++ b/bindings/ocaml/llvm/CMakeLists.txt +@@ -8,4 +8,4 @@ + "${LLVM_LIBRARY_DIR}/ocaml/META.llvm") + + install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm" +- DESTINATION lib/ocaml) ++ DESTINATION "${LLVM_OCAML_INSTALL_PATH}") +Index: bindings/ocaml/llvm/META.llvm.in +=================================================================== +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -3,7 +3,7 @@ + description = "LLVM OCaml bindings" + archive(byte) = "llvm.cma" + archive(native) = "llvm.cmxa" +-directory = "." ++directory = "llvm" + + package "analysis" ( + requires = "llvm" +Index: cmake/config-ix.cmake +=================================================================== +--- a/cmake/config-ix.cmake ++++ b/cmake/config-ix.cmake +@@ -576,6 +576,9 @@ + message(STATUS "OCaml bindings enabled.") + find_ocamlfind_package(oUnit VERSION 2 OPTIONAL) + set(LLVM_BINDINGS "${LLVM_BINDINGS} ocaml") ++ ++ set(LLVM_OCAML_INSTALL_PATH "${OCAML_STDLIB_PATH}" CACHE STRING ++ "Install directory for LLVM OCaml packages") + else() + message(STATUS "OCaml bindings disabled, need ctypes >=0.4.") + endif() +Index: cmake/modules/AddOCaml.cmake +=================================================================== +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -193,12 +193,12 @@ + endforeach() + + install(FILES ${install_files} +- DESTINATION lib/ocaml) ++ DESTINATION "${LLVM_OCAML_INSTALL_PATH}/llvm") + install(FILES ${install_shlibs} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE +- DESTINATION lib/ocaml) ++ DESTINATION "${LLVM_OCAML_INSTALL_PATH}/llvm") + + foreach( install_file ${install_files} ${install_shlibs} ) + get_filename_component(filename "${install_file}" NAME) diff --git a/patches/llvm/META.patch.10.0.0 b/patches/llvm/META.patch.10.0.0 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.10.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.11.0.0 b/patches/llvm/META.patch.11.0.0 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.11.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.12.0.1 b/patches/llvm/META.patch.12.0.1 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.12.0.1 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.13.0.0 b/patches/llvm/META.patch.13.0.0 new file mode 100644 index 0000000..5b79ab2 --- /dev/null +++ b/patches/llvm/META.patch.13.0.0 @@ -0,0 +1,199 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index 991bbc0600..a118933875 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,118 +1,148 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "debuginfo" ( + requires = "llvm" +- version = "@PACKAGE_VERSION@" ++ version = "@PACKAGE_VERSION@" + description = "DebugInfo support for LLVM" +- archive(byte) = "llvm_debuginfo.cma" +- archive(native) = "llvm_debuginfo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_debuginfo.cma" ++ archive(native, -llvm.static) = "shared/llvm_debuginfo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_debuginfo.cma" ++ archive(native, llvm.static) = "static/llvm_debuginfo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.14.0.6 b/patches/llvm/META.patch.14.0.6 new file mode 100644 index 0000000..62d17a6 --- /dev/null +++ b/patches/llvm/META.patch.14.0.6 @@ -0,0 +1,199 @@ +diff --git a/llvm/bindings/ocaml/backends/META.llvm_backend.in b/llvm/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/llvm/bindings/ocaml/backends/META.llvm_backend.in ++++ b/llvm/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/llvm/bindings/ocaml/llvm/META.llvm.in b/llvm/bindings/ocaml/llvm/META.llvm.in +index 991bbc0600..a118933875 100644 +--- a/llvm/bindings/ocaml/llvm/META.llvm.in ++++ b/llvm/bindings/ocaml/llvm/META.llvm.in +@@ -1,118 +1,148 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "debuginfo" ( + requires = "llvm" +- version = "@PACKAGE_VERSION@" ++ version = "@PACKAGE_VERSION@" + description = "DebugInfo support for LLVM" +- archive(byte) = "llvm_debuginfo.cma" +- archive(native) = "llvm_debuginfo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_debuginfo.cma" ++ archive(native, -llvm.static) = "shared/llvm_debuginfo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_debuginfo.cma" ++ archive(native, llvm.static) = "static/llvm_debuginfo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.4.0.0 b/patches/llvm/META.patch.4.0.0 new file mode 100644 index 0000000..4c0037b --- /dev/null +++ b/patches/llvm/META.patch.4.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "dynamic/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "dynamic/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "dynamic/llvm.cma" ++archive(native, -llvm.static) = "dynamic/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_analysis.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_ipo.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_irreader.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_target.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_linker.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "dynamic/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "dynamic/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.5.0.0 b/patches/llvm/META.patch.5.0.0 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.5.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.6.0.0 b/patches/llvm/META.patch.6.0.0 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.6.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.7.0.0 b/patches/llvm/META.patch.7.0.0 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.7.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.8.0.0 b/patches/llvm/META.patch.8.0.0 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.8.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/META.patch.9.0.0 b/patches/llvm/META.patch.9.0.0 new file mode 100644 index 0000000..7f4b126 --- /dev/null +++ b/patches/llvm/META.patch.9.0.0 @@ -0,0 +1,186 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,8 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte, -llvm.static) = "shared/llvm_@TARGET@.cma" ++archive(native, -llvm.static) = "shared/llvm_@TARGET@.cmxa" ++archive(byte, llvm.static) = "static/llvm_@TARGET@.cma" ++archive(native, llvm.static) = "static/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..0f54ae1e4b0 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,138 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte, -llvm.static) = "shared/llvm.cma" ++archive(native, -llvm.static) = "shared/llvm.cmxa" ++archive(byte, llvm.static) = "static/llvm.cma" ++archive(native, llvm.static) = "static/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_analysis.cma" ++ archive(native, -llvm.static) = "shared/llvm_analysis.cmxa" ++ archive(byte, llvm.static) = "static/llvm_analysis.cma" ++ archive(native, llvm.static) = "static/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitreader.cma" ++ archive(native, llvm.static) = "static/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_bitwriter.cma" ++ archive(native, -llvm.static) = "shared/llvm_bitwriter.cmxa" ++ archive(byte, llvm.static) = "static/llvm_bitwriter.cma" ++ archive(native, llvm.static) = "static/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_executionengine.cma" ++ archive(native, -llvm.static) = "shared/llvm_executionengine.cmxa" ++ archive(byte, llvm.static) = "static/llvm_executionengine.cma" ++ archive(native, llvm.static) = "static/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_ipo.cma" ++ archive(native, -llvm.static) = "shared/llvm_ipo.cmxa" ++ archive(byte, llvm.static) = "static/llvm_ipo.cma" ++ archive(native, llvm.static) = "static/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_irreader.cma" ++ archive(native, -llvm.static) = "shared/llvm_irreader.cmxa" ++ archive(byte, llvm.static) = "static/llvm_irreader.cma" ++ archive(native, llvm.static) = "static/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_scalar_opts.cma" ++ archive(native, -llvm.static) = "shared/llvm_scalar_opts.cmxa" ++ archive(byte, llvm.static) = "static/llvm_scalar_opts.cma" ++ archive(native, llvm.static) = "static/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_transform_utils.cma" ++ archive(native, -llvm.static) = "shared/llvm_transform_utils.cmxa" ++ archive(byte, llvm.static) = "static/llvm_transform_utils.cma" ++ archive(native, llvm.static) = "static/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_vectorize.cma" ++ archive(native, -llvm.static) = "shared/llvm_vectorize.cmxa" ++ archive(byte, llvm.static) = "static/llvm_vectorize.cma" ++ archive(native, llvm.static) = "static/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_passmgr_builder.cma" ++ archive(native, -llvm.static) = "shared/llvm_passmgr_builder.cmxa" ++ archive(byte, llvm.static) = "static/llvm_passmgr_builder.cma" ++ archive(native, llvm.static) = "static/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_target.cma" ++ archive(native, -llvm.static) = "shared/llvm_target.cmxa" ++ archive(byte, llvm.static) = "static/llvm_target.cma" ++ archive(native, llvm.static) = "static/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_linker.cma" ++ archive(native, -llvm.static) = "shared/llvm_linker.cmxa" ++ archive(byte, llvm.static) = "static/llvm_linker.cma" ++ archive(native, llvm.static) = "static/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte, -llvm.static) = "shared/llvm_all_backends.cma" ++ archive(native, -llvm.static) = "shared/llvm_all_backends.cmxa" ++ archive(byte, llvm.static) = "static/llvm_all_backends.cma" ++ archive(native, llvm.static) = "static/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/add-cmt-for-llvm-13.patch b/patches/llvm/add-cmt-for-llvm-13.patch new file mode 100644 index 0000000..e3b946f --- /dev/null +++ b/patches/llvm/add-cmt-for-llvm-13.patch @@ -0,0 +1,23 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index b27cbd3..d69b1da 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -110,6 +110,8 @@ function(add_ocaml_library name) + list(APPEND ocaml_inputs "${bin}/${ocaml_file}.mli" "${bin}/${ocaml_file}.ml") + + list(APPEND ocaml_outputs "${bin}/${ocaml_file}.cmi" "${bin}/${ocaml_file}.cmo") ++ ++ list(APPEND ocaml_outputs "${bin}/${ocaml_file}.cmti" "${bin}/${ocaml_file}.cmt") + if( HAVE_OCAMLOPT ) + list(APPEND ocaml_outputs + "${bin}/${ocaml_file}.cmx" +@@ -159,7 +161,8 @@ function(add_ocaml_library name) + + add_custom_command( + OUTPUT ${ocaml_outputs} +- COMMAND "${OCAMLFIND}" "ocamlmklib" "-o" "${name}" ${ocaml_flags} ${ocaml_params} ++ COMMAND "${OCAMLFIND}" "ocamlmklib" "-ocamlcflags" "-bin-annot" ++ "-o" "${name}" ${ocaml_flags} ${ocaml_params} + DEPENDS ${ocaml_inputs} ${c_outputs} + COMMENT "Building OCaml library ${name}" + VERBATIM) diff --git a/patches/llvm/build.sh b/patches/llvm/build.sh new file mode 100644 index 0000000..2389807 --- /dev/null +++ b/patches/llvm/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" + +case `"$llvm_config" --shared-mode` in +"shared") + patch -p1 < link.patch;; +"static") + ;; +*) + echo "Error: '$llvm_config' should have returned either shared or static" + exit 1;; +esac + +mkdir build +cd build + +"$cmake" -DLLVM_OCAML_OUT_OF_TREE=TRUE -DLLVM_OCAML_INSTALL_PATH="$libdir" .. diff --git a/patches/llvm/cmake.patch b/patches/llvm/cmake.patch new file mode 100644 index 0000000..a8e4dbb --- /dev/null +++ b/patches/llvm/cmake.patch @@ -0,0 +1,27 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index e3dd1d8..4bcd475 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -170,9 +170,13 @@ function(add_ocaml_library name) + add_dependencies("ocaml_${name}" "ocaml_${ocaml_dep}") + endforeach() + +- foreach( llvm_lib ${llvm_libs} ) +- add_dependencies("ocaml_${name}" "${llvm_lib}") +- endforeach() ++ if( NOT LLVM_OCAML_OUT_OF_TREE ) ++ foreach( llvm_lib ${llvm_libs} ) ++ add_dependencies("ocaml_${name}" "${llvm_lib}") ++ endforeach() ++ endif() ++ ++ add_dependencies("ocaml_all" "ocaml_${name}") + + set(install_files) + set(install_shlibs) +@@ -205,3 +209,5 @@ function(add_ocaml_library name) + VERBATIM) + endforeach() + endfunction() ++ ++add_custom_target("ocaml_all") diff --git a/patches/llvm/compile.sh b/patches/llvm/compile.sh new file mode 100644 index 0000000..1c424af --- /dev/null +++ b/patches/llvm/compile.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +cmd=$1 +version=$2 +make=$3 +prefix=$4 +libdir=$5 + +execute() { + echo "Executing: $@" + "$@" +} + +common_configure() { + execute ./configure CC=gcc CXX=g++ --disable-compiler-version-checks --prefix="$prefix" --disable-doxygen --disable-docs --enable-static "$@" --with-ocaml-libdir="$libdir/llvm" +} + +configure() { + case `uname -s` in + Darwin) + common_configure --disable-shared || exit 1;; + *) + common_configure --enable-shared || exit 1;; + esac +} + +if [ $cmd = "uninstall" ]; then + configure + "$make" -C bindings/ocaml -k uninstall || exit 1 + rm -rf "$libdir/llvm" + exit 0 +elif [ $cmd != "install" ]; then + echo "Fatal error: Do not recognize the command" + exit 1 +fi + +brew_llvm_config=/usr/local/Cellar/llvm/${version}*/bin/llvm-config +if ! stat -t $brew_llvm_config +then + brew_llvm_config= +fi + +version_sans_dot=$(echo $version | tr -d .) +for config in llvm-config-$version llvm-config$version_sans_dot llvm-config-mp-$version $brew_llvm_config llvm-config; do + case `"$config" --version` in + $version|$version.*) + configure + "$make" -C bindings/ocaml build SYSTEM_LLVM_CONFIG="$config" || exit 1 + "$make" -C bindings/ocaml install SYSTEM_LLVM_CONFIG="$config" || exit 1 + cp "$libdir/llvm/META.llvm" "$libdir/llvm/META" || exit 1 + exit 0;; + *) + continue;; + esac +done + +echo "Error: LLVM $version is not installed." +exit 1 diff --git a/patches/llvm/fix-macos.patch.10.0.0 b/patches/llvm/fix-macos.patch.10.0.0 new file mode 100644 index 0000000..4c76a6c --- /dev/null +++ b/patches/llvm/fix-macos.patch.10.0.0 @@ -0,0 +1,30 @@ +From 98ca3c8802d0ae92a5baf34ffdc454d680276845 Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:57 +0000 +Subject: [PATCH 2/2] Fix support for building the OCaml binding on macOS + +The output of ocamlmklib is always .a and .so +--- + llvm/cmake/modules/AddOCaml.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index b7e2ba430344..dc80abcc6e75 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -40,10 +40,10 @@ function(add_ocaml_library name) + set(ocaml_outputs "${bin}/${name}.cma") + if( ARG_C ) + list(APPEND ocaml_outputs +- "${bin}/lib${name}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ "${bin}/lib${name}.a") + if ( BUILD_SHARED_LIBS ) + list(APPEND ocaml_outputs +- "${bin}/dll${name}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ "${bin}/dll${name}.so") + endif() + endif() + if( HAVE_OCAMLOPT ) +-- +2.34.0 + diff --git a/patches/llvm/fix-macos.patch.11.0.0 b/patches/llvm/fix-macos.patch.11.0.0 new file mode 100644 index 0000000..4c76a6c --- /dev/null +++ b/patches/llvm/fix-macos.patch.11.0.0 @@ -0,0 +1,30 @@ +From 98ca3c8802d0ae92a5baf34ffdc454d680276845 Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:57 +0000 +Subject: [PATCH 2/2] Fix support for building the OCaml binding on macOS + +The output of ocamlmklib is always .a and .so +--- + llvm/cmake/modules/AddOCaml.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index b7e2ba430344..dc80abcc6e75 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -40,10 +40,10 @@ function(add_ocaml_library name) + set(ocaml_outputs "${bin}/${name}.cma") + if( ARG_C ) + list(APPEND ocaml_outputs +- "${bin}/lib${name}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ "${bin}/lib${name}.a") + if ( BUILD_SHARED_LIBS ) + list(APPEND ocaml_outputs +- "${bin}/dll${name}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ "${bin}/dll${name}.so") + endif() + endif() + if( HAVE_OCAMLOPT ) +-- +2.34.0 + diff --git a/patches/llvm/fix-macos.patch.12.0.1 b/patches/llvm/fix-macos.patch.12.0.1 new file mode 100644 index 0000000..4c76a6c --- /dev/null +++ b/patches/llvm/fix-macos.patch.12.0.1 @@ -0,0 +1,30 @@ +From 98ca3c8802d0ae92a5baf34ffdc454d680276845 Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:57 +0000 +Subject: [PATCH 2/2] Fix support for building the OCaml binding on macOS + +The output of ocamlmklib is always .a and .so +--- + llvm/cmake/modules/AddOCaml.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index b7e2ba430344..dc80abcc6e75 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -40,10 +40,10 @@ function(add_ocaml_library name) + set(ocaml_outputs "${bin}/${name}.cma") + if( ARG_C ) + list(APPEND ocaml_outputs +- "${bin}/lib${name}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ "${bin}/lib${name}.a") + if ( BUILD_SHARED_LIBS ) + list(APPEND ocaml_outputs +- "${bin}/dll${name}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ "${bin}/dll${name}.so") + endif() + endif() + if( HAVE_OCAMLOPT ) +-- +2.34.0 + diff --git a/patches/llvm/fix-macos.patch.13.0.0 b/patches/llvm/fix-macos.patch.13.0.0 new file mode 100644 index 0000000..4c76a6c --- /dev/null +++ b/patches/llvm/fix-macos.patch.13.0.0 @@ -0,0 +1,30 @@ +From 98ca3c8802d0ae92a5baf34ffdc454d680276845 Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:57 +0000 +Subject: [PATCH 2/2] Fix support for building the OCaml binding on macOS + +The output of ocamlmklib is always .a and .so +--- + llvm/cmake/modules/AddOCaml.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index b7e2ba430344..dc80abcc6e75 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -40,10 +40,10 @@ function(add_ocaml_library name) + set(ocaml_outputs "${bin}/${name}.cma") + if( ARG_C ) + list(APPEND ocaml_outputs +- "${bin}/lib${name}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ "${bin}/lib${name}.a") + if ( BUILD_SHARED_LIBS ) + list(APPEND ocaml_outputs +- "${bin}/dll${name}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ "${bin}/dll${name}.so") + endif() + endif() + if( HAVE_OCAMLOPT ) +-- +2.34.0 + diff --git a/patches/llvm/fix-macos.patch.14.0.6 b/patches/llvm/fix-macos.patch.14.0.6 new file mode 100644 index 0000000..b2b59ee --- /dev/null +++ b/patches/llvm/fix-macos.patch.14.0.6 @@ -0,0 +1,30 @@ +From 98ca3c8802d0ae92a5baf34ffdc454d680276845 Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:57 +0000 +Subject: [PATCH 2/2] Fix support for building the OCaml binding on macOS + +The output of ocamlmklib is always .a and .so +--- + llvm-project/llvm/cmake/modules/AddOCaml.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/llvm-project/llvm/cmake/modules/AddOCaml.cmake b/llvm-project/llvm/cmake/modules/AddOCaml.cmake +index b7e2ba430344..dc80abcc6e75 100644 +--- a/llvm/cmake/modules/AddOCaml.cmake ++++ b/llvm/cmake/modules/AddOCaml.cmake +@@ -40,10 +40,10 @@ function(add_ocaml_library name) + set(ocaml_outputs "${bin}/${name}.cma") + if( ARG_C ) + list(APPEND ocaml_outputs +- "${bin}/lib${name}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ "${bin}/lib${name}.a") + if ( BUILD_SHARED_LIBS ) + list(APPEND ocaml_outputs +- "${bin}/dll${name}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ "${bin}/dll${name}.so") + endif() + endif() + if( HAVE_OCAMLOPT ) +-- +2.34.0 + diff --git a/patches/llvm/fix-rhel.patch.10.0.0 b/patches/llvm/fix-rhel.patch.10.0.0 new file mode 100644 index 0000000..d224fdd --- /dev/null +++ b/patches/llvm/fix-rhel.patch.10.0.0 @@ -0,0 +1,45 @@ +From 58e8402f9000d0dfe67b3df99ed8cd21b8325acd Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sun, 26 Dec 2021 05:09:10 +0000 +Subject: [PATCH] Handle RHEL-based distributions (do not have + libLLVM-.so, only libLLVM.so) + +--- + llvm/cmake/modules/AddOCaml.cmake | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index dc80abcc6e75..f51a339f084b 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -66,20 +66,22 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-custom") + endif() + ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() ++ + if(LLVM_LINK_LLVM_DYLIB) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- if( BUILD_SHARED_LIBS ) +- list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ ++ if(BUILD_SHARED_LIBS AND LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags ${LLVM_OCAML_EXTERNAL_LLVM_LIBS}) + else() + foreach( llvm_lib ${llvm_libs} ) + list(APPEND ocaml_flags "-l${llvm_lib}" ) + endforeach() + endif() +- if(LLVM_OCAML_OUT_OF_TREE) +- list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) +- endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-rhel.patch.11.0.0 b/patches/llvm/fix-rhel.patch.11.0.0 new file mode 100644 index 0000000..d224fdd --- /dev/null +++ b/patches/llvm/fix-rhel.patch.11.0.0 @@ -0,0 +1,45 @@ +From 58e8402f9000d0dfe67b3df99ed8cd21b8325acd Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sun, 26 Dec 2021 05:09:10 +0000 +Subject: [PATCH] Handle RHEL-based distributions (do not have + libLLVM-.so, only libLLVM.so) + +--- + llvm/cmake/modules/AddOCaml.cmake | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index dc80abcc6e75..f51a339f084b 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -66,20 +66,22 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-custom") + endif() + ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() ++ + if(LLVM_LINK_LLVM_DYLIB) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- if( BUILD_SHARED_LIBS ) +- list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ ++ if(BUILD_SHARED_LIBS AND LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags ${LLVM_OCAML_EXTERNAL_LLVM_LIBS}) + else() + foreach( llvm_lib ${llvm_libs} ) + list(APPEND ocaml_flags "-l${llvm_lib}" ) + endforeach() + endif() +- if(LLVM_OCAML_OUT_OF_TREE) +- list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) +- endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-rhel.patch.12.0.1 b/patches/llvm/fix-rhel.patch.12.0.1 new file mode 100644 index 0000000..d224fdd --- /dev/null +++ b/patches/llvm/fix-rhel.patch.12.0.1 @@ -0,0 +1,45 @@ +From 58e8402f9000d0dfe67b3df99ed8cd21b8325acd Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sun, 26 Dec 2021 05:09:10 +0000 +Subject: [PATCH] Handle RHEL-based distributions (do not have + libLLVM-.so, only libLLVM.so) + +--- + llvm/cmake/modules/AddOCaml.cmake | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index dc80abcc6e75..f51a339f084b 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -66,20 +66,22 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-custom") + endif() + ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() ++ + if(LLVM_LINK_LLVM_DYLIB) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- if( BUILD_SHARED_LIBS ) +- list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ ++ if(BUILD_SHARED_LIBS AND LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags ${LLVM_OCAML_EXTERNAL_LLVM_LIBS}) + else() + foreach( llvm_lib ${llvm_libs} ) + list(APPEND ocaml_flags "-l${llvm_lib}" ) + endforeach() + endif() +- if(LLVM_OCAML_OUT_OF_TREE) +- list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) +- endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-rhel.patch.13.0.0 b/patches/llvm/fix-rhel.patch.13.0.0 new file mode 100644 index 0000000..d224fdd --- /dev/null +++ b/patches/llvm/fix-rhel.patch.13.0.0 @@ -0,0 +1,45 @@ +From 58e8402f9000d0dfe67b3df99ed8cd21b8325acd Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sun, 26 Dec 2021 05:09:10 +0000 +Subject: [PATCH] Handle RHEL-based distributions (do not have + libLLVM-.so, only libLLVM.so) + +--- + llvm/cmake/modules/AddOCaml.cmake | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index dc80abcc6e75..f51a339f084b 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -66,20 +66,22 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-custom") + endif() + ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() ++ + if(LLVM_LINK_LLVM_DYLIB) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- if( BUILD_SHARED_LIBS ) +- list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ ++ if(BUILD_SHARED_LIBS AND LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags ${LLVM_OCAML_EXTERNAL_LLVM_LIBS}) + else() + foreach( llvm_lib ${llvm_libs} ) + list(APPEND ocaml_flags "-l${llvm_lib}" ) + endforeach() + endif() +- if(LLVM_OCAML_OUT_OF_TREE) +- list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) +- endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-rhel.patch.14.0.6 b/patches/llvm/fix-rhel.patch.14.0.6 new file mode 100644 index 0000000..e603d6e --- /dev/null +++ b/patches/llvm/fix-rhel.patch.14.0.6 @@ -0,0 +1,45 @@ +From 58e8402f9000d0dfe67b3df99ed8cd21b8325acd Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sun, 26 Dec 2021 05:09:10 +0000 +Subject: [PATCH] Handle RHEL-based distributions (do not have + libLLVM-.so, only libLLVM.so) + +--- + llvm/cmake/modules/AddOCaml.cmake | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index dc80abcc6e75..f51a339f084b 100644 +--- a/llvm/cmake/modules/AddOCaml.cmake ++++ b/llvm/cmake/modules/AddOCaml.cmake +@@ -66,20 +66,22 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-custom") + endif() + ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() ++ + if(LLVM_LINK_LLVM_DYLIB) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- if( BUILD_SHARED_LIBS ) +- list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ ++ if(BUILD_SHARED_LIBS AND LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags ${LLVM_OCAML_EXTERNAL_LLVM_LIBS}) + else() + foreach( llvm_lib ${llvm_libs} ) + list(APPEND ocaml_flags "-l${llvm_lib}" ) + endforeach() + endif() +- if(LLVM_OCAML_OUT_OF_TREE) +- list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) +- endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-shared.patch.10.0.0 b/patches/llvm/fix-shared.patch.10.0.0 new file mode 100644 index 0000000..3bf086f --- /dev/null +++ b/patches/llvm/fix-shared.patch.10.0.0 @@ -0,0 +1,37 @@ +From 7eaf48ca7f0b2ba0b5871b48fbe4a1b1460afbef Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:00 +0000 +Subject: [PATCH 1/2] Add support for out-of-tree shared linked OCaml LLVM + binding + +--- + llvm/cmake/modules/AddOCaml.cmake | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index 891c9e6d618c..b7e2ba430344 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -70,9 +70,16 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-shared.patch.11.0.0 b/patches/llvm/fix-shared.patch.11.0.0 new file mode 100644 index 0000000..3bf086f --- /dev/null +++ b/patches/llvm/fix-shared.patch.11.0.0 @@ -0,0 +1,37 @@ +From 7eaf48ca7f0b2ba0b5871b48fbe4a1b1460afbef Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:00 +0000 +Subject: [PATCH 1/2] Add support for out-of-tree shared linked OCaml LLVM + binding + +--- + llvm/cmake/modules/AddOCaml.cmake | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index 891c9e6d618c..b7e2ba430344 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -70,9 +70,16 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-shared.patch.12.0.1 b/patches/llvm/fix-shared.patch.12.0.1 new file mode 100644 index 0000000..3bf086f --- /dev/null +++ b/patches/llvm/fix-shared.patch.12.0.1 @@ -0,0 +1,37 @@ +From 7eaf48ca7f0b2ba0b5871b48fbe4a1b1460afbef Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:00 +0000 +Subject: [PATCH 1/2] Add support for out-of-tree shared linked OCaml LLVM + binding + +--- + llvm/cmake/modules/AddOCaml.cmake | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index 891c9e6d618c..b7e2ba430344 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -70,9 +70,16 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-shared.patch.13.0.0 b/patches/llvm/fix-shared.patch.13.0.0 new file mode 100644 index 0000000..3bf086f --- /dev/null +++ b/patches/llvm/fix-shared.patch.13.0.0 @@ -0,0 +1,37 @@ +From 7eaf48ca7f0b2ba0b5871b48fbe4a1b1460afbef Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:00 +0000 +Subject: [PATCH 1/2] Add support for out-of-tree shared linked OCaml LLVM + binding + +--- + llvm/cmake/modules/AddOCaml.cmake | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index 891c9e6d618c..b7e2ba430344 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -70,9 +70,16 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-shared.patch.14.0.6 b/patches/llvm/fix-shared.patch.14.0.6 new file mode 100644 index 0000000..1025055 --- /dev/null +++ b/patches/llvm/fix-shared.patch.14.0.6 @@ -0,0 +1,37 @@ +From 7eaf48ca7f0b2ba0b5871b48fbe4a1b1460afbef Mon Sep 17 00:00:00 2001 +From: Kate +Date: Sat, 25 Dec 2021 18:21:00 +0000 +Subject: [PATCH 1/2] Add support for out-of-tree shared linked OCaml LLVM + binding + +--- + llvm/cmake/modules/AddOCaml.cmake | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake +index 891c9e6d618c..b7e2ba430344 100644 +--- a/llvm/cmake/modules/AddOCaml.cmake ++++ b/llvm/cmake/modules/AddOCaml.cmake +@@ -70,9 +70,16 @@ function(add_ocaml_library name) + list(APPEND ocaml_flags "-lLLVM") + else() + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) +-- +2.34.0 + diff --git a/patches/llvm/fix-shared.patch.5.0.0 b/patches/llvm/fix-shared.patch.5.0.0 new file mode 100644 index 0000000..12f2000 --- /dev/null +++ b/patches/llvm/fix-shared.patch.5.0.0 @@ -0,0 +1,25 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 1d8094cc505..ab4b72edc02 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -67,9 +67,17 @@ function(add_ocaml_library name) + endif() + + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-ccopt" "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) diff --git a/patches/llvm/fix-shared.patch.6.0.0 b/patches/llvm/fix-shared.patch.6.0.0 new file mode 100644 index 0000000..12f2000 --- /dev/null +++ b/patches/llvm/fix-shared.patch.6.0.0 @@ -0,0 +1,25 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 1d8094cc505..ab4b72edc02 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -67,9 +67,17 @@ function(add_ocaml_library name) + endif() + + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-ccopt" "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) diff --git a/patches/llvm/fix-shared.patch.7.0.0 b/patches/llvm/fix-shared.patch.7.0.0 new file mode 100644 index 0000000..64e3691 --- /dev/null +++ b/patches/llvm/fix-shared.patch.7.0.0 @@ -0,0 +1,25 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 1d8094cc505..ab4b72edc02 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -67,9 +67,17 @@ function(add_ocaml_library name) + endif() + + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-ccopt" "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) diff --git a/patches/llvm/fix-shared.patch.8.0.0 b/patches/llvm/fix-shared.patch.8.0.0 new file mode 100644 index 0000000..64e3691 --- /dev/null +++ b/patches/llvm/fix-shared.patch.8.0.0 @@ -0,0 +1,25 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 1d8094cc505..ab4b72edc02 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -67,9 +67,17 @@ function(add_ocaml_library name) + endif() + + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-ccopt" "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) diff --git a/patches/llvm/fix-shared.patch.9.0.0 b/patches/llvm/fix-shared.patch.9.0.0 new file mode 100644 index 0000000..64e3691 --- /dev/null +++ b/patches/llvm/fix-shared.patch.9.0.0 @@ -0,0 +1,25 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 1d8094cc505..ab4b72edc02 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -67,9 +67,17 @@ function(add_ocaml_library name) + endif() + + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ if( BUILD_SHARED_LIBS ) ++ list(APPEND ocaml_flags "-lLLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}") ++ else() ++ foreach( llvm_lib ${llvm_libs} ) ++ list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ endforeach() ++ endif() ++ ++ if(LLVM_OCAML_OUT_OF_TREE) ++ list(APPEND ocaml_flags "-ccopt" "-L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}" ) ++ endif() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + foreach(system_lib ${system_libs}) diff --git a/patches/llvm/install.sh.10.0.0 b/patches/llvm/install.sh.10.0.0 new file mode 100644 index 0000000..d267a5d --- /dev/null +++ b/patches/llvm/install.sh.10.0.0 @@ -0,0 +1,71 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" +action="$5" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | xargs +} + +function llvm_build { + mkdir "build-$1" + cd "build-$1" + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBS="`"$llvm_config" --libs`" \ + .. + $make ocaml_all + + cd .. +} + +function llvm_install { + if test -d "build-$1"; then + cd "build-$1" + + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + fi +} + +case "$action" in +"build") + if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_build static + llvm_build shared + elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_build static + elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_build shared + else + echo "Link mode not recognized" + exit 1 + fi + ;; +"install") + llvm_install static + llvm_install shared + ;; +*) + echo "Action not recognized" + exit 1 + ;; +esac diff --git a/patches/llvm/install.sh.11.0.0 b/patches/llvm/install.sh.11.0.0 new file mode 100644 index 0000000..d267a5d --- /dev/null +++ b/patches/llvm/install.sh.11.0.0 @@ -0,0 +1,71 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" +action="$5" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | xargs +} + +function llvm_build { + mkdir "build-$1" + cd "build-$1" + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBS="`"$llvm_config" --libs`" \ + .. + $make ocaml_all + + cd .. +} + +function llvm_install { + if test -d "build-$1"; then + cd "build-$1" + + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + fi +} + +case "$action" in +"build") + if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_build static + llvm_build shared + elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_build static + elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_build shared + else + echo "Link mode not recognized" + exit 1 + fi + ;; +"install") + llvm_install static + llvm_install shared + ;; +*) + echo "Action not recognized" + exit 1 + ;; +esac diff --git a/patches/llvm/install.sh.12.0.1 b/patches/llvm/install.sh.12.0.1 new file mode 100644 index 0000000..d267a5d --- /dev/null +++ b/patches/llvm/install.sh.12.0.1 @@ -0,0 +1,71 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" +action="$5" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | xargs +} + +function llvm_build { + mkdir "build-$1" + cd "build-$1" + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBS="`"$llvm_config" --libs`" \ + .. + $make ocaml_all + + cd .. +} + +function llvm_install { + if test -d "build-$1"; then + cd "build-$1" + + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + fi +} + +case "$action" in +"build") + if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_build static + llvm_build shared + elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_build static + elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_build shared + else + echo "Link mode not recognized" + exit 1 + fi + ;; +"install") + llvm_install static + llvm_install shared + ;; +*) + echo "Action not recognized" + exit 1 + ;; +esac diff --git a/patches/llvm/install.sh.13.0.0 b/patches/llvm/install.sh.13.0.0 new file mode 100644 index 0000000..50e0193 --- /dev/null +++ b/patches/llvm/install.sh.13.0.0 @@ -0,0 +1,71 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" +action="$5" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/M68k//g' | sed 's/Nios2//g' | xargs +} + +function llvm_build { + mkdir "build-$1" + cd "build-$1" + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBS="`"$llvm_config" --libs`" \ + .. + $make ocaml_all + + cd .. +} + +function llvm_install { + if test -d "build-$1"; then + cd "build-$1" + + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + fi +} + +case "$action" in +"build") + if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_build static + llvm_build shared + elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_build static + elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_build shared + else + echo "Link mode not recognized" + exit 1 + fi + ;; +"install") + llvm_install static + llvm_install shared + ;; +*) + echo "Action not recognized" + exit 1 + ;; +esac diff --git a/patches/llvm/install.sh.14.0.6 b/patches/llvm/install.sh.14.0.6 new file mode 100644 index 0000000..9edbece --- /dev/null +++ b/patches/llvm/install.sh.14.0.6 @@ -0,0 +1,78 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" +action="$5" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/M68k//g' | sed 's/Nios2//g' | xargs +} + +function llvm_build { + cd llvm + + # Copy the required Common LLVM CMake modules to the source tree + cp ../cmake/Modules/* cmake/ + + mkdir "build-$1" + cd "build-$1" + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBS="`"$llvm_config" --libs`" \ + .. + $make ocaml_all + + cd ../.. +} + +function llvm_install { + cd llvm + if test -d "build-$1"; then + cd "build-$1" + + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + fi + cd .. +} + +case "$action" in +"build") + if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_build static + llvm_build shared + elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_build static + elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_build shared + else + echo "Link mode not recognized" + exit 1 + fi + ;; +"install") + llvm_install static + llvm_install shared + ;; +*) + echo "Action not recognized" + exit 1 + ;; +esac diff --git a/patches/llvm/install.sh.3.6 b/patches/llvm/install.sh.3.6 new file mode 100644 index 0000000..aec6ffe --- /dev/null +++ b/patches/llvm/install.sh.3.6 @@ -0,0 +1,49 @@ +#!/bin/bash -ex + +version=$1 +make=$2 +prefix=$3 +libdir=$4 + +common_configure() { + ./configure CC=gcc CXX=g++ --disable-compiler-version-checks --prefix="$prefix" \ + --disable-doxygen --disable-docs --with-ocaml-libdir="$libdir/llvm" \ + --enable-static "$@" +} + +configure() { + case `uname -s` in + Darwin) + common_configure --disable-shared;; + *) + common_configure --enable-shared;; + esac +} + +brew_llvm_config=/usr/local/Cellar/llvm/${version}*/bin/llvm-config +if ! stat -t $brew_llvm_config; then + brew_llvm_config= +fi + +shopt -s nullglob + +version_sans_dot=$(echo $version | tr -d .) +for config in llvm-config-$version llvm-config$version_sans_dot llvm-config-mp-$version $brew_llvm_config llvm-config; do + case `$config --version` in + $version|$version.*) + configure + $make -C bindings/ocaml all SYSTEM_LLVM_CONFIG=$config + $make -C bindings/ocaml install SYSTEM_LLVM_CONFIG=$config + mv "$libdir/llvm/META.llvm" "$libdir/llvm/META" + for stublib in $libdir/llvm/dll*.so; do + mv "$stublib" "$libdir/stublibs/" + echo llvm >"$libdir/stublibs/$(basename $stublib).owner" + done + exit 0;; + *) + continue;; + esac +done + +echo "Error: LLVM $version is not installed." +exit 1 diff --git a/patches/llvm/install.sh.3.7 b/patches/llvm/install.sh.3.7 new file mode 100644 index 0000000..f619621 --- /dev/null +++ b/patches/llvm/install.sh.3.7 @@ -0,0 +1,51 @@ +#!/bin/bash -ex + +version=$1 +make=$2 +prefix=$3 +libdir=$4 + +common_configure() { + ../configure CC=gcc CXX=g++ --disable-compiler-version-checks --prefix="$prefix" \ + --disable-doxygen --disable-docs --with-ocaml-libdir="$libdir/llvm" \ + --enable-static "$@" +} + +configure() { + case `uname -s` in + Darwin) + common_configure --disable-shared;; + *) + common_configure --enable-shared;; + esac +} + +brew_llvm_config=/usr/local/Cellar/llvm/${version}*/bin/llvm-config +if ! stat -t $brew_llvm_config; then + brew_llvm_config= +fi + +shopt -s nullglob + +version_sans_dot=$(echo $version | tr -d .) +for config in llvm-config-$version llvm-config$version_sans_dot llvm-config-mp-$version $brew_llvm_config llvm-config; do + case `$config --version` in + $version|$version.*) + mkdir build + cd build + configure + $make -C bindings all SYSTEM_LLVM_CONFIG=$config + $make -C bindings install SYSTEM_LLVM_CONFIG=$config + mv "$libdir/llvm/META.llvm" "$libdir/llvm/META" + for stublib in $libdir/llvm/dll*.so; do + mv "$stublib" "$libdir/stublibs/" + echo llvm >"$libdir/stublibs/$(basename $stublib).owner" + done + exit 0;; + *) + continue;; + esac +done + +echo "Error: LLVM $version is not installed." +exit 1 diff --git a/patches/llvm/install.sh.3.8 b/patches/llvm/install.sh.3.8 new file mode 100644 index 0000000..ce66bbe --- /dev/null +++ b/patches/llvm/install.sh.3.8 @@ -0,0 +1,36 @@ +#!/bin/bash -ex + +llvm_config="$1" +make="$2" +prefix="$3" +libdir="$4" + +common_configure() { + ../configure CC=gcc CXX=g++ --disable-compiler-version-checks --prefix="$prefix" \ + --disable-doxygen --disable-docs --with-ocaml-libdir="$libdir/llvm" \ + --enable-static --with-python="`command -v python2.7`" "$@" +} + +configure() { + case `uname -s` in + Darwin) + common_configure --disable-shared;; + *) + common_configure --enable-shared;; + esac +} + +mkdir build +cd build + +configure + +"$make" -C bindings all SYSTEM_LLVM_CONFIG="$llvm_config" +"$make" -C bindings install SYSTEM_LLVM_CONFIG="$llvm_config" + +mv "$libdir/llvm/META.llvm" "$libdir/llvm/META" +shopt -s nullglob +for stublib in $libdir/llvm/dll*.so; do + mv "$stublib" "$libdir/stublibs/" + echo llvm > "$libdir/stublibs/$(basename $stublib).owner" +done diff --git a/patches/llvm/install.sh.4.0.0 b/patches/llvm/install.sh.4.0.0 new file mode 100644 index 0000000..461c3b4 --- /dev/null +++ b/patches/llvm/install.sh.4.0.0 @@ -0,0 +1,63 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" + +function llvm_save { + cp cmake/modules/AddOCaml.cmake AddOCaml.cmake.save +} + +function llvm_restore { + cp AddOCaml.cmake.save cmake/modules/AddOCaml.cmake +} + +function llvm_link_patch { + llvm_libdir=$("$1" --libdir) + llvm_libs=$("$1" --link-$2 --libs) + + sed -i.bak "s,%%LIBDIR%%,${llvm_libdir}," link.patch + sed -i.bak "s,%%LIBS%%,${llvm_libs}," link.patch + + patch -p1 < link.patch +} + +function llvm_install { + llvm_link_patch "$2" $3 + + mkdir build + cd build + + "$cmake" -DLLVM_OCAML_OUT_OF_TREE=TRUE -DLLVM_OCAML_INSTALL_PATH="${libdir}" .. + make ocaml_all + make -C bindings/ocaml install/fast + + cd .. + + mkdir "${libdir}"/llvm/$1 + cp "${libdir}"/llvm/*.a "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + + rm -rf build + + llvm_restore +} + +llvm_save +if $llvm_config --link-static --libs && $llvm_config --link-shared --libs; then + patch -p1 < META.patch + llvm_install static "${llvm_config}" static + llvm_install dynamic "${llvm_config}" shared +elif $llvm_config --link-static --libs; then + sed -i.bak "s,%%LINKAGE%%,static," link-META.patch + patch -p1 < link-META.patch + llvm_install static "${llvm_config}" static +elif $llvm_config --link-shared --libs; then + sed -i.bak "s,%%LINKAGE%%,dynamic," link-META.patch + patch -p1 < link-META.patch + llvm_install dynamic "${llvm_config}" shared +else + echo "WTF..." + exit 1 +fi diff --git a/patches/llvm/install.sh.5.0.0 b/patches/llvm/install.sh.5.0.0 new file mode 100644 index 0000000..bffdce5 --- /dev/null +++ b/patches/llvm/install.sh.5.0.0 @@ -0,0 +1,49 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | sed 's/WebAssembly//g' | xargs +} + +function llvm_install { + mkdir build + cd build + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + .. + $make ocaml_all + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + rm -rf build +} + +if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_install static + llvm_install shared +elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_install static +elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_install shared +else + echo "WTF..." + exit 1 +fi diff --git a/patches/llvm/install.sh.6.0.0 b/patches/llvm/install.sh.6.0.0 new file mode 100644 index 0000000..bffdce5 --- /dev/null +++ b/patches/llvm/install.sh.6.0.0 @@ -0,0 +1,49 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | sed 's/WebAssembly//g' | xargs +} + +function llvm_install { + mkdir build + cd build + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + .. + $make ocaml_all + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + rm -rf build +} + +if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_install static + llvm_install shared +elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_install static +elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_install shared +else + echo "WTF..." + exit 1 +fi diff --git a/patches/llvm/install.sh.7.0.0 b/patches/llvm/install.sh.7.0.0 new file mode 100644 index 0000000..bffdce5 --- /dev/null +++ b/patches/llvm/install.sh.7.0.0 @@ -0,0 +1,49 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | sed 's/WebAssembly//g' | xargs +} + +function llvm_install { + mkdir build + cd build + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + .. + $make ocaml_all + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + rm -rf build +} + +if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_install static + llvm_install shared +elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_install static +elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_install shared +else + echo "WTF..." + exit 1 +fi diff --git a/patches/llvm/install.sh.8.0.0 b/patches/llvm/install.sh.8.0.0 new file mode 100644 index 0000000..60e4b1b --- /dev/null +++ b/patches/llvm/install.sh.8.0.0 @@ -0,0 +1,49 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | xargs +} + +function llvm_install { + mkdir build + cd build + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + .. + $make ocaml_all + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + rm -rf build +} + +if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_install static + llvm_install shared +elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_install static +elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_install shared +else + echo "WTF..." + exit 1 +fi diff --git a/patches/llvm/install.sh.9.0.0 b/patches/llvm/install.sh.9.0.0 new file mode 100644 index 0000000..60e4b1b --- /dev/null +++ b/patches/llvm/install.sh.9.0.0 @@ -0,0 +1,49 @@ +#!/bin/bash -ex + +llvm_config="$1" +libdir="$2" +cmake="$3" +make="$4" + +function filter_experimental_targets { + sed 's/AVR//g' | sed 's/Nios2//g' | xargs +} + +function llvm_install { + mkdir build + cd build + + "$cmake" \ + -DCMAKE_BUILD_TYPE="`"$llvm_config" --build-mode`" \ + -DLLVM_TARGETS_TO_BUILD="`"$llvm_config" --targets-built | filter_experimental_targets | sed 's/ /;/g'`" \ + -DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="`"$llvm_config" --libdir`" \ + -DBUILD_SHARED_LIBS=`[ $1 = "shared" ] && echo TRUE || echo FALSE` \ + -DLLVM_OCAML_OUT_OF_TREE=TRUE \ + -DLLVM_OCAML_INSTALL_PATH="${libdir}" \ + .. + $make ocaml_all + "$cmake" -P bindings/ocaml/cmake_install.cmake + + mkdir "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cma "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/*.cmxa "${libdir}"/llvm/$1 + mv "${libdir}"/llvm/llvm*.a "${libdir}"/llvm/$1 + + cd .. + rm -rf build +} + +if "$llvm_config" --link-static --libs && "$llvm_config" --link-shared --libs; then + patch -p1 < META.patch + llvm_install static + llvm_install shared +elif "$llvm_config" --link-static --libs; then + sed "s,%%LINKAGE%%,static," link-META.patch | patch -p1 + llvm_install static +elif "$llvm_config" --link-shared --libs; then + sed "s,%%LINKAGE%%,shared," link-META.patch | patch -p1 + llvm_install shared +else + echo "WTF..." + exit 1 +fi diff --git a/patches/llvm/link-META.patch.10.0.0 b/patches/llvm/link-META.patch.10.0.0 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.10.0.0 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.11.0.0 b/patches/llvm/link-META.patch.11.0.0 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.11.0.0 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.12.0.1 b/patches/llvm/link-META.patch.12.0.1 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.12.0.1 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.13.0.0 b/patches/llvm/link-META.patch.13.0.0 new file mode 100644 index 0000000..a72f655 --- /dev/null +++ b/patches/llvm/link-META.patch.13.0.0 @@ -0,0 +1,166 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index 991bbc0600..255be6dfa3 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,118 +1,118 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "debuginfo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "DebugInfo support for LLVM" +- archive(byte) = "llvm_debuginfo.cma" +- archive(native) = "llvm_debuginfo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_debuginfo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_debuginfo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.14.0.6 b/patches/llvm/link-META.patch.14.0.6 new file mode 100644 index 0000000..0ded7db --- /dev/null +++ b/patches/llvm/link-META.patch.14.0.6 @@ -0,0 +1,166 @@ +diff --git a/llvm/bindings/ocaml/backends/META.llvm_backend.in b/llvm/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/llvm/bindings/ocaml/backends/META.llvm_backend.in ++++ b/llvm/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/llvm/bindings/ocaml/llvm/META.llvm.in b/llvm/bindings/ocaml/llvm/META.llvm.in +index 991bbc0600..255be6dfa3 100644 +--- a/llvm/bindings/ocaml/llvm/META.llvm.in ++++ b/llvm/bindings/ocaml/llvm/META.llvm.in +@@ -1,118 +1,118 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "debuginfo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "DebugInfo support for LLVM" +- archive(byte) = "llvm_debuginfo.cma" +- archive(native) = "llvm_debuginfo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_debuginfo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_debuginfo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.4.0.0 b/patches/llvm/link-META.patch.4.0.0 new file mode 100644 index 0000000..7786ac6 --- /dev/null +++ b/patches/llvm/link-META.patch.4.0.0 @@ -0,0 +1,143 @@ +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.5.0.0 b/patches/llvm/link-META.patch.5.0.0 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.5.0.0 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.6.0.0 b/patches/llvm/link-META.patch.6.0.0 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.6.0.0 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.7.0.0 b/patches/llvm/link-META.patch.7.0.0 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.7.0.0 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.8.0.0 b/patches/llvm/link-META.patch.8.0.0 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.8.0.0 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link-META.patch.9.0.0 b/patches/llvm/link-META.patch.9.0.0 new file mode 100644 index 0000000..a741f1c --- /dev/null +++ b/patches/llvm/link-META.patch.9.0.0 @@ -0,0 +1,156 @@ +diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in +index bd23abe0ca4..053e7a4f2e8 100644 +--- a/bindings/ocaml/backends/META.llvm_backend.in ++++ b/bindings/ocaml/backends/META.llvm_backend.in +@@ -2,6 +2,6 @@ name = "llvm_@TARGET@" + version = "@PACKAGE_VERSION@" + description = "@TARGET@ Backend for LLVM" + requires = "llvm" +-archive(byte) = "llvm_@TARGET@.cma" +-archive(native) = "llvm_@TARGET@.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm_@TARGET@.cma" ++archive(native) = "%%LINKAGE%%/llvm_@TARGET@.cmxa" + directory = "llvm" +diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in +index adafd788ebf..01ff313e426 100644 +--- a/bindings/ocaml/llvm/META.llvm.in ++++ b/bindings/ocaml/llvm/META.llvm.in +@@ -1,110 +1,110 @@ + name = "llvm" + version = "@PACKAGE_VERSION@" + description = "LLVM OCaml bindings" +-archive(byte) = "llvm.cma" +-archive(native) = "llvm.cmxa" ++archive(byte) = "%%LINKAGE%%/llvm.cma" ++archive(native) = "%%LINKAGE%%/llvm.cmxa" + directory = "llvm" + + package "analysis" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate representation analysis for LLVM" +- archive(byte) = "llvm_analysis.cma" +- archive(native) = "llvm_analysis.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_analysis.cma" ++ archive(native) = "%%LINKAGE%%/llvm_analysis.cmxa" + ) + + package "bitreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Bitcode reader for LLVM" +- archive(byte) = "llvm_bitreader.cma" +- archive(native) = "llvm_bitreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitreader.cmxa" + ) + + package "bitwriter" ( + requires = "llvm,unix" + version = "@PACKAGE_VERSION@" + description = "Bitcode writer for LLVM" +- archive(byte) = "llvm_bitwriter.cma" +- archive(native) = "llvm_bitwriter.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_bitwriter.cma" ++ archive(native) = "%%LINKAGE%%/llvm_bitwriter.cmxa" + ) + + package "executionengine" ( + requires = "llvm,llvm.target,ctypes.foreign" + version = "@PACKAGE_VERSION@" + description = "JIT and Interpreter for LLVM" +- archive(byte) = "llvm_executionengine.cma" +- archive(native) = "llvm_executionengine.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_executionengine.cma" ++ archive(native) = "%%LINKAGE%%/llvm_executionengine.cmxa" + ) + + package "ipo" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IPO Transforms for LLVM" +- archive(byte) = "llvm_ipo.cma" +- archive(native) = "llvm_ipo.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_ipo.cma" ++ archive(native) = "%%LINKAGE%%/llvm_ipo.cmxa" + ) + + package "irreader" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "IR assembly reader for LLVM" +- archive(byte) = "llvm_irreader.cma" +- archive(native) = "llvm_irreader.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_irreader.cma" ++ archive(native) = "%%LINKAGE%%/llvm_irreader.cmxa" + ) + + package "scalar_opts" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Scalar Transforms for LLVM" +- archive(byte) = "llvm_scalar_opts.cma" +- archive(native) = "llvm_scalar_opts.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_scalar_opts.cma" ++ archive(native) = "%%LINKAGE%%/llvm_scalar_opts.cmxa" + ) + + package "transform_utils" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Transform utilities for LLVM" +- archive(byte) = "llvm_transform_utils.cma" +- archive(native) = "llvm_transform_utils.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_transform_utils.cma" ++ archive(native) = "%%LINKAGE%%/llvm_transform_utils.cmxa" + ) + + package "vectorize" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Vector Transforms for LLVM" +- archive(byte) = "llvm_vectorize.cma" +- archive(native) = "llvm_vectorize.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_vectorize.cma" ++ archive(native) = "%%LINKAGE%%/llvm_vectorize.cmxa" + ) + + package "passmgr_builder" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Pass Manager Builder for LLVM" +- archive(byte) = "llvm_passmgr_builder.cma" +- archive(native) = "llvm_passmgr_builder.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_passmgr_builder.cma" ++ archive(native) = "%%LINKAGE%%/llvm_passmgr_builder.cmxa" + ) + + package "target" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Target Information for LLVM" +- archive(byte) = "llvm_target.cma" +- archive(native) = "llvm_target.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_target.cma" ++ archive(native) = "%%LINKAGE%%/llvm_target.cmxa" + ) + + package "linker" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "Intermediate Representation Linker for LLVM" +- archive(byte) = "llvm_linker.cma" +- archive(native) = "llvm_linker.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_linker.cma" ++ archive(native) = "%%LINKAGE%%/llvm_linker.cmxa" + ) + + package "all_backends" ( + requires = "llvm" + version = "@PACKAGE_VERSION@" + description = "All backends for LLVM" +- archive(byte) = "llvm_all_backends.cma" +- archive(native) = "llvm_all_backends.cmxa" ++ archive(byte) = "%%LINKAGE%%/llvm_all_backends.cma" ++ archive(native) = "%%LINKAGE%%/llvm_all_backends.cmxa" + ) diff --git a/patches/llvm/link.patch.3.9 b/patches/llvm/link.patch.3.9 new file mode 100644 index 0000000..d612540 --- /dev/null +++ b/patches/llvm/link.patch.3.9 @@ -0,0 +1,13 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index e3dd1d8..eb3c4a2 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -68,7 +68,7 @@ function(add_ocaml_library name) + + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) + foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) ++ list(APPEND ocaml_flags "-lLLVM-3.9" ) + endforeach() + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) diff --git a/patches/llvm/link.patch.4.0.0 b/patches/llvm/link.patch.4.0.0 new file mode 100644 index 0000000..8d26423 --- /dev/null +++ b/patches/llvm/link.patch.4.0.0 @@ -0,0 +1,14 @@ +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index e3dd1d8..eb3c4a2 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -68,7 +68,6 @@ function(add_ocaml_library name) + + explicit_map_components_to_libraries(llvm_libs ${ARG_LLVM}) +- foreach( llvm_lib ${llvm_libs} ) +- list(APPEND ocaml_flags "-l${llvm_lib}" ) +- endforeach() ++ list(APPEND ocaml_flags %%LIBS%% ) ++ list(APPEND ocaml_flags "-ccopt" "-L%%LIBDIR%%" ) + + get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) diff --git a/patches/llvm/makefile+build.patch b/patches/llvm/makefile+build.patch new file mode 100644 index 0000000..7a288d9 --- /dev/null +++ b/patches/llvm/makefile+build.patch @@ -0,0 +1,14 @@ +diff --git a/bindings/ocaml/Makefile b/bindings/ocaml/Makefile +index b0e1f09..8472451 100644 +--- a/bindings/ocaml/Makefile ++++ b/bindings/ocaml/Makefile +@@ -17,4 +17,9 @@ ocamldoc: + $(MAKE) -C $$i ocamldoc; \ + done + ++build: ++ $(Verb) for i in $(DIRS) ; do \ ++ $(MAKE) -C $$i all-local; \ ++ done ++ + include $(LEVEL)/Makefile.common diff --git a/patches/llvm/makefile+system.patch b/patches/llvm/makefile+system.patch new file mode 100644 index 0000000..bbcd594 --- /dev/null +++ b/patches/llvm/makefile+system.patch @@ -0,0 +1,28 @@ +diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml +index 1b964ee..70df397 100644 +--- a/bindings/ocaml/Makefile.ocaml ++++ b/bindings/ocaml/Makefile.ocaml +@@ -29,6 +29,11 @@ endif + + include $(LEVEL)/Makefile.common + ++ifdef SYSTEM_LLVM_CONFIG ++LLVM_CONFIG = $(SYSTEM_LLVM_CONFIG) ++LLVMLibsOptions += $(shell $(LLVM_CONFIG) --ldflags) ++endif ++ + # Intentionally ignore PROJ_prefix here. We want the ocaml stdlib. However, the + # user can override this with OCAML_LIBDIR or configure --with-ocaml-libdir=. + PROJ_libocamldir := $(DESTDIR)$(OCAML_LIBDIR) +@@ -143,7 +148,11 @@ endif + # The .cmo files are the only intermediates; all others are to be installed. + OutputsCMI := $(ObjectsCMI:$(ObjDir)/%.cmi=$(OcamlDir)/%.cmi) + OutputsCMX := $(ObjectsCMX:$(ObjDir)/%.cmx=$(OcamlDir)/%.cmx) ++ifdef SYSTEM_LLVM_CONFIG ++OutputLibs := $(UsedLibNames:%=$(shell $(LLVM_CONFIG) --libdir)/%) ++else + OutputLibs := $(UsedLibNames:%=$(OcamlDir)/%) ++endif + + ifdef LIBRARYNAME + LibraryA := $(OcamlDir)/lib$(LIBRARYNAME).a diff --git a/patches/lru/hashtbl-seeded.patch b/patches/lru/hashtbl-seeded.patch new file mode 100644 index 0000000..e9ca3f7 --- /dev/null +++ b/patches/lru/hashtbl-seeded.patch @@ -0,0 +1,13 @@ +diff --git a/src/lru.ml b/src/lru.ml +index 2484c24..98e6786 100644 +--- a/src/lru.ml ++++ b/src/lru.ml +@@ -301,7 +301,7 @@ module M = struct + end + + module SeededHash (H: Hashtbl.HashedType) = struct +- include H let hash _ x = hash x ++ include H let seeded_hash _ x = hash x + end + + module Make (K: Hashtbl.HashedType) (V: Weighted) = diff --git a/patches/lutils/_oasis_remove_.ml b/patches/lutils/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/lutils/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/lutils/lutils.install b/patches/lutils/lutils.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/lutils/lutils.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/lwt/4.01cloexec.diff b/patches/lwt/4.01cloexec.diff new file mode 100644 index 0000000..543246d --- /dev/null +++ b/patches/lwt/4.01cloexec.diff @@ -0,0 +1,44 @@ +https://github.com/ocsigen/lwt/pull/2.patch +From 0df80f6d05625f80e1e3e05a46e355728881b38a Mon Sep 17 00:00:00 2001 +From: Anil Madhavapeddy +Date: Sat, 3 Aug 2013 20:20:55 +0100 +Subject: [PATCH] OCaml 4.01.0dev has a Unix.O_CLOEXEC flag, so add this to + Lwt_unix too. + +This was added quite recently in ocaml/ocaml@2207c45056e69d1ea5 +--- + src/unix/lwt_unix.ml | 3 +++ + src/unix/lwt_unix.mli | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/src/unix/lwt_unix.ml b/src/unix/lwt_unix.ml +index 5115ffe..4222f7b 100644 +--- a/src/unix/lwt_unix.ml ++++ b/src/unix/lwt_unix.ml +@@ -596,6 +596,9 @@ type open_flag = + #if ocaml_version >= (3, 13) + | O_SHARE_DELETE + #endif ++#if ocaml_version >= (4, 01) ++ | O_CLOEXEC ++#endif + + #if windows + +diff --git a/src/unix/lwt_unix.mli b/src/unix/lwt_unix.mli +index cc9df59..f85df52 100644 +--- a/src/unix/lwt_unix.mli ++++ b/src/unix/lwt_unix.mli +@@ -315,6 +315,9 @@ type open_flag = + #if ocaml_version >= (3, 13) + | O_SHARE_DELETE + #endif ++#if ocaml_version >= (4, 01) ++ | O_CLOEXEC ++#endif + + val openfile : string -> open_flag list -> file_perm -> file_descr Lwt.t + (** Wrapper for [Unix.openfile]. *) +-- +1.8.1.6 + diff --git a/patches/lwt/META-version.patch b/patches/lwt/META-version.patch new file mode 100644 index 0000000..7f9f43e --- /dev/null +++ b/patches/lwt/META-version.patch @@ -0,0 +1,36 @@ +diff -Naur lwt-4.2.1.orig/lwt.opam lwt-4.2.1/lwt.opam +--- lwt-4.2.1.orig/lwt.opam 2020-12-30 22:06:53.640469206 +0100 ++++ lwt-4.2.1/lwt.opam 2020-12-30 22:08:52.634458990 +0100 +@@ -2,7 +2,7 @@ + + synopsis: "Promises and event-driven I/O" + +-version: "dev" ++version: "4.2.1" + license: "MIT" + homepage: "https://github.com/ocsigen/lwt" + doc: "https://ocsigen.org/lwt/manual/" +diff -Naur lwt-4.2.1.orig/lwt_ppx.opam lwt-4.2.1/lwt_ppx.opam +--- lwt-4.2.1.orig/lwt_ppx.opam 2020-12-30 22:06:53.640469206 +0100 ++++ lwt-4.2.1/lwt_ppx.opam 2020-12-30 22:08:57.079458608 +0100 +@@ -2,7 +2,7 @@ + + synopsis: "PPX syntax for Lwt, providing something similar to async/await from JavaScript" + +-version: "dev" ++version: "4.2.1" + license: "MIT" + homepage: "https://github.com/ocsigen/lwt" + doc: "https://ocsigen.org/lwt/api/Ppx_lwt" +diff -Naur lwt-4.2.1.orig/lwt_react.opam lwt-4.2.1/lwt_react.opam +--- lwt-4.2.1.orig/lwt_react.opam 2020-12-30 22:06:53.640469206 +0100 ++++ lwt-4.2.1/lwt_react.opam 2020-12-30 22:09:00.320458330 +0100 +@@ -2,7 +2,7 @@ + + synopsis: "Helpers for using React with Lwt" + +-version: "dev" ++version: "4.2.1" + license: "MIT" + homepage: "https://github.com/ocsigen/lwt" + doc: "https://ocsigen.org/lwt/api/Lwt_react" diff --git a/patches/lwt/lwt.install.2.7.0 b/patches/lwt/lwt.install.2.7.0 new file mode 100644 index 0000000..bdf8496 --- /dev/null +++ b/patches/lwt/lwt.install.2.7.0 @@ -0,0 +1,6 @@ +lib: "lwt.opam" { "opam" } +doc: [ + "README.md" + "CHANGES" + "doc/COPYING" { "LICENSE" } +] diff --git a/patches/lwt/lwt.install.2.7.1 b/patches/lwt/lwt.install.2.7.1 new file mode 100644 index 0000000..bdf8496 --- /dev/null +++ b/patches/lwt/lwt.install.2.7.1 @@ -0,0 +1,6 @@ +lib: "lwt.opam" { "opam" } +doc: [ + "README.md" + "CHANGES" + "doc/COPYING" { "LICENSE" } +] diff --git a/patches/lwt/lwt.install.3.0.0 b/patches/lwt/lwt.install.3.0.0 new file mode 100644 index 0000000..d88814c --- /dev/null +++ b/patches/lwt/lwt.install.3.0.0 @@ -0,0 +1,6 @@ +lib: "opam/opam" { "opam" } +doc: [ + "README.md" + "CHANGES" + "doc/COPYING" { "LICENSE" } +] diff --git a/patches/lwt/patch-ocsigen-lwt-101.diff b/patches/lwt/patch-ocsigen-lwt-101.diff new file mode 100644 index 0000000..02fdc7d --- /dev/null +++ b/patches/lwt/patch-ocsigen-lwt-101.diff @@ -0,0 +1,49 @@ +diff -uNr lwt.2.4.6.orig/lwt.2.4.6/ppx/ppx_lwt.ml lwt.2.4.6/lwt.2.4.6/ppx/ppx_lwt.ml +--- lwt.2.4.6.orig/lwt.2.4.6/ppx/ppx_lwt.ml 1970-01-01 01:00:00.000000000 +0100 ++++ lwt.2.4.6/lwt.2.4.6/ppx/ppx_lwt.ml 2015-01-02 12:28:16.000000000 +0000 +@@ -0,0 +1 @@ ++(* Dummy ML file to workaround https://github.com/ocsigen/lwt/issues/91 *) +diff -uNr lwt.2.4.6.orig/myocamlbuild.ml lwt.2.4.6/myocamlbuild.ml +--- lwt.2.4.6.orig/myocamlbuild.ml 2015-01-02 12:14:23.000000000 +0000 ++++ lwt.2.4.6/myocamlbuild.ml 2015-01-02 12:29:08.000000000 +0000 +@@ -21,7 +21,7 @@ + *) + + (* OASIS_START *) +-(* DO NOT EDIT (digest: 61e7bc76f38130ad68399b55a0e0b025) *) ++(* DO NOT EDIT (digest: bdd8da10af4f850f9a9f61b515da15ca) *) + module OASISGettext = struct + (* # 22 "src/oasis/OASISGettext.ml" *) + +@@ -634,7 +634,7 @@ + ("lwt-syntax", ["syntax"], []); + ("lwt-syntax-options", ["syntax"], []); + ("lwt-syntax-log", ["syntax"], []); +- ("ppx", ["ppx"], ["Ppx_lwt"]); ++ ("ppx", ["ppx"], []); + ("test", ["tests"], []) + ]; + lib_c = +diff -uNr lwt.2.4.6.orig/ppx/ppx.mldylib lwt.2.4.6/ppx/ppx.mldylib +--- lwt.2.4.6.orig/ppx/ppx.mldylib 2015-01-02 12:14:23.000000000 +0000 ++++ lwt.2.4.6/ppx/ppx.mldylib 2015-01-02 12:29:08.000000000 +0000 +@@ -1,3 +1,4 @@ + # OASIS_START +-# DO NOT EDIT (digest: d41d8cd98f00b204e9800998ecf8427e) ++# DO NOT EDIT (digest: d62cd5ddc27d99b3e4e5b16e801ef038) ++Ppx_lwt + # OASIS_STOP +diff -uNr lwt.2.4.6.orig/ppx/ppx.mllib lwt.2.4.6/ppx/ppx.mllib +--- lwt.2.4.6.orig/ppx/ppx.mllib 2015-01-02 12:14:23.000000000 +0000 ++++ lwt.2.4.6/ppx/ppx.mllib 2015-01-02 12:29:08.000000000 +0000 +@@ -1,3 +1,4 @@ + # OASIS_START +-# DO NOT EDIT (digest: d41d8cd98f00b204e9800998ecf8427e) ++# DO NOT EDIT (digest: d62cd5ddc27d99b3e4e5b16e801ef038) ++Ppx_lwt + # OASIS_STOP +diff -uNr lwt.2.4.6.orig/ppx/ppx_lwt.ml lwt.2.4.6/ppx/ppx_lwt.ml +--- lwt.2.4.6.orig/ppx/ppx_lwt.ml 1970-01-01 01:00:00.000000000 +0100 ++++ lwt.2.4.6/ppx/ppx_lwt.ml 2015-01-02 12:29:06.000000000 +0000 +@@ -0,0 +1 @@ ++(* Dummy ML file to workaround https://github.com/ocsigen/lwt/issues/91 *) diff --git a/patches/macaque/fix-configure.patch b/patches/macaque/fix-configure.patch new file mode 100644 index 0000000..8b9952d --- /dev/null +++ b/patches/macaque/fix-configure.patch @@ -0,0 +1,24 @@ +diff --git a/configure b/configure +index d2a26d1..3985b43 100755 +--- a/configure ++++ b/configure +@@ -1,7 +1,7 @@ + #!/bin/sh + + # OASIS_START +-# DO NOT EDIT (digest: 6f7b8221311e800a7093dc3b793f67ca) ++# DO NOT EDIT (digest: 67dd0def14e1d99625d2485f6a4d5df1) + set -e + + FST=true +@@ -23,5 +23,9 @@ for i in "$@"; do + esac + done + +-make configure CONFIGUREFLAGS="$*" ++if [ ! -e setup.exe ] || [ _oasis -nt setup.exe ] || [ setup.ml -nt setup.exe ] || [ configure -nt setup.exe ]; then ++ ocamlfind ocamlopt -o setup.exe setup.ml || ocamlfind ocamlc -o setup.exe setup.ml || exit 1 ++ rm -f setup.cmi setup.cmo setup.cmx setup.o ++fi ++./setup.exe -configure "$@" + # OASIS_STOP diff --git a/patches/mascot/4.01.patch b/patches/mascot/4.01.patch new file mode 100644 index 0000000..658e29a --- /dev/null +++ b/patches/mascot/4.01.patch @@ -0,0 +1,31 @@ +commit 0b80748d63c012f79b1d210848ef069fa19e3e8f +Author: Hugo Heuzard +Date: Sat May 10 11:19:09 2014 +0200 + + 4.01 + +diff --git a/src/checks/code_ignoreUnit.ml b/src/checks/code_ignoreUnit.ml +index 0c89914..78de4a0 100644 +--- a/src/checks/code_ignoreUnit.ml ++++ b/src/checks/code_ignoreUnit.ml +@@ -106,16 +106,16 @@ and process_expression error e = + List.iter (fun (_, e) -> process_expression error e) l + | Texp_tuple l -> + List.iter (process_expression error) l +- | Texp_construct (_, _, _, l, _) -> ++ | Texp_construct (_, _, l, _) -> + List.iter (process_expression error) l + | Texp_variant (_, eo) -> + (match eo with Some e -> process_expression error e | None -> ()) + | Texp_record (l, eo) -> +- List.iter (fun (_, _, _, e) -> process_expression error e) l; ++ List.iter (fun (_, _, e) -> process_expression error e) l; + (match eo with Some e -> process_expression error e | None -> ()) +- | Texp_field (e, _, _, _) -> ++ | Texp_field (e, _, _) -> + process_expression error e +- | Texp_setfield (e1, _, _, _, e2) -> ++ | Texp_setfield (e1, _, _, e2) -> + process_expression error e1; + process_expression error e2 + | Texp_array l -> diff --git a/patches/mascot/mascot.install b/patches/mascot/mascot.install new file mode 100644 index 0000000..dd9f760 --- /dev/null +++ b/patches/mascot/mascot.install @@ -0,0 +1 @@ +bin: ["_build/src/driver/mascot.native" {"mascot"}] diff --git a/patches/melt/melt.install b/patches/melt/melt.install new file mode 100644 index 0000000..45504f6 --- /dev/null +++ b/patches/melt/melt.install @@ -0,0 +1,5 @@ +bin: [ + "_build/meltpp/main.native" {"meltpp"} + "_build/melt/tool.native" {"meltbuild"} + "_build/latop/latop.native" {"latop"} +] diff --git a/patches/menhir/menhir.install.20120123 b/patches/menhir/menhir.install.20120123 new file mode 100644 index 0000000..94a6ee2 --- /dev/null +++ b/patches/menhir/menhir.install.20120123 @@ -0,0 +1 @@ +bin: ["src/menhir.opt" {"menhir"}] diff --git a/patches/menhir/menhir.install.20130116 b/patches/menhir/menhir.install.20130116 new file mode 100644 index 0000000..94a6ee2 --- /dev/null +++ b/patches/menhir/menhir.install.20130116 @@ -0,0 +1 @@ +bin: ["src/menhir.opt" {"menhir"}] diff --git a/patches/menhir/menhir.install.20130911 b/patches/menhir/menhir.install.20130911 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20130911 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20140422 b/patches/menhir/menhir.install.20140422 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20140422 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20141215 b/patches/menhir/menhir.install.20141215 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20141215 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20150914 b/patches/menhir/menhir.install.20150914 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20150914 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20150921 b/patches/menhir/menhir.install.20150921 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20150921 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20151005 b/patches/menhir/menhir.install.20151005 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20151005 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20151012 b/patches/menhir/menhir.install.20151012 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20151012 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20151023 b/patches/menhir/menhir.install.20151023 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20151023 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20151026 b/patches/menhir/menhir.install.20151026 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20151026 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20151030 b/patches/menhir/menhir.install.20151030 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20151030 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20151103 b/patches/menhir/menhir.install.20151103 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20151103 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20151112 b/patches/menhir/menhir.install.20151112 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20151112 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20160303 b/patches/menhir/menhir.install.20160303 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20160303 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/menhir.install.20160504 b/patches/menhir/menhir.install.20160504 new file mode 100644 index 0000000..5ef5f87 --- /dev/null +++ b/patches/menhir/menhir.install.20160504 @@ -0,0 +1 @@ +bin: ["src/_stage2/menhir.native" {"menhir"}] diff --git a/patches/menhir/warn_error.patch b/patches/menhir/warn_error.patch new file mode 100644 index 0000000..8334ddd --- /dev/null +++ b/patches/menhir/warn_error.patch @@ -0,0 +1,10 @@ +diff -ur src/src/_tags menhir-20141215/src/_tags +--- src/src/_tags 2015-01-12 15:38:28.615352081 +0100 ++++ menhir-20141215/src/_tags 2015-01-12 15:33:15.568981571 +0100 +@@ -1,5 +1,3 @@ +-# Enable Jonathan's "nazi warnings". +-<*>: my_warnings + + # Tag both parser source files with origin_parser. + <{yacc-parser,fancy-parser}.mly>:origin_parser +Seulement dans src/src: _tags.orig diff --git a/patches/merlin-acme/merlin-acme.install b/patches/merlin-acme/merlin-acme.install new file mode 100644 index 0000000..216667d --- /dev/null +++ b/patches/merlin-acme/merlin-acme.install @@ -0,0 +1,6 @@ +bin: [ + "Errors" + "TypeOf" + "Locate" + "Cplt" +] diff --git a/patches/message-switch/disable-error-on-warn.patch b/patches/message-switch/disable-error-on-warn.patch new file mode 100644 index 0000000..bb9336b --- /dev/null +++ b/patches/message-switch/disable-error-on-warn.patch @@ -0,0 +1,151 @@ +From b5dfcb6eda440c70776bc2af059576de288c05a6 Mon Sep 17 00:00:00 2001 +From: Marcello Seri +Date: Mon, 5 Jun 2017 16:13:39 +0100 +Subject: [PATCH] Disable warn-on-error when compiling message switch + +Signed-off-by: Marcello Seri +--- + _oasis | 30 +----------------------------- + 1 file changed, 1 insertion(+), 29 deletions(-) + +diff --git a/_oasis b/_oasis +index 31ee872..516c5a0 100644 +--- a/_oasis ++++ b/_oasis +@@ -1,6 +1,6 @@ + OASISFormat: 0.3 + Name: message_switch +-Version: 1.0.0 ++Version: 1.4.0 + Synopsis: A simple store-and-forward message switch + Authors: Dave Scott + License: ISC +@@ -18,8 +18,6 @@ Flag lwt + Library message_switch + CompiledObject: best + Pack: true +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + Path: core + Findlibname: message_switch + Modules: Protocol, Make, Monad, Mresult, S +@@ -28,8 +26,6 @@ Library message_switch + Library message_switch_lwt + Build$: flag(lwt) + CompiledObject: best +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + Path: lwt + Findlibparent: message_switch + Findlibname: lwt +@@ -39,8 +35,6 @@ Library message_switch_lwt + Library message_switch_async + Build$: flag(async) + CompiledObject: best +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + Path: async + Findlibparent: message_switch + Findlibname: async +@@ -49,8 +43,6 @@ Library message_switch_async + + Library message_switch_unix + CompiledObject: best +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + Path: unix + Findlibparent: message_switch + Findlibname: unix +@@ -59,8 +51,6 @@ Library message_switch_unix + + Library message_switch_server + Build$: flag(lwt) +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + CompiledObject: best + Pack: true + Install: false +@@ -72,8 +62,6 @@ Library message_switch_server + + Executable m_cli + CompiledObject: best +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + Path: cli + MainIs: main.ml + Custom: true +@@ -82,8 +70,6 @@ Executable m_cli + + Executable link_test + Build$: flag(lwt)&&flag(tests) +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + CompiledObject: best + Path: core_test + MainIs: link_test_main.ml +@@ -93,8 +79,6 @@ Executable link_test + + Executable client + Build$: flag(lwt)&&flag(tests) +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + CompiledObject: best + Path: core_test + MainIs: client_main.ml +@@ -104,8 +88,6 @@ Executable client + + Executable client_async + Build$: flag(async)&&flag(tests) +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + CompiledObject: best + Path: core_test + MainIs: client_async_main.ml +@@ -115,8 +97,6 @@ Executable client_async + + Executable client_unix + CompiledObject: best +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + Path: core_test + MainIs: client_unix_main.ml + Build$: flag(tests) +@@ -126,8 +106,6 @@ Executable client_unix + + Executable server + Build$: flag(lwt)&&flag(tests) +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + CompiledObject: best + Path: core_test + MainIs: server_main.ml +@@ -137,8 +115,6 @@ Executable server + + Executable server_async + Build$: flag(async)&&flag(tests) +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + CompiledObject: best + Path: core_test + MainIs: server_async_main.ml +@@ -148,8 +124,6 @@ Executable server_async + + Executable server_unix + CompiledObject: best +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + Path: core_test + MainIs: server_unix_main.ml + Build$: flag(tests) +@@ -159,8 +133,6 @@ Executable server_unix + + Executable switch + Build$: flag(lwt) +- ByteOpt: -warn-error +a +- NativeOpt: -warn-error +a + CompiledObject: best + Path: switch + MainIs: switch_main.ml +-- +2.11.0 + diff --git a/patches/message-switch/fix-mktemp-for-busybox.patch b/patches/message-switch/fix-mktemp-for-busybox.patch new file mode 100644 index 0000000..aa94a49 --- /dev/null +++ b/patches/message-switch/fix-mktemp-for-busybox.patch @@ -0,0 +1,25 @@ +From 653eac9553482c6a57c1e55068fe86a0f5c1201d Mon Sep 17 00:00:00 2001 +From: Marcello Seri +Date: Tue, 20 Jun 2017 11:02:23 +0100 +Subject: [PATCH] Update mktemp template in configure to support busybox + +Signed-off-by: Marcello Seri +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 5ad76e3..d9d2e21 100755 +--- a/configure ++++ b/configure +@@ -1,6 +1,6 @@ + #!/bin/bash + +-D=$(mktemp -d /tmp/configure.XXXXX) ++D=$(mktemp -d /tmp/configure.XXXXXX) + function cleanup { + cd / + rm -rf $D +-- +2.11.0 + diff --git a/patches/mezzo/mezzo.install b/patches/mezzo/mezzo.install new file mode 100644 index 0000000..5a9ed5c --- /dev/null +++ b/patches/mezzo/mezzo.install @@ -0,0 +1 @@ +bin: [ "_build/mezzo.native" { "mezzo" } ] diff --git a/patches/mezzo/no-deprecated-fatal-warning.patch b/patches/mezzo/no-deprecated-fatal-warning.patch new file mode 100644 index 0000000..07417ff --- /dev/null +++ b/patches/mezzo/no-deprecated-fatal-warning.patch @@ -0,0 +1,13 @@ +diff --git a/myocamlbuild.pre.ml b/myocamlbuild.pre.ml +index 24b1d3c..1bf6c8e 100644 +--- a/myocamlbuild.pre.ml ++++ b/myocamlbuild.pre.ml +@@ -28,7 +28,7 @@ let _ = + match event with + | After_rules -> + flag ["ocaml"; "compile"; "my_warnings"] +- (S[A "-w"; A "@1..3@8..12@14..21@23..40-41@43"]); ++ (S[A "-w"; A "@1-2+3@8..12@14..21@23..40-41@43"]); + | _ -> () + ); + ;; diff --git a/patches/mikmatch/fix_build.patch b/patches/mikmatch/fix_build.patch new file mode 100644 index 0000000..69e79a6 --- /dev/null +++ b/patches/mikmatch/fix_build.patch @@ -0,0 +1,17 @@ +--- pcre/Makefile.orig 2014-11-11 18:50:00.000000000 +0800 ++++ pcre/Makefile 2014-11-11 18:54:45.385223413 +0800 +@@ -94,11 +94,9 @@ + ocamlc -c mikmatch.mli + ocamlc -a -o run_mikmatch_pcre.cma -I $(PCRE_DIR) \ + mikmatch.ml run_mikmatch_pcre.ml +- ocamlmktop -o mikmatch_pcre.top \ +- -I +camlp4 -I $(PCRE_DIR) \ +- dynlink.cma \ +- camlp4o.cma \ +- pa_mikmatch_pcre.cma pcre.cma unix.cma run_mikmatch_pcre.cma ++ ocamlfind ocamlmktop -o mikmatch_pcre.top \ ++ -linkpkg -package camlp4.lib,pcre,unix \ ++ pa_mikmatch_pcre.cma run_mikmatch_pcre.cma + + misc-nc: + ocamlc -c mikmatch.mli diff --git a/patches/mikmatch/mikmatch.patch b/patches/mikmatch/mikmatch.patch new file mode 100644 index 0000000..8d2c0fc --- /dev/null +++ b/patches/mikmatch/mikmatch.patch @@ -0,0 +1,13 @@ +diff --git a/str/META.template b/str/META.template +index b692995..961e89b 100644 +--- a/str/META.template ++++ b/str/META.template +@@ -2,7 +2,7 @@ name = "mikmatch_str" + version = "VERSION" + description = "Pattern matching extended with regexps in Ocamllex syntax" + +-requires = "camlp4 pcre unix" ++requires = "camlp4 str unix" + requires(toploop) += "tophide" + + archive(syntax,toploop) = "pa_mikmatch_str.cma run_mikmatch_str.cma" diff --git a/patches/minilight/minilight.install b/patches/minilight/minilight.install new file mode 100644 index 0000000..d9b4f8a --- /dev/null +++ b/patches/minilight/minilight.install @@ -0,0 +1 @@ +bin: "minilight-ocaml" diff --git a/patches/minios-xen/build-opam.sh b/patches/minios-xen/build-opam.sh new file mode 100644 index 0000000..78a9aa2 --- /dev/null +++ b/patches/minios-xen/build-opam.sh @@ -0,0 +1,11 @@ +#!/bin/sh -ex + +# The MiniOS build is sensitive to some external variables +# like EXTRA_DEPS being set, even to blank values. +# See: https://github.com/mirage/mirage-xen-minios/issues/15 +# This wrapper script explicitly unexports them from the +# environment before invoking Make + +unset EXTRA_DEPS + +make debug=n CONFIG_VERBOSE_BOOT=n diff --git a/patches/mirage-www/mirage-www.install.0.3.0 b/patches/mirage-www/mirage-www.install.0.3.0 new file mode 100644 index 0000000..c5f8718 --- /dev/null +++ b/patches/mirage-www/mirage-www.install.0.3.0 @@ -0,0 +1,4 @@ +bin: [ + "?src/dist/build/mir-www/mir-www" {"mir-www"} + "?src/dist/build/mir-www/mir-www.xen" {"mir-www.xen"} +] diff --git a/patches/mirage-www/mirage-www.install.0.4.0 b/patches/mirage-www/mirage-www.install.0.4.0 new file mode 100644 index 0000000..c5f8718 --- /dev/null +++ b/patches/mirage-www/mirage-www.install.0.4.0 @@ -0,0 +1,4 @@ +bin: [ + "?src/dist/build/mir-www/mir-www" {"mir-www"} + "?src/dist/build/mir-www/mir-www.xen" {"mir-www.xen"} +] diff --git a/patches/mirage-www/mirage-www.install.1.0.0 b/patches/mirage-www/mirage-www.install.1.0.0 new file mode 100644 index 0000000..0e10f1e --- /dev/null +++ b/patches/mirage-www/mirage-www.install.1.0.0 @@ -0,0 +1,3 @@ +bin: [ + "?src/_build/main.native" {"mirage-www"} +] diff --git a/patches/mirage-www/mirage-www.install.1.1.0 b/patches/mirage-www/mirage-www.install.1.1.0 new file mode 100644 index 0000000..7859246 --- /dev/null +++ b/patches/mirage-www/mirage-www.install.1.1.0 @@ -0,0 +1,3 @@ +bin: [ + "src/mir-www" {"mirage-www"} +] diff --git a/patches/mirari/mirari.install b/patches/mirari/mirari.install new file mode 100644 index 0000000..0ee2fbd --- /dev/null +++ b/patches/mirari/mirari.install @@ -0,0 +1 @@ +bin: ["dist/build/mirari/mirari" {"mirari"}] diff --git a/patches/missinglib/meta-0.4.1.patch b/patches/missinglib/meta-0.4.1.patch new file mode 100644 index 0000000..9b5e39b --- /dev/null +++ b/patches/missinglib/meta-0.4.1.patch @@ -0,0 +1,11 @@ +--- a/libsrc/META 2015-01-15 15:21:20.991565330 +0100 ++++ b/libsrc/META 2015-01-15 15:21:42.333564587 +0100 +@@ -1,6 +1,6 @@ + name="Missinglib" +-version="0.0.1" ++version="0.4.1" + description="Utility libraries for OCaml" +-requires="str" ++requires="str unix" + archive(byte)="missinglib.cma" + archive(native)="missinglib.cmxa" diff --git a/patches/missinglib/opam.patch b/patches/missinglib/opam.patch new file mode 100644 index 0000000..762a70e --- /dev/null +++ b/patches/missinglib/opam.patch @@ -0,0 +1,12 @@ +diff -ru missinglib.0.4.1/Makefile.setup missinglib.0.4.1/Makefile.setup +--- missinglib.0.4.1/Makefile.setup 2004-06-05 17:45:01.000000000 +0200 ++++ missinglib.0.4.1/Makefile.setup 2012-10-05 18:14:52.729673166 +0200 +@@ -16,7 +16,7 @@ + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # + +-OCAMLFLAGS := -warn-error A ++OCAMLFLAGS := -w -a + + ifndef OCAMLMAKEFILE + OCAMLMAKEFILE := $(PATHTOTOP)/contrib/OCamlMakefile/OCamlMakefile diff --git a/patches/mldonkey/mldonkey.install.3.1.2 b/patches/mldonkey/mldonkey.install.3.1.2 new file mode 100644 index 0000000..39a5cbf --- /dev/null +++ b/patches/mldonkey/mldonkey.install.3.1.2 @@ -0,0 +1,8 @@ +bin: [ + "mlnet" {"mlslsk"} + "mlnet" + "mlnet" {"mlgnut"} + "mlnet" {"mldonkey"} + "mlnet" {"mldc"} + "mlnet" {"mlbt"} +] diff --git a/patches/mldonkey/mldonkey.install.3.1.3 b/patches/mldonkey/mldonkey.install.3.1.3 new file mode 100644 index 0000000..39a5cbf --- /dev/null +++ b/patches/mldonkey/mldonkey.install.3.1.3 @@ -0,0 +1,8 @@ +bin: [ + "mlnet" {"mlslsk"} + "mlnet" + "mlnet" {"mlgnut"} + "mlnet" {"mldonkey"} + "mlnet" {"mldc"} + "mlnet" {"mlbt"} +] diff --git a/patches/mldonkey/mldonkey.install.3.1.5 b/patches/mldonkey/mldonkey.install.3.1.5 new file mode 100644 index 0000000..39a5cbf --- /dev/null +++ b/patches/mldonkey/mldonkey.install.3.1.5 @@ -0,0 +1,8 @@ +bin: [ + "mlnet" {"mlslsk"} + "mlnet" + "mlnet" {"mlgnut"} + "mlnet" {"mldonkey"} + "mlnet" {"mldc"} + "mlnet" {"mlbt"} +] diff --git a/patches/mldonkey/mldonkey.install.3.1.6 b/patches/mldonkey/mldonkey.install.3.1.6 new file mode 100644 index 0000000..39a5cbf --- /dev/null +++ b/patches/mldonkey/mldonkey.install.3.1.6 @@ -0,0 +1,8 @@ +bin: [ + "mlnet" {"mlslsk"} + "mlnet" + "mlnet" {"mlgnut"} + "mlnet" {"mldonkey"} + "mlnet" {"mldc"} + "mlnet" {"mlbt"} +] diff --git a/patches/mldonkey/mldonkey.install.3.1.7-2 b/patches/mldonkey/mldonkey.install.3.1.7-2 new file mode 100644 index 0000000..6fabcee --- /dev/null +++ b/patches/mldonkey/mldonkey.install.3.1.7-2 @@ -0,0 +1,3 @@ +bin: [ + "mlnet" +] diff --git a/patches/mlgmp/_oasis b/patches/mlgmp/_oasis new file mode 100644 index 0000000..795bf37 --- /dev/null +++ b/patches/mlgmp/_oasis @@ -0,0 +1,15 @@ +OASISFormat: 0.3 +Name: gmp +Version: 20120224 +Synopsis: GMP +Authors: Jean-Christophe Filliatre. +License: ISC +Plugins: META (0.3) +BuildTools: ocamlbuild + +Library gmp + Path: . + Modules: Gmp + CSources: mlgmp_z.c,mlgmp_q.c,mlgmp_f.c,mlgmp_fr.c,mlgmp_random.c,mlgmp_misc.c,config.h,mlgmp.h + CCLib: -L/usr/local/lib -lgmp -lmpfr + CCOpt: -I/usr/local/include -Wall diff --git a/patches/mlgmp/fix-extern-declarations.diff b/patches/mlgmp/fix-extern-declarations.diff new file mode 100644 index 0000000..b302e9e --- /dev/null +++ b/patches/mlgmp/fix-extern-declarations.diff @@ -0,0 +1,20 @@ +Description: Update extern declarations for [de]serialize functions to match ocaml 4.04 definitions. +Author: Dimitri John Ledkov + +--- mlgmp-20021123.orig/config.h ++++ mlgmp-20021123/config.h +@@ -58,11 +58,11 @@ + #define MPFR_SIZE_ARCH32 16 + #define MPFR_SIZE_ARCH64 24 + +-extern void serialize_int_4(int32 i); ++extern void serialize_int_4(int32_t i); + extern void serialize_block_1(void * data, long len); + +-extern uint32 deserialize_uint_4(void); +-extern int32 deserialize_sint_4(void); ++extern uint32_t deserialize_uint_4(void); ++extern int32_t deserialize_sint_4(void); + extern void deserialize_block_1(void * data, long len); + + #endif /* SERIALIZE */ diff --git a/patches/mlmpfr/mlmpfr_compatibility_test.c.4.0.2+dune b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.0.2+dune new file mode 100644 index 0000000..084c4cf --- /dev/null +++ b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.0.2+dune @@ -0,0 +1,24 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + // mlmpfr.4.0.2 is fully compatible with MPFR-4.0.0 + if(strcmp(subversion, "4.0.0") == 0) + return 0; + + // mlmpfr.4.0.2 is fully compatible with MPFR-4.0.1 + if(strcmp(subversion, "4.0.1") == 0) + return 0; + + if(strcmp(subversion, "4.0.2") == 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0 b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0 new file mode 100644 index 0000000..b6fa0c2 --- /dev/null +++ b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0 @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + if(strcmp(subversion, "4.1.0") == 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix1 b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix1 new file mode 100644 index 0000000..b6fa0c2 --- /dev/null +++ b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix1 @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + if(strcmp(subversion, "4.1.0") == 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix2 b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix2 new file mode 100644 index 0000000..b6fa0c2 --- /dev/null +++ b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.0+bugfix2 @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + if(strcmp(subversion, "4.1.0") == 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.1 b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.1 new file mode 100644 index 0000000..162b475 --- /dev/null +++ b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.1.1 @@ -0,0 +1,20 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + if(strcmp(subversion, "4.1.1") == 0) + return 0; + + // Version 4.1.1 is also compatible with 4.2.0 + if(strcmp(subversion, "4.2.0") == 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.0 b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.0 new file mode 100644 index 0000000..05e414a --- /dev/null +++ b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.0 @@ -0,0 +1,17 @@ +#include + +// Define the minimal version of MPFR, MLMPFR is based on (4.2.0). +#define MLMPFR_MPFR_VERSION_MAFOR 4 +#define MLMPFR_MPFR_VERSION_MINOR 2 +#define MLMPFR_MPFR_VERSION_PATCHLEVEL 0 + +int +main (int argc, char **argv) +{ + if (MPFR_VERSION_MAJOR >= MLMPFR_MPFR_VERSION_MAFOR + && MPFR_VERSION_MINOR >= MLMPFR_MPFR_VERSION_MINOR + && MPFR_VERSION_PATCHLEVEL >= MLMPFR_MPFR_VERSION_PATCHLEVEL) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.1 b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.1 new file mode 100644 index 0000000..0ce356c --- /dev/null +++ b/patches/mlmpfr/mlmpfr_compatibility_test.c.4.2.1 @@ -0,0 +1,17 @@ +#include + +// Define the minimal version of MPFR, MLMPFR is based on (4.2.1). +#define MLMPFR_MPFR_VERSION_MAFOR 4 +#define MLMPFR_MPFR_VERSION_MINOR 2 +#define MLMPFR_MPFR_VERSION_PATCHLEVEL 1 + +int +main (int argc, char **argv) +{ + if (MPFR_VERSION_MAJOR >= MLMPFR_MPFR_VERSION_MAFOR + && MPFR_VERSION_MINOR >= MLMPFR_MPFR_VERSION_MINOR + && MPFR_VERSION_PATCHLEVEL >= MLMPFR_MPFR_VERSION_PATCHLEVEL) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/test.c.3.1.6 b/patches/mlmpfr/test.c.3.1.6 new file mode 100644 index 0000000..462e2b5 --- /dev/null +++ b/patches/mlmpfr/test.c.3.1.6 @@ -0,0 +1,20 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + // test succeed if MPFR version is less or equal to 3.1.6 + // mlmpfr.3.1.6 is not compatible with all the previous versions + // of MPFR, but since I didn't tested all of them, it's OK like + // this for now! + if(strcmp(subversion, "3.1.6") <= 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/test.c.4.0.0 b/patches/mlmpfr/test.c.4.0.0 new file mode 100644 index 0000000..3325196 --- /dev/null +++ b/patches/mlmpfr/test.c.4.0.0 @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + if(strcmp(subversion, "4.0.0") == 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/test.c.4.0.1 b/patches/mlmpfr/test.c.4.0.1 new file mode 100644 index 0000000..7b4972b --- /dev/null +++ b/patches/mlmpfr/test.c.4.0.1 @@ -0,0 +1,20 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + // mlmpfr.4.0.1 is fully compatible with MPFR-4.0.0 + if(strcmp(subversion, "4.0.0") == 0) + return 0; + + if(strcmp(subversion, "4.0.1") == 0) + return 0; + + return 1; +} diff --git a/patches/mlmpfr/test.c.4.0.2 b/patches/mlmpfr/test.c.4.0.2 new file mode 100644 index 0000000..084c4cf --- /dev/null +++ b/patches/mlmpfr/test.c.4.0.2 @@ -0,0 +1,24 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + const char *version = mpfr_get_version(); + char subversion[6]; + memcpy(subversion, version, 5); + subversion[5] = '\0'; + + // mlmpfr.4.0.2 is fully compatible with MPFR-4.0.0 + if(strcmp(subversion, "4.0.0") == 0) + return 0; + + // mlmpfr.4.0.2 is fully compatible with MPFR-4.0.1 + if(strcmp(subversion, "4.0.1") == 0) + return 0; + + if(strcmp(subversion, "4.0.2") == 0) + return 0; + + return 1; +} diff --git a/patches/mlpost/mlpost.install b/patches/mlpost/mlpost.install new file mode 100644 index 0000000..6f1aea3 --- /dev/null +++ b/patches/mlpost/mlpost.install @@ -0,0 +1 @@ +bin: ["_build/tool.native" {"mlpost"}] diff --git a/patches/mlpost/opam.patch.in b/patches/mlpost/opam.patch.in new file mode 100644 index 0000000..fbff918 --- /dev/null +++ b/patches/mlpost/opam.patch.in @@ -0,0 +1,15 @@ +diff -ru mlpost.0.8.1/configure.in mlpost.0.8.1/configure.in +--- mlpost.0.8.1/configure.in 2010-04-26 21:50:23.000000000 +0200 ++++ mlpost.0.8.1/configure.in 2012-10-05 18:14:40.253296052 +0200 +@@ -327,9 +327,9 @@ + if test -n "$LABLGTK2LIB";then + echo "ocamlfind found lablgtk2 in $LABLGTK2LIB" + else +- AC_CHECK_FILE($OCAMLLIB/lablgtk2/lablgtk.cma,LABLGTK2=yes,LABLGTK2=no) ++ AC_CHECK_FILE(%{lib}%/lablgtk2/lablgtk.cma,LABLGTK2=yes,LABLGTK2=no) + if test "$LABLGTK2" = yes; then +- LABLGTK2LIB=$OCAMLLIB/lablgtk2/ ++ LABLGTK2LIB=%{lib}%/lablgtk2/ + elif test -n "$OCAMLLIBLOCAL"; then + AC_CHECK_FILE($OCAMLLIBLOCAL/lablgtk2/lablgtk2.cma,LABLGTK2=yes,LABLGTK2=no) + if test "$LABLGTK2" = yes; then diff --git a/patches/modelica_ml/modelica.ml.install.0.1.1 b/patches/modelica_ml/modelica.ml.install.0.1.1 new file mode 100644 index 0000000..fe8c471 --- /dev/null +++ b/patches/modelica_ml/modelica.ml.install.0.1.1 @@ -0,0 +1,6 @@ +bin: [ + "?_build/test/parse_modelica.byte" {"parse_modelica"} + "?_build/test/parse_modelica.native" {"parse_modelica"} + "?_build/test/modelica_frontend_tests.byte" {"modelica_frontend_tests"} + "?_build/test/modelica_frontend_tests.native" {"modelica_frontend_tests"} +] diff --git a/patches/modelica_ml/modelica.ml.install.0.2.0 b/patches/modelica_ml/modelica.ml.install.0.2.0 new file mode 100644 index 0000000..e12162d --- /dev/null +++ b/patches/modelica_ml/modelica.ml.install.0.2.0 @@ -0,0 +1,14 @@ +bin: [ + "?_build/test/modclread.byte" {"modclread"} + "?_build/test/modclread.native" {"modclread"} + "?_build/test/modcl.byte" {"modcl"} + "?_build/test/modcl.native" {"modcl"} + "?_build/test/modclc.byte" {"modclc"} + "?_build/test/modclc.native" {"modclc"} + "?_build/test/parse_package.byte" {"parse_pkg"} + "?_build/test/parse_package.native" {"parse_pkg"} + "?_build/test/parse_modelica.byte" {"parse_modelica"} + "?_build/test/parse_modelica.native" {"parse_modelica"} + "?_build/test/modelica_frontend_tests.byte" {"modelica_frontend_tests"} + "?_build/test/modelica_frontend_tests.native" {"modelica_frontend_tests"} +] diff --git a/patches/mpi/post103.patch b/patches/mpi/post103.patch new file mode 100644 index 0000000..0c00ab0 --- /dev/null +++ b/patches/mpi/post103.patch @@ -0,0 +1,33 @@ +diff --git a/Makefile b/Makefile +index 45b0183..3a36dea 100644 +--- a/Makefile ++++ b/Makefile +@@ -15,7 +15,8 @@ OBJS=mpi.cmo + all: libcamlmpi.a byte + + install: +- ocamlfind install mpi META mpi.mli mpi.cmi $(wildcard mpi.cm*a) $(wildcard *mpi.a) ++ ocamlfind install mpi META mpi.mli mpi.cmi \ ++ $(wildcard mpi*.cmx) $(wildcard mpi.cm*a) $(wildcard *mpi.a) + + uninstall: + ocamlfind remove mpi +diff --git a/init.c b/init.c +index 7edebdf..2dd314a 100644 +--- a/init.c ++++ b/init.c +@@ -57,8 +57,14 @@ value caml_mpi_init(value arguments) + argv[i] = NULL; + MPI_Init(&argc, &argv); + /* Register an error handler */ ++#if MPI_VERSION >= 2 ++ MPI_Comm_create_errhandler( ++ (MPI_Handler_function *)caml_mpi_error_handler, &hdlr); ++ MPI_Comm_set_errhandler(MPI_COMM_WORLD, hdlr); ++#else + MPI_Errhandler_create((MPI_Handler_function *)caml_mpi_error_handler, &hdlr); + MPI_Errhandler_set(MPI_COMM_WORLD, hdlr); ++#endif + return Val_unit; + } + diff --git a/patches/mpi/post105.patch b/patches/mpi/post105.patch new file mode 100644 index 0000000..a8aee56 --- /dev/null +++ b/patches/mpi/post105.patch @@ -0,0 +1,14 @@ +diff --git a/init.c b/init.c +index 5fcd03e..a49c613 100644 +--- a/init.c ++++ b/init.c +@@ -80,8 +80,7 @@ value caml_mpi_init(value arguments) + MPI_Init(&argc, &argv); + /* Register an error handler */ + #if MPI_VERSION >= 2 +- MPI_Comm_create_errhandler( +- (MPI_Handler_function *)caml_mpi_error_handler, &hdlr); ++ MPI_Comm_create_errhandler(caml_mpi_error_handler, &hdlr); + MPI_Comm_set_errhandler(MPI_COMM_WORLD, hdlr); + #else + MPI_Errhandler_create((MPI_Handler_function *)caml_mpi_error_handler, &hdlr); diff --git a/patches/mpp/_oasis_remove_.ml b/patches/mpp/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/mpp/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/mpp/mpp.install.0.1.0 b/patches/mpp/mpp.install.0.1.0 new file mode 100644 index 0000000..2dca4d2 --- /dev/null +++ b/patches/mpp/mpp.install.0.1.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/mpp_main.byte" {"mpp"} + "?_build/src/mpp_main.native" {"mpp"} +] diff --git a/patches/mpp/mpp.install.0.1.1 b/patches/mpp/mpp.install.0.1.1 new file mode 100644 index 0000000..2dca4d2 --- /dev/null +++ b/patches/mpp/mpp.install.0.1.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/mpp_main.byte" {"mpp"} + "?_build/src/mpp_main.native" {"mpp"} +] diff --git a/patches/mpp/mpp.install.0.1.2 b/patches/mpp/mpp.install.0.1.2 new file mode 100644 index 0000000..2dca4d2 --- /dev/null +++ b/patches/mpp/mpp.install.0.1.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/mpp_main.byte" {"mpp"} + "?_build/src/mpp_main.native" {"mpp"} +] diff --git a/patches/mpp/mpp.install.0.1.3 b/patches/mpp/mpp.install.0.1.3 new file mode 100644 index 0000000..2dca4d2 --- /dev/null +++ b/patches/mpp/mpp.install.0.1.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/mpp_main.byte" {"mpp"} + "?_build/src/mpp_main.native" {"mpp"} +] diff --git a/patches/mpp/mpp.install.0.1.4 b/patches/mpp/mpp.install.0.1.4 new file mode 100644 index 0000000..2dca4d2 --- /dev/null +++ b/patches/mpp/mpp.install.0.1.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/mpp_main.byte" {"mpp"} + "?_build/src/mpp_main.native" {"mpp"} +] diff --git a/patches/mpp/mpp.install.0.1.5 b/patches/mpp/mpp.install.0.1.5 new file mode 100644 index 0000000..2dca4d2 --- /dev/null +++ b/patches/mpp/mpp.install.0.1.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/mpp_main.byte" {"mpp"} + "?_build/src/mpp_main.native" {"mpp"} +] diff --git a/patches/mpp/mpp.install.0.1.7 b/patches/mpp/mpp.install.0.1.7 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/mpp/mpp.install.0.1.7 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/mpp/mpp.install.0.1.8 b/patches/mpp/mpp.install.0.1.8 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/mpp/mpp.install.0.1.8 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/mpp/mpp.install.0.2.0 b/patches/mpp/mpp.install.0.2.0 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/mpp/mpp.install.0.2.0 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/mpp/mpp.install.0.2.1 b/patches/mpp/mpp.install.0.2.1 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/mpp/mpp.install.0.2.1 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/mpp/mpp.install.0.3.0 b/patches/mpp/mpp.install.0.3.0 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/mpp/mpp.install.0.3.0 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/mpp/mpp.install.0.3.2 b/patches/mpp/mpp.install.0.3.2 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/mpp/mpp.install.0.3.2 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/msgpack/no-camlp4.patch.1.0.0 b/patches/msgpack/no-camlp4.patch.1.0.0 new file mode 100644 index 0000000..8f3da95 --- /dev/null +++ b/patches/msgpack/no-camlp4.patch.1.0.0 @@ -0,0 +1,73 @@ +diff --git a/_oasis b/_oasis +index f3733a5..4a7bec5 100644 +--- a/_oasis ++++ b/_oasis +@@ -13,7 +13,7 @@ Description: + MessagePack is an efficient binary serialization format. + If meta_conv is installed, conv module will be installed. + +-BuildTools: ocamlbuild, camlp4 ++BuildTools: ocamlbuild + + # ------------------------------------------------------------ + # Flags +diff --git a/setup.ml b/setup.ml +index 26f0f36..2a51166 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -6991,8 +6991,7 @@ let setup_t = + FindlibPackage ("extlib", None); + FindlibPackage ("num", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7054,8 +7053,7 @@ let setup_t = + FindlibPackage ("meta_conv", None); + InternalLibrary "msgpack" + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7102,8 +7100,7 @@ let setup_t = + InternalLibrary "msgpack"; + FindlibPackage ("oUnit", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7141,8 +7138,7 @@ let setup_t = + FindlibPackage ("oUnit", None); + FindlibPackage ("meta_conv.syntax", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7185,7 +7181,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_core" + ] + }); +@@ -7221,7 +7216,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_conv" + ] + }); diff --git a/patches/msgpack/no-camlp4.patch.1.1.0 b/patches/msgpack/no-camlp4.patch.1.1.0 new file mode 100644 index 0000000..c79be6b --- /dev/null +++ b/patches/msgpack/no-camlp4.patch.1.1.0 @@ -0,0 +1,73 @@ +diff --git a/_oasis b/_oasis +index f3733a5..4a7bec5 100644 +--- a/_oasis ++++ b/_oasis +@@ -13,7 +13,7 @@ Description: + MessagePack is an efficient binary serialization format. + If meta_conv is installed, conv module will be installed. + +-BuildTools: ocamlbuild, camlp4 ++BuildTools: ocamlbuild + + # ------------------------------------------------------------ + # Flags +diff --git a/setup.ml b/setup.ml +index 26f0f36..2a51166 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -6991,8 +6991,7 @@ let setup_t = + bs_path = "lib/core"; + bs_compiled_object = Best; + bs_build_depends = [FindlibPackage ("num", None)]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7054,8 +7053,7 @@ let setup_t = + FindlibPackage ("meta_conv", None); + InternalLibrary "msgpack" + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7102,8 +7100,7 @@ let setup_t = + InternalLibrary "msgpack"; + FindlibPackage ("oUnit", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7141,8 +7138,7 @@ let setup_t = + FindlibPackage ("oUnit", None); + FindlibPackage ("meta_conv.syntax", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7185,7 +7181,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_core" + ] + }); +@@ -7221,7 +7216,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_conv" + ] + }); diff --git a/patches/msgpack/no-camlp4.patch.1.1.1 b/patches/msgpack/no-camlp4.patch.1.1.1 new file mode 100644 index 0000000..c79be6b --- /dev/null +++ b/patches/msgpack/no-camlp4.patch.1.1.1 @@ -0,0 +1,73 @@ +diff --git a/_oasis b/_oasis +index f3733a5..4a7bec5 100644 +--- a/_oasis ++++ b/_oasis +@@ -13,7 +13,7 @@ Description: + MessagePack is an efficient binary serialization format. + If meta_conv is installed, conv module will be installed. + +-BuildTools: ocamlbuild, camlp4 ++BuildTools: ocamlbuild + + # ------------------------------------------------------------ + # Flags +diff --git a/setup.ml b/setup.ml +index 26f0f36..2a51166 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -6991,8 +6991,7 @@ let setup_t = + bs_path = "lib/core"; + bs_compiled_object = Best; + bs_build_depends = [FindlibPackage ("num", None)]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7054,8 +7053,7 @@ let setup_t = + FindlibPackage ("meta_conv", None); + InternalLibrary "msgpack" + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7102,8 +7100,7 @@ let setup_t = + InternalLibrary "msgpack"; + FindlibPackage ("oUnit", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7141,8 +7138,7 @@ let setup_t = + FindlibPackage ("oUnit", None); + FindlibPackage ("meta_conv.syntax", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7185,7 +7181,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_core" + ] + }); +@@ -7221,7 +7216,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_conv" + ] + }); diff --git a/patches/msgpack/no-camlp4.patch.1.2.0 b/patches/msgpack/no-camlp4.patch.1.2.0 new file mode 100644 index 0000000..c79be6b --- /dev/null +++ b/patches/msgpack/no-camlp4.patch.1.2.0 @@ -0,0 +1,73 @@ +diff --git a/_oasis b/_oasis +index f3733a5..4a7bec5 100644 +--- a/_oasis ++++ b/_oasis +@@ -13,7 +13,7 @@ Description: + MessagePack is an efficient binary serialization format. + If meta_conv is installed, conv module will be installed. + +-BuildTools: ocamlbuild, camlp4 ++BuildTools: ocamlbuild + + # ------------------------------------------------------------ + # Flags +diff --git a/setup.ml b/setup.ml +index 26f0f36..2a51166 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -6991,8 +6991,7 @@ let setup_t = + bs_path = "lib/core"; + bs_compiled_object = Best; + bs_build_depends = [FindlibPackage ("num", None)]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7054,8 +7053,7 @@ let setup_t = + FindlibPackage ("meta_conv", None); + InternalLibrary "msgpack" + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7102,8 +7100,7 @@ let setup_t = + InternalLibrary "msgpack"; + FindlibPackage ("oUnit", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7141,8 +7138,7 @@ let setup_t = + FindlibPackage ("oUnit", None); + FindlibPackage ("meta_conv.syntax", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7185,7 +7181,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_core" + ] + }); +@@ -7221,7 +7216,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_conv" + ] + }); diff --git a/patches/msgpack/no-camlp4.patch.1.2.1 b/patches/msgpack/no-camlp4.patch.1.2.1 new file mode 100644 index 0000000..c79be6b --- /dev/null +++ b/patches/msgpack/no-camlp4.patch.1.2.1 @@ -0,0 +1,73 @@ +diff --git a/_oasis b/_oasis +index f3733a5..4a7bec5 100644 +--- a/_oasis ++++ b/_oasis +@@ -13,7 +13,7 @@ Description: + MessagePack is an efficient binary serialization format. + If meta_conv is installed, conv module will be installed. + +-BuildTools: ocamlbuild, camlp4 ++BuildTools: ocamlbuild + + # ------------------------------------------------------------ + # Flags +diff --git a/setup.ml b/setup.ml +index 26f0f36..2a51166 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -6991,8 +6991,7 @@ let setup_t = + bs_path = "lib/core"; + bs_compiled_object = Best; + bs_build_depends = [FindlibPackage ("num", None)]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7054,8 +7053,7 @@ let setup_t = + FindlibPackage ("meta_conv", None); + InternalLibrary "msgpack" + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7102,8 +7100,7 @@ let setup_t = + InternalLibrary "msgpack"; + FindlibPackage ("oUnit", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7141,8 +7138,7 @@ let setup_t = + FindlibPackage ("oUnit", None); + FindlibPackage ("meta_conv.syntax", None) + ]; +- bs_build_tools = +- [ExternalTool "ocamlbuild"; ExternalTool "camlp4"]; ++ bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; +@@ -7185,7 +7181,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_core" + ] + }); +@@ -7221,7 +7216,6 @@ let setup_t = + test_tools = + [ + ExternalTool "ocamlbuild"; +- ExternalTool "camlp4"; + InternalExecutable "test_conv" + ] + }); diff --git a/patches/mstruct/build_with_trunk.patch b/patches/mstruct/build_with_trunk.patch new file mode 100644 index 0000000..067b929 --- /dev/null +++ b/patches/mstruct/build_with_trunk.patch @@ -0,0 +1,13 @@ +diff --git a/lib/mstruct.ml b/lib/mstruct.ml +index ce4c734..d43b487 100644 +--- a/lib/mstruct.ml ++++ b/lib/mstruct.ml +@@ -14,6 +14,8 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *) + ++open Bigarray ++ + type ba = Cstruct.buffer + + type t = { diff --git a/patches/mustache/add_pipe.patch b/patches/mustache/add_pipe.patch new file mode 100644 index 0000000..01918ce --- /dev/null +++ b/patches/mustache/add_pipe.patch @@ -0,0 +1,28 @@ +diff --git a/lib/mustache.ml b/lib/mustache.ml +index 6a5a146..40fb611 100644 +--- a/lib/mustache.ml ++++ b/lib/mustache.ml +@@ -5,6 +5,9 @@ module Str = Re_str + module List = ListLabels + module String = StringLabels + ++let (|>) x f = f x ++let (@@) f x = f x ++ + exception Invalid_param of string with sexp + exception Invalid_template of string with sexp + +diff --git a/lib_test/test_mustache.ml b/lib_test/test_mustache.ml +index 516c1c0..a8242f3 100644 +--- a/lib_test/test_mustache.ml ++++ b/lib_test/test_mustache.ml +@@ -2,6 +2,9 @@ open OUnit2 + open Printf + open Sexplib.Std + ++let (|>) x f = f x ++let (@@) f x = f x ++ + module List = ListLabels + module String = StringLabels + diff --git a/patches/mybuild/mybuild.install b/patches/mybuild/mybuild.install new file mode 100644 index 0000000..a862e05 --- /dev/null +++ b/patches/mybuild/mybuild.install @@ -0,0 +1,3 @@ +bin: [ + "?_build/mybuild_write_version.native" {"mybuild_write_version"} +] diff --git a/patches/nocrypto/0001-add-missing-runtime-dependencies-in-_tags.patch b/patches/nocrypto/0001-add-missing-runtime-dependencies-in-_tags.patch new file mode 100644 index 0000000..1b3b972 --- /dev/null +++ b/patches/nocrypto/0001-add-missing-runtime-dependencies-in-_tags.patch @@ -0,0 +1,47 @@ +From 6f97531287a3e3ee749f2277248af28bdc85b8e4 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Mon, 26 Mar 2018 16:09:16 +0200 +Subject: [PATCH 1/4] add missing runtime dependencies in _tags + +Binaries in , depend on ppx_sexp_conv's runtime +library within ppx_sexp_conv. + +The packed modules also depend on the package +ppx_sexp_conv: its presence at pack-creation time influences the +generated .cmi interface, see + + https://github.com/ocaml/opam-repository/pull/11628#issuecomment-375697444 + +Note: the package ppx_sexp_conv.runtime-lib would suffice, but it is +only available as such under recent ppx_sexp_conv versions, so its +explicit use would make the build description (needlessly) +incompatible with older ppx_sexp_conv versions. +--- + _tags | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/_tags b/_tags +index 6d4e7de..c2a6610 100644 +--- a/_tags ++++ b/_tags +@@ -7,6 +7,7 @@ true: package(bytes), package(cstruct) + : package(zarith), package(sexplib), package(ppx_sexp_conv) + and not : for-pack(Nocrypto) + : link_stubs(src/libnocrypto_stubs) ++: package(ppx_sexp_conv) + + : include + : package(unix), package(bytes) +@@ -19,7 +20,7 @@ true: package(bytes), package(cstruct) + + <**/*.c>: ccopt(--std=c99 -Wall -Wextra -O3) + +-: use_nocrypto, package(zarith), package(cstruct.unix) +-: use_nocrypto, package(zarith), package(oUnit) ++: use_nocrypto, package(zarith), package(ppx_sexp_conv) ++: use_nocrypto, package(zarith), package(ppx_sexp_conv), package(oUnit) + + : -traverse +-- +2.18.0 + diff --git a/patches/nocrypto/0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch b/patches/nocrypto/0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch new file mode 100644 index 0000000..e4d3439 --- /dev/null +++ b/patches/nocrypto/0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch @@ -0,0 +1,39 @@ +From dc799fd2a66c41ca7729201a5d038cd403ca1de6 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Tue, 27 Mar 2018 12:00:23 +0200 +Subject: [PATCH 2/4] add ppx_sexp_conv as a runtime dependency in the + packaging metadata + +--- + opam | 2 +- + pkg/META | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/opam b/opam +index ad1dbc7..c35570b 100644 +--- a/opam ++++ b/opam +@@ -20,7 +20,7 @@ depends: [ + "topkg" {build} + "cpuid" {build} + "ocb-stubblr" {build} +- "ppx_sexp_conv" {build} ++ "ppx_sexp_conv" + "oUnit" {test} + "cstruct" + "zarith" +diff --git a/pkg/META b/pkg/META +index 242b2bb..a7929c7 100644 +--- a/pkg/META ++++ b/pkg/META +@@ -1,6 +1,6 @@ + version = "0.5.4" + description = "Simple crypto for the modern age" +-requires = "cstruct zarith sexplib" ++requires = "cstruct zarith sexplib ppx_sexp_conv" + archive(byte) = "nocrypto.cma" + archive(native) = "nocrypto.cmxa" + plugin(byte) = "nocrypto.cma" +-- +2.18.0 + diff --git a/patches/nocrypto/0003-Auto-detect-ppx_sexp_conv-runtime-library.patch b/patches/nocrypto/0003-Auto-detect-ppx_sexp_conv-runtime-library.patch new file mode 100644 index 0000000..e2f03a1 --- /dev/null +++ b/patches/nocrypto/0003-Auto-detect-ppx_sexp_conv-runtime-library.patch @@ -0,0 +1,146 @@ +From ad9278021a65d423e30765e58110848adda4b13e Mon Sep 17 00:00:00 2001 +From: Jeremie Dimino +Date: Fri, 11 May 2018 15:44:47 +0200 +Subject: [PATCH 3/4] Auto-detect ppx_sexp_conv runtime library + +--- + myocamlbuild.ml | 25 ++++++++++++++++++++++--- + pkg/META | 43 ------------------------------------------- + pkg/META.in | 43 +++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 65 insertions(+), 46 deletions(-) + delete mode 100644 pkg/META + create mode 100644 pkg/META.in + +diff --git a/myocamlbuild.ml b/myocamlbuild.ml +index 2752315..7b29635 100644 +--- a/myocamlbuild.ml ++++ b/myocamlbuild.ml +@@ -1,5 +1,24 @@ + open Ocamlbuild_plugin + +-let () = dispatch Ocb_stubblr.( +- init & ccopt ~tags:["accelerate"] "-DACCELERATE -msse2 -maes" +-) ++let runtime_deps_of_ppx ppx = ++ (Findlib.query "ppx_sexp_conv").dependencies ++ |> List.filter_opt (fun { Findlib.name; _ } -> ++ if name = ppx || name = "ppx_deriving" then ++ None ++ else ++ Some name) ++ ++let () = dispatch (fun hook -> ++ Ocb_stubblr.( ++ init & ccopt ~tags:["accelerate"] "-DACCELERATE -msse2 -maes" ++ ) hook; ++ match hook with ++ | After_rules -> ++ let meta = "pkg/META" in ++ let meta_in = meta ^ ".in" in ++ rule meta ~dep:meta_in ~prod:meta (fun _ _ -> ++ let deps = String.concat " " (runtime_deps_of_ppx "ppx_sexp_conv") in ++ Echo([String.subst "PPX_SEXP_CONV_RUNTIME" deps ++ (Pathname.read meta_in)], ++ meta)) ++ | _ -> ()) +diff --git a/pkg/META b/pkg/META +deleted file mode 100644 +index a7929c7..0000000 +--- a/pkg/META ++++ /dev/null +@@ -1,43 +0,0 @@ +-version = "0.5.4" +-description = "Simple crypto for the modern age" +-requires = "cstruct zarith sexplib ppx_sexp_conv" +-archive(byte) = "nocrypto.cma" +-archive(native) = "nocrypto.cmxa" +-plugin(byte) = "nocrypto.cma" +-plugin(native) = "nocrypto.cmxs" +-xen_linkopts = "-lnocrypto_stubs+mirage-xen" +-freestanding_linkopts = "-lnocrypto_stubs+mirage-freestanding" +-exists_if = "nocrypto.cma" +- +-package "unix" ( +- version = "0.5.4" +- description = "Simple crypto for the modern age" +- requires = "nocrypto unix bytes" +- archive(byte) = "nocrypto_unix.cma" +- archive(native) = "nocrypto_unix.cmxa" +- plugin(byte) = "nocrypto_unix.cma" +- plugin(native) = "nocrypto_unix.cmxs" +- exists_if = "nocrypto_unix.cma" +-) +- +-package "lwt" ( +- version = "0.5.4" +- description = "Simple crypto for the modern age" +- requires = "nocrypto nocrypto.unix lwt.unix cstruct.lwt" +- archive(byte) = "nocrypto_lwt.cma" +- archive(native) = "nocrypto_lwt.cmxa" +- plugin(byte) = "nocrypto_lwt.cma" +- plugin(native) = "nocrypto_lwt.cmxs" +- exists_if = "nocrypto_lwt.cma" +-) +- +-package "mirage" ( +- version = "0.5.4" +- description = "Simple crypto for the modern age" +- requires = "nocrypto lwt mirage-entropy" +- archive(byte) = "nocrypto_mirage.cma" +- archive(native) = "nocrypto_mirage.cmxa" +- plugin(byte) = "nocrypto_mirage.cma" +- plugin(native) = "nocrypto_mirage.cmxs" +- exists_if = "nocrypto_mirage.cma" +-) +diff --git a/pkg/META.in b/pkg/META.in +new file mode 100644 +index 0000000..0b263d7 +--- /dev/null ++++ b/pkg/META.in +@@ -0,0 +1,43 @@ ++version = "0.5.4" ++description = "Simple crypto for the modern age" ++requires = "cstruct zarith sexplib PPX_SEXP_CONV_RUNTIME" ++archive(byte) = "nocrypto.cma" ++archive(native) = "nocrypto.cmxa" ++plugin(byte) = "nocrypto.cma" ++plugin(native) = "nocrypto.cmxs" ++xen_linkopts = "-lnocrypto_stubs+mirage-xen" ++freestanding_linkopts = "-lnocrypto_stubs+mirage-freestanding" ++exists_if = "nocrypto.cma" ++ ++package "unix" ( ++ version = "0.5.4" ++ description = "Simple crypto for the modern age" ++ requires = "nocrypto unix bytes" ++ archive(byte) = "nocrypto_unix.cma" ++ archive(native) = "nocrypto_unix.cmxa" ++ plugin(byte) = "nocrypto_unix.cma" ++ plugin(native) = "nocrypto_unix.cmxs" ++ exists_if = "nocrypto_unix.cma" ++) ++ ++package "lwt" ( ++ version = "0.5.4" ++ description = "Simple crypto for the modern age" ++ requires = "nocrypto nocrypto.unix lwt.unix cstruct.lwt" ++ archive(byte) = "nocrypto_lwt.cma" ++ archive(native) = "nocrypto_lwt.cmxa" ++ plugin(byte) = "nocrypto_lwt.cma" ++ plugin(native) = "nocrypto_lwt.cmxs" ++ exists_if = "nocrypto_lwt.cma" ++) ++ ++package "mirage" ( ++ version = "0.5.4" ++ description = "Simple crypto for the modern age" ++ requires = "nocrypto lwt mirage-entropy" ++ archive(byte) = "nocrypto_mirage.cma" ++ archive(native) = "nocrypto_mirage.cmxa" ++ plugin(byte) = "nocrypto_mirage.cma" ++ plugin(native) = "nocrypto_mirage.cmxs" ++ exists_if = "nocrypto_mirage.cma" ++) +-- +2.18.0 + diff --git a/patches/nocrypto/0004-pack-package-workaround-ocamlbuild-272.patch b/patches/nocrypto/0004-pack-package-workaround-ocamlbuild-272.patch new file mode 100644 index 0000000..8bda0db --- /dev/null +++ b/patches/nocrypto/0004-pack-package-workaround-ocamlbuild-272.patch @@ -0,0 +1,38 @@ +From 063b3496340fe4c3544b532ec0d27797b7917bb4 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Mon, 26 Mar 2018 16:07:45 +0200 +Subject: [PATCH 4/4] pack+package: workaround ocamlbuild#272 + +ocamlbuild should pass -package(...) flags to ocamlfind when building +a -pack-ed file, see + + https://github.com/ocaml/opam-repository/pull/11628#issuecomment-375697444 +--- + myocamlbuild.ml | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/myocamlbuild.ml b/myocamlbuild.ml +index 7b29635..7a5cdb6 100644 +--- a/myocamlbuild.ml ++++ b/myocamlbuild.ml +@@ -8,9 +8,17 @@ let runtime_deps_of_ppx ppx = + else + Some name) + ++let ocamlfind_and_pack = function ++ | After_rules -> ++ if !Options.use_ocamlfind then ++ pflag ["ocaml"; "pack"] "package" ++ (fun pkg -> S [A "-package"; A pkg]); ++ | _ -> () ++ + let () = dispatch (fun hook -> + Ocb_stubblr.( + init & ccopt ~tags:["accelerate"] "-DACCELERATE -msse2 -maes" ++ & ocamlfind_and_pack + ) hook; + match hook with + | After_rules -> +-- +2.18.0 + diff --git a/patches/nocrypto/0005-use-modern-cstruct-findlib.patch b/patches/nocrypto/0005-use-modern-cstruct-findlib.patch new file mode 100644 index 0000000..406df1c --- /dev/null +++ b/patches/nocrypto/0005-use-modern-cstruct-findlib.patch @@ -0,0 +1,32 @@ +From 063b3496340fe4c3544b532ec0d27797b7917bb4 Mon Sep 17 00:00:00 2001 +From: Anil Madhavapeddy +Date: Tue, 12 Mar 2019 09:07:13 +0000 +Subject: [PATCH 5/5] use modern cstruct findlib + +see https://discuss.ocaml.org/t/psa-cstruct-3-4-0-removes-old-ocamlfind-subpackage-aliases/3275 + +--- a/_tags.orig 2019-03-12 09:03:58.000000000 +0000 ++++ b/_tags 2019-03-12 09:04:12.000000000 +0000 +@@ -13,7 +13,7 @@ + : package(unix), package(bytes) + + : include +-: package(lwt.unix), package(cstruct.lwt) ++: package(lwt.unix), package(cstruct-lwt) + + : include + : package(lwt), package(mirage-entropy) +--- a/pkg/META.in.orig 2019-03-12 09:03:19.000000000 +0000 ++++ b/pkg/META.in 2019-03-12 09:03:33.000000000 +0000 +@@ -23,7 +23,7 @@ + package "lwt" ( + version = "0.5.4" + description = "Simple crypto for the modern age" +- requires = "nocrypto nocrypto.unix lwt.unix cstruct.lwt" ++ requires = "nocrypto nocrypto.unix lwt.unix cstruct-lwt" + archive(byte) = "nocrypto_lwt.cma" + archive(native) = "nocrypto_lwt.cmxa" + plugin(byte) = "nocrypto_lwt.cma" +-- +2.18.0 + diff --git a/patches/nocrypto/0006-explicit-dependency-on-sexplib.patch b/patches/nocrypto/0006-explicit-dependency-on-sexplib.patch new file mode 100644 index 0000000..80c8075 --- /dev/null +++ b/patches/nocrypto/0006-explicit-dependency-on-sexplib.patch @@ -0,0 +1,24 @@ +From 063b3496340fe4c3544b532ec0d27797b7917bb4 Mon Sep 17 00:00:00 2001 +From: Anil Madhavapeddy +Date: Tue, 26 Mar 2019 20:07:13 +0000 +Subject: [PATCH 6/6] explicitly depend on sexplib + +Need to explicitly depend on sexplib rather than hope +it is a transitive dependency of cstruct. This lets +cstruct.4.0.0 work which makes sexplib optional. + +--- a/_tags.orig 2019-03-26 20:33:33.000000000 +0000 ++++ b/_tags 2019-03-26 20:33:42.000000000 +0000 +@@ -1,7 +1,7 @@ + true: color(always) + true: bin_annot, safe_string + true: warn(A-4-29-33-40-41-42-43-34-44-48) +-true: package(bytes), package(cstruct) ++true: package(bytes), package(sexplib), package(cstruct) + + : include + : package(zarith), package(sexplib), package(ppx_sexp_conv) + +-- +2.18.0 + diff --git a/patches/nocrypto/0007-mirage-entropy.patch b/patches/nocrypto/0007-mirage-entropy.patch new file mode 100644 index 0000000..559c063 --- /dev/null +++ b/patches/nocrypto/0007-mirage-entropy.patch @@ -0,0 +1,58 @@ +From: Hannes Mehnert +Subject: [PATCH 1/1] compile mirage-entropy sublibrary if mirage-entropy is installed + +Previously the compilation depended on mirage-xen or ocaml-freestanding being +present, but _tags show the dependency is actually mirage-entropy. + +--- a/opam 2019-11-02 13:38:17.202429000 +0100 ++++ b/opam 2019-11-02 13:39:19.173535000 +0100 +@@ -12,6 +12,7 @@ + + build: ["ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" "--tests" "false" + "--with-lwt" "%{lwt:installed}%" ++ "--with-mirage" "%{mirage-entropy:installed}%" + "--xen" "%{mirage-xen:installed}%" + "--freestanding" "%{ocaml-freestanding:installed}%"] + +@@ -26,11 +27,11 @@ + "cstruct" + "zarith" + "sexplib" +- ("mirage-no-xen" | ("mirage-xen" & "mirage-entropy" & "zarith-xen")) +- ("mirage-no-solo5" | ("mirage-solo5" & "mirage-entropy" & "zarith-freestanding")) ++ ("mirage-no-xen" | ("mirage-xen" & "zarith-xen")) ++ ("mirage-no-solo5" | ("mirage-solo5" & "zarith-freestanding")) + ] + +-depopts: [ "lwt" ] ++depopts: [ "lwt" "mirage-entropy" ] + conflicts: [ + "topkg" {<"0.8.0"} + "ocb-stubblr" {<"0.1.0"} +--- a/pkg/pkg.ml 2017-02-01 00:43:04.000000000 +0100 ++++ b/pkg/pkg.ml 2019-11-02 13:37:30.295780000 +0100 +@@ -11,6 +11,7 @@ + + let unix = Conf.with_pkg ~default:true "unix" + let lwt = Conf.with_pkg ~default:false "lwt" ++let mirage_entropy = Conf.with_pkg ~default:false "mirage" + let xen = Conf.(key "xen" bool ~absent:false + ~doc:"Build Mirage/Xen support.") + let fs = Conf.(key "freestanding" bool ~absent:false +@@ -39,12 +40,14 @@ + let unix = Conf.value c unix in + let lwt = Conf.value c lwt && unix + and xen = Conf.value c xen +- and fs = Conf.value c fs in ++ and fs = Conf.value c fs ++ and mirage_entropy = Conf.value c mirage_entropy ++ in + Ok [ Pkg.clib "src/libnocrypto_stubs.clib"; + Pkg.mllib "src/nocrypto.mllib"; + Pkg.mllib ~cond:unix "unix/nocrypto_unix.mllib"; + Pkg.mllib ~cond:lwt "lwt/nocrypto_lwt.mllib"; +- Pkg.mllib ~cond:(xen||fs) "mirage/nocrypto_mirage.mllib"; ++ Pkg.mllib ~cond:mirage_entropy "mirage/nocrypto_mirage.mllib"; + Pkg.test "tests/testrunner"; + Pkg.test ~run:false "bench/speed"; + mirage ~xen ~fs "src/libnocrypto_stubs.clib"; ] diff --git a/patches/nocrypto/postconf.patch b/patches/nocrypto/postconf.patch new file mode 100644 index 0000000..54af46d --- /dev/null +++ b/patches/nocrypto/postconf.patch @@ -0,0 +1,18 @@ +--- a/postconf ++++ b/postconf +@@ -13,7 +13,7 @@ echo "XEN_CFLAGS=\"${XEN_CFLAGS}\"" >> setup.data + # * unsupported by the current toolchain; or + # * disabled via NOCRYPTO_NO_ACCEL env var. + # +-function test_platform { ++test_platform () { + CPUDETECT=$(mktemp -t nocrypto.XXXXXX) + (cc src/native/cpudetect_static.c -o ${CPUDETECT} > /dev/null 2>&1 && ${CPUDETECT}) + ok=$? +@@ -21,5 +21,5 @@ function test_platform { + return $ok + } + if grep -q '^modernity="true"' setup.data; then +- [[ -z $NOCRYPTO_NO_ACCEL ]] && test_platform || echo "modernity=\"false\"" >> setup.data ++ [ -z $NOCRYPTO_NO_ACCEL ] && test_platform || echo "modernity=\"false\"" >> setup.data + fi diff --git a/patches/nocrypto/werror.patch.0.5.0 b/patches/nocrypto/werror.patch.0.5.0 new file mode 100644 index 0000000..dc8575c --- /dev/null +++ b/patches/nocrypto/werror.patch.0.5.0 @@ -0,0 +1,72 @@ +--- a/setup.ml 2019-04-16 15:03:37.793002055 +0100 ++++ b/setup.ml 2019-04-16 15:03:49.008933634 +0100 +@@ -7020,7 +7020,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3" + ]); + (OASISExpr.EAnd +@@ -7030,7 +7029,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-msse2"; + "-maes" +@@ -7196,7 +7194,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-DNDEBUG"; + "${XEN_CFLAGS}" +@@ -7208,7 +7205,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-DNDEBUG"; + "${XEN_CFLAGS}"; +--- a/myocamlbuild.ml 2019-04-16 15:03:35.797014198 +0100 ++++ b/myocamlbuild.ml 2019-04-16 15:04:00.636862379 +0100 +@@ -654,8 +654,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3" + ]); + (OASISExpr.EAnd +@@ -670,8 +668,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-msse2"; +@@ -700,8 +696,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-DNDEBUG"; +@@ -720,8 +714,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-DNDEBUG"; diff --git a/patches/nocrypto/werror.patch.0.5.1 b/patches/nocrypto/werror.patch.0.5.1 new file mode 100644 index 0000000..793652e --- /dev/null +++ b/patches/nocrypto/werror.patch.0.5.1 @@ -0,0 +1,72 @@ +--- a/setup.ml 2019-04-16 15:02:32.357394398 +0100 ++++ b/setup.ml 2019-04-16 15:02:45.789314884 +0100 +@@ -7021,7 +7021,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3" + ]); + (OASISExpr.EAnd +@@ -7031,7 +7030,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-msse2"; + "-maes" +@@ -7197,7 +7195,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-DNDEBUG"; + "${XEN_CFLAGS}" +@@ -7209,7 +7206,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-DNDEBUG"; + "${XEN_CFLAGS}"; +--- a/myocamlbuild.ml 2019-04-16 15:02:34.961379028 +0100 ++++ b/myocamlbuild.ml 2019-04-16 16:15:30.751484060 +0100 +@@ -654,8 +654,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3" + ]); + (OASISExpr.EAnd +@@ -670,8 +668,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-msse2"; +@@ -700,8 +696,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-DNDEBUG"; +@@ -720,8 +714,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-DNDEBUG"; diff --git a/patches/nocrypto/werror.patch.0.5.2 b/patches/nocrypto/werror.patch.0.5.2 new file mode 100644 index 0000000..48f323e --- /dev/null +++ b/patches/nocrypto/werror.patch.0.5.2 @@ -0,0 +1,72 @@ +--- a/setup.ml 2019-04-16 14:57:33.467531887 +0100 ++++ b/setup.ml 2019-04-16 15:06:59.227695456 +0100 +@@ -7031,7 +7031,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3" + ]); + (OASISExpr.EAnd +@@ -7041,7 +7040,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-DACCELERATE"; + "-msse2"; +@@ -7208,7 +7206,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-DNDEBUG"; + "${XEN_CFLAGS}" +@@ -7220,7 +7217,6 @@ + "--std=c99"; + "-Wall"; + "-Wextra"; +- "-Werror"; + "-O3"; + "-DNDEBUG"; + "${XEN_CFLAGS}"; +--- a/myocamlbuild.ml 2019-04-16 14:57:38.307496074 +0100 ++++ b/myocamlbuild.ml 2019-04-16 14:58:02.587317168 +0100 +@@ -654,8 +654,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3" + ]); + (OASISExpr.EAnd +@@ -670,8 +668,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-DACCELERATE"; +@@ -702,8 +698,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-DNDEBUG"; +@@ -722,8 +716,6 @@ + A "-ccopt"; + A "-Wextra"; + A "-ccopt"; +- A "-Werror"; +- A "-ccopt"; + A "-O3"; + A "-ccopt"; + A "-DNDEBUG"; diff --git a/patches/nocrypto/werror.patch.0.5.3 b/patches/nocrypto/werror.patch.0.5.3 new file mode 100644 index 0000000..36644f0 --- /dev/null +++ b/patches/nocrypto/werror.patch.0.5.3 @@ -0,0 +1,20 @@ +--- a/_oasis 2019-04-14 18:53:58.732983307 +0100 ++++ b/_oasis 2019-04-16 13:22:25.459958829 +0100 +@@ -73,7 +73,7 @@ + XMETARequires: cstruct, zarith, sexplib + XMETAExtraLines: xen_linkopts = "-lnocrypto_xen_stubs" + ByteOpt: -w A-4-29-33-40-41-42-43-34-44 +- CCOpt: --std=c99 -Wall -Wextra -Werror -O3 ++ CCOpt: --std=c99 -Wall -Wextra -O3 + if flag(modernity) && architecture(amd64) + CCOpt+: -DACCELERATE -msse2 -maes + +@@ -117,7 +117,7 @@ + native/des/generic.h + BuildDepends: nocrypto, mirage-entropy-xen + XMETARequires: nocrypto, lwt, mirage-entropy-xen +- CCOpt: --std=c99 -Wall -Wextra -Werror -O3 -DNDEBUG $XEN_CFLAGS ++ CCOpt: --std=c99 -Wall -Wextra -O3 -DNDEBUG $XEN_CFLAGS + if flag(modernity) && architecture(amd64) + CCOpt+: -DACCELERATE -msse2 -maes + diff --git a/patches/num/findlib-install.patch.1.0 b/patches/num/findlib-install.patch.1.0 new file mode 100644 index 0000000..146d5ea --- /dev/null +++ b/patches/num/findlib-install.patch.1.0 @@ -0,0 +1,129 @@ +From 1a75e61a92fbd79ac4231a4cd62dc4717a4e7cfd Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 10 Jan 2018 15:20:46 +0000 +Subject: [PATCH] Provide findlib-install target + +Allows installing the entire library using ocamlfind. +--- + Makefile | 10 +++++++++- + src/META | 17 ----------------- + src/META.in | 19 +++++++++++++++++++ + src/Makefile | 17 +++++++++++++++-- + 4 files changed, 43 insertions(+), 20 deletions(-) + delete mode 100644 src/META + create mode 100644 src/META.in + +diff --git a/Makefile b/Makefile +index 6a5d08f..b40e588 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,8 +14,16 @@ install: + $(MAKE) -C src install + $(MAKE) -C toplevel install + ++findlib-install: ++ $(MAKE) -C src findlib-install ++ $(MAKE) -C toplevel install ++ + uninstall: + $(MAKE) -C src uninstall + $(MAKE) -C toplevel uninstall + +-.PHONY: all test clean install uninstall ++findlib-uninstall: ++ $(MAKE) -C src findlib-uninstall ++ $(MAKE) -C toplevel uninstall ++ ++.PHONY: all test clean install uninstall findlib-install findlib-uninstall +diff --git a/src/META b/src/META +deleted file mode 100644 +index 66ac170..0000000 +--- a/src/META ++++ /dev/null +@@ -1,17 +0,0 @@ +-# This META is the one provided by findlib when the "num" library was +-# part of the core OCaml distribution. For backward compatibility, +-# it installs into OCaml's standard library directory, not in a subdirectory +- +-requires = "num.core" +-requires(toploop) = "num.core,num-top" +-version = "1.0" +-description = "Arbitrary-precision rational arithmetic" +-package "core" ( +- directory = "^" +- version = "1.0" +- browse_interfaces = "" +- archive(byte) = "nums.cma" +- archive(native) = "nums.cmxa" +- plugin(byte) = "nums.cma" +- plugin(native) = "nums.cmxs" +-) +diff --git a/src/META.in b/src/META.in +new file mode 100644 +index 0000000..b5678b7 +--- /dev/null ++++ b/src/META.in +@@ -0,0 +1,19 @@ ++# This META is the one provided by findlib when the "num" library was ++# part of the core OCaml distribution. For backward compatibility, ++# it is installed into OCaml's standard library directory. If the ++# directory line below is removed, then it's installed in a ++# subdirectory, as normal for a findlib package. ++ ++requires = "num.core" ++requires(toploop) = "num.core,num-top" ++version = "1.0" ++description = "Arbitrary-precision rational arithmetic" ++package "core" ( ++ directory = "^" ++ version = "1.0" ++ browse_interfaces = "" ++ archive(byte) = "nums.cma" ++ archive(native) = "nums.cmxa" ++ plugin(byte) = "nums.cma" ++ plugin(native) = "nums.cmxs" ++) +diff --git a/src/Makefile b/src/Makefile +index ab6a5b6..a9f39ca 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -79,21 +79,34 @@ endif + ifeq "$(NATDYNLINK)" "true" + TOINSTALL+=nums.cmxs + endif ++ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + TOINSTALL_STUBS=dllnums.$(SO) ++else ++TOINSTALL_STUBS= ++endif + + install: ++ cp META.in META + $(OCAMLFIND) install num META ++ rm -f META + $(INSTALL) $(TOINSTALL) $(STDLIBDIR) + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + $(INSTALL) $(TOINSTALL_STUBS) $(STDLIBDIR)/stublibs + endif + +-uninstall: ++findlib-install: ++ grep -Fv '^' META.in > META ++ $(OCAMLFIND) install num META $(TOINSTALL) $(TOINSTALL_STUBS) ++ rm -f META ++ ++findlib-uninstall: ++ $(OCAMLFIND) remove num ++ ++uninstall: findlib-uninstall + cd $(STDLIBDIR) && rm -f $(TOINSTALL) + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + cd $(STDLIBDIR)/stublibs && rm -f $(TOINSTALL_STUBS) + endif +- $(OCAMLFIND) remove num + + clean: + rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO) +-- +2.14.1 + diff --git a/patches/num/findlib-install.patch.1.1 b/patches/num/findlib-install.patch.1.1 new file mode 100644 index 0000000..d2837ff --- /dev/null +++ b/patches/num/findlib-install.patch.1.1 @@ -0,0 +1,129 @@ +From 7688bb4fea24463c92e9c4870acc08495a4c77cb Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 10 Jan 2018 15:20:46 +0000 +Subject: [PATCH] Provide findlib-install target + +Allows installing the entire library using ocamlfind. +--- + Makefile | 10 +++++++++- + src/META | 17 ----------------- + src/META.in | 19 +++++++++++++++++++ + src/Makefile | 17 +++++++++++++++-- + 4 files changed, 43 insertions(+), 20 deletions(-) + delete mode 100644 src/META + create mode 100644 src/META.in + +diff --git a/Makefile b/Makefile +index 6a5d08f..b40e588 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,8 +14,16 @@ install: + $(MAKE) -C src install + $(MAKE) -C toplevel install + ++findlib-install: ++ $(MAKE) -C src findlib-install ++ $(MAKE) -C toplevel install ++ + uninstall: + $(MAKE) -C src uninstall + $(MAKE) -C toplevel uninstall + +-.PHONY: all test clean install uninstall ++findlib-uninstall: ++ $(MAKE) -C src findlib-uninstall ++ $(MAKE) -C toplevel uninstall ++ ++.PHONY: all test clean install uninstall findlib-install findlib-uninstall +diff --git a/src/META b/src/META +deleted file mode 100644 +index 66ac170..0000000 +--- a/src/META ++++ /dev/null +@@ -1,17 +0,0 @@ +-# This META is the one provided by findlib when the "num" library was +-# part of the core OCaml distribution. For backward compatibility, +-# it installs into OCaml's standard library directory, not in a subdirectory +- +-requires = "num.core" +-requires(toploop) = "num.core,num-top" +-version = "1.0" +-description = "Arbitrary-precision rational arithmetic" +-package "core" ( +- directory = "^" +- version = "1.0" +- browse_interfaces = "" +- archive(byte) = "nums.cma" +- archive(native) = "nums.cmxa" +- plugin(byte) = "nums.cma" +- plugin(native) = "nums.cmxs" +-) +diff --git a/src/META.in b/src/META.in +new file mode 100644 +index 0000000..b5678b7 +--- /dev/null ++++ b/src/META.in +@@ -0,0 +1,19 @@ ++# This META is the one provided by findlib when the "num" library was ++# part of the core OCaml distribution. For backward compatibility, ++# it is installed into OCaml's standard library directory. If the ++# directory line below is removed, then it's installed in a ++# subdirectory, as normal for a findlib package. ++ ++requires = "num.core" ++requires(toploop) = "num.core,num-top" ++version = "1.0" ++description = "Arbitrary-precision rational arithmetic" ++package "core" ( ++ directory = "^" ++ version = "1.0" ++ browse_interfaces = "" ++ archive(byte) = "nums.cma" ++ archive(native) = "nums.cmxa" ++ plugin(byte) = "nums.cma" ++ plugin(native) = "nums.cmxs" ++) +diff --git a/src/Makefile b/src/Makefile +index 97dc074..ff271fe 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -80,21 +80,34 @@ endif + ifeq "$(NATDYNLINK)" "true" + TOINSTALL+=nums.cmxs + endif ++ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + TOINSTALL_STUBS=dllnums.$(SO) ++else ++TOINSTALL_STUBS= ++endif + + install: ++ cp META.in META + $(OCAMLFIND) install num META ++ rm -f META + $(INSTALL_DATA) $(TOINSTALL) $(STDLIBDIR) + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + $(INSTALL_DLL) $(TOINSTALL_STUBS) $(STDLIBDIR)/stublibs + endif + +-uninstall: ++findlib-install: ++ grep -Fv '^' META.in > META ++ $(OCAMLFIND) install num META $(TOINSTALL) $(TOINSTALL_STUBS) ++ rm -f META ++ ++findlib-uninstall: ++ $(OCAMLFIND) remove num ++ ++uninstall: findlib-uninstall + cd $(STDLIBDIR) && rm -f $(TOINSTALL) + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + cd $(STDLIBDIR)/stublibs && rm -f $(TOINSTALL_STUBS) + endif +- $(OCAMLFIND) remove num + + clean: + rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO) +-- +2.14.1 + diff --git a/patches/num/installation-warning.patch b/patches/num/installation-warning.patch new file mode 100644 index 0000000..88ef9b6 --- /dev/null +++ b/patches/num/installation-warning.patch @@ -0,0 +1,59 @@ +From db8d748b2cad0adc2698e9fcf28727083a711bae Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 24 Jan 2018 16:01:56 +0000 +Subject: [PATCH] Warn about installations broken by previous faulty package + +--- + Makefile | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +diff --git a/Makefile b/Makefile +index b40e588..d4dcd70 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,9 +14,42 @@ install: + $(MAKE) -C src install + $(MAKE) -C toplevel install + ++OCAMLFIND_DIR:=$(dir $(shell command -v ocamlfind 2>/dev/null)) ++OCAMLC_DIR:=$(dir $(shell command -v ocamlc 2>/dev/null)) ++NUM_INSTALLED:=$(shell ocamlfind query num 2>/dev/null) ++ ++ifeq ($(NUM_INSTALLED),) ++# The num findlib package is not already present - wohoo! ++OUR_FAULT=no ++else ++ifeq ($(OCAMLFIND_DIR),$(OCAMLC_DIR)) ++# The num findlib package is present, but ocamlc and ocamlfind are in the ++# same place, which means that either we're looking at a system-installed ++# ocamlfind (which isn't supported), or the user has done something else ++# nefarious and doesn't deserve our sympathy (or, at least, our potentially ++# unhelpful advice) ++OUR_FAULT=no ++else ++# The num findlib package package is present, and ocamlc and ocamlfind reside ++# in different directories, which means that we're almost certainly looking at ++# a system switch which has been damaged by a previous num package installation ++# on an OS which didn't protect the system lib directory. ++OUR_FAULT=probably ++endif ++endif ++ + findlib-install: ++ifeq ($(OUR_FAULT),no) + $(MAKE) -C src findlib-install + $(MAKE) -C toplevel install ++else ++ @echo "\033[0;31m[ERROR]\033[m It appears that the num library was previously installed to your system" ++ @echo " compiler's lib directory, probably by a faulty opam package." ++ @echo " You will need to remove arith_flags.*, arith_status.*, big_int.*," ++ @echo " int_misc.*, nat.*, num.*, ratio.*, nums.*, libnums.* and" ++ @echo " stublibs/dllnums.* from $(shell ocamlc -where)." ++ @false ++endif + + uninstall: + $(MAKE) -C src uninstall +-- +2.14.1 + diff --git a/patches/nuscr/fix-cram-tests.patch b/patches/nuscr/fix-cram-tests.patch new file mode 100644 index 0000000..df1bcc2 --- /dev/null +++ b/patches/nuscr/fix-cram-tests.patch @@ -0,0 +1,105 @@ +From ba4c7b2513f40c8c1c39ff5a448c4295d463dd13 Mon Sep 17 00:00:00 2001 +From: Fangyi Zhou +Date: Wed, 20 Sep 2023 09:35:48 +0100 +Subject: [PATCH] Fix mysterious test failures + +--- + test/cram-tests/codegen/ocaml-codegen.t/run.t | 2 ++ + test/cram-tests/codegen/ocaml-monadic-codegen.t/run.t | 2 ++ + test/cram-tests/refinements/annotated-fsm.t/run.t | 1 + + test/cram-tests/refinements/state-var-contract.t/run.t | 1 + + test/cram-tests/refinements/state-var-higher-lower.t/run.t | 3 +++ + 5 files changed, 9 insertions(+) + +diff --git a/test/cram-tests/codegen/ocaml-codegen.t/run.t b/test/cram-tests/codegen/ocaml-codegen.t/run.t +index 68db5895..5b00c385 100644 +--- a/test/cram-tests/codegen/ocaml-codegen.t/run.t ++++ b/test/cram-tests/codegen/ocaml-codegen.t/run.t +@@ -15,6 +15,7 @@ Show EFSM for Client and Server + 6 -> 7 [label="S?bye()", ]; + + } ++ + $ nuscr --fsm=S@Adder Adder.nuscr + digraph G { + 0; +@@ -31,6 +32,7 @@ Show EFSM for Client and Server + 6 -> 7 [label="C!bye()", ]; + + } ++ + Generate OCaml code for Adders Client + $ nuscr --gencode-ocaml=C@Adder Adder.nuscr > C.ml + Generate OCaml code for Adders Server +diff --git a/test/cram-tests/codegen/ocaml-monadic-codegen.t/run.t b/test/cram-tests/codegen/ocaml-monadic-codegen.t/run.t +index ed459018..8ad25927 100644 +--- a/test/cram-tests/codegen/ocaml-monadic-codegen.t/run.t ++++ b/test/cram-tests/codegen/ocaml-monadic-codegen.t/run.t +@@ -15,6 +15,7 @@ Show EFSM for Client and Server + 6 -> 7 [label="S?bye()", ]; + + } ++ + $ nuscr --fsm=S@Adder Adder.nuscr + digraph G { + 0; +@@ -31,6 +32,7 @@ Show EFSM for Client and Server + 6 -> 7 [label="C!bye()", ]; + + } ++ + Generate OCaml code for Adders Client + $ nuscr --gencode-ocaml-monadic=C@Adder Adder.nuscr > C.ml + Generate OCaml code for Adders Server +diff --git a/test/cram-tests/refinements/annotated-fsm.t/run.t b/test/cram-tests/refinements/annotated-fsm.t/run.t +index e3d0db1a..5bf61826 100644 +--- a/test/cram-tests/refinements/annotated-fsm.t/run.t ++++ b/test/cram-tests/refinements/annotated-fsm.t/run.t +@@ -13,6 +13,7 @@ Expecting recursion expressions to be correctly attached. + 5 -> 6 [label="A!Total(sum: (sum:int{sum = count}))", ]; + + } ++ + + Var info should be as follows: + 0 should have rec var: count +diff --git a/test/cram-tests/refinements/state-var-contract.t/run.t b/test/cram-tests/refinements/state-var-contract.t/run.t +index 6e7b753c..2b761191 100644 +--- a/test/cram-tests/refinements/state-var-contract.t/run.t ++++ b/test/cram-tests/refinements/state-var-contract.t/run.t +@@ -28,6 +28,7 @@ Print FSM for C@Contract + 9 -> 10 [label="P?confirm()", ]; + + } ++ + Print State Variables: + $ nuscr --gencode-fstar C@Contract Contract.nuscr + module Generated +diff --git a/test/cram-tests/refinements/state-var-higher-lower.t/run.t b/test/cram-tests/refinements/state-var-higher-lower.t/run.t +index a4a09620..9c449147 100644 +--- a/test/cram-tests/refinements/state-var-higher-lower.t/run.t ++++ b/test/cram-tests/refinements/state-var-higher-lower.t/run.t +@@ -412,6 +412,7 @@ Show HigherLower FSM and State variables. + 2 -> 9 [label="B?win() x && t = 1})>", ]; + + } ++ + digraph G { + 0; + 1; +@@ -439,6 +440,7 @@ Show HigherLower FSM and State variables. + 13 -> 14 [label="A!win()", ]; + + } ++ + digraph G { + 0 [label="!silent t: (t:int{0 < t}) = + t0", ]; +@@ -455,6 +457,7 @@ Show HigherLower FSM and State variables. + 2 -> 8 [label="B?lose(ignore: (ignore:unit{n <> x && t = 1}))", ]; + + } ++ + State 0 has variables: (empty) + State 1 has variables: {n: (n:int{0 <= n && n < 100})} + State 2 has variables: {n: (n:int{0 <= n && n < 100}); t0: (t0:int{0 < t0}); t: (t:int{0 < t})} diff --git a/patches/oasis-mirage/oasis.install b/patches/oasis-mirage/oasis.install new file mode 100644 index 0000000..7eb0043 --- /dev/null +++ b/patches/oasis-mirage/oasis.install @@ -0,0 +1,3 @@ +bin: [ + "_build/src/cli/Main.byte" {"oasis"} +] diff --git a/patches/oasis/_oasis_remove_.ml b/patches/oasis/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/oasis/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/oasis/oasis.install.0.2.0 b/patches/oasis/oasis.install.0.2.0 new file mode 100644 index 0000000..1abd97b --- /dev/null +++ b/patches/oasis/oasis.install.0.2.0 @@ -0,0 +1 @@ +bin: ["_build/src/cli/oasis"] diff --git a/patches/oasis/oasis.install.0.3.0 b/patches/oasis/oasis.install.0.3.0 new file mode 100644 index 0000000..f4c047a --- /dev/null +++ b/patches/oasis/oasis.install.0.3.0 @@ -0,0 +1 @@ +bin: ["_build/src/cli/Main.byte" {"oasis"}] diff --git a/patches/oasis/oasis.install.0.4.0 b/patches/oasis/oasis.install.0.4.0 new file mode 100644 index 0000000..f4c047a --- /dev/null +++ b/patches/oasis/oasis.install.0.4.0 @@ -0,0 +1 @@ +bin: ["_build/src/cli/Main.byte" {"oasis"}] diff --git a/patches/oasis/oasis.install.0.4.1 b/patches/oasis/oasis.install.0.4.1 new file mode 100644 index 0000000..f4c047a --- /dev/null +++ b/patches/oasis/oasis.install.0.4.1 @@ -0,0 +1 @@ +bin: ["_build/src/cli/Main.byte" {"oasis"}] diff --git a/patches/oasis/oasis.install.0.4.10 b/patches/oasis/oasis.install.0.4.10 new file mode 100644 index 0000000..075d452 --- /dev/null +++ b/patches/oasis/oasis.install.0.4.10 @@ -0,0 +1,5 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" +] diff --git a/patches/oasis/oasis.install.0.4.11 b/patches/oasis/oasis.install.0.4.11 new file mode 100644 index 0000000..075d452 --- /dev/null +++ b/patches/oasis/oasis.install.0.4.11 @@ -0,0 +1,5 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" +] diff --git a/patches/oasis/oasis.install.0.4.2 b/patches/oasis/oasis.install.0.4.2 new file mode 100644 index 0000000..f4c047a --- /dev/null +++ b/patches/oasis/oasis.install.0.4.2 @@ -0,0 +1 @@ +bin: ["_build/src/cli/Main.byte" {"oasis"}] diff --git a/patches/oasis/oasis.install.0.4.3 b/patches/oasis/oasis.install.0.4.3 new file mode 100644 index 0000000..f4c047a --- /dev/null +++ b/patches/oasis/oasis.install.0.4.3 @@ -0,0 +1 @@ +bin: ["_build/src/cli/Main.byte" {"oasis"}] diff --git a/patches/oasis/oasis.install.0.4.4 b/patches/oasis/oasis.install.0.4.4 new file mode 100644 index 0000000..f4c047a --- /dev/null +++ b/patches/oasis/oasis.install.0.4.4 @@ -0,0 +1 @@ +bin: ["_build/src/cli/Main.byte" {"oasis"}] diff --git a/patches/oasis/oasis.install.0.4.5 b/patches/oasis/oasis.install.0.4.5 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/oasis/oasis.install.0.4.5 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/oasis/oasis.install.0.4.6 b/patches/oasis/oasis.install.0.4.6 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/oasis/oasis.install.0.4.6 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/oasis/oasis.install.0.4.7 b/patches/oasis/oasis.install.0.4.7 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/oasis/oasis.install.0.4.7 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/oasis/oasis.install.0.4.8 b/patches/oasis/oasis.install.0.4.8 new file mode 100644 index 0000000..075d452 --- /dev/null +++ b/patches/oasis/oasis.install.0.4.8 @@ -0,0 +1,5 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" +] diff --git a/patches/oasis2debian/oasis.install b/patches/oasis2debian/oasis.install new file mode 100644 index 0000000..075d452 --- /dev/null +++ b/patches/oasis2debian/oasis.install @@ -0,0 +1,5 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" +] diff --git a/patches/oasis2opam/_oasis_remove_.ml b/patches/oasis2opam/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/oasis2opam/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/oasis2opam/oasis2opam.install.0.2 b/patches/oasis2opam/oasis2opam.install.0.2 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.2.1 b/patches/oasis2opam/oasis2opam.install.0.2.1 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.2.2 b/patches/oasis2opam/oasis2opam.install.0.2.2 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.2.3 b/patches/oasis2opam/oasis2opam.install.0.2.3 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.2.4 b/patches/oasis2opam/oasis2opam.install.0.2.4 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.2.5 b/patches/oasis2opam/oasis2opam.install.0.2.5 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.2.6 b/patches/oasis2opam/oasis2opam.install.0.2.6 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2.6 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.2.7 b/patches/oasis2opam/oasis2opam.install.0.2.7 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.2.7 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.3.0 b/patches/oasis2opam/oasis2opam.install.0.3.0 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.3.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.3.1 b/patches/oasis2opam/oasis2opam.install.0.3.1 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.3.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.3.2 b/patches/oasis2opam/oasis2opam.install.0.3.2 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.3.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.3.3 b/patches/oasis2opam/oasis2opam.install.0.3.3 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.3.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.3.4 b/patches/oasis2opam/oasis2opam.install.0.3.4 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.3.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.3.5 b/patches/oasis2opam/oasis2opam.install.0.3.5 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.3.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.3.6 b/patches/oasis2opam/oasis2opam.install.0.3.6 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.3.6 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.4.0 b/patches/oasis2opam/oasis2opam.install.0.4.0 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.4.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.4.4 b/patches/oasis2opam/oasis2opam.install.0.4.4 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.4.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.4.5 b/patches/oasis2opam/oasis2opam.install.0.4.5 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.4.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.5.0 b/patches/oasis2opam/oasis2opam.install.0.5.0 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.5.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.5.1 b/patches/oasis2opam/oasis2opam.install.0.5.1 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.5.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.6.0 b/patches/oasis2opam/oasis2opam.install.0.6.0 new file mode 100644 index 0000000..7e2edcf --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.6.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oasis2opam.byte" {"oasis2opam"} + "?_build/src/oasis2opam.native" {"oasis2opam"} +] diff --git a/patches/oasis2opam/oasis2opam.install.0.6.1 b/patches/oasis2opam/oasis2opam.install.0.6.1 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.6.1 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/oasis2opam/oasis2opam.install.0.6.2 b/patches/oasis2opam/oasis2opam.install.0.6.2 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/oasis2opam/oasis2opam.install.0.6.2 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/obigstore/obigstore-unset-warn-error.diff b/patches/obigstore/obigstore-unset-warn-error.diff new file mode 100644 index 0000000..677baf6 --- /dev/null +++ b/patches/obigstore/obigstore-unset-warn-error.diff @@ -0,0 +1,12 @@ +diff -r -u obigstore-obigstore-0.9.1.orig/OMakefile obigstore-obigstore-0.9.1/OMakefile +--- obigstore-obigstore-0.9.1.orig/OMakefile 2014-01-08 08:00:20.000000000 -0500 ++++ obigstore-obigstore-0.9.1/OMakefile 2015-04-07 14:25:59.056019978 -0400 +@@ -31,7 +31,7 @@ + .PHONY: install + .PHONY: uninstall + +-OCAMLFLAGS = -g -thread -w +a-4-6-9-27..29-32..99 -warn-error +a-4-6-9-18-27-28-29..99 ++OCAMLFLAGS = -g -thread -w +a-4-6-9-27..29-32..99 -warn-error -a + OCAMLFINDFLAGS = -syntax camlp4o -ppopt -lwt-debug + CFLAGS = -g -Wall -O2 -fPIC + diff --git a/patches/obuild/obuild.install b/patches/obuild/obuild.install new file mode 100644 index 0000000..dca0ada --- /dev/null +++ b/patches/obuild/obuild.install @@ -0,0 +1,4 @@ +bin: [ + "dist/build/obuild/obuild" + "dist/build/obuild-simple/obuild-simple" +] diff --git a/patches/ocaml-arg/ocaml-arg.install b/patches/ocaml-arg/ocaml-arg.install new file mode 100644 index 0000000..5b51d68 --- /dev/null +++ b/patches/ocaml-arg/ocaml-arg.install @@ -0,0 +1,8 @@ +lib: [ + "_build/src/arg.cma" + "_build/src/arg.cmxa" + "_build/src/arg.a" + "_build/src/argExt.cmi" + "_build/src/subCommand.cmi" + "_build/src/formatExt.cmi" +] diff --git a/patches/ocaml-base-compiler/0001-Re-generate-configure.patch b/patches/ocaml-base-compiler/0001-Re-generate-configure.patch new file mode 100644 index 0000000..7921fae --- /dev/null +++ b/patches/ocaml-base-compiler/0001-Re-generate-configure.patch @@ -0,0 +1,119 @@ +From 08cf969ee4d728e60bbda3113e95c52b2637d2b7 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Wed, 13 Jul 2022 11:23:51 +0200 +Subject: [PATCH] Re-generate configure + +to turn off -Werror ; see https://github.com/ocaml/opam-repository/pull/21630 +--- + configure | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/configure b/configure +index d9cc166e0e..1a760cc179 100755 +--- a/configure ++++ b/configure +@@ -1,6 +1,6 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.69 for OCaml 4.09.1+dev1-2020-03-13. ++# Generated by GNU Autoconf 2.69 for OCaml 4.09.1. + # + # Report bugs to . + # +@@ -590,8 +590,8 @@ MAKEFLAGS= + # Identity of this package. + PACKAGE_NAME='OCaml' + PACKAGE_TARNAME='ocaml' +-PACKAGE_VERSION='4.09.1+dev1-2020-03-13' +-PACKAGE_STRING='OCaml 4.09.1+dev1-2020-03-13' ++PACKAGE_VERSION='4.09.1' ++PACKAGE_STRING='OCaml 4.09.1' + PACKAGE_BUGREPORT='caml-list@inria.fr' + PACKAGE_URL='http://www.ocaml.org' + +@@ -1418,7 +1418,7 @@ if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +-\`configure' configures OCaml 4.09.1+dev1-2020-03-13 to adapt to many kinds of systems. ++\`configure' configures OCaml 4.09.1 to adapt to many kinds of systems. + + Usage: $0 [OPTION]... [VAR=VALUE]... + +@@ -1484,7 +1484,7 @@ fi + + if test -n "$ac_init_help"; then + case $ac_init_help in +- short | recursive ) echo "Configuration of OCaml 4.09.1+dev1-2020-03-13:";; ++ short | recursive ) echo "Configuration of OCaml 4.09.1:";; + esac + cat <<\_ACEOF + +@@ -1642,7 +1642,7 @@ fi + test -n "$ac_init_help" && exit $ac_status + if $ac_init_version; then + cat <<\_ACEOF +-OCaml configure 4.09.1+dev1-2020-03-13 ++OCaml configure 4.09.1 + generated by GNU Autoconf 2.69 + + Copyright (C) 2012 Free Software Foundation, Inc. +@@ -2305,7 +2305,7 @@ cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + +-It was created by OCaml $as_me 4.09.1+dev1-2020-03-13, which was ++It was created by OCaml $as_me 4.09.1, which was + generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ +@@ -2654,8 +2654,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.09.1+dev1-2020-03-13" >&5 +-$as_echo "$as_me: Configuring OCaml version 4.09.1+dev1-2020-03-13" >&6;} ++{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.09.1" >&5 ++$as_echo "$as_me: Configuring OCaml version 4.09.1" >&6;} + + # Configuration variables + +@@ -2730,7 +2730,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + ## Output variables + + +-VERSION=4.09.1+dev1-2020-03-13 ++VERSION=4.09.1 + + + # Note: This is present for the flexdll bootstrap where it exposed as the old +@@ -12360,7 +12360,7 @@ case $ocaml_cv_cc_vendor in #( + msvc-*) : + outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings="" ;; #( + *) : +- outputobj='-o $(EMPTY)'; case 4.09.1+dev1-2020-03-13 in #( ++ outputobj='-o $(EMPTY)'; case 4.09.1 in #( + *+dev*) : + gcc_warnings="-Wall -Werror" ;; #( + *) : +@@ -17200,7 +17200,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + # report actual input values of CONFIG_FILES etc. instead of their + # values after options handling. + ac_log=" +-This file was extended by OCaml $as_me 4.09.1+dev1-2020-03-13, which was ++This file was extended by OCaml $as_me 4.09.1, which was + generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES +@@ -17267,7 +17267,7 @@ _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ +-OCaml config.status 4.09.1+dev1-2020-03-13 ++OCaml config.status 4.09.1 + configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +-- +2.35.1 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.07 b/patches/ocaml-base-compiler/PIC.patch.3.07 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.07 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.07+1 b/patches/ocaml-base-compiler/PIC.patch.3.07+1 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.07+1 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.07+2 b/patches/ocaml-base-compiler/PIC.patch.3.07+2 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.07+2 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.08.0 b/patches/ocaml-base-compiler/PIC.patch.3.08.0 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.08.0 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.08.1 b/patches/ocaml-base-compiler/PIC.patch.3.08.1 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.08.1 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.08.2 b/patches/ocaml-base-compiler/PIC.patch.3.08.2 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.08.2 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.08.3 b/patches/ocaml-base-compiler/PIC.patch.3.08.3 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.08.3 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.08.4 b/patches/ocaml-base-compiler/PIC.patch.3.08.4 new file mode 100644 index 0000000..e25e812 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.08.4 @@ -0,0 +1,210 @@ +From 3d664fd9695159460337bf0764808aefc8fb5cdf Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09-3.11 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Ajout production de code relogeable (option -fPIC) + - Produce position-independent code by default. This makes it easier to embed Caml code in a shared library. + - Lswitch did not generate relocatable code with -fPIC option (PR#3924) + - Non-PC-relative reference (PR#3924) + - PR#4867, PR#4760: make Lswitch generate PIC code acceptable for MacOS X +--- + asmcomp/amd64/arch.ml | 8 +++++++- + asmcomp/amd64/emit.mlp | 38 +++++++++++++++++++++++++++++++------- + asmcomp/amd64/proc.ml | 1 + + asmcomp/amd64/reload.ml | 9 +++++++-- + asmcomp/amd64/selection.ml | 2 +- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 7 files changed, 52 insertions(+), 13 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index 5d3005349..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,7 +14,13 @@ + + (* Machine-specific command-line options *) + +-let command_line_options = [] ++let pic_code = ref true ++ ++let command_line_options = ++ [ "-fPIC", Arg.Set pic_code, ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a3ceedadc..e3049aa8d 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -12,7 +12,7 @@ + + (* $Id$ *) + +-(* Emission of Intel 386 assembly code *) ++(* Emission of x86-64 (AMD 64) assembly code *) + + open Misc + open Cmm +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -312,7 +318,10 @@ let emit_instr fallthrough i = + ` movlpd {emit_label lbl}(%rip), {emit_reg i.res.(0)}\n` + end + | Lop(Iconst_symbol s) -> +- ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` ++ if !pic_code then ++ ` leaq {emit_symbol s}(%rip), {emit_reg i.res.(0)}\n` ++ else ++ ` movq ${emit_symbol s}, {emit_reg i.res.(0)}\n` + | Lop(Icall_ind) -> + ` call *{emit_reg i.arg.(0)}\n`; + record_frame i.live +@@ -331,7 +340,7 @@ let emit_instr fallthrough i = + end + | Lop(Iextcall(s, alloc)) -> + if alloc then begin +- ` movq ${emit_symbol s}, %rax\n`; ++ ` leaq {emit_symbol s}(%rip), %rax\n`; + ` call {emit_symbol "caml_c_call"}\n`; + record_frame i.live + end else begin +@@ -471,6 +480,7 @@ let emit_instr fallthrough i = + | Lop(Ispecific(Istore_int(n, addr))) -> + ` movq ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Istore_symbol(s, addr))) -> ++ assert (not !pic_code); + ` movq ${emit_symbol s}, {emit_addressing addr i.arg 0}\n` + | Lop(Ispecific(Ioffset_loc(n, addr))) -> + ` addq ${emit_int n}, {emit_addressing addr i.arg 0}\n` +@@ -531,12 +541,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml +index f18604442..44c1d97fb 100644 +--- a/asmcomp/amd64/reload.ml ++++ b/asmcomp/amd64/reload.ml +@@ -26,7 +26,8 @@ open Mach + or S R + Iconst_int S + Iconst_float R +- Iconst_symbol S ++ Iconst_symbol (not PIC) S ++ Iconst_symbol (PIC) R + Icall_ind R + Itailcall_ind R + Iload R R R +@@ -72,7 +73,11 @@ method reload_operation op arg res = + (* This add will be turned into a lea; args and results must be + in registers *) + super#reload_operation op arg res +- | Iconst_int _ | Iconst_symbol _ ++ | Iconst_symbol _ -> ++ if !pic_code ++ then super#reload_operation op arg res ++ else (arg, res) ++ | Iconst_int _ + | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr) + | Iintop_imm(_, _) -> + (* The argument(s) and results can be either in register or on stack *) +diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml +index acd79f141..b38a1b8cd 100644 +--- a/asmcomp/amd64/selection.ml ++++ b/asmcomp/amd64/selection.ml +@@ -144,7 +144,7 @@ method select_store addr exp = + (Ispecific(Istore_int(Nativeint.of_int n, addr)), Ctuple []) + | Cconst_natpointer n when self#is_immediate_natint n -> + (Ispecific(Istore_int(n, addr)), Ctuple []) +- | Cconst_symbol s -> ++ | Cconst_symbol s when not !pic_code -> + (Ispecific(Istore_symbol(s, addr)), Ctuple []) + | _ -> + super#select_store addr exp +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index a387a6780..1c219e0d0 100755 +--- a/configure ++++ b/configure +@@ -296,7 +296,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/PIC.patch.3.09.0 b/patches/ocaml-base-compiler/PIC.patch.3.09.0 new file mode 100644 index 0000000..8dd2fb8 --- /dev/null +++ b/patches/ocaml-base-compiler/PIC.patch.3.09.0 @@ -0,0 +1,44 @@ +From 74e79341aaaacea4399c76b8ad9798e2187c7ec9 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sat, 17 Dec 2005 17:05:26 +0000 +Subject: [PATCH] Back-port PIC related changes from 3.09.1 + + - x86_64: do not define ARCH_CODE32 if compiling for a shared library (PR#3869) + - Non-PC-relative reference (PR#3924) +--- + asmrun/amd64.S | 2 +- + configure | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/asmrun/amd64.S b/asmrun/amd64.S +index b1f204f44..5fd5440cf 100644 +--- a/asmrun/amd64.S ++++ b/asmrun/amd64.S +@@ -52,7 +52,7 @@ FUNCTION(caml_call_gc) + pushq %rdi + pushq %rbx + pushq %rax +- movq %rsp, caml_gc_regs ++ movq %rsp, caml_gc_regs(%rip) + /* Save floating-point registers */ + subq $(16*8), %rsp + movlpd %xmm0, 0*8(%rsp) +diff --git a/configure b/configure +index b68154a01..ccafdf57f 100755 +--- a/configure ++++ b/configure +@@ -293,7 +293,10 @@ case "$bytecc,$host" in + gcc*,x86_64-*-linux*) + bytecccompopts="-fno-defer-pop $gcc_warnings" + # Tell gcc that we can use 32-bit code addresses for threaded code +- echo "#define ARCH_CODE32" >> m.h;; ++ # unless we are compiled for a shared library (-fPIC option) ++ echo "#ifndef __PIC__" >> m.h ++ echo "# define ARCH_CODE32" >> m.h ++ echo "#endif" >> m.h;; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07 new file mode 100644 index 0000000..26a89bb --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07 @@ -0,0 +1,184 @@ +From 0914dde80414d95b95dd9bd71ecaa90da44ec0f0 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index 29810cc206c..bc076184ab9 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -44,7 +46,10 @@ char * caml_exception_pointer = NULL; + void mlraise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index c05e9c73f02..a87fec365c8 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -570,7 +570,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -659,19 +658,68 @@ void init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index b3ae46d3c1b..52023aa5465 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -118,6 +118,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void init_ieee_floats (void); + extern void init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -144,10 +145,12 @@ void caml_main(char **argv) + #endif + sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index e6e05e3178b..b4081469c4f 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -116,10 +116,14 @@ CAMLexport void sys_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value sys_exit(value retcode) + { + #ifndef NATIVE_CODE + debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + #ifdef HAS_UI + ui_exit(Int_val(retcode)); diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+1 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+1 new file mode 100644 index 0000000..26a89bb --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+1 @@ -0,0 +1,184 @@ +From 0914dde80414d95b95dd9bd71ecaa90da44ec0f0 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index 29810cc206c..bc076184ab9 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -44,7 +46,10 @@ char * caml_exception_pointer = NULL; + void mlraise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index c05e9c73f02..a87fec365c8 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -570,7 +570,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -659,19 +658,68 @@ void init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index b3ae46d3c1b..52023aa5465 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -118,6 +118,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void init_ieee_floats (void); + extern void init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -144,10 +145,12 @@ void caml_main(char **argv) + #endif + sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index e6e05e3178b..b4081469c4f 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -116,10 +116,14 @@ CAMLexport void sys_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value sys_exit(value retcode) + { + #ifndef NATIVE_CODE + debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + #ifdef HAS_UI + ui_exit(Int_val(retcode)); diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+2 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+2 new file mode 100644 index 0000000..26a89bb --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.07+2 @@ -0,0 +1,184 @@ +From 0914dde80414d95b95dd9bd71ecaa90da44ec0f0 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index 29810cc206c..bc076184ab9 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -44,7 +46,10 @@ char * caml_exception_pointer = NULL; + void mlraise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index c05e9c73f02..a87fec365c8 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -570,7 +570,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -659,19 +658,68 @@ void init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index b3ae46d3c1b..52023aa5465 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -118,6 +118,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void init_ieee_floats (void); + extern void init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -144,10 +145,12 @@ void caml_main(char **argv) + #endif + sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index e6e05e3178b..b4081469c4f 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -116,10 +116,14 @@ CAMLexport void sys_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value sys_exit(value retcode) + { + #ifndef NATIVE_CODE + debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + #ifdef HAS_UI + ui_exit(Int_val(retcode)); diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.0 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.0 new file mode 100644 index 0000000..e1b685b --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.0 @@ -0,0 +1,184 @@ +From ea1245f655aaf7881f34f6c47cf51ae4fe972db6 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index a6ce72ef7c5..cd4823285cc 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -528,7 +528,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -615,19 +614,68 @@ void caml_init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 576c2c56c85..2e4e7bcc856 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -119,6 +119,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -150,10 +151,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index c5f5c60e146..6d48e753182 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -88,10 +88,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.1 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.1 new file mode 100644 index 0000000..e1b685b --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.1 @@ -0,0 +1,184 @@ +From ea1245f655aaf7881f34f6c47cf51ae4fe972db6 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index a6ce72ef7c5..cd4823285cc 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -528,7 +528,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -615,19 +614,68 @@ void caml_init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 576c2c56c85..2e4e7bcc856 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -119,6 +119,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -150,10 +151,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index c5f5c60e146..6d48e753182 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -88,10 +88,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.2 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.2 new file mode 100644 index 0000000..e1b685b --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.2 @@ -0,0 +1,184 @@ +From ea1245f655aaf7881f34f6c47cf51ae4fe972db6 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index a6ce72ef7c5..cd4823285cc 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -528,7 +528,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -615,19 +614,68 @@ void caml_init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 576c2c56c85..2e4e7bcc856 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -119,6 +119,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -150,10 +151,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index c5f5c60e146..6d48e753182 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -88,10 +88,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.3 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.3 new file mode 100644 index 0000000..e1b685b --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.3 @@ -0,0 +1,184 @@ +From ea1245f655aaf7881f34f6c47cf51ae4fe972db6 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index a6ce72ef7c5..cd4823285cc 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -528,7 +528,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -615,19 +614,68 @@ void caml_init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 576c2c56c85..2e4e7bcc856 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -119,6 +119,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -150,10 +151,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index c5f5c60e146..6d48e753182 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -88,10 +88,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.4 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.4 new file mode 100644 index 0000000..e1b685b --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.08.4 @@ -0,0 +1,184 @@ +From ea1245f655aaf7881f34f6c47cf51ae4fe972db6 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 72 insertions(+), 12 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index a6ce72ef7c5..cd4823285cc 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -528,7 +528,6 @@ static void trap_handler(int sig, int code, struct sigcontext * context) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + static int is_stack_overflow(char * fault_addr) + { +@@ -615,19 +614,68 @@ void caml_init_signals(void) + { + struct sigaltstack stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; + #if defined(TARGET_i386) && defined(SYS_linux_elf) +- act.sa_handler = (void (*)(int)) segv_handler; +- act.sa_flags = SA_ONSTACK | SA_NODEFER; ++ act.sa_handler = (void (*)(int)) segv_handler; ++ act.sa_flags = SA_ONSTACK | SA_NODEFER; + #else +- act.sa_sigaction = segv_handler; +- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++ act.sa_sigaction = segv_handler; ++ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; ++#endif ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } + #endif +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && (defined(SYS_solaris) \ ++ || defined(SYS_sunos) || defined(SYS_bsd) || defined(SYS_linux)) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && (defined(SYS_solaris) || defined(SYS_sunos) \ ++ || defined(SYS_bsd) || defined(SYS_linux)) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 576c2c56c85..2e4e7bcc856 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -119,6 +119,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -150,10 +151,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index c5f5c60e146..6d48e753182 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -88,10 +88,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.0 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.0 new file mode 100644 index 0000000..ab350ae --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.0 @@ -0,0 +1,175 @@ +From 413e6e9e54eb3ff72b3478627e5bc241e540dd67 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 +++++- + asmrun/signals.c | 64 +++++++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index 061a381e579..ff94c289ede 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -400,7 +400,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -468,14 +467,61 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } ++#endif ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 44aab0ccf53..9739f1d8230 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -123,6 +123,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -154,10 +155,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index f62b903bf50..2ccf9abc7f8 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -92,10 +92,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.1 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.1 new file mode 100644 index 0000000..ab350ae --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.1 @@ -0,0 +1,175 @@ +From 413e6e9e54eb3ff72b3478627e5bc241e540dd67 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 +++++- + asmrun/signals.c | 64 +++++++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index 061a381e579..ff94c289ede 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -400,7 +400,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -468,14 +467,61 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } ++#endif ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 44aab0ccf53..9739f1d8230 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -123,6 +123,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -154,10 +155,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index f62b903bf50..2ccf9abc7f8 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -92,10 +92,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.2 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.2 new file mode 100644 index 0000000..ab350ae --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.2 @@ -0,0 +1,175 @@ +From 413e6e9e54eb3ff72b3478627e5bc241e540dd67 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 +++++- + asmrun/signals.c | 64 +++++++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index 061a381e579..ff94c289ede 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -400,7 +400,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -468,14 +467,61 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } ++#endif ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 44aab0ccf53..9739f1d8230 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -123,6 +123,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -154,10 +155,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index f62b903bf50..2ccf9abc7f8 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -92,10 +92,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.3 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.3 new file mode 100644 index 0000000..ab350ae --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.09.3 @@ -0,0 +1,175 @@ +From 413e6e9e54eb3ff72b3478627e5bc241e540dd67 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 +++++- + asmrun/signals.c | 64 +++++++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d00014ef291..c0d54cae733 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals.c b/asmrun/signals.c +index 061a381e579..ff94c289ede 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -400,7 +400,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -468,14 +467,61 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } ++ } ++#endif ++} ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); + } + #endif + } +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 44aab0ccf53..9739f1d8230 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -123,6 +123,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -154,10 +155,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index f62b903bf50..2ccf9abc7f8 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -92,10 +92,14 @@ CAMLexport void caml_sys_error(value arg) + CAMLnoreturn; + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.0 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.0 new file mode 100644 index 0000000..2681ea3 --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.0 @@ -0,0 +1,178 @@ +From 009bddc3007926bc306d0eb8986386ffd9b8b292 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals_asm.c | 64 +++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d89bcc6582f..176c50e5a41 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c +index b55561265f1..36ddb7cbc30 100644 +--- a/asmrun/signals_asm.c ++++ b/asmrun/signals_asm.c +@@ -172,7 +172,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -240,17 +239,64 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } + } + #endif + #if defined(_WIN32) && !defined(_WIN64) + caml_win32_overflow_detection(); + #endif + } ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); ++ } ++#endif ++} +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 765d2a8bfc5..24f92b6e11b 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -125,6 +125,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -156,10 +157,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index bbc0e605f4d..115eb823fb4 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -97,10 +97,14 @@ CAMLexport void caml_sys_io_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.1 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.1 new file mode 100644 index 0000000..2681ea3 --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.1 @@ -0,0 +1,178 @@ +From 009bddc3007926bc306d0eb8986386ffd9b8b292 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals_asm.c | 64 +++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d89bcc6582f..176c50e5a41 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c +index b55561265f1..36ddb7cbc30 100644 +--- a/asmrun/signals_asm.c ++++ b/asmrun/signals_asm.c +@@ -172,7 +172,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -240,17 +239,64 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } + } + #endif + #if defined(_WIN32) && !defined(_WIN64) + caml_win32_overflow_detection(); + #endif + } ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); ++ } ++#endif ++} +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 765d2a8bfc5..24f92b6e11b 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -125,6 +125,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -156,10 +157,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index bbc0e605f4d..115eb823fb4 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -97,10 +97,14 @@ CAMLexport void caml_sys_io_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.2 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.2 new file mode 100644 index 0000000..2681ea3 --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.10.2 @@ -0,0 +1,178 @@ +From 009bddc3007926bc306d0eb8986386ffd9b8b292 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals_asm.c | 64 +++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index d89bcc6582f..176c50e5a41 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c +index b55561265f1..36ddb7cbc30 100644 +--- a/asmrun/signals_asm.c ++++ b/asmrun/signals_asm.c +@@ -172,7 +172,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -240,17 +239,64 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } + } + #endif + #if defined(_WIN32) && !defined(_WIN64) + caml_win32_overflow_detection(); + #endif + } ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); ++ } ++#endif ++} +diff --git a/asmrun/startup.c b/asmrun/startup.c +index 765d2a8bfc5..24f92b6e11b 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -125,6 +125,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -156,10 +157,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index bbc0e605f4d..115eb823fb4 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -97,10 +97,14 @@ CAMLexport void caml_sys_io_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.0 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.0 new file mode 100644 index 0000000..c9b2a2c --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.0 @@ -0,0 +1,178 @@ +From f610dea6b1ae9f366fd7d42e0c53954646c36b2f Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals_asm.c | 64 +++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index a1ec0fb070e..038ba671dd1 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c +index f8f542ada95..b14b16ece46 100644 +--- a/asmrun/signals_asm.c ++++ b/asmrun/signals_asm.c +@@ -173,7 +173,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -241,17 +240,64 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } + } + #endif + #if defined(_WIN32) && !defined(_WIN64) + caml_win32_overflow_detection(); + #endif + } ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); ++ } ++#endif ++} +diff --git a/asmrun/startup.c b/asmrun/startup.c +index d22e58fe41d..60d39fd72cb 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -136,6 +136,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -167,10 +168,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index bbc0e605f4d..115eb823fb4 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -97,10 +97,14 @@ CAMLexport void caml_sys_io_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.1 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.1 new file mode 100644 index 0000000..c9b2a2c --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.1 @@ -0,0 +1,178 @@ +From f610dea6b1ae9f366fd7d42e0c53954646c36b2f Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals_asm.c | 64 +++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index a1ec0fb070e..038ba671dd1 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c +index f8f542ada95..b14b16ece46 100644 +--- a/asmrun/signals_asm.c ++++ b/asmrun/signals_asm.c +@@ -173,7 +173,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -241,17 +240,64 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } + } + #endif + #if defined(_WIN32) && !defined(_WIN64) + caml_win32_overflow_detection(); + #endif + } ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); ++ } ++#endif ++} +diff --git a/asmrun/startup.c b/asmrun/startup.c +index d22e58fe41d..60d39fd72cb 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -136,6 +136,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -167,10 +168,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index bbc0e605f4d..115eb823fb4 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -97,10 +97,14 @@ CAMLexport void caml_sys_io_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.2 b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.2 new file mode 100644 index 0000000..c9b2a2c --- /dev/null +++ b/patches/ocaml-base-compiler/alt-signal-stack.patch.3.11.2 @@ -0,0 +1,178 @@ +From f610dea6b1ae9f366fd7d42e0c53954646c36b2f Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 5 Mar 2021 19:14:07 +0100 +Subject: [PATCH] Dynamically allocate the alternate signal stack + +In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant. +It is no longer possible to statically allocate the alternate signal +stack for the main thread, as we've been doing for the last 25 years. + +This commit implements dynamic allocation of the alternate signal stack +even for the main thread. It reuses the code already in place to allocate +the alternate signal stack for other threads. + +The alternate signal stack is freed when the main OCaml code / an OCaml thread +stops. + +(partial back-port of PR#10266 and PR#10726) +--- + asmrun/fail.c | 7 ++++- + asmrun/signals_asm.c | 64 +++++++++++++++++++++++++++++++++++++------- + asmrun/startup.c | 3 +++ + byterun/sys.c | 4 +++ + 4 files changed, 68 insertions(+), 10 deletions(-) + +diff --git a/asmrun/fail.c b/asmrun/fail.c +index a1ec0fb070e..038ba671dd1 100644 +--- a/asmrun/fail.c ++++ b/asmrun/fail.c +@@ -27,6 +27,8 @@ + #include "stack.h" + #include "roots.h" + ++extern void caml_terminate_signals(void); ++ + /* The globals holding predefined exceptions */ + + typedef value caml_generated_constant[1]; +@@ -55,7 +57,10 @@ char * caml_exception_pointer = NULL; + void caml_raise(value v) + { + Unlock_exn(); +- if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v); ++ if (caml_exception_pointer == NULL) { ++ caml_terminate_signals(); ++ caml_fatal_uncaught_exception(v); ++ } + + #ifndef Stack_grows_upwards + #define PUSHED_AFTER < +diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c +index f8f542ada95..b14b16ece46 100644 +--- a/asmrun/signals_asm.c ++++ b/asmrun/signals_asm.c +@@ -173,7 +173,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #ifdef HAS_STACK_OVERFLOW_DETECTION + + static char * system_stack_top; +-static char sig_alt_stack[SIGSTKSZ]; + + DECLARE_SIGNAL_HANDLER(segv_handler) + { +@@ -241,17 +240,64 @@ void caml_init_signals(void) + { + stack_t stk; + struct sigaction act; +- stk.ss_sp = sig_alt_stack; +- stk.ss_size = SIGSTKSZ; +- stk.ss_flags = 0; +- SET_SIGACT(act, segv_handler); +- act.sa_flags |= SA_ONSTACK | SA_NODEFER; +- sigemptyset(&act.sa_mask); +- system_stack_top = (char *) &act; +- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } ++ /* Allocate and select an alternate stack for handling signals, ++ especially SIGSEGV signals. ++ The alternate stack used to be statically-allocated for the main thread, ++ but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ ++ may not be a compile-time constant. */ ++ stk.ss_sp = malloc(SIGSTKSZ); ++ if (stk.ss_sp != NULL) { ++ stk.ss_size = SIGSTKSZ; ++ stk.ss_flags = 0; ++ SET_SIGACT(act, segv_handler); ++ act.sa_flags |= SA_ONSTACK | SA_NODEFER; ++ sigemptyset(&act.sa_mask); ++ system_stack_top = (char *) &act; ++ if (sigaltstack(&stk, NULL) == 0) ++ sigaction(SIGSEGV, &act, NULL); ++ else ++ free(stk.ss_sp); ++ } + } + #endif + #if defined(_WIN32) && !defined(_WIN64) + caml_win32_overflow_detection(); + #endif + } ++ ++/* Termination of signal stuff */ ++ ++#if defined(TARGET_power) || defined(TARGET_sparc) && defined(SYS_solaris) \ ++ || defined(HAS_STACK_OVERFLOW_DETECTION) ++static void set_signal_default(int signum) ++{ ++ struct sigaction act; ++ sigemptyset(&act.sa_mask); ++ act.sa_handler = SIG_DFL; ++ act.sa_flags = 0; ++ sigaction(signum, &act, NULL); ++} ++#endif ++ ++void caml_terminate_signals(void) ++{ ++#if defined(TARGET_sparc) && defined(SYS_solaris) ++ set_signal_default(SIGILL); ++#endif ++ ++#if defined(TARGET_power) ++ set_signal_default(SIGTRAP); ++#endif ++ ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++ set_signal_default(SIGSEGV); ++ stack_t oldstk, stk; ++ stk.ss_flags = SS_DISABLE; ++ if (sigaltstack(&stk, &oldstk) == 0) { ++ /* If caml_init_signals failed, we are not using an alternate signal stack. ++ SS_DISABLE will be set in oldstk, and there is nothing to free in this ++ case. */ ++ if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp); ++ } ++#endif ++} +diff --git a/asmrun/startup.c b/asmrun/startup.c +index d22e58fe41d..60d39fd72cb 100644 +--- a/asmrun/startup.c ++++ b/asmrun/startup.c +@@ -136,6 +136,7 @@ void (*caml_termination_hook)(void *) = NULL; + extern value caml_start_program (void); + extern void caml_init_ieee_floats (void); + extern void caml_init_signals (void); ++extern void caml_terminate_signals(void); + + void caml_main(char **argv) + { +@@ -167,10 +168,12 @@ void caml_main(char **argv) + #endif + caml_sys_init(exe_name, argv); + if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) { ++ caml_terminate_signals(); + if (caml_termination_hook != NULL) caml_termination_hook(NULL); + return; + } + res = caml_start_program(); ++ caml_terminate_signals(); + if (Is_exception_result(res)) + caml_fatal_uncaught_exception(Extract_exception(res)); + } +diff --git a/byterun/sys.c b/byterun/sys.c +index bbc0e605f4d..115eb823fb4 100644 +--- a/byterun/sys.c ++++ b/byterun/sys.c +@@ -97,10 +97,14 @@ CAMLexport void caml_sys_io_error(value arg) + } + } + ++extern void caml_terminate_signals(void); ++ + CAMLprim value caml_sys_exit(value retcode) + { + #ifndef NATIVE_CODE + caml_debugger(PROGRAM_EXIT); ++#else ++ caml_terminate_signals(); + #endif + exit(Int_val(retcode)); + return Val_unit; diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.00.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.00.0 new file mode 100644 index 0000000..9aa62e2 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.00.0 @@ -0,0 +1,33 @@ +From 4a8630f83ce70396d5fdcc812ed912a7df771787 Mon Sep 17 00:00:00 2001 +From: Anil Madhavapeddy +Date: Sun, 21 Jun 2020 22:56:47 +0100 +Subject: [PATCH] add `-fcommon` unconditionally to fix build on gcc10 + +--- + configure | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configure b/configure +index a9a4068ee..54607bfb9 100755 +--- a/configure ++++ b/configure +@@ -345,6 +345,8 @@ case "$bytecc,$host" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -740,6 +742,7 @@ case "$arch,$nativecc,$system,$host_type" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$model,$system" in +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.00.1 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.00.1 new file mode 100644 index 0000000..9aa62e2 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.00.1 @@ -0,0 +1,33 @@ +From 4a8630f83ce70396d5fdcc812ed912a7df771787 Mon Sep 17 00:00:00 2001 +From: Anil Madhavapeddy +Date: Sun, 21 Jun 2020 22:56:47 +0100 +Subject: [PATCH] add `-fcommon` unconditionally to fix build on gcc10 + +--- + configure | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configure b/configure +index a9a4068ee..54607bfb9 100755 +--- a/configure ++++ b/configure +@@ -345,6 +345,8 @@ case "$bytecc,$host" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -740,6 +742,7 @@ case "$arch,$nativecc,$system,$host_type" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$model,$system" in +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.01.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.01.0 new file mode 100644 index 0000000..de77038 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.01.0 @@ -0,0 +1,33 @@ +From de6f4ab737b0f83f945845967ac4be867650a44c Mon Sep 17 00:00:00 2001 +From: Anil Madhavapeddy +Date: Sun, 21 Jun 2020 22:56:47 +0100 +Subject: [PATCH] add `-fcommon` unconditionally to fix build on gcc10 + +--- + configure | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configure b/configure +index 07b1c3503..3210157f3 100755 +--- a/configure ++++ b/configure +@@ -350,6 +350,8 @@ case "$bytecc,$host" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -752,6 +754,7 @@ case "$arch,$nativecc,$system,$host_type" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$model,$system" in +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.0 new file mode 100644 index 0000000..8ded06a --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.0 @@ -0,0 +1,27 @@ +commit 942f9b16d8449d296e864830dbb40315033d4915 +Author: Anil Madhavapeddy +Date: Sun Jun 21 22:56:47 2020 +0100 + + add `-fcommon` unconditionally to fix build on gcc10 + +diff --git a/configure b/configure +index dbc617807..9338088aa 100755 +--- a/configure ++++ b/configure +@@ -425,6 +425,8 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -872,6 +874,7 @@ case "$arch,$nativecc,$system,$target" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$system" in diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.1 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.1 new file mode 100644 index 0000000..56e7241 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.1 @@ -0,0 +1,27 @@ +commit 47581e8e3ebbd68fe05d130b764ddc86902ed214 +Author: Anil Madhavapeddy +Date: Sun Jun 21 22:56:47 2020 +0100 + + add `-fcommon` unconditionally to fix build on gcc10 + +diff --git a/configure b/configure +index 3edb9fd24..af50adf00 100755 +--- a/configure ++++ b/configure +@@ -429,6 +429,8 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -878,6 +880,7 @@ case "$arch,$nativecc,$system,$target" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$system" in diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.2 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.2 new file mode 100644 index 0000000..cfc2e7c --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.2 @@ -0,0 +1,27 @@ +commit edcc102f57a201f94c4aee34ab5b7d5fb6b2aed5 +Author: Anil Madhavapeddy +Date: Sun Jun 21 22:56:47 2020 +0100 + + add `-fcommon` unconditionally to fix build on gcc10 + +diff --git a/configure b/configure +index 4ea1498cf..b3162734c 100755 +--- a/configure ++++ b/configure +@@ -444,6 +444,8 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -907,6 +909,7 @@ case "$arch,$nativecc,$system,$target" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$system" in diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.3 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.3 new file mode 100644 index 0000000..43cedd4 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.02.3 @@ -0,0 +1,27 @@ +commit 227a21a1f50d48a7fa4e53f6e9c15e8e7339dc2f +Author: Anil Madhavapeddy +Date: Sun Jun 21 22:56:47 2020 +0100 + + add `-fcommon` unconditionally to fix build on gcc10 + +diff --git a/configure b/configure +index 4ea1498cf..b3162734c 100755 +--- a/configure ++++ b/configure +@@ -444,6 +444,8 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -907,6 +909,7 @@ case "$arch,$nativecc,$system,$target" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$system" in diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.03.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.03.0 new file mode 100644 index 0000000..83b0159 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.03.0 @@ -0,0 +1,21 @@ +commit 66d623e92c6b1abcf9cbc5e6833080f8ed0376f1 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 0bb2d35f9..b5226a576 100755 +--- a/configure ++++ b/configure +@@ -331,7 +331,7 @@ case "$ccfamily" in + wrn "Consider using GCC version 4.2 or above." + bytecccompopts="-std=gnu99 -O $gcc_warnings";; + gcc-*) +- bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv $gcc_warnings";; ++ bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv -fcommon $gcc_warnings";; + *) + bytecccompopts="-O";; + esac diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.0 new file mode 100644 index 0000000..a40a7c3 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.0 @@ -0,0 +1,21 @@ +commit b4443b80713c27deaa5942ba83302409a4b6b3d6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index f43893a4e..25019ea2c 100755 +--- a/configure ++++ b/configure +@@ -358,7 +358,7 @@ case "$ccfamily" in + wrn "Consider using GCC version 4.2 or above." + bytecccompopts="-std=gnu99 -O $gcc_warnings";; + gcc-*) +- bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv $gcc_warnings";; ++ bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv -fcommon $gcc_warnings";; + *) + bytecccompopts="-O";; + esac diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.1 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.1 new file mode 100644 index 0000000..9f85b1e --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.1 @@ -0,0 +1,21 @@ +commit 6c333f72f212806c4f96b1f58f27cfab8dcb8d20 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index b9ae81a3c..1871cffbe 100755 +--- a/configure ++++ b/configure +@@ -358,7 +358,7 @@ case "$ccfamily" in + wrn "Consider using GCC version 4.2 or above." + bytecccompopts="-std=gnu99 -O $gcc_warnings";; + gcc-*) +- bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv $gcc_warnings";; ++ bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv -fcommon $gcc_warnings";; + *) + bytecccompopts="-O";; + esac diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.2 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.2 new file mode 100644 index 0000000..ed00f68 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.04.2 @@ -0,0 +1,21 @@ +commit e51d8a63919303c581174dc5e8d19ba279184e68 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 3b2636035..bdb123ea3 100755 +--- a/configure ++++ b/configure +@@ -358,7 +358,7 @@ case "$ccfamily" in + wrn "Consider using GCC version 4.2 or above." + bytecccompopts="-std=gnu99 -O $gcc_warnings";; + gcc-*) +- bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv $gcc_warnings";; ++ bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv -fcommon $gcc_warnings";; + *) + bytecccompopts="-O";; + esac diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.05.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.05.0 new file mode 100644 index 0000000..6022cc3 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.05.0 @@ -0,0 +1,21 @@ +commit b3a3a9e79c310d3073b0117f81973f3b415fe316 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index e79659954..3cb87d807 100755 +--- a/configure ++++ b/configure +@@ -402,7 +402,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + byteccprivatecompopts="$gcc_warnings";; + gcc-*) +- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; ++ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + byteccprivatecompopts="$gcc_warnings";; + *) + bytecccompopts="-O";; diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.06.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.06.0 new file mode 100644 index 0000000..f8e2fc5 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.06.0 @@ -0,0 +1,21 @@ +commit 026d2c456ba0242e3641af07914f9c7d6d1ca1f5 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 203396554..912e0214c 100755 +--- a/configure ++++ b/configure +@@ -467,7 +467,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.06.1 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.06.1 new file mode 100644 index 0000000..e483449 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.06.1 @@ -0,0 +1,21 @@ +commit 003edfae7d004c9095d061517f193a2b821814e6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 203396554..912e0214c 100755 +--- a/configure ++++ b/configure +@@ -467,7 +467,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.07.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.07.0 new file mode 100644 index 0000000..d6c9827 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.07.0 @@ -0,0 +1,21 @@ +commit e0746ecf225f9928929162a9381acfe13cbe0cd2 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.07.1 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.07.1 new file mode 100644 index 0000000..ff70b2f --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.07.1 @@ -0,0 +1,21 @@ +commit e312163ad1349cb767cb38e64908d0dc6247b8f9 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.08.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.08.0 new file mode 100644 index 0000000..cffb28e --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.08.0 @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12412,7 +12412,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.08.1 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.08.1 new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.08.1 @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-base-compiler/fix-gcc10.patch.4.09.0 b/patches/ocaml-base-compiler/fix-gcc10.patch.4.09.0 new file mode 100644 index 0000000..cffb28e --- /dev/null +++ b/patches/ocaml-base-compiler/fix-gcc10.patch.4.09.0 @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12412,7 +12412,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-base-compiler/ocaml-base-compiler.install b/patches/ocaml-base-compiler/ocaml-base-compiler.install new file mode 100644 index 0000000..4f14813 --- /dev/null +++ b/patches/ocaml-base-compiler/ocaml-base-compiler.install @@ -0,0 +1 @@ +share_root: ["config.cache" {"ocaml/config.cache"}] diff --git a/patches/ocaml-base-compiler/ocamlopt-fPIC.patch b/patches/ocaml-base-compiler/ocamlopt-fPIC.patch new file mode 100644 index 0000000..d102c1d --- /dev/null +++ b/patches/ocaml-base-compiler/ocamlopt-fPIC.patch @@ -0,0 +1,34 @@ +From a61bcb0f6c4863e3f6cb184d1a620413cf71ac05 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Mon, 1 Jan 2007 13:07:35 +0000 +Subject: [PATCH 2/3] Produce position-independent code by default. This makes + it easier to embed Caml code in a shared library. + +git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/arch.ml | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/asmcomp/amd64/arch.ml b/asmcomp/amd64/arch.ml +index d9b174bc0..3e8f4b111 100644 +--- a/asmcomp/amd64/arch.ml ++++ b/asmcomp/amd64/arch.ml +@@ -14,11 +14,13 @@ + + (* Machine-specific command-line options *) + +-let pic_code = ref false ++let pic_code = ref true + + let command_line_options = + [ "-fPIC", Arg.Set pic_code, +- " Generate position-independent machine code" ] ++ " Generate position-independent machine code (default)"; ++ "-fno-PIC", Arg.Clear pic_code, ++ " Generate position-dependent machine code" ] + + (* Specific operations for the AMD64 processor *) + +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr2061.patch b/patches/ocaml-base-compiler/pr2061.patch new file mode 100644 index 0000000..653c49d --- /dev/null +++ b/patches/ocaml-base-compiler/pr2061.patch @@ -0,0 +1,23 @@ +From 0d27aeebb4086175b5c46a6612d9275ed8a08f9c Mon Sep 17 00:00:00 2001 +From: Damien Doligez +Date: Mon, 2 Feb 2004 22:33:27 +0000 +Subject: [PATCH 1/7] PR#2061 probleme de locale + +git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6106 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + ocamldoc/remove_DEBUG | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ocamldoc/remove_DEBUG b/ocamldoc/remove_DEBUG +index 99ab8972f..6dd7ad0b0 100755 +--- a/ocamldoc/remove_DEBUG ++++ b/ocamldoc/remove_DEBUG +@@ -5,4 +5,4 @@ + # respecting the cpp # line annotation conventions + + echo "# 1 \"$1\"" +-sed -e '/DEBUG/s/.*//' "$1" ++LC_ALL=C sed -e '/DEBUG/s/.*//' "$1" +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4439.patch b/patches/ocaml-base-compiler/pr4439.patch new file mode 100644 index 0000000..6a512dc --- /dev/null +++ b/patches/ocaml-base-compiler/pr4439.patch @@ -0,0 +1,25 @@ +From b50c588e661c6679e4ffd4c42ac2155d826d7bb4 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Sat, 27 Feb 2021 15:54:19 +0000 +Subject: [PATCH 1/3] Back-port part of PR#4439/PR#4433 + +--- + asmrun/signals.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/asmrun/signals.c b/asmrun/signals.c +index 000360d25..061a381e5 100644 +--- a/asmrun/signals.c ++++ b/asmrun/signals.c +@@ -466,7 +466,7 @@ void caml_init_signals(void) + /* Stack overflow handling */ + #ifdef HAS_STACK_OVERFLOW_DETECTION + { +- struct sigaltstack stk; ++ stack_t stk; + struct sigaction act; + stk.ss_sp = sig_alt_stack; + stk.ss_size = SIGSTKSZ; +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4867.patch.3.09.0 b/patches/ocaml-base-compiler/pr4867.patch.3.09.0 new file mode 100644 index 0000000..aea436f --- /dev/null +++ b/patches/ocaml-base-compiler/pr4867.patch.3.09.0 @@ -0,0 +1,75 @@ +From 02ac5a0e93a72c61397ab7c74817083da871ea82 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 18 Sep 2009 13:49:21 +0000 +Subject: [PATCH] PR#4867, PR#4760: make Lswitch generate PIC code acceptable + for MacOS X + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.11@9342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 28 ++++++++++++++++++++++++---- + asmcomp/amd64/proc.ml | 1 + + 2 files changed, 25 insertions(+), 4 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index a5ef1dcdd..b6f3dc4af 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -534,12 +540,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 856e4655a..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -169,6 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4867.patch.3.09.1 b/patches/ocaml-base-compiler/pr4867.patch.3.09.1 new file mode 100644 index 0000000..fbb972b --- /dev/null +++ b/patches/ocaml-base-compiler/pr4867.patch.3.09.1 @@ -0,0 +1,89 @@ +From 484d170309a82f2dd1d7430b0cb7611964620588 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 18 Sep 2009 13:49:21 +0000 +Subject: [PATCH 3/3] PR#4867, PR#4760: make Lswitch generate PIC code + acceptable for MacOS X + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.11@9342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 33 ++++++++++++++++++++++++--------- + asmcomp/amd64/proc.ml | 3 +-- + 2 files changed, 25 insertions(+), 11 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index b57b308a1..7dd081f18 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -534,17 +540,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- if !pic_code then begin +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n` +- end else begin +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n` +- end; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 0e274b4f4..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -92,7 +92,6 @@ let phys_reg n = + let rax = phys_reg 0 + let rcx = phys_reg 5 + let rdx = phys_reg 4 +-let r11 = phys_reg 9 + let rxmm15 = phys_reg 115 + + let stack_slot slot ty = +@@ -170,7 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] +- | Iswitch(_, _) when !pic_code -> [| r11 |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4867.patch.3.09.2 b/patches/ocaml-base-compiler/pr4867.patch.3.09.2 new file mode 100644 index 0000000..fbb972b --- /dev/null +++ b/patches/ocaml-base-compiler/pr4867.patch.3.09.2 @@ -0,0 +1,89 @@ +From 484d170309a82f2dd1d7430b0cb7611964620588 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 18 Sep 2009 13:49:21 +0000 +Subject: [PATCH 3/3] PR#4867, PR#4760: make Lswitch generate PIC code + acceptable for MacOS X + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.11@9342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 33 ++++++++++++++++++++++++--------- + asmcomp/amd64/proc.ml | 3 +-- + 2 files changed, 25 insertions(+), 11 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index b57b308a1..7dd081f18 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -534,17 +540,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- if !pic_code then begin +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n` +- end else begin +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n` +- end; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 0e274b4f4..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -92,7 +92,6 @@ let phys_reg n = + let rax = phys_reg 0 + let rcx = phys_reg 5 + let rdx = phys_reg 4 +-let r11 = phys_reg 9 + let rxmm15 = phys_reg 115 + + let stack_slot slot ty = +@@ -170,7 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] +- | Iswitch(_, _) when !pic_code -> [| r11 |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4867.patch.3.09.3 b/patches/ocaml-base-compiler/pr4867.patch.3.09.3 new file mode 100644 index 0000000..fbb972b --- /dev/null +++ b/patches/ocaml-base-compiler/pr4867.patch.3.09.3 @@ -0,0 +1,89 @@ +From 484d170309a82f2dd1d7430b0cb7611964620588 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 18 Sep 2009 13:49:21 +0000 +Subject: [PATCH 3/3] PR#4867, PR#4760: make Lswitch generate PIC code + acceptable for MacOS X + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.11@9342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 33 ++++++++++++++++++++++++--------- + asmcomp/amd64/proc.ml | 3 +-- + 2 files changed, 25 insertions(+), 11 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index b57b308a1..7dd081f18 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -534,17 +540,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- if !pic_code then begin +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n` +- end else begin +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n` +- end; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 0e274b4f4..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -92,7 +92,6 @@ let phys_reg n = + let rax = phys_reg 0 + let rcx = phys_reg 5 + let rdx = phys_reg 4 +-let r11 = phys_reg 9 + let rxmm15 = phys_reg 115 + + let stack_slot slot ty = +@@ -170,7 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] +- | Iswitch(_, _) when !pic_code -> [| r11 |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4867.patch.3.10.0 b/patches/ocaml-base-compiler/pr4867.patch.3.10.0 new file mode 100644 index 0000000..6184fcb --- /dev/null +++ b/patches/ocaml-base-compiler/pr4867.patch.3.10.0 @@ -0,0 +1,89 @@ +From f8f3b251bbf20f163be7752f7dab0b36da7286a2 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 18 Sep 2009 13:49:21 +0000 +Subject: [PATCH] PR#4867, PR#4760: make Lswitch generate PIC code acceptable + for MacOS X + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.11@9342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 33 ++++++++++++++++++++++++--------- + asmcomp/amd64/proc.ml | 3 +-- + 2 files changed, 25 insertions(+), 11 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index 4f2d54d17..96be4a559 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -548,17 +554,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- if !pic_code then begin +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n` +- end else begin +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n` +- end; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 0e274b4f4..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -92,7 +92,6 @@ let phys_reg n = + let rax = phys_reg 0 + let rcx = phys_reg 5 + let rdx = phys_reg 4 +-let r11 = phys_reg 9 + let rxmm15 = phys_reg 115 + + let stack_slot slot ty = +@@ -170,7 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] +- | Iswitch(_, _) when !pic_code -> [| r11 |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4867.patch.3.10.1 b/patches/ocaml-base-compiler/pr4867.patch.3.10.1 new file mode 100644 index 0000000..f38585c --- /dev/null +++ b/patches/ocaml-base-compiler/pr4867.patch.3.10.1 @@ -0,0 +1,103 @@ +From 1e0307ff682b106adbbf7c6df967de205fb96760 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 18 Sep 2009 13:49:21 +0000 +Subject: [PATCH] PR#4867, PR#4760: make Lswitch generate PIC code acceptable + for MacOS X + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.11@9342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 47 +++++++++++++++++++++--------------------- + asmcomp/amd64/proc.ml | 3 +-- + 2 files changed, 25 insertions(+), 25 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index 7b5565b49..1084b3241 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -548,31 +554,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- if !pic_code then begin +- (* PR#4424: r11 is known to be clobbered by the Lswitch, +- meaning that no variable that is live across the Lswitch +- is assigned to r11. However, the argument to Lswitch +- can still be assigned to r11, so we need to special-case +- this situation. *) +- if i.arg.(0).loc = Reg 9 (* ie r11, cf amd64/proc.ml *) then begin +- ` salq $3, %r11\n`; +- ` pushq %r11\n`; +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` addq 0(%rsp), %r11\n`; +- ` addq $8, %rsp\n`; +- ` jmp *(%r11)\n` +- end else begin +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n` +- end +- end else begin +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n` +- end; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 0e274b4f4..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -92,7 +92,6 @@ let phys_reg n = + let rax = phys_reg 0 + let rcx = phys_reg 5 + let rdx = phys_reg 4 +-let r11 = phys_reg 9 + let rxmm15 = phys_reg 115 + + let stack_slot slot ty = +@@ -170,7 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] +- | Iswitch(_, _) when !pic_code -> [| r11 |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr4867.patch.3.10.2 b/patches/ocaml-base-compiler/pr4867.patch.3.10.2 new file mode 100644 index 0000000..f38585c --- /dev/null +++ b/patches/ocaml-base-compiler/pr4867.patch.3.10.2 @@ -0,0 +1,103 @@ +From 1e0307ff682b106adbbf7c6df967de205fb96760 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 18 Sep 2009 13:49:21 +0000 +Subject: [PATCH] PR#4867, PR#4760: make Lswitch generate PIC code acceptable + for MacOS X + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.11@9342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 47 +++++++++++++++++++++--------------------- + asmcomp/amd64/proc.ml | 3 +-- + 2 files changed, 25 insertions(+), 25 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index 7b5565b49..1084b3241 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -23,6 +23,12 @@ open Mach + open Linearize + open Emitaux + ++let macosx = ++ match Config.system with ++ | "macosx" -> true ++ | _ -> false ++ ++ + (* Tradeoff between code size and code speed *) + + let fastcode_flag = ref true +@@ -548,31 +554,26 @@ let emit_instr fallthrough i = + end + | Lswitch jumptbl -> + let lbl = new_label() in +- if !pic_code then begin +- (* PR#4424: r11 is known to be clobbered by the Lswitch, +- meaning that no variable that is live across the Lswitch +- is assigned to r11. However, the argument to Lswitch +- can still be assigned to r11, so we need to special-case +- this situation. *) +- if i.arg.(0).loc = Reg 9 (* ie r11, cf amd64/proc.ml *) then begin +- ` salq $3, %r11\n`; +- ` pushq %r11\n`; +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` addq 0(%rsp), %r11\n`; +- ` addq $8, %rsp\n`; +- ` jmp *(%r11)\n` +- end else begin +- ` leaq {emit_label lbl}(%rip), %r11\n`; +- ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n` +- end +- end else begin +- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n` +- end; +- ` .section .rodata\n`; +- emit_align 8; ++ (* rax and rdx are clobbered by the Lswitch, ++ meaning that no variable that is live across the Lswitch ++ is assigned to rax or rdx. However, the argument to Lswitch ++ can still be assigned to one of these two registers, so ++ we must be careful not to clobber it before use. *) ++ let (tmp1, tmp2) = ++ if i.arg.(0).loc = Reg 0 (* rax *) ++ then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*)) ++ else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in ++ ` leaq {emit_label lbl}(%rip), {emit_reg tmp1}\n`; ++ ` movslq ({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`; ++ ` addq {emit_reg tmp2}, {emit_reg tmp1}\n`; ++ ` jmp *{emit_reg tmp1}\n`; ++ if macosx ++ then ` .const\n` ++ else ` .section .rodata\n`; ++ emit_align 4; + `{emit_label lbl}:`; + for i = 0 to Array.length jumptbl - 1 do +- ` .quad {emit_label jumptbl.(i)}\n` ++ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n` + done; + ` .text\n` + | Lsetuptrap lbl -> +diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml +index 0e274b4f4..bda821f8a 100644 +--- a/asmcomp/amd64/proc.ml ++++ b/asmcomp/amd64/proc.ml +@@ -92,7 +92,6 @@ let phys_reg n = + let rax = phys_reg 0 + let rcx = phys_reg 5 + let rdx = phys_reg 4 +-let r11 = phys_reg 9 + let rxmm15 = phys_reg 115 + + let stack_slot slot ty = +@@ -170,7 +169,7 @@ let destroyed_at_oper = function + | Iop(Istore(Single, _)) -> [| rxmm15 |] + | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) + -> [| rax |] +- | Iswitch(_, _) when !pic_code -> [| r11 |] ++ | Iswitch(_, _) -> [| rax; rdx |] + | _ -> [||] + + let destroyed_at_raise = all_phys_regs +-- +2.27.0 + diff --git a/patches/ocaml-base-compiler/pr5237.patch b/patches/ocaml-base-compiler/pr5237.patch new file mode 100644 index 0000000..cc802ff --- /dev/null +++ b/patches/ocaml-base-compiler/pr5237.patch @@ -0,0 +1,64 @@ +From d7d13be2aa34a4812e56a3b2ef3ec60bfc4341c0 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Sun, 13 Mar 2011 13:33:17 +0000 +Subject: [PATCH] PR#5237: incorrect .size directives generated for x86-32 and + x86-64 + +git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.12@10980 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 +--- + asmcomp/amd64/emit.mlp | 13 +++++++------ + asmcomp/i386/emit.mlp | 6 +++--- + 2 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index 08745799b..80e71cce1 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -679,17 +679,18 @@ let fundecl fundecl = + emit_all true fundecl.fun_body; + List.iter emit_call_gc !call_gc_sites; + emit_call_bound_errors (); ++ begin match Config.system with ++ "linux" | "gnu" -> ++ ` .type {emit_symbol fundecl.fun_name},@function\n`; ++ ` .size {emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n` ++ | _ -> () ++ end; + if !float_constants <> [] then begin + if macosx + then ` .literal8\n` + else ` .section .rodata.cst8,\"a\",@progbits\n`; + List.iter emit_float_constant !float_constants +- end; +- match Config.system with +- "linux" | "gnu" -> +- ` .type {emit_symbol fundecl.fun_name},@function\n`; +- ` .size {emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n` +- | _ -> () ++ end + + (* Emission of data *) + +diff --git a/asmcomp/i386/emit.mlp b/asmcomp/i386/emit.mlp +index 75881201e..d78a28a82 100644 +--- a/asmcomp/i386/emit.mlp ++++ b/asmcomp/i386/emit.mlp +@@ -905,12 +905,12 @@ let fundecl fundecl = + emit_all true fundecl.fun_body; + List.iter emit_call_gc !call_gc_sites; + emit_call_bound_errors (); +- List.iter emit_float_constant !float_constants; +- match Config.system with ++ begin match Config.system with + "linux_elf" | "bsd_elf" | "gnu" -> + ` .type {emit_symbol fundecl.fun_name},@function\n`; + ` .size {emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n` +- | _ -> () ++ | _ -> () end; ++ List.iter emit_float_constant !float_constants + + + (* Emission of data *) +-- +2.27.0 + diff --git a/patches/ocaml-config/gen_ocaml_config.ml.in.0 b/patches/ocaml-config/gen_ocaml_config.ml.in.0 new file mode 100644 index 0000000..a185f70 --- /dev/null +++ b/patches/ocaml-config/gen_ocaml_config.ml.in.0 @@ -0,0 +1,48 @@ +let () = + if Sys.ocaml_version <> Sys.argv.(1) then + (Printf.eprintf + "OCaml version mismatch: %%s, expected %s" + Sys.ocaml_version Sys.argv.(1); + exit 1) + else + let oc = open_out (Sys.argv.(2) ^ ".config") in + let exe = ".exe" in + let (ocaml, suffix) = + let s = Sys.executable_name in + if Filename.check_suffix s exe then + (Filename.chop_suffix s exe, exe) + else + (s, "") + in + let ocamlc = ocaml^"c"^suffix in + let libdir = + if Sys.command (ocamlc^" -where > where") = 0 then + (* Must be opened in text mode for Windows *) + let ic = open_in "where" in + let r = input_line ic in + close_in ic; r + else + failwith "Bad return from 'ocamlc -where'" + in + let stubsdir = + let ic = open_in (Filename.concat libdir "ld.conf") in + let rec r acc = try r (input_line ic::acc) with End_of_file -> acc in + let lines = List.rev (r []) in + close_in ic; + String.concat ":" lines + in + let p fmt = Printf.fprintf oc (fmt ^^ "\n") in + p "opam-version: \"2.0\""; + p "variables {"; + p " native: %%b" + (Sys.file_exists (ocaml^"opt"^suffix)); + p " native-tools: %%b" + (Sys.file_exists (ocamlc^".opt"^suffix)); + p " native-dynlink: %%b" + (Sys.file_exists (Filename.concat libdir "dynlink.cmxa")); + p " stubsdir: %%S" + stubsdir; + p " preinstalled: %{ocaml-system:installed}%"; + p " compiler: \"%{ocaml-system:installed?system:}%%{ocaml-base-compiler:version}%%{ocaml-variants:version}%\""; + p "}"; + close_out oc diff --git a/patches/ocaml-config/gen_ocaml_config.ml.in.1 b/patches/ocaml-config/gen_ocaml_config.ml.in.1 new file mode 100644 index 0000000..f498b84 --- /dev/null +++ b/patches/ocaml-config/gen_ocaml_config.ml.in.1 @@ -0,0 +1,52 @@ +let () = + let ocaml_version = + let v = Sys.ocaml_version in + try String.sub v 0 (String.index v '+') with Not_found -> v + in + if ocaml_version <> Sys.argv.(1) then + (Printf.eprintf + "OCaml version mismatch: %%s, expected %s" + ocaml_version Sys.argv.(1); + exit 1) + else + let oc = open_out (Sys.argv.(2) ^ ".config") in + let exe = ".exe" in + let (ocaml, suffix) = + let s = Sys.executable_name in + if Filename.check_suffix s exe then + (Filename.chop_suffix s exe, exe) + else + (s, "") + in + let ocamlc = ocaml^"c"^suffix in + let libdir = + if Sys.command (ocamlc^" -where > where") = 0 then + (* Must be opened in text mode for Windows *) + let ic = open_in "where" in + let r = input_line ic in + close_in ic; r + else + failwith "Bad return from 'ocamlc -where'" + in + let stubsdir = + let ic = open_in (Filename.concat libdir "ld.conf") in + let rec r acc = try r (input_line ic::acc) with End_of_file -> acc in + let lines = List.rev (r []) in + close_in ic; + String.concat ":" lines + in + let p fmt = Printf.fprintf oc (fmt ^^ "\n") in + p "opam-version: \"2.0\""; + p "variables {"; + p " native: %%b" + (Sys.file_exists (ocaml^"opt"^suffix)); + p " native-tools: %%b" + (Sys.file_exists (ocamlc^".opt"^suffix)); + p " native-dynlink: %%b" + (Sys.file_exists (Filename.concat libdir "dynlink.cmxa")); + p " stubsdir: %%S" + stubsdir; + p " preinstalled: %{ocaml-system:installed}%"; + p " compiler: \"%{ocaml-system:installed?system:}%%{ocaml-base-compiler:version}%%{ocaml-variants:version}%\""; + p "}"; + close_out oc diff --git a/patches/ocaml-config/gen_ocaml_config.ml.in.2 b/patches/ocaml-config/gen_ocaml_config.ml.in.2 new file mode 100644 index 0000000..8de5a66 --- /dev/null +++ b/patches/ocaml-config/gen_ocaml_config.ml.in.2 @@ -0,0 +1,56 @@ +let () = + let ocaml_version = + let v = Sys.ocaml_version in + let l = String.length v in + let plus = try String.index v '+' with Not_found -> l in + (* Introduced in 4.11.0; used from 4.12.0 *) + let tilde = try String.index v '~' with Not_found -> l in + String.sub v 0 (min (min plus tilde) l) + in + if ocaml_version <> Sys.argv.(1) then + (Printf.eprintf + "OCaml version mismatch: %%s, expected %s" + ocaml_version Sys.argv.(1); + exit 1) + else + let oc = open_out (Sys.argv.(2) ^ ".config") in + let exe = ".exe" in + let (ocaml, suffix) = + let s = Sys.executable_name in + if Filename.check_suffix s exe then + (Filename.chop_suffix s exe, exe) + else + (s, "") + in + let ocamlc = ocaml^"c"^suffix in + let libdir = + if Sys.command (ocamlc^" -where > where") = 0 then + (* Must be opened in text mode for Windows *) + let ic = open_in "where" in + let r = input_line ic in + close_in ic; r + else + failwith "Bad return from 'ocamlc -where'" + in + let stubsdir = + let ic = open_in (Filename.concat libdir "ld.conf") in + let rec r acc = try r (input_line ic::acc) with End_of_file -> acc in + let lines = List.rev (r []) in + close_in ic; + String.concat ":" lines + in + let p fmt = Printf.fprintf oc (fmt ^^ "\n") in + p "opam-version: \"2.0\""; + p "variables {"; + p " native: %%b" + (Sys.file_exists (ocaml^"opt"^suffix)); + p " native-tools: %%b" + (Sys.file_exists (ocamlc^".opt"^suffix)); + p " native-dynlink: %%b" + (Sys.file_exists (Filename.concat libdir "dynlink.cmxa")); + p " stubsdir: %%S" + stubsdir; + p " preinstalled: %{ocaml-system:installed}%"; + p " compiler: \"%{ocaml-system:installed?system:}%%{ocaml-base-compiler:version}%%{ocaml-variants:version}%%{ocaml-option-32bit:installed?+32bit:}%%{ocaml-option-afl:installed?+afl:}%%{ocaml-option-bytecode-only:installed?+bytecode-only:}%%{ocaml-option-default-unsafe-string:installed?+default-unsafe-string:}%%{ocaml-option-fp:installed?+fp:}%%{ocaml-option-flambda:installed?+flambda:}%%{ocaml-option-musl:installed?+musl:}%%{ocaml-option-nnp:installed?+nnp:}%%{ocaml-option-no-flat-float-array:installed?+no-flat-float-array:}%%{ocaml-option-spacetime:installed?+spacetime:}%%{ocaml-option-static:installed?+static:}%\""; + p "}"; + close_out oc diff --git a/patches/ocaml-config/gen_ocaml_config.ml.in.3 b/patches/ocaml-config/gen_ocaml_config.ml.in.3 new file mode 100644 index 0000000..b6771e6 --- /dev/null +++ b/patches/ocaml-config/gen_ocaml_config.ml.in.3 @@ -0,0 +1,65 @@ +let () = + let ocaml_version = + let v = Sys.ocaml_version in + let l = String.length v in + let plus = try String.index v '+' with Not_found -> l in + (* Introduced in 4.11.0; used from 4.12.0 *) + let tilde = try String.index v '~' with Not_found -> l in + String.sub v 0 (min (min plus tilde) l) + in + if ocaml_version <> Sys.argv.(1) then + (Printf.eprintf + "OCaml version mismatch: %%s, expected %s" + ocaml_version Sys.argv.(1); + exit 1) + else + let oc = open_out (Sys.argv.(2) ^ ".config") in + let exe = ".exe" in + let (ocaml, suffix) = + let s = Sys.executable_name in + if Filename.check_suffix s exe then + (Filename.chop_suffix s exe, exe) + else + (s, "") + in + let ocamlc = ocaml^"c"^suffix in + let libdir = + if Sys.command (ocamlc^" -where > where") = 0 then + (* Must be opened in text mode for Windows *) + let ic = open_in "where" in + let r = input_line ic in + close_in ic; r + else + failwith "Bad return from 'ocamlc -where'" + in + let stubsdir = + let ic = open_in (Filename.concat libdir "ld.conf") in + let rec r acc = try r (input_line ic::acc) with End_of_file -> acc in + let lines = List.rev (r []) in + close_in ic; + let sep = if Sys.os_type = "Win32" then ";" else ":" in + String.concat sep lines + in + let has_native_dynlink = + let check_dir libdir = + Sys.file_exists (Filename.concat libdir "dynlink.cmxa") + in + List.exists check_dir [Filename.concat libdir "dynlink"; libdir] + in + let p fmt = Printf.fprintf oc (fmt ^^ "\n") in + p "opam-version: \"2.0\""; + p "variables {"; + p " native: %%b" + (Sys.file_exists (ocaml^"opt"^suffix)); + p " native-tools: %%b" + (* The variable [ocamlc] already has a suffix on Windows + (ex. '...\bin\ocamlc.exe') so we use [ocaml] to check *) + (Sys.file_exists (ocaml^"c.opt"^suffix)); + p " native-dynlink: %%b" + has_native_dynlink; + p " stubsdir: %%S" + stubsdir; + p " preinstalled: %{ocaml-system:installed}%"; + p " compiler: \"%{ocaml-system:installed?system:}%%{ocaml-base-compiler:version}%%{dkml-base-compiler:version}%%{ocaml-variants:version}%%{ocaml-option-32bit:installed?+32bit:}%%{ocaml-option-afl:installed?+afl:}%%{ocaml-option-bytecode-only:installed?+bytecode-only:}%%{ocaml-option-default-unsafe-string:installed?+default-unsafe-string:}%%{ocaml-option-fp:installed?+fp:}%%{ocaml-option-flambda:installed?+flambda:}%%{ocaml-option-musl:installed?+musl:}%%{ocaml-option-nnp:installed?+nnp:}%%{ocaml-option-no-flat-float-array:installed?+no-flat-float-array:}%%{ocaml-option-spacetime:installed?+spacetime:}%%{ocaml-option-static:installed?+static:}%\""; + p "}"; + close_out oc diff --git a/patches/ocaml-config/ocaml-config.install b/patches/ocaml-config/ocaml-config.install new file mode 100644 index 0000000..03a7de2 --- /dev/null +++ b/patches/ocaml-config/ocaml-config.install @@ -0,0 +1 @@ +share: ["gen_ocaml_config.ml"] diff --git a/patches/ocaml-expat/Makefile.patch b/patches/ocaml-expat/Makefile.patch new file mode 100644 index 0000000..684505a --- /dev/null +++ b/patches/ocaml-expat/Makefile.patch @@ -0,0 +1,21 @@ +diff --git a/Makefile b/Makefile +index b32f906..e428fa5 100644 +--- a/Makefile ++++ b/Makefile +@@ -25,6 +25,7 @@ OCAMLDEP=ocamldep + OCAMLMKLIB=ocamlmklib + OCAMLDOC=ocamldoc + OCAMLFIND=ocamlfind ++OCAMLDIR:=$(shell ocamlfind query stdlib) + + .PHONY: all + all: $(ARCHIVE) +@@ -32,7 +33,7 @@ all: $(ARCHIVE) + allopt: $(XARCHIVE) + + depend: *.c *.ml *.mli +- gcc -MM *.c > depend ++ gcc -I $(OCAMLDIR) -MM *.c > depend + $(OCAMLDEP) *.mli *.ml >> depend + + ## Library creation diff --git a/patches/ocaml-inifiles/fix_build.diff b/patches/ocaml-inifiles/fix_build.diff new file mode 100644 index 0000000..0fbb8a3 --- /dev/null +++ b/patches/ocaml-inifiles/fix_build.diff @@ -0,0 +1,11 @@ +--- a/Makefile 2005-04-28 02:42:19.000000000 +0200 ++++ b/Makefile 2023-01-15 17:38:52.921470728 +0100 +@@ -2,7 +2,7 @@ + + SOURCES=parseini.mly inilexer.mll inifiles.mli inifiles.ml + RESULT=inifiles +-PACKS=pcre ++PACKS=pcre unix + + LIBINSTALL_FILES=$(wildcard *.mli *.cmi *.cma *.cmxa *.a *.so) + OCAMLDOCFLAGS=-colorize-code diff --git a/patches/ocaml-inifiles/fix_lowercase.diff b/patches/ocaml-inifiles/fix_lowercase.diff new file mode 100644 index 0000000..418e0d4 --- /dev/null +++ b/patches/ocaml-inifiles/fix_lowercase.diff @@ -0,0 +1,11 @@ +--- a/inifiles.ml 2005-09-15 04:01:38.000000000 +0200 ++++ b/inifiles.ml 2023-01-15 17:34:39.263798277 +0100 +@@ -50,7 +50,7 @@ + struct + type t = string + let compare (x:t) (y:t) = +- String.compare (String.lowercase x) (String.lowercase y) ++ String.compare (String.lowercase_ascii x) (String.lowercase_ascii y) + end + + module Strset = Set.Make(Ordstr) diff --git a/patches/ocaml-inifiles/ocaml-inifiles.diff b/patches/ocaml-inifiles/ocaml-inifiles.diff new file mode 100644 index 0000000..b5d1fa7 --- /dev/null +++ b/patches/ocaml-inifiles/ocaml-inifiles.diff @@ -0,0 +1,11 @@ +--- a/inifiles.ml 2012-10-05 17:05:39.000000000 -0700 ++++ b/inifiles.ml 2012-10-05 17:05:44.000000000 -0700 +@@ -257,7 +257,7 @@ + func + initial + (List.rev_map +- (new inifile) ++ (fun x -> new inifile x) + (List.filter + check_file + (List.rev_map diff --git a/patches/ocaml-markdown/opam.patch b/patches/ocaml-markdown/opam.patch new file mode 100644 index 0000000..916760c --- /dev/null +++ b/patches/ocaml-markdown/opam.patch @@ -0,0 +1,57 @@ +diff -ru ocaml-markdown.0.1.0/_oasis ocaml-markdown.0.1.0/_oasis +--- ocaml-markdown.0.1.0/_oasis 2012-06-15 20:37:55.000000000 +0200 ++++ ocaml-markdown.0.1.0/_oasis 2012-10-05 18:14:56.449785619 +0200 +@@ -20,7 +20,7 @@ + FindlibParent: markdown + Path: src + Modules: MarkdownHTML +- BuildDepends: markdown, ocsigen.xhtml ++ BuildDepends: markdown, tyxml + + Executable test + Path: test +diff -ru ocaml-markdown.0.1.0/setup.ml ocaml-markdown.0.1.0/setup.ml +--- ocaml-markdown.0.1.0/setup.ml 2012-06-15 20:37:55.000000000 +0200 ++++ ocaml-markdown.0.1.0/setup.ml 2012-10-05 18:14:56.501787191 +0200 +@@ -5695,7 +5695,7 @@ + bs_build_depends = + [ + InternalLibrary "markdown"; +- FindlibPackage ("ocsigen.xhtml", None) ++ FindlibPackage ("tyxml", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; +diff -ru ocaml-markdown.0.1.0/src/MarkdownHTML.ml ocaml-markdown.0.1.0/src/MarkdownHTML.ml +--- ocaml-markdown.0.1.0/src/MarkdownHTML.ml 2012-06-15 20:37:55.000000000 +0200 ++++ ocaml-markdown.0.1.0/src/MarkdownHTML.ml 2012-10-05 18:14:56.577789494 +0200 +@@ -1,7 +1,7 @@ + (* Copyright (C) 2009 Mauricio Fernandez *) + + open Markdown +-open XHTML.M ++open Xhtml.M + + let rec elm_to_html ~render_pre ~render_link ~render_img elm = + let self = elm_to_html ~render_pre ~render_link ~render_img in +@@ -35,7 +35,7 @@ + | Code s -> code [pcdata s] + | Anchor id -> + (* would like to do +- a ~a:[XHTML.M_01_00.a_name_01_00 id] [] ++ a ~a:[Xhtml.M_01_00.a_name_01_00 id] [] + but that'd require switching to M_01_00 everywhere, so cheap hack *) + b ~a:[a_id id] [] + | Link href -> begin match href.href_target with +diff -ru ocaml-markdown.0.1.0/_tags ocaml-markdown.0.1.0/_tags +--- ocaml-markdown.0.1.0/_tags 2012-06-15 20:37:55.000000000 +0200 ++++ ocaml-markdown.0.1.0/_tags 2012-10-05 18:14:56.537788281 +0200 +@@ -18,7 +18,7 @@ + # Library html + "src/html.cmxs": use_html + : use_markdown +-: pkg_ocsigen.xhtml ++: pkg_tyxml + : pkg_extlib + : pkg_str + : pkg_sexplib diff --git a/patches/ocaml-secondary-compiler/0001-Don-t-build-manpages-for-stdlib-docs.patch b/patches/ocaml-secondary-compiler/0001-Don-t-build-manpages-for-stdlib-docs.patch new file mode 100644 index 0000000..cda19dd --- /dev/null +++ b/patches/ocaml-secondary-compiler/0001-Don-t-build-manpages-for-stdlib-docs.patch @@ -0,0 +1,24 @@ +From 0cf3c6ad7ce2a2b2806faceccfb0a9321da5e22a Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Fri, 26 Jul 2019 12:12:19 +0100 +Subject: [PATCH] Don't build manpages for stdlib docs +--- + ocamldoc/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile +index b109815071..e31e441f61 100644 +--- a/ocamldoc/Makefile ++++ b/ocamldoc/Makefile +@@ -170,7 +170,7 @@ LIBCMIFILES = $(LIBCMOFILES:.cmo=.cmi) + + + .PHONY: all +-all: lib exe generators manpages ++all: lib exe generators + + manpages: generators + +-- +2.20.1 + diff --git a/patches/ocaml-secondary-compiler/0001-Fix-failure-to-install-tools-links.patch b/patches/ocaml-secondary-compiler/0001-Fix-failure-to-install-tools-links.patch new file mode 100644 index 0000000..41f5f77 --- /dev/null +++ b/patches/ocaml-secondary-compiler/0001-Fix-failure-to-install-tools-links.patch @@ -0,0 +1,26 @@ +From 705739fa54260b7a0e6cbba0b5a99e52c79f9c09 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Tue, 6 Aug 2019 09:23:06 +0100 +Subject: [PATCH] Fix failure to install tools links + +In --disable-installing-bytecode-programs mode, the .opt version of the +tools is installed, but the symlink for the tool itself is not created. +--- + tools/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/Makefile b/tools/Makefile +index 530dd37f34..1b3014a3ab 100644 +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -197,6 +197,7 @@ else + do \ + if test -f "$$i".opt; then \ + $(INSTALL_PROG) "$$i.opt" "$(INSTALL_BINDIR)/$$i.opt$(EXE)"; \ ++ (cd "$(INSTALL_BINDIR)/" && $(LN) "$$i.opt$(EXE)" "$$i$(EXE)"); \ + fi; \ + done + endif +-- +2.20.1 + diff --git a/patches/ocaml-secondary-compiler/fix-gcc10.patch b/patches/ocaml-secondary-compiler/fix-gcc10.patch new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-secondary-compiler/fix-gcc10.patch @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-src/META.3.12.1 b/patches/ocaml-src/META.3.12.1 new file mode 100644 index 0000000..0bfa1ea --- /dev/null +++ b/patches/ocaml-src/META.3.12.1 @@ -0,0 +1 @@ +version = "3.12.1" diff --git a/patches/ocaml-src/META.4.00.0 b/patches/ocaml-src/META.4.00.0 new file mode 100644 index 0000000..16fd2b0 --- /dev/null +++ b/patches/ocaml-src/META.4.00.0 @@ -0,0 +1 @@ +version = "4.00.0" diff --git a/patches/ocaml-src/META.4.00.1 b/patches/ocaml-src/META.4.00.1 new file mode 100644 index 0000000..26c6c39 --- /dev/null +++ b/patches/ocaml-src/META.4.00.1 @@ -0,0 +1 @@ +version = "4.00.1" diff --git a/patches/ocaml-src/META.4.01.0 b/patches/ocaml-src/META.4.01.0 new file mode 100644 index 0000000..6f027c4 --- /dev/null +++ b/patches/ocaml-src/META.4.01.0 @@ -0,0 +1 @@ +version = "4.01.0" diff --git a/patches/ocaml-src/META.4.02.0 b/patches/ocaml-src/META.4.02.0 new file mode 100644 index 0000000..c2dfd31 --- /dev/null +++ b/patches/ocaml-src/META.4.02.0 @@ -0,0 +1 @@ +version = "4.02.0" diff --git a/patches/ocaml-src/META.4.02.1 b/patches/ocaml-src/META.4.02.1 new file mode 100644 index 0000000..fb660a3 --- /dev/null +++ b/patches/ocaml-src/META.4.02.1 @@ -0,0 +1 @@ +version = "4.02.1" diff --git a/patches/ocaml-src/META.4.02.2 b/patches/ocaml-src/META.4.02.2 new file mode 100644 index 0000000..f01ea6b --- /dev/null +++ b/patches/ocaml-src/META.4.02.2 @@ -0,0 +1 @@ +version = "4.02.2" diff --git a/patches/ocaml-src/META.4.02.3 b/patches/ocaml-src/META.4.02.3 new file mode 100644 index 0000000..ad382de --- /dev/null +++ b/patches/ocaml-src/META.4.02.3 @@ -0,0 +1 @@ +version = "4.02.3" diff --git a/patches/ocaml-src/META.4.03.0 b/patches/ocaml-src/META.4.03.0 new file mode 100644 index 0000000..f012128 --- /dev/null +++ b/patches/ocaml-src/META.4.03.0 @@ -0,0 +1 @@ +version = "4.03.0" diff --git a/patches/ocaml-src/META.4.04.0 b/patches/ocaml-src/META.4.04.0 new file mode 100644 index 0000000..827cc42 --- /dev/null +++ b/patches/ocaml-src/META.4.04.0 @@ -0,0 +1 @@ +version = "4.04.0" diff --git a/patches/ocaml-src/META.4.04.1 b/patches/ocaml-src/META.4.04.1 new file mode 100644 index 0000000..8f6234f --- /dev/null +++ b/patches/ocaml-src/META.4.04.1 @@ -0,0 +1 @@ +version = "4.04.1" diff --git a/patches/ocaml-src/META.4.04.2 b/patches/ocaml-src/META.4.04.2 new file mode 100644 index 0000000..fc6467b --- /dev/null +++ b/patches/ocaml-src/META.4.04.2 @@ -0,0 +1 @@ +version = "4.04.2" diff --git a/patches/ocaml-src/META.4.05.0 b/patches/ocaml-src/META.4.05.0 new file mode 100644 index 0000000..58b96f2 --- /dev/null +++ b/patches/ocaml-src/META.4.05.0 @@ -0,0 +1 @@ +version = "4.05.0" diff --git a/patches/ocaml-src/META.4.06.0 b/patches/ocaml-src/META.4.06.0 new file mode 100644 index 0000000..ccd9eaf --- /dev/null +++ b/patches/ocaml-src/META.4.06.0 @@ -0,0 +1 @@ +version = "4.06.0" diff --git a/patches/ocaml-src/META.4.06.1 b/patches/ocaml-src/META.4.06.1 new file mode 100644 index 0000000..0df7137 --- /dev/null +++ b/patches/ocaml-src/META.4.06.1 @@ -0,0 +1 @@ +version = "4.06.1" diff --git a/patches/ocaml-src/META.4.07.0 b/patches/ocaml-src/META.4.07.0 new file mode 100644 index 0000000..547abd1 --- /dev/null +++ b/patches/ocaml-src/META.4.07.0 @@ -0,0 +1 @@ +version = "4.07.0" diff --git a/patches/ocaml-src/META.4.07.1 b/patches/ocaml-src/META.4.07.1 new file mode 100644 index 0000000..10126ce --- /dev/null +++ b/patches/ocaml-src/META.4.07.1 @@ -0,0 +1 @@ +version = "4.07.1" diff --git a/patches/ocaml-src/META.4.08.0 b/patches/ocaml-src/META.4.08.0 new file mode 100644 index 0000000..f01b745 --- /dev/null +++ b/patches/ocaml-src/META.4.08.0 @@ -0,0 +1 @@ +version = "4.08.0" diff --git a/patches/ocaml-src/META.4.08.1 b/patches/ocaml-src/META.4.08.1 new file mode 100644 index 0000000..2b5107d --- /dev/null +++ b/patches/ocaml-src/META.4.08.1 @@ -0,0 +1 @@ +version = "4.08.1" diff --git a/patches/ocaml-src/META.4.09.0 b/patches/ocaml-src/META.4.09.0 new file mode 100644 index 0000000..3805be8 --- /dev/null +++ b/patches/ocaml-src/META.4.09.0 @@ -0,0 +1 @@ +version = "4.09.0" diff --git a/patches/ocaml-src/META.4.09.1 b/patches/ocaml-src/META.4.09.1 new file mode 100644 index 0000000..8c67929 --- /dev/null +++ b/patches/ocaml-src/META.4.09.1 @@ -0,0 +1 @@ +version = "4.09.1" diff --git a/patches/ocaml-src/META.4.09.1-1 b/patches/ocaml-src/META.4.09.1-1 new file mode 100644 index 0000000..8c67929 --- /dev/null +++ b/patches/ocaml-src/META.4.09.1-1 @@ -0,0 +1 @@ +version = "4.09.1" diff --git a/patches/ocaml-src/META.4.10.0 b/patches/ocaml-src/META.4.10.0 new file mode 100644 index 0000000..1203301 --- /dev/null +++ b/patches/ocaml-src/META.4.10.0 @@ -0,0 +1 @@ +version = "4.10.0" diff --git a/patches/ocaml-src/META.4.10.1 b/patches/ocaml-src/META.4.10.1 new file mode 100644 index 0000000..630225a --- /dev/null +++ b/patches/ocaml-src/META.4.10.1 @@ -0,0 +1 @@ +version = "4.10.1" diff --git a/patches/ocaml-src/META.4.10.2 b/patches/ocaml-src/META.4.10.2 new file mode 100644 index 0000000..169022a --- /dev/null +++ b/patches/ocaml-src/META.4.10.2 @@ -0,0 +1 @@ +version = "4.10.2" diff --git a/patches/ocaml-src/META.4.11.0 b/patches/ocaml-src/META.4.11.0 new file mode 100644 index 0000000..1d80091 --- /dev/null +++ b/patches/ocaml-src/META.4.11.0 @@ -0,0 +1 @@ +version = "4.11.0" diff --git a/patches/ocaml-src/META.4.11.1 b/patches/ocaml-src/META.4.11.1 new file mode 100644 index 0000000..985cad6 --- /dev/null +++ b/patches/ocaml-src/META.4.11.1 @@ -0,0 +1 @@ +version = "4.11.1" diff --git a/patches/ocaml-src/META.4.11.2 b/patches/ocaml-src/META.4.11.2 new file mode 100644 index 0000000..d075083 --- /dev/null +++ b/patches/ocaml-src/META.4.11.2 @@ -0,0 +1 @@ +version = "4.11.2" diff --git a/patches/ocaml-src/META.4.12.0 b/patches/ocaml-src/META.4.12.0 new file mode 100644 index 0000000..322791a --- /dev/null +++ b/patches/ocaml-src/META.4.12.0 @@ -0,0 +1 @@ +version = "4.12.0" diff --git a/patches/ocaml-src/META.4.12.1 b/patches/ocaml-src/META.4.12.1 new file mode 100644 index 0000000..88cdcee --- /dev/null +++ b/patches/ocaml-src/META.4.12.1 @@ -0,0 +1 @@ +version = "4.12.1" diff --git a/patches/ocaml-src/META.4.13.0 b/patches/ocaml-src/META.4.13.0 new file mode 100644 index 0000000..85a08b4 --- /dev/null +++ b/patches/ocaml-src/META.4.13.0 @@ -0,0 +1 @@ +version = "4.13.0" diff --git a/patches/ocaml-src/META.4.13.1 b/patches/ocaml-src/META.4.13.1 new file mode 100644 index 0000000..1f1fda4 --- /dev/null +++ b/patches/ocaml-src/META.4.13.1 @@ -0,0 +1 @@ +version = "4.13.1" diff --git a/patches/ocaml-src/META.4.13.dev b/patches/ocaml-src/META.4.13.dev new file mode 100644 index 0000000..ee2424c --- /dev/null +++ b/patches/ocaml-src/META.4.13.dev @@ -0,0 +1 @@ +version = "4.13.2" diff --git a/patches/ocaml-src/META.4.14.0 b/patches/ocaml-src/META.4.14.0 new file mode 100644 index 0000000..d3b92c2 --- /dev/null +++ b/patches/ocaml-src/META.4.14.0 @@ -0,0 +1 @@ +version = "4.14.0" diff --git a/patches/ocaml-src/META.4.14.1 b/patches/ocaml-src/META.4.14.1 new file mode 100644 index 0000000..a26f3e9 --- /dev/null +++ b/patches/ocaml-src/META.4.14.1 @@ -0,0 +1 @@ +version = "4.14.1" diff --git a/patches/ocaml-src/META.4.14.2 b/patches/ocaml-src/META.4.14.2 new file mode 100644 index 0000000..399d056 --- /dev/null +++ b/patches/ocaml-src/META.4.14.2 @@ -0,0 +1 @@ +version = "4.14.2" diff --git a/patches/ocaml-src/META.4.14.dev b/patches/ocaml-src/META.4.14.dev new file mode 100644 index 0000000..d3b92c2 --- /dev/null +++ b/patches/ocaml-src/META.4.14.dev @@ -0,0 +1 @@ +version = "4.14.0" diff --git a/patches/ocaml-src/META.5.0.0 b/patches/ocaml-src/META.5.0.0 new file mode 100644 index 0000000..916c60d --- /dev/null +++ b/patches/ocaml-src/META.5.0.0 @@ -0,0 +1 @@ +version = "5.0.0" diff --git a/patches/ocaml-src/META.5.0.dev b/patches/ocaml-src/META.5.0.dev new file mode 100644 index 0000000..916c60d --- /dev/null +++ b/patches/ocaml-src/META.5.0.dev @@ -0,0 +1 @@ +version = "5.0.0" diff --git a/patches/ocaml-src/META.5.1.0 b/patches/ocaml-src/META.5.1.0 new file mode 100644 index 0000000..9f18ff6 --- /dev/null +++ b/patches/ocaml-src/META.5.1.0 @@ -0,0 +1 @@ +version = "5.1.0" diff --git a/patches/ocaml-src/META.5.1.1 b/patches/ocaml-src/META.5.1.1 new file mode 100644 index 0000000..b9f0619 --- /dev/null +++ b/patches/ocaml-src/META.5.1.1 @@ -0,0 +1 @@ +version = "5.1.1" diff --git a/patches/ocaml-src/META.5.2.0 b/patches/ocaml-src/META.5.2.0 new file mode 100644 index 0000000..c5d78cc --- /dev/null +++ b/patches/ocaml-src/META.5.2.0 @@ -0,0 +1 @@ +version = "5.2.0" diff --git a/patches/ocaml-src/fix-configure-4.09.1.patch b/patches/ocaml-src/fix-configure-4.09.1.patch new file mode 100644 index 0000000..dfd3e75 --- /dev/null +++ b/patches/ocaml-src/fix-configure-4.09.1.patch @@ -0,0 +1,104 @@ +--- a/configure ++++ b/configure +@@ -1,6 +1,6 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.69 for OCaml 4.09.1+dev1-2020-03-13. ++# Generated by GNU Autoconf 2.69 for OCaml 4.09.1. + # + # Report bugs to . + # +@@ -590,8 +590,8 @@ + # Identity of this package. + PACKAGE_NAME='OCaml' + PACKAGE_TARNAME='ocaml' +-PACKAGE_VERSION='4.09.1+dev1-2020-03-13' +-PACKAGE_STRING='OCaml 4.09.1+dev1-2020-03-13' ++PACKAGE_VERSION='4.09.1' ++PACKAGE_STRING='OCaml 4.09.1' + PACKAGE_BUGREPORT='caml-list@inria.fr' + PACKAGE_URL='http://www.ocaml.org' + +@@ -1418,7 +1418,7 @@ + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +-\`configure' configures OCaml 4.09.1+dev1-2020-03-13 to adapt to many kinds of systems. ++\`configure' configures OCaml 4.09.1 to adapt to many kinds of systems. + + Usage: $0 [OPTION]... [VAR=VALUE]... + +@@ -1484,7 +1484,7 @@ + + if test -n "$ac_init_help"; then + case $ac_init_help in +- short | recursive ) echo "Configuration of OCaml 4.09.1+dev1-2020-03-13:";; ++ short | recursive ) echo "Configuration of OCaml 4.09.1:";; + esac + cat <<\_ACEOF + +@@ -1642,7 +1642,7 @@ + test -n "$ac_init_help" && exit $ac_status + if $ac_init_version; then + cat <<\_ACEOF +-OCaml configure 4.09.1+dev1-2020-03-13 ++OCaml configure 4.09.1 + generated by GNU Autoconf 2.69 + + Copyright (C) 2012 Free Software Foundation, Inc. +@@ -2305,7 +2305,7 @@ + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + +-It was created by OCaml $as_me 4.09.1+dev1-2020-03-13, which was ++It was created by OCaml $as_me 4.09.1, which was + generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ +@@ -2654,8 +2654,8 @@ + + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.09.1+dev1-2020-03-13" >&5 +-$as_echo "$as_me: Configuring OCaml version 4.09.1+dev1-2020-03-13" >&6;} ++{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.09.1" >&5 ++$as_echo "$as_me: Configuring OCaml version 4.09.1" >&6;} + + # Configuration variables + +@@ -2730,7 +2730,7 @@ + ## Output variables + + +-VERSION=4.09.1+dev1-2020-03-13 ++VERSION=4.09.1 + + + # Note: This is present for the flexdll bootstrap where it exposed as the old +@@ -12360,7 +12360,7 @@ + msvc-*) : + outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings="" ;; #( + *) : +- outputobj='-o $(EMPTY)'; case 4.09.1+dev1-2020-03-13 in #( ++ outputobj='-o $(EMPTY)'; case 4.09.1 in #( + *+dev*) : + gcc_warnings="-Wall -Werror" ;; #( + *) : +@@ -17200,7 +17200,7 @@ + # report actual input values of CONFIG_FILES etc. instead of their + # values after options handling. + ac_log=" +-This file was extended by OCaml $as_me 4.09.1+dev1-2020-03-13, which was ++This file was extended by OCaml $as_me 4.09.1, which was + generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES +@@ -17267,7 +17267,7 @@ + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ +-OCaml config.status 4.09.1+dev1-2020-03-13 ++OCaml config.status 4.09.1 + configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + diff --git a/patches/ocaml-system/gen_ocaml_config.ml.in b/patches/ocaml-system/gen_ocaml_config.ml.in new file mode 100644 index 0000000..fdc510a --- /dev/null +++ b/patches/ocaml-system/gen_ocaml_config.ml.in @@ -0,0 +1,43 @@ +let () = + let exe = ".exe" in + let ocamlc = + let (base, suffix) = + let s = Sys.executable_name in + if Filename.check_suffix s exe then + (Filename.chop_suffix s exe, exe) + else + (s, "") in + base ^ "c" ^ suffix in + if Sys.ocaml_version <> "%{_:version}%" then + (Printf.eprintf + "ERROR: The compiler found at %%s has version %%s,\n\ + and this package requires %{_:version}%.\n\ + You should use e.g. 'opam switch create %{_:name}%.%%s' \ + instead." + ocamlc Sys.ocaml_version Sys.ocaml_version; + exit 1) + else + let ocamlc_digest = Digest.to_hex (Digest.file ocamlc) in + let libdir = + if Sys.command (ocamlc^" -where > %{_:name}%.config") = 0 then + let ic = open_in "%{_:name}%.config" in + let r = input_line ic in + close_in ic; + Sys.remove "%{_:name}%.config"; + r + else + failwith "Bad return from 'ocamlc -where'" + in + let graphics = Filename.concat libdir "graphics.cmi" in + let graphics_digest = + if Sys.file_exists graphics then + Digest.to_hex (Digest.file graphics) + else + String.make 32 '0' + in + let oc = open_out "%{_:name}%.config" in + Printf.fprintf oc "opam-version: \"2.0\"\n\ + file-depends: [ [ %%S %%S ] [ %%S %%S ] ]\n\ + variables { path: %%S }\n" + ocamlc ocamlc_digest graphics graphics_digest (Filename.dirname ocamlc); + close_out oc diff --git a/patches/ocaml-variants/add-conditional-compilation.patch.4.06.1+rescript b/patches/ocaml-variants/add-conditional-compilation.patch.4.06.1+rescript new file mode 100644 index 0000000..a1d75de --- /dev/null +++ b/patches/ocaml-variants/add-conditional-compilation.patch.4.06.1+rescript @@ -0,0 +1,691 @@ +From 7cbcc8d2c31026ccda7dc042f4637c386d5ada0c Mon Sep 17 00:00:00 2001 +From: Hongbo Zhang +Date: Fri, 11 Jun 2021 20:53:25 +0800 +Subject: [PATCH] add conditional compilation + +--- + parsing/lexer.mli | 10 + + parsing/lexer.mll | 570 +++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 578 insertions(+), 2 deletions(-) + +diff --git a/parsing/lexer.mli b/parsing/lexer.mli +index 63617b48d..abbda759b 100644 +--- a/parsing/lexer.mli ++++ b/parsing/lexer.mli +@@ -19,6 +19,8 @@ val init : unit -> unit + val token: Lexing.lexbuf -> Parser.token + val skip_hash_bang: Lexing.lexbuf -> unit + ++type directive_type ++ + type error = + | Illegal_character of char + | Illegal_escape of string +@@ -28,6 +30,14 @@ type error = + | Keyword_as_label of string + | Invalid_literal of string + | Invalid_directive of string * string option ++ | Unterminated_paren_in_conditional ++ | Unterminated_if ++ | Unterminated_else ++ | Unexpected_token_in_conditional ++ | Expect_hash_then_in_conditional ++ | Illegal_semver of string ++ | Unexpected_directive ++ | Conditional_expr_expected_type of directive_type * directive_type + ;; + + exception Error of error * Location.t +diff --git a/parsing/lexer.mll b/parsing/lexer.mll +index 1e385a044..b0b336314 100644 +--- a/parsing/lexer.mll ++++ b/parsing/lexer.mll +@@ -19,6 +19,36 @@ + open Lexing + open Misc + open Parser ++[@@@warning "-37"] ++type directive_value = ++ | Dir_bool of bool ++ | Dir_float of float ++ | Dir_int of int ++ | Dir_string of string ++ | Dir_null ++ ++type directive_type = ++ | Dir_type_bool ++ | Dir_type_float ++ | Dir_type_int ++ | Dir_type_string ++ | Dir_type_null ++ ++let type_of_directive x = ++ match x with ++ | Dir_bool _ -> Dir_type_bool ++ | Dir_float _ -> Dir_type_float ++ | Dir_int _ -> Dir_type_int ++ | Dir_string _ -> Dir_type_string ++ | Dir_null -> Dir_type_null ++ ++let string_of_type_directive x = ++ match x with ++ | Dir_type_bool -> "bool" ++ | Dir_type_float -> "float" ++ | Dir_type_int -> "int" ++ | Dir_type_string -> "string" ++ | Dir_type_null -> "null" + + type error = + | Illegal_character of char +@@ -29,10 +59,394 @@ type error = + | Keyword_as_label of string + | Invalid_literal of string + | Invalid_directive of string * string option ++ | Unterminated_paren_in_conditional ++ | Unterminated_if ++ | Unterminated_else ++ | Unexpected_token_in_conditional ++ | Expect_hash_then_in_conditional ++ | Illegal_semver of string ++ | Unexpected_directive ++ | Conditional_expr_expected_type of directive_type * directive_type ++ + ;; + + exception Error of error * Location.t;; + ++let assert_same_type lexbuf x y = ++ let lhs = type_of_directive x in let rhs = type_of_directive y in ++ if lhs <> rhs then ++ raise (Error(Conditional_expr_expected_type(lhs,rhs), Location.curr lexbuf)) ++ else y ++ ++let directive_built_in_values = ++ Hashtbl.create 51 ++ ++ ++let replace_directive_built_in_value k v = ++ Hashtbl.replace directive_built_in_values k v ++ ++let () = ++ (* Note we use {!Config} instead of {!Sys} becasue ++ we want to overwrite in some cases with the ++ same stdlib ++ *) ++ let version = ++ Config.version (* so that it can be overridden*) ++ in ++ replace_directive_built_in_value "OCAML_VERSION" ++ (Dir_string version); ++ replace_directive_built_in_value "OCAML_PATCH" ++ (Dir_string ++ (match String.rindex version '+' with ++ | exception Not_found -> "" ++ | i -> ++ String.sub version (i + 1) ++ (String.length version - i - 1))) ++ ; ++ replace_directive_built_in_value "OS_TYPE" ++ (Dir_string Sys.os_type); ++ replace_directive_built_in_value "BIG_ENDIAN" ++ (Dir_bool Sys.big_endian); ++ replace_directive_built_in_value "WORD_SIZE" ++ (Dir_int Sys.word_size) ++ ++let find_directive_built_in_value k = ++ Hashtbl.find directive_built_in_values k ++ ++(* let iter_directive_built_in_value f = Hashtbl.iter f directive_built_in_values *) ++ ++(* ++ {[ ++ # semver 0 "12";; ++ - : int * int * int * string = (12, 0, 0, "");; ++ # semver 0 "12.3";; ++ - : int * int * int * string = (12, 3, 0, "");; ++ semver 0 "12.3.10";; ++ - : int * int * int * string = (12, 3, 10, "");; ++ # semver 0 "12.3.10+x";; ++ - : int * int * int * string = (12, 3, 10, "+x") ++ ]} ++*) ++let zero = Char.code '0' ++let dot = Char.code '.' ++let semantic_version_parse str start last_index = ++ let rec aux start acc last_index = ++ if start <= last_index then ++ let c = Char.code (String.unsafe_get str start) in ++ if c = dot then (acc, start + 1) (* consume [4.] instead of [4]*) ++ else ++ let v = c - zero in ++ if v >=0 && v <= 9 then ++ aux (start + 1) (acc * 10 + v) last_index ++ else (acc , start) ++ else (acc, start) ++ in ++ let major, major_end = aux start 0 last_index in ++ let minor, minor_end = aux major_end 0 last_index in ++ let patch, patch_end = aux minor_end 0 last_index in ++ let additional = String.sub str patch_end (last_index - patch_end +1) in ++ (major, minor, patch), additional ++ ++(** ++ {[ ++ semver Location.none "1.2.3" "~1.3.0" = false;; ++ semver Location.none "1.2.3" "^1.3.0" = true ;; ++ semver Location.none "1.2.3" ">1.3.0" = false ;; ++ semver Location.none "1.2.3" ">=1.3.0" = false ;; ++ semver Location.none "1.2.3" "<1.3.0" = true ;; ++ semver Location.none "1.2.3" "<=1.3.0" = true ;; ++ ]} ++*) ++let semver loc lhs str = ++ let last_index = String.length str - 1 in ++ if last_index < 0 then raise (Error(Illegal_semver str, loc)) ++ else ++ let pred, ((major, minor, _patch) as version, _) = ++ let v = String.unsafe_get str 0 in ++ match v with ++ | '>' -> ++ if last_index = 0 then raise (Error(Illegal_semver str, loc)) else ++ if String.unsafe_get str 1 = '=' then ++ `Ge, semantic_version_parse str 2 last_index ++ else `Gt, semantic_version_parse str 1 last_index ++ | '<' ++ -> ++ if last_index = 0 then raise (Error(Illegal_semver str, loc)) else ++ if String.unsafe_get str 1 = '=' then ++ `Le, semantic_version_parse str 2 last_index ++ else `Lt, semantic_version_parse str 1 last_index ++ | '^' ++ -> `Compatible, semantic_version_parse str 1 last_index ++ | '~' -> `Approximate, semantic_version_parse str 1 last_index ++ | _ -> `Exact, semantic_version_parse str 0 last_index ++ in ++ let ((l_major, l_minor, _l_patch) as lversion,_) = ++ semantic_version_parse lhs 0 (String.length lhs - 1) in ++ match pred with ++ | `Ge -> lversion >= version ++ | `Gt -> lversion > version ++ | `Le -> lversion <= version ++ | `Lt -> lversion < version ++ | `Approximate -> major = l_major && minor = l_minor ++ | `Compatible -> major = l_major ++ | `Exact -> lversion = version ++ ++ ++(* let pp_directive_value fmt (x : directive_value) = ++ match x with ++ | Dir_bool b -> Format.pp_print_bool fmt b ++ | Dir_int b -> Format.pp_print_int fmt b ++ | Dir_float b -> Format.pp_print_float fmt b ++ | Dir_string s -> Format.fprintf fmt "%S" s ++ | Dir_null -> Format.pp_print_string fmt "null" *) ++ ++(* let list_variables fmt = ++ iter_directive_built_in_value ++ (fun s dir_value -> ++ Format.fprintf ++ fmt "@[%s@ %a@]@." ++ s pp_directive_value dir_value ++ ) *) ++ ++let defined str = ++ begin match find_directive_built_in_value str with ++ | Dir_null -> false ++ | _ -> true ++ | exception _ -> ++ try ignore @@ Sys.getenv str; true with _ -> false ++ end ++ ++let query _loc str = ++ begin match find_directive_built_in_value str with ++ | Dir_null -> Dir_bool false ++ | v -> v ++ | exception Not_found -> ++ begin match Sys.getenv str with ++ | v -> ++ begin ++ try Dir_bool (bool_of_string v) with ++ _ -> ++ begin ++ try Dir_int (int_of_string v ) ++ with ++ _ -> ++ begin try (Dir_float (float_of_string v)) ++ with _ -> Dir_string v ++ end ++ end ++ end ++ | exception Not_found -> ++ Dir_bool false ++ end ++ end ++ ++ ++(* let define_key_value key v = ++ if String.length key > 0 ++ && Char.uppercase_ascii (key.[0]) = key.[0] then ++ begin ++ replace_directive_built_in_value key ++ begin ++ (* NEED Sync up across {!lexer.mll} {!bspp.ml} and here, ++ TODO: put it in {!lexer.mll} ++ *) ++ try Dir_bool (bool_of_string v) with ++ _ -> ++ begin ++ try Dir_int (int_of_string v ) ++ with ++ _ -> ++ begin try (Dir_float (float_of_string v)) ++ with _ -> Dir_string v ++ end ++ end ++ end; ++ true ++ end ++ else false *) ++ ++let cvt_int_literal s = ++ - int_of_string ("-" ^ s) ++ ++let value_of_token loc (t : Parser.token) = ++ match t with ++ | INT (i,None) -> Dir_int (cvt_int_literal i) ++ | STRING (s,_) -> Dir_string s ++ | FLOAT (s,None) -> Dir_float (float_of_string s) ++ | TRUE -> Dir_bool true ++ | FALSE -> Dir_bool false ++ | UIDENT s -> query loc s ++ | _ -> raise (Error (Unexpected_token_in_conditional, loc)) ++ ++ ++let directive_parse token_with_comments lexbuf = ++ let look_ahead = ref None in ++ let token () : Parser.token = ++ let v = !look_ahead in ++ match v with ++ | Some v -> ++ look_ahead := None ; ++ v ++ | None -> ++ let rec skip () = ++ match token_with_comments lexbuf with ++ | COMMENT _ ++ | DOCSTRING _ -> skip () ++ | EOF -> raise (Error (Unterminated_if, Location.curr lexbuf)) ++ | t -> t ++ in skip () ++ in ++ let push e = ++ (* INVARIANT: only look at most one token *) ++ assert (!look_ahead = None); ++ look_ahead := Some e ++ in ++ let rec ++ token_op calc ~no lhs = ++ match token () with ++ | (LESS ++ | GREATER ++ | INFIXOP0 "<=" ++ | INFIXOP0 ">=" ++ | EQUAL ++ | INFIXOP0 "<>" as op) -> ++ let f = ++ match op with ++ | LESS -> (<) ++ | GREATER -> (>) ++ | INFIXOP0 "<=" -> (<=) ++ | EQUAL -> (=) ++ | INFIXOP0 "<>" -> (<>) ++ | _ -> assert false ++ in ++ let curr_loc = Location.curr lexbuf in ++ let rhs = value_of_token curr_loc (token ()) in ++ not calc || ++ f lhs (assert_same_type lexbuf lhs rhs) ++ | INFIXOP0 "=~" -> ++ not calc || ++ begin match lhs with ++ | Dir_string s -> ++ let curr_loc = Location.curr lexbuf in ++ let rhs = value_of_token curr_loc (token ()) in ++ begin match rhs with ++ | Dir_string rhs -> ++ semver curr_loc s rhs ++ | _ -> ++ raise ++ (Error ++ ( Conditional_expr_expected_type ++ (Dir_type_string, type_of_directive lhs), Location.curr lexbuf)) ++ end ++ | _ -> raise ++ (Error ++ ( Conditional_expr_expected_type ++ (Dir_type_string, type_of_directive lhs), Location.curr lexbuf)) ++ end ++ | e -> no e ++ and ++ parse_or calc : bool = ++ parse_or_aux calc (parse_and calc) ++ and (* a || (b || (c || d))*) ++ parse_or_aux calc v : bool = ++ (* let l = v in *) ++ match token () with ++ | BARBAR -> ++ let b = parse_or (calc && not v) in ++ v || b ++ | e -> push e ; v ++ and parse_and calc = ++ parse_and_aux calc (parse_relation calc) ++ and parse_and_aux calc v = (* a && (b && (c && d)) *) ++ (* let l = v in *) ++ match token () with ++ | AMPERAMPER -> ++ let b = parse_and (calc && v) in ++ v && b ++ | e -> push e ; v ++ and parse_relation (calc : bool) : bool = ++ let curr_token = token () in ++ let curr_loc = Location.curr lexbuf in ++ match curr_token with ++ | TRUE -> true ++ | FALSE -> false ++ | UIDENT v -> ++ let value_v = query curr_loc v in ++ token_op calc ++ ~no:(fun e -> push e ; ++ match value_v with ++ | Dir_bool b -> b ++ | _ -> ++ let ty = type_of_directive value_v in ++ raise ++ (Error(Conditional_expr_expected_type (Dir_type_bool, ty), ++ curr_loc))) ++ value_v ++ | INT (v,None) -> ++ let num_v = cvt_int_literal v in ++ token_op calc ++ ~no:(fun e -> ++ push e; ++ num_v <> 0 ++ ) ++ (Dir_int num_v) ++ | FLOAT (v,None) -> ++ token_op calc ++ ~no:(fun _e -> ++ raise (Error(Conditional_expr_expected_type(Dir_type_bool, Dir_type_float), ++ curr_loc))) ++ (Dir_float (float_of_string v)) ++ | STRING (v,_) -> ++ token_op calc ++ ~no:(fun _e -> ++ raise (Error ++ (Conditional_expr_expected_type(Dir_type_bool, Dir_type_string), ++ curr_loc))) ++ (Dir_string v) ++ | LIDENT ("defined" | "undefined" as r) -> ++ let t = token () in ++ let loc = Location.curr lexbuf in ++ begin match t with ++ | UIDENT s -> ++ not calc || ++ if r.[0] = 'u' then ++ not @@ defined s ++ else defined s ++ | _ -> raise (Error (Unexpected_token_in_conditional, loc)) ++ end ++ | LPAREN -> ++ let v = parse_or calc in ++ begin match token () with ++ | RPAREN -> v ++ | _ -> raise (Error(Unterminated_paren_in_conditional, Location.curr lexbuf)) ++ end ++ ++ | _ -> raise (Error (Unexpected_token_in_conditional, curr_loc)) ++ in ++ let v = parse_or true in ++ begin match token () with ++ | THEN | EOL -> v ++ | _ -> raise (Error (Expect_hash_then_in_conditional, Location.curr lexbuf)) ++ end ++ ++ ++type dir_conditional = ++ | Dir_if_true ++ | Dir_if_false ++ | Dir_out ++ ++(* let string_of_dir_conditional (x : dir_conditional) = *) ++(* match x with *) ++(* | Dir_if_true -> "Dir_if_true" *) ++(* | Dir_if_false -> "Dir_if_false" *) ++(* | Dir_out -> "Dir_out" *) ++ ++let is_elif (i : Parser.token ) = ++ match i with ++ | LIDENT "elif" -> true ++ | _ -> false (* avoid polymorphic equal *) ++ ++ + (* The table of keywords *) + + let keyword_table = +@@ -115,6 +529,11 @@ let in_comment () = !comment_start_loc <> [];; + let is_in_string = ref false + let in_string () = !is_in_string + let print_warnings = ref true ++let if_then_else = ref Dir_out ++let sharp_look_ahead = ref None ++let update_if_then_else v = ++ (* Format.fprintf Format.err_formatter "@[update %s \n@]@." (string_of_dir_conditional v); *) ++ if_then_else := v + + (* Escaped chars are interpreted in strings unless they are in comments. *) + let store_escaped_char lexbuf c = +@@ -269,6 +688,23 @@ let report_error ppf = function + | None -> () + | Some expl -> fprintf ppf ": %s" expl + end ++ | Unterminated_if -> ++ fprintf ppf "#if not terminated" ++ | Unterminated_else -> ++ fprintf ppf "#else not terminated" ++ | Unexpected_directive -> fprintf ppf "Unexpected directive" ++ | Unexpected_token_in_conditional -> ++ fprintf ppf "Unexpected token in conditional predicate" ++ | Unterminated_paren_in_conditional -> ++ fprintf ppf "Unterminated parens in conditional predicate" ++ | Expect_hash_then_in_conditional -> ++ fprintf ppf "Expect `then` after conditional predicate" ++ | Conditional_expr_expected_type (a,b) -> ++ fprintf ppf "Conditional expression type mismatch (%s,%s)" ++ (string_of_type_directive a ) ++ (string_of_type_directive b ) ++ | Illegal_semver s -> ++ fprintf ppf "Illegal semantic version string %s" s + + let () = + Location.register_error_of_exn +@@ -523,7 +959,15 @@ rule token = parse + { INFIXOP3(Lexing.lexeme lexbuf) } + | '#' (symbolchar | '#') + + { HASHOP(Lexing.lexeme lexbuf) } +- | eof { EOF } ++ | eof { ++ if !if_then_else <> Dir_out then ++ if !if_then_else = Dir_if_true then ++ raise (Error (Unterminated_if, Location.curr lexbuf)) ++ else raise (Error(Unterminated_else, Location.curr lexbuf)) ++ else ++ EOF ++ ++ } + | _ + { raise (Error(Illegal_character (Lexing.lexeme_char lexbuf 0), + Location.curr lexbuf)) +@@ -693,6 +1137,9 @@ and skip_hash_bang = parse + | "" { () } + + { ++ let at_bol lexbuf = ++ let pos = Lexing.lexeme_start_p lexbuf in ++ pos.pos_cnum = pos.pos_bol + + let token_with_comments lexbuf = + match !preprocessor with +@@ -717,6 +1164,94 @@ and skip_hash_bang = parse + + and docstring = Docstrings.docstring + ++ let interpret_directive lexbuf cont look_ahead = ++ let if_then_else = !if_then_else in ++ begin match token_with_comments lexbuf, if_then_else with ++ | IF, Dir_out -> ++ let rec skip_from_if_false () = ++ let token = token_with_comments lexbuf in ++ if token = EOF then ++ raise (Error (Unterminated_if, Location.curr lexbuf)) else ++ if token = HASH && at_bol lexbuf then ++ begin ++ let token = token_with_comments lexbuf in ++ match token with ++ | END -> ++ begin ++ update_if_then_else Dir_out; ++ cont lexbuf ++ end ++ | ELSE -> ++ begin ++ update_if_then_else Dir_if_false; ++ cont lexbuf ++ end ++ | IF -> ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ | _ -> ++ if is_elif token && ++ directive_parse token_with_comments lexbuf then ++ begin ++ update_if_then_else Dir_if_true; ++ cont lexbuf ++ end ++ else skip_from_if_false () ++ end ++ else skip_from_if_false () in ++ if directive_parse token_with_comments lexbuf then ++ begin ++ update_if_then_else Dir_if_true (* Next state: ELSE *); ++ cont lexbuf ++ end ++ else ++ skip_from_if_false () ++ | IF, (Dir_if_false | Dir_if_true)-> ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | LIDENT "elif", (Dir_if_false | Dir_out) ++ -> (* when the predicate is false, it will continue eating `elif` *) ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | (LIDENT "elif" | ELSE as token), Dir_if_true -> ++ (* looking for #end, however, it can not see #if anymore *) ++ let rec skip_from_if_true else_seen = ++ let token = token_with_comments lexbuf in ++ if token = EOF then ++ raise (Error (Unterminated_else, Location.curr lexbuf)) else ++ if token = HASH && at_bol lexbuf then ++ begin ++ let token = token_with_comments lexbuf in ++ match token with ++ | END -> ++ begin ++ update_if_then_else Dir_out; ++ cont lexbuf ++ end ++ | IF -> ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ | ELSE -> ++ if else_seen then ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ else ++ skip_from_if_true true ++ | _ -> ++ if else_seen && is_elif token then ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ else ++ skip_from_if_true else_seen ++ end ++ else skip_from_if_true else_seen in ++ skip_from_if_true (token = ELSE) ++ | ELSE, Dir_if_false ++ | ELSE, Dir_out -> ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | END, (Dir_if_false | Dir_if_true ) -> ++ update_if_then_else Dir_out; ++ cont lexbuf ++ | END, Dir_out -> ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | token, (Dir_if_true | Dir_if_false | Dir_out) -> ++ look_ahead token ++ end ++ + let token lexbuf = + let post_pos = lexeme_end_p lexbuf in + let attach lines docs pre_pos = +@@ -763,6 +1298,10 @@ and skip_hash_bang = parse + | BlankLine -> BlankLine + in + loop lines' docs lexbuf ++ | HASH when at_bol lexbuf -> ++ interpret_directive lexbuf ++ (fun lexbuf -> loop lines docs lexbuf) ++ (fun token -> sharp_look_ahead := Some token; HASH) + | DOCSTRING doc -> + Docstrings.register doc; + add_docstring_comment doc; +@@ -786,9 +1325,16 @@ and skip_hash_bang = parse + attach lines docs (lexeme_start_p lexbuf); + tok + in +- loop NoLine Initial lexbuf ++ match !sharp_look_ahead with ++ | None -> ++ loop NoLine Initial lexbuf ++ | Some token -> ++ sharp_look_ahead := None ; ++ token + + let init () = ++ sharp_look_ahead := None; ++ update_if_then_else Dir_out; + is_in_string := false; + comment_start_loc := []; + comment_list := []; +@@ -796,6 +1342,26 @@ and skip_hash_bang = parse + | None -> () + | Some (init, _preprocess) -> init () + ++ (* let rec filter_directive pos acc lexbuf : (int * int ) list = ++ match token_with_comments lexbuf with ++ | HASH when at_bol lexbuf -> ++ (* ^[start_pos]#if ... #then^[end_pos] *) ++ let start_pos = Lexing.lexeme_start lexbuf in ++ interpret_directive lexbuf ++ (fun lexbuf -> ++ filter_directive ++ (Lexing.lexeme_end lexbuf) ++ ((pos, start_pos) :: acc) ++ lexbuf ++ ++ ) ++ (fun _token -> filter_directive pos acc lexbuf ) ++ | EOF -> (pos, Lexing.lexeme_end lexbuf) :: acc ++ | _ -> filter_directive pos acc lexbuf *) ++ ++ (* let filter_directive_from_lexbuf lexbuf = ++ List.rev (filter_directive 0 [] lexbuf ) *) ++ + let set_preprocessor init preprocess = + escaped_newlines := true; + preprocessor := Some (init, preprocess) +-- +2.27.0 + diff --git a/patches/ocaml-variants/add-conditional-compilation.patch.4.10.2+rescript b/patches/ocaml-variants/add-conditional-compilation.patch.4.10.2+rescript new file mode 100644 index 0000000..4eb0201 --- /dev/null +++ b/patches/ocaml-variants/add-conditional-compilation.patch.4.10.2+rescript @@ -0,0 +1,692 @@ +From 10d84496fb275832cfca45f35f9321116bb7aec7 Mon Sep 17 00:00:00 2001 +From: Hongbo Zhang +Date: Fri, 11 Jun 2021 20:53:25 +0800 +Subject: [PATCH] add conditional compilation + +# Conflicts: +# parsing/lexer.mll +--- + parsing/lexer.mli | 10 + + parsing/lexer.mll | 569 +++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 577 insertions(+), 2 deletions(-) + +diff --git a/parsing/lexer.mli b/parsing/lexer.mli +index cde2ad5cf..d44c02d32 100644 +--- a/parsing/lexer.mli ++++ b/parsing/lexer.mli +@@ -24,6 +24,8 @@ val init : unit -> unit + val token: Lexing.lexbuf -> Parser.token + val skip_hash_bang: Lexing.lexbuf -> unit + ++type directive_type ++ + type error = + | Illegal_character of char + | Illegal_escape of string * string option +@@ -34,6 +36,14 @@ type error = + | Keyword_as_label of string + | Invalid_literal of string + | Invalid_directive of string * string option ++ | Unterminated_paren_in_conditional ++ | Unterminated_if ++ | Unterminated_else ++ | Unexpected_token_in_conditional ++ | Expect_hash_then_in_conditional ++ | Illegal_semver of string ++ | Unexpected_directive ++ | Conditional_expr_expected_type of directive_type * directive_type + ;; + + exception Error of error * Location.t +diff --git a/parsing/lexer.mll b/parsing/lexer.mll +index 8d6411dc2..f7d2c8121 100644 +--- a/parsing/lexer.mll ++++ b/parsing/lexer.mll +@@ -19,6 +19,36 @@ + open Lexing + open Misc + open Parser ++[@@@warning "-37"] ++type directive_value = ++ | Dir_bool of bool ++ | Dir_float of float ++ | Dir_int of int ++ | Dir_string of string ++ | Dir_null ++ ++type directive_type = ++ | Dir_type_bool ++ | Dir_type_float ++ | Dir_type_int ++ | Dir_type_string ++ | Dir_type_null ++ ++let type_of_directive x = ++ match x with ++ | Dir_bool _ -> Dir_type_bool ++ | Dir_float _ -> Dir_type_float ++ | Dir_int _ -> Dir_type_int ++ | Dir_string _ -> Dir_type_string ++ | Dir_null -> Dir_type_null ++ ++let string_of_type_directive x = ++ match x with ++ | Dir_type_bool -> "bool" ++ | Dir_type_float -> "float" ++ | Dir_type_int -> "int" ++ | Dir_type_string -> "string" ++ | Dir_type_null -> "null" + + type error = + | Illegal_character of char +@@ -30,10 +60,394 @@ type error = + | Keyword_as_label of string + | Invalid_literal of string + | Invalid_directive of string * string option ++ | Unterminated_paren_in_conditional ++ | Unterminated_if ++ | Unterminated_else ++ | Unexpected_token_in_conditional ++ | Expect_hash_then_in_conditional ++ | Illegal_semver of string ++ | Unexpected_directive ++ | Conditional_expr_expected_type of directive_type * directive_type ++ + ;; + + exception Error of error * Location.t;; + ++let assert_same_type lexbuf x y = ++ let lhs = type_of_directive x in let rhs = type_of_directive y in ++ if lhs <> rhs then ++ raise (Error(Conditional_expr_expected_type(lhs,rhs), Location.curr lexbuf)) ++ else y ++ ++let directive_built_in_values = ++ Hashtbl.create 51 ++ ++ ++let replace_directive_built_in_value k v = ++ Hashtbl.replace directive_built_in_values k v ++ ++let () = ++ (* Note we use {!Config} instead of {!Sys} becasue ++ we want to overwrite in some cases with the ++ same stdlib ++ *) ++ let version = ++ Config.version (* so that it can be overridden*) ++ in ++ replace_directive_built_in_value "OCAML_VERSION" ++ (Dir_string version); ++ replace_directive_built_in_value "OCAML_PATCH" ++ (Dir_string ++ (match String.rindex version '+' with ++ | exception Not_found -> "" ++ | i -> ++ String.sub version (i + 1) ++ (String.length version - i - 1))) ++ ; ++ replace_directive_built_in_value "OS_TYPE" ++ (Dir_string Sys.os_type); ++ replace_directive_built_in_value "BIG_ENDIAN" ++ (Dir_bool Sys.big_endian); ++ replace_directive_built_in_value "WORD_SIZE" ++ (Dir_int Sys.word_size) ++ ++let find_directive_built_in_value k = ++ Hashtbl.find directive_built_in_values k ++ ++(* let iter_directive_built_in_value f = Hashtbl.iter f directive_built_in_values *) ++ ++(* ++ {[ ++ # semver 0 "12";; ++ - : int * int * int * string = (12, 0, 0, "");; ++ # semver 0 "12.3";; ++ - : int * int * int * string = (12, 3, 0, "");; ++ semver 0 "12.3.10";; ++ - : int * int * int * string = (12, 3, 10, "");; ++ # semver 0 "12.3.10+x";; ++ - : int * int * int * string = (12, 3, 10, "+x") ++ ]} ++*) ++let zero = Char.code '0' ++let dot = Char.code '.' ++let semantic_version_parse str start last_index = ++ let rec aux start acc last_index = ++ if start <= last_index then ++ let c = Char.code (String.unsafe_get str start) in ++ if c = dot then (acc, start + 1) (* consume [4.] instead of [4]*) ++ else ++ let v = c - zero in ++ if v >=0 && v <= 9 then ++ aux (start + 1) (acc * 10 + v) last_index ++ else (acc , start) ++ else (acc, start) ++ in ++ let major, major_end = aux start 0 last_index in ++ let minor, minor_end = aux major_end 0 last_index in ++ let patch, patch_end = aux minor_end 0 last_index in ++ let additional = String.sub str patch_end (last_index - patch_end +1) in ++ (major, minor, patch), additional ++ ++(** ++ {[ ++ semver Location.none "1.2.3" "~1.3.0" = false;; ++ semver Location.none "1.2.3" "^1.3.0" = true ;; ++ semver Location.none "1.2.3" ">1.3.0" = false ;; ++ semver Location.none "1.2.3" ">=1.3.0" = false ;; ++ semver Location.none "1.2.3" "<1.3.0" = true ;; ++ semver Location.none "1.2.3" "<=1.3.0" = true ;; ++ ]} ++*) ++let semver loc lhs str = ++ let last_index = String.length str - 1 in ++ if last_index < 0 then raise (Error(Illegal_semver str, loc)) ++ else ++ let pred, ((major, minor, _patch) as version, _) = ++ let v = String.unsafe_get str 0 in ++ match v with ++ | '>' -> ++ if last_index = 0 then raise (Error(Illegal_semver str, loc)) else ++ if String.unsafe_get str 1 = '=' then ++ `Ge, semantic_version_parse str 2 last_index ++ else `Gt, semantic_version_parse str 1 last_index ++ | '<' ++ -> ++ if last_index = 0 then raise (Error(Illegal_semver str, loc)) else ++ if String.unsafe_get str 1 = '=' then ++ `Le, semantic_version_parse str 2 last_index ++ else `Lt, semantic_version_parse str 1 last_index ++ | '^' ++ -> `Compatible, semantic_version_parse str 1 last_index ++ | '~' -> `Approximate, semantic_version_parse str 1 last_index ++ | _ -> `Exact, semantic_version_parse str 0 last_index ++ in ++ let ((l_major, l_minor, _l_patch) as lversion,_) = ++ semantic_version_parse lhs 0 (String.length lhs - 1) in ++ match pred with ++ | `Ge -> lversion >= version ++ | `Gt -> lversion > version ++ | `Le -> lversion <= version ++ | `Lt -> lversion < version ++ | `Approximate -> major = l_major && minor = l_minor ++ | `Compatible -> major = l_major ++ | `Exact -> lversion = version ++ ++ ++(* let pp_directive_value fmt (x : directive_value) = ++ match x with ++ | Dir_bool b -> Format.pp_print_bool fmt b ++ | Dir_int b -> Format.pp_print_int fmt b ++ | Dir_float b -> Format.pp_print_float fmt b ++ | Dir_string s -> Format.fprintf fmt "%S" s ++ | Dir_null -> Format.pp_print_string fmt "null" *) ++ ++(* let list_variables fmt = ++ iter_directive_built_in_value ++ (fun s dir_value -> ++ Format.fprintf ++ fmt "@[%s@ %a@]@." ++ s pp_directive_value dir_value ++ ) *) ++ ++let defined str = ++ begin match find_directive_built_in_value str with ++ | Dir_null -> false ++ | _ -> true ++ | exception _ -> ++ try ignore @@ Sys.getenv str; true with _ -> false ++ end ++ ++let query _loc str = ++ begin match find_directive_built_in_value str with ++ | Dir_null -> Dir_bool false ++ | v -> v ++ | exception Not_found -> ++ begin match Sys.getenv str with ++ | v -> ++ begin ++ try Dir_bool (bool_of_string v) with ++ _ -> ++ begin ++ try Dir_int (int_of_string v ) ++ with ++ _ -> ++ begin try (Dir_float (float_of_string v)) ++ with _ -> Dir_string v ++ end ++ end ++ end ++ | exception Not_found -> ++ Dir_bool false ++ end ++ end ++ ++ ++(* let define_key_value key v = ++ if String.length key > 0 ++ && Char.uppercase_ascii (key.[0]) = key.[0] then ++ begin ++ replace_directive_built_in_value key ++ begin ++ (* NEED Sync up across {!lexer.mll} {!bspp.ml} and here, ++ TODO: put it in {!lexer.mll} ++ *) ++ try Dir_bool (bool_of_string v) with ++ _ -> ++ begin ++ try Dir_int (int_of_string v ) ++ with ++ _ -> ++ begin try (Dir_float (float_of_string v)) ++ with _ -> Dir_string v ++ end ++ end ++ end; ++ true ++ end ++ else false *) ++ ++let cvt_int_literal s = ++ - int_of_string ("-" ^ s) ++ ++let value_of_token loc (t : Parser.token) = ++ match t with ++ | INT (i,None) -> Dir_int (cvt_int_literal i) ++ | STRING (s,_) -> Dir_string s ++ | FLOAT (s,None) -> Dir_float (float_of_string s) ++ | TRUE -> Dir_bool true ++ | FALSE -> Dir_bool false ++ | UIDENT s -> query loc s ++ | _ -> raise (Error (Unexpected_token_in_conditional, loc)) ++ ++ ++let directive_parse token_with_comments lexbuf = ++ let look_ahead = ref None in ++ let token () : Parser.token = ++ let v = !look_ahead in ++ match v with ++ | Some v -> ++ look_ahead := None ; ++ v ++ | None -> ++ let rec skip () = ++ match token_with_comments lexbuf with ++ | COMMENT _ ++ | DOCSTRING _ -> skip () ++ | EOF -> raise (Error (Unterminated_if, Location.curr lexbuf)) ++ | t -> t ++ in skip () ++ in ++ let push e = ++ (* INVARIANT: only look at most one token *) ++ assert (!look_ahead = None); ++ look_ahead := Some e ++ in ++ let rec ++ token_op calc ~no lhs = ++ match token () with ++ | (LESS ++ | GREATER ++ | INFIXOP0 "<=" ++ | INFIXOP0 ">=" ++ | EQUAL ++ | INFIXOP0 "<>" as op) -> ++ let f = ++ match op with ++ | LESS -> (<) ++ | GREATER -> (>) ++ | INFIXOP0 "<=" -> (<=) ++ | EQUAL -> (=) ++ | INFIXOP0 "<>" -> (<>) ++ | _ -> assert false ++ in ++ let curr_loc = Location.curr lexbuf in ++ let rhs = value_of_token curr_loc (token ()) in ++ not calc || ++ f lhs (assert_same_type lexbuf lhs rhs) ++ | INFIXOP0 "=~" -> ++ not calc || ++ begin match lhs with ++ | Dir_string s -> ++ let curr_loc = Location.curr lexbuf in ++ let rhs = value_of_token curr_loc (token ()) in ++ begin match rhs with ++ | Dir_string rhs -> ++ semver curr_loc s rhs ++ | _ -> ++ raise ++ (Error ++ ( Conditional_expr_expected_type ++ (Dir_type_string, type_of_directive lhs), Location.curr lexbuf)) ++ end ++ | _ -> raise ++ (Error ++ ( Conditional_expr_expected_type ++ (Dir_type_string, type_of_directive lhs), Location.curr lexbuf)) ++ end ++ | e -> no e ++ and ++ parse_or calc : bool = ++ parse_or_aux calc (parse_and calc) ++ and (* a || (b || (c || d))*) ++ parse_or_aux calc v : bool = ++ (* let l = v in *) ++ match token () with ++ | BARBAR -> ++ let b = parse_or (calc && not v) in ++ v || b ++ | e -> push e ; v ++ and parse_and calc = ++ parse_and_aux calc (parse_relation calc) ++ and parse_and_aux calc v = (* a && (b && (c && d)) *) ++ (* let l = v in *) ++ match token () with ++ | AMPERAMPER -> ++ let b = parse_and (calc && v) in ++ v && b ++ | e -> push e ; v ++ and parse_relation (calc : bool) : bool = ++ let curr_token = token () in ++ let curr_loc = Location.curr lexbuf in ++ match curr_token with ++ | TRUE -> true ++ | FALSE -> false ++ | UIDENT v -> ++ let value_v = query curr_loc v in ++ token_op calc ++ ~no:(fun e -> push e ; ++ match value_v with ++ | Dir_bool b -> b ++ | _ -> ++ let ty = type_of_directive value_v in ++ raise ++ (Error(Conditional_expr_expected_type (Dir_type_bool, ty), ++ curr_loc))) ++ value_v ++ | INT (v,None) -> ++ let num_v = cvt_int_literal v in ++ token_op calc ++ ~no:(fun e -> ++ push e; ++ num_v <> 0 ++ ) ++ (Dir_int num_v) ++ | FLOAT (v,None) -> ++ token_op calc ++ ~no:(fun _e -> ++ raise (Error(Conditional_expr_expected_type(Dir_type_bool, Dir_type_float), ++ curr_loc))) ++ (Dir_float (float_of_string v)) ++ | STRING (v,_) -> ++ token_op calc ++ ~no:(fun _e -> ++ raise (Error ++ (Conditional_expr_expected_type(Dir_type_bool, Dir_type_string), ++ curr_loc))) ++ (Dir_string v) ++ | LIDENT ("defined" | "undefined" as r) -> ++ let t = token () in ++ let loc = Location.curr lexbuf in ++ begin match t with ++ | UIDENT s -> ++ not calc || ++ if r.[0] = 'u' then ++ not @@ defined s ++ else defined s ++ | _ -> raise (Error (Unexpected_token_in_conditional, loc)) ++ end ++ | LPAREN -> ++ let v = parse_or calc in ++ begin match token () with ++ | RPAREN -> v ++ | _ -> raise (Error(Unterminated_paren_in_conditional, Location.curr lexbuf)) ++ end ++ ++ | _ -> raise (Error (Unexpected_token_in_conditional, curr_loc)) ++ in ++ let v = parse_or true in ++ begin match token () with ++ | THEN | EOL -> v ++ | _ -> raise (Error (Expect_hash_then_in_conditional, Location.curr lexbuf)) ++ end ++ ++ ++type dir_conditional = ++ | Dir_if_true ++ | Dir_if_false ++ | Dir_out ++ ++(* let string_of_dir_conditional (x : dir_conditional) = *) ++(* match x with *) ++(* | Dir_if_true -> "Dir_if_true" *) ++(* | Dir_if_false -> "Dir_if_false" *) ++(* | Dir_out -> "Dir_out" *) ++ ++let is_elif (i : Parser.token ) = ++ match i with ++ | LIDENT "elif" -> true ++ | _ -> false (* avoid polymorphic equal *) ++ ++ + (* The table of keywords *) + + let keyword_table = +@@ -116,6 +530,11 @@ let in_comment () = !comment_start_loc <> [];; + let is_in_string = ref false + let in_string () = !is_in_string + let print_warnings = ref true ++let if_then_else = ref Dir_out ++let sharp_look_ahead = ref None ++let update_if_then_else v = ++ (* Format.fprintf Format.err_formatter "@[update %s \n@]@." (string_of_dir_conditional v); *) ++ if_then_else := v + + (* Escaped chars are interpreted in strings unless they are in comments. *) + let store_escaped_char lexbuf c = +@@ -288,6 +707,23 @@ let prepare_error loc = function + (fun ppf -> match explanation with + | None -> () + | Some expl -> fprintf ppf ": %s" expl) ++ | Unterminated_if -> ++ Location.errorf ~loc "#if not terminated" ++ | Unterminated_else -> ++ Location.errorf ~loc "#else not terminated" ++ | Unexpected_directive -> Location.errorf ~loc "Unexpected directive" ++ | Unexpected_token_in_conditional -> ++ Location.errorf ~loc "Unexpected token in conditional predicate" ++ | Unterminated_paren_in_conditional -> ++ Location.errorf ~loc "Unterminated parens in conditional predicate" ++ | Expect_hash_then_in_conditional -> ++ Location.errorf ~loc "Expect `then` after conditional predicate" ++ | Conditional_expr_expected_type (a,b) -> ++ Location.errorf ~loc "Conditional expression type mismatch (%s,%s)" ++ (string_of_type_directive a ) ++ (string_of_type_directive b ) ++ | Illegal_semver s -> ++ Location.errorf ~loc "Illegal semantic version string %s" s + + let () = + Location.register_error_of_exn +@@ -535,7 +971,14 @@ rule token = parse + { LETOP op } + | "and" kwdopchar dotsymbolchar * as op + { ANDOP op } +- | eof { EOF } ++ | eof { ++ if !if_then_else <> Dir_out then ++ if !if_then_else = Dir_if_true then ++ raise (Error (Unterminated_if, Location.curr lexbuf)) ++ else raise (Error(Unterminated_else, Location.curr lexbuf)) ++ else ++ EOF ++ } + | (_ as illegal_char) + { error lexbuf (Illegal_character illegal_char) } + +@@ -716,6 +1159,9 @@ and skip_hash_bang = parse + | "" { () } + + { ++ let at_bol lexbuf = ++ let pos = Lexing.lexeme_start_p lexbuf in ++ pos.pos_cnum = pos.pos_bol + + let token_with_comments lexbuf = + match !preprocessor with +@@ -740,6 +1186,94 @@ and skip_hash_bang = parse + + and docstring = Docstrings.docstring + ++ let interpret_directive lexbuf cont look_ahead = ++ let if_then_else = !if_then_else in ++ begin match token_with_comments lexbuf, if_then_else with ++ | IF, Dir_out -> ++ let rec skip_from_if_false () = ++ let token = token_with_comments lexbuf in ++ if token = EOF then ++ raise (Error (Unterminated_if, Location.curr lexbuf)) else ++ if token = HASH && at_bol lexbuf then ++ begin ++ let token = token_with_comments lexbuf in ++ match token with ++ | END -> ++ begin ++ update_if_then_else Dir_out; ++ cont lexbuf ++ end ++ | ELSE -> ++ begin ++ update_if_then_else Dir_if_false; ++ cont lexbuf ++ end ++ | IF -> ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ | _ -> ++ if is_elif token && ++ directive_parse token_with_comments lexbuf then ++ begin ++ update_if_then_else Dir_if_true; ++ cont lexbuf ++ end ++ else skip_from_if_false () ++ end ++ else skip_from_if_false () in ++ if directive_parse token_with_comments lexbuf then ++ begin ++ update_if_then_else Dir_if_true (* Next state: ELSE *); ++ cont lexbuf ++ end ++ else ++ skip_from_if_false () ++ | IF, (Dir_if_false | Dir_if_true)-> ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | LIDENT "elif", (Dir_if_false | Dir_out) ++ -> (* when the predicate is false, it will continue eating `elif` *) ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | (LIDENT "elif" | ELSE as token), Dir_if_true -> ++ (* looking for #end, however, it can not see #if anymore *) ++ let rec skip_from_if_true else_seen = ++ let token = token_with_comments lexbuf in ++ if token = EOF then ++ raise (Error (Unterminated_else, Location.curr lexbuf)) else ++ if token = HASH && at_bol lexbuf then ++ begin ++ let token = token_with_comments lexbuf in ++ match token with ++ | END -> ++ begin ++ update_if_then_else Dir_out; ++ cont lexbuf ++ end ++ | IF -> ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ | ELSE -> ++ if else_seen then ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ else ++ skip_from_if_true true ++ | _ -> ++ if else_seen && is_elif token then ++ raise (Error (Unexpected_directive, Location.curr lexbuf)) ++ else ++ skip_from_if_true else_seen ++ end ++ else skip_from_if_true else_seen in ++ skip_from_if_true (token = ELSE) ++ | ELSE, Dir_if_false ++ | ELSE, Dir_out -> ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | END, (Dir_if_false | Dir_if_true ) -> ++ update_if_then_else Dir_out; ++ cont lexbuf ++ | END, Dir_out -> ++ raise (Error(Unexpected_directive, Location.curr lexbuf)) ++ | token, (Dir_if_true | Dir_if_false | Dir_out) -> ++ look_ahead token ++ end ++ + let token lexbuf = + let post_pos = lexeme_end_p lexbuf in + let attach lines docs pre_pos = +@@ -786,6 +1320,10 @@ and skip_hash_bang = parse + | BlankLine -> BlankLine + in + loop lines' docs lexbuf ++ | HASH when at_bol lexbuf -> ++ interpret_directive lexbuf ++ (fun lexbuf -> loop lines docs lexbuf) ++ (fun token -> sharp_look_ahead := Some token; HASH) + | DOCSTRING doc -> + Docstrings.register doc; + add_docstring_comment doc; +@@ -809,9 +1347,16 @@ and skip_hash_bang = parse + attach lines docs (lexeme_start_p lexbuf); + tok + in +- loop NoLine Initial lexbuf ++ match !sharp_look_ahead with ++ | None -> ++ loop NoLine Initial lexbuf ++ | Some token -> ++ sharp_look_ahead := None ; ++ token + + let init () = ++ sharp_look_ahead := None; ++ update_if_then_else Dir_out; + is_in_string := false; + comment_start_loc := []; + comment_list := []; +@@ -819,6 +1364,26 @@ and skip_hash_bang = parse + | None -> () + | Some (init, _preprocess) -> init () + ++ (* let rec filter_directive pos acc lexbuf : (int * int ) list = ++ match token_with_comments lexbuf with ++ | HASH when at_bol lexbuf -> ++ (* ^[start_pos]#if ... #then^[end_pos] *) ++ let start_pos = Lexing.lexeme_start lexbuf in ++ interpret_directive lexbuf ++ (fun lexbuf -> ++ filter_directive ++ (Lexing.lexeme_end lexbuf) ++ ((pos, start_pos) :: acc) ++ lexbuf ++ ++ ) ++ (fun _token -> filter_directive pos acc lexbuf ) ++ | EOF -> (pos, Lexing.lexeme_end lexbuf) :: acc ++ | _ -> filter_directive pos acc lexbuf *) ++ ++ (* let filter_directive_from_lexbuf lexbuf = ++ List.rev (filter_directive 0 [] lexbuf ) *) ++ + let set_preprocessor init preprocess = + escaped_newlines := true; + preprocessor := Some (init, preprocess) +-- +2.27.0 + diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.02.0+improved-errors b/patches/ocaml-variants/fix-gcc10.patch.4.02.0+improved-errors new file mode 100644 index 0000000..56e7241 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.02.0+improved-errors @@ -0,0 +1,27 @@ +commit 47581e8e3ebbd68fe05d130b764ddc86902ed214 +Author: Anil Madhavapeddy +Date: Sun Jun 21 22:56:47 2020 +0100 + + add `-fcommon` unconditionally to fix build on gcc10 + +diff --git a/configure b/configure +index 3edb9fd24..af50adf00 100755 +--- a/configure ++++ b/configure +@@ -429,6 +429,8 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -878,6 +880,7 @@ case "$arch,$nativecc,$system,$target" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$system" in diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.02.2+improved-errors b/patches/ocaml-variants/fix-gcc10.patch.4.02.2+improved-errors new file mode 100644 index 0000000..56e7241 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.02.2+improved-errors @@ -0,0 +1,27 @@ +commit 47581e8e3ebbd68fe05d130b764ddc86902ed214 +Author: Anil Madhavapeddy +Date: Sun Jun 21 22:56:47 2020 +0100 + + add `-fcommon` unconditionally to fix build on gcc10 + +diff --git a/configure b/configure +index 3edb9fd24..af50adf00 100755 +--- a/configure ++++ b/configure +@@ -429,6 +429,8 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -878,6 +880,7 @@ case "$arch,$nativecc,$system,$target" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$system" in diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.02.4+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.02.4+trunk new file mode 100644 index 0000000..8ded06a --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.02.4+trunk @@ -0,0 +1,27 @@ +commit 942f9b16d8449d296e864830dbb40315033d4915 +Author: Anil Madhavapeddy +Date: Sun Jun 21 22:56:47 2020 +0100 + + add `-fcommon` unconditionally to fix build on gcc10 + +diff --git a/configure b/configure +index dbc617807..9338088aa 100755 +--- a/configure ++++ b/configure +@@ -425,6 +425,8 @@ case "$bytecc,$target" in + bytecccompopts="-fno-defer-pop $gcc_warnings";; + esac + ++bytecccompopts="-fcommon $bytecccompopts" ++ + # Configure compiler to use in further tests + + cc="$bytecc -O $bytecclinkopts" +@@ -872,6 +874,7 @@ case "$arch,$nativecc,$system,$target" in + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac + ++nativecccompopts="-fcommon $nativecccompopts" + asppprofflags='-DPROFILING' + + case "$arch,$system" in diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.03.1+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.03.1+trunk new file mode 100644 index 0000000..83b0159 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.03.1+trunk @@ -0,0 +1,21 @@ +commit 66d623e92c6b1abcf9cbc5e6833080f8ed0376f1 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 0bb2d35f9..b5226a576 100755 +--- a/configure ++++ b/configure +@@ -331,7 +331,7 @@ case "$ccfamily" in + wrn "Consider using GCC version 4.2 or above." + bytecccompopts="-std=gnu99 -O $gcc_warnings";; + gcc-*) +- bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv $gcc_warnings";; ++ bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv -fcommon $gcc_warnings";; + *) + bytecccompopts="-O";; + esac diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.04.1+copatterns b/patches/ocaml-variants/fix-gcc10.patch.4.04.1+copatterns new file mode 100644 index 0000000..a40a7c3 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.04.1+copatterns @@ -0,0 +1,21 @@ +commit b4443b80713c27deaa5942ba83302409a4b6b3d6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index f43893a4e..25019ea2c 100755 +--- a/configure ++++ b/configure +@@ -358,7 +358,7 @@ case "$ccfamily" in + wrn "Consider using GCC version 4.2 or above." + bytecccompopts="-std=gnu99 -O $gcc_warnings";; + gcc-*) +- bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv $gcc_warnings";; ++ bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv -fcommon $gcc_warnings";; + *) + bytecccompopts="-O";; + esac diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.04.3+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.04.3+trunk new file mode 100644 index 0000000..ed00f68 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.04.3+trunk @@ -0,0 +1,21 @@ +commit e51d8a63919303c581174dc5e8d19ba279184e68 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 3b2636035..bdb123ea3 100755 +--- a/configure ++++ b/configure +@@ -358,7 +358,7 @@ case "$ccfamily" in + wrn "Consider using GCC version 4.2 or above." + bytecccompopts="-std=gnu99 -O $gcc_warnings";; + gcc-*) +- bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv $gcc_warnings";; ++ bytecccompopts="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv -fcommon $gcc_warnings";; + *) + bytecccompopts="-O";; + esac diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk new file mode 100644 index 0000000..6022cc3 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk @@ -0,0 +1,21 @@ +commit b3a3a9e79c310d3073b0117f81973f3b415fe316 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index e79659954..3cb87d807 100755 +--- a/configure ++++ b/configure +@@ -402,7 +402,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + byteccprivatecompopts="$gcc_warnings";; + gcc-*) +- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; ++ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + byteccprivatecompopts="$gcc_warnings";; + *) + bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl new file mode 100644 index 0000000..6022cc3 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl @@ -0,0 +1,21 @@ +commit b3a3a9e79c310d3073b0117f81973f3b415fe316 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index e79659954..3cb87d807 100755 +--- a/configure ++++ b/configure +@@ -402,7 +402,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + byteccprivatecompopts="$gcc_warnings";; + gcc-*) +- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; ++ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + byteccprivatecompopts="$gcc_warnings";; + *) + bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda new file mode 100644 index 0000000..6022cc3 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda @@ -0,0 +1,21 @@ +commit b3a3a9e79c310d3073b0117f81973f3b415fe316 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index e79659954..3cb87d807 100755 +--- a/configure ++++ b/configure +@@ -402,7 +402,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + byteccprivatecompopts="$gcc_warnings";; + gcc-*) +- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; ++ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + byteccprivatecompopts="$gcc_warnings";; + *) + bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp new file mode 100644 index 0000000..6022cc3 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp @@ -0,0 +1,21 @@ +commit b3a3a9e79c310d3073b0117f81973f3b415fe316 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index e79659954..3cb87d807 100755 +--- a/configure ++++ b/configure +@@ -402,7 +402,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + byteccprivatecompopts="$gcc_warnings";; + gcc-*) +- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; ++ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + byteccprivatecompopts="$gcc_warnings";; + *) + bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda new file mode 100644 index 0000000..6022cc3 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda @@ -0,0 +1,21 @@ +commit b3a3a9e79c310d3073b0117f81973f3b415fe316 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index e79659954..3cb87d807 100755 +--- a/configure ++++ b/configure +@@ -402,7 +402,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + byteccprivatecompopts="$gcc_warnings";; + gcc-*) +- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; ++ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + byteccprivatecompopts="$gcc_warnings";; + *) + bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string new file mode 100644 index 0000000..6022cc3 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string @@ -0,0 +1,21 @@ +commit b3a3a9e79c310d3073b0117f81973f3b415fe316 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index e79659954..3cb87d807 100755 +--- a/configure ++++ b/configure +@@ -402,7 +402,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + byteccprivatecompopts="$gcc_warnings";; + gcc-*) +- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; ++ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + byteccprivatecompopts="$gcc_warnings";; + *) + bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk new file mode 100644 index 0000000..e483449 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk @@ -0,0 +1,21 @@ +commit 003edfae7d004c9095d061517f193a2b821814e6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 203396554..912e0214c 100755 +--- a/configure ++++ b/configure +@@ -467,7 +467,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl new file mode 100644 index 0000000..e483449 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl @@ -0,0 +1,21 @@ +commit 003edfae7d004c9095d061517f193a2b821814e6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 203396554..912e0214c 100755 +--- a/configure ++++ b/configure +@@ -467,7 +467,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda new file mode 100644 index 0000000..e483449 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda @@ -0,0 +1,21 @@ +commit 003edfae7d004c9095d061517f193a2b821814e6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 203396554..912e0214c 100755 +--- a/configure ++++ b/configure +@@ -467,7 +467,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp new file mode 100644 index 0000000..e483449 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp @@ -0,0 +1,21 @@ +commit 003edfae7d004c9095d061517f193a2b821814e6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 203396554..912e0214c 100755 +--- a/configure ++++ b/configure +@@ -467,7 +467,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda new file mode 100644 index 0000000..e483449 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda @@ -0,0 +1,21 @@ +commit 003edfae7d004c9095d061517f193a2b821814e6 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 203396554..912e0214c 100755 +--- a/configure ++++ b/configure +@@ -467,7 +467,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk new file mode 100644 index 0000000..d6c9827 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk @@ -0,0 +1,21 @@ +commit e0746ecf225f9928929162a9381acfe13cbe0cd2 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl new file mode 100644 index 0000000..d6c9827 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl @@ -0,0 +1,21 @@ +commit e0746ecf225f9928929162a9381acfe13cbe0cd2 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string new file mode 100644 index 0000000..d6c9827 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string @@ -0,0 +1,21 @@ +commit e0746ecf225f9928929162a9381acfe13cbe0cd2 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda new file mode 100644 index 0000000..d6c9827 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda @@ -0,0 +1,21 @@ +commit e0746ecf225f9928929162a9381acfe13cbe0cd2 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp new file mode 100644 index 0000000..d6c9827 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp @@ -0,0 +1,21 @@ +commit e0746ecf225f9928929162a9381acfe13cbe0cd2 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda new file mode 100644 index 0000000..d6c9827 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda @@ -0,0 +1,21 @@ +commit e0746ecf225f9928929162a9381acfe13cbe0cd2 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 1316b3c1e..74d4dc86e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda new file mode 100644 index 0000000..e37b5e8 --- /dev/null +++ b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda @@ -0,0 +1,34 @@ +commit 3f10a16153308f967149917585d2bc0b9c06492c +Author: Anil Madhavapeddy +Date: Sun Jun 21 18:40:27 2020 +0100 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 9a78a4554..0c54b560b 100755 +--- a/configure ++++ b/configure +@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings" ;; #( + gcc-*) : +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings" ;; #( + msvc-*) : + common_cflags="-nologo -O2 -Gy- -MD" +diff --git a/configure.ac b/configure.ac +index f5d8a2687..775e0e2db 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,7 +540,7 @@ AS_CASE([$host], + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings"], + [gcc-*], +- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; + internal_cflags="$gcc_warnings"], + [msvc-*], + [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/ocaml-variants.install b/patches/ocaml-variants/ocaml-variants.install new file mode 100644 index 0000000..4f14813 --- /dev/null +++ b/patches/ocaml-variants/ocaml-variants.install @@ -0,0 +1 @@ +share_root: ["config.cache" {"ocaml/config.cache"}] diff --git a/patches/ocaml-xml-rpc/ocaml-xml-rpc.install b/patches/ocaml-xml-rpc/ocaml-xml-rpc.install new file mode 100644 index 0000000..580e956 --- /dev/null +++ b/patches/ocaml-xml-rpc/ocaml-xml-rpc.install @@ -0,0 +1 @@ +bin: ["oxridl.opt" {"oxridl"}] diff --git a/patches/ocamlbrowser/hasgot.patch b/patches/ocamlbrowser/hasgot.patch new file mode 100644 index 0000000..0869fc0 --- /dev/null +++ b/patches/ocamlbrowser/hasgot.patch @@ -0,0 +1,14 @@ +diff --git a/config/auto-aux/hasgot b/config/auto-aux/hasgot +index 53d5786..5248229 100755 +--- a/config/auto-aux/hasgot ++++ b/config/auto-aux/hasgot +@@ -30,7 +30,8 @@ while : ; do + shift + done + +-(echo "main() {" ++(for f in $*; do echo "int $f();"; done ++ echo "int main() {" + for f in $*; do echo " $f();"; done + echo "}") >> hasgot.c + diff --git a/patches/ocamlclean/disable-warn-error.patch b/patches/ocamlclean/disable-warn-error.patch new file mode 100644 index 0000000..d053273 --- /dev/null +++ b/patches/ocamlclean/disable-warn-error.patch @@ -0,0 +1,18 @@ +diff --git a/configure b/configure +index 73cd90a..9e5fcc1 100755 +--- a/configure ++++ b/configure +@@ -76,10 +76,10 @@ done + echo -n "\ + BINDIR = $BINDIR + MAN1DIR = $MANDIR/man1 +-OCAMLC = $OCAMLC -w Ae -warn-error A +-OCAMLOPT = $OCAMLOPT -w Ae -warn-error A ++OCAMLC = $OCAMLC -w Ae ++OCAMLOPT = $OCAMLOPT -w Ae + OCAMLC_UNSAFE = $OCAMLC +-OCAMLBUILD = $OCAMLBUILD -cflags -w,Ae,-warn-error,A -lflags -w,Ae,-warn-error,A -no-links -classic-display ++OCAMLBUILD = $OCAMLBUILD -cflags -w,Ae -lflags -w,Ae -no-links -classic-display + BIN = $PWD/bin + ETC = $PWD/etc + DIST = $PWD/dist diff --git a/patches/ocamldap/ocaml-4.02.patch b/patches/ocamldap/ocaml-4.02.patch new file mode 100644 index 0000000..959ddd0 --- /dev/null +++ b/patches/ocamldap/ocaml-4.02.patch @@ -0,0 +1,13 @@ +diff --git a/src/ldap_ooclient.ml b/src/ldap_ooclient.ml +index 79fd51d..7ffa39e 100644 +--- a/src/ldap_ooclient.ml ++++ b/src/ldap_ooclient.ml +@@ -23,7 +23,7 @@ + open Ldap_types + open Ldap_funclient + open Ldap_schemaparser +-open String ++let lowercase = String.lowercase + + (* types used throughout the library *) + (* add types *) diff --git a/patches/ocamldsort/ocamldsort.install b/patches/ocamldsort/ocamldsort.install new file mode 100644 index 0000000..c1fcebe --- /dev/null +++ b/patches/ocamldsort/ocamldsort.install @@ -0,0 +1,4 @@ +bin: [ + "ocamldsort.opt" + "ocamldsort" +] diff --git a/patches/ocamlfind-lint/ocamlfind-lint.install b/patches/ocamlfind-lint/ocamlfind-lint.install new file mode 100644 index 0000000..670a2b3 --- /dev/null +++ b/patches/ocamlfind-lint/ocamlfind-lint.install @@ -0,0 +1,4 @@ +bin: [ + "?ocamlfind-lint" + "?ocamlfind-lint.byte" +] diff --git a/patches/ocamlfind-secondary/META.in b/patches/ocamlfind-secondary/META.in new file mode 100644 index 0000000..12e3ee6 --- /dev/null +++ b/patches/ocamlfind-secondary/META.in @@ -0,0 +1,3 @@ +description = "OCaml Secondary Compiler" +version = "%{ocaml-secondary-compiler:version}%" +directory = "%{ocaml-secondary-compiler:share}%/bin" diff --git a/patches/ocamlfind-secondary/ocaml-secondary-compiler.conf.in b/patches/ocamlfind-secondary/ocaml-secondary-compiler.conf.in new file mode 100644 index 0000000..d13023c --- /dev/null +++ b/patches/ocamlfind-secondary/ocaml-secondary-compiler.conf.in @@ -0,0 +1,10 @@ +path(secondary) = "%{ocaml-secondary-compiler:share}%/lib" +destdir(secondary) = "%{ocaml-secondary-compiler:share}%/lib" +stdlib(secondary) = "%{ocaml-secondary-compiler:share}%/lib" +ocamlc(secondary) = "%{ocaml-secondary-compiler:share}%/bin/ocamlc" +ocamlopt(secondary) = "%{ocaml-secondary-compiler:share}%/bin/ocamlopt" +ocamlcp(secondary) = "%{ocaml-secondary-compiler:share}%/bin/ocamlcp" +ocamlmklib(secondary) = "%{ocaml-secondary-compiler:share}%/bin/ocamlmklib" +ocamlmktop(secondary) = "%{ocaml-secondary-compiler:share}%/bin/ocamlmktop" +ocamldoc(secondary) = "%{ocaml-secondary-compiler:share}%/bin/ocamldoc" +ocamldep(secondary) = "%{ocaml-secondary-compiler:share}%/bin/ocamldep" diff --git a/patches/ocamlfind/0001-Fix-bug-when-installing-with-a-system-compiler.patch b/patches/ocamlfind/0001-Fix-bug-when-installing-with-a-system-compiler.patch new file mode 100644 index 0000000..c050899 --- /dev/null +++ b/patches/ocamlfind/0001-Fix-bug-when-installing-with-a-system-compiler.patch @@ -0,0 +1,26 @@ +From f53247f546375972789b96c3f612cd7f524bf2aa Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Mon, 11 Jul 2022 18:12:18 +0200 +Subject: [PATCH] Fix bug when installing with a system compiler + +See https://discuss.ocaml.org/t/problem-installing-ocamlfind-on-latest-ocamlpro-alpine-docker-image/10147 +--- + src/findlib/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/findlib/Makefile b/src/findlib/Makefile +index 84514b6f22..ea23f4a10c 100644 +--- a/src/findlib/Makefile ++++ b/src/findlib/Makefile +@@ -123,7 +123,7 @@ clean: + install: all + $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$(NAME)" + $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAMLFIND_BIN)" +- $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_CORE_STDLIB)" ++ test $(INSTALL_TOPFIND) -eq 0 || $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_CORE_STDLIB)" + test $(INSTALL_TOPFIND) -eq 0 || $(INSTALLFILE) topfind "$(DESTDIR)$(prefix)$(OCAML_CORE_STDLIB)/" + files=`$(SH) $(TOP)/tools/collect_files $(TOP)/Makefile.config \ + findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib$(LIB_SUFFIX) findlib.cmxs \ +-- +2.35.1 + diff --git a/patches/ocamlfind/0001-Harden-test-for-OCaml-5.patch b/patches/ocamlfind/0001-Harden-test-for-OCaml-5.patch new file mode 100644 index 0000000..8011238 --- /dev/null +++ b/patches/ocamlfind/0001-Harden-test-for-OCaml-5.patch @@ -0,0 +1,12 @@ +diff a/configure b/configure +--- a/configure ++++ b/configure +@@ -294,7 +294,7 @@ + # If findlib has been configured -sitelib $(ocamlc -where) then there's + # nothing to do, but otherwise we need to put OCaml's Standard Library + # into the path setting. +- if [ ! -e "${ocaml_sitelib}/stdlib/META" ]; then ++ if [ ! -e "${ocaml_sitelib}/stdlib.cmi" ]; then + ocamlpath="${ocaml_core_stdlib}${path_sep}${ocamlpath}" + fi + fi diff --git a/patches/ocamlfind/1.5.4-sed-bsd-compat.patch b/patches/ocamlfind/1.5.4-sed-bsd-compat.patch new file mode 100644 index 0000000..44629d0 --- /dev/null +++ b/patches/ocamlfind/1.5.4-sed-bsd-compat.patch @@ -0,0 +1,13 @@ +diff --git a/src/findlib/Makefile b/src/findlib/Makefile +index 5466d95..bdd7f14 100644 +--- a/src/findlib/Makefile ++++ b/src/findlib/Makefile +@@ -74,7 +74,7 @@ topfind.ml: topfind.ml.in + if [ "$(ENABLE_TOPFIND_PPXOPT)" = "true" ]; then \ + cp topfind.ml.in topfind.ml; \ + else \ +- sed -e '/PPXOPT_BEGIN/,/PPXOPT_END/{d}' topfind.ml.in \ ++ sed -e '/PPXOPT_BEGIN/,/PPXOPT_END/ d' topfind.ml.in \ + > topfind.ml ; \ + fi + diff --git a/patches/ocamlfind/check-num-in-sitelib.patch b/patches/ocamlfind/check-num-in-sitelib.patch new file mode 100644 index 0000000..2fe9e5f --- /dev/null +++ b/patches/ocamlfind/check-num-in-sitelib.patch @@ -0,0 +1,39 @@ +From 04a4e29db7d86e56ba7cb3b1ea6a26cdf9e597b2 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Fri, 20 Oct 2017 16:13:59 +0200 +Subject: [PATCH] don't install an empty 'num' package if a third-party package + exists + +When reinstalling/updating ocamlfind in an existing OCaml environment, +ocamlfind is installed in a context where ocamlfind packages may +already exist. In particular, the `num` package (separated from the +compiler distribution in 4.06) may exist and own the file +${ocaml_core_stdlib}/num.cmi. In this case ocamlfind should not +overwrite it by installing its own num package -- the behaviour +observed by Jacques-Pascal Deplaix before this patch. + +This approach may be generalizable to the other builtin base packages. +--- + configure | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 6a4a558..2627f1f 100755 +--- a/configure ++++ b/configure +@@ -524,7 +524,11 @@ fi + + # num? + +-if [ -f "${ocaml_core_stdlib}/num.cmi" ]; then ++if [ -f "${ocaml_sitelib}/num/META" ]; then ++ echo "num: package already present" ++ lnum="" ++ numtop="" ++elif [ -f "${ocaml_core_stdlib}/num.cmi" ]; then + echo "num: found" + lnum="num num-top" + numtop="num-top" +-- +2.9.5 + diff --git a/patches/ocamlfind/fix-bsd.patch b/patches/ocamlfind/fix-bsd.patch new file mode 100644 index 0000000..1a5a20b --- /dev/null +++ b/patches/ocamlfind/fix-bsd.patch @@ -0,0 +1,25 @@ +From 3c64229844630eefab8df15db1626d6fb4f2ee9a Mon Sep 17 00:00:00 2001 +From: Kate +Date: Mon, 15 Mar 2021 21:02:45 +0000 +Subject: [PATCH] Fix BSD support + +--- + tools/extract_args/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/extract_args/Makefile b/tools/extract_args/Makefile +index d6c80a1..4ba6aeb 100644 +--- a/tools/extract_args/Makefile ++++ b/tools/extract_args/Makefile +@@ -1,7 +1,7 @@ + all: extract_args + + extract_args.ml: extract_args.mll +- ocamllex -o $@ $< ++ ocamllex -o extract_args.ml extract_args.mll + + extract_args: extract_args.ml + ocamlc -o extract_args extract_args.ml +-- +2.30.2 + diff --git a/patches/ocamlfind/no-awk-check.patch.1.0.4 b/patches/ocamlfind/no-awk-check.patch.1.0.4 new file mode 100644 index 0000000..be6a765 --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.0.4 @@ -0,0 +1,19 @@ +commit 78fdec4547038f65e7d8401035dacdc7052f7ff2 +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index 4376bb9..ab70488 100755 +--- a/configure ++++ b/configure +@@ -170,7 +170,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.3.1 b/patches/ocamlfind/no-awk-check.patch.1.3.1 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.3.1 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.3.2 b/patches/ocamlfind/no-awk-check.patch.1.3.2 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.3.2 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.3.3 b/patches/ocamlfind/no-awk-check.patch.1.3.3 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.3.3 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.4.0 b/patches/ocamlfind/no-awk-check.patch.1.4.0 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.4.0 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.4.1 b/patches/ocamlfind/no-awk-check.patch.1.4.1 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.4.1 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.5.1 b/patches/ocamlfind/no-awk-check.patch.1.5.1 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.5.1 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.5.2 b/patches/ocamlfind/no-awk-check.patch.1.5.2 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.5.2 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.5.3 b/patches/ocamlfind/no-awk-check.patch.1.5.3 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.5.3 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.5.4 b/patches/ocamlfind/no-awk-check.patch.1.5.4 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.5.4 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.5.5 b/patches/ocamlfind/no-awk-check.patch.1.5.5 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.5.5 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.5.6 b/patches/ocamlfind/no-awk-check.patch.1.5.6 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.5.6 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.6.1 b/patches/ocamlfind/no-awk-check.patch.1.6.1 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.6.1 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.6.2 b/patches/ocamlfind/no-awk-check.patch.1.6.2 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.6.2 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.7.1 b/patches/ocamlfind/no-awk-check.patch.1.7.1 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.7.1 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.7.2 b/patches/ocamlfind/no-awk-check.patch.1.7.2 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.7.2 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.7.3 b/patches/ocamlfind/no-awk-check.patch.1.7.3 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.7.3 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.7.3-1 b/patches/ocamlfind/no-awk-check.patch.1.7.3-1 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.7.3-1 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/no-awk-check.patch.1.8.0 b/patches/ocamlfind/no-awk-check.patch.1.8.0 new file mode 100644 index 0000000..c9e80da --- /dev/null +++ b/patches/ocamlfind/no-awk-check.patch.1.8.0 @@ -0,0 +1,19 @@ +commit 40142bc941e6e308686e86be6fc2da92f346a22f +Author: Kate +Date: Tue Mar 19 16:29:06 2019 +0000 + + Remove awk from the set of checked unix tools as it's not used anywhere + +diff --git a/configure b/configure +index d9b587c..20e8dca 100755 +--- a/configure ++++ b/configure +@@ -184,7 +184,7 @@ echo "Configuring core..." + + # Some standard Unix tools must be available: + +-for tool in sed awk ocaml ocamlc uname rm make cat m4 dirname basename; do ++for tool in sed ocaml ocamlc uname rm make cat m4 dirname basename; do + if in_path $tool; then true; else + echo "configure: $tool not in PATH; this is required" 1>&2 + exit 1 diff --git a/patches/ocamlfind/ocaml-stub b/patches/ocamlfind/ocaml-stub new file mode 100644 index 0000000..e5ad990 --- /dev/null +++ b/patches/ocamlfind/ocaml-stub @@ -0,0 +1,4 @@ +#!/bin/sh + +BINDIR=$(dirname "$(command -v ocamlc)") +"$BINDIR/ocaml" -I "$OCAML_TOPLEVEL_PATH" "$@" diff --git a/patches/ocamlfind/ocamlfind.install.1.0.4 b/patches/ocamlfind/ocamlfind.install.1.0.4 new file mode 100644 index 0000000..3f9cffb --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.0.4 @@ -0,0 +1,4 @@ +bin: [ + "src/findlib/ocamlfind" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.3.1 b/patches/ocamlfind/ocamlfind.install.1.3.1 new file mode 100644 index 0000000..c4e91b6 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.3.1 @@ -0,0 +1,5 @@ +bin: [ + "src/findlib/ocamlfind" + "tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.3.2 b/patches/ocamlfind/ocamlfind.install.1.3.2 new file mode 100644 index 0000000..c4e91b6 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.3.2 @@ -0,0 +1,5 @@ +bin: [ + "src/findlib/ocamlfind" + "tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.3.3 b/patches/ocamlfind/ocamlfind.install.1.3.3 new file mode 100644 index 0000000..c4e91b6 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.3.3 @@ -0,0 +1,5 @@ +bin: [ + "src/findlib/ocamlfind" + "tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.4.0 b/patches/ocamlfind/ocamlfind.install.1.4.0 new file mode 100644 index 0000000..c4e91b6 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.4.0 @@ -0,0 +1,5 @@ +bin: [ + "src/findlib/ocamlfind" + "tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.4.1 b/patches/ocamlfind/ocamlfind.install.1.4.1 new file mode 100644 index 0000000..4dc43e8 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.4.1 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.5.1 b/patches/ocamlfind/ocamlfind.install.1.5.1 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.5.1 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.5.2 b/patches/ocamlfind/ocamlfind.install.1.5.2 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.5.2 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.5.3 b/patches/ocamlfind/ocamlfind.install.1.5.3 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.5.3 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.5.4 b/patches/ocamlfind/ocamlfind.install.1.5.4 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.5.4 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.5.5 b/patches/ocamlfind/ocamlfind.install.1.5.5 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.5.5 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.5.6 b/patches/ocamlfind/ocamlfind.install.1.5.6 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.5.6 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.6.1 b/patches/ocamlfind/ocamlfind.install.1.6.1 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.6.1 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.6.2 b/patches/ocamlfind/ocamlfind.install.1.6.2 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.6.2 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.7.1 b/patches/ocamlfind/ocamlfind.install.1.7.1 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.7.1 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.7.2 b/patches/ocamlfind/ocamlfind.install.1.7.2 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.7.2 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.7.3 b/patches/ocamlfind/ocamlfind.install.1.7.3 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.7.3 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.7.3-1 b/patches/ocamlfind/ocamlfind.install.1.7.3-1 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.7.3-1 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.8.0 b/patches/ocamlfind/ocamlfind.install.1.8.0 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.8.0 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/ocamlfind.install.1.8.1 b/patches/ocamlfind/ocamlfind.install.1.8.1 new file mode 100644 index 0000000..295c625 --- /dev/null +++ b/patches/ocamlfind/ocamlfind.install.1.8.1 @@ -0,0 +1,6 @@ +bin: [ + "src/findlib/ocamlfind" {"ocamlfind"} + "?src/findlib/ocamlfind_opt" {"ocamlfind"} + "?tools/safe_camlp4" +] +toplevel: ["src/findlib/topfind"] diff --git a/patches/ocamlfind/termux.patch.1.6.2 b/patches/ocamlfind/termux.patch.1.6.2 new file mode 100644 index 0000000..c573a4a --- /dev/null +++ b/patches/ocamlfind/termux.patch.1.6.2 @@ -0,0 +1,46 @@ +diff --git a/Makefile b/Makefile +index bf3aabb..efc5b94 100644 +--- a/Makefile ++++ b/Makefile +@@ -55,7 +55,7 @@ findlib.conf: findlib.conf.in + USE_CYGPATH="$(USE_CYGPATH)"; \ + export USE_CYGPATH; \ + cat findlib.conf.in | \ +- tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf ++ sh tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf + if ocamlc.opt >/dev/null 2>&1; then \ + echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \ + fi +diff --git a/src/findlib/Makefile b/src/findlib/Makefile +index 70dc74c..dcfc901 100644 +--- a/src/findlib/Makefile ++++ b/src/findlib/Makefile +@@ -79,8 +79,8 @@ findlib_config.ml: findlib_config.mlp $(TOP)/Makefile.config + USE_CYGPATH="$(USE_CYGPATH)"; \ + export USE_CYGPATH; \ + cat findlib_config.mlp | \ +- $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ +- $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ ++ sh $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ ++ sh $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ + sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \ + -e 's;@SYSTEM@;$(SYSTEM);g' \ + >findlib_config.ml +@@ -100,7 +100,7 @@ topfind: topfind_rd$(OCAML_REMOVE_DIRECTORY).p + USE_CYGPATH="$(USE_CYGPATH)"; \ + export USE_CYGPATH; \ + cat topfind_rd$(OCAML_REMOVE_DIRECTORY).p | \ +- $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' \ ++ sh $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' \ + >topfind + + num_top.cma: $(NUMTOP_OBJECTS) +@@ -115,7 +115,7 @@ install: all + mkdir -p "$(prefix)$(OCAML_SITELIB)/$(NAME)" + mkdir -p "$(prefix)$(OCAMLFIND_BIN)" + test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_CORE_STDLIB)" +- files=`$(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib.cmxa findlib.a findlib.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ ++ files=`sh $(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib.cmxa findlib.a findlib.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ + cp $$files "$(prefix)$(OCAML_SITELIB)/$(NAME)" + f="ocamlfind$(EXEC_SUFFIX)"; { test -f ocamlfind_opt$(EXEC_SUFFIX) && f="ocamlfind_opt$(EXEC_SUFFIX)"; }; \ + cp $$f "$(prefix)$(OCAMLFIND_BIN)/ocamlfind$(EXEC_SUFFIX)" diff --git a/patches/ocamlfind/termux.patch.1.7.1 b/patches/ocamlfind/termux.patch.1.7.1 new file mode 100644 index 0000000..b8e854f --- /dev/null +++ b/patches/ocamlfind/termux.patch.1.7.1 @@ -0,0 +1,52 @@ +commit 933444d4638a804fed42a2a57310ebe31e49855f (HEAD -> master) +Author: ygrek +Date: Sat Nov 26 16:21:34 2016 -0800 + + do not assume /bin/sh exists + +diff --git a/Makefile b/Makefile +index e2b46c2..3ecbedf 100644 +--- a/Makefile ++++ b/Makefile +@@ -55,7 +55,7 @@ findlib.conf: findlib.conf.in + USE_CYGPATH="$(USE_CYGPATH)"; \ + export USE_CYGPATH; \ + cat findlib.conf.in | \ +- tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf ++ sh tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf + if ./tools/cmd_from_same_dir ocamlc; then \ + echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \ + fi +diff --git a/src/findlib/Makefile b/src/findlib/Makefile +index 1385a6a..602dc34 100644 +--- a/src/findlib/Makefile ++++ b/src/findlib/Makefile +@@ -86,8 +86,8 @@ findlib_config.ml: findlib_config.mlp $(TOP)/Makefile.config + USE_CYGPATH="$(USE_CYGPATH)"; \ + export USE_CYGPATH; \ + cat findlib_config.mlp | \ +- $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ +- $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ ++ sh $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ ++ sh $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ + sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \ + -e 's;@SYSTEM@;$(SYSTEM);g' \ + >findlib_config.ml +@@ -107,7 +107,7 @@ topfind: topfind_rd$(OCAML_REMOVE_DIRECTORY).p + USE_CYGPATH="$(USE_CYGPATH)"; \ + export USE_CYGPATH; \ + cat topfind_rd$(OCAML_REMOVE_DIRECTORY).p | \ +- $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' \ ++ sh $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' \ + >topfind + + num_top.cma: $(NUMTOP_OBJECTS) +@@ -122,7 +122,7 @@ install: all + mkdir -p "$(prefix)$(OCAML_SITELIB)/$(NAME)" + mkdir -p "$(prefix)$(OCAMLFIND_BIN)" + test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_CORE_STDLIB)" +- files=`$(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib.a findlib.cmxs topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top.a findlib_top.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ ++ files=`sh $(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib.a findlib.cmxs topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top.a findlib_top.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ + cp $$files "$(prefix)$(OCAML_SITELIB)/$(NAME)" + f="ocamlfind$(EXEC_SUFFIX)"; { test -f ocamlfind_opt$(EXEC_SUFFIX) && f="ocamlfind_opt$(EXEC_SUFFIX)"; }; \ + cp $$f "$(prefix)$(OCAMLFIND_BIN)/ocamlfind$(EXEC_SUFFIX)" diff --git a/patches/ocamlfind/threads.patch b/patches/ocamlfind/threads.patch new file mode 100644 index 0000000..1f2191c --- /dev/null +++ b/patches/ocamlfind/threads.patch @@ -0,0 +1,26 @@ +From 6de006e6f4864a585b085f840660383fa354f9bf Mon Sep 17 00:00:00 2001 +From: Anton Bachin +Date: Wed, 20 Dec 2017 12:17:40 -0600 +Subject: [PATCH] threads: drop explicit check for -thread/-vmthread + +--- + site-lib-src/threads/META.in | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/site-lib-src/threads/META.in b/site-lib-src/threads/META.in +index b42f3dd..fe2d986 100644 +--- a/site-lib-src/threads/META.in ++++ b/site-lib-src/threads/META.in +@@ -9,9 +9,6 @@ dnl This file is input of the m4 macro processor. + + `browse_interfaces = "'interfaces`"' + +-`error(-mt) = "Missing -thread or -vmthread switch"' +-`error(-mt_vm,-mt_posix) = "Missing -thread or -vmthread switch"' +- + `package "vm" (' + ` # --- Bytecode-only threads:' + ` requires = "unix"' +-- +2.12.2 + diff --git a/patches/ocamlgraph/install-findlib-dgraph.patch b/patches/ocamlgraph/install-findlib-dgraph.patch new file mode 100644 index 0000000..b3e6b39 --- /dev/null +++ b/patches/ocamlgraph/install-findlib-dgraph.patch @@ -0,0 +1,16 @@ +diff -u -r ocamlgraph-1.8.3/Makefile.in ocamlgraph-new/Makefile.in +--- Makefile.in 2013-04-17 20:30:17.000000000 +0200 ++++ Makefile.in.new 2013-09-02 17:29:25.225954859 +0200 +@@ -372,8 +372,10 @@ + $(OCAMLFIND) install ocamlgraph META \ + $(SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \ + graph$(LIBEXT) graph.cmx graph.cmo graph.cmi $(CMA) $(CMXA) \ +- $(VIEWER_CMXLIB) $(VIEWER_CMOLIB) $(DGRAPH_CMXLIB) \ +- $(DGRAPH_CMOLIB) ++ $(VIEWER_CMXLIB) $(VIEWER_CMOLIB) $(VIEWER_CMILIB) \ ++ $(VIEWER_CMXLIB:.cmx=.o) \ ++ $(DGRAPH_CMXLIB) $(DGRAPH_CMOLIB) $(DGRAPH_CMILIB) \ ++ $(DGRAPH_CMXLIB:.cmx=.o) + else + $(OCAMLFIND) install ocamlgraph META \ + $(SRCDIR)/*.mli $(VIEWER_DIR)/*.mli $(DGRAPH_DIR)/*.mli \ diff --git a/patches/ocamlgraph/ocamlgraph.install b/patches/ocamlgraph/ocamlgraph.install new file mode 100644 index 0000000..b2e3c7b --- /dev/null +++ b/patches/ocamlgraph/ocamlgraph.install @@ -0,0 +1,6 @@ +lib: [ + "graph.cma" + "graph.cmi" + "graph.cmxa" + "graph.a" +] diff --git a/patches/ocamlify/ocamlify.install b/patches/ocamlify/ocamlify.install new file mode 100644 index 0000000..133e9cb --- /dev/null +++ b/patches/ocamlify/ocamlify.install @@ -0,0 +1 @@ +bin: ["_build/src/ocamlify"] diff --git a/patches/ocamlmod/_oasis_remove_.ml b/patches/ocamlmod/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/ocamlmod/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/ocamlmod/ocamlmod.install.0.0.3 b/patches/ocamlmod/ocamlmod.install.0.0.3 new file mode 100644 index 0000000..4f10ffa --- /dev/null +++ b/patches/ocamlmod/ocamlmod.install.0.0.3 @@ -0,0 +1 @@ +bin: ["_build/src/ocamlmod.byte" {"ocamlmod"}] diff --git a/patches/ocamlmod/ocamlmod.install.0.0.4 b/patches/ocamlmod/ocamlmod.install.0.0.4 new file mode 100644 index 0000000..4f10ffa --- /dev/null +++ b/patches/ocamlmod/ocamlmod.install.0.0.4 @@ -0,0 +1 @@ +bin: ["_build/src/ocamlmod.byte" {"ocamlmod"}] diff --git a/patches/ocamlmod/ocamlmod.install.0.0.7 b/patches/ocamlmod/ocamlmod.install.0.0.7 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/ocamlmod/ocamlmod.install.0.0.7 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/ocamlmod/ocamlmod.install.0.0.8 b/patches/ocamlmod/ocamlmod.install.0.0.8 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/ocamlmod/ocamlmod.install.0.0.8 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/ocamlmod/ocamlmod.install.0.0.9 b/patches/ocamlmod/ocamlmod.install.0.0.9 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/ocamlmod/ocamlmod.install.0.0.9 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/ocamlmod/safe-string.patch b/patches/ocamlmod/safe-string.patch new file mode 100644 index 0000000..0be5974 --- /dev/null +++ b/patches/ocamlmod/safe-string.patch @@ -0,0 +1,25 @@ +diff --git a/setup.ml b/setup.ml +index d611c02..13787aa 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -208,7 +208,7 @@ module OASISString = struct + raise Not_found + + let replace_chars f s = +- let buf = String.make (String.length s) 'X' in ++ let buf = Bytes.make (String.length s) 'X' in + for i = 0 to String.length s - 1 do + buf.[i] <- f s.[i] + done; +@@ -280,9 +280,9 @@ module OASISUtils = struct + let buf = + (* Start with a _ if digit *) + if '0' <= s.[0] && s.[0] <= '9' then +- "_"^buf ++ "_"^Bytes.to_string buf + else +- buf ++ Bytes.to_string buf + in + String.lowercase buf + end diff --git a/patches/ocamlmod/test01.mod.patch b/patches/ocamlmod/test01.mod.patch new file mode 100644 index 0000000..66eafbb --- /dev/null +++ b/patches/ocamlmod/test01.mod.patch @@ -0,0 +1,5 @@ +--- /dev/null ++++ test/data/test01.mod +@@ -0,0 +1,2 @@ ++A.ml ++B.ml diff --git a/patches/ocamlnet/cloexec.patch b/patches/ocamlnet/cloexec.patch new file mode 100644 index 0000000..707fcc9 --- /dev/null +++ b/patches/ocamlnet/cloexec.patch @@ -0,0 +1,71 @@ +diff -ur ocamlnet-3.6.5/src/netsys/configure ocamlnet-3.6.5-patch/src/netsys/configure +--- ocamlnet-3.6.5/src/netsys/configure 2013-06-06 01:05:30.000000000 +0200 ++++ ocamlnet-3.6.5-patch/src/netsys/configure 2013-08-28 15:26:52.113026081 +0200 +@@ -361,6 +361,20 @@ + echo "no" + fi + ++printf "Checking for O_CLOEXEC... " ++mkdir -p tmp ++cat <<_EOF_ >tmp/t.ml ++let x = Unix.O_CLOEXEC;; ++_EOF_ ++ ++def_o_cloexec="-D NO_O_CLOEXEC" ++if ocaml unix.cma tmp/t.ml >/dev/null 2>/dev/null; then ++ echo "yes" ++ def_o_cloexec="-D HAVE_O_CLOEXEC" ++else ++ echo "no" ++fi ++ + + ###################################################################### + +@@ -368,6 +382,7 @@ + cat <Makefile.conf + NETSYS_LINK_OPTIONS = $netsys_link_options + DEF_O_SHARE_DELETE = $def_o_share_delete ++DEF_O_CLOEXEC = $def_o_cloexec + EOF + + cat <>config.h +Only in ocamlnet-3.6.5-patch/src/netsys: configure~ +diff -ur ocamlnet-3.6.5/src/netsys/Makefile ocamlnet-3.6.5-patch/src/netsys/Makefile +--- ocamlnet-3.6.5/src/netsys/Makefile 2013-06-06 01:05:30.000000000 +0200 ++++ ocamlnet-3.6.5-patch/src/netsys/Makefile 2013-08-28 15:36:59.127055524 +0200 +@@ -48,7 +48,8 @@ + OCAMLC_OPTIONS_FOR_netsys_c_xdr.c = -ccopt -O + + OCAMLC_OPTIONS_FOR_netsys_posix.ml = \ +- -package "camlp4.macro" -syntax camlp4o -ppopt "$(DEF_O_SHARE_DELETE)" ++ -package "camlp4.macro" -syntax camlp4o -ppopt "$(DEF_O_SHARE_DELETE)" \ ++ -ppopt "$(DEF_O_CLOEXEC)" + OCAMLOPT_OPTIONS_FOR_netsys_posix.ml = $(OCAMLC_OPTIONS_FOR_netsys_posix.ml) + + OCAMLDEP_OPTIONS = -package "camlp4.macro" -syntax camlp4o +Only in ocamlnet-3.6.5-patch/src/netsys: Makefile~ +diff -ur ocamlnet-3.6.5/src/netsys/netsys_posix.ml ocamlnet-3.6.5-patch/src/netsys/netsys_posix.ml +--- ocamlnet-3.6.5/src/netsys/netsys_posix.ml 2013-06-06 01:05:30.000000000 +0200 ++++ ocamlnet-3.6.5-patch/src/netsys/netsys_posix.ml 2013-08-28 15:37:13.842507865 +0200 +@@ -702,6 +702,11 @@ + type at_flag = AT_EACCESS | AT_SYMLINK_NOFOLLOW | AT_REMOVEDIR + + (* The stubs assume these type definitions: *) ++IFDEF HAVE_O_CLOEXEC THEN ++type open_flag1 = Unix.open_flag = ++ O_RDONLY | O_WRONLY | O_RDWR | O_NONBLOCK | O_APPEND | O_CREAT | O_TRUNC ++ | O_EXCL | O_NOCTTY | O_DSYNC | O_SYNC | O_RSYNC | O_SHARE_DELETE | O_CLOEXEC ++ELSE + IFDEF HAVE_O_SHARE_DELETE THEN + type open_flag1 = Unix.open_flag = + O_RDONLY | O_WRONLY | O_RDWR | O_NONBLOCK | O_APPEND | O_CREAT | O_TRUNC +@@ -711,6 +716,7 @@ + O_RDONLY | O_WRONLY | O_RDWR | O_NONBLOCK | O_APPEND | O_CREAT | O_TRUNC + | O_EXCL | O_NOCTTY | O_DSYNC | O_SYNC | O_RSYNC + ENDIF ++ENDIF + + type access_permission1 = Unix.access_permission = + R_OK | W_OK | X_OK | F_OK +Only in ocamlnet-3.6.5-patch/src/netsys: netsys_posix.ml~ diff --git a/patches/ocamlnet/fix-ocaml-4.02.patch b/patches/ocamlnet/fix-ocaml-4.02.patch new file mode 100644 index 0000000..a6975f5 --- /dev/null +++ b/patches/ocamlnet/fix-ocaml-4.02.patch @@ -0,0 +1,12 @@ +--- a/src/netstring/netencoding.mli 2014-03-17 23:07:25.757083686 +0100 ++++ b/src/netstring/netencoding.mli 2014-03-17 23:05:15.801089492 +0100 +@@ -120,7 +120,7 @@ + * to ensure that all output lines have a length <= 76 bytes. + * + * Note unsafe characters: +- * As recommended by RFC 2045, the characters [!#$\@[]^`{|}~] ++ * As recommended by RFC 2045, the characters [!#$\@[]^`|{}~] + * and the double quotes + * are additionally represented as hex tokens. + * Furthermore, the letter 'F' is considered as unsafe if it + diff --git a/patches/ocamlnet/fix-version-number.patch b/patches/ocamlnet/fix-version-number.patch new file mode 100644 index 0000000..ba9dc76 --- /dev/null +++ b/patches/ocamlnet/fix-version-number.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 32e6f17..989522f 100755 +--- a/configure ++++ b/configure +@@ -73,7 +73,7 @@ set_defaults () { + ocamlc=`get_path ocamlc` + set_defaults + +-version="$(sed -ne 's/^version: *"\(.*\)\.git".*/\1/p' ../opam)" ++version="4.1.9" + exec_suffix="" + path_sep=":" + diff --git a/patches/ocamlnet/netgzip.patch b/patches/ocamlnet/netgzip.patch new file mode 100644 index 0000000..b240780 --- /dev/null +++ b/patches/ocamlnet/netgzip.patch @@ -0,0 +1,96 @@ +diff --git a/src/netzip/netgzip.ml b/src/netzip/netgzip.ml +index f696760..1057a4e 100644 +--- a/src/netzip/netgzip.ml ++++ b/src/netzip/netgzip.ml +@@ -6,8 +6,7 @@ class input_gzip_rec gzip_ch : Netchannels.rec_in_channel = + object(self) + val mutable closed = false + +- method input s p l = +- let s = Bytes.unsafe_to_string s in ++ method input s p l = + let n = Gzip.input gzip_ch s p l in + if n = 0 then raise End_of_file; + n +@@ -27,7 +26,6 @@ class input_gzip gzip_ch = + class output_gzip_rec gzip_ch : Netchannels.rec_out_channel = + object(self) + method output s p l = +- let s = Bytes.unsafe_to_string s in + Gzip.output gzip_ch s p l; + l + method close_out() = +@@ -156,24 +154,20 @@ let inflating_conv st incoming at_eof outgoing = + (fun out_buf out_pos out_len -> + let (finished, used_in, used_out) = + try +- let in_buf = Bytes.unsafe_to_string in_buf in +- let out_buf = Bytes.unsafe_to_string out_buf in +- Zlib.inflate +- stream +- in_buf in_pos in_len out_buf out_pos out_len ++ Zlib.inflate ++ stream ++ in_buf in_pos in_len out_buf out_pos out_len + Zlib.Z_SYNC_FLUSH + with Zlib.Error(_, _) -> +- dispose_in_ignore st; ++ dispose_in_ignore st; + gzip_error "error during decompression" in +- +- ++ ++ + st.in_size <- + Int32.add st.in_size (Int32.of_int used_out); + st.in_crc <- +- ( let out_buf = Bytes.unsafe_to_string out_buf in +- Zlib.update_crc st.in_crc out_buf out_pos used_out +- ); +- ++ Zlib.update_crc st.in_crc out_buf out_pos used_out; ++ + k := !k + used_in; + + if finished then ( +@@ -292,31 +286,27 @@ let deflating_conv st incoming at_eof outgoing = + (fun out_buf out_pos out_len -> + let (finished, used_in, used_out) = + try +- let in_buf = Bytes.unsafe_to_string in_buf in +- let out_buf = Bytes.unsafe_to_string out_buf in +- Zlib.deflate +- stream in_buf 0 in_len out_buf out_pos out_len ++ Zlib.deflate ++ stream in_buf 0 in_len out_buf out_pos out_len + (if at_eof then Zlib.Z_FINISH else Zlib.Z_NO_FLUSH) +- with ++ with + | Zlib.Error(_, "buffer error") -> + (false, 0, 0) + |Zlib.Error(_, msg) -> + raise (Gzip.Error("error during compression")) in +- ++ + st.out_size <- Int32.add st.out_size (Int32.of_int used_in); +- st.out_crc <- ( +- let in_buf = Bytes.unsafe_to_string in_buf in +- Zlib.update_crc st.out_crc in_buf 0 used_in +- ); +- ++ st.out_crc <- ++ Zlib.update_crc st.out_crc in_buf 0 used_in; ++ + Netbuffer.delete incoming 0 used_in; +- ++ + if at_eof && finished then loop := false; + used_out + ) in + if not at_eof then loop := false + done; +- ++ + if at_eof then ( + write_int32 outgoing st.out_crc; + write_int32 outgoing st.out_size; diff --git a/patches/ocamlnet/nethttpd_types.patch b/patches/ocamlnet/nethttpd_types.patch new file mode 100644 index 0000000..29bf7ad --- /dev/null +++ b/patches/ocamlnet/nethttpd_types.patch @@ -0,0 +1,23 @@ +diff --git a/src/nethttpd/nethttpd_types.ml b/src/nethttpd/nethttpd_types.ml +index af538c9..84f1521 100644 +--- a/src/nethttpd/nethttpd_types.ml ++++ b/src/nethttpd/nethttpd_types.ml +@@ -216,8 +216,6 @@ object(self) + + (* ---- The following is copied from Netcgi_env: ---- *) + +- method input_header = in_header +- + method input_header_field ?default name = + try in_header # field name + with Not_found as nf -> +@@ -250,9 +248,6 @@ object(self) + method input_content_type() = + Mimestring.scan_mime_type_ep (self # input_header_field "CONTENT-TYPE") [] + +- method output_header = +- out_header +- + method output_header_field ?default name = + try out_header # field name + with Not_found as nf -> diff --git a/patches/ocamlnet/netpop.patch b/patches/ocamlnet/netpop.patch new file mode 100644 index 0000000..8712dd4 --- /dev/null +++ b/patches/ocamlnet/netpop.patch @@ -0,0 +1,21 @@ +diff --git a/src/pop/netpop.ml b/src/pop/netpop.ml +index e99b5eb..9207382 100644 +--- a/src/pop/netpop.ml ++++ b/src/pop/netpop.ml +@@ -230,16 +230,4 @@ object (self) + send_command oc (sprintf "UIDL %d" n); + status_response ic parse_line (Hashtbl.create 1) + with _ -> raise Protocol_error +- +- method stat () = +- self#check_state `Transaction; +- send_command oc "STAT"; +- try +- status_response ic (fun s p -> +- let count, p = int s p in +- let size, p = int s p in +- let ext = trim s p 1 in +- (count, size, ext) +- ) +- with _ -> raise Protocol_error; + end diff --git a/patches/ocamlnet/ocamlnet-ocaml4.diff b/patches/ocamlnet/ocamlnet-ocaml4.diff new file mode 100644 index 0000000..3e038f6 --- /dev/null +++ b/patches/ocamlnet/ocamlnet-ocaml4.diff @@ -0,0 +1,11 @@ +--- src/netzip/netgzip.ml.orig 2012-10-10 12:35:18.000000000 -0700 ++++ src/netzip/netgzip.ml 2012-10-10 12:35:49.000000000 -0700 +@@ -323,7 +323,7 @@ + Netcompression.register + ~iana_name:"gzip" + ~decoder:(new inflating_pipe) +- ~encoder:(new deflating_pipe) ++ ~encoder:(new deflating_pipe ~level:9) + () + + diff --git a/patches/ocamlnet/ocamlnet.install b/patches/ocamlnet/ocamlnet.install new file mode 100644 index 0000000..29411be --- /dev/null +++ b/patches/ocamlnet/ocamlnet.install @@ -0,0 +1,4 @@ +bin: [ + "src/rpc-generator/ocamlrpcgen" + "src/netplex/netplex-admin" +] diff --git a/patches/ocamlnet/pkg-config.patch b/patches/ocamlnet/pkg-config.patch new file mode 100644 index 0000000..cbccf7a --- /dev/null +++ b/patches/ocamlnet/pkg-config.patch @@ -0,0 +1,17 @@ +diff --git a/code/src/nettls-gnutls/configure b/code/src/nettls-gnutls/configure +index 247ee47..65833db 100755 +--- a/src/nettls-gnutls/configure ++++ b/src/nettls-gnutls/configure +@@ -9,7 +9,10 @@ + have_gnutls=0 + + if [ -z "$PKG_CONFIG" ]; then +- PKG_CONFIG="pkg-config" ++ PKG_CONFIG="pkg-config" ++ # Workaround issue on OpenBSD ++ export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 ++ export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 + fi + + if [ -z "$GNUTLS_LIBS" ]; then + diff --git a/patches/ocamlnet/robust-host.patch b/patches/ocamlnet/robust-host.patch new file mode 100644 index 0000000..ee3f359 --- /dev/null +++ b/patches/ocamlnet/robust-host.patch @@ -0,0 +1,155 @@ +diff --git a/src/equeue-ssl/https_client.ml b/src/equeue-ssl/https_client.ml +index a1e7028..986cc2d 100644 +--- a/src/equeue-ssl/https_client.ml ++++ b/src/equeue-ssl/https_client.ml +@@ -15,6 +15,7 @@ object + string -> int -> Unixqueue.event_system -> + exn option -> + Uq_engines.multiplex_controller ++ method default_port : int option + end + + +@@ -64,5 +65,7 @@ let https_transport_channel_type ?(verify = fun _ _ _ -> ()) + ~ssl_socket + fd ctx esys in + (mplex :> Uq_engines.multiplex_controller) ++ ++ method default_port = Some 443 + end + ) +diff --git a/src/equeue-ssl/https_client.mli b/src/equeue-ssl/https_client.mli +index 446b031..cbbca97 100644 +--- a/src/equeue-ssl/https_client.mli ++++ b/src/equeue-ssl/https_client.mli +@@ -16,6 +16,7 @@ object + string -> int -> Unixqueue.event_system -> + exn option -> + Uq_engines.multiplex_controller ++ method default_port : int option + end + (** Same as {!Http_client.transport_channel_type} *) + +diff --git a/src/netclient/http_client.ml b/src/netclient/http_client.ml +index 23b4051..e708254 100644 +--- a/src/netclient/http_client.ml ++++ b/src/netclient/http_client.ml +@@ -2840,6 +2840,7 @@ let test_http_1_1 proto_str = + let transmitter + peer_is_proxy + proxy_auth_state ++ default_port + (m : http_call) + (f_done : http_call -> unit) + options +@@ -2943,8 +2944,12 @@ let transmitter + let rh = msg # request_header `Effective in + let host = msg # get_host() in + let port = msg # get_port() in +- let host_str = host ^ (if port = 80 then "" +- else ":" ^ string_of_int port) in ++ let include_port = match default_port with ++ | None -> true ++ | Some p -> p <> port in ++ let host_str = ++ host ^ (if include_port then ":" ^ string_of_int port ++ else "") in + rh # update_field "Host" host_str; + + if close_flag then +@@ -3573,9 +3578,10 @@ object + string -> int -> Unixqueue.event_system -> + Http_client_conncache.private_data -> + Uq_engines.multiplex_controller ++ method default_port : int option + end + +-let http_transport_channel_type : transport_channel_type = ++let simple_transport_channel_type default_port : transport_channel_type = + ( object(self) + method continue fd cb tmo tmo_x host port esys priv_data = + if priv_data <> None then raise Not_found; +@@ -3587,9 +3593,16 @@ let http_transport_channel_type : transport_channel_type = + method setup_e fd cb tmo tmo_x host port esys = + let mplex = self # continue fd cb tmo tmo_x host port esys None in + eps_e (`Done(mplex,None)) esys ++ method default_port = default_port + end + ) + ++let http_transport_channel_type = ++ simple_transport_channel_type (Some 80) ++ ++let proxy_transport_channel_type = ++ simple_transport_channel_type None ++ + + (**********************************************************************) + +@@ -3597,6 +3610,7 @@ let fragile_pipeline + esys cb + cache_peer + proxy_auth_state proxy_auth_handler_opt ++ default_port + fd mplex priv_data connect_time no_pipelining conn_cache + auth_cache + counters options = +@@ -3740,8 +3754,9 @@ let fragile_pipeline + * queues: + *) + let trans = +- transmitter peer_is_proxy proxy_auth_state m f_done options in +- ++ transmitter peer_is_proxy proxy_auth_state default_port ++ m f_done options in ++ + (* (* would not work, so leave disabled *) + if !proxy_auth_state = `None then ( + match proxy_auth_handler_opt with +@@ -4525,6 +4540,7 @@ let robust_pipeline + esys tp cb + peer + proxy_auth_handler_opt ++ default_port + conn_cache conn_owner + auth_cache + counters options = +@@ -4670,6 +4686,7 @@ let robust_pipeline + fragile_pipeline + esys cb cache_peer + proxy_auth_state proxy_auth_handler_opt ++ default_port + fd mplex priv_data t no_pipelining conn_cache + auth_cache + counters options in +@@ -4901,7 +4918,7 @@ class pipeline = + + initializer ( + Hashtbl.add transports http_cb_id http_transport_channel_type; +- Hashtbl.add transports proxy_only_cb_id http_transport_channel_type; ++ Hashtbl.add transports proxy_only_cb_id proxy_transport_channel_type; + ) + + method event_system = esys +@@ -5134,6 +5151,7 @@ class pipeline = + esys tp cb + peer + proxy_auth_handler_opt ++ tp#default_port + conn_cache + (self :> < >) + auth_cache +diff --git a/src/netclient/http_client.mli b/src/netclient/http_client.mli +index 9934f5f..5231083 100644 +--- a/src/netclient/http_client.mli ++++ b/src/netclient/http_client.mli +@@ -761,6 +761,9 @@ object + + If it is not possible to continue, the method may raise [Not_found]. + *) ++ ++ method default_port : int option ++ (** If set, the [Host] header omits this port number *) + end + + diff --git a/patches/ocamlscript/ocamlscript.install b/patches/ocamlscript/ocamlscript.install new file mode 100644 index 0000000..5c19182 --- /dev/null +++ b/patches/ocamlscript/ocamlscript.install @@ -0,0 +1 @@ +bin: ["ocamlscript"] diff --git a/patches/ocamlsdl/safe-string.diff b/patches/ocamlsdl/safe-string.diff new file mode 100644 index 0000000..69e4016 --- /dev/null +++ b/patches/ocamlsdl/safe-string.diff @@ -0,0 +1,19 @@ +diff -r -u ocamlsdl-0.9.1/src/sdlmouse.ml ocamlsdl-0.9.1.fix/src/sdlmouse.ml +--- a/src/sdlmouse.ml 2011-04-10 17:33:52.000000000 +0200 ++++ b/src/sdlmouse.ml 2017-11-23 17:13:19.000000000 +0100 +@@ -49,12 +49,12 @@ + = "ml_SDL_Cursor_data" + + let string_of_bits x = +- let s = String.make 8 ' ' in ++ let s = Bytes.make 8 ' ' in + for i=0 to 7 do + if x land (1 lsl i) <> 0 +- then s.[7-i] <- '@' ++ then Bytes.set s (7-i) '@' + done ; +- s ++ Bytes.to_string s + + let pprint_cursor c = + let { data = data ; mask = mask } = cursor_data c in diff --git a/patches/ocamlspot/ocamlspot.install b/patches/ocamlspot/ocamlspot.install new file mode 100644 index 0000000..7688696 --- /dev/null +++ b/patches/ocamlspot/ocamlspot.install @@ -0,0 +1,4 @@ +lib: [ + "ocamlspot.vim" + "ocamlspot.el" +] diff --git a/patches/ocamltter/cleanup.patch b/patches/ocamltter/cleanup.patch new file mode 100644 index 0000000..62d009e --- /dev/null +++ b/patches/ocamltter/cleanup.patch @@ -0,0 +1,4362 @@ +diff --git a/_oasis b/_oasis +index 3197125..1fc7b53 100644 +--- a/_oasis ++++ b/_oasis +@@ -9,6 +9,6 @@ BuildType: Custom (0.2) + InstallType: Custom (0.2) + XCustomBuild: yes no | omake --install; PREFIX=$prefix omake + XCustomInstall: PREFIX=$prefix omake install +-XCustomUninstall: PREFIX=$prefix omake uninstall ++XCustomUninstall: yes no | omake --install; PREFIX=$prefix omake uninstall + XCustomBuildClean: PREFIX=$prefix omake clean + BuildTools: omake +diff --git a/setup.ml b/setup.ml +index 6152a68..402be2f 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -1,48 +1,58 @@ + (* setup.ml generated for the first time by OASIS v0.3.0 *) + + (* OASIS_START *) +-(* DO NOT EDIT (digest: 96c54ae40aba435fd1fd9372631873d1) *) ++(* DO NOT EDIT (digest: 8c21f4cc3c6c83143ad3abd2a73b1129) *) + (* +- Regenerated by OASIS v0.3.0 ++ Regenerated by OASIS v0.4.6 + Visit http://oasis.forge.ocamlcore.org for more information and + documentation about functions used in this file. + *) + module OASISGettext = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISGettext.ml" *) ++(* # 22 "src/oasis/OASISGettext.ml" *) ++ + + let ns_ str = + str + ++ + let s_ str = + str + +- let f_ (str : ('a, 'b, 'c, 'd) format4) = ++ ++ let f_ (str: ('a, 'b, 'c, 'd) format4) = + str + ++ + let fn_ fmt1 fmt2 n = + if n = 1 then + fmt1^^"" + else + fmt2^^"" + ++ + let init = + [] + ++ + end + + module OASISContext = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISContext.ml" *) ++(* # 22 "src/oasis/OASISContext.ml" *) ++ + + open OASISGettext + ++ + type level = + [ `Debug + | `Info + | `Warning + | `Error] + ++ + type t = + { ++ (* TODO: replace this by a proplist. *) + quiet: bool; + info: bool; + debug: bool; +@@ -51,6 +61,7 @@ module OASISContext = struct + printf: level -> string -> unit; + } + ++ + let printf lvl str = + let beg = + match lvl with +@@ -61,6 +72,7 @@ module OASISContext = struct + in + prerr_endline (beg^str) + ++ + let default = + ref + { +@@ -72,37 +84,50 @@ module OASISContext = struct + printf = printf; + } + ++ + let quiet = + {!default with quiet = true} + + +- let args () = ++ let fspecs () = ++ (* TODO: don't act on default. *) ++ let ignore_plugins = ref false in + ["-quiet", + Arg.Unit (fun () -> default := {!default with quiet = true}), +- (s_ " Run quietly"); ++ s_ " Run quietly"; + + "-info", + Arg.Unit (fun () -> default := {!default with info = true}), +- (s_ " Display information message"); ++ s_ " Display information message"; + + + "-debug", + Arg.Unit (fun () -> default := {!default with debug = true}), +- (s_ " Output debug message")] ++ s_ " Output debug message"; ++ ++ "-ignore-plugins", ++ Arg.Set ignore_plugins, ++ s_ " Ignore plugin's field."; ++ ++ "-C", ++ (* TODO: remove this chdir. *) ++ Arg.String (fun str -> Sys.chdir str), ++ s_ "dir Change directory before running."], ++ fun () -> {!default with ignore_plugins = !ignore_plugins} + end + + module OASISString = struct +-(* # 1 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISString.ml" *) +- ++(* # 22 "src/oasis/OASISString.ml" *) + + + (** Various string utilities. +- ++ + Mostly inspired by extlib and batteries ExtString and BatString libraries. + + @author Sylvain Le Gall + *) + ++ + let nsplitf str f = + if str = "" then + [] +@@ -123,16 +148,18 @@ module OASISString = struct + push (); + List.rev !lst + ++ + (** [nsplit c s] Split the string [s] at char [c]. It doesn't include the + separator. + *) + let nsplit str c = + nsplitf str ((=) c) + ++ + let find ~what ?(offset=0) str = + let what_idx = ref 0 in +- let str_idx = ref offset in +- while !str_idx < String.length str && ++ let str_idx = ref offset in ++ while !str_idx < String.length str && + !what_idx < String.length what do + if str.[!str_idx] = what.[!what_idx] then + incr what_idx +@@ -142,16 +169,18 @@ module OASISString = struct + done; + if !what_idx <> String.length what then + raise Not_found +- else ++ else + !str_idx - !what_idx + +- let sub_start str len = ++ ++ let sub_start str len = + let str_len = String.length str in + if len >= str_len then + "" + else + String.sub str len (str_len - len) + ++ + let sub_end ?(offset=0) str len = + let str_len = String.length str in + if len >= str_len then +@@ -159,12 +188,13 @@ module OASISString = struct + else + String.sub str 0 (str_len - len) + ++ + let starts_with ~what ?(offset=0) str = + let what_idx = ref 0 in + let str_idx = ref offset in + let ok = ref true in + while !ok && +- !str_idx < String.length str && ++ !str_idx < String.length str && + !what_idx < String.length what do + if str.[!str_idx] = what.[!what_idx] then + incr what_idx +@@ -174,21 +204,23 @@ module OASISString = struct + done; + if !what_idx = String.length what then + true +- else ++ else + false + ++ + let strip_starts_with ~what str = + if starts_with ~what str then + sub_start str (String.length what) + else + raise Not_found + ++ + let ends_with ~what ?(offset=0) str = + let what_idx = ref ((String.length what) - 1) in + let str_idx = ref ((String.length str) - 1) in + let ok = ref true in + while !ok && +- offset <= !str_idx && ++ offset <= !str_idx && + 0 <= !what_idx do + if str.[!str_idx] = what.[!what_idx] then + decr what_idx +@@ -198,65 +230,137 @@ module OASISString = struct + done; + if !what_idx = -1 then + true +- else ++ else + false + ++ + let strip_ends_with ~what str = + if ends_with ~what str then + sub_end str (String.length what) + else + raise Not_found + ++ + let replace_chars f s = +- let buf = String.make (String.length s) 'X' in +- for i = 0 to String.length s - 1 do +- buf.[i] <- f s.[i] +- done; +- buf ++ let buf = Buffer.create (String.length s) in ++ String.iter (fun c -> Buffer.add_char buf (f c)) s; ++ Buffer.contents buf ++ ++ let lowercase_ascii = ++ replace_chars ++ (fun c -> ++ if (c >= 'A' && c <= 'Z') then ++ Char.chr (Char.code c + 32) ++ else ++ c) ++ ++ let uncapitalize_ascii s = ++ if s <> "" then ++ (lowercase_ascii (String.sub s 0 1)) ^ (String.sub s 1 ((String.length s) - 1)) ++ else ++ s ++ ++ let uppercase_ascii = ++ replace_chars ++ (fun c -> ++ if (c >= 'a' && c <= 'z') then ++ Char.chr (Char.code c - 32) ++ else ++ c) ++ ++ let capitalize_ascii s = ++ if s <> "" then ++ (uppercase_ascii (String.sub s 0 1)) ^ (String.sub s 1 ((String.length s) - 1)) ++ else ++ s + + end + + module OASISUtils = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISUtils.ml" *) ++(* # 22 "src/oasis/OASISUtils.ml" *) ++ + + open OASISGettext + +- module MapString = Map.Make(String) + +- let map_string_of_assoc assoc = +- List.fold_left +- (fun acc (k, v) -> MapString.add k v acc) +- MapString.empty +- assoc ++ module MapExt = ++ struct ++ module type S = ++ sig ++ include Map.S ++ val add_list: 'a t -> (key * 'a) list -> 'a t ++ val of_list: (key * 'a) list -> 'a t ++ val to_list: 'a t -> (key * 'a) list ++ end ++ ++ module Make (Ord: Map.OrderedType) = ++ struct ++ include Map.Make(Ord) ++ ++ let rec add_list t = ++ function ++ | (k, v) :: tl -> add_list (add k v t) tl ++ | [] -> t + +- module SetString = Set.Make(String) ++ let of_list lst = add_list empty lst ++ ++ let to_list t = fold (fun k v acc -> (k, v) :: acc) t [] ++ end ++ end ++ ++ ++ module MapString = MapExt.Make(String) + +- let set_string_add_list st lst = +- List.fold_left +- (fun acc e -> SetString.add e acc) +- st +- lst + +- let set_string_of_list = +- set_string_add_list +- SetString.empty ++ module SetExt = ++ struct ++ module type S = ++ sig ++ include Set.S ++ val add_list: t -> elt list -> t ++ val of_list: elt list -> t ++ val to_list: t -> elt list ++ end ++ ++ module Make (Ord: Set.OrderedType) = ++ struct ++ include Set.Make(Ord) ++ ++ let rec add_list t = ++ function ++ | e :: tl -> add_list (add e t) tl ++ | [] -> t ++ ++ let of_list lst = add_list empty lst ++ ++ let to_list = elements ++ end ++ end ++ ++ ++ module SetString = SetExt.Make(String) + + + let compare_csl s1 s2 = +- String.compare (String.lowercase s1) (String.lowercase s2) ++ String.compare (OASISString.lowercase_ascii s1) (OASISString.lowercase_ascii s2) ++ + + module HashStringCsl = + Hashtbl.Make + (struct + type t = string ++ let equal s1 s2 = (compare_csl s1 s2) = 0 ++ let hash s = Hashtbl.hash (OASISString.lowercase_ascii s) ++ end) + +- let equal s1 s2 = +- (String.lowercase s1) = (String.lowercase s2) +- +- let hash s = +- Hashtbl.hash (String.lowercase s) ++ module SetStringCsl = ++ SetExt.Make ++ (struct ++ type t = string ++ let compare = compare_csl + end) + ++ + let varname_of_string ?(hyphen='_') s = + if String.length s = 0 then + begin +@@ -284,9 +388,10 @@ module OASISUtils = struct + else + buf + in +- String.lowercase buf ++ OASISString.lowercase_ascii buf + end + ++ + let varname_concat ?(hyphen='_') p s = + let what = String.make 1 hyphen in + let p = +@@ -307,42 +412,49 @@ module OASISUtils = struct + let is_varname str = + str = varname_of_string str + ++ + let failwithf fmt = Printf.ksprintf failwith fmt + ++ + end + + module PropList = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/PropList.ml" *) ++(* # 22 "src/oasis/PropList.ml" *) ++ + + open OASISGettext + ++ + type name = string + ++ + exception Not_set of name * string option + exception No_printer of name + exception Unknown_field of name * name + ++ + let () = + Printexc.register_printer + (function + | Not_set (nm, Some rsn) -> +- Some ++ Some + (Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn) + | Not_set (nm, None) -> +- Some ++ Some + (Printf.sprintf (f_ "Field '%s' is not set") nm) + | No_printer nm -> + Some + (Printf.sprintf (f_ "No default printer for value %s") nm) + | Unknown_field (nm, schm) -> +- Some +- (Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm) ++ Some ++ (Printf.sprintf ++ (f_ "Field %s is not defined in schema %s") nm schm) + | _ -> + None) + ++ + module Data = + struct +- + type t = + (name, unit -> unit) Hashtbl.t + +@@ -352,12 +464,13 @@ module PropList = struct + let clear t = + Hashtbl.clear t + +-(* # 71 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/PropList.ml" *) ++ ++(* # 78 "src/oasis/PropList.ml" *) + end + ++ + module Schema = + struct +- + type ('ctxt, 'extra) value = + { + get: Data.t -> string; +@@ -381,7 +494,7 @@ module PropList = struct + order = Queue.create (); + name_norm = + (if case_insensitive then +- String.lowercase ++ OASISString.lowercase_ascii + else + fun s -> s); + } +@@ -445,9 +558,9 @@ module PropList = struct + t.name + end + ++ + module Field = + struct +- + type ('ctxt, 'value, 'extra) t = + { + set: Data.t -> ?context:'ctxt -> 'value -> unit; +@@ -577,28 +690,27 @@ module PropList = struct + + let fgets data t = + t.gets data +- + end + ++ + module FieldRO = + struct +- + let create ?schema ?name ?parse ?print ?default ?update ?help extra = + let fld = + Field.create ?schema ?name ?parse ?print ?default ?update ?help extra + in + fun data -> Field.fget data fld +- + end + end + + module OASISMessage = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISMessage.ml" *) ++(* # 22 "src/oasis/OASISMessage.ml" *) + + + open OASISGettext + open OASISContext + ++ + let generic_message ~ctxt lvl fmt = + let cond = + if ctxt.quiet then +@@ -617,30 +729,39 @@ module OASISMessage = struct + end) + fmt + ++ + let debug ~ctxt fmt = + generic_message ~ctxt `Debug fmt + ++ + let info ~ctxt fmt = + generic_message ~ctxt `Info fmt + ++ + let warning ~ctxt fmt = + generic_message ~ctxt `Warning fmt + ++ + let error ~ctxt fmt = + generic_message ~ctxt `Error fmt + + end + + module OASISVersion = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISVersion.ml" *) ++(* # 22 "src/oasis/OASISVersion.ml" *) ++ + + open OASISGettext + + + ++ ++ + type s = string + +- type t = string ++ ++ type t = string ++ + + type comparator = + | VGreater of t +@@ -650,20 +771,24 @@ module OASISVersion = struct + | VLesserEqual of t + | VOr of comparator * comparator + | VAnd of comparator * comparator +- ++ ++ + + (* Range of allowed characters *) + let is_digit c = + '0' <= c && c <= '9' + ++ + let is_alpha c = + ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') + ++ + let is_special = + function + | '.' | '+' | '-' | '~' -> true + | _ -> false + ++ + let rec version_compare v1 v2 = + if v1 <> "" || v2 <> "" then + begin +@@ -707,11 +832,11 @@ module OASISVersion = struct + while !p < String.length v && is_digit v.[!p] do + incr p + done; +- let substr = ++ let substr = + String.sub v !p ((String.length v) - !p) +- in +- let res = +- match String.sub v start_p (!p - start_p) with ++ in ++ let res = ++ match String.sub v start_p (!p - start_p) with + | "" -> 0 + | s -> int_of_string s + in +@@ -747,8 +872,14 @@ module OASISVersion = struct + + let version_of_string str = str + ++ + let string_of_version t = t + ++ ++ let version_compare_string s1 s2 = ++ version_compare (version_of_string s1) (version_of_string s2) ++ ++ + let chop t = + try + let pos = +@@ -758,6 +889,7 @@ module OASISVersion = struct + with Not_found -> + t + ++ + let rec comparator_apply v op = + match op with + | VGreater cv -> +@@ -775,6 +907,7 @@ module OASISVersion = struct + | VAnd (op1, op2) -> + (comparator_apply v op1) && (comparator_apply v op2) + ++ + let rec string_of_comparator = + function + | VGreater v -> "> "^(string_of_version v) +@@ -787,6 +920,7 @@ module OASISVersion = struct + | VAnd (c1, c2) -> + (string_of_comparator c1)^" && "^(string_of_comparator c2) + ++ + let rec varname_of_comparator = + let concat p v = + OASISUtils.varname_concat +@@ -805,13 +939,24 @@ module OASISVersion = struct + | VAnd (c1, c2) -> + (varname_of_comparator c1)^"_and_"^(varname_of_comparator c2) + +- let version_0_3_or_after t = +- comparator_apply t (VGreaterEqual (string_of_version "0.3")) ++ ++ let rec comparator_ge v' = ++ let cmp v = version_compare v v' >= 0 in ++ function ++ | VEqual v ++ | VGreaterEqual v ++ | VGreater v -> cmp v ++ | VLesserEqual _ ++ | VLesser _ -> false ++ | VOr (c1, c2) -> comparator_ge v' c1 || comparator_ge v' c2 ++ | VAnd (c1, c2) -> comparator_ge v' c1 && comparator_ge v' c2 ++ + + end + + module OASISLicense = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISLicense.ml" *) ++(* # 22 "src/oasis/OASISLicense.ml" *) ++ + + (** License for _oasis fields + @author Sylvain Le Gall +@@ -819,15 +964,20 @@ module OASISLicense = struct + + + +- type license = string + +- type license_exception = string ++ ++ type license = string ++ ++ ++ type license_exception = string ++ + + type license_version = + | Version of OASISVersion.t + | VersionOrLater of OASISVersion.t + | NoVersion +- ++ ++ + + type license_dep_5_unit = + { +@@ -835,31 +985,38 @@ module OASISLicense = struct + excption: license_exception option; + version: license_version; + } +- ++ ++ + + type license_dep_5 = + | DEP5Unit of license_dep_5_unit + | DEP5Or of license_dep_5 list + | DEP5And of license_dep_5 list +- ++ + + type t = + | DEP5License of license_dep_5 + | OtherLicense of string (* URL *) +- ++ ++ + + end + + module OASISExpr = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISExpr.ml" *) ++(* # 22 "src/oasis/OASISExpr.ml" *) ++ ++ + + + + open OASISGettext + +- type test = string + +- type flag = string ++ type test = string ++ ++ ++ type flag = string ++ + + type t = + | EBool of bool +@@ -868,9 +1025,11 @@ module OASISExpr = struct + | EOr of t * t + | EFlag of flag + | ETest of test * string +- + +- type 'a choices = (t * 'a) list ++ ++ ++ type 'a choices = (t * 'a) list ++ + + let eval var_get t = + let rec eval' = +@@ -902,6 +1061,7 @@ module OASISExpr = struct + in + eval' t + ++ + let choose ?printer ?name var_get lst = + let rec choose_aux = + function +@@ -938,44 +1098,66 @@ module OASISExpr = struct + in + choose_aux (List.rev lst) + ++ ++end ++ ++module OASISText = struct ++(* # 22 "src/oasis/OASISText.ml" *) ++ ++ ++ ++ type elt = ++ | Para of string ++ | Verbatim of string ++ | BlankLine ++ ++ ++ type t = elt list ++ + end + + module OASISTypes = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISTypes.ml" *) ++(* # 22 "src/oasis/OASISTypes.ml" *) ++ ++ ++ + + ++ type name = string ++ type package_name = string ++ type url = string ++ type unix_dirname = string ++ type unix_filename = string ++ type host_dirname = string ++ type host_filename = string ++ type prog = string ++ type arg = string ++ type args = string list ++ type command_line = (prog * arg list) + + +- type name = string +- type package_name = string +- type url = string +- type unix_dirname = string +- type unix_filename = string +- type host_dirname = string +- type host_filename = string +- type prog = string +- type arg = string +- type args = string list +- type command_line = (prog * arg list) ++ type findlib_name = string ++ type findlib_full = string + +- type findlib_name = string +- type findlib_full = string + + type compiled_object = + | Byte + | Native + | Best +- ++ ++ + + type dependency = + | FindlibPackage of findlib_full * OASISVersion.comparator option + | InternalLibrary of name +- ++ ++ + + type tool = + | ExternalTool of name + | InternalExecutable of name +- ++ ++ + + type vcs = + | Darcs +@@ -987,7 +1169,8 @@ module OASISTypes = struct + | Arch + | Monotone + | OtherVCS of url +- ++ ++ + + type plugin_kind = + [ `Configure +@@ -998,6 +1181,7 @@ module OASISTypes = struct + | `Extra + ] + ++ + type plugin_data_purpose = + [ `Configure + | `Build +@@ -1012,22 +1196,29 @@ module OASISTypes = struct + | `Other of string + ] + +- type 'a plugin = 'a * name * OASISVersion.t option ++ ++ type 'a plugin = 'a * name * OASISVersion.t option ++ + + type all_plugin = plugin_kind plugin + ++ + type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list + +-(* # 102 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISTypes.ml" *) + +- type 'a conditional = 'a OASISExpr.choices ++(* # 115 "src/oasis/OASISTypes.ml" *) ++ ++ ++ type 'a conditional = 'a OASISExpr.choices ++ + + type custom = + { + pre_command: (command_line option) conditional; + post_command: (command_line option) conditional; + } +- ++ ++ + + type common_section = + { +@@ -1035,7 +1226,8 @@ module OASISTypes = struct + cs_data: PropList.Data.t; + cs_plugin_data: plugin_data; + } +- ++ ++ + + type build_section = + { +@@ -1054,7 +1246,8 @@ module OASISTypes = struct + bs_byteopt: args conditional; + bs_nativeopt: args conditional; + } +- ++ ++ + + type library = + { +@@ -1064,19 +1257,29 @@ module OASISTypes = struct + lib_findlib_parent: findlib_name option; + lib_findlib_name: findlib_name option; + lib_findlib_containers: findlib_name list; +- } ++ } ++ ++ ++ type object_ = ++ { ++ obj_modules: string list; ++ obj_findlib_fullname: findlib_name list option; ++ } ++ + + type executable = + { + exec_custom: bool; + exec_main_is: unix_filename; +- } ++ } ++ + + type flag = + { + flag_description: string option; + flag_default: bool conditional; +- } ++ } ++ + + type source_repository = + { +@@ -1087,7 +1290,8 @@ module OASISTypes = struct + src_repo_branch: string option; + src_repo_tag: string option; + src_repo_subdir: unix_filename option; +- } ++ } ++ + + type test = + { +@@ -1097,7 +1301,8 @@ module OASISTypes = struct + test_working_directory: unix_filename option; + test_run: bool conditional; + test_tools: tool list; +- } ++ } ++ + + type doc_format = + | HTML of unix_filename +@@ -1107,90 +1312,475 @@ module OASISTypes = struct + | Info of unix_filename + | DVI + | OtherDoc +- + +- type doc = +- { +- doc_type: [`Doc] plugin; +- doc_custom: custom; +- doc_build: bool conditional; +- doc_install: bool conditional; +- doc_install_dir: unix_filename; +- doc_title: string; +- doc_authors: string list; +- doc_abstract: string option; +- doc_format: doc_format; +- doc_data_files: (unix_filename * unix_filename option) list; +- doc_build_tools: tool list; +- } + +- type section = +- | Library of common_section * build_section * library +- | Executable of common_section * build_section * executable +- | Flag of common_section * flag +- | SrcRepo of common_section * source_repository +- | Test of common_section * test +- | Doc of common_section * doc +- + +- type section_kind = +- [ `Library | `Executable | `Flag | `SrcRepo | `Test | `Doc ] ++ type doc = ++ { ++ doc_type: [`Doc] plugin; ++ doc_custom: custom; ++ doc_build: bool conditional; ++ doc_install: bool conditional; ++ doc_install_dir: unix_filename; ++ doc_title: string; ++ doc_authors: string list; ++ doc_abstract: string option; ++ doc_format: doc_format; ++ doc_data_files: (unix_filename * unix_filename option) list; ++ doc_build_tools: tool list; ++ } ++ ++ ++ type section = ++ | Library of common_section * build_section * library ++ | Object of common_section * build_section * object_ ++ | Executable of common_section * build_section * executable ++ | Flag of common_section * flag ++ | SrcRepo of common_section * source_repository ++ | Test of common_section * test ++ | Doc of common_section * doc ++ ++ ++ ++ type section_kind = ++ [ `Library | `Object | `Executable | `Flag | `SrcRepo | `Test | `Doc ] ++ ++ ++ type package = ++ { ++ oasis_version: OASISVersion.t; ++ ocaml_version: OASISVersion.comparator option; ++ findlib_version: OASISVersion.comparator option; ++ alpha_features: string list; ++ beta_features: string list; ++ name: package_name; ++ version: OASISVersion.t; ++ license: OASISLicense.t; ++ license_file: unix_filename option; ++ copyrights: string list; ++ maintainers: string list; ++ authors: string list; ++ homepage: url option; ++ synopsis: string; ++ description: OASISText.t option; ++ categories: url list; ++ ++ conf_type: [`Configure] plugin; ++ conf_custom: custom; ++ ++ build_type: [`Build] plugin; ++ build_custom: custom; ++ ++ install_type: [`Install] plugin; ++ install_custom: custom; ++ uninstall_custom: custom; ++ ++ clean_custom: custom; ++ distclean_custom: custom; ++ ++ files_ab: unix_filename list; ++ sections: section list; ++ plugins: [`Extra] plugin list; ++ disable_oasis_section: unix_filename list; ++ schema_data: PropList.Data.t; ++ plugin_data: plugin_data; ++ } ++ ++ ++end ++ ++module OASISFeatures = struct ++(* # 22 "src/oasis/OASISFeatures.ml" *) ++ ++ open OASISTypes ++ open OASISUtils ++ open OASISGettext ++ open OASISVersion ++ ++ module MapPlugin = ++ Map.Make ++ (struct ++ type t = plugin_kind * name ++ let compare = Pervasives.compare ++ end) ++ ++ module Data = ++ struct ++ type t = ++ { ++ oasis_version: OASISVersion.t; ++ plugin_versions: OASISVersion.t option MapPlugin.t; ++ alpha_features: string list; ++ beta_features: string list; ++ } ++ ++ let create oasis_version alpha_features beta_features = ++ { ++ oasis_version = oasis_version; ++ plugin_versions = MapPlugin.empty; ++ alpha_features = alpha_features; ++ beta_features = beta_features ++ } ++ ++ let of_package pkg = ++ create ++ pkg.OASISTypes.oasis_version ++ pkg.OASISTypes.alpha_features ++ pkg.OASISTypes.beta_features ++ ++ let add_plugin (plugin_kind, plugin_name, plugin_version) t = ++ {t with ++ plugin_versions = MapPlugin.add ++ (plugin_kind, plugin_name) ++ plugin_version ++ t.plugin_versions} ++ ++ let plugin_version plugin_kind plugin_name t = ++ MapPlugin.find (plugin_kind, plugin_name) t.plugin_versions ++ ++ let to_string t = ++ Printf.sprintf ++ "oasis_version: %s; alpha_features: %s; beta_features: %s; \ ++ plugins_version: %s" ++ (OASISVersion.string_of_version t.oasis_version) ++ (String.concat ", " t.alpha_features) ++ (String.concat ", " t.beta_features) ++ (String.concat ", " ++ (MapPlugin.fold ++ (fun (_, plg) ver_opt acc -> ++ (plg^ ++ (match ver_opt with ++ | Some v -> ++ " "^(OASISVersion.string_of_version v) ++ | None -> "")) ++ :: acc) ++ t.plugin_versions [])) ++ end ++ ++ type origin = ++ | Field of string * string ++ | Section of string ++ | NoOrigin ++ ++ type stage = Alpha | Beta ++ ++ ++ let string_of_stage = ++ function ++ | Alpha -> "alpha" ++ | Beta -> "beta" ++ ++ ++ let field_of_stage = ++ function ++ | Alpha -> "AlphaFeatures" ++ | Beta -> "BetaFeatures" ++ ++ type publication = InDev of stage | SinceVersion of OASISVersion.t ++ ++ type t = ++ { ++ name: string; ++ plugin: all_plugin option; ++ publication: publication; ++ description: unit -> string; ++ } ++ ++ (* TODO: mutex protect this. *) ++ let all_features = Hashtbl.create 13 ++ ++ ++ let since_version ver_str = SinceVersion (version_of_string ver_str) ++ let alpha = InDev Alpha ++ let beta = InDev Beta ++ ++ ++ let to_string t = ++ Printf.sprintf ++ "feature: %s; plugin: %s; publication: %s" ++ t.name ++ (match t.plugin with ++ | None -> "" ++ | Some (_, nm, _) -> nm) ++ (match t.publication with ++ | InDev stage -> string_of_stage stage ++ | SinceVersion ver -> ">= "^(OASISVersion.string_of_version ver)) ++ ++ let data_check t data origin = ++ let no_message = "no message" in ++ ++ let check_feature features stage = ++ let has_feature = List.mem t.name features in ++ if not has_feature then ++ match origin with ++ | Field (fld, where) -> ++ Some ++ (Printf.sprintf ++ (f_ "Field %s in %s is only available when feature %s \ ++ is in field %s.") ++ fld where t.name (field_of_stage stage)) ++ | Section sct -> ++ Some ++ (Printf.sprintf ++ (f_ "Section %s is only available when features %s \ ++ is in field %s.") ++ sct t.name (field_of_stage stage)) ++ | NoOrigin -> ++ Some no_message ++ else ++ None ++ in ++ ++ let version_is_good ~min_version version fmt = ++ let version_is_good = ++ OASISVersion.comparator_apply ++ version (OASISVersion.VGreaterEqual min_version) ++ in ++ Printf.ksprintf ++ (fun str -> ++ if version_is_good then ++ None ++ else ++ Some str) ++ fmt ++ in ++ ++ match origin, t.plugin, t.publication with ++ | _, _, InDev Alpha -> check_feature data.Data.alpha_features Alpha ++ | _, _, InDev Beta -> check_feature data.Data.beta_features Beta ++ | Field(fld, where), None, SinceVersion min_version -> ++ version_is_good ~min_version data.Data.oasis_version ++ (f_ "Field %s in %s is only valid since OASIS v%s, update \ ++ OASISFormat field from '%s' to '%s' after checking \ ++ OASIS changelog.") ++ fld where (string_of_version min_version) ++ (string_of_version data.Data.oasis_version) ++ (string_of_version min_version) ++ ++ | Field(fld, where), Some(plugin_knd, plugin_name, _), ++ SinceVersion min_version -> ++ begin ++ try ++ let plugin_version_current = ++ try ++ match Data.plugin_version plugin_knd plugin_name data with ++ | Some ver -> ver ++ | None -> ++ failwithf ++ (f_ "Field %s in %s is only valid for the OASIS \ ++ plugin %s since v%s, but no plugin version is \ ++ defined in the _oasis file, change '%s' to \ ++ '%s (%s)' in your _oasis file.") ++ fld where plugin_name (string_of_version min_version) ++ plugin_name ++ plugin_name (string_of_version min_version) ++ with Not_found -> ++ failwithf ++ (f_ "Field %s in %s is only valid when the OASIS plugin %s \ ++ is defined.") ++ fld where plugin_name ++ in ++ version_is_good ~min_version plugin_version_current ++ (f_ "Field %s in %s is only valid for the OASIS plugin %s \ ++ since v%s, update your plugin from '%s (%s)' to \ ++ '%s (%s)' after checking the plugin's changelog.") ++ fld where plugin_name (string_of_version min_version) ++ plugin_name (string_of_version plugin_version_current) ++ plugin_name (string_of_version min_version) ++ with Failure msg -> ++ Some msg ++ end ++ ++ | Section sct, None, SinceVersion min_version -> ++ version_is_good ~min_version data.Data.oasis_version ++ (f_ "Section %s is only valid for since OASIS v%s, update \ ++ OASISFormat field from '%s' to '%s' after checking OASIS \ ++ changelog.") ++ sct (string_of_version min_version) ++ (string_of_version data.Data.oasis_version) ++ (string_of_version min_version) ++ ++ | Section sct, Some(plugin_knd, plugin_name, _), ++ SinceVersion min_version -> ++ begin ++ try ++ let plugin_version_current = ++ try ++ match Data.plugin_version plugin_knd plugin_name data with ++ | Some ver -> ver ++ | None -> ++ failwithf ++ (f_ "Section %s is only valid for the OASIS \ ++ plugin %s since v%s, but no plugin version is \ ++ defined in the _oasis file, change '%s' to \ ++ '%s (%s)' in your _oasis file.") ++ sct plugin_name (string_of_version min_version) ++ plugin_name ++ plugin_name (string_of_version min_version) ++ with Not_found -> ++ failwithf ++ (f_ "Section %s is only valid when the OASIS plugin %s \ ++ is defined.") ++ sct plugin_name ++ in ++ version_is_good ~min_version plugin_version_current ++ (f_ "Section %s is only valid for the OASIS plugin %s \ ++ since v%s, update your plugin from '%s (%s)' to \ ++ '%s (%s)' after checking the plugin's changelog.") ++ sct plugin_name (string_of_version min_version) ++ plugin_name (string_of_version plugin_version_current) ++ plugin_name (string_of_version min_version) ++ with Failure msg -> ++ Some msg ++ end ++ ++ | NoOrigin, None, SinceVersion min_version -> ++ version_is_good ~min_version data.Data.oasis_version "%s" no_message ++ ++ | NoOrigin, Some(plugin_knd, plugin_name, _), SinceVersion min_version -> ++ begin ++ try ++ let plugin_version_current = ++ match Data.plugin_version plugin_knd plugin_name data with ++ | Some ver -> ver ++ | None -> raise Not_found ++ in ++ version_is_good ~min_version plugin_version_current ++ "%s" no_message ++ with Not_found -> ++ Some no_message ++ end ++ ++ ++ let data_assert t data origin = ++ match data_check t data origin with ++ | None -> () ++ | Some str -> failwith str ++ ++ ++ let data_test t data = ++ match data_check t data NoOrigin with ++ | None -> true ++ | Some str -> false ++ ++ ++ let package_test t pkg = ++ data_test t (Data.of_package pkg) ++ ++ ++ let create ?plugin name publication description = ++ let () = ++ if Hashtbl.mem all_features name then ++ failwithf "Feature '%s' is already declared." name ++ in ++ let t = ++ { ++ name = name; ++ plugin = plugin; ++ publication = publication; ++ description = description; ++ } ++ in ++ Hashtbl.add all_features name t; ++ t ++ ++ ++ let get_stage name = ++ try ++ (Hashtbl.find all_features name).publication ++ with Not_found -> ++ failwithf (f_ "Feature %s doesn't exist.") name ++ ++ ++ let list () = ++ Hashtbl.fold (fun _ v acc -> v :: acc) all_features [] ++ ++ (* ++ * Real flags. ++ *) ++ ++ ++ let features = ++ create "features_fields" ++ (since_version "0.4") ++ (fun () -> ++ s_ "Enable to experiment not yet official features.") ++ ++ ++ let flag_docs = ++ create "flag_docs" ++ (since_version "0.3") ++ (fun () -> ++ s_ "Building docs require '-docs' flag at configure.") ++ ++ ++ let flag_tests = ++ create "flag_tests" ++ (since_version "0.3") ++ (fun () -> ++ s_ "Running tests require '-tests' flag at configure.") ++ ++ ++ let pack = ++ create "pack" ++ (since_version "0.3") ++ (fun () -> ++ s_ "Allow to create packed library.") ++ ++ ++ let section_object = ++ create "section_object" beta ++ (fun () -> ++ s_ "Implement an object section.") + +- type package = +- { +- oasis_version: OASISVersion.t; +- ocaml_version: OASISVersion.comparator option; +- findlib_version: OASISVersion.comparator option; +- name: package_name; +- version: OASISVersion.t; +- license: OASISLicense.t; +- license_file: unix_filename option; +- copyrights: string list; +- maintainers: string list; +- authors: string list; +- homepage: url option; +- synopsis: string; +- description: string option; +- categories: url list; +- +- conf_type: [`Configure] plugin; +- conf_custom: custom; +- +- build_type: [`Build] plugin; +- build_custom: custom; +- +- install_type: [`Install] plugin; +- install_custom: custom; +- uninstall_custom: custom; +- +- clean_custom: custom; +- distclean_custom: custom; +- +- files_ab: unix_filename list; +- sections: section list; +- plugins: [`Extra] plugin list; +- schema_data: PropList.Data.t; +- plugin_data: plugin_data; +- } + ++ let dynrun_for_release = ++ create "dynrun_for_release" alpha ++ (fun () -> ++ s_ "Make '-setup-update dynamic' suitable for releasing project.") ++ ++ ++ let compiled_setup_ml = ++ create "compiled_setup_ml" alpha ++ (fun () -> ++ s_ "It compiles the setup.ml and speed-up actions done with it.") ++ ++ let disable_oasis_section = ++ create "disable_oasis_section" alpha ++ (fun () -> ++ s_ "Allows the OASIS section comments and digest to be omitted in \ ++ generated files.") ++ ++ let no_automatic_syntax = ++ create "no_automatic_syntax" alpha ++ (fun () -> ++ s_ "Disable the automatic inclusion of -syntax camlp4o for packages \ ++ that matches the internal heuristic (if a dependency ends with \ ++ a .syntax or is a well known syntax).") + end + + module OASISUnixPath = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISUnixPath.ml" *) ++(* # 22 "src/oasis/OASISUnixPath.ml" *) ++ + + type unix_filename = string + type unix_dirname = string + ++ + type host_filename = string + type host_dirname = string + ++ + let current_dir_name = "." + ++ + let parent_dir_name = ".." + ++ + let is_current_dir fn = + fn = current_dir_name || fn = "" + ++ + let concat f1 f2 = + if is_current_dir f1 then + f2 +@@ -1200,6 +1790,7 @@ module OASISUnixPath = struct + in + f1'^"/"^f2 + ++ + let make = + function + | hd :: tl -> +@@ -1210,12 +1801,14 @@ module OASISUnixPath = struct + | [] -> + invalid_arg "OASISUnixPath.make" + ++ + let dirname f = + try + String.sub f 0 (String.rindex f '/') + with Not_found -> + current_dir_name + ++ + let basename f = + try + let pos_start = +@@ -1225,6 +1818,7 @@ module OASISUnixPath = struct + with Not_found -> + f + ++ + let chop_extension f = + try + let last_dot = +@@ -1247,26 +1841,31 @@ module OASISUnixPath = struct + with Not_found -> + f + ++ + let capitalize_file f = + let dir = dirname f in + let base = basename f in +- concat dir (String.capitalize base) ++ concat dir (OASISString.capitalize_ascii base) ++ + + let uncapitalize_file f = + let dir = dirname f in + let base = basename f in +- concat dir (String.uncapitalize base) ++ concat dir (OASISString.uncapitalize_ascii base) ++ + + end + + module OASISHostPath = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISHostPath.ml" *) ++(* # 22 "src/oasis/OASISHostPath.ml" *) + + + open Filename + ++ + module Unix = OASISUnixPath + ++ + let make = + function + | [] -> +@@ -1274,6 +1873,7 @@ module OASISHostPath = struct + | hd :: tl -> + List.fold_left Filename.concat hd tl + ++ + let of_unix ufn = + if Sys.os_type = "Unix" then + ufn +@@ -1293,14 +1893,18 @@ module OASISHostPath = struct + end + + module OASISSection = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISSection.ml" *) ++(* # 22 "src/oasis/OASISSection.ml" *) ++ + + open OASISTypes + +- let section_kind_common = ++ ++ let section_kind_common = + function +- | Library (cs, _, _) -> ++ | Library (cs, _, _) -> + `Library, cs ++ | Object (cs, _, _) -> ++ `Object, cs + | Executable (cs, _, _) -> + `Executable, cs + | Flag (cs, _) -> +@@ -1312,32 +1916,38 @@ module OASISSection = struct + | Doc (cs, _) -> + `Doc, cs + ++ + let section_common sct = + snd (section_kind_common sct) + ++ + let section_common_set cs = + function + | Library (_, bs, lib) -> Library (cs, bs, lib) ++ | Object (_, bs, obj) -> Object (cs, bs, obj) + | Executable (_, bs, exec) -> Executable (cs, bs, exec) + | Flag (_, flg) -> Flag (cs, flg) + | SrcRepo (_, src_repo) -> SrcRepo (cs, src_repo) + | Test (_, tst) -> Test (cs, tst) + | Doc (_, doc) -> Doc (cs, doc) + ++ + (** Key used to identify section + *) +- let section_id sct = +- let k, cs = ++ let section_id sct = ++ let k, cs = + section_kind_common sct + in + k, cs.cs_name + ++ + let string_of_section sct = + let k, nm = + section_id sct + in + (match k with +- | `Library -> "library" ++ | `Library -> "library" ++ | `Object -> "object" + | `Executable -> "executable" + | `Flag -> "flag" + | `SrcRepo -> "src repository" +@@ -1345,20 +1955,22 @@ module OASISSection = struct + | `Doc -> "doc") + ^" "^nm + ++ + let section_find id scts = + List.find + (fun sct -> id = section_id sct) + scts + ++ + module CSection = + struct + type t = section + + let id = section_id + +- let compare t1 t2 = ++ let compare t1 t2 = + compare (id t1) (id t2) +- ++ + let equal t1 t2 = + (id t1) = (id t2) + +@@ -1366,28 +1978,33 @@ module OASISSection = struct + Hashtbl.hash (id t) + end + ++ + module MapSection = Map.Make(CSection) + module SetSection = Set.Make(CSection) + ++ + end + + module OASISBuildSection = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISBuildSection.ml" *) ++(* # 22 "src/oasis/OASISBuildSection.ml" *) ++ + + end + + module OASISExecutable = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISExecutable.ml" *) ++(* # 22 "src/oasis/OASISExecutable.ml" *) ++ + + open OASISTypes + +- let unix_exec_is (cs, bs, exec) is_native ext_dll suffix_program = +- let dir = ++ ++ let unix_exec_is (cs, bs, exec) is_native ext_dll suffix_program = ++ let dir = + OASISUnixPath.concat + bs.bs_path + (OASISUnixPath.dirname exec.exec_main_is) + in +- let is_native_exec = ++ let is_native_exec = + match bs.bs_compiled_object with + | Native -> true + | Best -> is_native () +@@ -1398,40 +2015,28 @@ module OASISExecutable = struct + dir + (cs.cs_name^(suffix_program ())), + +- if not is_native_exec && +- not exec.exec_custom && ++ if not is_native_exec && ++ not exec.exec_custom && + bs.bs_c_sources <> [] then + Some (dir^"/dll"^cs.cs_name^"_stubs"^(ext_dll ())) + else + None + ++ + end + + module OASISLibrary = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISLibrary.ml" *) ++(* # 22 "src/oasis/OASISLibrary.ml" *) ++ + + open OASISTypes + open OASISUtils + open OASISGettext + open OASISSection + +- type library_name = name +- type findlib_part_name = name +- type 'a map_of_findlib_part_name = 'a OASISUtils.MapString.t +- +- exception InternalLibraryNotFound of library_name +- exception FindlibPackageNotFound of findlib_name +- +- type group_t = +- | Container of findlib_name * group_t list +- | Package of (findlib_name * +- common_section * +- build_section * +- library * +- group_t list) + + (* Look for a module file, considering capitalization or not. *) +- let find_module source_file_exists (cs, bs, lib) modul = ++ let find_module source_file_exists bs modul = + let possible_base_fn = + List.map + (OASISUnixPath.concat bs.bs_path) +@@ -1469,10 +2074,11 @@ module OASISLibrary = struct + (`No_sources possible_base_fn) + possible_base_fn + ++ + let source_unix_files ~ctxt (cs, bs, lib) source_file_exists = + List.fold_left + (fun acc modul -> +- match find_module source_file_exists (cs, bs, lib) modul with ++ match find_module source_file_exists bs modul with + | `Sources (base_fn, lst) -> + (base_fn, lst) :: acc + | `No_sources _ -> +@@ -1485,6 +2091,7 @@ module OASISLibrary = struct + [] + (lib.lib_modules @ lib.lib_internal_modules) + ++ + let generated_unix_files + ~ctxt + ~is_native +@@ -1494,50 +2101,49 @@ module OASISLibrary = struct + ~source_file_exists + (cs, bs, lib) = + +- let find_modules lst ext = ++ let find_modules lst ext = + let find_module modul = +- match find_module source_file_exists (cs, bs, lib) modul with ++ match find_module source_file_exists bs modul with ++ | `Sources (base_fn, [fn]) when ext <> "cmi" ++ && Filename.check_suffix fn ".mli" -> ++ None (* No implementation files for pure interface. *) + | `Sources (base_fn, _) -> +- [base_fn] ++ Some [base_fn] + | `No_sources lst -> + OASISMessage.warning + ~ctxt + (f_ "Cannot find source file matching \ + module '%s' in library %s") + modul cs.cs_name; +- lst ++ Some lst + in +- List.map +- (fun nm -> +- List.map +- (fun base_fn -> base_fn ^"."^ext) +- (find_module nm)) +- lst +- in +- +- (* The headers that should be compiled along *) +- let headers = +- if lib.lib_pack then ++ List.fold_left ++ (fun acc nm -> ++ match find_module nm with ++ | None -> acc ++ | Some base_fns -> ++ List.map (fun base_fn -> base_fn ^"."^ext) base_fns :: acc) + [] +- else +- find_modules +- lib.lib_modules +- "cmi" ++ lst + in + + (* The .cmx that be compiled along *) + let cmxs = + let should_be_built = +- (not lib.lib_pack) && (* Do not install .cmx packed submodules *) + match bs.bs_compiled_object with + | Native -> true + | Best -> is_native + | Byte -> false + in + if should_be_built then +- find_modules +- (lib.lib_modules @ lib.lib_internal_modules) +- "cmx" ++ if lib.lib_pack then ++ find_modules ++ [cs.cs_name] ++ "cmx" ++ else ++ find_modules ++ (lib.lib_modules @ lib.lib_internal_modules) ++ "cmx" + else + [] + in +@@ -1546,12 +2152,32 @@ module OASISLibrary = struct + [] + in + ++ (* The headers and annot/cmt files that should be compiled along *) ++ let headers = ++ let sufx = ++ if lib.lib_pack ++ then [".cmti"; ".cmt"; ".annot"] ++ else [".cmi"; ".cmti"; ".cmt"; ".annot"] ++ in ++ List.map ++ begin ++ List.fold_left ++ begin fun accu s -> ++ let dot = String.rindex s '.' in ++ let base = String.sub s 0 dot in ++ List.map ((^) base) sufx @ accu ++ end ++ [] ++ end ++ (find_modules lib.lib_modules "cmi") ++ in ++ + (* Compute what libraries should be built *) + let acc_nopath = + (* Add the packed header file if required *) + let add_pack_header acc = + if lib.lib_pack then +- [cs.cs_name^".cmi"] :: acc ++ [cs.cs_name^".cmi"; cs.cs_name^".cmti"; cs.cs_name^".cmt"] :: acc + else + acc + in +@@ -1559,7 +2185,7 @@ module OASISLibrary = struct + add_pack_header ([cs.cs_name^".cma"] :: acc) + in + let native acc = +- let acc = ++ let acc = + add_pack_header + (if has_native_dynlink then + [cs.cs_name^".cmxs"] :: acc +@@ -1598,11 +2224,113 @@ module OASISLibrary = struct + acc_nopath) + (headers @ cmxs) + +- type data = common_section * build_section * library ++ ++end ++ ++module OASISObject = struct ++(* # 22 "src/oasis/OASISObject.ml" *) ++ ++ ++ open OASISTypes ++ open OASISGettext ++ ++ ++ let source_unix_files ~ctxt (cs, bs, obj) source_file_exists = ++ List.fold_left ++ (fun acc modul -> ++ match OASISLibrary.find_module source_file_exists bs modul with ++ | `Sources (base_fn, lst) -> ++ (base_fn, lst) :: acc ++ | `No_sources _ -> ++ OASISMessage.warning ++ ~ctxt ++ (f_ "Cannot find source file matching \ ++ module '%s' in object %s") ++ modul cs.cs_name; ++ acc) ++ [] ++ obj.obj_modules ++ ++ ++ let generated_unix_files ++ ~ctxt ++ ~is_native ++ ~source_file_exists ++ (cs, bs, obj) = ++ ++ let find_module ext modul = ++ match OASISLibrary.find_module source_file_exists bs modul with ++ | `Sources (base_fn, _) -> [base_fn ^ ext] ++ | `No_sources lst -> ++ OASISMessage.warning ++ ~ctxt ++ (f_ "Cannot find source file matching \ ++ module '%s' in object %s") ++ modul cs.cs_name ; ++ lst ++ in ++ ++ let header, byte, native, c_object, f = ++ match obj.obj_modules with ++ | [ m ] -> (find_module ".cmi" m, ++ find_module ".cmo" m, ++ find_module ".cmx" m, ++ find_module ".o" m, ++ fun x -> x) ++ | _ -> ([cs.cs_name ^ ".cmi"], ++ [cs.cs_name ^ ".cmo"], ++ [cs.cs_name ^ ".cmx"], ++ [cs.cs_name ^ ".o"], ++ OASISUnixPath.concat bs.bs_path) ++ in ++ List.map (List.map f) ( ++ match bs.bs_compiled_object with ++ | Native -> ++ native :: c_object :: byte :: header :: [] ++ | Best when is_native -> ++ native :: c_object :: byte :: header :: [] ++ | Byte | Best -> ++ byte :: header :: []) ++ ++ ++end ++ ++module OASISFindlib = struct ++(* # 22 "src/oasis/OASISFindlib.ml" *) ++ ++ ++ open OASISTypes ++ open OASISUtils ++ open OASISGettext ++ open OASISSection ++ ++ ++ type library_name = name ++ type findlib_part_name = name ++ type 'a map_of_findlib_part_name = 'a OASISUtils.MapString.t ++ ++ ++ exception InternalLibraryNotFound of library_name ++ exception FindlibPackageNotFound of findlib_name ++ ++ ++ type group_t = ++ | Container of findlib_name * group_t list ++ | Package of (findlib_name * ++ common_section * ++ build_section * ++ [`Library of library | `Object of object_] * ++ group_t list) ++ ++ ++ type data = common_section * ++ build_section * ++ [`Library of library | `Object of object_] + type tree = + | Node of (data option) * (tree MapString.t) + | Leaf of data + ++ + let findlib_mapping pkg = + (* Map from library name to either full findlib name or parts + parent. *) + let fndlb_parts_of_lib_name = +@@ -1641,6 +2369,23 @@ module OASISLibrary = struct + mp + end + ++ | Object (cs, _, obj) -> ++ begin ++ let obj_name = cs.cs_name in ++ if MapString.mem obj_name mp then ++ failwithf ++ (f_ "The object name '%s' is used more than once.") ++ obj_name; ++ let findlib_full_name = match obj.obj_findlib_fullname with ++ | Some ns -> String.concat "." ns ++ | None -> obj_name ++ in ++ MapString.add ++ obj_name ++ (`Solved findlib_full_name) ++ mp ++ end ++ + | Executable _ | Test _ | Flag _ | SrcRepo _ | Doc _ -> + mp) + MapString.empty +@@ -1708,7 +2453,7 @@ module OASISLibrary = struct + let lib_name = cs.cs_name in + findlib_name_of_library_name lib_name + in +- let rec add_children nm_lst (children : tree MapString.t) = ++ let rec add_children nm_lst (children: tree MapString.t) = + match nm_lst with + | (hd :: tl) -> + begin +@@ -1778,7 +2523,9 @@ module OASISLibrary = struct + (fun mp -> + function + | Library (cs, bs, lib) -> +- add (cs, bs, lib) mp ++ add (cs, bs, `Library lib) mp ++ | Object (cs, bs, obj) -> ++ add (cs, bs, `Object obj) mp + | _ -> + mp) + MapString.empty +@@ -1790,13 +2537,13 @@ module OASISLibrary = struct + in + + let library_name_of_findlib_name = +- Lazy.lazy_from_fun +- (fun () -> +- (* Revert findlib_name_of_library_name. *) +- MapString.fold +- (fun k v mp -> MapString.add v k mp) +- fndlb_name_of_lib_name +- MapString.empty) ++ lazy begin ++ (* Revert findlib_name_of_library_name. *) ++ MapString.fold ++ (fun k v mp -> MapString.add v k mp) ++ fndlb_name_of_lib_name ++ MapString.empty ++ end + in + let library_name_of_findlib_name fndlb_nm = + try +@@ -1809,11 +2556,13 @@ module OASISLibrary = struct + findlib_name_of_library_name, + library_name_of_findlib_name + ++ + let findlib_of_group = + function + | Container (fndlb_nm, _) + | Package (fndlb_nm, _, _, _, _) -> fndlb_nm + ++ + let root_of_group grp = + let rec root_lib_aux = + (* We do a DFS in the group. *) +@@ -1838,40 +2587,48 @@ module OASISLibrary = struct + (f_ "Unable to determine root library of findlib library '%s'") + (findlib_of_group grp) + ++ + end + + module OASISFlag = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISFlag.ml" *) ++(* # 22 "src/oasis/OASISFlag.ml" *) ++ + + end + + module OASISPackage = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISPackage.ml" *) ++(* # 22 "src/oasis/OASISPackage.ml" *) ++ + + end + + module OASISSourceRepository = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISSourceRepository.ml" *) ++(* # 22 "src/oasis/OASISSourceRepository.ml" *) ++ + + end + + module OASISTest = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISTest.ml" *) ++(* # 22 "src/oasis/OASISTest.ml" *) ++ + + end + + module OASISDocument = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISDocument.ml" *) ++(* # 22 "src/oasis/OASISDocument.ml" *) ++ + + end + + module OASISExec = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISExec.ml" *) ++(* # 22 "src/oasis/OASISExec.ml" *) ++ + + open OASISGettext + open OASISUtils + open OASISMessage + ++ + (* TODO: I don't like this quote, it is there because $(rm) foo expands to + * 'rm -f' foo... + *) +@@ -1902,6 +2659,7 @@ module OASISExec = struct + | Some f, i -> + f i + ++ + let run_read_output ~ctxt ?f_exit_code cmd args = + let fn = + Filename.temp_file "oasis-" ".txt" +@@ -1933,6 +2691,7 @@ module OASISExec = struct + (try Sys.remove fn with _ -> ()); + raise e + ++ + let run_read_one_line ~ctxt ?f_exit_code cmd args = + match run_read_output ~ctxt ?f_exit_code cmd args with + | [fst] -> +@@ -1944,10 +2703,12 @@ module OASISExec = struct + end + + module OASISFileUtil = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISFileUtil.ml" *) ++(* # 22 "src/oasis/OASISFileUtil.ml" *) ++ + + open OASISGettext + ++ + let file_exists_case fn = + let dirname = Filename.dirname fn in + let basename = Filename.basename fn in +@@ -1961,6 +2722,7 @@ module OASISFileUtil = struct + else + false + ++ + let find_file ?(case_sensitive=true) paths exts = + + (* Cardinal product of two list *) +@@ -1969,7 +2731,7 @@ module OASISFileUtil = struct + (List.map + (fun a -> + List.map +- (fun b -> a,b) ++ (fun b -> a, b) + lst2) + lst1) + in +@@ -1979,7 +2741,7 @@ module OASISFileUtil = struct + | p1 :: p2 :: tl -> + let acc = + (List.map +- (fun (a,b) -> Filename.concat a b) ++ (fun (a, b) -> Filename.concat a b) + (p1 * p2)) + in + combined_paths (acc :: tl) +@@ -1991,19 +2753,21 @@ module OASISFileUtil = struct + + let alternatives = + List.map +- (fun (p,e) -> ++ (fun (p, e) -> + if String.length e > 0 && e.[0] <> '.' then + p ^ "." ^ e + else + p ^ e) + ((combined_paths paths) * exts) + in +- List.find ++ List.find (fun file -> + (if case_sensitive then +- file_exists_case ++ file_exists_case file + else +- Sys.file_exists) +- alternatives ++ Sys.file_exists file) ++ && not (Sys.is_directory file) ++ ) alternatives ++ + + let which ~ctxt prg = + let path_sep = +@@ -2023,6 +2787,7 @@ module OASISFileUtil = struct + in + find_file ~case_sensitive:false [path_lst; [prg]] exec_ext + ++ + (**/**) + let rec fix_dir dn = + (* Windows hack because Sys.file_exists "src\\" = false when +@@ -2036,9 +2801,11 @@ module OASISFileUtil = struct + else + dn + ++ + let q = Filename.quote + (**/**) + ++ + let cp ~ctxt ?(recurse=false) src tgt = + if recurse then + match Sys.os_type with +@@ -2055,6 +2822,7 @@ module OASISFileUtil = struct + | _ -> "cp") + [q src; q tgt] + ++ + let mkdir ~ctxt tgt = + OASISExec.run ~ctxt + (match Sys.os_type with +@@ -2062,6 +2830,7 @@ module OASISFileUtil = struct + | _ -> "mkdir") + [q tgt] + ++ + let rec mkdir_parent ~ctxt f tgt = + let tgt = + fix_dir tgt +@@ -2084,15 +2853,20 @@ module OASISFileUtil = struct + end + end + ++ + let rmdir ~ctxt tgt = +- if Sys.readdir tgt = [||] then +- begin +- match Sys.os_type with +- | "Win32" -> +- OASISExec.run ~ctxt "rd" [q tgt] +- | _ -> +- OASISExec.run ~ctxt "rm" ["-r"; q tgt] +- end ++ if Sys.readdir tgt = [||] then begin ++ match Sys.os_type with ++ | "Win32" -> ++ OASISExec.run ~ctxt "rd" [q tgt] ++ | _ -> ++ OASISExec.run ~ctxt "rm" ["-r"; q tgt] ++ end else begin ++ OASISMessage.error ~ctxt ++ (f_ "Cannot remove directory '%s': not empty.") ++ tgt ++ end ++ + + let glob ~ctxt fn = + let basename = +@@ -2139,19 +2913,23 @@ module OASISFileUtil = struct + end + + +-# 2142 "setup.ml" ++# 2916 "setup.ml" + module BaseEnvLight = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseEnvLight.ml" *) ++(* # 22 "src/base/BaseEnvLight.ml" *) ++ + + module MapString = Map.Make(String) + ++ + type t = string MapString.t + ++ + let default_filename = + Filename.concat + (Sys.getcwd ()) + "setup.data" + ++ + let load ?(allow_empty=false) ?(filename=default_filename) () = + if Sys.file_exists filename then + begin +@@ -2209,26 +2987,29 @@ module BaseEnvLight = struct + filename) + end + +- let var_get name env = +- let rec var_expand str = +- let buff = +- Buffer.create ((String.length str) * 2) +- in +- Buffer.add_substitute +- buff +- (fun var -> +- try +- var_expand (MapString.find var env) +- with Not_found -> +- failwith +- (Printf.sprintf +- "No variable %s defined when trying to expand %S." +- var +- str)) +- str; +- Buffer.contents buff ++ ++ let rec var_expand str env = ++ let buff = ++ Buffer.create ((String.length str) * 2) + in +- var_expand (MapString.find name env) ++ Buffer.add_substitute ++ buff ++ (fun var -> ++ try ++ var_expand (MapString.find var env) env ++ with Not_found -> ++ failwith ++ (Printf.sprintf ++ "No variable %s defined when trying to expand %S." ++ var ++ str)) ++ str; ++ Buffer.contents buff ++ ++ ++ let var_get name env = ++ var_expand (MapString.find name env) env ++ + + let var_choose lst env = + OASISExpr.choose +@@ -2237,20 +3018,24 @@ module BaseEnvLight = struct + end + + +-# 2240 "setup.ml" ++# 3021 "setup.ml" + module BaseContext = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseContext.ml" *) ++(* # 22 "src/base/BaseContext.ml" *) + ++ (* TODO: get rid of this module. *) + open OASISContext + +- let args = args ++ ++ let args () = fst (fspecs ()) ++ + + let default = default + + end + + module BaseMessage = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseMessage.ml" *) ++(* # 22 "src/base/BaseMessage.ml" *) ++ + + (** Message to user, overrid for Base + @author Sylvain Le Gall +@@ -2258,31 +3043,38 @@ module BaseMessage = struct + open OASISMessage + open BaseContext + ++ + let debug fmt = debug ~ctxt:!default fmt + ++ + let info fmt = info ~ctxt:!default fmt + ++ + let warning fmt = warning ~ctxt:!default fmt + ++ + let error fmt = error ~ctxt:!default fmt + + end + + module BaseEnv = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseEnv.ml" *) ++(* # 22 "src/base/BaseEnv.ml" *) + + open OASISGettext + open OASISUtils + open PropList + ++ + module MapString = BaseEnvLight.MapString + ++ + type origin_t = + | ODefault + | OGetEnv + | OFileLoad + | OCommandLine + ++ + type cli_handle_t = + | CLINone + | CLIAuto +@@ -2290,6 +3082,7 @@ module BaseEnv = struct + | CLIEnable + | CLIUser of (Arg.key * Arg.spec * Arg.doc) list + ++ + type definition_t = + { + hide: bool; +@@ -2299,21 +3092,26 @@ module BaseEnv = struct + group: string option; + } + ++ + let schema = + Schema.create "environment" + ++ + (* Environment data *) + let env = + Data.create () + ++ + (* Environment data from file *) + let env_from_file = + ref MapString.empty + ++ + (* Lexer for var *) + let var_lxr = + Genlex.make_lexer [] + ++ + let rec var_expand str = + let buff = + Buffer.create ((String.length str) * 2) +@@ -2364,6 +3162,7 @@ module BaseEnv = struct + str; + Buffer.contents buff + ++ + and var_get name = + let vl = + try +@@ -2378,6 +3177,7 @@ module BaseEnv = struct + in + var_expand vl + ++ + let var_choose ?printer ?name lst = + OASISExpr.choose + ?printer +@@ -2385,6 +3185,7 @@ module BaseEnv = struct + var_get + lst + ++ + let var_protect vl = + let buff = + Buffer.create (String.length vl) +@@ -2396,6 +3197,7 @@ module BaseEnv = struct + vl; + Buffer.contents buff + ++ + let var_define + ?(hide=false) + ?(dump=true) +@@ -2481,6 +3283,7 @@ module BaseEnv = struct + fun () -> + var_expand (var_get_low (var_get_lst env)) + ++ + let var_redefine + ?hide + ?dump +@@ -2509,8 +3312,9 @@ module BaseEnv = struct + dflt + end + +- let var_ignore (e : unit -> string) = +- () ++ ++ let var_ignore (e: unit -> string) = () ++ + + let print_hidden = + var_define +@@ -2521,6 +3325,7 @@ module BaseEnv = struct + "print_hidden" + (fun () -> "false") + ++ + let var_all () = + List.rev + (Schema.fold +@@ -2532,24 +3337,28 @@ module BaseEnv = struct + [] + schema) + ++ + let default_filename = + BaseEnvLight.default_filename + ++ + let load ?allow_empty ?filename () = + env_from_file := BaseEnvLight.load ?allow_empty ?filename () + ++ + let unload () = + env_from_file := MapString.empty; + Data.clear env + ++ + let dump ?(filename=default_filename) () = + let chn = + open_out_bin filename + in +- let output nm value = ++ let output nm value = + Printf.fprintf chn "%s=%S\n" nm value + in +- let mp_todo = ++ let mp_todo = + (* Dump data from schema *) + Schema.fold + (fun mp_todo nm def _ -> +@@ -2576,6 +3385,7 @@ module BaseEnv = struct + (* End of the dump *) + close_out chn + ++ + let print () = + let printable_vars = + Schema.fold +@@ -2614,11 +3424,12 @@ module BaseEnv = struct + + Printf.printf "\nConfiguration: \n"; + List.iter +- (fun (name,value) -> ++ (fun (name, value) -> + Printf.printf "%s: %s %s\n" name (dot_pad name) value) + (List.rev printable_vars); + Printf.printf "\n%!" + ++ + let args () = + let arg_concat = + OASISUtils.varname_concat ~hyphen:'-' +@@ -2729,11 +3540,13 @@ module BaseEnv = struct + end + + module BaseArgExt = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseArgExt.ml" *) ++(* # 22 "src/base/BaseArgExt.ml" *) ++ + + open OASISUtils + open OASISGettext + ++ + let parse argv args = + (* Simulate command line for Arg *) + let current = +@@ -2757,13 +3570,15 @@ module BaseArgExt = struct + end + + module BaseCheck = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseCheck.ml" *) ++(* # 22 "src/base/BaseCheck.ml" *) ++ + + open BaseEnv + open BaseMessage + open OASISUtils + open OASISGettext + ++ + let prog_best prg prg_lst = + var_redefine + prg +@@ -2786,15 +3601,19 @@ module BaseCheck = struct + | Some prg -> prg + | None -> raise Not_found) + ++ + let prog prg = + prog_best prg [prg] + ++ + let prog_opt prg = + prog_best prg [prg^".opt"; prg] + ++ + let ocamlfind = + prog "ocamlfind" + ++ + let version + var_prefix + cmp +@@ -2836,11 +3655,13 @@ module BaseCheck = struct + version_str) + () + ++ + let package_version pkg = + OASISExec.run_read_one_line ~ctxt:!BaseContext.default + (ocamlfind ()) + ["query"; "-format"; "%v"; pkg] + ++ + let package ?version_comparator pkg () = + let var = + OASISUtils.varname_concat +@@ -2883,18 +3704,21 @@ module BaseCheck = struct + end + + module BaseOCamlcConfig = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseOCamlcConfig.ml" *) ++(* # 22 "src/base/BaseOCamlcConfig.ml" *) + + + open BaseEnv + open OASISUtils + open OASISGettext + ++ + module SMap = Map.Make(String) + ++ + let ocamlc = + BaseCheck.prog_opt "ocamlc" + ++ + let ocamlc_config_map = + (* Map name to value for ocamlc -config output + (name ^": "^value) +@@ -2940,7 +3764,7 @@ module BaseOCamlcConfig = struct + mp + in + +- let cache = ++ let cache = + lazy + (var_protect + (Marshal.to_string +@@ -2959,6 +3783,7 @@ module BaseOCamlcConfig = struct + (* TODO: update if ocamlc change !!! *) + Lazy.force cache) + ++ + let var_define nm = + (* Extract data from ocamlc -config *) + let avlbl_config_get () = +@@ -2967,15 +3792,15 @@ module BaseOCamlcConfig = struct + 0 + in + let chop_version_suffix s = +- try ++ try + String.sub s 0 (String.index s '+') +- with _ -> ++ with _ -> + s + in + + let nm_config, value_config = + match nm with +- | "ocaml_version" -> ++ | "ocaml_version" -> + "version", chop_version_suffix + | _ -> nm, (fun x -> x) + in +@@ -2999,7 +3824,7 @@ module BaseOCamlcConfig = struct + end + + module BaseStandardVar = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseStandardVar.ml" *) ++(* # 22 "src/base/BaseStandardVar.ml" *) + + + open OASISGettext +@@ -3008,6 +3833,7 @@ module BaseStandardVar = struct + open BaseCheck + open BaseEnv + ++ + let ocamlfind = BaseCheck.ocamlfind + let ocamlc = BaseOCamlcConfig.ocamlc + let ocamlopt = prog_opt "ocamlopt" +@@ -3018,13 +3844,16 @@ module BaseStandardVar = struct + let rpkg = + ref None + ++ + let pkg_get () = + match !rpkg with + | Some pkg -> pkg + | None -> failwith (s_ "OASIS Package is not set") + ++ + let var_cond = ref [] + ++ + let var_define_cond ~since_version f dflt = + let holder = ref (fun () -> dflt) in + let since_version = +@@ -3036,14 +3865,17 @@ module BaseStandardVar = struct + holder := f ()) :: !var_cond; + fun () -> !holder () + ++ + (**/**) + ++ + let pkg_name = + var_define + ~short_desc:(fun () -> s_ "Package name") + "pkg_name" + (fun () -> (pkg_get ()).name) + ++ + let pkg_version = + var_define + ~short_desc:(fun () -> s_ "Package version") +@@ -3051,16 +3883,20 @@ module BaseStandardVar = struct + (fun () -> + (OASISVersion.string_of_version (pkg_get ()).version)) + ++ + let c = BaseOCamlcConfig.var_define + ++ + let os_type = c "os_type" + let system = c "system" + let architecture = c "architecture" + let ccomp_type = c "ccomp_type" + let ocaml_version = c "ocaml_version" + ++ + (* TODO: Check standard variable presence at runtime *) + ++ + let standard_library_default = c "standard_library_default" + let standard_library = c "standard_library" + let standard_runtime = c "standard_runtime" +@@ -3074,24 +3910,27 @@ module BaseStandardVar = struct + let default_executable_name = c "default_executable_name" + let systhread_supported = c "systhread_supported" + +- let flexlink = ++ ++ let flexlink = + BaseCheck.prog "flexlink" + ++ + let flexdll_version = + var_define + ~short_desc:(fun () -> "FlexDLL version (Win32)") + "flexdll_version" + (fun () -> +- let lst = ++ let lst = + OASISExec.run_read_output ~ctxt:!BaseContext.default + (flexlink ()) ["-help"] + in +- match lst with ++ match lst with + | line :: _ -> + Scanf.sscanf line "FlexDLL version %s" (fun ver -> ver) + | [] -> + raise Not_found) + ++ + (**/**) + let p name hlp dflt = + var_define +@@ -3101,6 +3940,7 @@ module BaseStandardVar = struct + name + dflt + ++ + let (/) a b = + if os_type () = Sys.os_type then + Filename.concat a b +@@ -3111,6 +3951,7 @@ module BaseStandardVar = struct + (os_type ()) + (**/**) + ++ + let prefix = + p "prefix" + (fun () -> s_ "Install architecture-independent files dir") +@@ -3124,96 +3965,115 @@ module BaseStandardVar = struct + | _ -> + "/usr/local") + ++ + let exec_prefix = + p "exec_prefix" + (fun () -> s_ "Install architecture-dependent files in dir") + (fun () -> "$prefix") + ++ + let bindir = + p "bindir" + (fun () -> s_ "User executables") + (fun () -> "$exec_prefix"/"bin") + ++ + let sbindir = + p "sbindir" + (fun () -> s_ "System admin executables") + (fun () -> "$exec_prefix"/"sbin") + ++ + let libexecdir = + p "libexecdir" + (fun () -> s_ "Program executables") + (fun () -> "$exec_prefix"/"libexec") + ++ + let sysconfdir = + p "sysconfdir" + (fun () -> s_ "Read-only single-machine data") + (fun () -> "$prefix"/"etc") + ++ + let sharedstatedir = + p "sharedstatedir" + (fun () -> s_ "Modifiable architecture-independent data") + (fun () -> "$prefix"/"com") + ++ + let localstatedir = + p "localstatedir" + (fun () -> s_ "Modifiable single-machine data") + (fun () -> "$prefix"/"var") + ++ + let libdir = + p "libdir" + (fun () -> s_ "Object code libraries") + (fun () -> "$exec_prefix"/"lib") + ++ + let datarootdir = + p "datarootdir" + (fun () -> s_ "Read-only arch-independent data root") + (fun () -> "$prefix"/"share") + ++ + let datadir = + p "datadir" + (fun () -> s_ "Read-only architecture-independent data") + (fun () -> "$datarootdir") + ++ + let infodir = + p "infodir" + (fun () -> s_ "Info documentation") + (fun () -> "$datarootdir"/"info") + ++ + let localedir = + p "localedir" + (fun () -> s_ "Locale-dependent data") + (fun () -> "$datarootdir"/"locale") + ++ + let mandir = + p "mandir" + (fun () -> s_ "Man documentation") + (fun () -> "$datarootdir"/"man") + ++ + let docdir = + p "docdir" + (fun () -> s_ "Documentation root") + (fun () -> "$datarootdir"/"doc"/"$pkg_name") + ++ + let htmldir = + p "htmldir" + (fun () -> s_ "HTML documentation") + (fun () -> "$docdir") + ++ + let dvidir = + p "dvidir" + (fun () -> s_ "DVI documentation") + (fun () -> "$docdir") + ++ + let pdfdir = + p "pdfdir" + (fun () -> s_ "PDF documentation") + (fun () -> "$docdir") + ++ + let psdir = + p "psdir" + (fun () -> s_ "PS documentation") + (fun () -> "$docdir") + ++ + let destdir = + p "destdir" + (fun () -> s_ "Prepend a path when installing package") +@@ -3223,35 +4083,39 @@ module BaseStandardVar = struct + ("destdir", + Some (s_ "undefined by construct")))) + ++ + let findlib_version = + var_define + "findlib_version" + (fun () -> + BaseCheck.package_version "findlib") + ++ + let is_native = + var_define + "is_native" + (fun () -> + try +- let _s : string = ++ let _s: string = + ocamlopt () + in + "true" + with PropList.Not_set _ -> +- let _s : string = ++ let _s: string = + ocamlc () + in + "false") + ++ + let ext_program = + var_define + "suffix_program" + (fun () -> + match os_type () with +- | "Win32" -> ".exe" ++ | "Win32" | "Cygwin" -> ".exe" + | _ -> "") + ++ + let rm = + var_define + ~short_desc:(fun () -> s_ "Remove a file.") +@@ -3261,6 +4125,7 @@ module BaseStandardVar = struct + | "Win32" -> "del" + | _ -> "rm -f") + ++ + let rmdir = + var_define + ~short_desc:(fun () -> s_ "Remove a directory.") +@@ -3270,6 +4135,7 @@ module BaseStandardVar = struct + | "Win32" -> "rd" + | _ -> "rm -rf") + ++ + let debug = + var_define + ~short_desc:(fun () -> s_ "Turn ocaml debug flag on") +@@ -3277,6 +4143,7 @@ module BaseStandardVar = struct + "debug" + (fun () -> "true") + ++ + let profile = + var_define + ~short_desc:(fun () -> s_ "Turn ocaml profile flag on") +@@ -3284,6 +4151,7 @@ module BaseStandardVar = struct + "profile" + (fun () -> "false") + ++ + let tests = + var_define_cond ~since_version:"0.3" + (fun () -> +@@ -3295,6 +4163,7 @@ module BaseStandardVar = struct + (fun () -> "false")) + "true" + ++ + let docs = + var_define_cond ~since_version:"0.3" + (fun () -> +@@ -3305,6 +4174,7 @@ module BaseStandardVar = struct + (fun () -> "true")) + "true" + ++ + let native_dynlink = + var_define + ~short_desc:(fun () -> s_ "Compiler support generation of .cmxs.") +@@ -3312,7 +4182,7 @@ module BaseStandardVar = struct + "native_dynlink" + (fun () -> + let res = +- let ocaml_lt_312 () = ++ let ocaml_lt_312 () = + OASISVersion.comparator_apply + (OASISVersion.version_of_string (ocaml_version ())) + (OASISVersion.VLesser +@@ -3324,7 +4194,7 @@ module BaseStandardVar = struct + (OASISVersion.VLesser + (OASISVersion.version_of_string "0.30")) + in +- let has_native_dynlink = ++ let has_native_dynlink = + let ocamlfind = ocamlfind () in + try + let fn = +@@ -3342,10 +4212,10 @@ module BaseStandardVar = struct + false + else if ocaml_lt_312 () then + false +- else if (os_type () = "Win32" || os_type () = "Cygwin") ++ else if (os_type () = "Win32" || os_type () = "Cygwin") + && flexdll_lt_030 () then + begin +- BaseMessage.warning ++ BaseMessage.warning + (f_ ".cmxs generation disabled because FlexDLL needs to be \ + at least 0.30. Please upgrade FlexDLL from %s to 0.30.") + (flexdll_version ()); +@@ -3356,6 +4226,7 @@ module BaseStandardVar = struct + in + string_of_bool res) + ++ + let init pkg = + rpkg := Some pkg; + List.iter (fun f -> f pkg.oasis_version) !var_cond +@@ -3363,12 +4234,14 @@ module BaseStandardVar = struct + end + + module BaseFileAB = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseFileAB.ml" *) ++(* # 22 "src/base/BaseFileAB.ml" *) ++ + + open BaseEnv + open OASISGettext + open BaseMessage + ++ + let to_filename fn = + let fn = + OASISHostPath.of_unix fn +@@ -3379,6 +4252,7 @@ module BaseFileAB = struct + fn; + Filename.chop_extension fn + ++ + let replace fn_lst = + let buff = + Buffer.create 13 +@@ -3411,15 +4285,18 @@ module BaseFileAB = struct + end + + module BaseLog = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseLog.ml" *) ++(* # 22 "src/base/BaseLog.ml" *) ++ + + open OASISUtils + ++ + let default_filename = + Filename.concat + (Filename.dirname BaseEnv.default_filename) + "setup.log" + ++ + module SetTupleString = + Set.Make + (struct +@@ -3430,6 +4307,7 @@ module BaseLog = struct + | n -> n + end) + ++ + let load () = + if Sys.file_exists default_filename then + begin +@@ -3479,6 +4357,7 @@ module BaseLog = struct + [] + end + ++ + let register event data = + let chn_out = + open_out_gen [Open_append; Open_creat; Open_text] 0o644 default_filename +@@ -3486,6 +4365,7 @@ module BaseLog = struct + Printf.fprintf chn_out "%S %S\n" event data; + close_out chn_out + ++ + let unregister event data = + if Sys.file_exists default_filename then + begin +@@ -3511,6 +4391,7 @@ module BaseLog = struct + Sys.remove default_filename + end + ++ + let filter events = + let st_events = + List.fold_left +@@ -3523,6 +4404,7 @@ module BaseLog = struct + (fun (e, _) -> SetString.mem e st_events) + (load ()) + ++ + let exists event data = + List.exists + (fun v -> (event, data) = v) +@@ -3530,31 +4412,38 @@ module BaseLog = struct + end + + module BaseBuilt = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseBuilt.ml" *) ++(* # 22 "src/base/BaseBuilt.ml" *) ++ + + open OASISTypes + open OASISGettext + open BaseStandardVar + open BaseMessage + ++ + type t = + | BExec (* Executable *) + | BExecLib (* Library coming with executable *) + | BLib (* Library *) ++ | BObj (* Library *) + | BDoc (* Document *) + ++ + let to_log_event_file t nm = + "built_"^ + (match t with + | BExec -> "exec" + | BExecLib -> "exec_lib" + | BLib -> "lib" ++ | BObj -> "obj" + | BDoc -> "doc")^ + "_"^nm + ++ + let to_log_event_done t nm = + "is_"^(to_log_event_file t nm) + ++ + let register t nm lst = + BaseLog.register + (to_log_event_done t nm) +@@ -3585,6 +4474,7 @@ module BaseBuilt = struct + (String.concat (s_ ", ") alt)) + lst + ++ + let unregister t nm = + List.iter + (fun (e, d) -> +@@ -3593,6 +4483,7 @@ module BaseBuilt = struct + [to_log_event_file t nm; + to_log_event_done t nm]) + ++ + let fold t nm f acc = + List.fold_left + (fun acc (_, fn) -> +@@ -3612,6 +4503,8 @@ module BaseBuilt = struct + (f_ "executable %s") + | BLib -> + (f_ "library %s") ++ | BObj -> ++ (f_ "object %s") + | BDoc -> + (f_ "documentation %s")) + nm); +@@ -3621,6 +4514,7 @@ module BaseBuilt = struct + (BaseLog.filter + [to_log_event_file t nm]) + ++ + let is_built t nm = + List.fold_left + (fun is_built (_, d) -> +@@ -3632,6 +4526,7 @@ module BaseBuilt = struct + (BaseLog.filter + [to_log_event_done t nm]) + ++ + let of_executable ffn (cs, bs, exec) = + let unix_exec_is, unix_dll_opt = + OASISExecutable.unix_exec_is +@@ -3655,6 +4550,7 @@ module BaseBuilt = struct + unix_exec_is, + unix_dll_opt + ++ + let of_library ffn (cs, bs, lib) = + let unix_lst = + OASISLibrary.generated_unix_files +@@ -3674,16 +4570,35 @@ module BaseBuilt = struct + in + evs, unix_lst + ++ ++ let of_object ffn (cs, bs, obj) = ++ let unix_lst = ++ OASISObject.generated_unix_files ++ ~ctxt:!BaseContext.default ++ ~source_file_exists:(fun fn -> ++ OASISFileUtil.file_exists_case (OASISHostPath.of_unix fn)) ++ ~is_native:(bool_of_string (is_native ())) ++ (cs, bs, obj) ++ in ++ let evs = ++ [BObj, ++ cs.cs_name, ++ List.map (List.map ffn) unix_lst] ++ in ++ evs, unix_lst ++ + end + + module BaseCustom = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseCustom.ml" *) ++(* # 22 "src/base/BaseCustom.ml" *) ++ + + open BaseEnv + open BaseMessage + open OASISTypes + open OASISGettext + ++ + let run cmd args extra_args = + OASISExec.run ~ctxt:!BaseContext.default ~quote:false + (var_expand cmd) +@@ -3691,6 +4606,7 @@ module BaseCustom = struct + var_expand + (args @ (Array.to_list extra_args))) + ++ + let hook ?(failsafe=false) cstm f e = + let optional_command lst = + let printer = +@@ -3727,7 +4643,7 @@ module BaseCustom = struct + end + + module BaseDynVar = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseDynVar.ml" *) ++(* # 22 "src/base/BaseDynVar.ml" *) + + + open OASISTypes +@@ -3735,6 +4651,7 @@ module BaseDynVar = struct + open BaseEnv + open BaseBuilt + ++ + let init pkg = + (* TODO: disambiguate exec vs other variable by adding exec_VARNAME. *) + (* TODO: provide compile option for library libary_byte_args_VARNAME... *) +@@ -3768,13 +4685,14 @@ module BaseDynVar = struct + (f_ "Executable '%s' not yet built.") + cs.cs_name))))) + +- | Library _ | Flag _ | Test _ | SrcRepo _ | Doc _ -> ++ | Library _ | Object _ | Flag _ | Test _ | SrcRepo _ | Doc _ -> + ()) + pkg.sections + end + + module BaseTest = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseTest.ml" *) ++(* # 22 "src/base/BaseTest.ml" *) ++ + + open BaseEnv + open BaseMessage +@@ -3782,6 +4700,7 @@ module BaseTest = struct + open OASISExpr + open OASISGettext + ++ + let test lst pkg extra_args = + + let one_test (failure, n) (test_plugin, cs, test) = +@@ -3832,7 +4751,7 @@ module BaseTest = struct + (failure, n) + end + in +- let (failed, n) = ++ let failed, n = + List.fold_left + one_test + (0.0, 0) +@@ -3855,7 +4774,7 @@ module BaseTest = struct + info "%s" msg; + + (* Possible explanation why the tests where not run. *) +- if OASISVersion.version_0_3_or_after pkg.oasis_version && ++ if OASISFeatures.package_test OASISFeatures.flag_tests pkg && + not (bool_of_string (BaseStandardVar.tests ())) && + lst <> [] then + BaseMessage.warning +@@ -3864,13 +4783,15 @@ module BaseTest = struct + end + + module BaseDoc = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseDoc.ml" *) ++(* # 22 "src/base/BaseDoc.ml" *) ++ + + open BaseEnv + open BaseMessage + open OASISTypes + open OASISGettext + ++ + let doc lst pkg extra_args = + + let one_doc (doc_plugin, cs, doc) = +@@ -3890,7 +4811,7 @@ module BaseDoc = struct + in + List.iter one_doc lst; + +- if OASISVersion.version_0_3_or_after pkg.oasis_version && ++ if OASISFeatures.package_test OASISFeatures.flag_docs pkg && + not (bool_of_string (BaseStandardVar.docs ())) && + lst <> [] then + BaseMessage.warning +@@ -3899,7 +4820,7 @@ module BaseDoc = struct + end + + module BaseSetup = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseSetup.ml" *) ++(* # 22 "src/base/BaseSetup.ml" *) + + open BaseEnv + open BaseMessage +@@ -3908,12 +4829,15 @@ module BaseSetup = struct + open OASISGettext + open OASISUtils + ++ + type std_args_fun = + package -> string array -> unit + ++ + type ('a, 'b) section_args_fun = + name * (package -> (common_section * 'a) -> string array -> 'b) + ++ + type t = + { + configure: std_args_fun; +@@ -3937,6 +4861,7 @@ module BaseSetup = struct + setup_update: bool; + } + ++ + (* Associate a plugin function with data from package *) + let join_plugin_sections filter_map lst = + List.rev +@@ -3950,6 +4875,7 @@ module BaseSetup = struct + [] + lst) + ++ + (* Search for plugin data associated with a section name *) + let lookup_plugin_section plugin action nm lst = + try +@@ -3961,11 +4887,12 @@ module BaseSetup = struct + nm + action + ++ + let configure t args = + (* Run configure *) + BaseCustom.hook + t.package.conf_custom +- (fun () -> ++ (fun () -> + (* Reload if preconf has changed it *) + begin + try +@@ -3992,12 +4919,14 @@ module BaseSetup = struct + (* Replace data in file *) + BaseFileAB.replace t.package.files_ab + ++ + let build t args = + BaseCustom.hook + t.package.build_custom + (t.build t.package) + args + ++ + let doc t args = + BaseDoc.doc + (join_plugin_sections +@@ -4017,6 +4946,7 @@ module BaseSetup = struct + t.package + args + ++ + let test t args = + BaseTest.test + (join_plugin_sections +@@ -4036,6 +4966,7 @@ module BaseSetup = struct + t.package + args + ++ + let all t args = + let rno_doc = + ref false +@@ -4043,6 +4974,9 @@ module BaseSetup = struct + let rno_test = + ref false + in ++ let arg_rest = ++ ref [] ++ in + Arg.parse_argv + ~current:(ref 0) + (Array.of_list +@@ -4056,12 +4990,16 @@ module BaseSetup = struct + "-no-test", + Arg.Set rno_test, + s_ "Don't run test target"; ++ ++ "--", ++ Arg.Rest (fun arg -> arg_rest := arg :: !arg_rest), ++ s_ "All arguments for configure."; + ] + (failwithf (f_ "Don't know what to do with '%s'")) + ""; + + info "Running configure step"; +- configure t [||]; ++ configure t (Array.of_list (List.rev !arg_rest)); + + info "Running build step"; + build t [||]; +@@ -4089,22 +5027,26 @@ module BaseSetup = struct + info "Skipping test step" + end + ++ + let install t args = + BaseCustom.hook + t.package.install_custom + (t.install t.package) + args + ++ + let uninstall t args = + BaseCustom.hook + t.package.uninstall_custom + (t.uninstall t.package) + args + ++ + let reinstall t args = + uninstall t args; + install t args + ++ + let clean, distclean = + let failsafe f a = + try +@@ -4146,6 +5088,7 @@ module BaseSetup = struct + (f t.package (cs, doc)) + args + | Library _ ++ | Object _ + | Executable _ + | Flag _ + | SrcRepo _ -> +@@ -4201,9 +5144,11 @@ module BaseSetup = struct + + clean, distclean + ++ + let version t _ = + print_endline t.oasis_version + ++ + let update_setup_ml, no_update_setup_ml_cli = + let b = ref true in + b, +@@ -4211,11 +5156,15 @@ module BaseSetup = struct + Arg.Clear b, + s_ " Don't try to update setup.ml, even if _oasis has changed.") + ++ ++ let default_oasis_fn = "_oasis" ++ ++ + let update_setup_ml t = + let oasis_fn = + match t.oasis_fn with + | Some fn -> fn +- | None -> "_oasis" ++ | None -> default_oasis_fn + in + let oasis_exec = + match t.oasis_exec with +@@ -4313,7 +5262,8 @@ module BaseSetup = struct + try + match t.oasis_digest with + | Some dgst -> +- if Sys.file_exists oasis_fn && dgst <> Digest.file "_oasis" then ++ if Sys.file_exists oasis_fn && ++ dgst <> Digest.file default_oasis_fn then + begin + do_update (); + true +@@ -4333,6 +5283,7 @@ module BaseSetup = struct + else + false + ++ + let setup t = + let catch_exn = + ref true +@@ -4474,41 +5425,34 @@ module BaseSetup = struct + error "%s" (Printexc.to_string e); + exit 1 + ++ + end + + +-# 4480 "setup.ml" ++# 5432 "setup.ml" + module InternalConfigurePlugin = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/plugins/internal/InternalConfigurePlugin.ml" *) ++(* # 22 "src/plugins/internal/InternalConfigurePlugin.ml" *) ++ + + (** Configure using internal scheme + @author Sylvain Le Gall + *) + ++ + open BaseEnv + open OASISTypes + open OASISUtils + open OASISGettext + open BaseMessage + ++ + (** Configure build using provided series of check to be done + * and then output corresponding file. + *) + let configure pkg argv = +- let var_ignore_eval var = +- let _s : string = +- var () +- in +- () +- in +- +- let errors = +- ref SetString.empty +- in +- +- let buff = +- Buffer.create 13 +- in ++ let var_ignore_eval var = let _s: string = var () in () in ++ let errors = ref SetString.empty in ++ let buff = Buffer.create 13 in + + let add_errors fmt = + Printf.kbprintf +@@ -4656,6 +5600,20 @@ module InternalConfigurePlugin = struct + | None -> + () + end; ++ (* Make sure the findlib version is fine for the OCaml compiler. *) ++ begin ++ let ocaml_ge4 = ++ OASISVersion.version_compare ++ (OASISVersion.version_of_string (BaseStandardVar.ocaml_version())) ++ (OASISVersion.version_of_string "4.0.0") >= 0 in ++ if ocaml_ge4 then ++ let findlib_lt132 = ++ OASISVersion.version_compare ++ (OASISVersion.version_of_string (BaseStandardVar.findlib_version())) ++ (OASISVersion.version_of_string "1.3.2") < 0 in ++ if findlib_lt132 then ++ add_errors "OCaml >= 4.0.0 requires Findlib version >= 1.3.2" ++ end; + + (* FlexDLL *) + if BaseStandardVar.os_type () = "Win32" || +@@ -4718,43 +5676,58 @@ module InternalConfigurePlugin = struct + (SetString.cardinal !errors) + end + ++ + end + + module InternalInstallPlugin = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/plugins/internal/InternalInstallPlugin.ml" *) ++(* # 22 "src/plugins/internal/InternalInstallPlugin.ml" *) ++ + + (** Install using internal scheme + @author Sylvain Le Gall + *) + ++ + open BaseEnv + open BaseStandardVar + open BaseMessage + open OASISTypes +- open OASISLibrary ++ open OASISFindlib + open OASISGettext + open OASISUtils + ++ + let exec_hook = + ref (fun (cs, bs, exec) -> cs, bs, exec) + ++ + let lib_hook = + ref (fun (cs, bs, lib) -> cs, bs, lib, []) + ++ ++ let obj_hook = ++ ref (fun (cs, bs, obj) -> cs, bs, obj, []) ++ ++ + let doc_hook = + ref (fun (cs, doc) -> cs, doc) + ++ + let install_file_ev = + "install-file" + ++ + let install_dir_ev = + "install-dir" + ++ + let install_findlib_ev = + "install-findlib" + ++ + let win32_max_command_line_length = 8000 + ++ + let split_install_command ocamlfind findlib_name meta files = + if Sys.os_type = "Win32" then + (* Arguments for the first command: *) +@@ -4794,20 +5767,21 @@ module InternalInstallPlugin = struct + | (firsts, others) -> + let cmd = args @ firsts in + (* Use -add for remaining commands: *) +- let () = ++ let () = + let findlib_ge_132 = + OASISVersion.comparator_apply +- (OASISVersion.version_of_string ++ (OASISVersion.version_of_string + (BaseStandardVar.findlib_version ())) +- (OASISVersion.VGreaterEqual ++ (OASISVersion.VGreaterEqual + (OASISVersion.version_of_string "1.3.2")) + in + if not findlib_ge_132 then + failwithf +- (f_ "Installing the library %s require to use the flag \ +- '-add' of ocamlfind because the command line is too \ +- long. This flag is only available for findlib 1.3.2. \ +- Please upgrade findlib from %s to 1.3.2") ++ (f_ "Installing the library %s require to use the \ ++ flag '-add' of ocamlfind because the command \ ++ line is too long. This flag is only available \ ++ for findlib 1.3.2. Please upgrade findlib from \ ++ %s to 1.3.2") + findlib_name (BaseStandardVar.findlib_version ()) + in + let cmds = split other_args others in +@@ -4818,6 +5792,7 @@ module InternalInstallPlugin = struct + else + ["install" :: findlib_name :: meta :: files] + ++ + let install pkg argv = + + let in_destdir = +@@ -4890,6 +5865,17 @@ module InternalInstallPlugin = struct + lst + in + ++ let make_fnames modul sufx = ++ List.fold_right ++ begin fun sufx accu -> ++ (OASISString.capitalize_ascii modul ^ sufx) :: ++ (OASISString.uncapitalize_ascii modul ^ sufx) :: ++ accu ++ end ++ sufx ++ [] ++ in ++ + (** Install all libraries *) + let install_libs pkg = + +@@ -4910,27 +5896,29 @@ module InternalInstallPlugin = struct + OASISHostPath.of_unix bs.bs_path + in + List.fold_left +- (fun acc modul -> +- try +- List.find +- OASISFileUtil.file_exists_case +- (List.map +- (Filename.concat path) +- [modul^".mli"; +- modul^".ml"; +- String.uncapitalize modul^".mli"; +- String.capitalize modul^".mli"; +- String.uncapitalize modul^".ml"; +- String.capitalize modul^".ml"]) +- :: acc +- with Not_found -> +- begin +- warning +- (f_ "Cannot find source header for module %s \ +- in library %s") +- modul cs.cs_name; +- acc +- end) ++ begin fun acc modul -> ++ begin ++ try ++ [List.find ++ OASISFileUtil.file_exists_case ++ (List.map ++ (Filename.concat path) ++ (make_fnames modul [".mli"; ".ml"]))] ++ with Not_found -> ++ warning ++ (f_ "Cannot find source header for module %s \ ++ in library %s") ++ modul cs.cs_name; ++ [] ++ end ++ @ ++ List.filter ++ OASISFileUtil.file_exists_case ++ (List.map ++ (Filename.concat path) ++ (make_fnames modul [".annot";".cmti";".cmt"])) ++ @ acc ++ end + acc + lib.lib_modules + in +@@ -4961,6 +5949,77 @@ module InternalInstallPlugin = struct + begin + (f_data, acc) + end ++ and files_of_object (f_data, acc) data_obj = ++ let cs, bs, obj, obj_extra = ++ !obj_hook data_obj ++ in ++ if var_choose bs.bs_install && ++ BaseBuilt.is_built BaseBuilt.BObj cs.cs_name then ++ begin ++ let acc = ++ (* Start with acc + obj_extra *) ++ List.rev_append obj_extra acc ++ in ++ let acc = ++ (* Add uncompiled header from the source tree *) ++ let path = ++ OASISHostPath.of_unix bs.bs_path ++ in ++ List.fold_left ++ begin fun acc modul -> ++ begin ++ try ++ [List.find ++ OASISFileUtil.file_exists_case ++ (List.map ++ (Filename.concat path) ++ (make_fnames modul [".mli"; ".ml"]))] ++ with Not_found -> ++ warning ++ (f_ "Cannot find source header for module %s \ ++ in object %s") ++ modul cs.cs_name; ++ [] ++ end ++ @ ++ List.filter ++ OASISFileUtil.file_exists_case ++ (List.map ++ (Filename.concat path) ++ (make_fnames modul [".annot";".cmti";".cmt"])) ++ @ acc ++ end ++ acc ++ obj.obj_modules ++ in ++ ++ let acc = ++ (* Get generated files *) ++ BaseBuilt.fold ++ BaseBuilt.BObj ++ cs.cs_name ++ (fun acc fn -> fn :: acc) ++ acc ++ in ++ ++ let f_data () = ++ (* Install data associated with the object *) ++ install_data ++ bs.bs_path ++ bs.bs_data_files ++ (Filename.concat ++ (datarootdir ()) ++ pkg.name); ++ f_data () ++ in ++ ++ (f_data, acc) ++ end ++ else ++ begin ++ (f_data, acc) ++ end ++ + in + + (* Install one group of library *) +@@ -4971,8 +6030,10 @@ module InternalInstallPlugin = struct + match grp with + | Container (_, children) -> + data_and_files, children +- | Package (_, cs, bs, lib, children) -> ++ | Package (_, cs, bs, `Library lib, children) -> + files_of_library data_and_files (cs, bs, lib), children ++ | Package (_, cs, bs, `Object obj, children) -> ++ files_of_object data_and_files (cs, bs, obj), children + in + List.fold_left + install_group_lib_aux +@@ -5006,7 +6067,7 @@ module InternalInstallPlugin = struct + begin + let meta = + (* Search META file *) +- let (_, bs, _) = ++ let _, bs, _ = + root_lib + in + let res = +@@ -5019,7 +6080,7 @@ module InternalInstallPlugin = struct + findlib_name; + res + in +- let files = ++ let files = + (* Make filename shorter to avoid hitting command max line length + * too early, esp. on Windows. + *) +@@ -5028,24 +6089,24 @@ module InternalInstallPlugin = struct + let nlen = String.length n in + if plen <= nlen && String.sub n 0 plen = p then + begin +- let fn_sep = ++ let fn_sep = + if Sys.os_type = "Win32" then + '\\' + else + '/' + in + let cutpoint = plen + +- (if plen < nlen && n.[plen] = fn_sep then ++ (if plen < nlen && n.[plen] = fn_sep then + 1 +- else ++ else + 0) + in + String.sub n cutpoint (nlen - cutpoint) + end +- else ++ else + n + in +- List.map (remove_prefix (Sys.getcwd ())) files ++ List.map (remove_prefix (Sys.getcwd ())) files + in + info + (f_ "Installing findlib library '%s'") +@@ -5079,7 +6140,7 @@ module InternalInstallPlugin = struct + + let install_execs pkg = + let install_exec data_exec = +- let (cs, bs, exec) = ++ let cs, bs, exec = + !exec_hook data_exec + in + if var_choose bs.bs_install && +@@ -5126,7 +6187,7 @@ module InternalInstallPlugin = struct + + let install_docs pkg = + let install_doc data = +- let (cs, doc) = ++ let cs, doc = + !doc_hook data + in + if var_choose doc.doc_install && +@@ -5162,6 +6223,7 @@ module InternalInstallPlugin = struct + install_execs pkg; + install_docs pkg + ++ + (* Uninstall already installed data *) + let uninstall _ argv = + List.iter +@@ -5225,41 +6287,49 @@ module InternalInstallPlugin = struct + (BaseLog.filter + [install_file_ev; + install_dir_ev; +- install_findlib_ev;])) ++ install_findlib_ev])) ++ + + end + + +-# 5233 "setup.ml" ++# 6296 "setup.ml" + module CustomPlugin = struct +-(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/plugins/custom/CustomPlugin.ml" *) ++(* # 22 "src/plugins/custom/CustomPlugin.ml" *) ++ + + (** Generate custom configure/build/doc/test/install system + @author + *) + ++ + open BaseEnv + open OASISGettext + open OASISTypes + + + ++ ++ + type t = + { + cmd_main: command_line conditional; + cmd_clean: (command_line option) conditional; + cmd_distclean: (command_line option) conditional; +- } ++ } ++ ++ ++ let run = BaseCustom.run + +- let run = BaseCustom.run + + let main t _ extra_args = + let cmd, args = +- var_choose +- ~name:(s_ "main command") ++ var_choose ++ ~name:(s_ "main command") + t.cmd_main + in +- run cmd args extra_args ++ run cmd args extra_args ++ + + let clean t pkg extra_args = + match var_choose t.cmd_clean with +@@ -5268,6 +6338,7 @@ module CustomPlugin = struct + | _ -> + () + ++ + let distclean t pkg extra_args = + match var_choose t.cmd_distclean with + | Some (cmd, args) -> +@@ -5275,20 +6346,21 @@ module CustomPlugin = struct + | _ -> + () + ++ + module Build = +- struct ++ struct + let main t pkg extra_args = + main t pkg extra_args; + List.iter + (fun sct -> + let evs = +- match sct with ++ match sct with + | Library (cs, bs, lib) when var_choose bs.bs_build -> + begin +- let evs, _ = +- BaseBuilt.of_library ++ let evs, _ = ++ BaseBuilt.of_library + OASISHostPath.of_unix +- (cs, bs, lib) ++ (cs, bs, lib) + in + evs + end +@@ -5329,6 +6401,7 @@ module CustomPlugin = struct + distclean t pkg extra_args + end + ++ + module Test = + struct + let main t pkg (cs, test) extra_args = +@@ -5336,7 +6409,7 @@ module CustomPlugin = struct + main t pkg extra_args; + 0.0 + with Failure s -> +- BaseMessage.warning ++ BaseMessage.warning + (f_ "Test '%s' fails: %s") + cs.cs_name + s; +@@ -5346,9 +6419,10 @@ module CustomPlugin = struct + clean t pkg extra_args + + let distclean t pkg (cs, test) extra_args = +- distclean t pkg extra_args ++ distclean t pkg extra_args + end + ++ + module Doc = + struct + let main t pkg (cs, _) extra_args = +@@ -5363,10 +6437,11 @@ module CustomPlugin = struct + distclean t pkg extra_args + end + ++ + end + + +-# 5369 "setup.ml" ++# 6444 "setup.ml" + open OASISTypes;; + + let setup_t = +@@ -5393,8 +6468,8 @@ let setup_t = + (OASISExpr.EBool true, + Some (("PREFIX=$prefix", ["omake"; "clean"]))) + ]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- }; ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ }; + test = []; + doc = []; + install = +@@ -5406,19 +6481,28 @@ let setup_t = + ("PREFIX=$prefix", ["omake"; "install"])) + ]; + cmd_clean = [(OASISExpr.EBool true, None)]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- }; ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ }; + uninstall = + CustomPlugin.main + { + CustomPlugin.cmd_main = + [ + (OASISExpr.EBool true, +- ("PREFIX=$prefix", ["omake"; "uninstall"])) ++ ("yes", ++ [ ++ "no"; ++ "|"; ++ "omake"; ++ "--install;"; ++ "PREFIX=$prefix"; ++ "omake"; ++ "uninstall" ++ ])) + ]; + cmd_clean = [(OASISExpr.EBool true, None)]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- }; ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ }; + clean = + [ + CustomPlugin.Build.clean +@@ -5441,8 +6525,8 @@ let setup_t = + (OASISExpr.EBool true, + Some (("PREFIX=$prefix", ["omake"; "clean"]))) + ]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- }; ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ }; + CustomPlugin.clean + { + CustomPlugin.cmd_main = +@@ -5451,18 +6535,27 @@ let setup_t = + ("PREFIX=$prefix", ["omake"; "install"])) + ]; + cmd_clean = [(OASISExpr.EBool true, None)]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- }; ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ }; + CustomPlugin.clean + { + CustomPlugin.cmd_main = + [ + (OASISExpr.EBool true, +- ("PREFIX=$prefix", ["omake"; "uninstall"])) ++ ("yes", ++ [ ++ "no"; ++ "|"; ++ "omake"; ++ "--install;"; ++ "PREFIX=$prefix"; ++ "omake"; ++ "uninstall" ++ ])) + ]; + cmd_clean = [(OASISExpr.EBool true, None)]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- } ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ } + ]; + clean_test = []; + clean_doc = []; +@@ -5488,8 +6581,8 @@ let setup_t = + (OASISExpr.EBool true, + Some (("PREFIX=$prefix", ["omake"; "clean"]))) + ]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- }; ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ }; + CustomPlugin.distclean + { + CustomPlugin.cmd_main = +@@ -5498,18 +6591,27 @@ let setup_t = + ("PREFIX=$prefix", ["omake"; "install"])) + ]; + cmd_clean = [(OASISExpr.EBool true, None)]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- }; ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ }; + CustomPlugin.distclean + { + CustomPlugin.cmd_main = + [ + (OASISExpr.EBool true, +- ("PREFIX=$prefix", ["omake"; "uninstall"])) ++ ("yes", ++ [ ++ "no"; ++ "|"; ++ "omake"; ++ "--install;"; ++ "PREFIX=$prefix"; ++ "omake"; ++ "uninstall" ++ ])) + ]; + cmd_clean = [(OASISExpr.EBool true, None)]; +- cmd_distclean = [(OASISExpr.EBool true, None)]; +- } ++ cmd_distclean = [(OASISExpr.EBool true, None)] ++ } + ]; + distclean_test = []; + distclean_doc = []; +@@ -5518,6 +6620,8 @@ let setup_t = + oasis_version = "0.2"; + ocaml_version = None; + findlib_version = None; ++ alpha_features = []; ++ beta_features = []; + name = "ocamltter"; + version = "2.1.0"; + license = +@@ -5526,8 +6630,8 @@ let setup_t = + { + OASISLicense.license = "LGPL"; + excption = Some "OCaml linking"; +- version = OASISLicense.Version "2.0"; +- }); ++ version = OASISLicense.Version "2.0" ++ }); + license_file = None; + copyrights = []; + maintainers = []; +@@ -5536,55 +6640,56 @@ let setup_t = + synopsis = "The OCAMLTTER twitter client"; + description = None; + categories = []; +- conf_type = (`Configure, "internal", Some "0.3"); ++ conf_type = (`Configure, "internal", Some "0.4"); + conf_custom = + { + pre_command = [(OASISExpr.EBool true, None)]; +- post_command = [(OASISExpr.EBool true, None)]; +- }; ++ post_command = [(OASISExpr.EBool true, None)] ++ }; + build_type = (`Build, "Custom", Some "0.2"); + build_custom = + { + pre_command = [(OASISExpr.EBool true, None)]; +- post_command = [(OASISExpr.EBool true, None)]; +- }; ++ post_command = [(OASISExpr.EBool true, None)] ++ }; + install_type = (`Install, "Custom", Some "0.2"); + install_custom = + { + pre_command = [(OASISExpr.EBool true, None)]; +- post_command = [(OASISExpr.EBool true, None)]; +- }; ++ post_command = [(OASISExpr.EBool true, None)] ++ }; + uninstall_custom = + { + pre_command = [(OASISExpr.EBool true, None)]; +- post_command = [(OASISExpr.EBool true, None)]; +- }; ++ post_command = [(OASISExpr.EBool true, None)] ++ }; + clean_custom = + { + pre_command = [(OASISExpr.EBool true, None)]; +- post_command = [(OASISExpr.EBool true, None)]; +- }; ++ post_command = [(OASISExpr.EBool true, None)] ++ }; + distclean_custom = + { + pre_command = [(OASISExpr.EBool true, None)]; +- post_command = [(OASISExpr.EBool true, None)]; +- }; ++ post_command = [(OASISExpr.EBool true, None)] ++ }; + files_ab = []; + sections = []; + plugins = [(`Extra, "StdFiles", Some "0.2")]; ++ disable_oasis_section = []; + schema_data = PropList.Data.create (); +- plugin_data = []; +- }; ++ plugin_data = [] ++ }; + oasis_fn = Some "_oasis"; +- oasis_version = "0.3.0"; +- oasis_digest = Some "\148\204\201&\210\147}\214.;\217T\211!\229y"; ++ oasis_version = "0.4.6"; ++ oasis_digest = Some "\135d\251\133c\193R[\203t\206\250\2315\152>"; + oasis_exec = None; + oasis_setup_args = []; +- setup_update = false; +- };; ++ setup_update = false ++ };; + + let setup () = BaseSetup.setup setup_t;; + +-# 5589 "setup.ml" ++# 6694 "setup.ml" + (* OASIS_STOP *) + let () = setup ();; diff --git a/patches/ocamlviz/ocamlviz.install b/patches/ocamlviz/ocamlviz.install new file mode 100644 index 0000000..8ff5f91 --- /dev/null +++ b/patches/ocamlviz/ocamlviz.install @@ -0,0 +1,4 @@ +bin: [ + "gui.opt" {"ocamlviz-gui"} + "ascii.opt" {"ocamlviz-ascii"} +] diff --git a/patches/ocamlviz/opam.patch.in b/patches/ocamlviz/opam.patch.in new file mode 100644 index 0000000..93ae62c --- /dev/null +++ b/patches/ocamlviz/opam.patch.in @@ -0,0 +1,48 @@ +diff -ru ocamlviz.1.01/configure.in ocamlviz.1.01/configure.in +--- ocamlviz.1.01/configure.in 2009-08-20 15:31:02.000000000 +0200 ++++ ocamlviz.1.01/configure.in 2012-10-05 18:15:14.102319199 +0200 +@@ -136,16 +136,16 @@ + fi + + # checking for lablgtk2 +-AC_CHECK_FILE($OCAMLLIB/lablgtk2/lablgtk.cma,LABLGTK2=yes,LABLGTK2=no) ++AC_CHECK_FILE(%{lib}%/lablgtk2/lablgtk.cma,LABLGTK2=yes,LABLGTK2=no) + # AC_CHECK_PROG(LABLGTK2,lablgtk2,yes,no) not always available (Win32) + if test "$LABLGTK2" = yes ; then +- INCLUDEGTK2="-I +lablgtk2" ++ INCLUDEGTK2="-I %{lib}%/lablgtk2" + fi + + # checking for cairo +-AC_CHECK_FILE($OCAMLLIB/cairo/cairo.cmxa,CAIRO=yes,CAIRO=no) ++AC_CHECK_FILE(%{lib}%/cairo2/cairo2.cmxa,CAIRO=yes,CAIRO=no) + if test "$CAIRO" = yes ; then +- INCLUDECAIRO="-I +cairo" ++ INCLUDECAIRO="-I %{lib}%/cairo2" + fi + + if test "$LABLGTK2" = yes && test "$CAIRO" = yes ; then +diff -ru ocamlviz.1.01/Makefile.in ocamlviz.1.01/Makefile.in +--- ocamlviz.1.01/Makefile.in 2009-09-08 12:48:31.000000000 +0200 ++++ ocamlviz.1.01/Makefile.in 2012-10-05 18:15:14.174321378 +0200 +@@ -108,7 +108,7 @@ + $(OCAMLC) $(BFLAGS) -o $@ lablgtk.cma gtkInit.cma unix.cma $^ + + gui.opt: $(GUICMX) +- $(OCAMLOPT) $(OFLAGS) -o $@ unix.cmxa threads.cmxa lablgtk.cmxa cairo.cmxa cairo_lablgtk.cmxa gtkThread.cmx $^ ++ $(OCAMLOPT) $(OFLAGS) -o $@ unix.cmxa threads.cmxa lablgtk.cmxa bigarray.cmxa cairo2.cmxa cairo_gtk.cmxa gtkThread.cmx $^ + + + camlp4/pa_ocamlviz.cmo: camlp4/pa_ocamlviz.ml +diff -ru ocamlviz.1.01/src/graph.ml ocamlviz.1.01/src/graph.ml +--- ocamlviz.1.01/src/graph.ml 2009-09-08 10:19:19.000000000 +0200 ++++ ocamlviz.1.01/src/graph.ml 2012-10-05 18:15:14.138320291 +0200 +@@ -194,7 +194,7 @@ + + (********** draws the 2 axis, the grid, the legends ************) + +-let draw_background cr t width height = ++module Cairo = struct include Cairo let rectangle ~x ~y ~width ~height = rectangle ~x ~y ~w:width ~h:height let set_dash cr t ofs = set_dash cr t ~ofs end open Cairo module Cairo_lablgtk = Cairo_gtk let draw_background cr t width height = + Cairo.rectangle cr ~x:t.lborder ~y:t.vborder ~width:(float width -. t.lborder -. t.rborder) ~height:(float height -. 2.*.t.vborder); + Cairo.set_source_rgb cr 1.0 1.0 1.0; + Cairo.fill cr; diff --git a/patches/ocamlweb/ocamlweb.install b/patches/ocamlweb/ocamlweb.install new file mode 100644 index 0000000..df876f3 --- /dev/null +++ b/patches/ocamlweb/ocamlweb.install @@ -0,0 +1 @@ +bin: ["ocamlweb"] diff --git a/patches/ocb-stubblr/custom-cclib.patch b/patches/ocb-stubblr/custom-cclib.patch new file mode 100644 index 0000000..e78b0df --- /dev/null +++ b/patches/ocb-stubblr/custom-cclib.patch @@ -0,0 +1,22 @@ +From d51b3f3a49f159469e00d23524db915f19bb0127 Mon Sep 17 00:00:00 2001 +From: Hannes Mehnert +Date: Tue, 3 Oct 2017 13:55:16 +0100 +Subject: [PATCH] bytecode / custom needs -cclib as well + +--- + src/ocb_stubblr.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ocb_stubblr.ml b/src/ocb_stubblr.ml +index b68c37a..a0ee035 100644 +--- a/src/ocb_stubblr.ml ++++ b/src/ocb_stubblr.ml +@@ -160,7 +160,7 @@ let link_flag () = + S [A switch; A ("-l"^name)] + and dep flag = Pathname.([remove_extension flag -.- "a"]) in + pflag ["link"; "ocaml"; "library"; "byte"] tag (libarg "-dllib"); +- pflag ["link"; "ocaml"; "library"; "native"] tag (libarg "-cclib"); ++ pflag ["link"; "ocaml"; "library"] tag (libarg "-cclib"); + pdep ["link"; "ocaml"] tag dep; + pdep ["compile"; "ocaml"] tag dep + (* XXX sneak in '-I' for compile;ocaml;program ?? *) diff --git a/patches/ocb-stubblr/use-OPAM_SWITCH_PREFIX.patch b/patches/ocb-stubblr/use-OPAM_SWITCH_PREFIX.patch new file mode 100644 index 0000000..67ffc9f --- /dev/null +++ b/patches/ocb-stubblr/use-OPAM_SWITCH_PREFIX.patch @@ -0,0 +1,33 @@ +From f1c9340f3ab973ad1e8dcc4b7065bbe6cfaa028f Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Sun, 1 Jul 2018 09:54:32 +0100 +Subject: [PATCH] Use OPAM_SWITCH_PREFIX before opam config var prefix + +opam 2's sandbox doesn't expose the mount point for the opam root. + +Signed-off-by: David Allsopp +--- + src/ocb_stubblr.ml | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/ocb_stubblr.ml b/src/ocb_stubblr.ml +index b68c37a..2cc5332 100644 +--- a/src/ocb_stubblr.ml ++++ b/src/ocb_stubblr.ml +@@ -31,11 +31,15 @@ module Pkg_config = struct + + (* XXX Would be nice to move pkg-config results to a build artefact. *) + +- let opam_prefix = ++ let opam_prefix_cmd = + let cmd = "opam config var prefix" in + lazy ( try run_and_read cmd with Failure _ -> + error_msgf "error running opam") + ++ let opam_prefix = ++ lazy (try Sys.getenv "OPAM_SWITCH_PREFIX" ++ with Not_found -> Lazy.force opam_prefix_cmd) ++ + let var = "PKG_CONFIG_PATH" + + let path () = diff --git a/patches/oclaunch/oclaunch.install b/patches/oclaunch/oclaunch.install new file mode 100644 index 0000000..082615a --- /dev/null +++ b/patches/oclaunch/oclaunch.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/oclaunch.byte" {"oclaunch"} + "?_build/src/oclaunch.native" {"oclaunch"} +] diff --git a/patches/ocp-indent/elisp-hotfix.patch b/patches/ocp-indent/elisp-hotfix.patch new file mode 100644 index 0000000..54a9e9e --- /dev/null +++ b/patches/ocp-indent/elisp-hotfix.patch @@ -0,0 +1,14 @@ +diff --git a/tools/ocp-indent.el b/tools/ocp-indent.el +index fdb70aa..7516245 100644 +--- a/tools/ocp-indent.el ++++ b/tools/ocp-indent.el +@@ -113,7 +113,8 @@ are blanks." + ;;;###autoload + (defun ocp-setup-indent () + (interactive nil) +- (unless (string= (file-name-extension (buffer-file-name)) "mly") ++ (unless (and (buffer-file-name) ++ (string= (file-name-extension (buffer-file-name)) "mly")) + (unless ocp-indent-allow-tabs (set 'indent-tabs-mode nil)) + (set (make-local-variable 'indent-line-function) #'ocp-indent-line) + (set (make-local-variable 'indent-region-function) #'ocp-indent-region))) diff --git a/patches/ocp-indent/fix-warn-error.patch.0.6.0 b/patches/ocp-indent/fix-warn-error.patch.0.6.0 new file mode 100644 index 0000000..c63353c --- /dev/null +++ b/patches/ocp-indent/fix-warn-error.patch.0.6.0 @@ -0,0 +1,14 @@ +diff -C 2 -r ocp-indent-0.6.0.orig/src/ocp-indent.ocp ocp-indent-0.6.0/src/ocp-indent.ocp +*** ocp-indent-0.6.0.orig/src/ocp-indent.ocp 2013-01-21 12:27:47.000000000 +0100 +--- ocp-indent-0.6.0/src/ocp-indent.ocp 2016-02-25 13:02:14.052188395 +0100 +*************** +*** 15,18 **** + ] + requires = [ ] +! comp += [ "-g" "-w" "+A-4-9" "-warn-error" ] + end +--- 15,18 ---- + ] + requires = [ ] +! comp += [ "-g" "-w" "+A-4-9" ] + end diff --git a/patches/ocp-indent/fix-warn-error.patch.0.6.2 b/patches/ocp-indent/fix-warn-error.patch.0.6.2 new file mode 100644 index 0000000..2fdd12e --- /dev/null +++ b/patches/ocp-indent/fix-warn-error.patch.0.6.2 @@ -0,0 +1,12 @@ +diff -C 2 -r ocp-indent.0.9.0.orig/src/ocp-indent.ocp ocp-indent.0.9.0/src/ocp-indent.ocp +*** ocp-indent.0.9.0.orig/src/ocp-indent.ocp 2016-02-25 13:28:02.504254590 +0100 +--- ocp-indent.0.9.0/src/ocp-indent.ocp 2016-02-25 13:28:19.912255334 +0100 +*************** +*** 1,3 **** +! comp += [ "-g" "-w" "+A-4-9" "-warn-error" ] + + begin library "ocp-indent-lexer" +--- 1,3 ---- +! comp += [ "-g" "-w" "+A-4-9" ] + + begin library "ocp-indent-lexer" diff --git a/patches/ocp-indent/fix-warn-error.patch.0.9.0 b/patches/ocp-indent/fix-warn-error.patch.0.9.0 new file mode 100644 index 0000000..2fdd12e --- /dev/null +++ b/patches/ocp-indent/fix-warn-error.patch.0.9.0 @@ -0,0 +1,12 @@ +diff -C 2 -r ocp-indent.0.9.0.orig/src/ocp-indent.ocp ocp-indent.0.9.0/src/ocp-indent.ocp +*** ocp-indent.0.9.0.orig/src/ocp-indent.ocp 2016-02-25 13:28:02.504254590 +0100 +--- ocp-indent.0.9.0/src/ocp-indent.ocp 2016-02-25 13:28:19.912255334 +0100 +*************** +*** 1,3 **** +! comp += [ "-g" "-w" "+A-4-9" "-warn-error" ] + + begin library "ocp-indent-lexer" +--- 1,3 ---- +! comp += [ "-g" "-w" "+A-4-9" ] + + begin library "ocp-indent-lexer" diff --git a/patches/ocp-indent/ocp-indent.install b/patches/ocp-indent/ocp-indent.install new file mode 100644 index 0000000..e9455c0 --- /dev/null +++ b/patches/ocp-indent/ocp-indent.install @@ -0,0 +1,40 @@ +bin: [ + "_obuild/ocp-indent/ocp-indent.asm" {"ocp-indent"} +] +lib: [ + "META" + "_obuild/ocp-indent.lib/ocp-indent.lib.a" {"lib/ocp-indent.lib.a"} + "_obuild/ocp-indent.lib/ocp-indent.lib.cma" {"lib/ocp-indent.lib.cma"} + "_obuild/ocp-indent.lib/ocp-indent.lib.cmxa" {"lib/ocp-indent.lib.cmxa"} + "_obuild/ocp-indent.lib/indentConfig.cmi" {"lib/indentConfig.cmi"} + "?_obuild/ocp-indent.lib/indentConfig.cmti" {"lib/indentConfig.cmti"} + "_obuild/ocp-indent.lib/indentBlock.cmi" {"lib/indentBlock.cmi"} + "?_obuild/ocp-indent.lib/indentBlock.cmti" {"lib/indentBlock.cmti"} + "_obuild/ocp-indent.lib/indentPrinter.cmi" {"lib/indentPrinter.cmi"} + "?_obuild/ocp-indent.lib/indentPrinter.cmti" {"lib/indentPrinter.cmti"} + "_obuild/ocp-indent.utils/ocp-indent.utils.a" {"utils/ocp-indent.utils.a"} + "_obuild/ocp-indent.utils/ocp-indent.utils.cma" {"utils/ocp-indent.utils.cma"} + "_obuild/ocp-indent.utils/ocp-indent.utils.cmxa" {"utils/ocp-indent.utils.cmxa"} + "_obuild/ocp-indent.utils/pos.cmi" {"utils/pos.cmi"} + "?_obuild/ocp-indent.utils/pos.cmti" {"utils/pos.cmti"} + (* "_obuild/ocp-indent.utils/util.cmi" {"utils/util.cmi"} *) + (* "?_obuild/ocp-indent.utils/util.cmt" {"utils/util.cmt"} *) + "_obuild/ocp-indent.utils/nstream.cmi" {"utils/nstream.cmi"} + "?_obuild/ocp-indent.utils/nstream.cmti" {"utils/nstream.cmti"} + (* "_obuild/ocp-indent.utils/compat.cmi" {"utils/compat.cmi"} *) + (* "_obuild/ocp-indent.utils/compat.cmt" {"utils/compat.cmt"} *) + "_obuild/ocp-indent.lexer/ocp-indent.lexer.a" {"lexer/ocp-indent.lexer.a"} + "_obuild/ocp-indent.lexer/ocp-indent.lexer.cma" {"lexer/ocp-indent.lexer.cma"} + "_obuild/ocp-indent.lexer/ocp-indent.lexer.cmxa" {"lexer/ocp-indent.lexer.cmxa"} + "_obuild/ocp-indent.lexer/approx_tokens.cmi" {"lexer/approx_tokens.cmi"} + "?_obuild/ocp-indent.lexer/approx_tokens.cmt" {"lexer/approx_tokens.cmt"} + "_obuild/ocp-indent.lexer/approx_lexer.cmi" {"lexer/approx_lexer.cmi"} + "?_obuild/ocp-indent.lexer/approx_lexer.cmt" {"lexer/approx_lexer.cmt"} +] +man: [ + "man/man1/ocp-indent.1" {"man1/ocp-indent.1"} +] +share: [ + "tools/ocp-indent.el" {"../emacs/site-lisp/ocp-indent.el"} + "tools/ocp-indent.vim" {"../vim/syntax/ocp-indent.vim"} +] diff --git a/patches/ocp-indent/warnings.patch b/patches/ocp-indent/warnings.patch new file mode 100644 index 0000000..1c2c5f4 --- /dev/null +++ b/patches/ocp-indent/warnings.patch @@ -0,0 +1,9 @@ +index cc73b04..181e7d7 100644 +--- a/src/ocp-indent.ocp ++++ b/src/ocp-indent.ocp +@@ -1,4 +1,4 @@ +-comp += [ "-g" "-w" "+A-4-9" "-warn-error" "+A-4-9" ] ++comp += [ "-g" "-w" "+A-4-9" "-warn-error" "+1..39" ] + + begin library "ocp-indent-lexer" + files = [ diff --git a/patches/ocp-index/0001-Update-for-4.02.patch b/patches/ocp-index/0001-Update-for-4.02.patch new file mode 100644 index 0000000..782d279 --- /dev/null +++ b/patches/ocp-index/0001-Update-for-4.02.patch @@ -0,0 +1,367 @@ +From f50b1a488e25ae3fb9125d2a739b614adfbad6a6 Mon Sep 17 00:00:00 2001 +From: Peter Zotov +Date: Mon, 12 May 2014 20:18:37 +0400 +Subject: [PATCH] Update for 4.02. + +--- + src/browserMain.ml | 2 +- + src/indexBuild.ml | 79 +++++++++++++++++++++++++++++++------------------- + src/indexOptions.ml | 2 +- + src/indexOut.ml | 13 +++++---- + src/indexPredefined.ml | 27 ++++++++++++----- + src/indexTypes.ml | 2 +- + src/libIndex.mli | 2 +- + 7 files changed, 79 insertions(+), 48 deletions(-) + +diff --git a/src/browserMain.ml b/src/browserMain.ml +index f34f6d5..fa5c8d0 100644 +--- a/src/browserMain.ml ++++ b/src/browserMain.ml +@@ -186,7 +186,7 @@ let interactive opts () = + LibIndex.Format.no_color + else + let attr = function +- | LibIndex.Type -> Curses.WA.color_pair 6 ++ | LibIndex.Type | LibIndex.OpenType -> Curses.WA.color_pair 6 + | LibIndex.Value -> Curses.WA.bold + | LibIndex.Exception -> Curses.WA.color_pair 3 + | LibIndex.Field _ | LibIndex.Variant _ -> Curses.WA.color_pair 4 +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index 3eddb5e..c25fdf2 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -123,8 +123,8 @@ let ty_of_sig_item = + function + | Types.Sig_value(id, decl) -> tree_of_value_description id decl + | Types.Sig_type(id, decl, rs) -> tree_of_type_declaration id decl rs +- | Types.Sig_exception(id, decl) -> tree_of_exception_declaration id decl +- | Types.Sig_module(id, mty, rs) -> tree_of_module id mty rs ++ | Types.Sig_typext(id, decl, es) -> tree_of_extension_constructor id decl es ++ | Types.Sig_module(id, { Types.md_type }, rs) -> tree_of_module id md_type rs + | Types.Sig_modtype(id, decl) -> tree_of_modtype_declaration id decl + | Types.Sig_class(id, decl, rs) -> tree_of_class_declaration id decl rs + | Types.Sig_class_type(id, decl, rs) -> tree_of_cltype_declaration id decl rs +@@ -195,6 +195,7 @@ let qualify_ty (parents:parents) ty = + | Otyp_poly (str, ty) -> Otyp_poly (str, aux ty) + | Otyp_module (str, strl, tylist) -> + Otyp_module (str, strl, List.map aux tylist) ++ | Otyp_open -> Otyp_open + in + aux ty + +@@ -202,17 +203,21 @@ let qualify_ty_in_sig_item (parents:parents) = + let qual = qualify_ty parents in + let open Outcometree in + function +- | Osig_type ((str, list, ty, priv, tylist2), rc) -> +- Osig_type ((str, list, qual ty, priv, +- List.map (fun (ty1,ty2) -> qual ty1, qual ty2) tylist2), rc) ++ | Osig_type (out_type_decl, rc) -> ++ Osig_type ({ out_type_decl with ++ otype_type = qual out_type_decl.otype_type; ++ otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) ++ out_type_decl.otype_cstrs }, rc) + | Osig_value (str, ty, str2) -> Osig_value (str, qual ty, str2) +- | Osig_exception (str, tylist) -> Osig_exception (str, List.map qual tylist) ++ | Osig_typext (constr, es) -> ++ Osig_typext ({ constr with ++ oext_args = List.map qual constr.oext_args }, es) + | out_sig -> out_sig (* don't get down in modules, classes and their types *) + + let loc_of_sig_item = function + | Types.Sig_value (_,descr) -> descr.Types.val_loc + | Types.Sig_type (_,descr,_) -> descr.Types.type_loc +- | Types.Sig_exception (_,descr) -> descr.Types.exn_loc ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_loc + (* Sadly the Types tree doesn't contain locations for those. This means we + won't associate comments easily either (todo...) *) + | Types.Sig_module _ +@@ -224,7 +229,7 @@ let loc_of_sig_item = function + let id_of_sig_item = function + | Types.Sig_value (id,_) + | Types.Sig_type (id,_,_) +- | Types.Sig_exception (id,_) ++ | Types.Sig_typext (id,_,_) + | Types.Sig_module (id,_,_) + | Types.Sig_modtype (id,_) + | Types.Sig_class (id,_,_) +@@ -234,7 +239,8 @@ let id_of_sig_item = function + let kind_of_sig_item = function + | Types.Sig_value _ -> Value + | Types.Sig_type _ -> Type +- | Types.Sig_exception _ -> Exception ++ | Types.Sig_typext (_, _, Types.Text_exception) -> Exception ++ | Types.Sig_typext _ -> OpenType + | Types.Sig_module _ -> Module + | Types.Sig_modtype _ -> ModuleType + | Types.Sig_class _ -> Class +@@ -243,20 +249,25 @@ let kind_of_sig_item = function + let trie_of_type_decl ?comments info ty_decl = + match ty_decl.Types.type_kind with + | Types.Type_abstract -> [], comments ++ | Types.Type_open -> [], comments + | Types.Type_record (fields,_repr) -> + List.map +- (fun (id, _mutable, ty_expr) -> +- let ty = Printtyp.tree_of_typexp false ty_expr in ++ (fun { Types.ld_id; ld_type } -> ++ let ty = Printtyp.tree_of_typexp false ld_type in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key ld_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Field info; +- name = id.Ident.name; ++ name = ld_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -267,25 +278,29 @@ let trie_of_type_decl ?comments info ty_decl = + comments + | Types.Type_variant variants -> + List.map +- (fun (id, ty_exprs, _constraints) -> ++ (fun { Types.cd_id; cd_args } -> + let ty = +- let params = match ty_exprs with ++ let params = match cd_args with + | [] -> Outcometree.Otyp_sum [] + | param::_ -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple ty_exprs; ++ { Types. desc = Types.Ttuple cd_args; + level = param.Types.level; + id = param.Types.id } + in +- Outcometree.Osig_type +- (("", [], params, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = params; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key cd_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Variant info; +- name = id.Ident.name; ++ name = cd_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -313,7 +328,7 @@ let locate_impl cmt path name kind = + sign + in + match modul with +- | Types.Sig_module (_,Types.Mty_signature sign,_) -> ++ | Types.Sig_module (_, {Types.md_type = Types.Mty_signature sign},_) -> + find_item path sign + | _ -> raise Not_found + in +@@ -370,8 +385,8 @@ let rec trie_of_sig_item + (* read module / class contents *) + let children, comments = + match sig_item with +- | Types.Sig_module (id,Types.Mty_signature sign,_) +- | Types.Sig_modtype (id,Types.Modtype_manifest (Types.Mty_signature sign)) ++ | Types.Sig_module (id,{ Types.md_type = Types.Mty_signature sign },_) ++ | Types.Sig_modtype (id,{ Types.mtd_type = Some (Types.Mty_signature sign) }) + -> + let path = path @ [id.Ident.name] in + let rec children_comments = lazy ( +@@ -392,7 +407,7 @@ let rec trie_of_sig_item + | Some _, lazy (_, comments) -> comments + in + children, comments +- | Types.Sig_module (_,Types.Mty_ident sig_ident,_) -> ++ | Types.Sig_module (_,{ Types.md_type = Types.Mty_ident sig_ident },_) -> + let sig_path = + let rec get_path = function + | Path.Pident id -> [id.Ident.name] +@@ -419,22 +434,26 @@ let rec trie_of_sig_item + | Types.Sig_class_type (id,{Types.clty_type=cty},_) + -> + let rec get_clsig = function +- | Types.Cty_constr (_,_,cty) | Types.Cty_fun (_,_,cty) -> ++ | Types.Cty_constr (_,_,cty) | Types.Cty_arrow (_,_,cty) -> + get_clsig cty + | Types.Cty_signature clsig -> clsig + in + let clsig = get_clsig cty in + let path = path@[id.Ident.name] in + let (fields, _) = +- Ctype.flatten_fields (Ctype.object_fields clsig.Types.cty_self) ++ Ctype.flatten_fields (Ctype.object_fields clsig.Types.csig_self) + in + lazy (List.fold_left (fun t (lbl,_,ty_expr) -> + if lbl = "*dummy method*" then t else + let _ = Printtyp.reset_and_mark_loops ty_expr in + let ty = Printtyp.tree_of_typexp false ty_expr in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in + Trie.add t (string_to_key lbl) + { path = path; +diff --git a/src/indexOptions.ml b/src/indexOptions.ml +index a800e9f..808fe25 100644 +--- a/src/indexOptions.ml ++++ b/src/indexOptions.ml +@@ -37,7 +37,7 @@ let filter opt info = + let open LibIndex in + let kinds = opt.filter in + match info.kind with +- | Type -> kinds.t ++ | Type | OpenType -> kinds.t + | Value | Method _ -> kinds.v + | Exception -> kinds.e + | Field _ | Variant _ -> kinds.c +diff --git a/src/indexOut.ml b/src/indexOut.ml +index d95ec8b..9ea17db 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -57,7 +57,7 @@ module IndexFormat = struct + let color = + let f kind fstr fmt = + let colorcode = match kind with +- | Type -> "\027[36m" ++ | Type | OpenType -> "\027[36m" + | Value -> "\027[1m" + | Exception -> "\027[33m" + | Field _ | Variant _ -> "\027[34m" +@@ -88,6 +88,7 @@ module IndexFormat = struct + | Type -> Format.pp_print_string fmt "type" + | Value -> Format.pp_print_string fmt "val" + | Exception -> Format.pp_print_string fmt "exception" ++ | OpenType -> Format.pp_print_string fmt "opentype" + | Field parentty -> + Format.fprintf fmt "field(%a)" + (colorise.f parentty.kind "%s") parentty.name +@@ -154,20 +155,20 @@ module IndexFormat = struct + | Osig_class (_,_,_,ctyp,_) + | Osig_class_type (_,_,_,ctyp,_) -> + !Oprint.out_class_type fmt ctyp +- | Osig_exception (_,[]) -> ++ | Osig_typext ({ oext_args = [] }, _) -> + Format.pp_print_char fmt '-' +- | Osig_exception (_,tylst) -> ++ | Osig_typext ({ oext_args }, _) -> + list ~paren:true + !Oprint.out_type + (fun fmt () -> + Format.pp_print_char fmt ','; Format.pp_print_space fmt ()) + fmt +- tylst ++ oext_args + | Osig_modtype (_,mtyp) + | Osig_module (_,mtyp,_) -> + !Oprint.out_module_type fmt mtyp +- | Osig_type ((_,_,ty,_,_),_) -> +- Format.fprintf fmt "@[%a@]" tydecl ty ++ | Osig_type ({ otype_type },_) -> ++ Format.fprintf fmt "@[%a@]" tydecl otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty + +diff --git a/src/indexPredefined.ml b/src/indexPredefined.ml +index 5f493bf..0fe7729 100644 +--- a/src/indexPredefined.ml ++++ b/src/indexPredefined.ml +@@ -24,8 +24,11 @@ let mktype name ?(params=[]) ?(def=Otyp_abstract) doc = { + kind = Type; + name = name; + ty = Some (Osig_type ( +- (name,List.map (fun v -> v,(true,true)) params,def,Asttypes.Public,[]), +- Orec_not)); ++ { otype_name = name; ++ otype_params = List.map (fun v -> v,(true,true)) params; ++ otype_type = def; ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy (Some doc); +@@ -37,11 +40,13 @@ let mkvariant name parent params = { + orig_path = []; + kind = Variant parent; + name = name; +- ty = Some (Osig_type (("", [], +- (match params with [] -> Otyp_sum [] +- | l -> Otyp_tuple l), +- Asttypes.Public, []), +- Outcometree.Orec_not)); ++ ty = Some (Osig_type ( ++ { otype_name = ""; ++ otype_params = []; ++ otype_type = (match params with [] -> Otyp_sum [] ++ | l -> Otyp_tuple l); ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy None; +@@ -53,7 +58,13 @@ let mkexn name params doc = { + orig_path = []; + kind = Exception; + name = name; +- ty = Some (Osig_exception (name,params)); ++ ty = Some (Osig_typext ({ ++ oext_name = name; ++ oext_type_name = "exn"; ++ oext_type_params = []; ++ oext_args = params; ++ oext_ret_type = None; ++ oext_private = Asttypes.Public }, Oext_exception)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy (Some doc); +diff --git a/src/indexTypes.ml b/src/indexTypes.ml +index 252386b..e094317 100644 +--- a/src/indexTypes.ml ++++ b/src/indexTypes.ml +@@ -35,7 +35,7 @@ type info = { path: string list; + + (** The kind of elements that can be stored in the trie *) + and kind = +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/libIndex.mli b/src/libIndex.mli +index 9e7efa8..b826cf7 100644 +--- a/src/libIndex.mli ++++ b/src/libIndex.mli +@@ -40,7 +40,7 @@ type info = IndexTypes.info = private { + + (** The kind of elements that can be stored in the trie *) + and kind = IndexTypes.kind = private +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +-- +2.0.1 + diff --git a/patches/ocp-index/META.1.1.5 b/patches/ocp-index/META.1.1.5 new file mode 100644 index 0000000..714cbf9 --- /dev/null +++ b/patches/ocp-index/META.1.1.5 @@ -0,0 +1,7 @@ +package "lib" ( + version = "1.1.5" + directory = "lib" + archive(byte) = "ocp-index-lib.cma" + archive(native) = "ocp-index-lib.cmxa" + requires = "compiler-libs compiler-libs.common ocp-indent.lexer ocp-indent.utils" +) diff --git a/patches/ocp-index/ocaml.4.02.patch.1.1.0 b/patches/ocp-index/ocaml.4.02.patch.1.1.0 new file mode 100644 index 0000000..d37f05c --- /dev/null +++ b/patches/ocp-index/ocaml.4.02.patch.1.1.0 @@ -0,0 +1,440 @@ +diff --git a/src/browserMain.ml b/src/browserMain.ml +index 3b277b7..6a201a7 100644 +--- a/src/browserMain.ml ++++ b/src/browserMain.ml +@@ -16,7 +16,7 @@ let rec eq l1 l2 = match l1, l2 with + let kind_to_tag, tag_to_style, register_ressource = + let h = Hashtbl.create 11 in + let kind_to_tag = function +- | LibIndex.Type -> "Type" ++ | LibIndex.Type | OpenType -> "Type" + | Value -> "Value" + | Exception -> "Exception" + | Field _ -> "Field" +diff --git a/src/grepMain.ml b/src/grepMain.ml +index 4dae5a6..514ca71 100644 +--- a/src/grepMain.ml ++++ b/src/grepMain.ml +@@ -82,8 +82,7 @@ end = struct + let ident path f ch = + let modname = + let s = Filename.basename (Filename.chop_extension f) in +- s.[0] <- Char.uppercase s.[0]; +- s ++ String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = + let lookfor = +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index 9c14706..dca601b 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -123,8 +123,8 @@ let ty_of_sig_item = + function + | Types.Sig_value(id, decl) -> tree_of_value_description id decl + | Types.Sig_type(id, decl, rs) -> tree_of_type_declaration id decl rs +- | Types.Sig_exception(id, decl) -> tree_of_exception_declaration id decl +- | Types.Sig_module(id, mty, rs) -> tree_of_module id mty rs ++ | Types.Sig_typext(id, decl, es) -> tree_of_extension_constructor id decl es ++ | Types.Sig_module(id, { Types.md_type }, rs) -> tree_of_module id md_type rs + | Types.Sig_modtype(id, decl) -> tree_of_modtype_declaration id decl + | Types.Sig_class(id, decl, rs) -> tree_of_class_declaration id decl rs + | Types.Sig_class_type(id, decl, rs) -> tree_of_cltype_declaration id decl rs +@@ -197,6 +197,7 @@ let qualify_ty (parents:parents) ty = + | Otyp_poly (str, ty) -> Otyp_poly (str, aux ty) + | Otyp_module (str, strl, tylist) -> + Otyp_module (str, strl, List.map aux tylist) ++ | Otyp_open -> Otyp_open + in + aux ty + +@@ -204,11 +205,15 @@ let qualify_ty_in_sig_item (parents:parents) = + let qual = qualify_ty parents in + let open Outcometree in + function +- | Osig_type ((str, list, ty, priv, tylist2), rc) -> +- Osig_type ((str, list, qual ty, priv, +- List.map (fun (ty1,ty2) -> qual ty1, qual ty2) tylist2), rc) ++ | Osig_type (out_type_decl, rc) -> ++ Osig_type ({ out_type_decl with ++ otype_type = qual out_type_decl.otype_type; ++ otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) ++ out_type_decl.otype_cstrs }, rc) + | Osig_value (str, ty, str2) -> Osig_value (str, qual ty, str2) +- | Osig_exception (str, tylist) -> Osig_exception (str, List.map qual tylist) ++ | Osig_typext (constr, es) -> ++ Osig_typext ({ constr with ++ oext_args = List.map qual constr.oext_args }, es) + | out_sig -> out_sig (* don't get down in modules, classes and their types *) + + (* -- end -- *) +@@ -216,19 +221,16 @@ let qualify_ty_in_sig_item (parents:parents) = + let loc_of_sig_item = function + | Types.Sig_value (_,descr) -> descr.Types.val_loc + | Types.Sig_type (_,descr,_) -> descr.Types.type_loc +- | Types.Sig_exception (_,descr) -> descr.Types.exn_loc +- (* Sadly the Types tree doesn't contain locations for those. This means we +- won't associate comments easily either (todo...) *) +- | Types.Sig_module _ +- | Types.Sig_modtype _ +- | Types.Sig_class _ +- | Types.Sig_class_type _ +- -> Location.none ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_loc ++ | Types.Sig_module (_,descr,_) -> descr.Types.md_loc ++ | Types.Sig_modtype (_,descr) -> descr.Types.mtd_loc ++ | Types.Sig_class (_,descr,_) -> descr.Types.cty_loc ++ | Types.Sig_class_type (_,descr,_) -> descr.Types.clty_loc + + let id_of_sig_item = function + | Types.Sig_value (id,_) + | Types.Sig_type (id,_,_) +- | Types.Sig_exception (id,_) ++ | Types.Sig_typext (id,_,_) + | Types.Sig_module (id,_,_) + | Types.Sig_modtype (id,_) + | Types.Sig_class (id,_,_) +@@ -238,7 +240,8 @@ let id_of_sig_item = function + let kind_of_sig_item = function + | Types.Sig_value _ -> Value + | Types.Sig_type _ -> Type +- | Types.Sig_exception _ -> Exception ++ | Types.Sig_typext (_, _, Types.Text_exception) -> Exception ++ | Types.Sig_typext _ -> OpenType + | Types.Sig_module _ -> Module + | Types.Sig_modtype _ -> ModuleType + | Types.Sig_class _ -> Class +@@ -247,20 +250,25 @@ let kind_of_sig_item = function + let trie_of_type_decl ?comments info ty_decl = + match ty_decl.Types.type_kind with + | Types.Type_abstract -> [], comments ++ | Types.Type_open -> [], comments + | Types.Type_record (fields,_repr) -> + List.map +- (fun (id, _mutable, ty_expr) -> +- let ty = Printtyp.tree_of_typexp false ty_expr in ++ (fun { Types.ld_id; ld_type } -> ++ let ty = Printtyp.tree_of_typexp false ld_type in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key ld_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Field info; +- name = id.Ident.name; ++ name = ld_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -271,25 +279,29 @@ let trie_of_type_decl ?comments info ty_decl = + comments + | Types.Type_variant variants -> + List.map +- (fun (id, ty_exprs, _constraints) -> ++ (fun { Types.cd_id; cd_args } -> + let ty = +- let params = match ty_exprs with ++ let params = match cd_args with + | [] -> Outcometree.Otyp_sum [] + | param::_ -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple ty_exprs; ++ { Types. desc = Types.Ttuple cd_args; + level = param.Types.level; + id = param.Types.id } + in +- Outcometree.Osig_type +- (("", [], params, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = params; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key cd_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Variant info; +- name = id.Ident.name; ++ name = cd_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -338,19 +350,21 @@ let rec trie_of_sig_item + in + (* ignore functor arguments *) + let rec sig_item_contents = function +- | Types.Sig_module (id, Types.Mty_functor (_,_,s), is_rec) -> +- sig_item_contents (Types.Sig_module (id, s, is_rec)) ++ | Types.Sig_module ++ (id, ({Types.md_type = Types.Mty_functor (_,_,s)} as funct), is_rec) -> ++ let funct = {funct with Types.md_type = s} in ++ sig_item_contents (Types.Sig_module (id, funct, is_rec)) + | Types.Sig_modtype +- (id, Types.Modtype_manifest (Types.Mty_functor (_,_,s))) -> +- sig_item_contents +- (Types.Sig_modtype (id, Types.Modtype_manifest s)) ++ (id, ({Types.mtd_type = Some (Types.Mty_functor (_,_,s))} as funct)) -> ++ let funct = {funct with Types.mtd_type = Some s} in ++ sig_item_contents (Types.Sig_modtype (id, funct)) + | si -> si + in + (* read module / class contents *) + let children, comments = + match sig_item_contents sig_item with +- | Types.Sig_module (id,Types.Mty_signature sign,_) +- | Types.Sig_modtype (id,Types.Modtype_manifest (Types.Mty_signature sign)) ++ | Types.Sig_module (id,{ Types.md_type = Types.Mty_signature sign },_) ++ | Types.Sig_modtype (id,{ Types.mtd_type = Some (Types.Mty_signature sign) }) + -> + let path = path @ [id.Ident.name] in + let children_comments = lazy ( +@@ -370,8 +384,12 @@ let rec trie_of_sig_item + | Some _, lazy (_, comments) -> comments + in + children, comments +- | Types.Sig_module (_,Types.Mty_ident sig_ident,_) +- | Types.Sig_modtype (_,Types.Modtype_manifest (Types.Mty_ident sig_ident)) -> ++ | Types.Sig_module (_,{ Types.md_type = ++ Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident},_) ++ | Types.Sig_modtype (_,{ Types.mtd_type = ++ Some ( Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident) }) -> + let sig_path = + let rec get_path = function + | Path.Pident id -> [id.Ident.name] +@@ -407,22 +425,26 @@ let rec trie_of_sig_item + | Types.Sig_class_type (id,{Types.clty_type=cty},_) + -> + let rec get_clsig = function +- | Types.Cty_constr (_,_,cty) | Types.Cty_fun (_,_,cty) -> ++ | Types.Cty_constr (_,_,cty) | Types.Cty_arrow (_,_,cty) -> + get_clsig cty + | Types.Cty_signature clsig -> clsig + in + let clsig = get_clsig cty in + let path = path@[id.Ident.name] in + let (fields, _) = +- Ctype.flatten_fields (Ctype.object_fields clsig.Types.cty_self) ++ Ctype.flatten_fields (Ctype.object_fields clsig.Types.csig_self) + in + lazy (List.fold_left (fun t (lbl,_,ty_expr) -> + if lbl = "*dummy method*" then t else + let _ = Printtyp.reset_and_mark_loops ty_expr in + let ty = Printtyp.tree_of_typexp false ty_expr in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in + Trie.add t (string_to_key lbl) + { path = path; +diff --git a/src/indexMisc.ml b/src/indexMisc.ml +index 2c171db..308af66 100644 +--- a/src/indexMisc.ml ++++ b/src/indexMisc.ml +@@ -52,12 +52,12 @@ let string_to_key s = + + let key_to_string l = + let rec aux n = function +- | [] -> String.create n ++ | [] -> Bytes.create n + | c::r -> + let s = aux (n+1) r in +- s.[n] <- if c = dot then '.' else c; s ++ Bytes.set s n (if c = dot then '.' else c); s + in +- aux 0 l ++ Bytes.to_string (aux 0 l) + + let modpath_to_key ?(enddot=true) path = + List.fold_right (fun p acc -> +@@ -65,15 +65,12 @@ let modpath_to_key ?(enddot=true) path = + string_to_key p @ acc) path [] + + let key_to_modpath l = +- let rec aux n = function +- | [] -> if n > 0 then [String.create n] else [] +- | '\000'::r -> String.create n :: aux 0 r +- | c::r -> +- match aux (n+1) r with +- | s::_ as p -> s.[n] <- c; p +- | [] -> assert false ++ let rec aux acc1 acc2 = function ++ | '\000'::r -> aux [] (acc1::acc2) r ++ | c::r -> aux (c::acc1) acc2 r ++ | [] -> if acc1 = [] then acc2 else acc1::acc2 + in +- aux 0 l ++ List.rev_map (fun l -> key_to_string (List.rev l)) (aux [] [] l) + + let modpath_to_string path = String.concat "." path + +diff --git a/src/indexOptions.ml b/src/indexOptions.ml +index d5b5d18..1854bf5 100644 +--- a/src/indexOptions.ml ++++ b/src/indexOptions.ml +@@ -37,7 +37,7 @@ let filter opt info = + let open LibIndex in + let kinds = opt.filter in + match info.kind with +- | Type -> kinds.t ++ | Type | OpenType -> kinds.t + | Value | Method _ -> kinds.v + | Exception -> kinds.e + | Field _ | Variant _ -> kinds.c +diff --git a/src/indexOut.ml b/src/indexOut.ml +index d95ec8b..9ea17db 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -57,7 +57,7 @@ module IndexFormat = struct + let color = + let f kind fstr fmt = + let colorcode = match kind with +- | Type -> "\027[36m" ++ | Type | OpenType -> "\027[36m" + | Value -> "\027[1m" + | Exception -> "\027[33m" + | Field _ | Variant _ -> "\027[34m" +@@ -88,6 +88,7 @@ module IndexFormat = struct + | Type -> Format.pp_print_string fmt "type" + | Value -> Format.pp_print_string fmt "val" + | Exception -> Format.pp_print_string fmt "exception" ++ | OpenType -> Format.pp_print_string fmt "opentype" + | Field parentty -> + Format.fprintf fmt "field(%a)" + (colorise.f parentty.kind "%s") parentty.name +@@ -154,20 +155,20 @@ module IndexFormat = struct + | Osig_class (_,_,_,ctyp,_) + | Osig_class_type (_,_,_,ctyp,_) -> + !Oprint.out_class_type fmt ctyp +- | Osig_exception (_,[]) -> ++ | Osig_typext ({ oext_args = [] }, _) -> + Format.pp_print_char fmt '-' +- | Osig_exception (_,tylst) -> ++ | Osig_typext ({ oext_args }, _) -> + list ~paren:true + !Oprint.out_type + (fun fmt () -> + Format.pp_print_char fmt ','; Format.pp_print_space fmt ()) + fmt +- tylst ++ oext_args + | Osig_modtype (_,mtyp) + | Osig_module (_,mtyp,_) -> + !Oprint.out_module_type fmt mtyp +- | Osig_type ((_,_,ty,_,_),_) -> +- Format.fprintf fmt "@[%a@]" tydecl ty ++ | Osig_type ({ otype_type },_) -> ++ Format.fprintf fmt "@[%a@]" tydecl otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty + +diff --git a/src/indexPredefined.ml b/src/indexPredefined.ml +index 5f493bf..0fe7729 100644 +--- a/src/indexPredefined.ml ++++ b/src/indexPredefined.ml +@@ -24,8 +24,11 @@ let mktype name ?(params=[]) ?(def=Otyp_abstract) doc = { + kind = Type; + name = name; + ty = Some (Osig_type ( +- (name,List.map (fun v -> v,(true,true)) params,def,Asttypes.Public,[]), +- Orec_not)); ++ { otype_name = name; ++ otype_params = List.map (fun v -> v,(true,true)) params; ++ otype_type = def; ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy (Some doc); +@@ -37,11 +40,13 @@ let mkvariant name parent params = { + orig_path = []; + kind = Variant parent; + name = name; +- ty = Some (Osig_type (("", [], +- (match params with [] -> Otyp_sum [] +- | l -> Otyp_tuple l), +- Asttypes.Public, []), +- Outcometree.Orec_not)); ++ ty = Some (Osig_type ( ++ { otype_name = ""; ++ otype_params = []; ++ otype_type = (match params with [] -> Otyp_sum [] ++ | l -> Otyp_tuple l); ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy None; +@@ -53,7 +58,13 @@ let mkexn name params doc = { + orig_path = []; + kind = Exception; + name = name; +- ty = Some (Osig_exception (name,params)); ++ ty = Some (Osig_typext ({ ++ oext_name = name; ++ oext_type_name = "exn"; ++ oext_type_params = []; ++ oext_args = params; ++ oext_ret_type = None; ++ oext_private = Asttypes.Public }, Oext_exception)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy (Some doc); +diff --git a/src/indexTypes.ml b/src/indexTypes.ml +index 252386b..e094317 100644 +--- a/src/indexTypes.ml ++++ b/src/indexTypes.ml +@@ -35,7 +35,7 @@ type info = { path: string list; + + (** The kind of elements that can be stored in the trie *) + and kind = +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/libIndex.mli b/src/libIndex.mli +index 9e7efa8..b826cf7 100644 +--- a/src/libIndex.mli ++++ b/src/libIndex.mli +@@ -40,7 +40,7 @@ type info = IndexTypes.info = private { + + (** The kind of elements that can be stored in the trie *) + and kind = IndexTypes.kind = private +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/ocp-index.ocp b/src/ocp-index.ocp +index d7f0fc9..47b1a55 100644 +--- a/src/ocp-index.ocp ++++ b/src/ocp-index.ocp +@@ -1,4 +1,5 @@ +-comp += [ "-g" "-w" "+1..39-4-9-37-40" ] ++comp += [ "-g" "-w" "+1..39-4-9-37-40" "-safe-string" ] ++link += [ "-g" "-w" "+1..39-4-9-37-40" ] + + begin library "ocp-index-lib" + sort = false diff --git a/patches/ocp-index/ocaml.4.02.patch.1.1.1 b/patches/ocp-index/ocaml.4.02.patch.1.1.1 new file mode 100644 index 0000000..77998a3 --- /dev/null +++ b/patches/ocp-index/ocaml.4.02.patch.1.1.1 @@ -0,0 +1,440 @@ +diff --git a/src/browserMain.ml b/src/browserMain.ml +index 3b277b7..6a201a7 100644 +--- a/src/browserMain.ml ++++ b/src/browserMain.ml +@@ -16,7 +16,7 @@ let rec eq l1 l2 = match l1, l2 with + let kind_to_tag, tag_to_style, register_ressource = + let h = Hashtbl.create 11 in + let kind_to_tag = function +- | LibIndex.Type -> "Type" ++ | LibIndex.Type | OpenType -> "Type" + | Value -> "Value" + | Exception -> "Exception" + | Field _ -> "Field" +diff --git a/src/grepMain.ml b/src/grepMain.ml +index 1493262..772704e 100644 +--- a/src/grepMain.ml ++++ b/src/grepMain.ml +@@ -82,8 +82,7 @@ end = struct + let ident path f ch = + let modname = + let s = Filename.basename (Filename.chop_extension f) in +- s.[0] <- Char.uppercase s.[0]; +- s ++ String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = + let lookfor = +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index aca5bff..139fa5b 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -131,8 +131,8 @@ let ty_of_sig_item = + function + | Types.Sig_value(id, decl) -> tree_of_value_description id decl + | Types.Sig_type(id, decl, rs) -> tree_of_type_declaration id decl rs +- | Types.Sig_exception(id, decl) -> tree_of_exception_declaration id decl +- | Types.Sig_module(id, mty, rs) -> tree_of_module id mty rs ++ | Types.Sig_typext(id, decl, es) -> tree_of_extension_constructor id decl es ++ | Types.Sig_module(id, { Types.md_type }, rs) -> tree_of_module id md_type rs + | Types.Sig_modtype(id, decl) -> tree_of_modtype_declaration id decl + | Types.Sig_class(id, decl, rs) -> tree_of_class_declaration id decl rs + | Types.Sig_class_type(id, decl, rs) -> tree_of_cltype_declaration id decl rs +@@ -205,6 +205,7 @@ let qualify_ty (parents:parents) ty = + | Otyp_poly (str, ty) -> Otyp_poly (str, aux ty) + | Otyp_module (str, strl, tylist) -> + Otyp_module (str, strl, List.map aux tylist) ++ | Otyp_open -> Otyp_open + in + aux ty + +@@ -212,11 +213,15 @@ let qualify_ty_in_sig_item (parents:parents) = + let qual = qualify_ty parents in + let open Outcometree in + function +- | Osig_type ((str, list, ty, priv, tylist2), rc) -> +- Osig_type ((str, list, qual ty, priv, +- List.map (fun (ty1,ty2) -> qual ty1, qual ty2) tylist2), rc) ++ | Osig_type (out_type_decl, rc) -> ++ Osig_type ({ out_type_decl with ++ otype_type = qual out_type_decl.otype_type; ++ otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) ++ out_type_decl.otype_cstrs }, rc) + | Osig_value (str, ty, str2) -> Osig_value (str, qual ty, str2) +- | Osig_exception (str, tylist) -> Osig_exception (str, List.map qual tylist) ++ | Osig_typext (constr, es) -> ++ Osig_typext ({ constr with ++ oext_args = List.map qual constr.oext_args }, es) + | out_sig -> out_sig (* don't get down in modules, classes and their types *) + + (* -- end -- *) +@@ -224,19 +229,16 @@ let qualify_ty_in_sig_item (parents:parents) = + let loc_of_sig_item = function + | Types.Sig_value (_,descr) -> descr.Types.val_loc + | Types.Sig_type (_,descr,_) -> descr.Types.type_loc +- | Types.Sig_exception (_,descr) -> descr.Types.exn_loc +- (* Sadly the Types tree doesn't contain locations for those. This means we +- won't associate comments easily either (todo...) *) +- | Types.Sig_module _ +- | Types.Sig_modtype _ +- | Types.Sig_class _ +- | Types.Sig_class_type _ +- -> Location.none ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_loc ++ | Types.Sig_module (_,descr,_) -> descr.Types.md_loc ++ | Types.Sig_modtype (_,descr) -> descr.Types.mtd_loc ++ | Types.Sig_class (_,descr,_) -> descr.Types.cty_loc ++ | Types.Sig_class_type (_,descr,_) -> descr.Types.clty_loc + + let id_of_sig_item = function + | Types.Sig_value (id,_) + | Types.Sig_type (id,_,_) +- | Types.Sig_exception (id,_) ++ | Types.Sig_typext (id,_,_) + | Types.Sig_module (id,_,_) + | Types.Sig_modtype (id,_) + | Types.Sig_class (id,_,_) +@@ -246,7 +248,8 @@ let id_of_sig_item = function + let kind_of_sig_item = function + | Types.Sig_value _ -> Value + | Types.Sig_type _ -> Type +- | Types.Sig_exception _ -> Exception ++ | Types.Sig_typext (_, _, Types.Text_exception) -> Exception ++ | Types.Sig_typext _ -> OpenType + | Types.Sig_module _ -> Module + | Types.Sig_modtype _ -> ModuleType + | Types.Sig_class _ -> Class +@@ -255,20 +258,25 @@ let kind_of_sig_item = function + let trie_of_type_decl ?comments info ty_decl = + match ty_decl.Types.type_kind with + | Types.Type_abstract -> [], comments ++ | Types.Type_open -> [], comments + | Types.Type_record (fields,_repr) -> + List.map +- (fun (id, _mutable, ty_expr) -> +- let ty = Printtyp.tree_of_typexp false ty_expr in ++ (fun { Types.ld_id; ld_type } -> ++ let ty = Printtyp.tree_of_typexp false ld_type in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key ld_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Field info; +- name = id.Ident.name; ++ name = ld_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -279,25 +287,29 @@ let trie_of_type_decl ?comments info ty_decl = + comments + | Types.Type_variant variants -> + List.map +- (fun (id, ty_exprs, _constraints) -> ++ (fun { Types.cd_id; cd_args } -> + let ty = +- let params = match ty_exprs with ++ let params = match cd_args with + | [] -> Outcometree.Otyp_sum [] + | param::_ -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple ty_exprs; ++ { Types. desc = Types.Ttuple cd_args; + level = param.Types.level; + id = param.Types.id } + in +- Outcometree.Osig_type +- (("", [], params, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = params; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key cd_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Variant info; +- name = id.Ident.name; ++ name = cd_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -353,19 +365,21 @@ let rec trie_of_sig_item + in + (* ignore functor arguments *) + let rec sig_item_contents = function +- | Types.Sig_module (id, Types.Mty_functor (_,_,s), is_rec) -> +- sig_item_contents (Types.Sig_module (id, s, is_rec)) ++ | Types.Sig_module ++ (id, ({Types.md_type = Types.Mty_functor (_,_,s)} as funct), is_rec) -> ++ let funct = {funct with Types.md_type = s} in ++ sig_item_contents (Types.Sig_module (id, funct, is_rec)) + | Types.Sig_modtype +- (id, Types.Modtype_manifest (Types.Mty_functor (_,_,s))) -> +- sig_item_contents +- (Types.Sig_modtype (id, Types.Modtype_manifest s)) ++ (id, ({Types.mtd_type = Some (Types.Mty_functor (_,_,s))} as funct)) -> ++ let funct = {funct with Types.mtd_type = Some s} in ++ sig_item_contents (Types.Sig_modtype (id, funct)) + | si -> si + in + (* read module / class contents *) + let children, comments = + match sig_item_contents sig_item with +- | Types.Sig_module (id,Types.Mty_signature sign,_) +- | Types.Sig_modtype (id,Types.Modtype_manifest (Types.Mty_signature sign)) ++ | Types.Sig_module (id,{ Types.md_type = Types.Mty_signature sign },_) ++ | Types.Sig_modtype (id,{ Types.mtd_type = Some (Types.Mty_signature sign) }) + -> + let path = path @ [id.Ident.name] in + let children_comments = lazy ( +@@ -385,8 +399,12 @@ let rec trie_of_sig_item + | Some _, lazy (_, comments) -> comments + in + children, comments +- | Types.Sig_module (_,Types.Mty_ident sig_ident,_) +- | Types.Sig_modtype (_,Types.Modtype_manifest (Types.Mty_ident sig_ident)) -> ++ | Types.Sig_module (_,{ Types.md_type = ++ Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident},_) ++ | Types.Sig_modtype (_,{ Types.mtd_type = ++ Some ( Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident) }) -> + let sig_path = + let rec get_path = function + | Path.Pident id -> [id.Ident.name] +@@ -422,22 +440,26 @@ let rec trie_of_sig_item + | Types.Sig_class_type (id,{Types.clty_type=cty},_) + -> + let rec get_clsig = function +- | Types.Cty_constr (_,_,cty) | Types.Cty_fun (_,_,cty) -> ++ | Types.Cty_constr (_,_,cty) | Types.Cty_arrow (_,_,cty) -> + get_clsig cty + | Types.Cty_signature clsig -> clsig + in + let clsig = get_clsig cty in + let path = path@[id.Ident.name] in + let (fields, _) = +- Ctype.flatten_fields (Ctype.object_fields clsig.Types.cty_self) ++ Ctype.flatten_fields (Ctype.object_fields clsig.Types.csig_self) + in + lazy (List.fold_left (fun t (lbl,_,ty_expr) -> + if lbl = "*dummy method*" then t else + let _ = Printtyp.reset_and_mark_loops ty_expr in + let ty = Printtyp.tree_of_typexp false ty_expr in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in + Trie.add t (string_to_key lbl) + { path = path; +diff --git a/src/indexMisc.ml b/src/indexMisc.ml +index f3231ce..929d431 100644 +--- a/src/indexMisc.ml ++++ b/src/indexMisc.ml +@@ -57,12 +57,12 @@ let string_to_key s = + + let key_to_string l = + let rec aux n = function +- | [] -> String.create n ++ | [] -> Bytes.create n + | c::r -> + let s = aux (n+1) r in +- s.[n] <- if c = dot then '.' else c; s ++ Bytes.set s n (if c = dot then '.' else c); s + in +- aux 0 l ++ Bytes.to_string (aux 0 l) + + let modpath_to_key ?(enddot=true) path = + List.fold_right (fun p acc -> +@@ -70,15 +70,12 @@ let modpath_to_key ?(enddot=true) path = + string_to_key p @ acc) path [] + + let key_to_modpath l = +- let rec aux n = function +- | [] -> if n > 0 then [String.create n] else [] +- | '\000'::r -> String.create n :: aux 0 r +- | c::r -> +- match aux (n+1) r with +- | s::_ as p -> s.[n] <- c; p +- | [] -> assert false ++ let rec aux acc1 acc2 = function ++ | '\000'::r -> aux [] (acc1::acc2) r ++ | c::r -> aux (c::acc1) acc2 r ++ | [] -> if acc1 = [] then acc2 else acc1::acc2 + in +- aux 0 l ++ List.rev_map (fun l -> key_to_string (List.rev l)) (aux [] [] l) + + let modpath_to_string path = String.concat "." path + +diff --git a/src/indexOptions.ml b/src/indexOptions.ml +index d5b5d18..1854bf5 100644 +--- a/src/indexOptions.ml ++++ b/src/indexOptions.ml +@@ -37,7 +37,7 @@ let filter opt info = + let open LibIndex in + let kinds = opt.filter in + match info.kind with +- | Type -> kinds.t ++ | Type | OpenType -> kinds.t + | Value | Method _ -> kinds.v + | Exception -> kinds.e + | Field _ | Variant _ -> kinds.c +diff --git a/src/indexOut.ml b/src/indexOut.ml +index d95ec8b..9ea17db 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -57,7 +57,7 @@ module IndexFormat = struct + let color = + let f kind fstr fmt = + let colorcode = match kind with +- | Type -> "\027[36m" ++ | Type | OpenType -> "\027[36m" + | Value -> "\027[1m" + | Exception -> "\027[33m" + | Field _ | Variant _ -> "\027[34m" +@@ -88,6 +88,7 @@ module IndexFormat = struct + | Type -> Format.pp_print_string fmt "type" + | Value -> Format.pp_print_string fmt "val" + | Exception -> Format.pp_print_string fmt "exception" ++ | OpenType -> Format.pp_print_string fmt "opentype" + | Field parentty -> + Format.fprintf fmt "field(%a)" + (colorise.f parentty.kind "%s") parentty.name +@@ -154,20 +155,20 @@ module IndexFormat = struct + | Osig_class (_,_,_,ctyp,_) + | Osig_class_type (_,_,_,ctyp,_) -> + !Oprint.out_class_type fmt ctyp +- | Osig_exception (_,[]) -> ++ | Osig_typext ({ oext_args = [] }, _) -> + Format.pp_print_char fmt '-' +- | Osig_exception (_,tylst) -> ++ | Osig_typext ({ oext_args }, _) -> + list ~paren:true + !Oprint.out_type + (fun fmt () -> + Format.pp_print_char fmt ','; Format.pp_print_space fmt ()) + fmt +- tylst ++ oext_args + | Osig_modtype (_,mtyp) + | Osig_module (_,mtyp,_) -> + !Oprint.out_module_type fmt mtyp +- | Osig_type ((_,_,ty,_,_),_) -> +- Format.fprintf fmt "@[%a@]" tydecl ty ++ | Osig_type ({ otype_type },_) -> ++ Format.fprintf fmt "@[%a@]" tydecl otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty + +diff --git a/src/indexPredefined.ml b/src/indexPredefined.ml +index 5f493bf..0fe7729 100644 +--- a/src/indexPredefined.ml ++++ b/src/indexPredefined.ml +@@ -24,8 +24,11 @@ let mktype name ?(params=[]) ?(def=Otyp_abstract) doc = { + kind = Type; + name = name; + ty = Some (Osig_type ( +- (name,List.map (fun v -> v,(true,true)) params,def,Asttypes.Public,[]), +- Orec_not)); ++ { otype_name = name; ++ otype_params = List.map (fun v -> v,(true,true)) params; ++ otype_type = def; ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy (Some doc); +@@ -37,11 +40,13 @@ let mkvariant name parent params = { + orig_path = []; + kind = Variant parent; + name = name; +- ty = Some (Osig_type (("", [], +- (match params with [] -> Otyp_sum [] +- | l -> Otyp_tuple l), +- Asttypes.Public, []), +- Outcometree.Orec_not)); ++ ty = Some (Osig_type ( ++ { otype_name = ""; ++ otype_params = []; ++ otype_type = (match params with [] -> Otyp_sum [] ++ | l -> Otyp_tuple l); ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy None; +@@ -53,7 +58,13 @@ let mkexn name params doc = { + orig_path = []; + kind = Exception; + name = name; +- ty = Some (Osig_exception (name,params)); ++ ty = Some (Osig_typext ({ ++ oext_name = name; ++ oext_type_name = "exn"; ++ oext_type_params = []; ++ oext_args = params; ++ oext_ret_type = None; ++ oext_private = Asttypes.Public }, Oext_exception)); + loc_sig = Location.none; + loc_impl = lazy Location.none; + doc = lazy (Some doc); +diff --git a/src/indexTypes.ml b/src/indexTypes.ml +index bbd1f9a..223e0c0 100644 +--- a/src/indexTypes.ml ++++ b/src/indexTypes.ml +@@ -35,7 +35,7 @@ type info = { path: string list; + + (** The kind of elements that can be stored in the trie *) + and kind = +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/libIndex.mli b/src/libIndex.mli +index 8572f90..e48f78b 100644 +--- a/src/libIndex.mli ++++ b/src/libIndex.mli +@@ -44,7 +44,7 @@ type info = IndexTypes.info = private { + + (** The kind of elements that can be stored in the trie *) + and kind = IndexTypes.kind = private +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/ocp-index.ocp b/src/ocp-index.ocp +index d7f0fc9..47b1a55 100644 +--- a/src/ocp-index.ocp ++++ b/src/ocp-index.ocp +@@ -1,4 +1,5 @@ +-comp += [ "-g" "-w" "+1..39-4-9-37-40" ] ++comp += [ "-g" "-w" "+1..39-4-9-37-40" "-safe-string" ] ++link += [ "-g" "-w" "+1..39-4-9-37-40" ] + + begin library "ocp-index-lib" + sort = false diff --git a/patches/ocp-index/ocaml.4.02.patch.1.1.2 b/patches/ocp-index/ocaml.4.02.patch.1.1.2 new file mode 100644 index 0000000..139cd34 --- /dev/null +++ b/patches/ocp-index/ocaml.4.02.patch.1.1.2 @@ -0,0 +1,734 @@ +diff --git a/src/browserMain.ml b/src/browserMain.ml +index 2bd5191..49065a9 100644 +--- a/src/browserMain.ml ++++ b/src/browserMain.ml +@@ -16,7 +16,7 @@ let rec eq l1 l2 = match l1, l2 with + let kind_to_tag, tag_to_style, register_ressource = + let h = Hashtbl.create 11 in + let kind_to_tag = function +- | LibIndex.Type -> "Type" ++ | LibIndex.Type | OpenType -> "Type" + | Value -> "Value" + | Exception -> "Exception" + | Field _ -> "Field" +diff --git a/src/grepMain.ml b/src/grepMain.ml +index ce2bb82..2103e3e 100644 +--- a/src/grepMain.ml ++++ b/src/grepMain.ml +@@ -85,8 +85,7 @@ end = struct + Filename.basename + (try Filename.chop_extension f with Invalid_argument _ -> f) + in +- s.[0] <- Char.uppercase s.[0]; +- s ++ String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = + let lookfor = +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index ac77d03..f640bd5 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -36,13 +36,13 @@ let orig_file_name = function + | Cmt f | Cmti f | Cmi f -> f + + let equal_kind k1 k2 = match k1,k2 with +- | Type,Type | Value,Value | Exception,Exception ++ | Type,Type | Value,Value | Exception,Exception | OpenType,OpenType + | Field _,Field _ | Variant _,Variant _ | Method _,Method _ + | Module,Module | ModuleType,ModuleType + | Class,Class | ClassType,ClassType + | Keyword,Keyword -> + true +- | Type,_ | Value,_ | Exception,_ ++ | Type,_ | Value,_ | Exception,_ | OpenType,_ + | Field _,_ | Variant _,_ | Method _,_ + | Module,_ | ModuleType,_ + | Class,_ | ClassType,_ +@@ -146,8 +146,8 @@ let ty_of_sig_item = + function + | Types.Sig_value(id, decl) -> tree_of_value_description id decl + | Types.Sig_type(id, decl, rs) -> tree_of_type_declaration id decl rs +- | Types.Sig_exception(id, decl) -> tree_of_exception_declaration id decl +- | Types.Sig_module(id, mty, rs) -> tree_of_module id mty rs ++ | Types.Sig_typext(id, decl, es) -> tree_of_extension_constructor id decl es ++ | Types.Sig_module(id, { Types.md_type }, rs) -> tree_of_module id md_type rs + | Types.Sig_modtype(id, decl) -> tree_of_modtype_declaration id decl + | Types.Sig_class(id, decl, rs) -> tree_of_class_declaration id decl rs + | Types.Sig_class_type(id, decl, rs) -> tree_of_cltype_declaration id decl rs +@@ -220,6 +220,7 @@ let qualify_ty (parents:parents) ty = + | Otyp_poly (str, ty) -> Otyp_poly (str, aux ty) + | Otyp_module (str, strl, tylist) -> + Otyp_module (str, strl, List.map aux tylist) ++ | Otyp_open -> Otyp_open + in + aux ty + +@@ -227,11 +228,15 @@ let qualify_ty_in_sig_item (parents:parents) = + let qual = qualify_ty parents in + let open Outcometree in + function +- | Osig_type ((str, list, ty, priv, tylist2), rc) -> +- Osig_type ((str, list, qual ty, priv, +- List.map (fun (ty1,ty2) -> qual ty1, qual ty2) tylist2), rc) ++ | Osig_type (out_type_decl, rc) -> ++ Osig_type ({ out_type_decl with ++ otype_type = qual out_type_decl.otype_type; ++ otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) ++ out_type_decl.otype_cstrs }, rc) + | Osig_value (str, ty, str2) -> Osig_value (str, qual ty, str2) +- | Osig_exception (str, tylist) -> Osig_exception (str, List.map qual tylist) ++ | Osig_typext (constr, es) -> ++ Osig_typext ({ constr with ++ oext_args = List.map qual constr.oext_args }, es) + | out_sig -> out_sig (* don't get down in modules, classes and their types *) + + (* -- end -- *) +@@ -239,19 +244,16 @@ let qualify_ty_in_sig_item (parents:parents) = + let loc_of_sig_item = function + | Types.Sig_value (_,descr) -> descr.Types.val_loc + | Types.Sig_type (_,descr,_) -> descr.Types.type_loc +- | Types.Sig_exception (_,descr) -> descr.Types.exn_loc +- (* Sadly the Types tree doesn't contain locations for those. This means we +- won't associate comments easily either (todo...) *) +- | Types.Sig_module _ +- | Types.Sig_modtype _ +- | Types.Sig_class _ +- | Types.Sig_class_type _ +- -> Location.none ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_loc ++ | Types.Sig_module (_,descr,_) -> descr.Types.md_loc ++ | Types.Sig_modtype (_,descr) -> descr.Types.mtd_loc ++ | Types.Sig_class (_,descr,_) -> descr.Types.cty_loc ++ | Types.Sig_class_type (_,descr,_) -> descr.Types.clty_loc + + let id_of_sig_item = function + | Types.Sig_value (id,_) + | Types.Sig_type (id,_,_) +- | Types.Sig_exception (id,_) ++ | Types.Sig_typext (id,_,_) + | Types.Sig_module (id,_,_) + | Types.Sig_modtype (id,_) + | Types.Sig_class (id,_,_) +@@ -261,7 +263,8 @@ let id_of_sig_item = function + let kind_of_sig_item = function + | Types.Sig_value _ -> Value + | Types.Sig_type _ -> Type +- | Types.Sig_exception _ -> Exception ++ | Types.Sig_typext (_, _, Types.Text_exception) -> Exception ++ | Types.Sig_typext _ -> OpenType + | Types.Sig_module _ -> Module + | Types.Sig_modtype _ -> ModuleType + | Types.Sig_class _ -> Class +@@ -270,20 +273,25 @@ let kind_of_sig_item = function + let trie_of_type_decl ?comments info ty_decl = + match ty_decl.Types.type_kind with + | Types.Type_abstract -> [], comments ++ | Types.Type_open -> [], comments + | Types.Type_record (fields,_repr) -> + List.map +- (fun (id, _mutable, ty_expr) -> +- let ty = Printtyp.tree_of_typexp false ty_expr in ++ (fun { Types.ld_id; ld_type } -> ++ let ty = Printtyp.tree_of_typexp false ld_type in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key ld_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Field info; +- name = id.Ident.name; ++ name = ld_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -294,25 +302,29 @@ let trie_of_type_decl ?comments info ty_decl = + comments + | Types.Type_variant variants -> + List.map +- (fun (id, ty_exprs, _constraints) -> ++ (fun { Types.cd_id; cd_args } -> + let ty = +- let params = match ty_exprs with ++ let params = match cd_args with + | [] -> Outcometree.Otyp_sum [] + | param::_ -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple ty_exprs; ++ { Types. desc = Types.Ttuple cd_args; + level = param.Types.level; + id = param.Types.id } + in +- Outcometree.Osig_type +- (("", [], params, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = params; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ string_to_key cd_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Variant info; +- name = id.Ident.name; ++ name = cd_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +@@ -322,6 +334,36 @@ let trie_of_type_decl ?comments info ty_decl = + variants, + comments + ++(** Implements looking up a module path in the parents list *) ++let lookup_parents (parents:parents) path sig_path = ++ let sig_key, path_key = match sig_path with ++ | hd::tl -> ++ modpath_to_key [hd], modpath_to_key tl ++ | [] -> assert false ++ in ++ let rec lookup = function ++ | [] -> ++ if debug_enabled then ++ debug "WARN: Module or sig reference %s not found a %s\n" ++ (modpath_to_string sig_path) ++ (modpath_to_string path); ++ Trie.empty ++ | (parentpath, lazy t) :: parents -> ++ let s = Trie.sub t sig_key in ++ if s = Trie.empty then lookup parents else ++ let s = Trie.sub s path_key in ++ let rewrite_path = ++ fix_path_prefix (List.length parentpath + List.length sig_path) path ++ in ++ Trie.map (fun _k v -> rewrite_path v) s ++ in ++ lookup parents ++ ++let rec path_of_ocaml = function ++ | Path.Pident id -> [id.Ident.name] ++ | Path.Pdot (path, s, _) -> path_of_ocaml path @ [s] ++ | Path.Papply (p1, _p2) -> path_of_ocaml p1 ++ + let rec trie_of_sig_item + ?comments implloc_trie (parents:parents) (orig_file:orig_file) path + sig_item next +@@ -368,19 +410,21 @@ let rec trie_of_sig_item + in + (* ignore functor arguments *) + let rec sig_item_contents = function +- | Types.Sig_module (id, Types.Mty_functor (_,_,s), is_rec) -> +- sig_item_contents (Types.Sig_module (id, s, is_rec)) ++ | Types.Sig_module ++ (id, ({Types.md_type = Types.Mty_functor (_,_,s)} as funct), is_rec) -> ++ let funct = {funct with Types.md_type = s} in ++ sig_item_contents (Types.Sig_module (id, funct, is_rec)) + | Types.Sig_modtype +- (id, Types.Modtype_manifest (Types.Mty_functor (_,_,s))) -> +- sig_item_contents +- (Types.Sig_modtype (id, Types.Modtype_manifest s)) ++ (id, ({Types.mtd_type = Some (Types.Mty_functor (_,_,s))} as funct)) -> ++ let funct = {funct with Types.mtd_type = Some s} in ++ sig_item_contents (Types.Sig_modtype (id, funct)) + | si -> si + in + (* read module / class contents *) + let children, comments = + match sig_item_contents sig_item with +- | Types.Sig_module (id,Types.Mty_signature sign,_) +- | Types.Sig_modtype (id,Types.Modtype_manifest (Types.Mty_signature sign)) ++ | Types.Sig_module (id,{ Types.md_type = Types.Mty_signature sign },_) ++ | Types.Sig_modtype (id,{ Types.mtd_type = Some (Types.Mty_signature sign) }) + -> + let path = path @ [id.Ident.name] in + let children_comments = lazy ( +@@ -400,64 +444,43 @@ let rec trie_of_sig_item + | Some _, lazy (_, comments) -> comments + in + children, comments +- | Types.Sig_module (_,Types.Mty_ident sig_ident,_) +- | Types.Sig_modtype (_,Types.Modtype_manifest (Types.Mty_ident sig_ident)) -> +- let sig_path = +- let rec get_path = function +- | Path.Pident id -> [id.Ident.name] +- | Path.Pdot (path, s, _) -> get_path path @ [s] +- | Path.Papply (p1, _p2) -> get_path p1 +- in +- get_path sig_ident +- in +- let sig_key, path_key = match sig_path with +- | hd::tl -> +- modpath_to_key [hd], modpath_to_key tl +- | [] -> assert false +- in +- let rec lookup = function +- | [] -> +- if debug_enabled then +- debug "WARN: Module or sig reference %s not found a %s\n" +- (modpath_to_string sig_path) +- (modpath_to_string (path@[id.Ident.name])); +- Trie.empty +- | (parentpath, lazy t) :: parents -> +- let s = Trie.sub t sig_key in +- if s = Trie.empty then lookup parents else +- let s = Trie.sub s path_key in +- let rewrite_path = +- fix_path_prefix +- (List.length parentpath + List.length sig_path) +- (path @ [id.Ident.name]) +- in +- Trie.map (fun _k v -> rewrite_path v) s +- in ++ | Types.Sig_module (_,{ Types.md_type = ++ Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident},_) ++ | Types.Sig_modtype (_,{ Types.mtd_type = ++ Some ( Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident) }) -> ++ let sig_path = path_of_ocaml sig_ident in + let children = lazy ( + (* Only keep the children, don't override the module reference *) +- Trie.graft_lazy Trie.empty [] (lazy (lookup parents)) ++ Trie.graft_lazy Trie.empty [] ++ (lazy (lookup_parents parents (path@[id.Ident.name]) sig_path)) + ) in + children, comments + | Types.Sig_class (id,{Types.cty_type=cty},_) + | Types.Sig_class_type (id,{Types.clty_type=cty},_) + -> + let rec get_clsig = function +- | Types.Cty_constr (_,_,cty) | Types.Cty_fun (_,_,cty) -> ++ | Types.Cty_constr (_,_,cty) | Types.Cty_arrow (_,_,cty) -> + get_clsig cty + | Types.Cty_signature clsig -> clsig + in + let clsig = get_clsig cty in + let path = path@[id.Ident.name] in + let (fields, _) = +- Ctype.flatten_fields (Ctype.object_fields clsig.Types.cty_self) ++ Ctype.flatten_fields (Ctype.object_fields clsig.Types.csig_self) + in + lazy (List.fold_left (fun t (lbl,_,ty_expr) -> + if lbl = "*dummy method*" then t else + let _ = Printtyp.reset_and_mark_loops ty_expr in + let ty = Printtyp.tree_of_typexp false ty_expr in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in + Trie.add t (string_to_key lbl) + { path = path; +@@ -486,6 +509,139 @@ let rec trie_of_sig_item + :: siblings, + comments + ++ ++(* These four functions go through the typedtree to extract includes *) ++let rec lookup_trie_of_module_expr parents t path = function ++ | Typedtree.Tmod_ident (incpath,{ Location.txt = _lid}) -> ++ let incpath = path_of_ocaml incpath in ++ debug "Including %s impl at %s\n" (modpath_to_string incpath) (modpath_to_string path); ++ let parents = (path, lazy t) :: parents in ++ let sub = lookup_parents parents path incpath in ++ overriding_merge t sub ++ | Typedtree.Tmod_constraint (e,_,_,_) ++ (* | Typedtree.Tmod_apply (e,_,_) *) -> ++ lookup_trie_of_module_expr parents t path e.mod_desc ++ | Typedtree.Tmod_apply ({ mod_desc = Typedtree.Tmod_functor(id,_,_,f) }, ++ { mod_desc = Typedtree.Tmod_ident (arg,_) ++ | Typedtree.Tmod_constraint ({mod_desc = Typedtree.Tmod_ident (arg,_)},_,_,_) },_) -> ++ let t = lookup_trie_of_module_expr parents t path f.Typedtree.mod_desc in ++ debug "Grafting %s at %s\n" id.Ident.name (modpath_to_string (path_of_ocaml arg)); ++ let functor_arg = lazy (lookup_parents parents (path_of_ocaml arg) path) in ++ Trie.graft_lazy t (modpath_to_key [id.Ident.name]) functor_arg ++ | _ -> t ++let rec extract_includes_from_submodule_sig parents t path name = function ++ | Typedtree.Tmty_signature sign -> ++ let path = path @ [name] in ++ let sub_includes = lazy ( ++ get_includes_sig ((path, lazy t) :: parents) ++ (Trie.sub t (modpath_to_key [name])) path sign ++ ) in ++ Trie.graft_lazy t (modpath_to_key [name]) sub_includes ++ | Typedtree.Tmty_functor (_,_,_,e) ++ | Typedtree.Tmty_with (e,_) -> ++ extract_includes_from_submodule_sig parents t path name e.Typedtree.mty_desc ++ | _ -> t ++and get_includes_impl parents t path ttree_struct = ++ let rec extract_submodule_impl t name = function ++ | Typedtree.Tmod_structure str -> ++ let path = path @ [name] in ++ let sub_includes = lazy ( ++ get_includes_impl ((path, lazy t) :: parents) ++ (Trie.sub t (modpath_to_key [name])) path str ++ ) in ++ Trie.graft_lazy t (modpath_to_key [name]) sub_includes ++ (* | Typedtree.Tmod_functor (arg_id,_,arg_t,e) *) ++ | Typedtree.Tmod_apply ({ mod_desc = Typedtree.Tmod_functor(id,_,_,f) }, ++ { mod_desc = Typedtree.Tmod_ident (arg,_) ++ | Typedtree.Tmod_constraint ({mod_desc = Typedtree.Tmod_ident (arg,_)},_,_,_) },_) -> ++ debug "Grafting %s at %s\n" id.Ident.name (modpath_to_string (path_of_ocaml arg)); ++ let functor_arg = lazy ( ++ lookup_parents ++ ((path, lazy t)::parents) (path_of_ocaml arg) (path@[name]) ++ ) in ++ extract_submodule_impl ++ (Trie.graft_lazy t (modpath_to_key [id.Ident.name]) functor_arg) ++ name f.Typedtree.mod_desc ++ | Typedtree.Tmod_functor (_,_,_,e) ++ | Typedtree.Tmod_constraint (e,_,_,_) -> ++ extract_submodule_impl t name e.Typedtree.mod_desc ++ | _ -> t ++ in ++ List.fold_left (fun t struc_item -> ++ match struc_item.Typedtree.str_desc with ++ | Typedtree.Tstr_include ++ { Typedtree.incl_mod = { Typedtree.mod_desc = e }} -> ++ lookup_trie_of_module_expr parents t path e ++ | Typedtree.Tstr_open ++ { Typedtree.open_path = p } -> ++ let sub = lookup_parents ((path, lazy t) :: parents) path (path_of_ocaml p) in ++ overriding_merge t sub ++ | Typedtree.Tstr_module ++ { Typedtree.mb_id = id; mb_expr = { Typedtree.mod_desc } } -> ++ extract_submodule_impl t id.Ident.name mod_desc ++ | Typedtree.Tstr_recmodule l -> ++ List.fold_left ++ (fun t { Typedtree.mb_id; mb_expr = { Typedtree.mod_desc } } -> ++ extract_submodule_impl t mb_id.Ident.name mod_desc) ++ t l ++ | Typedtree.Tstr_modtype ++ { Typedtree.mtd_id = id; mtd_type = Some { Typedtree.mty_desc = e } } -> ++ extract_includes_from_submodule_sig parents t path id.Ident.name e ++ | _ -> t) ++ t ttree_struct.Typedtree.str_items ++and get_includes_sig parents t path ttree_sig = ++ let rec extract_includes t = function ++ | Typedtree.Tmty_ident (incpath,_) -> ++ let incpath = path_of_ocaml incpath in ++ debug "Including %s sig at %s\n" (modpath_to_string incpath) (modpath_to_string path); ++ let parents = (path, lazy t) :: parents in ++ let sub = lookup_parents parents path incpath in ++ overriding_merge t sub ++ | Typedtree.Tmty_with (e,_) -> ++ extract_includes t e.Typedtree.mty_desc ++ | Typedtree.Tmty_typeof e -> ++ lookup_trie_of_module_expr parents t path ++ e.Typedtree.mod_desc ++ | _ -> t ++ in ++ List.fold_left (fun t sig_item -> ++ match sig_item.Typedtree.sig_desc with ++ | Typedtree.Tsig_include ++ { Typedtree.incl_mod = { Typedtree.mty_desc = e }} -> ++ extract_includes t e ++ | Typedtree.Tsig_module ++ { Typedtree.md_id = id ; md_type = { Typedtree.mty_desc } } ++ | Typedtree.Tsig_modtype ++ { Typedtree.mtd_id = id; mtd_type = Some { Typedtree.mty_desc } } -> ++ extract_includes_from_submodule_sig parents t path ++ id.Ident.name mty_desc ++ | Typedtree.Tsig_recmodule l -> ++ List.fold_left ++ (fun t { Typedtree.md_id; md_type = { Typedtree.mty_desc } } -> ++ extract_includes_from_submodule_sig parents t path ++ md_id.Ident.name mty_desc) ++ t l ++ | _ -> t) ++ t ttree_sig.Typedtree.sig_items ++ ++let add_locs ~locs t = ++ Trie.map (fun path info -> ++ let loc_info = lazy ( ++ List.find (has_kind info.kind) (Trie.find_all locs path) ++ ) in ++ let lookup fld none = ++ let loc = Lazy.force (fld info) in ++ if loc = none ++ then try Lazy.force (fld (Lazy.force loc_info)) with Not_found -> none ++ else loc ++ in ++ { info with ++ loc_sig = lazy (lookup (fun i -> i.loc_sig) Location.none); ++ loc_impl = lazy (lookup (fun i -> i.loc_impl) Location.none); ++ doc = lazy (lookup (fun i -> i.doc) None); ++ } ++ ) t ++ + (* Can work in a subtree (t doesn't have to be the root) *) + let qualify_type_idents parents t = + let qualify _key id = +@@ -524,6 +680,14 @@ let cmt_sign cmt_contents = + -> Some sign + | _ -> None + ++let cmt_includes parents t path cmt_contents = ++ match cmt_contents.Cmt_format.cmt_annots with ++ | Cmt_format.Implementation impl -> ++ get_includes_impl parents t path impl ++ | Cmt_format.Interface sign -> ++ get_includes_sig parents t path sign ++ | _ -> Trie.empty ++ + let protect_read reader f = + try reader f with + | Cmt_format.Error _ | Cmi_format.Error _ -> +@@ -539,7 +703,7 @@ let lookup_loc_impl orig_file = + if not (Sys.file_exists cmt) then None else Some cmt + + let load_loc_impl parents filename cmt_contents = +- debug "Registering %s (for implementation locations)..." filename; ++ debug " -Registering %s (for implementation locations)..." filename; + let chrono = timer () in + match cmt_sign cmt_contents with + | Some sign -> +@@ -555,6 +719,8 @@ let load_loc_impl parents filename cmt_contents = + sign + in + debug " %.3fs\n%!" (chrono()); ++ let includes = cmt_includes parents t [] cmt_contents in ++ let t = add_locs ~locs:includes t in + Some t + | _ -> + debug " %.3fs\n%!" (chrono()); +@@ -582,7 +748,7 @@ let load_cmi ?(qualify=false) root t modul orig_file = + ) in + let children = lazy ( + let info = Lazy.force info in +- debug "Registering %s..." file; ++ debug " -Registering %s..." file; + let chrono = timer () in + let rec implloc_trie = lazy ( + match Lazy.force impl_cmt with +@@ -649,7 +815,7 @@ let load_cmt ?(qualify=false) root t modul orig_file = + ) in + let children = lazy ( + let info = Lazy.force info in +- debug "Registering %s..." cmt_file; ++ debug " -Registering %s..." cmt_file; + let chrono = timer () in + let comments = Some (Lazy.from_val info.Cmt_format.cmt_comments) in + let rec implloc_trie = lazy ( +@@ -679,6 +845,13 @@ let load_cmt ?(qualify=false) root t modul orig_file = + debug " %.3fs\n%!" (chrono()); + t + ) in ++ let children = lazy ( ++ let includes = ++ cmt_includes [[modul], children; [], root] ++ t [] (Lazy.force info) ++ in ++ add_locs ~locs:includes (Lazy.force children) ++ ) in + let loc_sig, loc_impl = + let of_info i = match i.Cmt_format.cmt_sourcefile with + | Some f -> Location.in_file f +diff --git a/src/indexMisc.ml b/src/indexMisc.ml +index f3231ce..929d431 100644 +--- a/src/indexMisc.ml ++++ b/src/indexMisc.ml +@@ -57,12 +57,12 @@ let string_to_key s = + + let key_to_string l = + let rec aux n = function +- | [] -> String.create n ++ | [] -> Bytes.create n + | c::r -> + let s = aux (n+1) r in +- s.[n] <- if c = dot then '.' else c; s ++ Bytes.set s n (if c = dot then '.' else c); s + in +- aux 0 l ++ Bytes.to_string (aux 0 l) + + let modpath_to_key ?(enddot=true) path = + List.fold_right (fun p acc -> +@@ -70,15 +70,12 @@ let modpath_to_key ?(enddot=true) path = + string_to_key p @ acc) path [] + + let key_to_modpath l = +- let rec aux n = function +- | [] -> if n > 0 then [String.create n] else [] +- | '\000'::r -> String.create n :: aux 0 r +- | c::r -> +- match aux (n+1) r with +- | s::_ as p -> s.[n] <- c; p +- | [] -> assert false ++ let rec aux acc1 acc2 = function ++ | '\000'::r -> aux [] (acc1::acc2) r ++ | c::r -> aux (c::acc1) acc2 r ++ | [] -> if acc1 = [] then acc2 else acc1::acc2 + in +- aux 0 l ++ List.rev_map (fun l -> key_to_string (List.rev l)) (aux [] [] l) + + let modpath_to_string path = String.concat "." path + +diff --git a/src/indexOptions.ml b/src/indexOptions.ml +index d5b5d18..1854bf5 100644 +--- a/src/indexOptions.ml ++++ b/src/indexOptions.ml +@@ -37,7 +37,7 @@ let filter opt info = + let open LibIndex in + let kinds = opt.filter in + match info.kind with +- | Type -> kinds.t ++ | Type | OpenType -> kinds.t + | Value | Method _ -> kinds.v + | Exception -> kinds.e + | Field _ | Variant _ -> kinds.c +diff --git a/src/indexOut.ml b/src/indexOut.ml +index 46e45e2..bf22816 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -57,7 +57,7 @@ module IndexFormat = struct + let color = + let f kind fstr fmt = + let colorcode = match kind with +- | Type -> "\027[36m" ++ | Type | OpenType -> "\027[36m" + | Value -> "\027[1m" + | Exception -> "\027[33m" + | Field _ | Variant _ -> "\027[34m" +@@ -88,6 +88,7 @@ module IndexFormat = struct + | Type -> Format.pp_print_string fmt "type" + | Value -> Format.pp_print_string fmt "val" + | Exception -> Format.pp_print_string fmt "exception" ++ | OpenType -> Format.pp_print_string fmt "opentype" + | Field parentty -> + Format.fprintf fmt "field(%a)" + (colorise.f parentty.kind "%s") parentty.name +@@ -159,20 +160,20 @@ module IndexFormat = struct + | Osig_class (_,_,_,ctyp,_) + | Osig_class_type (_,_,_,ctyp,_) -> + !Oprint.out_class_type fmt ctyp +- | Osig_exception (_,[]) -> ++ | Osig_typext ({ oext_args = [] }, _) -> + Format.pp_print_char fmt '-' +- | Osig_exception (_,tylst) -> ++ | Osig_typext ({ oext_args }, _) -> + list ~paren:true + !Oprint.out_type + (fun fmt () -> + Format.pp_print_char fmt ','; Format.pp_print_space fmt ()) + fmt +- tylst ++ oext_args + | Osig_modtype (_,mtyp) + | Osig_module (_,mtyp,_) -> + !Oprint.out_module_type fmt mtyp +- | Osig_type ((_,_,ty,_,_),_) -> +- tydecl fmt ty ++ | Osig_type ({ otype_type },_) -> ++ tydecl fmt otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty + +diff --git a/src/indexPredefined.ml b/src/indexPredefined.ml +index 1e994d0..974adf3 100644 +--- a/src/indexPredefined.ml ++++ b/src/indexPredefined.ml +@@ -24,8 +24,11 @@ let mktype name ?(params=[]) ?(def=Otyp_abstract) doc = { + kind = Type; + name = name; + ty = Some (Osig_type ( +- (name,List.map (fun v -> v,(true,true)) params,def,Asttypes.Public,[]), +- Orec_not)); ++ { otype_name = name; ++ otype_params = List.map (fun v -> v,(true,true)) params; ++ otype_type = def; ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val (Some doc); +@@ -37,11 +40,13 @@ let mkvariant name parent params = { + orig_path = []; + kind = Variant parent; + name = name; +- ty = Some (Osig_type (("", [], +- (match params with [] -> Otyp_sum [] +- | l -> Otyp_tuple l), +- Asttypes.Public, []), +- Outcometree.Orec_not)); ++ ty = Some (Osig_type ( ++ { otype_name = ""; ++ otype_params = []; ++ otype_type = (match params with [] -> Otyp_sum [] ++ | l -> Otyp_tuple l); ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val None; +@@ -53,7 +58,13 @@ let mkexn name params doc = { + orig_path = []; + kind = Exception; + name = name; +- ty = Some (Osig_exception (name,params)); ++ ty = Some (Osig_typext ({ ++ oext_name = name; ++ oext_type_name = "exn"; ++ oext_type_params = []; ++ oext_args = params; ++ oext_ret_type = None; ++ oext_private = Asttypes.Public }, Oext_exception)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val (Some doc); +diff --git a/src/indexTypes.ml b/src/indexTypes.ml +index cb1ee67..342f86f 100644 +--- a/src/indexTypes.ml ++++ b/src/indexTypes.ml +@@ -35,7 +35,7 @@ type info = { path: string list; + + (** The kind of elements that can be stored in the trie *) + and kind = +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/libIndex.mli b/src/libIndex.mli +index d71b99b..9e27b1c 100644 +--- a/src/libIndex.mli ++++ b/src/libIndex.mli +@@ -44,7 +44,7 @@ type info = IndexTypes.info = private { + + (** The kind of elements that can be stored in the trie *) + and kind = IndexTypes.kind = private +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/ocp-index.ocp b/src/ocp-index.ocp +index d7f0fc9..47b1a55 100644 +--- a/src/ocp-index.ocp ++++ b/src/ocp-index.ocp +@@ -1,4 +1,5 @@ +-comp += [ "-g" "-w" "+1..39-4-9-37-40" ] ++comp += [ "-g" "-w" "+1..39-4-9-37-40" "-safe-string" ] ++link += [ "-g" "-w" "+1..39-4-9-37-40" ] + + begin library "ocp-index-lib" + sort = false diff --git a/patches/ocp-index/ocaml.4.02.patch.1.1.3 b/patches/ocp-index/ocaml.4.02.patch.1.1.3 new file mode 100644 index 0000000..5be9ec9 --- /dev/null +++ b/patches/ocp-index/ocaml.4.02.patch.1.1.3 @@ -0,0 +1,808 @@ +diff --git a/opam b/opam +index 3a9a458..7c58305 100644 +--- a/opam ++++ b/opam +@@ -13,7 +13,7 @@ tags: [ + "org:ocamlpro" + "org:typerex" + ] +-dev-repo: "https://github.com/OCamlPro/ocp-index.git" ++dev-repo: "https://github.com/OCamlPro/ocp-index.git#4.02" + build: [ + ["./configure" "--prefix" prefix] + [make] +@@ -26,7 +26,7 @@ depends: [ + ] + depopts: "lambda-term" + conflicts: "lambda-term" {< "1.7"} +-available: [ocaml-version >= "4.01.0" & ocaml-version < "4.02"] ++available: [ocaml-version >= "4.02.0" & ocaml-version < "4.03"] + messages: "For ocp-browser, please also install package lambda-term" {! lambda-term:installed} + post-messages: + "This package requires additional configuration for use in editors. Either install package 'user-setup', or manually: +diff --git a/src/browserMain.ml b/src/browserMain.ml +index 2bd5191..49065a9 100644 +--- a/src/browserMain.ml ++++ b/src/browserMain.ml +@@ -16,7 +16,7 @@ let rec eq l1 l2 = match l1, l2 with + let kind_to_tag, tag_to_style, register_ressource = + let h = Hashtbl.create 11 in + let kind_to_tag = function +- | LibIndex.Type -> "Type" ++ | LibIndex.Type | OpenType -> "Type" + | Value -> "Value" + | Exception -> "Exception" + | Field _ -> "Field" +diff --git a/src/grepMain.ml b/src/grepMain.ml +index a37cc77..88b2fa9 100644 +--- a/src/grepMain.ml ++++ b/src/grepMain.ml +@@ -85,8 +85,7 @@ end = struct + Filename.basename + (try Filename.chop_extension f with Invalid_argument _ -> f) + in +- s.[0] <- Char.uppercase s.[0]; +- s ++ String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = + let lookfor = +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index ac77d03..cf914c0 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -36,13 +36,13 @@ let orig_file_name = function + | Cmt f | Cmti f | Cmi f -> f + + let equal_kind k1 k2 = match k1,k2 with +- | Type,Type | Value,Value | Exception,Exception ++ | Type,Type | Value,Value | Exception,Exception | OpenType,OpenType + | Field _,Field _ | Variant _,Variant _ | Method _,Method _ + | Module,Module | ModuleType,ModuleType + | Class,Class | ClassType,ClassType + | Keyword,Keyword -> + true +- | Type,_ | Value,_ | Exception,_ ++ | Type,_ | Value,_ | Exception,_ | OpenType,_ + | Field _,_ | Variant _,_ | Method _,_ + | Module,_ | ModuleType,_ + | Class,_ | ClassType,_ +@@ -146,8 +146,8 @@ let ty_of_sig_item = + function + | Types.Sig_value(id, decl) -> tree_of_value_description id decl + | Types.Sig_type(id, decl, rs) -> tree_of_type_declaration id decl rs +- | Types.Sig_exception(id, decl) -> tree_of_exception_declaration id decl +- | Types.Sig_module(id, mty, rs) -> tree_of_module id mty rs ++ | Types.Sig_typext(id, decl, es) -> tree_of_extension_constructor id decl es ++ | Types.Sig_module(id, { Types.md_type }, rs) -> tree_of_module id md_type rs + | Types.Sig_modtype(id, decl) -> tree_of_modtype_declaration id decl + | Types.Sig_class(id, decl, rs) -> tree_of_class_declaration id decl rs + | Types.Sig_class_type(id, decl, rs) -> tree_of_cltype_declaration id decl rs +@@ -220,6 +220,7 @@ let qualify_ty (parents:parents) ty = + | Otyp_poly (str, ty) -> Otyp_poly (str, aux ty) + | Otyp_module (str, strl, tylist) -> + Otyp_module (str, strl, List.map aux tylist) ++ | Otyp_open -> Otyp_open + in + aux ty + +@@ -227,11 +228,15 @@ let qualify_ty_in_sig_item (parents:parents) = + let qual = qualify_ty parents in + let open Outcometree in + function +- | Osig_type ((str, list, ty, priv, tylist2), rc) -> +- Osig_type ((str, list, qual ty, priv, +- List.map (fun (ty1,ty2) -> qual ty1, qual ty2) tylist2), rc) ++ | Osig_type (out_type_decl, rc) -> ++ Osig_type ({ out_type_decl with ++ otype_type = qual out_type_decl.otype_type; ++ otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) ++ out_type_decl.otype_cstrs }, rc) + | Osig_value (str, ty, str2) -> Osig_value (str, qual ty, str2) +- | Osig_exception (str, tylist) -> Osig_exception (str, List.map qual tylist) ++ | Osig_typext (constr, es) -> ++ Osig_typext ({ constr with ++ oext_args = List.map qual constr.oext_args }, es) + | out_sig -> out_sig (* don't get down in modules, classes and their types *) + + (* -- end -- *) +@@ -239,19 +244,16 @@ let qualify_ty_in_sig_item (parents:parents) = + let loc_of_sig_item = function + | Types.Sig_value (_,descr) -> descr.Types.val_loc + | Types.Sig_type (_,descr,_) -> descr.Types.type_loc +- | Types.Sig_exception (_,descr) -> descr.Types.exn_loc +- (* Sadly the Types tree doesn't contain locations for those. This means we +- won't associate comments easily either (todo...) *) +- | Types.Sig_module _ +- | Types.Sig_modtype _ +- | Types.Sig_class _ +- | Types.Sig_class_type _ +- -> Location.none ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_loc ++ | Types.Sig_module (_,descr,_) -> descr.Types.md_loc ++ | Types.Sig_modtype (_,descr) -> descr.Types.mtd_loc ++ | Types.Sig_class (_,descr,_) -> descr.Types.cty_loc ++ | Types.Sig_class_type (_,descr,_) -> descr.Types.clty_loc + + let id_of_sig_item = function + | Types.Sig_value (id,_) + | Types.Sig_type (id,_,_) +- | Types.Sig_exception (id,_) ++ | Types.Sig_typext (id,_,_) + | Types.Sig_module (id,_,_) + | Types.Sig_modtype (id,_) + | Types.Sig_class (id,_,_) +@@ -261,67 +263,129 @@ let id_of_sig_item = function + let kind_of_sig_item = function + | Types.Sig_value _ -> Value + | Types.Sig_type _ -> Type +- | Types.Sig_exception _ -> Exception ++ | Types.Sig_typext (_, _, Types.Text_exception) -> Exception ++ | Types.Sig_typext _ -> OpenType + | Types.Sig_module _ -> Module + | Types.Sig_modtype _ -> ModuleType + | Types.Sig_class _ -> Class + | Types.Sig_class_type _ -> ClassType + ++let attrs_of_sig_item = function ++ | Types.Sig_value (_,descr) -> descr.Types.val_attributes ++ | Types.Sig_type (_,descr,_) -> descr.Types.type_attributes ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_attributes ++ | Types.Sig_module (_,descr,_) -> descr.Types.md_attributes ++ | Types.Sig_modtype (_,descr) -> descr.Types.mtd_attributes ++ | Types.Sig_class (_,descr,_) -> descr.Types.cty_attributes ++ | Types.Sig_class_type (_,descr,_) -> descr.Types.clty_attributes ++ ++let doc_of_attributes attrs = ++ let doc_loc_id = "ocaml.doc" in (* not exported ! *) ++ let open Parsetree in ++ match List.find (fun ({Location.txt},_) -> txt = doc_loc_id) attrs with ++ | _, PStr [{pstr_desc = Pstr_eval ({pexp_desc},_)}] -> ++ (match pexp_desc with ++ | Pexp_constant (Const_string (s,_)) -> Some s ++ | _ -> debug "Unexpected ocaml.doc docstring format"; None) ++ | _ -> None ++ | exception Not_found -> None ++ + let trie_of_type_decl ?comments info ty_decl = + match ty_decl.Types.type_kind with + | Types.Type_abstract -> [], comments ++ | Types.Type_open -> [], comments + | Types.Type_record (fields,_repr) -> + List.map +- (fun (id, _mutable, ty_expr) -> +- let ty = Printtyp.tree_of_typexp false ty_expr in ++ (fun { Types.ld_id; ld_type; ld_attributes } -> ++ let ty = Printtyp.tree_of_typexp false ld_type in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ let doc = doc_of_attributes ld_attributes in ++ string_to_key ld_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Field info; +- name = id.Ident.name; ++ name = ld_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +- doc = lazy None; ++ doc = lazy doc; + file = info.file; + } ()) + fields, + comments + | Types.Type_variant variants -> + List.map +- (fun (id, ty_exprs, _constraints) -> ++ (fun { Types.cd_id; cd_args; cd_attributes } -> + let ty = +- let params = match ty_exprs with ++ let params = match cd_args with + | [] -> Outcometree.Otyp_sum [] + | param::_ -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple ty_exprs; ++ { Types. desc = Types.Ttuple cd_args; + level = param.Types.level; + id = param.Types.id } + in +- Outcometree.Osig_type +- (("", [], params, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = params; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ let doc = doc_of_attributes cd_attributes in ++ string_to_key cd_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Variant info; +- name = id.Ident.name; ++ name = cd_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +- doc = lazy None; ++ doc = lazy doc; + file = info.file; + } ()) + variants, + comments + ++(** Implements looking up a module path in the parents list *) ++let lookup_parents (parents:parents) path sig_path = ++ let sig_key, path_key = match sig_path with ++ | hd::tl -> ++ modpath_to_key [hd], modpath_to_key tl ++ | [] -> assert false ++ in ++ let rec lookup = function ++ | [] -> ++ if debug_enabled then ++ debug "WARN: Module or sig reference %s not found a %s\n" ++ (modpath_to_string sig_path) ++ (modpath_to_string path); ++ Trie.empty ++ | (parentpath, lazy t) :: parents -> ++ let s = Trie.sub t sig_key in ++ if s = Trie.empty then lookup parents else ++ let s = Trie.sub s path_key in ++ let rewrite_path = ++ fix_path_prefix (List.length parentpath + List.length sig_path) path ++ in ++ Trie.map (fun _k v -> rewrite_path v) s ++ in ++ lookup parents ++ ++let rec path_of_ocaml = function ++ | Path.Pident id -> [id.Ident.name] ++ | Path.Pdot (path, s, _) -> path_of_ocaml path @ [s] ++ | Path.Papply (p1, _p2) -> path_of_ocaml p1 ++ + let rec trie_of_sig_item + ?comments implloc_trie (parents:parents) (orig_file:orig_file) path + sig_item next +@@ -333,9 +397,10 @@ let rec trie_of_sig_item + | Some n -> loc_of_sig_item n + in + let doc, comments = +- match comments with +- | None -> lazy None, None +- | Some comments -> ++ match doc_of_attributes (attrs_of_sig_item sig_item), comments with ++ | Some s, _ -> lazy (Some s), comments ++ | None, None -> lazy None, None ++ | None, Some comments -> + let assoc = lazy ( + associate_comment (Lazy.force comments) loc nextloc + ) in +@@ -368,19 +433,21 @@ let rec trie_of_sig_item + in + (* ignore functor arguments *) + let rec sig_item_contents = function +- | Types.Sig_module (id, Types.Mty_functor (_,_,s), is_rec) -> +- sig_item_contents (Types.Sig_module (id, s, is_rec)) ++ | Types.Sig_module ++ (id, ({Types.md_type = Types.Mty_functor (_,_,s)} as funct), is_rec) -> ++ let funct = {funct with Types.md_type = s} in ++ sig_item_contents (Types.Sig_module (id, funct, is_rec)) + | Types.Sig_modtype +- (id, Types.Modtype_manifest (Types.Mty_functor (_,_,s))) -> +- sig_item_contents +- (Types.Sig_modtype (id, Types.Modtype_manifest s)) ++ (id, ({Types.mtd_type = Some (Types.Mty_functor (_,_,s))} as funct)) -> ++ let funct = {funct with Types.mtd_type = Some s} in ++ sig_item_contents (Types.Sig_modtype (id, funct)) + | si -> si + in + (* read module / class contents *) + let children, comments = + match sig_item_contents sig_item with +- | Types.Sig_module (id,Types.Mty_signature sign,_) +- | Types.Sig_modtype (id,Types.Modtype_manifest (Types.Mty_signature sign)) ++ | Types.Sig_module (id,{ Types.md_type = Types.Mty_signature sign },_) ++ | Types.Sig_modtype (id,{ Types.mtd_type = Some (Types.Mty_signature sign) }) + -> + let path = path @ [id.Ident.name] in + let children_comments = lazy ( +@@ -400,64 +467,43 @@ let rec trie_of_sig_item + | Some _, lazy (_, comments) -> comments + in + children, comments +- | Types.Sig_module (_,Types.Mty_ident sig_ident,_) +- | Types.Sig_modtype (_,Types.Modtype_manifest (Types.Mty_ident sig_ident)) -> +- let sig_path = +- let rec get_path = function +- | Path.Pident id -> [id.Ident.name] +- | Path.Pdot (path, s, _) -> get_path path @ [s] +- | Path.Papply (p1, _p2) -> get_path p1 +- in +- get_path sig_ident +- in +- let sig_key, path_key = match sig_path with +- | hd::tl -> +- modpath_to_key [hd], modpath_to_key tl +- | [] -> assert false +- in +- let rec lookup = function +- | [] -> +- if debug_enabled then +- debug "WARN: Module or sig reference %s not found a %s\n" +- (modpath_to_string sig_path) +- (modpath_to_string (path@[id.Ident.name])); +- Trie.empty +- | (parentpath, lazy t) :: parents -> +- let s = Trie.sub t sig_key in +- if s = Trie.empty then lookup parents else +- let s = Trie.sub s path_key in +- let rewrite_path = +- fix_path_prefix +- (List.length parentpath + List.length sig_path) +- (path @ [id.Ident.name]) +- in +- Trie.map (fun _k v -> rewrite_path v) s +- in ++ | Types.Sig_module (_,{ Types.md_type = ++ Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident},_) ++ | Types.Sig_modtype (_,{ Types.mtd_type = ++ Some ( Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident) }) -> ++ let sig_path = path_of_ocaml sig_ident in + let children = lazy ( + (* Only keep the children, don't override the module reference *) +- Trie.graft_lazy Trie.empty [] (lazy (lookup parents)) ++ Trie.graft_lazy Trie.empty [] ++ (lazy (lookup_parents parents (path@[id.Ident.name]) sig_path)) + ) in + children, comments + | Types.Sig_class (id,{Types.cty_type=cty},_) + | Types.Sig_class_type (id,{Types.clty_type=cty},_) + -> + let rec get_clsig = function +- | Types.Cty_constr (_,_,cty) | Types.Cty_fun (_,_,cty) -> ++ | Types.Cty_constr (_,_,cty) | Types.Cty_arrow (_,_,cty) -> + get_clsig cty + | Types.Cty_signature clsig -> clsig + in + let clsig = get_clsig cty in + let path = path@[id.Ident.name] in + let (fields, _) = +- Ctype.flatten_fields (Ctype.object_fields clsig.Types.cty_self) ++ Ctype.flatten_fields (Ctype.object_fields clsig.Types.csig_self) + in + lazy (List.fold_left (fun t (lbl,_,ty_expr) -> + if lbl = "*dummy method*" then t else + let _ = Printtyp.reset_and_mark_loops ty_expr in + let ty = Printtyp.tree_of_typexp false ty_expr in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in + Trie.add t (string_to_key lbl) + { path = path; +@@ -486,6 +532,139 @@ let rec trie_of_sig_item + :: siblings, + comments + ++ ++(* These four functions go through the typedtree to extract includes *) ++let rec lookup_trie_of_module_expr parents t path = function ++ | Typedtree.Tmod_ident (incpath,{ Location.txt = _lid}) -> ++ let incpath = path_of_ocaml incpath in ++ debug "Including %s impl at %s\n" (modpath_to_string incpath) (modpath_to_string path); ++ let parents = (path, lazy t) :: parents in ++ let sub = lookup_parents parents path incpath in ++ overriding_merge t sub ++ | Typedtree.Tmod_constraint (e,_,_,_) ++ (* | Typedtree.Tmod_apply (e,_,_) *) -> ++ lookup_trie_of_module_expr parents t path e.mod_desc ++ | Typedtree.Tmod_apply ({ mod_desc = Typedtree.Tmod_functor(id,_,_,f) }, ++ { mod_desc = Typedtree.Tmod_ident (arg,_) ++ | Typedtree.Tmod_constraint ({mod_desc = Typedtree.Tmod_ident (arg,_)},_,_,_) },_) -> ++ let t = lookup_trie_of_module_expr parents t path f.Typedtree.mod_desc in ++ debug "Grafting %s at %s\n" id.Ident.name (modpath_to_string (path_of_ocaml arg)); ++ let functor_arg = lazy (lookup_parents parents (path_of_ocaml arg) path) in ++ Trie.graft_lazy t (modpath_to_key [id.Ident.name]) functor_arg ++ | _ -> t ++let rec extract_includes_from_submodule_sig parents t path name = function ++ | Typedtree.Tmty_signature sign -> ++ let path = path @ [name] in ++ let sub_includes = lazy ( ++ get_includes_sig ((path, lazy t) :: parents) ++ (Trie.sub t (modpath_to_key [name])) path sign ++ ) in ++ Trie.graft_lazy t (modpath_to_key [name]) sub_includes ++ | Typedtree.Tmty_functor (_,_,_,e) ++ | Typedtree.Tmty_with (e,_) -> ++ extract_includes_from_submodule_sig parents t path name e.Typedtree.mty_desc ++ | _ -> t ++and get_includes_impl parents t path ttree_struct = ++ let rec extract_submodule_impl t name = function ++ | Typedtree.Tmod_structure str -> ++ let path = path @ [name] in ++ let sub_includes = lazy ( ++ get_includes_impl ((path, lazy t) :: parents) ++ (Trie.sub t (modpath_to_key [name])) path str ++ ) in ++ Trie.graft_lazy t (modpath_to_key [name]) sub_includes ++ (* | Typedtree.Tmod_functor (arg_id,_,arg_t,e) *) ++ | Typedtree.Tmod_apply ({ mod_desc = Typedtree.Tmod_functor(id,_,_,f) }, ++ { mod_desc = Typedtree.Tmod_ident (arg,_) ++ | Typedtree.Tmod_constraint ({mod_desc = Typedtree.Tmod_ident (arg,_)},_,_,_) },_) -> ++ debug "Grafting %s at %s\n" id.Ident.name (modpath_to_string (path_of_ocaml arg)); ++ let functor_arg = lazy ( ++ lookup_parents ++ ((path, lazy t)::parents) (path_of_ocaml arg) (path@[name]) ++ ) in ++ extract_submodule_impl ++ (Trie.graft_lazy t (modpath_to_key [id.Ident.name]) functor_arg) ++ name f.Typedtree.mod_desc ++ | Typedtree.Tmod_functor (_,_,_,e) ++ | Typedtree.Tmod_constraint (e,_,_,_) -> ++ extract_submodule_impl t name e.Typedtree.mod_desc ++ | _ -> t ++ in ++ List.fold_left (fun t struc_item -> ++ match struc_item.Typedtree.str_desc with ++ | Typedtree.Tstr_include ++ { Typedtree.incl_mod = { Typedtree.mod_desc = e }} -> ++ lookup_trie_of_module_expr parents t path e ++ | Typedtree.Tstr_open ++ { Typedtree.open_path = p } -> ++ let sub = lookup_parents ((path, lazy t) :: parents) path (path_of_ocaml p) in ++ overriding_merge t sub ++ | Typedtree.Tstr_module ++ { Typedtree.mb_id = id; mb_expr = { Typedtree.mod_desc } } -> ++ extract_submodule_impl t id.Ident.name mod_desc ++ | Typedtree.Tstr_recmodule l -> ++ List.fold_left ++ (fun t { Typedtree.mb_id; mb_expr = { Typedtree.mod_desc } } -> ++ extract_submodule_impl t mb_id.Ident.name mod_desc) ++ t l ++ | Typedtree.Tstr_modtype ++ { Typedtree.mtd_id = id; mtd_type = Some { Typedtree.mty_desc = e } } -> ++ extract_includes_from_submodule_sig parents t path id.Ident.name e ++ | _ -> t) ++ t ttree_struct.Typedtree.str_items ++and get_includes_sig parents t path ttree_sig = ++ let rec extract_includes t = function ++ | Typedtree.Tmty_ident (incpath,_) -> ++ let incpath = path_of_ocaml incpath in ++ debug "Including %s sig at %s\n" (modpath_to_string incpath) (modpath_to_string path); ++ let parents = (path, lazy t) :: parents in ++ let sub = lookup_parents parents path incpath in ++ overriding_merge t sub ++ | Typedtree.Tmty_with (e,_) -> ++ extract_includes t e.Typedtree.mty_desc ++ | Typedtree.Tmty_typeof e -> ++ lookup_trie_of_module_expr parents t path ++ e.Typedtree.mod_desc ++ | _ -> t ++ in ++ List.fold_left (fun t sig_item -> ++ match sig_item.Typedtree.sig_desc with ++ | Typedtree.Tsig_include ++ { Typedtree.incl_mod = { Typedtree.mty_desc = e }} -> ++ extract_includes t e ++ | Typedtree.Tsig_module ++ { Typedtree.md_id = id ; md_type = { Typedtree.mty_desc } } ++ | Typedtree.Tsig_modtype ++ { Typedtree.mtd_id = id; mtd_type = Some { Typedtree.mty_desc } } -> ++ extract_includes_from_submodule_sig parents t path ++ id.Ident.name mty_desc ++ | Typedtree.Tsig_recmodule l -> ++ List.fold_left ++ (fun t { Typedtree.md_id; md_type = { Typedtree.mty_desc } } -> ++ extract_includes_from_submodule_sig parents t path ++ md_id.Ident.name mty_desc) ++ t l ++ | _ -> t) ++ t ttree_sig.Typedtree.sig_items ++ ++let add_locs ~locs t = ++ Trie.map (fun path info -> ++ let loc_info = lazy ( ++ List.find (has_kind info.kind) (Trie.find_all locs path) ++ ) in ++ let lookup fld none = ++ let loc = Lazy.force (fld info) in ++ if loc = none ++ then try Lazy.force (fld (Lazy.force loc_info)) with Not_found -> none ++ else loc ++ in ++ { info with ++ loc_sig = lazy (lookup (fun i -> i.loc_sig) Location.none); ++ loc_impl = lazy (lookup (fun i -> i.loc_impl) Location.none); ++ doc = lazy (lookup (fun i -> i.doc) None); ++ } ++ ) t ++ + (* Can work in a subtree (t doesn't have to be the root) *) + let qualify_type_idents parents t = + let qualify _key id = +@@ -524,6 +703,14 @@ let cmt_sign cmt_contents = + -> Some sign + | _ -> None + ++let cmt_includes parents t path cmt_contents = ++ match cmt_contents.Cmt_format.cmt_annots with ++ | Cmt_format.Implementation impl -> ++ get_includes_impl parents t path impl ++ | Cmt_format.Interface sign -> ++ get_includes_sig parents t path sign ++ | _ -> Trie.empty ++ + let protect_read reader f = + try reader f with + | Cmt_format.Error _ | Cmi_format.Error _ -> +@@ -539,7 +726,7 @@ let lookup_loc_impl orig_file = + if not (Sys.file_exists cmt) then None else Some cmt + + let load_loc_impl parents filename cmt_contents = +- debug "Registering %s (for implementation locations)..." filename; ++ debug " -Registering %s (for implementation locations)..." filename; + let chrono = timer () in + match cmt_sign cmt_contents with + | Some sign -> +@@ -555,6 +742,8 @@ let load_loc_impl parents filename cmt_contents = + sign + in + debug " %.3fs\n%!" (chrono()); ++ let includes = cmt_includes parents t [] cmt_contents in ++ let t = add_locs ~locs:includes t in + Some t + | _ -> + debug " %.3fs\n%!" (chrono()); +@@ -582,7 +771,7 @@ let load_cmi ?(qualify=false) root t modul orig_file = + ) in + let children = lazy ( + let info = Lazy.force info in +- debug "Registering %s..." file; ++ debug " -Registering %s..." file; + let chrono = timer () in + let rec implloc_trie = lazy ( + match Lazy.force impl_cmt with +@@ -649,7 +838,7 @@ let load_cmt ?(qualify=false) root t modul orig_file = + ) in + let children = lazy ( + let info = Lazy.force info in +- debug "Registering %s..." cmt_file; ++ debug " -Registering %s..." cmt_file; + let chrono = timer () in + let comments = Some (Lazy.from_val info.Cmt_format.cmt_comments) in + let rec implloc_trie = lazy ( +@@ -679,6 +868,13 @@ let load_cmt ?(qualify=false) root t modul orig_file = + debug " %.3fs\n%!" (chrono()); + t + ) in ++ let children = lazy ( ++ let includes = ++ cmt_includes [[modul], children; [], root] ++ t [] (Lazy.force info) ++ in ++ add_locs ~locs:includes (Lazy.force children) ++ ) in + let loc_sig, loc_impl = + let of_info i = match i.Cmt_format.cmt_sourcefile with + | Some f -> Location.in_file f +diff --git a/src/indexMisc.ml b/src/indexMisc.ml +index eee8666..8ba66f5 100644 +--- a/src/indexMisc.ml ++++ b/src/indexMisc.ml +@@ -57,12 +57,12 @@ let string_to_key s = + + let key_to_string l = + let rec aux n = function +- | [] -> String.create n ++ | [] -> Bytes.create n + | c::r -> + let s = aux (n+1) r in +- s.[n] <- if c = dot then '.' else c; s ++ Bytes.set s n (if c = dot then '.' else c); s + in +- aux 0 l ++ Bytes.to_string (aux 0 l) + + let modpath_to_key ?(enddot=true) path = + List.fold_right (fun p acc -> +@@ -70,22 +70,19 @@ let modpath_to_key ?(enddot=true) path = + string_to_key p @ acc) path [] + + let key_to_modpath l = +- let rec aux n = function +- | [] -> if n > 0 then [String.create n] else [] +- | '\000'::r -> String.create n :: aux 0 r +- | c::r -> +- match aux (n+1) r with +- | s::_ as p -> s.[n] <- c; p +- | [] -> assert false ++ let rec aux acc1 acc2 = function ++ | '\000'::r -> aux [] (acc1::acc2) r ++ | c::r -> aux (c::acc1) acc2 r ++ | [] -> if acc1 = [] then acc2 else acc1::acc2 + in +- aux 0 l ++ List.rev_map (fun l -> key_to_string (List.rev l)) (aux [] [] l) + + let modpath_to_string path = String.concat "." path + + let parent_type id = + match id.IndexTypes.kind with + | Field parent | Variant parent | Method parent -> Some parent +- | Type | Value | Exception | Module | ModuleType | Class ++ | Type | Value | Exception | OpenType | Module | ModuleType | Class + | ClassType | Keyword -> None + + +diff --git a/src/indexOptions.ml b/src/indexOptions.ml +index d5b5d18..1854bf5 100644 +--- a/src/indexOptions.ml ++++ b/src/indexOptions.ml +@@ -37,7 +37,7 @@ let filter opt info = + let open LibIndex in + let kinds = opt.filter in + match info.kind with +- | Type -> kinds.t ++ | Type | OpenType -> kinds.t + | Value | Method _ -> kinds.v + | Exception -> kinds.e + | Field _ | Variant _ -> kinds.c +diff --git a/src/indexOut.ml b/src/indexOut.ml +index c2b5ca6..b82b041 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -57,7 +57,7 @@ module IndexFormat = struct + let color = + let f kind fstr fmt = + let colorcode = match kind with +- | Type -> "\027[36m" ++ | Type | OpenType -> "\027[36m" + | Value -> "\027[1m" + | Exception -> "\027[33m" + | Field _ | Variant _ -> "\027[34m" +@@ -88,6 +88,7 @@ module IndexFormat = struct + | Type -> Format.pp_print_string fmt "type" + | Value -> Format.pp_print_string fmt "val" + | Exception -> Format.pp_print_string fmt "exception" ++ | OpenType -> Format.pp_print_string fmt "opentype" + | Field parentty -> + Format.fprintf fmt "field(%a)" + (colorise.f parentty.kind "%s") parentty.name +@@ -159,20 +160,20 @@ module IndexFormat = struct + | Osig_class (_,_,_,ctyp,_) + | Osig_class_type (_,_,_,ctyp,_) -> + !Oprint.out_class_type fmt ctyp +- | Osig_exception (_,[]) -> ++ | Osig_typext ({ oext_args = [] }, _) -> + Format.pp_print_char fmt '-' +- | Osig_exception (_,tylst) -> ++ | Osig_typext ({ oext_args }, _) -> + list ~paren:true + !Oprint.out_type + (fun fmt () -> + Format.pp_print_char fmt ','; Format.pp_print_space fmt ()) + fmt +- tylst ++ oext_args + | Osig_modtype (_,mtyp) + | Osig_module (_,mtyp,_) -> + !Oprint.out_module_type fmt mtyp +- | Osig_type ((_,_,ty,_,_),_) -> +- tydecl fmt ty ++ | Osig_type ({ otype_type },_) -> ++ tydecl fmt otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty + +diff --git a/src/indexPredefined.ml b/src/indexPredefined.ml +index 1e994d0..974adf3 100644 +--- a/src/indexPredefined.ml ++++ b/src/indexPredefined.ml +@@ -24,8 +24,11 @@ let mktype name ?(params=[]) ?(def=Otyp_abstract) doc = { + kind = Type; + name = name; + ty = Some (Osig_type ( +- (name,List.map (fun v -> v,(true,true)) params,def,Asttypes.Public,[]), +- Orec_not)); ++ { otype_name = name; ++ otype_params = List.map (fun v -> v,(true,true)) params; ++ otype_type = def; ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val (Some doc); +@@ -37,11 +40,13 @@ let mkvariant name parent params = { + orig_path = []; + kind = Variant parent; + name = name; +- ty = Some (Osig_type (("", [], +- (match params with [] -> Otyp_sum [] +- | l -> Otyp_tuple l), +- Asttypes.Public, []), +- Outcometree.Orec_not)); ++ ty = Some (Osig_type ( ++ { otype_name = ""; ++ otype_params = []; ++ otype_type = (match params with [] -> Otyp_sum [] ++ | l -> Otyp_tuple l); ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val None; +@@ -53,7 +58,13 @@ let mkexn name params doc = { + orig_path = []; + kind = Exception; + name = name; +- ty = Some (Osig_exception (name,params)); ++ ty = Some (Osig_typext ({ ++ oext_name = name; ++ oext_type_name = "exn"; ++ oext_type_params = []; ++ oext_args = params; ++ oext_ret_type = None; ++ oext_private = Asttypes.Public }, Oext_exception)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val (Some doc); +diff --git a/src/indexTypes.ml b/src/indexTypes.ml +index cb1ee67..342f86f 100644 +--- a/src/indexTypes.ml ++++ b/src/indexTypes.ml +@@ -35,7 +35,7 @@ type info = { path: string list; + + (** The kind of elements that can be stored in the trie *) + and kind = +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/libIndex.mli b/src/libIndex.mli +index d71b99b..9e27b1c 100644 +--- a/src/libIndex.mli ++++ b/src/libIndex.mli +@@ -44,7 +44,7 @@ type info = IndexTypes.info = private { + + (** The kind of elements that can be stored in the trie *) + and kind = IndexTypes.kind = private +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/ocp-index.ocp b/src/ocp-index.ocp +index d7f0fc9..47b1a55 100644 +--- a/src/ocp-index.ocp ++++ b/src/ocp-index.ocp +@@ -1,4 +1,5 @@ +-comp += [ "-g" "-w" "+1..39-4-9-37-40" ] ++comp += [ "-g" "-w" "+1..39-4-9-37-40" "-safe-string" ] ++link += [ "-g" "-w" "+1..39-4-9-37-40" ] + + begin library "ocp-index-lib" + sort = false diff --git a/patches/ocp-index/ocaml.4.02.patch.1.1.4 b/patches/ocp-index/ocaml.4.02.patch.1.1.4 new file mode 100644 index 0000000..1866a0b --- /dev/null +++ b/patches/ocp-index/ocaml.4.02.patch.1.1.4 @@ -0,0 +1,808 @@ +diff --git a/opam b/opam +index 0fa7477..4220556 100644 +--- a/opam ++++ b/opam +@@ -13,7 +13,7 @@ tags: [ + "org:ocamlpro" + "org:typerex" + ] +-dev-repo: "https://github.com/OCamlPro/ocp-index.git" ++dev-repo: "https://github.com/OCamlPro/ocp-index.git#4.02" + build: [ + ["./configure" "--prefix" prefix] + [make] +@@ -26,7 +26,7 @@ depends: [ + ] + depopts: "lambda-term" + conflicts: "lambda-term" {< "1.7"} +-available: [ocaml-version >= "4.01.0" & ocaml-version < "4.02"] ++available: [ocaml-version >= "4.02.0" & ocaml-version < "4.03"] + messages: "For ocp-browser, please also install package lambda-term" {! lambda-term:installed} + post-messages: + "This package requires additional configuration for use in editors. Either install package 'user-setup', or manually: +diff --git a/src/browserMain.ml b/src/browserMain.ml +index 2bd5191..49065a9 100644 +--- a/src/browserMain.ml ++++ b/src/browserMain.ml +@@ -16,7 +16,7 @@ let rec eq l1 l2 = match l1, l2 with + let kind_to_tag, tag_to_style, register_ressource = + let h = Hashtbl.create 11 in + let kind_to_tag = function +- | LibIndex.Type -> "Type" ++ | LibIndex.Type | OpenType -> "Type" + | Value -> "Value" + | Exception -> "Exception" + | Field _ -> "Field" +diff --git a/src/grepMain.ml b/src/grepMain.ml +index 28e7f86..98020f0 100644 +--- a/src/grepMain.ml ++++ b/src/grepMain.ml +@@ -85,8 +85,7 @@ end = struct + Filename.basename + (try Filename.chop_extension f with Invalid_argument _ -> f) + in +- s.[0] <- Char.uppercase s.[0]; +- s ++ String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = + let lookfor = +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index c9edf6c..c026e8d 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -36,13 +36,13 @@ let orig_file_name = function + | Cmt f | Cmti f | Cmi f -> f + + let equal_kind k1 k2 = match k1,k2 with +- | Type,Type | Value,Value | Exception,Exception ++ | Type,Type | Value,Value | Exception,Exception | OpenType,OpenType + | Field _,Field _ | Variant _,Variant _ | Method _,Method _ + | Module,Module | ModuleType,ModuleType + | Class,Class | ClassType,ClassType + | Keyword,Keyword -> + true +- | Type,_ | Value,_ | Exception,_ ++ | Type,_ | Value,_ | Exception,_ | OpenType,_ + | Field _,_ | Variant _,_ | Method _,_ + | Module,_ | ModuleType,_ + | Class,_ | ClassType,_ +@@ -146,8 +146,8 @@ let ty_of_sig_item = + function + | Types.Sig_value(id, decl) -> tree_of_value_description id decl + | Types.Sig_type(id, decl, rs) -> tree_of_type_declaration id decl rs +- | Types.Sig_exception(id, decl) -> tree_of_exception_declaration id decl +- | Types.Sig_module(id, mty, rs) -> tree_of_module id mty rs ++ | Types.Sig_typext(id, decl, es) -> tree_of_extension_constructor id decl es ++ | Types.Sig_module(id, { Types.md_type }, rs) -> tree_of_module id md_type rs + | Types.Sig_modtype(id, decl) -> tree_of_modtype_declaration id decl + | Types.Sig_class(id, decl, rs) -> tree_of_class_declaration id decl rs + | Types.Sig_class_type(id, decl, rs) -> tree_of_cltype_declaration id decl rs +@@ -220,6 +220,7 @@ let qualify_ty (parents:parents) ty = + | Otyp_poly (str, ty) -> Otyp_poly (str, aux ty) + | Otyp_module (str, strl, tylist) -> + Otyp_module (str, strl, List.map aux tylist) ++ | Otyp_open -> Otyp_open + in + aux ty + +@@ -227,11 +228,15 @@ let qualify_ty_in_sig_item (parents:parents) = + let qual = qualify_ty parents in + let open Outcometree in + function +- | Osig_type ((str, list, ty, priv, tylist2), rc) -> +- Osig_type ((str, list, qual ty, priv, +- List.map (fun (ty1,ty2) -> qual ty1, qual ty2) tylist2), rc) ++ | Osig_type (out_type_decl, rc) -> ++ Osig_type ({ out_type_decl with ++ otype_type = qual out_type_decl.otype_type; ++ otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) ++ out_type_decl.otype_cstrs }, rc) + | Osig_value (str, ty, str2) -> Osig_value (str, qual ty, str2) +- | Osig_exception (str, tylist) -> Osig_exception (str, List.map qual tylist) ++ | Osig_typext (constr, es) -> ++ Osig_typext ({ constr with ++ oext_args = List.map qual constr.oext_args }, es) + | out_sig -> out_sig (* don't get down in modules, classes and their types *) + + (* -- end -- *) +@@ -257,19 +262,16 @@ let with_path_loc ?srcpath loc = + let loc_of_sig_item = function + | Types.Sig_value (_,descr) -> descr.Types.val_loc + | Types.Sig_type (_,descr,_) -> descr.Types.type_loc +- | Types.Sig_exception (_,descr) -> descr.Types.exn_loc +- (* Sadly the Types tree doesn't contain locations for those. This means we +- won't associate comments easily either (todo...) *) +- | Types.Sig_module _ +- | Types.Sig_modtype _ +- | Types.Sig_class _ +- | Types.Sig_class_type _ +- -> Location.none ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_loc ++ | Types.Sig_module (_,descr,_) -> descr.Types.md_loc ++ | Types.Sig_modtype (_,descr) -> descr.Types.mtd_loc ++ | Types.Sig_class (_,descr,_) -> descr.Types.cty_loc ++ | Types.Sig_class_type (_,descr,_) -> descr.Types.clty_loc + + let id_of_sig_item = function + | Types.Sig_value (id,_) + | Types.Sig_type (id,_,_) +- | Types.Sig_exception (id,_) ++ | Types.Sig_typext (id,_,_) + | Types.Sig_module (id,_,_) + | Types.Sig_modtype (id,_) + | Types.Sig_class (id,_,_) +@@ -279,67 +281,129 @@ let id_of_sig_item = function + let kind_of_sig_item = function + | Types.Sig_value _ -> Value + | Types.Sig_type _ -> Type +- | Types.Sig_exception _ -> Exception ++ | Types.Sig_typext (_, _, Types.Text_exception) -> Exception ++ | Types.Sig_typext _ -> OpenType + | Types.Sig_module _ -> Module + | Types.Sig_modtype _ -> ModuleType + | Types.Sig_class _ -> Class + | Types.Sig_class_type _ -> ClassType + ++let attrs_of_sig_item = function ++ | Types.Sig_value (_,descr) -> descr.Types.val_attributes ++ | Types.Sig_type (_,descr,_) -> descr.Types.type_attributes ++ | Types.Sig_typext (_,descr,_) -> descr.Types.ext_attributes ++ | Types.Sig_module (_,descr,_) -> descr.Types.md_attributes ++ | Types.Sig_modtype (_,descr) -> descr.Types.mtd_attributes ++ | Types.Sig_class (_,descr,_) -> descr.Types.cty_attributes ++ | Types.Sig_class_type (_,descr,_) -> descr.Types.clty_attributes ++ ++let doc_of_attributes attrs = ++ let doc_loc_id = "ocaml.doc" in (* not exported ! *) ++ let open Parsetree in ++ match List.find (fun ({Location.txt},_) -> txt = doc_loc_id) attrs with ++ | _, PStr [{pstr_desc = Pstr_eval ({pexp_desc},_)}] -> ++ (match pexp_desc with ++ | Pexp_constant (Const_string (s,_)) -> Some s ++ | _ -> debug "Unexpected ocaml.doc docstring format"; None) ++ | _ -> None ++ | exception Not_found -> None ++ + let trie_of_type_decl ?comments info ty_decl = + match ty_decl.Types.type_kind with + | Types.Type_abstract -> [], comments ++ | Types.Type_open -> [], comments + | Types.Type_record (fields,_repr) -> + List.map +- (fun (id, _mutable, ty_expr) -> +- let ty = Printtyp.tree_of_typexp false ty_expr in ++ (fun { Types.ld_id; ld_type; ld_attributes } -> ++ let ty = Printtyp.tree_of_typexp false ld_type in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ let doc = doc_of_attributes ld_attributes in ++ string_to_key ld_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Field info; +- name = id.Ident.name; ++ name = ld_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +- doc = lazy None; ++ doc = lazy doc; + file = info.file; + } ()) + fields, + comments + | Types.Type_variant variants -> + List.map +- (fun (id, ty_exprs, _constraints) -> ++ (fun { Types.cd_id; cd_args; cd_attributes } -> + let ty = +- let params = match ty_exprs with ++ let params = match cd_args with + | [] -> Outcometree.Otyp_sum [] + | param::_ -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple ty_exprs; ++ { Types. desc = Types.Ttuple cd_args; + level = param.Types.level; + id = param.Types.id } + in +- Outcometree.Osig_type +- (("", [], params, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = params; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in +- string_to_key id.Ident.name, ++ let doc = doc_of_attributes cd_attributes in ++ string_to_key cd_id.Ident.name, + Trie.create ~value:{ + path = info.path; + orig_path = info.path; + kind = Variant info; +- name = id.Ident.name; ++ name = cd_id.Ident.name; + ty = Some ty; + loc_sig = info.loc_sig; + loc_impl = info.loc_impl; +- doc = lazy None; ++ doc = lazy doc; + file = info.file; + } ()) + variants, + comments + ++(** Implements looking up a module path in the parents list *) ++let lookup_parents (parents:parents) path sig_path = ++ let sig_key, path_key = match sig_path with ++ | hd::tl -> ++ modpath_to_key [hd], modpath_to_key tl ++ | [] -> assert false ++ in ++ let rec lookup = function ++ | [] -> ++ if debug_enabled then ++ debug "WARN: Module or sig reference %s not found a %s\n" ++ (modpath_to_string sig_path) ++ (modpath_to_string path); ++ Trie.empty ++ | (parentpath, lazy t) :: parents -> ++ let s = Trie.sub t sig_key in ++ if s = Trie.empty then lookup parents else ++ let s = Trie.sub s path_key in ++ let rewrite_path = ++ fix_path_prefix (List.length parentpath + List.length sig_path) path ++ in ++ Trie.map (fun _k v -> rewrite_path v) s ++ in ++ lookup parents ++ ++let rec path_of_ocaml = function ++ | Path.Pident id -> [id.Ident.name] ++ | Path.Pdot (path, s, _) -> path_of_ocaml path @ [s] ++ | Path.Papply (p1, _p2) -> path_of_ocaml p1 ++ + let rec trie_of_sig_item + ?comments ?srcpath implloc_trie (parents:parents) (orig_file:orig_file) + path sig_item next +@@ -351,9 +415,10 @@ let rec trie_of_sig_item + | Some n -> with_path_loc ?srcpath (loc_of_sig_item n) + in + let doc, comments = +- match comments with +- | None -> lazy None, None +- | Some comments -> ++ match doc_of_attributes (attrs_of_sig_item sig_item), comments with ++ | Some s, _ -> lazy (Some s), comments ++ | None, None -> lazy None, None ++ | None, Some comments -> + let assoc = lazy ( + associate_comment (Lazy.force comments) loc nextloc + ) in +@@ -386,19 +451,21 @@ let rec trie_of_sig_item + in + (* ignore functor arguments *) + let rec sig_item_contents = function +- | Types.Sig_module (id, Types.Mty_functor (_,_,s), is_rec) -> +- sig_item_contents (Types.Sig_module (id, s, is_rec)) ++ | Types.Sig_module ++ (id, ({Types.md_type = Types.Mty_functor (_,_,s)} as funct), is_rec) -> ++ let funct = {funct with Types.md_type = s} in ++ sig_item_contents (Types.Sig_module (id, funct, is_rec)) + | Types.Sig_modtype +- (id, Types.Modtype_manifest (Types.Mty_functor (_,_,s))) -> +- sig_item_contents +- (Types.Sig_modtype (id, Types.Modtype_manifest s)) ++ (id, ({Types.mtd_type = Some (Types.Mty_functor (_,_,s))} as funct)) -> ++ let funct = {funct with Types.mtd_type = Some s} in ++ sig_item_contents (Types.Sig_modtype (id, funct)) + | si -> si + in + (* read module / class contents *) + let children, comments = + match sig_item_contents sig_item with +- | Types.Sig_module (id,Types.Mty_signature sign,_) +- | Types.Sig_modtype (id,Types.Modtype_manifest (Types.Mty_signature sign)) ++ | Types.Sig_module (id,{ Types.md_type = Types.Mty_signature sign },_) ++ | Types.Sig_modtype (id,{ Types.mtd_type = Some (Types.Mty_signature sign) }) + -> + let path = path @ [id.Ident.name] in + let children_comments = lazy ( +@@ -418,64 +485,43 @@ let rec trie_of_sig_item + | Some _, lazy (_, comments) -> comments + in + children, comments +- | Types.Sig_module (_,Types.Mty_ident sig_ident,_) +- | Types.Sig_modtype (_,Types.Modtype_manifest (Types.Mty_ident sig_ident)) -> +- let sig_path = +- let rec get_path = function +- | Path.Pident id -> [id.Ident.name] +- | Path.Pdot (path, s, _) -> get_path path @ [s] +- | Path.Papply (p1, _p2) -> get_path p1 +- in +- get_path sig_ident +- in +- let sig_key, path_key = match sig_path with +- | hd::tl -> +- modpath_to_key [hd], modpath_to_key tl +- | [] -> assert false +- in +- let rec lookup = function +- | [] -> +- if debug_enabled then +- debug "WARN: Module or sig reference %s not found a %s\n" +- (modpath_to_string sig_path) +- (modpath_to_string (path@[id.Ident.name])); +- Trie.empty +- | (parentpath, lazy t) :: parents -> +- let s = Trie.sub t sig_key in +- if s = Trie.empty then lookup parents else +- let s = Trie.sub s path_key in +- let rewrite_path = +- fix_path_prefix +- (List.length parentpath + List.length sig_path) +- (path @ [id.Ident.name]) +- in +- Trie.map (fun _k v -> rewrite_path v) s +- in ++ | Types.Sig_module (_,{ Types.md_type = ++ Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident},_) ++ | Types.Sig_modtype (_,{ Types.mtd_type = ++ Some ( Types.Mty_ident sig_ident ++ | Types.Mty_alias sig_ident) }) -> ++ let sig_path = path_of_ocaml sig_ident in + let children = lazy ( + (* Only keep the children, don't override the module reference *) +- Trie.graft_lazy Trie.empty [] (lazy (lookup parents)) ++ Trie.graft_lazy Trie.empty [] ++ (lazy (lookup_parents parents (path@[id.Ident.name]) sig_path)) + ) in + children, comments + | Types.Sig_class (id,{Types.cty_type=cty},_) + | Types.Sig_class_type (id,{Types.clty_type=cty},_) + -> + let rec get_clsig = function +- | Types.Cty_constr (_,_,cty) | Types.Cty_fun (_,_,cty) -> ++ | Types.Cty_constr (_,_,cty) | Types.Cty_arrow (_,_,cty) -> + get_clsig cty + | Types.Cty_signature clsig -> clsig + in + let clsig = get_clsig cty in + let path = path@[id.Ident.name] in + let (fields, _) = +- Ctype.flatten_fields (Ctype.object_fields clsig.Types.cty_self) ++ Ctype.flatten_fields (Ctype.object_fields clsig.Types.csig_self) + in + lazy (List.fold_left (fun t (lbl,_,ty_expr) -> + if lbl = "*dummy method*" then t else + let _ = Printtyp.reset_and_mark_loops ty_expr in + let ty = Printtyp.tree_of_typexp false ty_expr in + let ty = +- Outcometree.Osig_type +- (("", [], ty, Asttypes.Public, []), Outcometree.Orec_not) ++ Outcometree.Osig_type (Outcometree.{ ++ otype_name = ""; ++ otype_params = []; ++ otype_type = ty; ++ otype_private = Asttypes.Public; ++ otype_cstrs = []; }, Outcometree.Orec_not) + in + Trie.add t (string_to_key lbl) + { path = path; +@@ -504,6 +550,139 @@ let rec trie_of_sig_item + :: siblings, + comments + ++ ++(* These four functions go through the typedtree to extract includes *) ++let rec lookup_trie_of_module_expr parents t path = function ++ | Typedtree.Tmod_ident (incpath,{ Location.txt = _lid}) -> ++ let incpath = path_of_ocaml incpath in ++ debug "Including %s impl at %s\n" (modpath_to_string incpath) (modpath_to_string path); ++ let parents = (path, lazy t) :: parents in ++ let sub = lookup_parents parents path incpath in ++ overriding_merge t sub ++ | Typedtree.Tmod_constraint (e,_,_,_) ++ (* | Typedtree.Tmod_apply (e,_,_) *) -> ++ lookup_trie_of_module_expr parents t path e.mod_desc ++ | Typedtree.Tmod_apply ({ mod_desc = Typedtree.Tmod_functor(id,_,_,f) }, ++ { mod_desc = Typedtree.Tmod_ident (arg,_) ++ | Typedtree.Tmod_constraint ({mod_desc = Typedtree.Tmod_ident (arg,_)},_,_,_) },_) -> ++ let t = lookup_trie_of_module_expr parents t path f.Typedtree.mod_desc in ++ debug "Grafting %s at %s\n" id.Ident.name (modpath_to_string (path_of_ocaml arg)); ++ let functor_arg = lazy (lookup_parents parents (path_of_ocaml arg) path) in ++ Trie.graft_lazy t (modpath_to_key [id.Ident.name]) functor_arg ++ | _ -> t ++let rec extract_includes_from_submodule_sig parents t path name = function ++ | Typedtree.Tmty_signature sign -> ++ let path = path @ [name] in ++ let sub_includes = lazy ( ++ get_includes_sig ((path, lazy t) :: parents) ++ (Trie.sub t (modpath_to_key [name])) path sign ++ ) in ++ Trie.graft_lazy t (modpath_to_key [name]) sub_includes ++ | Typedtree.Tmty_functor (_,_,_,e) ++ | Typedtree.Tmty_with (e,_) -> ++ extract_includes_from_submodule_sig parents t path name e.Typedtree.mty_desc ++ | _ -> t ++and get_includes_impl parents t path ttree_struct = ++ let rec extract_submodule_impl t name = function ++ | Typedtree.Tmod_structure str -> ++ let path = path @ [name] in ++ let sub_includes = lazy ( ++ get_includes_impl ((path, lazy t) :: parents) ++ (Trie.sub t (modpath_to_key [name])) path str ++ ) in ++ Trie.graft_lazy t (modpath_to_key [name]) sub_includes ++ (* | Typedtree.Tmod_functor (arg_id,_,arg_t,e) *) ++ | Typedtree.Tmod_apply ({ mod_desc = Typedtree.Tmod_functor(id,_,_,f) }, ++ { mod_desc = Typedtree.Tmod_ident (arg,_) ++ | Typedtree.Tmod_constraint ({mod_desc = Typedtree.Tmod_ident (arg,_)},_,_,_) },_) -> ++ debug "Grafting %s at %s\n" id.Ident.name (modpath_to_string (path_of_ocaml arg)); ++ let functor_arg = lazy ( ++ lookup_parents ++ ((path, lazy t)::parents) (path_of_ocaml arg) (path@[name]) ++ ) in ++ extract_submodule_impl ++ (Trie.graft_lazy t (modpath_to_key [id.Ident.name]) functor_arg) ++ name f.Typedtree.mod_desc ++ | Typedtree.Tmod_functor (_,_,_,e) ++ | Typedtree.Tmod_constraint (e,_,_,_) -> ++ extract_submodule_impl t name e.Typedtree.mod_desc ++ | _ -> t ++ in ++ List.fold_left (fun t struc_item -> ++ match struc_item.Typedtree.str_desc with ++ | Typedtree.Tstr_include ++ { Typedtree.incl_mod = { Typedtree.mod_desc = e }} -> ++ lookup_trie_of_module_expr parents t path e ++ | Typedtree.Tstr_open ++ { Typedtree.open_path = p } -> ++ let sub = lookup_parents ((path, lazy t) :: parents) path (path_of_ocaml p) in ++ overriding_merge t sub ++ | Typedtree.Tstr_module ++ { Typedtree.mb_id = id; mb_expr = { Typedtree.mod_desc } } -> ++ extract_submodule_impl t id.Ident.name mod_desc ++ | Typedtree.Tstr_recmodule l -> ++ List.fold_left ++ (fun t { Typedtree.mb_id; mb_expr = { Typedtree.mod_desc } } -> ++ extract_submodule_impl t mb_id.Ident.name mod_desc) ++ t l ++ | Typedtree.Tstr_modtype ++ { Typedtree.mtd_id = id; mtd_type = Some { Typedtree.mty_desc = e } } -> ++ extract_includes_from_submodule_sig parents t path id.Ident.name e ++ | _ -> t) ++ t ttree_struct.Typedtree.str_items ++and get_includes_sig parents t path ttree_sig = ++ let rec extract_includes t = function ++ | Typedtree.Tmty_ident (incpath,_) -> ++ let incpath = path_of_ocaml incpath in ++ debug "Including %s sig at %s\n" (modpath_to_string incpath) (modpath_to_string path); ++ let parents = (path, lazy t) :: parents in ++ let sub = lookup_parents parents path incpath in ++ overriding_merge t sub ++ | Typedtree.Tmty_with (e,_) -> ++ extract_includes t e.Typedtree.mty_desc ++ | Typedtree.Tmty_typeof e -> ++ lookup_trie_of_module_expr parents t path ++ e.Typedtree.mod_desc ++ | _ -> t ++ in ++ List.fold_left (fun t sig_item -> ++ match sig_item.Typedtree.sig_desc with ++ | Typedtree.Tsig_include ++ { Typedtree.incl_mod = { Typedtree.mty_desc = e }} -> ++ extract_includes t e ++ | Typedtree.Tsig_module ++ { Typedtree.md_id = id ; md_type = { Typedtree.mty_desc } } ++ | Typedtree.Tsig_modtype ++ { Typedtree.mtd_id = id; mtd_type = Some { Typedtree.mty_desc } } -> ++ extract_includes_from_submodule_sig parents t path ++ id.Ident.name mty_desc ++ | Typedtree.Tsig_recmodule l -> ++ List.fold_left ++ (fun t { Typedtree.md_id; md_type = { Typedtree.mty_desc } } -> ++ extract_includes_from_submodule_sig parents t path ++ md_id.Ident.name mty_desc) ++ t l ++ | _ -> t) ++ t ttree_sig.Typedtree.sig_items ++ ++let add_locs ~locs t = ++ Trie.map (fun path info -> ++ let loc_info = lazy ( ++ List.find (has_kind info.kind) (Trie.find_all locs path) ++ ) in ++ let lookup fld none = ++ let loc = Lazy.force (fld info) in ++ if loc = none ++ then try Lazy.force (fld (Lazy.force loc_info)) with Not_found -> none ++ else loc ++ in ++ { info with ++ loc_sig = lazy (lookup (fun i -> i.loc_sig) Location.none); ++ loc_impl = lazy (lookup (fun i -> i.loc_impl) Location.none); ++ doc = lazy (lookup (fun i -> i.doc) None); ++ } ++ ) t ++ + (* Can work in a subtree (t doesn't have to be the root) *) + let qualify_type_idents parents t = + let qualify _key id = +@@ -542,6 +721,14 @@ let cmt_sign cmt_contents = + -> Some sign + | _ -> None + ++let cmt_includes parents t path cmt_contents = ++ match cmt_contents.Cmt_format.cmt_annots with ++ | Cmt_format.Implementation impl -> ++ get_includes_impl parents t path impl ++ | Cmt_format.Interface sign -> ++ get_includes_sig parents t path sign ++ | _ -> Trie.empty ++ + let protect_read reader f = + try reader f with + | Cmt_format.Error _ | Cmi_format.Error _ -> +@@ -557,7 +744,7 @@ let lookup_loc_impl orig_file = + if not (Sys.file_exists cmt) then None else Some cmt + + let load_loc_impl parents filename cmt_contents = +- debug "Registering %s (for implementation locations)..." filename; ++ debug " -Registering %s (for implementation locations)..." filename; + let chrono = timer () in + match cmt_sign cmt_contents with + | Some sign -> +@@ -574,6 +761,8 @@ let load_loc_impl parents filename cmt_contents = + sign + in + debug " %.3fs\n%!" (chrono()); ++ let includes = cmt_includes parents t [] cmt_contents in ++ let t = add_locs ~locs:includes t in + Some t + | _ -> + debug " %.3fs\n%!" (chrono()); +@@ -601,7 +790,7 @@ let load_cmi ?(qualify=false) root t modul orig_file = + ) in + let children = lazy ( + let info = Lazy.force info in +- debug "Registering %s..." file; ++ debug " -Registering %s..." file; + let chrono = timer () in + let rec implloc_trie = lazy ( + match Lazy.force impl_cmt with +@@ -668,7 +857,7 @@ let load_cmt ?(qualify=false) root t modul orig_file = + ) in + let children = lazy ( + let info = Lazy.force info in +- debug "Registering %s..." cmt_file; ++ debug " -Registering %s..." cmt_file; + let chrono = timer () in + let comments = Some (Lazy.from_val info.Cmt_format.cmt_comments) in + let rec implloc_trie = lazy ( +@@ -700,6 +889,13 @@ let load_cmt ?(qualify=false) root t modul orig_file = + debug " %.3fs\n%!" (chrono()); + t + ) in ++ let children = lazy ( ++ let includes = ++ cmt_includes [[modul], children; [], root] ++ t [] (Lazy.force info) ++ in ++ add_locs ~locs:includes (Lazy.force children) ++ ) in + let loc_sig, loc_impl = + let of_info i = match i.Cmt_format.cmt_sourcefile with + | Some f -> Location.in_file f +diff --git a/src/indexMisc.ml b/src/indexMisc.ml +index eee8666..8ba66f5 100644 +--- a/src/indexMisc.ml ++++ b/src/indexMisc.ml +@@ -57,12 +57,12 @@ let string_to_key s = + + let key_to_string l = + let rec aux n = function +- | [] -> String.create n ++ | [] -> Bytes.create n + | c::r -> + let s = aux (n+1) r in +- s.[n] <- if c = dot then '.' else c; s ++ Bytes.set s n (if c = dot then '.' else c); s + in +- aux 0 l ++ Bytes.to_string (aux 0 l) + + let modpath_to_key ?(enddot=true) path = + List.fold_right (fun p acc -> +@@ -70,22 +70,19 @@ let modpath_to_key ?(enddot=true) path = + string_to_key p @ acc) path [] + + let key_to_modpath l = +- let rec aux n = function +- | [] -> if n > 0 then [String.create n] else [] +- | '\000'::r -> String.create n :: aux 0 r +- | c::r -> +- match aux (n+1) r with +- | s::_ as p -> s.[n] <- c; p +- | [] -> assert false ++ let rec aux acc1 acc2 = function ++ | '\000'::r -> aux [] (acc1::acc2) r ++ | c::r -> aux (c::acc1) acc2 r ++ | [] -> if acc1 = [] then acc2 else acc1::acc2 + in +- aux 0 l ++ List.rev_map (fun l -> key_to_string (List.rev l)) (aux [] [] l) + + let modpath_to_string path = String.concat "." path + + let parent_type id = + match id.IndexTypes.kind with + | Field parent | Variant parent | Method parent -> Some parent +- | Type | Value | Exception | Module | ModuleType | Class ++ | Type | Value | Exception | OpenType | Module | ModuleType | Class + | ClassType | Keyword -> None + + +diff --git a/src/indexOptions.ml b/src/indexOptions.ml +index c37d0ef..a1e55c4 100644 +--- a/src/indexOptions.ml ++++ b/src/indexOptions.ml +@@ -37,7 +37,7 @@ let filter opt info = + let open LibIndex in + let kinds = opt.filter in + match info.kind with +- | Type -> kinds.t ++ | Type | OpenType -> kinds.t + | Value | Method _ -> kinds.v + | Exception -> kinds.e + | Field _ | Variant _ -> kinds.c +diff --git a/src/indexOut.ml b/src/indexOut.ml +index 37b6a2a..3ab29c8 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -64,7 +64,7 @@ module IndexFormat = struct + let color = + let f kind fstr fmt = + let colorcode = match kind with +- | Type -> "\027[36m" ++ | Type | OpenType -> "\027[36m" + | Value -> "\027[1m" + | Exception -> "\027[33m" + | Field _ | Variant _ -> "\027[34m" +@@ -95,6 +95,7 @@ module IndexFormat = struct + | Type -> Format.pp_print_string fmt "type" + | Value -> Format.pp_print_string fmt "val" + | Exception -> Format.pp_print_string fmt "exception" ++ | OpenType -> Format.pp_print_string fmt "opentype" + | Field parentty -> + Format.fprintf fmt "field(%a)" + (colorise.f parentty.kind "%s") parentty.name +@@ -166,20 +167,20 @@ module IndexFormat = struct + | Osig_class (_,_,_,ctyp,_) + | Osig_class_type (_,_,_,ctyp,_) -> + !Oprint.out_class_type fmt ctyp +- | Osig_exception (_,[]) -> ++ | Osig_typext ({ oext_args = [] }, _) -> + Format.pp_print_char fmt '-' +- | Osig_exception (_,tylst) -> ++ | Osig_typext ({ oext_args }, _) -> + list ~paren:true + !Oprint.out_type + (fun fmt () -> + Format.pp_print_char fmt ','; Format.pp_print_space fmt ()) + fmt +- tylst ++ oext_args + | Osig_modtype (_,mtyp) + | Osig_module (_,mtyp,_) -> + !Oprint.out_module_type fmt mtyp +- | Osig_type ((_,_,ty,_,_),_) -> +- tydecl fmt ty ++ | Osig_type ({ otype_type },_) -> ++ tydecl fmt otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty + +diff --git a/src/indexPredefined.ml b/src/indexPredefined.ml +index 1e994d0..974adf3 100644 +--- a/src/indexPredefined.ml ++++ b/src/indexPredefined.ml +@@ -24,8 +24,11 @@ let mktype name ?(params=[]) ?(def=Otyp_abstract) doc = { + kind = Type; + name = name; + ty = Some (Osig_type ( +- (name,List.map (fun v -> v,(true,true)) params,def,Asttypes.Public,[]), +- Orec_not)); ++ { otype_name = name; ++ otype_params = List.map (fun v -> v,(true,true)) params; ++ otype_type = def; ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val (Some doc); +@@ -37,11 +40,13 @@ let mkvariant name parent params = { + orig_path = []; + kind = Variant parent; + name = name; +- ty = Some (Osig_type (("", [], +- (match params with [] -> Otyp_sum [] +- | l -> Otyp_tuple l), +- Asttypes.Public, []), +- Outcometree.Orec_not)); ++ ty = Some (Osig_type ( ++ { otype_name = ""; ++ otype_params = []; ++ otype_type = (match params with [] -> Otyp_sum [] ++ | l -> Otyp_tuple l); ++ otype_private = Asttypes.Public; ++ otype_cstrs = [] }, Orec_not)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val None; +@@ -53,7 +58,13 @@ let mkexn name params doc = { + orig_path = []; + kind = Exception; + name = name; +- ty = Some (Osig_exception (name,params)); ++ ty = Some (Osig_typext ({ ++ oext_name = name; ++ oext_type_name = "exn"; ++ oext_type_params = []; ++ oext_args = params; ++ oext_ret_type = None; ++ oext_private = Asttypes.Public }, Oext_exception)); + loc_sig = Lazy.from_val Location.none; + loc_impl = Lazy.from_val Location.none; + doc = Lazy.from_val (Some doc); +diff --git a/src/indexTypes.ml b/src/indexTypes.ml +index cb1ee67..342f86f 100644 +--- a/src/indexTypes.ml ++++ b/src/indexTypes.ml +@@ -35,7 +35,7 @@ type info = { path: string list; + + (** The kind of elements that can be stored in the trie *) + and kind = +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/libIndex.mli b/src/libIndex.mli +index d71b99b..9e27b1c 100644 +--- a/src/libIndex.mli ++++ b/src/libIndex.mli +@@ -44,7 +44,7 @@ type info = IndexTypes.info = private { + + (** The kind of elements that can be stored in the trie *) + and kind = IndexTypes.kind = private +- | Type | Value | Exception ++ | Type | Value | Exception | OpenType + | Field of info | Variant of info + | Method of info + | Module | ModuleType +diff --git a/src/ocp-index.ocp b/src/ocp-index.ocp +index d7f0fc9..47b1a55 100644 +--- a/src/ocp-index.ocp ++++ b/src/ocp-index.ocp +@@ -1,4 +1,5 @@ +-comp += [ "-g" "-w" "+1..39-4-9-37-40" ] ++comp += [ "-g" "-w" "+1..39-4-9-37-40" "-safe-string" ] ++link += [ "-g" "-w" "+1..39-4-9-37-40" ] + + begin library "ocp-index-lib" + sort = false diff --git a/patches/ocp-index/ocaml.4.03.patch.1.1.2 b/patches/ocp-index/ocaml.4.03.patch.1.1.2 new file mode 100644 index 0000000..8b285a9 --- /dev/null +++ b/patches/ocp-index/ocaml.4.03.patch.1.1.2 @@ -0,0 +1,66 @@ +diff --git a/src/grepMain.ml b/src/grepMain.ml +index 2103e3e..cc0212f 100644 +--- a/src/grepMain.ml ++++ b/src/grepMain.ml +@@ -85,7 +85,7 @@ end = struct + Filename.basename + (try Filename.chop_extension f with Invalid_argument _ -> f) + in +- String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s ++ String.mapi (function 0 -> Char.uppercase_ascii | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = + let lookfor = +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index f640bd5..0cc6eb1 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -305,12 +305,21 @@ let trie_of_type_decl ?comments info ty_decl = + (fun { Types.cd_id; cd_args } -> + let ty = + let params = match cd_args with +- | [] -> Outcometree.Otyp_sum [] +- | param::_ -> ++ | Cstr_tuple [] -> Outcometree.Otyp_sum [] ++ | Cstr_tuple (param::_ as l) -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple cd_args; ++ { Types. desc = Types.Ttuple l; + level = param.Types.level; + id = param.Types.id } ++ | Cstr_record params -> ++ Outcometree.Otyp_record ( ++ List.map ++ (fun l -> ++ (Ident.name l.Types.ld_id, ++ l.ld_mutable = Mutable, ++ Printtyp.tree_of_typexp false l.ld_type) ++ ) ++ params) + in + Outcometree.Osig_type (Outcometree.{ + otype_name = ""; +@@ -902,8 +911,8 @@ let load_files t dirfiles = + try + let i = String.rindex file '.' in + let len = String.length file in +- let modul = String.capitalize (String.sub file 0 i) in +- let ext = String.lowercase (String.sub file (i+1) (len-i-1)) in ++ let modul = String.capitalize_ascii (String.sub file 0 i) in ++ let ext = String.lowercase_ascii (String.sub file (i+1) (len-i-1)) in + modul, ext + with Not_found -> file, "" + in +diff --git a/src/indexOut.ml b/src/indexOut.ml +index bf22816..c02821f 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -176,6 +176,8 @@ module IndexFormat = struct + tydecl fmt otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty ++ | Osig_ellipsis -> ++ Format.fprintf fmt "..." + + let ty ?(colorise = no_color) fmt id = + option_iter id.ty diff --git a/patches/ocp-index/ocaml.4.03.patch.1.1.3 b/patches/ocp-index/ocaml.4.03.patch.1.1.3 new file mode 100644 index 0000000..e111bb4 --- /dev/null +++ b/patches/ocp-index/ocaml.4.03.patch.1.1.3 @@ -0,0 +1,88 @@ +diff --git a/opam b/opam +index 7c58305..0050cb7 100644 +--- a/opam ++++ b/opam +@@ -13,7 +13,7 @@ tags: [ + "org:ocamlpro" + "org:typerex" + ] +-dev-repo: "https://github.com/OCamlPro/ocp-index.git#4.02" ++dev-repo: "https://github.com/OCamlPro/ocp-index.git#4.03" + build: [ + ["./configure" "--prefix" prefix] + [make] +@@ -26,7 +26,7 @@ depends: [ + ] + depopts: "lambda-term" + conflicts: "lambda-term" {< "1.7"} +-available: [ocaml-version >= "4.02.0" & ocaml-version < "4.03"] ++available: [ocaml-version >= "4.03"] + messages: "For ocp-browser, please also install package lambda-term" {! lambda-term:installed} + post-messages: + "This package requires additional configuration for use in editors. Either install package 'user-setup', or manually: +diff --git a/src/grepMain.ml b/src/grepMain.ml +index 88b2fa9..a38abfd 100644 +--- a/src/grepMain.ml ++++ b/src/grepMain.ml +@@ -85,7 +85,7 @@ end = struct + Filename.basename + (try Filename.chop_extension f with Invalid_argument _ -> f) + in +- String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s ++ String.mapi (function 0 -> Char.uppercase_ascii | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = + let lookfor = +diff --git a/src/indexBuild.ml b/src/indexBuild.ml +index cf914c0..f4fb5a9 100644 +--- a/src/indexBuild.ml ++++ b/src/indexBuild.ml +@@ -326,12 +326,21 @@ let trie_of_type_decl ?comments info ty_decl = + (fun { Types.cd_id; cd_args; cd_attributes } -> + let ty = + let params = match cd_args with +- | [] -> Outcometree.Otyp_sum [] +- | param::_ -> ++ | Cstr_tuple [] -> Outcometree.Otyp_sum [] ++ | Cstr_tuple (param::_ as l) -> + Printtyp.tree_of_typexp false +- { Types. desc = Types.Ttuple cd_args; ++ { Types. desc = Types.Ttuple l; + level = param.Types.level; + id = param.Types.id } ++ | Cstr_record params -> ++ Outcometree.Otyp_record ( ++ List.map ++ (fun l -> ++ (Ident.name l.Types.ld_id, ++ l.ld_mutable = Mutable, ++ Printtyp.tree_of_typexp false l.ld_type) ++ ) ++ params) + in + Outcometree.Osig_type (Outcometree.{ + otype_name = ""; +@@ -925,8 +934,8 @@ let load_files t dirfiles = + try + let i = String.rindex file '.' in + let len = String.length file in +- let modul = String.capitalize (String.sub file 0 i) in +- let ext = String.lowercase (String.sub file (i+1) (len-i-1)) in ++ let modul = String.capitalize_ascii (String.sub file 0 i) in ++ let ext = String.lowercase_ascii (String.sub file (i+1) (len-i-1)) in + modul, ext + with Not_found -> file, "" + in +diff --git a/src/indexOut.ml b/src/indexOut.ml +index b82b041..d9f69a5 100644 +--- a/src/indexOut.ml ++++ b/src/indexOut.ml +@@ -176,6 +176,8 @@ module IndexFormat = struct + tydecl fmt otype_type + | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty ++ | Osig_ellipsis -> ++ Format.fprintf fmt "..." + + let ty ?(colorise = no_color) fmt id = + option_iter id.ty diff --git a/patches/ocp-index/ocaml.4.03.patch.1.1.4 b/patches/ocp-index/ocaml.4.03.patch.1.1.4 new file mode 100644 index 0000000..1997fc6 --- /dev/null +++ b/patches/ocp-index/ocaml.4.03.patch.1.1.4 @@ -0,0 +1,192 @@ +diff -r -C 2 ocp-index.1.1.4.orig/opam ocp-index.1.1.4/opam +*** ocp-index.1.1.4.orig/opam 2016-05-12 11:00:19.040179931 +0200 +--- ocp-index.1.1.4/opam 2016-05-12 11:00:58.084181600 +0200 +*************** +*** 14,18 **** + "org:typerex" + ] +! dev-repo: "https://github.com/OCamlPro/ocp-index.git#4.02" + build: [ + ["./configure" "--prefix" prefix] +--- 14,18 ---- + "org:typerex" + ] +! dev-repo: "https://github.com/OCamlPro/ocp-index.git#4.03" + build: [ + ["./configure" "--prefix" prefix] +*************** +*** 27,31 **** + depopts: "lambda-term" + conflicts: "lambda-term" {< "1.7"} +! available: [ocaml-version >= "4.02.0" & ocaml-version < "4.03"] + messages: "For ocp-browser, please also install package lambda-term" {! lambda-term:installed} + post-messages: +--- 27,31 ---- + depopts: "lambda-term" + conflicts: "lambda-term" {< "1.7"} +! available: [ocaml-version >= "4.03"] + messages: "For ocp-browser, please also install package lambda-term" {! lambda-term:installed} + post-messages: +diff -r -C 2 ocp-index.1.1.4.orig/src/grepMain.ml ocp-index.1.1.4/src/grepMain.ml +*** ocp-index.1.1.4.orig/src/grepMain.ml 2016-05-12 11:00:19.040179931 +0200 +--- ocp-index.1.1.4/src/grepMain.ml 2016-05-12 11:00:58.152181603 +0200 +*************** +*** 86,90 **** + (try Filename.chop_extension f with Invalid_argument _ -> f) + in +! String.mapi (function 0 -> Char.uppercase | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = +--- 86,90 ---- + (try Filename.chop_extension f with Invalid_argument _ -> f) + in +! String.mapi (function 0 -> Char.uppercase_ascii | _ -> fun x -> x) s + in + let f (curpath, lookfor, last_scope, acc) scope tok pos = +diff -r -C 2 ocp-index.1.1.4.orig/src/indexBuild.ml ocp-index.1.1.4/src/indexBuild.ml +*** ocp-index.1.1.4.orig/src/indexBuild.ml 2016-05-12 11:00:19.040179931 +0200 +--- ocp-index.1.1.4/src/indexBuild.ml 2016-05-12 11:00:58.152181603 +0200 +*************** +*** 222,225 **** +--- 222,226 ---- + Otyp_module (str, strl, List.map aux tylist) + | Otyp_open -> Otyp_open ++ | Otyp_attribute (ty,attr) -> Otyp_attribute(aux ty,attr) + in + aux ty +*************** +*** 234,238 **** + otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) + out_type_decl.otype_cstrs }, rc) +! | Osig_value (str, ty, str2) -> Osig_value (str, qual ty, str2) + | Osig_typext (constr, es) -> + Osig_typext ({ constr with +--- 235,239 ---- + otype_cstrs = List.map (fun (ty1,ty2) -> qual ty1, qual ty2) + out_type_decl.otype_cstrs }, rc) +! | Osig_value v -> Osig_value { v with oval_type = qual v.oval_type } + | Osig_typext (constr, es) -> + Osig_typext ({ constr with +*************** +*** 304,308 **** + | _, PStr [{pstr_desc = Pstr_eval ({pexp_desc},_)}] -> + (match pexp_desc with +! | Pexp_constant (Const_string (s,_)) -> Some s + | _ -> debug "Unexpected ocaml.doc docstring format"; None) + | _ -> None +--- 305,309 ---- + | _, PStr [{pstr_desc = Pstr_eval ({pexp_desc},_)}] -> + (match pexp_desc with +! | Pexp_constant (Pconst_string (s,_)) -> Some s + | _ -> debug "Unexpected ocaml.doc docstring format"; None) + | _ -> None +*************** +*** 323,326 **** +--- 324,328 ---- + otype_type = ty; + otype_private = Asttypes.Public; ++ otype_immediate = false; + otype_cstrs = []; }, Outcometree.Orec_not) + in +*************** +*** 345,354 **** + let ty = + let params = match cd_args with +! | [] -> Outcometree.Otyp_sum [] +! | param::_ -> + Printtyp.tree_of_typexp false +! { Types. desc = Types.Ttuple cd_args; + level = param.Types.level; + id = param.Types.id } + in + Outcometree.Osig_type (Outcometree.{ +--- 347,365 ---- + let ty = + let params = match cd_args with +! | Cstr_tuple [] -> Outcometree.Otyp_sum [] +! | Cstr_tuple (param::_ as l) -> + Printtyp.tree_of_typexp false +! { Types. desc = Types.Ttuple l; + level = param.Types.level; + id = param.Types.id } ++ | Cstr_record params -> ++ Outcometree.Otyp_record ( ++ List.map ++ (fun l -> ++ (Ident.name l.Types.ld_id, ++ l.ld_mutable = Mutable, ++ Printtyp.tree_of_typexp false l.ld_type) ++ ) ++ params) + in + Outcometree.Osig_type (Outcometree.{ +*************** +*** 357,360 **** +--- 368,372 ---- + otype_type = params; + otype_private = Asttypes.Public; ++ otype_immediate = false; + otype_cstrs = []; }, Outcometree.Orec_not) + in +*************** +*** 522,525 **** +--- 534,538 ---- + otype_type = ty; + otype_private = Asttypes.Public; ++ otype_immediate = false; + otype_cstrs = []; }, Outcometree.Orec_not) + in +*************** +*** 947,952 **** + let i = String.rindex file '.' in + let len = String.length file in +! let modul = String.capitalize (String.sub file 0 i) in +! let ext = String.lowercase (String.sub file (i+1) (len-i-1)) in + modul, ext + with Not_found -> file, "" +--- 960,965 ---- + let i = String.rindex file '.' in + let len = String.length file in +! let modul = String.capitalize_ascii (String.sub file 0 i) in +! let ext = String.lowercase_ascii (String.sub file (i+1) (len-i-1)) in + modul, ext + with Not_found -> file, "" +diff -r -C 2 ocp-index.1.1.4.orig/src/indexOut.ml ocp-index.1.1.4/src/indexOut.ml +*** ocp-index.1.1.4.orig/src/indexOut.ml 2016-05-12 11:00:19.040179931 +0200 +--- ocp-index.1.1.4/src/indexOut.ml 2016-05-12 11:00:58.152181603 +0200 +*************** +*** 182,187 **** + | Osig_type ({ otype_type },_) -> + tydecl fmt otype_type +! | Osig_value (_,ty,_) -> + !Oprint.out_type fmt ty + + let ty ?(colorise = no_color) fmt id = +--- 182,189 ---- + | Osig_type ({ otype_type },_) -> + tydecl fmt otype_type +! | Osig_value { oval_type = ty } -> + !Oprint.out_type fmt ty ++ | Osig_ellipsis -> ++ Format.fprintf fmt "..." + + let ty ?(colorise = no_color) fmt id = +diff -r -C 2 ocp-index.1.1.4.orig/src/indexPredefined.ml ocp-index.1.1.4/src/indexPredefined.ml +*** ocp-index.1.1.4.orig/src/indexPredefined.ml 2016-05-12 11:00:19.040179931 +0200 +--- ocp-index.1.1.4/src/indexPredefined.ml 2016-05-12 11:00:58.152181603 +0200 +*************** +*** 29,32 **** +--- 29,33 ---- + otype_type = def; + otype_private = Asttypes.Public; ++ otype_immediate = false; + otype_cstrs = [] }, Orec_not)); + loc_sig = Lazy.from_val Location.none; +*************** +*** 46,49 **** +--- 47,51 ---- + otype_type = (match params with [] -> Otyp_sum [] + | l -> Otyp_tuple l); ++ otype_immediate = false; + otype_private = Asttypes.Public; + otype_cstrs = [] }, Orec_not)); diff --git a/patches/ocp-ocamlres/non-portable-sed-option.diff b/patches/ocp-ocamlres/non-portable-sed-option.diff new file mode 100644 index 0000000..81dfea1 --- /dev/null +++ b/patches/ocp-ocamlres/non-portable-sed-option.diff @@ -0,0 +1,12 @@ +diff -u -r ocp-ocamlres.0.3-orig/Makefile ocp-ocamlres.0.3/Makefile +--- ocp-ocamlres.0.3-orig/Makefile 2014-05-15 14:19:52.000000000 +0200 ++++ ocp-ocamlres.0.3/Makefile 2014-08-28 15:48:37.000000000 +0200 +@@ -76,7 +76,7 @@ + -include .depend + .depend: + ocamlfind ocamldep -I src -package $(PACKAGES) $(LIB_ML) > $@ +- sed -i s/src/build/g $@ ++ sed -i.old s/src/build/g $@ + + $(BIN_CMO): build/ocplib-ocamlres.cma + $(BIN_CMX): build/ocplib-ocamlres.cmxa diff --git a/patches/ocp-pack-split/ocp-pack-split.install b/patches/ocp-pack-split/ocp-pack-split.install new file mode 100644 index 0000000..ae1f830 --- /dev/null +++ b/patches/ocp-pack-split/ocp-pack-split.install @@ -0,0 +1,4 @@ +bin: [ + "ocp-pack" {"ocp-pack"} + "ocp-split" {"ocp-split"} +] diff --git a/patches/ocp-pp/0001-Fix-ocp-pp-for-changes-in-compiler-libs.patch b/patches/ocp-pp/0001-Fix-ocp-pp-for-changes-in-compiler-libs.patch new file mode 100644 index 0000000..09e1227 --- /dev/null +++ b/patches/ocp-pp/0001-Fix-ocp-pp-for-changes-in-compiler-libs.patch @@ -0,0 +1,57 @@ +From 79c47d87adb12a9d4ec7e866bd8945a9540044ea Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 8 Mar 2019 23:21:06 +0100 +Subject: [PATCH] Fix ocp-pp for changes in compiler-libs + +--- + tools/ocp-pp/main.ml | 2 +- + tools/ocp-pp/ocpp.ml | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tools/ocp-pp/main.ml b/tools/ocp-pp/main.ml +index 88b89cb..e744c02 100644 +--- a/tools/ocp-pp/main.ml ++++ b/tools/ocp-pp/main.ml +@@ -137,7 +137,7 @@ let () = + ), " Display general information"; + "--debug", Arg.Set debug, + " Print tokens and corresponding lines"; +- "-I", Arg.String (fun s -> Config.load_path := [s] @ !Config.load_path), ++ "-I", Arg.String (Load_path.add_dir), + " Add directory to path searched for include files"; + ] in + Arg.parse arg_list preprocess_filename arg_usage; +diff --git a/tools/ocp-pp/ocpp.ml b/tools/ocp-pp/ocpp.ml +index 2856c11..e05c44d 100644 +--- a/tools/ocp-pp/ocpp.ml ++++ b/tools/ocp-pp/ocpp.ml +@@ -1004,7 +1004,7 @@ and preprocess_directive lexer directive = + if debug_ocpp then + Printf.eprintf "loc_fname = %S\n%!" loc.loc_start.pos_fname; + Format.eprintf "%aWarning: %s\n@." +- Location.print loc (Compat.get_STRING token); ++ Location.print_loc loc (Compat.get_STRING token); + | _ -> raise Parsing.Parse_error + end; + preprocess lexer +@@ -1016,7 +1016,7 @@ and preprocess_directive lexer directive = + let loc = Location.curr !current_lexbuf in + if debug_ocpp then + Printf.eprintf "loc_fname = %S\n%!" loc.loc_start.pos_fname; +- Format.eprintf "%aError: %s\n@." Location.print loc ++ Format.eprintf "%aError: %s\n@." Location.print_loc loc + (Compat.get_STRING token); + exit 2 + | _ -> raise Parsing.Parse_error +@@ -1118,7 +1118,7 @@ and preprocess_include lexer filename = + local_filename + else + try +- Misc.find_in_path !Config.load_path filename ++ Misc.find_in_path (Load_path.get_paths ())filename + with Not_found -> + if debug_ocpp then + Printf.eprintf "OCPP_INCLUDE current = %S\n%!" current_filename; +-- +2.11.0 + diff --git a/patches/ocsigenserver/build-against-recent-lwt.diff b/patches/ocsigenserver/build-against-recent-lwt.diff new file mode 100644 index 0000000..e9d8ddb --- /dev/null +++ b/patches/ocsigenserver/build-against-recent-lwt.diff @@ -0,0 +1,39 @@ +From dcf9988313f4e3110c12065ea889a1ee2a9badd8 Mon Sep 17 00:00:00 2001 +From: Mauricio Fernandez +Date: Sun, 26 Apr 2015 12:42:47 +0200 +Subject: [PATCH] Fix build against recent Lwt. + +--- + src/extensions/ocsigen_comet.ml | 2 +- + src/server/ocsigen_server.ml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/extensions/ocsigen_comet.ml b/src/extensions/ocsigen_comet.ml +index ad7d9dd..ccc0719 100644 +--- a/src/extensions/ocsigen_comet.ml ++++ b/src/extensions/ocsigen_comet.ml +@@ -468,7 +468,7 @@ end = struct + Lwt.choose + [ (choosed >|= fun x -> Some x); + (Lwt_unix.sleep (get_timeout ()) >|= fun () -> None); +- (Lwt_event.next Security.kill >>= fun () -> Lwt.fail Kill); ++ (Lwt_react.E.next Security.kill >>= fun () -> Lwt.fail Kill); + ] >|= fun x -> + List.iter (fun c -> Channels.send_listeners c (-1)) active ; + let s = Messages.encode_downgoing ended x in +diff --git a/src/server/ocsigen_server.ml b/src/server/ocsigen_server.ml +index c5563a6..e548f5e 100644 +--- a/src/server/ocsigen_server.ml ++++ b/src/server/ocsigen_server.ml +@@ -1040,7 +1040,7 @@ let rec wait_connection use_ssl port socket = + >>= decr_connected + in + +- Lwt_util.iter handle_one l >>= fun () -> ++ Lwt_list.iter_p handle_one l >>= fun () -> + match e with + | Some e -> handle_exn e + | None -> Lwt.return ()) +-- +1.8.5.2 + diff --git a/patches/ocsigenserver/fix-build-with-ocsipersist-sqlite.diff b/patches/ocsigenserver/fix-build-with-ocsipersist-sqlite.diff new file mode 100644 index 0000000..6db0f9c --- /dev/null +++ b/patches/ocsigenserver/fix-build-with-ocsipersist-sqlite.diff @@ -0,0 +1,47 @@ +From 42eef0caa729a39467fdac61e4120a5cefabd4e4 Mon Sep 17 00:00:00 2001 +From: Mauricio Fernandez +Date: Sun, 26 Apr 2015 17:22:56 +0200 +Subject: [PATCH] Check against lwt.preemptive instead of lwt.extra in + configure script. + +--- + Makefile.options | 2 +- + configure | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile.options b/Makefile.options +index bd3a8fa..060cdbe 100644 +--- a/Makefile.options ++++ b/Makefile.options +@@ -26,7 +26,7 @@ endif + ## but also to generate src/baselib/ocsigen_config.ml and src/files/META + + ifeq "$(PREEMPTIVE)" "YES" +-LWT_EXTRA_PACKAGE:=lwt.extra ++LWT_EXTRA_PACKAGE:=lwt.preemptive + endif + + BASE_PACKAGE := lwt ipaddr +diff --git a/configure b/configure +index 2e786ed..cec8fe7 100755 +--- a/configure ++++ b/configure +@@ -454,12 +454,12 @@ if [ "$with_camlzip" -gt 0 ]; then + fi + fi + +-# Check Lwt.extra ++# Check lwt.preemptive + if [ "$with_preempt" -gt 0 ]; then +- if test_library lwt.extra; then ++ if test_library lwt.preemptive; then + echo -n + elif [ "$with_preempt" -gt 1 ]; then +- fail_library lwt.extra "Missing support for 'extra' in lwt." ++ fail_library lwt.extra "Missing support for 'preemptive' in lwt." + else + with_preempt=0 + fi +-- +1.8.5.2 + diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.1 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.1 new file mode 100644 index 0000000..3744671 --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.1 @@ -0,0 +1,35 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.10 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.10 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.10 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.11.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.11.0 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.11.0 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.12.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.12.0 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.12.0 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.13.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.13.0 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.13.0 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.14.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.14.0 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.14.0 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.15.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.15.0 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.15.0 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.16.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.16.0 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.16.0 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.2.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.2.0 new file mode 100644 index 0000000..3744671 --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.2.0 @@ -0,0 +1,35 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.3.1 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.3.1 new file mode 100644 index 0000000..3744671 --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.3.1 @@ -0,0 +1,35 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.4.0 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.4.0 new file mode 100644 index 0000000..3744671 --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.4.0 @@ -0,0 +1,35 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.5 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.5 new file mode 100644 index 0000000..3744671 --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.5 @@ -0,0 +1,35 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.6 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.6 new file mode 100644 index 0000000..3744671 --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.6 @@ -0,0 +1,35 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.7 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.7 new file mode 100644 index 0000000..3744671 --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.7 @@ -0,0 +1,35 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.8 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.8 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.8 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/fix-gmake-4.3.patch.2.9 b/patches/ocsigenserver/fix-gmake-4.3.patch.2.9 new file mode 100644 index 0000000..0a2f43f --- /dev/null +++ b/patches/ocsigenserver/fix-gmake-4.3.patch.2.9 @@ -0,0 +1,48 @@ +commit 014aefc4e460686a361b974f16ebb7e0c993b36b (from e9ab14a4437640656117aed30a1ee5b6227f07de) +Merge: e9ab14a4 5cc446bd +Author: Jerome Vouillon +Date: Mon Feb 10 13:33:26 2020 +0100 + + Merge pull request #182 from Codeizer/patch-1 + + Compilation error + +diff --git a/src/extensions/ocsipersist-dbm/Makefile b/src/extensions/ocsipersist-dbm/Makefile +index 45064a32..5811b260 100644 +--- a/src/extensions/ocsipersist-dbm/Makefile ++++ b/src/extensions/ocsipersist-dbm/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt.unix lwt_log xml-light dbm + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-pgsql/Makefile b/src/extensions/ocsipersist-pgsql/Makefile +index d0a1fc14..9c4f31b2 100644 +--- a/src/extensions/ocsipersist-pgsql/Makefile ++++ b/src/extensions/ocsipersist-pgsql/Makefile +@@ -4,7 +4,7 @@ PACKAGE := xml-light pgocaml lwt lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep +diff --git a/src/extensions/ocsipersist-sqlite/Makefile b/src/extensions/ocsipersist-sqlite/Makefile +index 6b0f6fea..13b1b2a6 100644 +--- a/src/extensions/ocsipersist-sqlite/Makefile ++++ b/src/extensions/ocsipersist-sqlite/Makefile +@@ -4,7 +4,7 @@ PACKAGE := lwt lwt_log xml-light sqlite3 + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} +-OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} ++OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc + OCAMLDEP := $(OCAMLFIND) ocamldep diff --git a/patches/ocsigenserver/ocsigenserver.install b/patches/ocsigenserver/ocsigenserver.install new file mode 100644 index 0000000..8756cf2 --- /dev/null +++ b/patches/ocsigenserver/ocsigenserver.install @@ -0,0 +1,4 @@ +bin: [ + "src/server/ocsigenserver" + "src/server/ocsigenserver.opt" +] diff --git a/patches/ocsigenserver/use_netstring-pcre.patch b/patches/ocsigenserver/use_netstring-pcre.patch new file mode 100644 index 0000000..c440dbf --- /dev/null +++ b/patches/ocsigenserver/use_netstring-pcre.patch @@ -0,0 +1,44 @@ +diff -ur ocsigenserver.2.2.0/Makefile.options ocsigenserver.2.2.0-patched/Makefile.options +--- ocsigenserver.2.2.0/Makefile.options 2012-12-08 00:17:09.000000000 +0900 ++++ ocsigenserver.2.2.0-patched/Makefile.options 2013-07-03 21:29:47.000000000 +0900 +@@ -34,6 +34,7 @@ + SERVER_PACKAGE := lwt.ssl \ + ${LWT_EXTRA_PACKAGE} \ + netstring \ ++ netstring-pcre \ + findlib \ + cryptokit \ + tyxml \ +diff -ur ocsigenserver.2.2.0/src/baselib/Makefile ocsigenserver.2.2.0-patched/src/baselib/Makefile +--- ocsigenserver.2.2.0/src/baselib/Makefile 2012-12-08 00:17:09.000000000 +0900 ++++ ocsigenserver.2.2.0-patched/src/baselib/Makefile 2013-07-03 21:25:11.000000000 +0900 +@@ -1,6 +1,6 @@ + include ../../Makefile.config + +-LIBS := -package lwt.unix,netstring,cryptokit,findlib,tyxml,lwt.syntax,${LWT_EXTRA_PACKAGE} ++LIBS := -package lwt.unix,netstring,netstring-pcre,cryptokit,findlib,tyxml,lwt.syntax,${LWT_EXTRA_PACKAGE} + OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} + OCAMLDOC := $(OCAMLFIND) ocamldoc +diff -ur ocsigenserver.2.2.0/src/extensions/Makefile ocsigenserver.2.2.0-patched/src/extensions/Makefile +--- ocsigenserver.2.2.0/src/extensions/Makefile 2012-12-08 00:17:09.000000000 +0900 ++++ ocsigenserver.2.2.0-patched/src/extensions/Makefile 2013-07-03 21:32:06.000000000 +0900 +@@ -4,6 +4,7 @@ + lwt.ssl \ + lwt.react \ + netstring \ ++ netstring-pcre \ + tyxml.parser \ + + LIBS := -I ../baselib -I ../http -I ../server ${addprefix -package ,${PACKAGE}} +diff -ur ocsigenserver.2.2.0/src/http/Makefile ocsigenserver.2.2.0-patched/src/http/Makefile +--- ocsigenserver.2.2.0/src/http/Makefile 2012-12-08 00:17:09.000000000 +0900 ++++ ocsigenserver.2.2.0-patched/src/http/Makefile 2013-07-03 21:25:19.000000000 +0900 +@@ -1,6 +1,6 @@ + include ../../Makefile.config + +-LIBS := -package netstring,lwt.ssl,tyxml -I ../baselib ++LIBS := -package netstring,netstring-pcre,lwt.ssl,tyxml -I ../baselib + OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} + OCAMLDOC := $(OCAMLFIND) ocamldoc diff --git a/patches/ocurl/examples.diff b/patches/ocurl/examples.diff new file mode 100644 index 0000000..c18036a --- /dev/null +++ b/patches/ocurl/examples.diff @@ -0,0 +1,28 @@ +commit 52dac4419fe23c7bbfc27bee060ed38d0153be98 +Author: ygrek +Date: Sun Nov 8 18:07:08 2015 -0800 + + do not build examples by default (fix #10) + +diff --git a/Makefile.in b/Makefile.in +index 3f93a2f..9374397 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -49,7 +49,7 @@ endif + + all: + @$(MAKE) depend +- @$(MAKE) targets ++ @$(MAKE) $(TARGETS) + + build: all + +@@ -75,8 +75,6 @@ else + ocamldoc -html -d doc curl.mli + endif + +-targets: $(TARGETS) examples +- + examples: + (cd examples; $(MAKE)) + diff --git a/patches/ocurl/fix_depend.diff b/patches/ocurl/fix_depend.diff new file mode 100644 index 0000000..4a72b9e --- /dev/null +++ b/patches/ocurl/fix_depend.diff @@ -0,0 +1,19 @@ +commit fbe426ff8543050b6acd00ca0572024d656b4694 (HEAD, master) +Author: ygrek +Date: Mon May 16 23:06:29 2016 +0300 + + Makefile: fix build on OCaml < 4.02.0 + +diff --git a/Makefile.in b/Makefile.in +index 8990bdf..dc1d2f0 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -158,7 +158,7 @@ distclean: clean + @rm -f Makefile + + depend: +- @$(OCAMLDEP) *.mli *.ml > .depend ++ @$(OCAMLDEP) *.mli $(filter-out errors.ml print_ext.ml, $(wildcard *.ml)) > .depend + + ifeq ($(wildcard .depend),.depend) + ifneq ($(MAKECMDGOALS),clean) diff --git a/patches/odb-server/opam.patch.in b/patches/odb-server/opam.patch.in new file mode 100644 index 0000000..6217667 --- /dev/null +++ b/patches/odb-server/opam.patch.in @@ -0,0 +1,19 @@ +diff -ru odb-server.0.1/Makefile odb-server.0.1/Makefile +--- odb-server.0.1/Makefile 2011-11-09 14:17:39.000000000 +0100 ++++ odb-server.0.1/Makefile 2012-10-05 18:14:58.789856354 +0200 +@@ -135,7 +135,7 @@ + $(MKDIR) $(INSTALLDIR) + $(CP) $(LIB_CMIFILES) $(LIB) $(LIB_BYTE) $(LIB:.cmxa=.a) \ + `ls $(SERVER_CMIFILES) | grep -v server.cmi` $(INSTALLDIR) +- $(CP) $(SERVER) $(CLIENT) `dirname \`which $(OCAMLC)\``/ ++ $(CP) $(SERVER) $(CLIENT) %{bin}% + + #### + oug: +@@ -214,4 +214,4 @@ + .depend depend: + ocamldep -pp $(CAMLP4O) *.ml > .depend + +-include .depend +\ Pas de fin de ligne à la fin du fichier ++include .depend diff --git a/patches/odnnr/install_keras.r b/patches/odnnr/install_keras.r new file mode 100644 index 0000000..4aa8301 --- /dev/null +++ b/patches/odnnr/install_keras.r @@ -0,0 +1,8 @@ +pkg <- 'keras' +if (!require(pkg, character.only = TRUE)) { + install.packages(pkg, dependencies = TRUE, repos='http://cran.r-project.org') +} +library(keras) +# CPU version; GPU version requires '= "gpu"' and installing all the +# required dependencies (like Nvidia proprietary packages) is a mess +install_keras(method = "conda", tensorflow = "cpu") diff --git a/patches/odoc-parser/0001-Don-t-make-parser-tests-installable.patch b/patches/odoc-parser/0001-Don-t-make-parser-tests-installable.patch new file mode 100644 index 0000000..409d1e2 --- /dev/null +++ b/patches/odoc-parser/0001-Don-t-make-parser-tests-installable.patch @@ -0,0 +1,25 @@ +From a29977ba0ca1e5617a24bc8693d033a085563ff3 Mon Sep 17 00:00:00 2001 +From: Jules Aguillon +Date: Tue, 12 Dec 2023 15:53:06 +0100 +Subject: [PATCH] Don't make parser tests installable + +This makes the regular build of odoc-parser to depend on its +test-dependencies, making it fail. +--- + src/parser/test/dune | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/parser/test/dune b/src/parser/test/dune +index 28c4d82f7..c6769550d 100644 +--- a/src/parser/test/dune ++++ b/src/parser/test/dune +@@ -1,6 +1,5 @@ + (library + (name odoc_parser_test) +- (package odoc-parser) + (inline_tests) + (enabled_if + (>= %{ocaml_version} 4.04.1)) +-- +2.40.1 + diff --git a/patches/omake/fam.patch b/patches/omake/fam.patch new file mode 100644 index 0000000..2311508 --- /dev/null +++ b/patches/omake/fam.patch @@ -0,0 +1,12 @@ +diff -ru a/lib/configure/Configure.om b/lib/configure/Configure.om +--- a/lib/configure/Configure.om ++++ b/lib/configure/Configure.om +@@ -266,7 +266,7 @@ + # \end{doc} + # + public.CheckCLib(libs, funs) = +- CFLAGS += $(addprefix -l, $(libs)) ++ LDFLAGS += $(addprefix -l, $(libs)) + + return $(TryLinkC $""" + #ifdef __cplusplus diff --git a/patches/omake/lib_build_OCaml.om.diff b/patches/omake/lib_build_OCaml.om.diff new file mode 100644 index 0000000..7b8023c --- /dev/null +++ b/patches/omake/lib_build_OCaml.om.diff @@ -0,0 +1,13 @@ +diff --git a/lib/build/OCaml.om b/lib/build/OCaml.om +index 8d00490..8fa3a6b 100644 +--- a/lib/build/OCaml.om ++++ b/lib/build/OCaml.om +@@ -181,7 +181,7 @@ private.get_bytecomp_c_comp() = + # Figure out the params for the C compiler + # + private.c_comp = $(get_c_comp) +- if $(equal X$(c_comp)X, XX) ++ if $(equal X$(string $(c_comp))X, XX) + private.bytecomp_c_comp = $(get_bytecomp_c_comp) + OCAML_CC = $(nth-hd 1, $(bytecomp_c_comp)) + OCAML_CFLAGS = $(nth-tl 1, $(bytecomp_c_comp)) diff --git a/patches/omake/netbsd_fam.patch b/patches/omake/netbsd_fam.patch new file mode 100644 index 0000000..b6a52a4 --- /dev/null +++ b/patches/omake/netbsd_fam.patch @@ -0,0 +1,26 @@ +$NetBSD: patch-ab,v 1.1.1.1 2010/05/29 10:43:14 obache Exp $ + +--- a/src/libmojave-external/cutil/fam_kqueue.c.orig 2010-05-28 09:23:46.000000000 +0000 ++++ b/src/libmojave-external/cutil/fam_kqueue.c +@@ -181,6 +181,12 @@ static kevent_t *new_kevent() { + return ev; + } + ++#if defined(__NetBSD__) ++typedef intptr_t kqueue_udata_t; ++#else ++typedef void *kqueue_udata_t; ++#endif ++ + /* + * Start monitoring a directory. + * We store the DirInfo pointer as the userdata in the kevent. +@@ -199,7 +205,7 @@ static int monitor_start(FAMConnection * + dir->kevent = kev; + /* Register interest in the MON_FLAGS flags of the dir */ + EV_SET(kev, dir->handle, EVFILT_VNODE, EV_ADD | EV_CLEAR, MON_FLAGS, +- (intptr_t) NULL, (void *)dir); ++ (intptr_t) NULL, (kqueue_udata_t) dir); + code = kevent(fc->id, kev, 1, NULL, 0, &gTime0); + #ifdef FAM_DEBUG + fprintf(stderr, diff --git a/patches/omake/omake.install b/patches/omake/omake.install new file mode 100644 index 0000000..90b325d --- /dev/null +++ b/patches/omake/omake.install @@ -0,0 +1,5 @@ +bin: [ + "src/main/omake.opt" {"osh"} + "src/main/omake.opt" {"omake"} + "src/main/cvs_realclean.opt" {"cvs_realclean"} +] diff --git a/patches/omake/opam.patch b/patches/omake/opam.patch new file mode 100644 index 0000000..3308fd3 --- /dev/null +++ b/patches/omake/opam.patch @@ -0,0 +1,12 @@ +diff -ru a/OMakefile b/OMakefile +--- a/OMakefile 2010-10-27 02:42:37.000000000 +0200 ++++ b/OMakefile 2012-10-05 18:14:52.045652506 +0200 +@@ -57,7 +57,7 @@ + # + # OCaml options + # +-OCAMLFLAGS[] += -w Ae$(if $(OCAML_ACCEPTS_Z_WARNING), z) ++OCAMLFLAGS[] += -w a + if $(THREADS_ENABLED) + OCAMLFLAGS += -thread + export diff --git a/patches/omake/readline.patch b/patches/omake/readline.patch new file mode 100644 index 0000000..b1d7a6c --- /dev/null +++ b/patches/omake/readline.patch @@ -0,0 +1,11 @@ +--- a/lib/configure/readline.om ++++ b/lib/configure/readline.om +@@ -39,7 +39,7 @@ + READLINE_CFLAGS += -DREADLINE_ENABLED + + # Test for GNU +- if $(CheckLib ncurses readline, rl_on_new_line) ++ if $(and $(not $(equal $(SYSNAME), Darwin)), $(CheckLib ncurses readline, rl_on_new_line)) + READLINE_GNU = true + READLINE_CFLAGS += -DREADLINE_GNU + export diff --git a/patches/omd/_oasis_remove_.ml b/patches/omd/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/omd/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/omd/omd.install.0.2 b/patches/omd/omd.install.0.2 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.3 b/patches/omd/omd.install.0.3 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.4 b/patches/omd/omd.install.0.4 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.5 b/patches/omd/omd.install.0.5 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.5.4 b/patches/omd/omd.install.0.5.4 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.5.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.5.5 b/patches/omd/omd.install.0.5.5 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.5.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.6.0 b/patches/omd/omd.install.0.6.0 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.6.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.6.1 b/patches/omd/omd.install.0.6.1 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.6.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.6.2 b/patches/omd/omd.install.0.6.2 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.6.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.6.3 b/patches/omd/omd.install.0.6.3 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.6.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.6.4 b/patches/omd/omd.install.0.6.4 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.6.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.6.5 b/patches/omd/omd.install.0.6.5 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.6.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.7.0 b/patches/omd/omd.install.0.7.0 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.7.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.7.1 b/patches/omd/omd.install.0.7.1 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.7.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.7.2 b/patches/omd/omd.install.0.7.2 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.7.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.7.3 b/patches/omd/omd.install.0.7.3 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.7.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.7.4 b/patches/omd/omd.install.0.7.4 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.7.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.7.5 b/patches/omd/omd.install.0.7.5 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.7.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.8.0 b/patches/omd/omd.install.0.8.0 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.8.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.8.1 b/patches/omd/omd.install.0.8.1 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.8.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.8.2 b/patches/omd/omd.install.0.8.2 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.8.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.9.0 b/patches/omd/omd.install.0.9.0 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.9.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.9.1 b/patches/omd/omd.install.0.9.1 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.9.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.9.3 b/patches/omd/omd.install.0.9.3 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.9.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.9.4 b/patches/omd/omd.install.0.9.4 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.9.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.9.5 b/patches/omd/omd.install.0.9.5 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.9.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.9.6 b/patches/omd/omd.install.0.9.6 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.9.6 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.0.9.7 b/patches/omd/omd.install.0.9.7 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.0.9.7 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.0.0 b/patches/omd/omd.install.1.0.0 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.0.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.0.1 b/patches/omd/omd.install.1.0.1 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.0.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.1.0 b/patches/omd/omd.install.1.1.0 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.1.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.1.1 b/patches/omd/omd.install.1.1.1 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.1.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.1.2 b/patches/omd/omd.install.1.1.2 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.1.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.1.3 b/patches/omd/omd.install.1.1.3 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.1.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.2.0 b/patches/omd/omd.install.1.2.0 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.2.0 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.2.1 b/patches/omd/omd.install.1.2.1 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.2.1 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.2.2 b/patches/omd/omd.install.1.2.2 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.2.2 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.2.3 b/patches/omd/omd.install.1.2.3 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.2.3 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.2.4 b/patches/omd/omd.install.1.2.4 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.2.4 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.2.5 b/patches/omd/omd.install.1.2.5 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.2.5 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.2.6 b/patches/omd/omd.install.1.2.6 new file mode 100644 index 0000000..c430b5f --- /dev/null +++ b/patches/omd/omd.install.1.2.6 @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/omd_main.byte" {"omd"} + "?_build/src/omd_main.native" {"omd"} +] diff --git a/patches/omd/omd.install.1.3.0 b/patches/omd/omd.install.1.3.0 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/omd/omd.install.1.3.0 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/opa-base/META.1.1.0+4263 b/patches/opa-base/META.1.1.0+4263 new file mode 100644 index 0000000..d0844f4 --- /dev/null +++ b/patches/opa-base/META.1.1.0+4263 @@ -0,0 +1,6 @@ +version = "1.1.0+4263" +description = "Extended standard library developped along the OPA language" +requires = "threads, unix, ulex, camlzip, ocamlgraph" +archive(byte) = "libbase.cma" +archive(native) = "libbase.cmxa" +exists_if = "libbase.cma" diff --git a/patches/opa-base/configure_notty.patch b/patches/opa-base/configure_notty.patch new file mode 100644 index 0000000..b152d2d --- /dev/null +++ b/patches/opa-base/configure_notty.patch @@ -0,0 +1,28 @@ +diff --git a/configure b/configure +index 37b6945..f4fd9e0 100755 +--- a/configure ++++ b/configure +@@ -84,11 +84,11 @@ echo -n > $CONFIG_LOG + echo-check() { echo -n "Checking $*... " >&2 ; echo "# CHECK-START: $*" >> $CONFIG_LOG; } + echo-ok() { + local opts=; if [ "X$1" = "X-n" ]; then shift; opts="-n"; fi +- echo $opts "$*" >&2 ; echo $opts -e "# CHECK-OK: $*\n" >> $CONFIG_LOG; ++ echo $opts "$*" >&2 ; echo $opts -e "# CHECK-OK: $*\n" >> $CONFIG_LOG; + } +-echo-ok-tag() { echo "OK" >&2 ; echo -e "# CHECK-OK\n" >> $CONFIG_LOG; } +-echo-err() { echo "$*" >&2 ; echo -e "# CHECK-FAIL: $*\n" >> $CONFIG_LOG; } +-echo-skip() { echo "$*" >&2 ; echo -e "# CHECK-SKIP: $*\n" >> $CONFIG_LOG; } ++echo-ok-tag() { echo "OK" >&2 ; echo -e "# CHECK-OK\n" >> $CONFIG_LOG; } ++echo-err() { echo "$*" >&2 ; echo -e "# CHECK-FAIL: $*\n" >> $CONFIG_LOG; } ++echo-skip() { echo "$*" >&2 ; echo -e "# CHECK-SKIP: $*\n" >> $CONFIG_LOG; } + + # check OS + echo-check your OS +@@ -688,6 +688,6 @@ fi + { + echo + echo "Congrats, you're all set. Installation will be done in:" +- echo " $PREFIX" ++ echo " $PREFIX" + echo + } >&2 diff --git a/patches/opa-base/ocamlfind.patch b/patches/opa-base/ocamlfind.patch new file mode 100644 index 0000000..24cab3a --- /dev/null +++ b/patches/opa-base/ocamlfind.patch @@ -0,0 +1,15 @@ +diff --git a/configure b/configure +index 6b25ac3..3f7fc63 100755 +--- a/configure ++++ b/configure +@@ -374,7 +374,9 @@ if [ -n "${NO_OCAMLFIND:-}" ]; then + OCAMLFIND= + echo-skip Disabled + elif [ -z "${OCAMLFIND:-}" ]; then +- OCAMLFIND=$OCAMLOPT_DIR/ocamlfind ++ if ! OCAMLFIND=$(which ocamlfind); then ++ OCAMLFIND=$OCAMLOPT_DIR/ocamlfind ++ fi + if [ ! -x "$OCAMLFIND" ]; then + OCAMLFIND=$OCAMLLIB/../../bin/ocamlfind + fi diff --git a/patches/opa-base/opa-base.install b/patches/opa-base/opa-base.install new file mode 100644 index 0000000..d8f44a3 --- /dev/null +++ b/patches/opa-base/opa-base.install @@ -0,0 +1,216 @@ +lib: [ + "META" + "_build/ocamllib/libbase.cma" + "_build/ocamllib/libbase.cmxa" + "_build/ocamllib/libbase.a" + "_build/ocamllib/libbase/abstr.cmi" + "_build/ocamllib/libbase/abstr.cmx" + "_build/ocamllib/libbase/ansi.cmi" + "_build/ocamllib/libbase/ansi.cmx" + "_build/ocamllib/libbase/baseArg.cmi" + "_build/ocamllib/libbase/baseArg.cmx" + "_build/ocamllib/libbase/baseArray.cmi" + "_build/ocamllib/libbase/baseArray.cmx" + "_build/ocamllib/libbase/baseChar.cmi" + "_build/ocamllib/libbase/baseChar.cmx" + "_build/ocamllib/libbase/base.cmi" + "_build/ocamllib/libbase/base.cmx" + "_build/ocamllib/libbase/baseFilename.cmi" + "_build/ocamllib/libbase/baseFilename.cmx" + "_build/ocamllib/libbase/baseFormat.cmi" + "_build/ocamllib/libbase/baseFormat.cmx" + "_build/ocamllib/libbase/baseHashtbl.cmi" + "_build/ocamllib/libbase/baseHashtbl.cmx" + "_build/ocamllib/libbase/baseInt64.cmi" + "_build/ocamllib/libbase/baseInt64.cmx" + "_build/ocamllib/libbase/baseLazy.cmi" + "_build/ocamllib/libbase/baseLazy.cmx" + "_build/ocamllib/libbase/baseList.cmi" + "_build/ocamllib/libbase/baseList.cmx" + "_build/ocamllib/libbase/baseMap.cmi" + "_build/ocamllib/libbase/baseMap.cmx" + "_build/ocamllib/libbase/baseMapSig.cmi" + "_build/ocamllib/libbase/baseMapSig.cmx" + "_build/ocamllib/libbase/baseMarshal.cmi" + "_build/ocamllib/libbase/baseMarshal.cmx" + "_build/ocamllib/libbase/baseObj.cmi" + "_build/ocamllib/libbase/baseObj.cmx" + "_build/ocamllib/libbase/baseRandom.cmi" + "_build/ocamllib/libbase/baseRandom.cmx" + "_build/ocamllib/libbase/baseSet.cmi" + "_build/ocamllib/libbase/baseSet.cmx" + "_build/ocamllib/libbase/baseSetSig.cmi" + "_build/ocamllib/libbase/baseSetSig.cmx" + "_build/ocamllib/libbase/baseString.cmi" + "_build/ocamllib/libbase/baseString.cmx" + "_build/ocamllib/libbase/baseStringSlice.cmi" + "_build/ocamllib/libbase/baseStringSlice.cmx" + "_build/ocamllib/libbase/baseSys.cmi" + "_build/ocamllib/libbase/baseSys.cmx" + "_build/ocamllib/libbase/baseUnix.cmi" + "_build/ocamllib/libbase/baseUnix.cmx" + "_build/ocamllib/libbase/baseUtf8.cmi" + "_build/ocamllib/libbase/baseUtf8.cmx" + "_build/ocamllib/libbase/bslServerLib.cmi" + "_build/ocamllib/libbase/bslServerLib.cmx" + "_build/ocamllib/libbase/bson.cmi" + "_build/ocamllib/libbase/bson.cmx" + "_build/ocamllib/libbase/buf.cmi" + "_build/ocamllib/libbase/buf.cmx" + "_build/ocamllib/libbase/cactutf.cmi" + "_build/ocamllib/libbase/cactutf.cmx" + "_build/ocamllib/libbase/charf.cmi" + "_build/ocamllib/libbase/charf.cmx" + "_build/ocamllib/libbase/charMap.cmi" + "_build/ocamllib/libbase/charMap.cmx" + "_build/ocamllib/libbase/chrono.cmi" + "_build/ocamllib/libbase/chrono.cmx" + "_build/ocamllib/libbase/consoleAnim.cmi" + "_build/ocamllib/libbase/consoleAnim.cmx" + "_build/ocamllib/libbase/consoleParser.cmi" + "_build/ocamllib/libbase/consoleParser.cmx" + "_build/ocamllib/libbase/counter.cmi" + "_build/ocamllib/libbase/counter.cmx" + "_build/ocamllib/libbase/cps.cmi" + "_build/ocamllib/libbase/cps.cmx" + "_build/ocamllib/libbase/date.cmi" + "_build/ocamllib/libbase/date.cmx" + "_build/ocamllib/libbase/debugMap.cmi" + "_build/ocamllib/libbase/debugMap.cmx" + "_build/ocamllib/libbase/debugPrint.cmi" + "_build/ocamllib/libbase/debugPrint.cmx" + "_build/ocamllib/libbase/debugTracer.cmi" + "_build/ocamllib/libbase/debugTracer.cmx" + "_build/ocamllib/libbase/debugVariables.cmi" + "_build/ocamllib/libbase/debugVariables.cmx" + "_build/ocamllib/libbase/dependenciesOrdering.cmi" + "_build/ocamllib/libbase/dependenciesOrdering.cmx" + "_build/ocamllib/libbase/egg.cmi" + "_build/ocamllib/libbase/egg.cmx" + "_build/ocamllib/libbase/encodings.cmi" + "_build/ocamllib/libbase/encodings.cmx" + "_build/ocamllib/libbase/fBuffer.cmi" + "_build/ocamllib/libbase/fBuffer.cmx" + "_build/ocamllib/libbase/file.cmi" + "_build/ocamllib/libbase/file.cmx" + "_build/ocamllib/libbase/file_mimetype.cmi" + "_build/ocamllib/libbase/file_mimetype.cmx" + "_build/ocamllib/libbase/filePos.cmi" + "_build/ocamllib/libbase/filePos.cmx" + "_build/ocamllib/libbase/fileReader.cmi" + "_build/ocamllib/libbase/fileReader.cmx" + "_build/ocamllib/libbase/fresh.cmi" + "_build/ocamllib/libbase/fresh.cmx" + "_build/ocamllib/libbase/hdList.cmi" + "_build/ocamllib/libbase/hdList.cmx" + "_build/ocamllib/libbase/heap.cmi" + "_build/ocamllib/libbase/heap.cmx" + "_build/ocamllib/libbase/identGenerator.cmi" + "_build/ocamllib/libbase/identGenerator.cmx" + "_build/ocamllib/libbase/imperativeScope.cmi" + "_build/ocamllib/libbase/imperativeScope.cmx" + "_build/ocamllib/libbase/indexer.cmi" + "_build/ocamllib/libbase/indexer.cmx" + "_build/ocamllib/libbase/infixOperator.cmi" + "_build/ocamllib/libbase/infixOperator.cmx" + "_build/ocamllib/libbase/intMap.cmi" + "_build/ocamllib/libbase/intMap.cmx" + "_build/ocamllib/libbase/intSet.cmi" + "_build/ocamllib/libbase/intSet.cmx" + "_build/ocamllib/libbase/iterSig.cmi" + "_build/ocamllib/libbase/iterSig.cmx" + "_build/ocamllib/libbase/jsonLex.cmi" + "_build/ocamllib/libbase/jsonLex.cmx" + "_build/ocamllib/libbase/jsonParse.cmi" + "_build/ocamllib/libbase/jsonParse.cmx" + "_build/ocamllib/libbase/jsonPrint.cmi" + "_build/ocamllib/libbase/jsonPrint.cmx" + "_build/ocamllib/libbase/jsonTypes.cmi" + "_build/ocamllib/libbase/jsonTypes.cmx" + "_build/ocamllib/libbase/json_utils.cmi" + "_build/ocamllib/libbase/json_utils.cmx" + "_build/ocamllib/libbase/listHashtbl.cmi" + "_build/ocamllib/libbase/listHashtbl.cmx" + "_build/ocamllib/libbase/listMap.cmi" + "_build/ocamllib/libbase/listMap.cmx" + "_build/ocamllib/libbase/listMapSig.cmi" + "_build/ocamllib/libbase/listMapSig.cmx" + "_build/ocamllib/libbase/loop.cmi" + "_build/ocamllib/libbase/loop.cmx" + "_build/ocamllib/libbase/mlstate_platform.cmi" + "_build/ocamllib/libbase/mlstate_platform.cmx" + "_build/ocamllib/libbase/mongo.cmi" + "_build/ocamllib/libbase/mongo.cmx" + "_build/ocamllib/libbase/mutableList.cmi" + "_build/ocamllib/libbase/mutableList.cmx" + "_build/ocamllib/libbase/option.cmi" + "_build/ocamllib/libbase/option.cmx" + "_build/ocamllib/libbase/order.cmi" + "_build/ocamllib/libbase/order.cmx" + "_build/ocamllib/libbase/orderedTypeDebugableSig.cmi" + "_build/ocamllib/libbase/orderedTypeDebugableSig.cmx" + "_build/ocamllib/libbase/orderedTypeSig.cmi" + "_build/ocamllib/libbase/orderedTypeSig.cmx" + "_build/ocamllib/libbase/pathTransform.cmi" + "_build/ocamllib/libbase/pathTransform.cmx" + "_build/ocamllib/libbase/pool.cmi" + "_build/ocamllib/libbase/pool.cmx" + "_build/ocamllib/libbase/RAList.cmi" + "_build/ocamllib/libbase/RAList.cmx" + "_build/ocamllib/libbase/rcontent.cmi" + "_build/ocamllib/libbase/rcontent.cmx" + "_build/ocamllib/libbase/reader.cmi" + "_build/ocamllib/libbase/reader.cmx" + "_build/ocamllib/libbase/resArray.cmi" + "_build/ocamllib/libbase/resArray.cmx" + "_build/ocamllib/libbase/return.cmi" + "_build/ocamllib/libbase/return.cmx" + "_build/ocamllib/libbase/sed.cmi" + "_build/ocamllib/libbase/sed.cmx" + "_build/ocamllib/libbase/setMap.cmi" + "_build/ocamllib/libbase/setMap.cmx" + "_build/ocamllib/libbase/setMapSig.cmi" + "_build/ocamllib/libbase/setMapSig.cmx" + "_build/ocamllib/libbase/sgzip.cmi" + "_build/ocamllib/libbase/sgzip.cmx" + "_build/ocamllib/libbase/sortHashtbl.cmi" + "_build/ocamllib/libbase/sortHashtbl.cmx" + "_build/ocamllib/libbase/sRope.cmi" + "_build/ocamllib/libbase/sRope.cmx" + "_build/ocamllib/libbase/stringListMap.cmi" + "_build/ocamllib/libbase/stringListMap.cmx" + "_build/ocamllib/libbase/stringMap.cmi" + "_build/ocamllib/libbase/stringMap.cmx" + "_build/ocamllib/libbase/stringReader.cmi" + "_build/ocamllib/libbase/stringReader.cmx" + "_build/ocamllib/libbase/stringSet.cmi" + "_build/ocamllib/libbase/stringSet.cmx" + "_build/ocamllib/libbase/terminal.cmi" + "_build/ocamllib/libbase/terminal.cmx" + "_build/ocamllib/libbase/time.cmi" + "_build/ocamllib/libbase/time.cmx" + "_build/ocamllib/libbase/topologicSort.cmi" + "_build/ocamllib/libbase/topologicSort.cmx" + "_build/ocamllib/libbase/traverse.cmi" + "_build/ocamllib/libbase/traverse.cmx" + "_build/ocamllib/libbase/traverseInterface.cmi" + "_build/ocamllib/libbase/traverseInterface.cmx" + "_build/ocamllib/libbase/tree.cmi" + "_build/ocamllib/libbase/tree.cmx" + "_build/ocamllib/libbase/uchar.cmi" + "_build/ocamllib/libbase/uchar.cmx" + "_build/ocamllib/libbase/unionFind.cmi" + "_build/ocamllib/libbase/unionFind.cmx" + "_build/ocamllib/libbase/weakHashtbl.cmi" + "_build/ocamllib/libbase/weakHashtbl.cmx" + "_build/ocamllib/libbase/weakResArray.cmi" + "_build/ocamllib/libbase/weakResArray.cmx" + "_build/ocamllib/libbase/wsdl2mlCommon.cmi" + "_build/ocamllib/libbase/wsdl2mlCommon.cmx" + "_build/ocamllib/libbase/xml.cmi" + "_build/ocamllib/libbase/xml.cmx" + "_build/ocamllib/libbase/xmlm.cmi" + "_build/ocamllib/libbase/xmlm.cmx" + "_build/ocamllib/libbase/libstubs.a" + "_build/ocamllib/libbase/dllstubs.so" +] diff --git a/patches/opa-base/rm_deps.patch b/patches/opa-base/rm_deps.patch new file mode 100644 index 0000000..21cab04 --- /dev/null +++ b/patches/opa-base/rm_deps.patch @@ -0,0 +1,41 @@ +diff --git a/configure b/configure +index 10bce2c..6b25ac3 100755 +--- a/configure ++++ b/configure +@@ -302,36 +302,6 @@ else + exit 1 + fi >&2 + +-# - checking for java +-echo-check for java +-if which java &>/dev/null; then +- echo-ok found +-else +- echo-err Not found +- exit 1 +-fi +- +-# - checking for nodejs +-echo-check for nodejs +-if which node &>/dev/null; then +- echo-ok found +-else +- echo-err Not found +- exit 1 +-fi +- +-# - checking for nodejs version +-echo-check for nodejs version +-NODE_VERSION=$(node --version) +-NODE_MIN_VERSION="v0.6" +-if [[ $NODE_VERSION > $NODE_MIN_VERSION ]]; then +- echo-ok $NODE_VERSION +-else +- echo-err $NODE_VERSION +- echo "Node $NODE_MIN_VERSION or newer is required" +- exit 1 +-fi +- + # check C libs: + # we depend on libssl, libzip and others, but through + # ocaml libs, so no need to check them directly diff --git a/patches/opam-build-revdeps/_oasis_remove_.ml b/patches/opam-build-revdeps/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/opam-build-revdeps/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/opam-build-revdeps/opam-build-revdeps.install b/patches/opam-build-revdeps/opam-build-revdeps.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/opam-build-revdeps/opam-build-revdeps.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/opam-lib/fix-build.diff b/patches/opam-lib/fix-build.diff new file mode 100644 index 0000000..88e445b --- /dev/null +++ b/patches/opam-lib/fix-build.diff @@ -0,0 +1,84 @@ +commit 9d72ce37e14660d7d6f60e44193e68470b317d4b +Author: Thomas Gazagnaire +Date: Thu Mar 7 08:40:14 2013 +0100 + + Fix build on Linux + +diff --git a/Makefile b/Makefile +index 1ad9aec..b6ad044 100644 +--- a/Makefile ++++ b/Makefile +@@ -7,7 +7,7 @@ TARGETS = opam opam-mk-repo + + .PHONY: all + +-all: $(LOCAL_OCPBUILD) META src/core/opamGitVersion.ml ++all: $(LOCAL_OCPBUILD) META + $(MAKE) clone + $(MAKE) compile + +@@ -27,7 +27,9 @@ OCAMLFIND_DIR=$(shell ocamlfind printconf destdir) + prepare: depends.ocp.in + sed "s|%{lib}%|$(OCAMLFIND_DIR)|g" depends.ocp.in > depends.ocp + +-compile: $(LOCAL_OCPBUILD) ++autogen: src/core/opamGitVersion.ml ++ ++compile: $(LOCAL_OCPBUILD) autogen + $(OCPBUILD) -init -scan -sanitize $(TARGET) + + clone: +@@ -42,7 +44,8 @@ clean: + + distclean: clean + $(MAKE) -C $(SRC_EXT) distclean +- rm -f META Makefile.config src/core/opamVersion.ml config.log config.status ++ rm -f META Makefile.config config.log config.status ++ rm -f src/core/opamVersion.ml src/core/opamGitVersion.ml + + .PHONY: tests + +@@ -67,15 +70,8 @@ tests-git: + META: META.in + sed 's/@VERSION@/$(version)/g' < $< > $@ + +-ISGIT = $(shell git status &> /dev/null && if [ $$? -eq 0 ]; then echo "1"; else echo "0"; fi) +- +-ifeq ($(ISGIT), 1) +-src/core/opamGitVersion.ml: .git/logs/HEAD +- @echo 'let version = Some "$(shell git describe)"' > $@ +-else + src/core/opamGitVersion.ml: +- @echo "let version = None" > $@ +-endif ++ sh shell/get-git-id.sh > $@ + + .PHONY: uninstall install + install: +@@ -129,11 +125,6 @@ doc: compile + src/**/*.mli -html -d doc/html/ + $(MAKE) -C doc + +-trailing: +- find src -name "*.ml*" -exec \ +- sed -i xxx -e :a -e "/^\n*$$/{$$d;N;ba" -e '}' {} \; +- find src -name "*xxx" -exec rm {} \; +- + OPAM_FULL = opam-full-$(version) + OPAM_FILES = $(wildcard src_ext/*.tar.gz)\ + $(wildcard src_ext/*.tbz)\ +diff --git a/shell/get-git-id.sh b/shell/get-git-id.sh +new file mode 100755 +index 0000000..b0d3773 +--- /dev/null ++++ b/shell/get-git-id.sh +@@ -0,0 +1,9 @@ ++#!/bin/sh -e ++ ++if [ -e .git/logs/HEAD ]; then ++ describe=`git describe` ++ echo let version = Some \"${describe}\" ++else ++ echo "let version = None" ++ ++fi diff --git a/patches/opam-lib/fix-wait.diff b/patches/opam-lib/fix-wait.diff new file mode 100644 index 0000000..57d3d95 --- /dev/null +++ b/patches/opam-lib/fix-wait.diff @@ -0,0 +1,19 @@ +diff --git a/src/core/opamProcess.ml b/src/core/opamProcess.ml +index ca64c89..320c42c 100644 +--- a/src/core/opamProcess.ml ++++ b/src/core/opamProcess.ml +@@ -175,9 +175,13 @@ let read_lines f = + List.rev !lines + with Sys_error _ -> [] + ++let rec waitpid p = try Unix.waitpid [] p with ++ | Unix.Unix_error (Unix.EINTR,_,_) -> waitpid p ++ | Unix.Unix_error (Unix.ECHILD,_,_) -> p, Unix.WEXITED 256 ++ + let wait p = + let rec iter () = +- let _, status = Unix.waitpid [] p.p_pid in ++ let _, status = waitpid p.p_pid in + match status with + | Unix.WEXITED code -> + let duration = Unix.gettimeofday () -. p.p_time in diff --git a/patches/opam-lib/ocamlbuild.diff b/patches/opam-lib/ocamlbuild.diff new file mode 100644 index 0000000..ccff11d --- /dev/null +++ b/patches/opam-lib/ocamlbuild.diff @@ -0,0 +1,63 @@ +diff --git a/Makefile b/Makefile +index b4c8c64..de27dde 100644 +--- a/Makefile ++++ b/Makefile +@@ -20,6 +20,23 @@ byte: $(LOCAL_OCPBUILD) + opt: $(LOCAL_OCPBUILD) + $(OCPBUILD) -asm + ++OCAMLBUILD_FLAGS=\ ++ -Is src/core,src/client,src/repositories,src/solver \ ++ -use-ocamlfind -pkgs re.glob,ocamlgraph,cmdliner,cudf,dose \ ++ -classic-display ++with-ocamlbuild: autogen ++ @for i in core repositories solver client; do\ ++ echo Compiling opam-$$i;\ ++ ls src/$$i/*.{ml,mll,mly} 2> /dev/null\ ++ | xargs basename\ ++ | awk -F. "{ print (toupper(substr(\$$1,0,1)) substr(\$$1,2)) }"\ ++ > src/$$i/opam-$$i.mllib;\ ++ ocamlbuild $(OCAMLBUILD_FLAGS) opam-$$i.cma opam-$$i.cmxa;\ ++ rm -f src/$$i/opam-$$i.mllib;\ ++ done;\ ++ ocamlbuild $(OCAMLBUILD_FLAGS) opamMain.native;\ ++ ln -sf _build/src/client/opamMain.native opam ++ + $(LOCAL_OCPBUILD): ocp-build/ocp-build.boot ocp-build/win32_c.c + $(MAKE) -C ocp-build + +@@ -39,6 +56,7 @@ clean: + rm -rf _obuild + rm -f *.annot src/*.annot + rm -f ocp-build.* ++ rm -f _build + $(MAKE) -C $(SRC_EXT) clean + $(MAKE) -C ocp-build clean + +@@ -93,7 +111,7 @@ REPO_LIB = opam-repositories + SOLVER_LIB = opam-solver + CLIENT_LIB = opam-client + +-CORE_NOMLI = opamGlobals.ml ++CORE_NOMLI = opamGlobals.ml opamParser.ml opamLexer.ml opamLineLexer.ml + CORE_MLI = $(foreach i, $(shell find src/core -name "*.mli"), $(notdir $i)) + REPO_MLI = $(foreach i, $(shell find src/repositories -name "*.mli"), $(notdir $i)) + SOLVER_MLI = $(foreach i, $(shell find src/solver -name "*.mli"), $(notdir $i)) +@@ -113,9 +131,17 @@ FILES = $(CORE_FILES:%=_obuild/opam-core/%)\ + $(SOLVER_FILES:%=_obuild/opam-solver/%)\ + $(CLIENT_FILES:%=_obuild/opam-client/%) + ++OCAMLBUILD_FILES =\ ++ $(CORE_FILES:%=_build/src/core/%)\ ++ $(REPO_FILES:%=_build/src/repositories/%)\ ++ $(SOLVER_FILES:%=_build/src/solver/%)\ ++ $(CLIENT_FILES:%=_build/src/client/%) ++ + .PHONY: libuninstall libinstall + libinstall: META + ocamlfind install opam META $(FILES) ++libinstall-with-ocamlbuild: META ++ ocamlfind install opam META $(OCAMLBUILD_FILES) + libuninstall: + ocamlfind remove opam + diff --git a/patches/opass/opass.install b/patches/opass/opass.install new file mode 100644 index 0000000..406049f --- /dev/null +++ b/patches/opass/opass.install @@ -0,0 +1 @@ +bin: ["main.native" {"opass"}] diff --git a/patches/oplay/oplay.install b/patches/oplay/oplay.install new file mode 100644 index 0000000..fa9aa2f --- /dev/null +++ b/patches/oplay/oplay.install @@ -0,0 +1,3 @@ +bin: [ + "oplay.native" { "oplay" } +] diff --git a/patches/oplsr/install_pls.r b/patches/oplsr/install_pls.r new file mode 100644 index 0000000..36993f5 --- /dev/null +++ b/patches/oplsr/install_pls.r @@ -0,0 +1,5 @@ +pkg <- 'pls' +if (!require(pkg, character.only = TRUE)) { + install.packages(pkg, dependencies = TRUE, + repos='http://cran.r-project.org') +} diff --git a/patches/oqamldebug/oqamldebug.install b/patches/oqamldebug/oqamldebug.install new file mode 100644 index 0000000..0699779 --- /dev/null +++ b/patches/oqamldebug/oqamldebug.install @@ -0,0 +1 @@ +bin: ["oqamldebug"] diff --git a/patches/oranger/compile_ranger.sh.0.9.11 b/patches/oranger/compile_ranger.sh.0.9.11 new file mode 100644 index 0000000..cfa6955 --- /dev/null +++ b/patches/oranger/compile_ranger.sh.0.9.11 @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x + +tar xzf 0.9.11.tar.gz + +cd ranger-0.9.11/cpp_version +mkdir build +cd build +cmake ../ +make +cp ranger `opam config var bin`/ml_rf_ranger diff --git a/patches/oranger/compile_ranger.sh.2.0.1 b/patches/oranger/compile_ranger.sh.2.0.1 new file mode 100644 index 0000000..cfa6955 --- /dev/null +++ b/patches/oranger/compile_ranger.sh.2.0.1 @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x + +tar xzf 0.9.11.tar.gz + +cd ranger-0.9.11/cpp_version +mkdir build +cd build +cmake ../ +make +cp ranger `opam config var bin`/ml_rf_ranger diff --git a/patches/oranger/compile_ranger.sh.2.0.2 b/patches/oranger/compile_ranger.sh.2.0.2 new file mode 100644 index 0000000..48b1e5b --- /dev/null +++ b/patches/oranger/compile_ranger.sh.2.0.2 @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x + +tar xzf 0.9.11.tar.gz + +cd ranger-0.9.11/cpp_version +mkdir build +cd build +cmake ../ +make +cp ranger "${1}/ml_rf_ranger" diff --git a/patches/ordma/unsafe_string.patch b/patches/ordma/unsafe_string.patch new file mode 100644 index 0000000..ecbd625 --- /dev/null +++ b/patches/ordma/unsafe_string.patch @@ -0,0 +1,10 @@ +index 2d502eb..57b0e3c 100644 +--- a/test/dune ++++ b/test/dune +@@ -1,7 +1,7 @@ + (executables + (names test lwt_test) + (libraries ordma cmdliner) +- (flags -w -27) ++ (flags -w -27 -unsafe-string) + ) diff --git a/patches/ordma/version.patch b/patches/ordma/version.patch new file mode 100644 index 0000000..b9648bf --- /dev/null +++ b/patches/ordma/version.patch @@ -0,0 +1,19 @@ +diff --git a/dune b/dune +index 04a65be..b43aaf7 100644 +--- a/dune ++++ b/dune +@@ -18,4 +18,5 @@ + echo let summary = major, minor, patch, git_revision") + ) + ) ++ (mode fallback) + ) +diff --git a/ordma_version.ml b/ordma_version.ml +new file mode 100644 +index 0000000..b97886f +--- /dev/null ++++ b/ordma_version.ml +@@ -0,0 +1,3 @@ ++let git_revision = "tags/0.0.5-0-g71dad88" ++let major, minor, patch = 0,0,5 ++let summary = major, minor, patch, git_revision diff --git a/patches/orrandomForest/install_matrix.r b/patches/orrandomForest/install_matrix.r new file mode 100644 index 0000000..393ca7b --- /dev/null +++ b/patches/orrandomForest/install_matrix.r @@ -0,0 +1,5 @@ +pkg <- 'Matrix' +if (!require(pkg, character.only = TRUE)) { + install.packages(pkg, dependencies = TRUE, + repos='http://cran.r-project.org') +} diff --git a/patches/orrandomForest/install_randomForest.r b/patches/orrandomForest/install_randomForest.r new file mode 100644 index 0000000..fb911aa --- /dev/null +++ b/patches/orrandomForest/install_randomForest.r @@ -0,0 +1,5 @@ +pkg <- 'randomForest' +if (!require(pkg, character.only = TRUE)) { + install.packages(pkg, dependencies = TRUE, + repos='http://cran.r-project.org') +} diff --git a/patches/orsvm_e1071/install_e1071.r b/patches/orsvm_e1071/install_e1071.r new file mode 100644 index 0000000..d52e651 --- /dev/null +++ b/patches/orsvm_e1071/install_e1071.r @@ -0,0 +1 @@ +install.packages('e1071', repos='http://cran.r-project.org') diff --git a/patches/orsvm_e1071/install_svmpath.r b/patches/orsvm_e1071/install_svmpath.r new file mode 100644 index 0000000..bbc1141 --- /dev/null +++ b/patches/orsvm_e1071/install_svmpath.r @@ -0,0 +1 @@ +install.packages('svmpath', repos='http://cran.r-project.org') diff --git a/patches/orxgboost/install_matrix.r b/patches/orxgboost/install_matrix.r new file mode 100644 index 0000000..393ca7b --- /dev/null +++ b/patches/orxgboost/install_matrix.r @@ -0,0 +1,5 @@ +pkg <- 'Matrix' +if (!require(pkg, character.only = TRUE)) { + install.packages(pkg, dependencies = TRUE, + repos='http://cran.r-project.org') +} diff --git a/patches/orxgboost/install_xgboost.r b/patches/orxgboost/install_xgboost.r new file mode 100644 index 0000000..cc4fd29 --- /dev/null +++ b/patches/orxgboost/install_xgboost.r @@ -0,0 +1,5 @@ +pkg <- 'xgboost' +if (!require(pkg, character.only = TRUE)) { + install.packages(pkg, dependencies = TRUE, + repos='http://cran.r-project.org') +} diff --git a/patches/ospec/ospec.install.0.2.1 b/patches/ospec/ospec.install.0.2.1 new file mode 100644 index 0000000..2e50eb8 --- /dev/null +++ b/patches/ospec/ospec.install.0.2.1 @@ -0,0 +1 @@ +bin: ["_build/src/ospec"] diff --git a/patches/ospec/ospec.install.0.3.0 b/patches/ospec/ospec.install.0.3.0 new file mode 100644 index 0000000..567b67a --- /dev/null +++ b/patches/ospec/ospec.install.0.3.0 @@ -0,0 +1 @@ +bin: ["_build/src/ospec.byte" {"ospec"}] diff --git a/patches/ospec/ospec.install.0.3.1 b/patches/ospec/ospec.install.0.3.1 new file mode 100644 index 0000000..567b67a --- /dev/null +++ b/patches/ospec/ospec.install.0.3.1 @@ -0,0 +1 @@ +bin: ["_build/src/ospec.byte" {"ospec"}] diff --git a/patches/ospec/ospec.install.0.3.2 b/patches/ospec/ospec.install.0.3.2 new file mode 100644 index 0000000..567b67a --- /dev/null +++ b/patches/ospec/ospec.install.0.3.2 @@ -0,0 +1 @@ +bin: ["_build/src/ospec.byte" {"ospec"}] diff --git a/patches/ott/Makefile.release.patch b/patches/ott/Makefile.release.patch new file mode 100644 index 0000000..e4064a7 --- /dev/null +++ b/patches/ott/Makefile.release.patch @@ -0,0 +1,32 @@ +diff --git a/src/Makefile b/src/Makefile +index 22b1928..cd7c283 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -36,12 +36,12 @@ topdir = .. + OTTVER=0.26 + + # for us +-OCAMLC = ocamlc.opt -g -dtypes # -w p disables partial match warnings +-OCAMLOPT = ocamlopt.opt -w y -g -dtypes -unsafe -inline 9 ++#OCAMLC = ocamlc.opt -g -dtypes # -w p disables partial match warnings ++#OCAMLOPT = ocamlopt.opt -w y -g -dtypes -unsafe -inline 9 + + # for releases +-#OCAMLC = ocamlc -g -w p -w y +-#OCAMLOPT = ocamlopt -w p -w y -unsafe -inline 9 ++OCAMLC = ocamlc -g -w p -w y ++OCAMLOPT = ocamlopt -w p -w y -unsafe -inline 9 + + OCAMLDEP = ocamldep + OCAMLLEX = ocamllex +@@ -105,8 +105,8 @@ CMX = $(patsubst %.cmo, %.cmx, $(CMO)) + CMI_FROM_MLI = $(patsubst %.mli, %.cmi, $(SOURCES_MLI)) + + +-#default: ott.opt +-default: ott.byt ++default: ott.opt ++#default: ott.byt + + all: default + ott: default diff --git a/patches/ott/new-string-syntax.diff b/patches/ott/new-string-syntax.diff new file mode 100644 index 0000000..9f4c366 --- /dev/null +++ b/patches/ott/new-string-syntax.diff @@ -0,0 +1,12 @@ +diff -u -r ott.0.24-orig/src/grammar_typecheck.ml ott.0.24/src/grammar_typecheck.ml +--- ott.0.24-orig/src/grammar_typecheck.ml 2014-01-30 18:54:47.000000000 +0100 ++++ ott.0.24/src/grammar_typecheck.ml 2014-08-28 17:35:37.000000000 +0200 +@@ -86,7 +86,7 @@ + avoid spurious conflicts. + + Generation of aux rules is controlled by a command-line option +--generate_aux_rules {true|false}, which one might (eg) set to false ++-generate_aux_rules {true | false}, which one might (eg) set to false + for latex output and true for OCaml output. + + *) diff --git a/patches/ott/ott.install.0.21.2 b/patches/ott/ott.install.0.21.2 new file mode 100644 index 0000000..5c7cbb2 --- /dev/null +++ b/patches/ott/ott.install.0.21.2 @@ -0,0 +1 @@ +bin: ["src/ott"] diff --git a/patches/ott/ott.install.0.24 b/patches/ott/ott.install.0.24 new file mode 100644 index 0000000..d2e14eb --- /dev/null +++ b/patches/ott/ott.install.0.24 @@ -0,0 +1,3 @@ +bin: ["src/ott"] +doc: ["doc/ott_manual_0.24.pdf" "doc/ott_manual_0.24.html"] +share_root: ["emacs/ottmode.el" {"emacs/site-lisp/ottmode.el"} "tex/ottlayout.sty" {"tex/ottlayout.sty"}] diff --git a/patches/ott/ott.install.0.25 b/patches/ott/ott.install.0.25 new file mode 100644 index 0000000..c128a4b --- /dev/null +++ b/patches/ott/ott.install.0.25 @@ -0,0 +1,3 @@ +bin: ["src/ott"] +doc: ["doc/ott_manual_0.25.pdf" "doc/ott_manual_0.25.html"] +share_root: ["emacs/ottmode.el" {"emacs/site-lisp/ottmode.el"} "tex/ottlayout.sty" {"tex/ottlayout.sty"}] diff --git a/patches/ott/ott.install.0.26 b/patches/ott/ott.install.0.26 new file mode 100644 index 0000000..cce90d1 --- /dev/null +++ b/patches/ott/ott.install.0.26 @@ -0,0 +1,3 @@ +bin: ["src/ott"] +doc: ["doc/ott_manual_0.25.pdf" "doc/ott_manual_0.25.html"] +share_root: ["emacs/ott-mode.el" {"emacs/site-lisp/ott-mode.el"} "tex/ottlayout.sty" {"tex/ottlayout.sty"}] diff --git a/patches/ott/ott.install.0.27 b/patches/ott/ott.install.0.27 new file mode 100644 index 0000000..cce90d1 --- /dev/null +++ b/patches/ott/ott.install.0.27 @@ -0,0 +1,3 @@ +bin: ["src/ott"] +doc: ["doc/ott_manual_0.25.pdf" "doc/ott_manual_0.25.html"] +share_root: ["emacs/ott-mode.el" {"emacs/site-lisp/ott-mode.el"} "tex/ottlayout.sty" {"tex/ottlayout.sty"}] diff --git a/patches/ott/ott.install.0.28 b/patches/ott/ott.install.0.28 new file mode 100644 index 0000000..55d36bd --- /dev/null +++ b/patches/ott/ott.install.0.28 @@ -0,0 +1,3 @@ +bin: ["src/ott"] +doc: ["built_doc/top2.pdf" { "doc/ott_manual.pdf" } "built_doc/top2.html" { "doc/ott_manual.html" }] +share_root: ["emacs/ott-mode.el" {"emacs/site-lisp/ott-mode.el"} "tex/ottlayout.sty" {"tex/ottlayout.sty"}] diff --git a/patches/ounit/safe-string.patch b/patches/ounit/safe-string.patch new file mode 100644 index 0000000..f4c934d --- /dev/null +++ b/patches/ounit/safe-string.patch @@ -0,0 +1,103 @@ +diff --git a/setup.ml b/setup.ml +index d611c02..13787aa 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -208,7 +208,7 @@ module OASISString = struct + raise Not_found + + let replace_chars f s = +- let buf = String.make (String.length s) 'X' in ++ let buf = Bytes.make (String.length s) 'X' in + for i = 0 to String.length s - 1 do + buf.[i] <- f s.[i] + done; +@@ -280,9 +280,9 @@ module OASISUtils = struct + let buf = + (* Start with a _ if digit *) + if '0' <= s.[0] && s.[0] <= '9' then +- "_"^buf ++ "_"^Bytes.to_string buf + else +- buf ++ Bytes.to_string buf + in + String.lowercase buf + end +diff --git a/src/oUnitAssert.ml b/src/oUnitAssert.ml +index d0c7d2e..8c7b533 100644 +--- a/src/oUnitAssert.ml ++++ b/src/oUnitAssert.ml +@@ -236,7 +236,7 @@ let assert_command + in + let () = + (* Dump sinput into the process stdin *) +- let buff = " " in ++ let buff = Bytes.of_string " " in + Stream.iter + (fun c -> + let _i : int = +@@ -259,12 +259,12 @@ let assert_command + (* Dump process output to stderr *) + begin + let chn = open_in fn_out in +- let buff = String.make 4096 'X' in ++ let buff = Bytes.make 4096 'X' in + let len = ref (-1) in + while !len <> 0 do +- len := input chn buff 0 (String.length buff); ++ len := input chn buff 0 (Bytes.length buff); + OUnitLogger.Test.raw_printf +- ctxt.test_logger "%s" (String.sub buff 0 !len); ++ ctxt.test_logger "%s" (Bytes.to_string (Bytes.sub buff 0 !len)); + done; + close_in chn + end; +diff --git a/src/oUnitConf.ml b/src/oUnitConf.ml +index 79d8f32..7a3e157 100644 +--- a/src/oUnitConf.ml ++++ b/src/oUnitConf.ml +@@ -71,13 +71,13 @@ let check_variable_name str = + str + + let cli_name name = +- let cli_name = "-" ^ name in ++ let cli_name = Bytes.of_string ("-" ^ name) in + for i = 1 to String.length name do +- match cli_name.[i] with ++ match Bytes.get cli_name i with + | '_' -> cli_name.[i] <- '-' + | _ -> () + done; +- cli_name ++ Bytes.to_string cli_name + + let subst conf extra_subst str = + let substitutions = Hashtbl.create (Hashtbl.length metaconf) in +diff --git a/src/oUnitRunnerProcesses.ml b/src/oUnitRunnerProcesses.ml +index 5a1466d..5b57a58 100644 +--- a/src/oUnitRunnerProcesses.ml ++++ b/src/oUnitRunnerProcesses.ml +@@ -64,10 +64,10 @@ let make_channel + let really_read fd str = + let off = ref 0 in + let read = ref 0 in +- while !read < String.length str do ++ while !read < Bytes.length str do + try + let one_read = +- Unix.read fd str !off (String.length str - !off) ++ Unix.read fd str !off (Bytes.length str - !off) + in + read := !read + one_read; + off := !off + one_read +@@ -87,8 +87,8 @@ let make_channel + let receive_data () = + try + let data_size = Marshal.data_size (really_read fd_read header_str) 0 in +- let data_str = really_read fd_read (String.create data_size) in +- let msg = Marshal.from_string (header_str ^ data_str) 0 in ++ let data_str = Bytes.to_string (really_read fd_read (Bytes.create data_size)) in ++ let msg = Marshal.from_string (Bytes.to_string header_str ^ data_str) 0 in + msg + with Failure(msg) -> + OUnitUtils.failwithf "Communication error with worker processes: %s" msg diff --git a/patches/owl/0001-Revert-update-config-file-for-publication.patch b/patches/owl/0001-Revert-update-config-file-for-publication.patch new file mode 100644 index 0000000..26414e5 --- /dev/null +++ b/patches/owl/0001-Revert-update-config-file-for-publication.patch @@ -0,0 +1,29 @@ +From 98e01498dd1318fc7d812ca7067fd4728384fdaa Mon Sep 17 00:00:00 2001 +From: Marcello Seri +Date: Mon, 16 May 2022 20:21:32 +0200 +Subject: [PATCH] Revert "update config file for publication" + +This reverts commit 93e706d6c0e2c4dc2fbef66208c4024b49c2d9dd. + +Signed-off-by: Marcello Seri +--- + src/owl/config/configure.ml | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/owl/config/configure.ml b/src/owl/config/configure.ml +index 190926d7..1f9e3444 100644 +--- a/src/owl/config/configure.ml ++++ b/src/owl/config/configure.ml +@@ -235,8 +235,7 @@ some details on how your openblas has been installed and the output of + ~link_flags:(openblas_conf.libs @ [ "-lm" ]) + |> not + in +- (* if needs_lapacke_flag then [ "-llapacke" ] else [] *) +- if needs_lapacke_flag then [ ] else [] ++ if needs_lapacke_flag then [ "-llapacke" ] else [] + in + let openmp_config = get_openmp_config c in + (* configure link options *) +-- +2.30.1 (Apple Git-130) + diff --git a/patches/owl/owl.install b/patches/owl/owl.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/owl/owl.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/pa_ounit/disable_warn_error.patch b/patches/pa_ounit/disable_warn_error.patch new file mode 100644 index 0000000..62e0040 --- /dev/null +++ b/patches/pa_ounit/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.495655897 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.643900873 -0500 +@@ -574,7 +574,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/pcre/_oasis_remove_.ml b/patches/pcre/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/pcre/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/pcre/pcre.install b/patches/pcre/pcre.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/pcre/pcre.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/pfff/lang_js-analyze-module_js.ml-Fix-invalid-documentati.patch b/patches/pfff/lang_js-analyze-module_js.ml-Fix-invalid-documentati.patch new file mode 100644 index 0000000..d11860f --- /dev/null +++ b/patches/pfff/lang_js-analyze-module_js.ml-Fix-invalid-documentati.patch @@ -0,0 +1,80 @@ +From 90424f6a206b32c0995e043fe404e694c884b5d3 Mon Sep 17 00:00:00 2001 +From: Juergen Hoetzel +Date: Mon, 24 Aug 2015 13:55:44 +0200 +Subject: [PATCH] * lang_js/analyze/module_js.ml: Fix invalid documentation + comments. Refs #130 + +See: http://caml.inria.fr/mantis/view.php?id=6916 +--- + lang_js/analyze/module_js.ml | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/lang_js/analyze/module_js.ml b/lang_js/analyze/module_js.ml +index 1433bf0..3bf63b3 100644 +--- a/lang_js/analyze/module_js.ml ++++ b/lang_js/analyze/module_js.ml +@@ -48,50 +48,50 @@ type shape = + | LiteralShape + | ArrayShape + +- (** _((id,container,maps) ref) **) ++ (* _((id,container,maps) ref) *) + (* this is a ref to allow extensible representations *) + (* id is unique, and is used to prune infinite recursion *) + (* maps is an ObjectShape list *) + | ObjectShape of (int * shape smap * shape list) ref + +- (** _(block,constructor) **) ++ (* _(block,constructor) *) + (* block is an ObjectShape *) + (* constructor is a ClassShape *) + | FunctionShape of shape Common.smap ref * shape + +- (** _(module) **) ++ (* _(module) *) + | RequireShape of module_ + +- (** _(reason) **) ++ (* _(reason) *) + | UnknownShape of string + +- (** _(instance, static) **) ++ (* _(instance, static) *) + (* instance is a ObjectShape *) + (* static is a ObjectShape where static.prototype is a ObjectShape *) + | ClassShape of shape * shape + +- (** _(class) **) ++ (* _(class) *) + (* class is a ClassShape *) + (* returns an ObjectShape *) + | NewShape of shape + +- (** _(maps) **) ++ (* _(maps) *) + (* maps is an ObjectShape *) + (* returns a ClassShape *) + | MixinShape of shape + +- (** _(class,mixin) **) ++ (* _(class,mixin) *) + (* class is a ClassShape, mixin is a ClassShape *) + (* returns a ClassShape *) + | ClassWithMixinShape of shape * shape + +- (** _(object,prop) **) ++ (* _(object,prop) *) + | PropertyShape of shape * string + +- (** _(function) **) ++ (* _(function) *) + | ApplyShape of shape + +- (** _(array) **) ++ (* _(array) *) + | ElementShape of shape + + let fresh_id = +-- +2.5.0 + diff --git a/patches/pfff/lang_js-analyze-utils_js.mli.patch b/patches/pfff/lang_js-analyze-utils_js.mli.patch new file mode 100644 index 0000000..c84ddcd --- /dev/null +++ b/patches/pfff/lang_js-analyze-utils_js.mli.patch @@ -0,0 +1,30 @@ +From 1658a7f55af6884644909901523a28d2df7416d7 Mon Sep 17 00:00:00 2001 +From: pad +Date: Thu, 20 Aug 2015 09:58:29 -0700 +Subject: [PATCH 68/72] * lang_js/analyze/utils_js.mli: fix issue #130 + +--- + lang_js/analyze/utils_js.mli | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/lang_js/analyze/utils_js.mli b/lang_js/analyze/utils_js.mli +index 637b832..19a8cbb 100644 +--- a/lang_js/analyze/utils_js.mli ++++ b/lang_js/analyze/utils_js.mli +@@ -1,8 +1,9 @@ + +-(** print utils **) ++(* print utils *) + val string_of_any : Ast_js.any -> string + +-(** Example: load file task **) +-(** if file exists, unmarshal data in the file and return it **) +-(** otherwise, run task to generate data, store it in the file, and return it **) ++(* Example: load file task ++ * if file exists, unmarshal data in the file and return it ++ * otherwise, run task to generate data, store it in the file, and return it ++ *) + val load : Common.filename -> (unit -> 'a) -> 'a +-- +2.5.0 + diff --git a/patches/pgocaml/opam.patch b/patches/pgocaml/opam.patch new file mode 100644 index 0000000..1454316 --- /dev/null +++ b/patches/pgocaml/opam.patch @@ -0,0 +1,12 @@ +diff -ru pgocaml.1.6/Makefile pgocaml.1.6/Makefile +--- pgocaml.1.6/Makefile 2012-07-04 19:53:31.000000000 +0200 ++++ pgocaml.1.6/Makefile 2012-10-05 18:14:39.889285053 +0200 +@@ -166,7 +166,7 @@ + # + + findlib_install: +- ocamlfind install $(PACKAGE) META pgocaml.a pgocaml.cma pgocaml.cmxa pGOCaml_generic.cm[ix] pGOCaml.cm[ix] pa_pgsql.cmo pGOCaml_generic.mli pGOCaml.mli ++ ocamlfind install $(PACKAGE) META pgocaml.cmxs pgocaml.a pgocaml.cma pgocaml.cmxa pGOCaml_generic.cm[ix] pGOCaml.cm[ix] pa_pgsql.cmo pGOCaml_generic.mli pGOCaml.mli + + reinstall: + ocamlfind remove $(PACKAGE) diff --git a/patches/pipebang/disable_warn_error.patch b/patches/pipebang/disable_warn_error.patch new file mode 100644 index 0000000..c0e6f3a --- /dev/null +++ b/patches/pipebang/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.499658884 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.645903833 -0500 +@@ -574,7 +574,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/pkcs11/0001-Detect-dlfcn.h-using-__linux__.patch b/patches/pkcs11/0001-Detect-dlfcn.h-using-__linux__.patch new file mode 100644 index 0000000..de7d813 --- /dev/null +++ b/patches/pkcs11/0001-Detect-dlfcn.h-using-__linux__.patch @@ -0,0 +1,26 @@ +From 23987e41515706d8d966d26f12f4e0a0c5e53891 Mon Sep 17 00:00:00 2001 +From: Etienne Millon +Date: Thu, 5 Jan 2017 09:16:25 +0100 +Subject: [PATCH] Detect `` using `__linux__` + +Closes #24 +--- + src/snippets/prelude.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/snippets/prelude.h b/src/snippets/prelude.h +index 6515d39..3ad0b61 100644 +--- a/src/snippets/prelude.h ++++ b/src/snippets/prelude.h +@@ -10,7 +10,7 @@ + #include + #else + +-#if defined(__GLIBC__) || (defined(__sun) && defined(__SVR4)) ++#if defined(__linux__) || (defined(__sun) && defined(__SVR4)) + #include + #endif + #ifdef _AIX +-- +2.11.0 + diff --git a/patches/planck/build_fix.patch b/patches/planck/build_fix.patch new file mode 100644 index 0000000..6bacc89 --- /dev/null +++ b/patches/planck/build_fix.patch @@ -0,0 +1,12 @@ +diff -r 3d3ef0c2f5d0 test/OMakefile +--- a/test/OMakefile Mon May 09 22:26:38 2016 +0800 ++++ b/test/OMakefile Fri Aug 25 09:48:30 2017 +0900 +@@ -25,7 +25,7 @@ + + NO_INSTALL=true + Test(name) = +- MyOCamlProgram("test_$(name)", $(name)) # No install ++ MyOCamlProgram(test_$(name), $(name)) # No install + export + + Test(expr) diff --git a/patches/planets/planets.install b/patches/planets/planets.install new file mode 100644 index 0000000..a135b68 --- /dev/null +++ b/patches/planets/planets.install @@ -0,0 +1 @@ +bin: ["planets"] diff --git a/patches/plasma/plasma.install b/patches/plasma/plasma.install new file mode 100644 index 0000000..0f6acc7 --- /dev/null +++ b/patches/plasma/plasma.install @@ -0,0 +1,11 @@ +bin: [ + "src/pfs_daemon/plasmad.opt" {"plasmad"} + "src/pkv/plasma_kv_httpd_demo.opt" {"plasma_kv_httpd_demo"} + "src/pkv/plasma_kv.opt" {"plasma_kv"} + "src/pfs_admin/plasma_datanode_init.opt" {"plasma_datanode_init"} + "src/mr_framework/plasma_convert.opt" {"plasma_convert"} + "src/pfs_admin/plasma_admin.opt" {"plasma_admin"} + "src/plasmaclient/plasma.opt" {"plasma"} + "src/pfs_nfs3/nfs3d.opt" {"nfs3d"} + "src/mr_framework/mr_streaming.opt" {"mr_streaming"} +] diff --git a/patches/podge/_oasis_remove_.ml b/patches/podge/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/podge/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/podge/podge.install b/patches/podge/podge.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/podge/podge.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/ppx_deriving/fix_dune_3.patch b/patches/ppx_deriving/fix_dune_3.patch new file mode 100644 index 0000000..2b3336c --- /dev/null +++ b/patches/ppx_deriving/fix_dune_3.patch @@ -0,0 +1,19 @@ +diff --git a/src_plugins/map/dune b/src_plugins/map/dune +--- a/src_plugins/map/dune ++++ b/src_plugins/map/dune +@@ -1,5 +1,5 @@ + (rule +- (deps ppx_deriving_map.cppo.ml) ++ (deps ../compat_macros.cppo ppx_deriving_map.cppo.ml) + (targets ppx_deriving_map.ml) + (action (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets}))) + +diff --git a/src_plugins/map/ppx_deriving_map.cppo.ml b/src_plugins/map/ppx_deriving_map.cppo.ml +--- a/src_plugins/map/ppx_deriving_map.cppo.ml ++++ b/src_plugins/map/ppx_deriving_map.cppo.ml +@@ -1,5 +1,3 @@ +-#include "../compat_macros.cppo" +- + open Longident + open Location + open Asttypes diff --git a/patches/ppx_deriving/fix_ppx_deriving_make_mllib.patch b/patches/ppx_deriving/fix_ppx_deriving_make_mllib.patch new file mode 100644 index 0000000..9be49f7 --- /dev/null +++ b/patches/ppx_deriving/fix_ppx_deriving_make_mllib.patch @@ -0,0 +1,18 @@ +From a4428407e974361d872e0a70e036bc7ee20e8467 Mon Sep 17 00:00:00 2001 +From: whitequark +Date: Tue, 28 Feb 2017 00:37:56 +0000 +Subject: [PATCH] Fix ppx_deriving_make.mllib. + +This is a bug that goes back all the way to c2fb119f, but it was +hidden by a matching bug in ocamlbuild <0.11. +--- + src_plugins/ppx_deriving_make.mllib | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src_plugins/ppx_deriving_make.mllib b/src_plugins/ppx_deriving_make.mllib +index 1b2681b..7f23204 100644 +--- a/src_plugins/ppx_deriving_make.mllib ++++ b/src_plugins/ppx_deriving_make.mllib +@@ -1 +1 @@ +-ppx_deriving_create ++ppx_deriving_make diff --git a/patches/ppx_deriving_morphism/ppx_deriving_morphism.install b/patches/ppx_deriving_morphism/ppx_deriving_morphism.install new file mode 100644 index 0000000..4ef6c72 --- /dev/null +++ b/patches/ppx_deriving_morphism/ppx_deriving_morphism.install @@ -0,0 +1,18 @@ +doc: [ + "_build/CHANGELOG.md" {"CHANGELOG.md"} + "_build/LICENSE" {"LICENSE"} + "_build/README.md" {"README.md"} ] +lib: [ + "_build/pkg/META" {"META"} + "_build/src/ppx_deriving_folder.a" {"ppx_deriving_folder.a"} + "_build/src/ppx_deriving_folder.cma" {"ppx_deriving_folder.cma"} + "_build/src/ppx_deriving_folder.cmxa" {"ppx_deriving_folder.cmxa"} + "_build/src/ppx_deriving_folder.cmxs" {"ppx_deriving_folder.cmxs"} + "_build/src/ppx_deriving_mapper.a" {"ppx_deriving_mapper.a"} + "_build/src/ppx_deriving_mapper.cma" {"ppx_deriving_mapper.cma"} + "_build/src/ppx_deriving_mapper.cmxa" {"ppx_deriving_mapper.cmxa"} + "_build/src/ppx_deriving_mapper.cmxs" {"ppx_deriving_mapper.cmxs"} + "_build/src/ppx_deriving_morphism.a" {"ppx_deriving_morphism.a"} + "_build/src/ppx_deriving_morphism.cma" {"ppx_deriving_morphism.cma"} + "_build/src/ppx_deriving_morphism.cmxa" {"ppx_deriving_morphism.cmxa"} + "_build/src/ppx_deriving_morphism.cmxs" {"ppx_deriving_morphism.cmxs"} ] diff --git a/patches/ppx_monadic/2.2.1-fix-match-expr.patch b/patches/ppx_monadic/2.2.1-fix-match-expr.patch new file mode 100644 index 0000000..ccf34dc --- /dev/null +++ b/patches/ppx_monadic/2.2.1-fix-match-expr.patch @@ -0,0 +1,124 @@ +changeset: 145:2bc1901bb986 +branch: 2.2.1-fix-match-expr +parent: 140:968bb9e6a0b3 +user: Christoph H?ger +date: Wed Sep 13 12:37:06 2017 +0200 +summary: Do not mess up annotated match expressions + +diff -r 968bb9e6a0b3 -r 2bc1901bb986 ppx/do_.ml +--- a/ppx/do_.ml Tue Aug 22 14:52:22 2017 +0900 ++++ b/ppx/do_.ml Wed Sep 13 12:37:06 2017 +0200 +@@ -20,7 +20,7 @@ + | Pexp_ident {txt=Lident "do_"} -> Some None + | Pexp_ident {txt=Ldot (lid, "do_"); loc} -> Some (Some {txt=lid; loc}) + | _ -> None +- ++ + let is_ext_do s = + match Longident.parse s with + | Lident "do" -> Some None +@@ -35,7 +35,7 @@ + | Some None -> Some (None, e) + | Some (Some lid) -> Some (Some {txt=lid; loc}, e) + end +- | Pexp_sequence (e1, e2) -> ++ | Pexp_sequence (e1, e2) -> + (* e1; e2; e3 is e1; (e2; e3) *) + begin match is_do e1 with + | None -> None +@@ -52,7 +52,7 @@ + | Some _ -> + raise_errorf ~loc:e.pexp_loc "ppx_monadic: do_ must be followed by ;" + +-let desugar_do e = ++let desugar_do e = + let open Monadic in + let rec f = function + | End e -> e +@@ -76,8 +76,8 @@ + in + f & parse None e + +-let extend super = +- let expr self e = ++let extend super = ++ let expr self e = + match is_do_clause e with + | Some (None, e) -> + (* Format.eprintf "do_ clause: %a@." Pprintast.expression e; *) +@@ -93,10 +93,10 @@ + (* the following is to surpress Warning 26 *) + let _ = bind in + let _ = return in +- (* I believe having fail is not a good idea... *) ++ (* I believe having fail is not a good idea... *) + [%e self.expr self & desugar_do e] + ] +- ++ + | None -> + match e.pexp_desc with + | Pexp_extension ({txt=x; loc}, PStr [{ pstr_desc= Pstr_eval ({ pexp_desc = Pexp_let(rec_flag, vbs, e')}, _attr) }]) -> +@@ -117,30 +117,30 @@ + [%expr + [%e bind] [%e vb.pvb_expr] (fun [%p vb.pvb_pat] -> [%e e']) + ] +- | _ -> ++ | _ -> + (* + (* Code A *) + let%m p1 = e1 +- and p2 = e2 ++ and p2 = e2 + in e +- +- is not equal to +- ++ ++ is not equal to ++ + (* Code B *) + let%m p1 = e1 in + let%m p2 = e2 in + e +- ++ + which is equivalent with the following: +- +- bind e1 (fun p1 -> +- bind e2 (fun p2 -> ++ ++ bind e1 (fun p1 -> ++ bind e2 (fun p2 -> + e)) +- ++ + Code A should be translated to the following: +- +- let ppx_monadic_v1 = e1 +- and ppx_monadic_v2 = e2 ++ ++ let ppx_monadic_v1 = e1 ++ and ppx_monadic_v2 = e2 + in + bind ppx_monadic_v1 (fun p1 -> + bind ppx_monadic_v2 (fun p2 -> +@@ -162,7 +162,7 @@ + [%e bind] [%e e] (fun [%p vb.pvb_pat] -> [%e st]) + ]) pevbs e' + end +- | Pexp_extension ({txt=x; loc}, PStr [{ pstr_desc= Pstr_eval (({ pexp_desc = Pexp_match(e, cases)} as e0), _attr) }]) -> ++ | Pexp_extension ({txt=x; loc}, PStr [{ pstr_desc= Pstr_eval (({ pexp_desc = Pexp_match(e', cases)} as e0), _attr) }]) -> + (* match%m e with cases => bind e (function cases) *) + begin match is_m x with + | None -> super.expr self e +@@ -175,7 +175,7 @@ + self.expr self & + with_loc e0.pexp_loc & fun () -> + [%expr +- [%e bind] [%e e] [%e e0'] ++ [%e bind] [%e e'] [%e e0'] + ] + end + | _ -> super.expr self e + diff --git a/patches/prbnmcn-stats/convergence-test.patch b/patches/prbnmcn-stats/convergence-test.patch new file mode 100644 index 0000000..bbd21ef --- /dev/null +++ b/patches/prbnmcn-stats/convergence-test.patch @@ -0,0 +1,27 @@ +From 6e24cbdebf8e35cc00878d059cf3fd88ba07f7d2 Mon Sep 17 00:00:00 2001 +From: Jan Midtgaard +Date: Thu, 28 Sep 2023 10:04:02 +0200 +Subject: [PATCH] Disable kl convergence test on OCaml > 4 + +--- + test/dist_test.ml | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/test/dist_test.ml b/test/dist_test.ml +index aa16588..c92fb42 100644 +--- a/test/dist_test.ml ++++ b/test/dist_test.ml +@@ -122,7 +122,9 @@ let make_conv_test distname f = + let lst = List.hd (List.rev dists) in + lst /. fst <=. 0.3 + +-let () = make_conv_test "kl" (fun () -> convergent_sequence Fin.Float.Dist.kl) ++let () = ++ if Char.equal Sys.ocaml_version.[0] '4' ++ then make_conv_test "kl" (fun () -> convergent_sequence Fin.Float.Dist.kl) + + let () = + make_conv_test "l1" (fun () -> convergent_sequence (Fin.Float.Dist.lp ~p:1.)) +-- +2.25.1 + diff --git a/patches/profound/profound.install b/patches/profound/profound.install new file mode 100644 index 0000000..530996d --- /dev/null +++ b/patches/profound/profound.install @@ -0,0 +1 @@ +bin: ["_build/profound.native" {"profound"}] diff --git a/patches/publish/publish.install b/patches/publish/publish.install new file mode 100644 index 0000000..02ad2c1 --- /dev/null +++ b/patches/publish/publish.install @@ -0,0 +1 @@ +bin: "opam-publish" diff --git a/patches/pure-splitmix/pure-splitmix.install b/patches/pure-splitmix/pure-splitmix.install new file mode 100644 index 0000000..a98b246 --- /dev/null +++ b/patches/pure-splitmix/pure-splitmix.install @@ -0,0 +1,8 @@ +lib: [ + "META" + "_build/src/pureSplitMix.cmi" + "_build/src/pureSplitMix.cmx" + "_build/src/pureSplitMix.cma" + "_build/src/pureSplitMix.cmxa" + "_build/src/pureSplitMix.a" +] diff --git a/patches/pxp/408.patch b/patches/pxp/408.patch new file mode 100644 index 0000000..bf2fe51 --- /dev/null +++ b/patches/pxp/408.patch @@ -0,0 +1,42 @@ +diff -urN pxp-1.2.9/src/pxp-engine/pxp_lexing.mli pxp.1.2.9/src/pxp-engine/pxp_lexing.mli +--- pxp-1.2.9/src/pxp-engine/pxp_lexing.mli 2017-02-28 22:21:46.000000000 +0900 ++++ pxp.1.2.9/src/pxp-engine/pxp_lexing.mli 2019-09-02 10:22:20.000000000 +0900 +@@ -10,11 +10,11 @@ + + type lexbuf = Lexing.lexbuf + +-val from_channel : in_channel -> lexbuf ++val from_channel : ?with_positions:bool -> in_channel -> lexbuf + +-val from_string : string -> lexbuf ++val from_string : ?with_positions:bool -> string -> lexbuf + +-val from_function : (Bytes.t -> int -> int) -> lexbuf ++val from_function : ?with_positions:bool -> (Bytes.t -> int -> int) -> lexbuf + + val lexeme : lexbuf -> string + +diff -urN pxp-1.2.9/tools/src/odoc/Makefile pxp.1.2.9/tools/src/odoc/Makefile +--- pxp-1.2.9/tools/src/odoc/Makefile 2017-02-28 22:21:52.000000000 +0900 ++++ pxp.1.2.9/tools/src/odoc/Makefile 2019-09-02 10:23:27.000000000 +0900 +@@ -6,6 +6,8 @@ + OCAMLC_OPTIONS += -I +ocamldoc + CLEAN_LIST += chtml.ml + ++PACKAGES = compiler-libs.common ++ + .PHONY: all + all: chtml.cmo + +diff -urN pxp-1.2.9/tools/src/odoc/chtml_ocaml4.ml pxp.1.2.9/tools/src/odoc/chtml_ocaml4.ml +--- pxp-1.2.9/tools/src/odoc/chtml_ocaml4.ml 2017-02-28 22:21:52.000000000 +0900 ++++ pxp.1.2.9/tools/src/odoc/chtml_ocaml4.ml 2019-09-02 10:19:18.000000000 +0900 +@@ -34,7 +34,7 @@ + open Odoc_info + open Module + +-module StringSet = Odoc_html.StringSet ++module StringSet = Odoc_html.String.Set + + + let word_re = Str.regexp "[ \t\r\n]+" diff --git a/patches/pxp/rm-dup-exc.patch b/patches/pxp/rm-dup-exc.patch new file mode 100644 index 0000000..f0f685a --- /dev/null +++ b/patches/pxp/rm-dup-exc.patch @@ -0,0 +1,11 @@ +diff -urN pxp-1.2.8/src/pxp-engine/pxp_document.ml pxp-1.2.8-cdnm0/src/pxp-engine/pxp_document.ml +--- pxp-1.2.8/src/pxp-engine/pxp_document.ml 2016-03-03 22:46:50.000000000 +0900 ++++ pxp-1.2.8-cdnm0/src/pxp-engine/pxp_document.ml 2017-02-15 13:33:08.000000000 +0900 +@@ -3398,7 +3398,6 @@ + ;; + + +-exception Skip;; + + let map_tree ~pre ?(post=(fun x -> x)) base = + let rec map_rec n = diff --git a/patches/qocamlbrowser/opam-configure.sh b/patches/qocamlbrowser/opam-configure.sh new file mode 100644 index 0000000..bcd1869 --- /dev/null +++ b/patches/qocamlbrowser/opam-configure.sh @@ -0,0 +1,26 @@ +#!/bin/sh +set -x + +MAKE=make +OS=unknown + +if [ "$#" -ge 2 ]; then + MAKE=$1 + OS=$2 +else + echo "Usage: $0 make OS [OS-family] [OS-distribution]" >&2 + exit 1 +fi + +if [ "$OS" = "macos"]; then + export PATH=/usr/lib64/qt5/bin:/usr/lib/qt5/bin:$PATH + ./configure || exit 1 + $MAKE || exit 1 +else + # a few GNU/Linux put executables there + export PATH=/usr/local/opt/qt/bin:$PATH + ./configure || exit 1 + $MAKE || exit 1 +fi + +exit 0 diff --git a/patches/qtest/qtest.install b/patches/qtest/qtest.install new file mode 100644 index 0000000..85a5fb1 --- /dev/null +++ b/patches/qtest/qtest.install @@ -0,0 +1,4 @@ +bin: [ + "?qtest/_build/qtest.byte" {"qtest"} + "?qtest/_build/qtest.native" {"qtest"} +] diff --git a/patches/rdbg/_oasis_remove_.ml b/patches/rdbg/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/rdbg/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/rdbg/rdbg.install.1.0 b/patches/rdbg/rdbg.install.1.0 new file mode 100644 index 0000000..23af769 --- /dev/null +++ b/patches/rdbg/rdbg.install.1.0 @@ -0,0 +1,10 @@ +bin: [ + "?_build/src/gnuplotrif.byte" {"gnuplot-rif"} + "?_build/src/gnuplotrif.native" {"gnuplot-rif"} + "?_build/src/rdbgbatch.byte" {"rdbg-batch"} + "?_build/src/rdbgbatch.native" {"rdbg-batch"} + "?_build/src/rdbgstart.byte" {"rdbg-top"} + "?_build/src/rdbgstart.native" {"rdbg-top"} + "?_build/src/rdbg.byte" {"rdbg"} + "?_build/src/rdbg.native" {"rdbg"} +] diff --git a/patches/rdbg/rdbg.install.1.65 b/patches/rdbg/rdbg.install.1.65 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/rdbg/rdbg.install.1.65 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/rdbg/rdbg.install.1.70 b/patches/rdbg/rdbg.install.1.70 new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/rdbg/rdbg.install.1.70 @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/reason/reason-1.13.7-topkg-compat.patch b/patches/reason/reason-1.13.7-topkg-compat.patch new file mode 100644 index 0000000..a86ddf0 --- /dev/null +++ b/patches/reason/reason-1.13.7-topkg-compat.patch @@ -0,0 +1,79 @@ +diff --git a/Makefile b/Makefile +index 42264a3..9de0d96 100644 +--- a/Makefile ++++ b/Makefile +@@ -16,7 +16,7 @@ setup_convenient_bin_links: + + precompile: + cp pkg/META.in pkg/META +- ocamlbuild -package topkg pkg/build.native ++ ocamlbuild -use-ocamlfind -package topkg pkg/build.native + + build_without_utop: compile_error setup_convenient_bin_links precompile + ./build.native build --utop false +diff --git a/opam b/opam +index c88f78a..d1c0e2c 100644 +--- a/opam ++++ b/opam +@@ -13,7 +13,7 @@ tags: [ "syntax" ] + substs: [ "pkg/META" ] + build: [ + [make "compile_error"] +- ["ocamlbuild" "-package" "topkg" "pkg/build.native"] ++ ["ocamlbuild" "-use-ocamlfind" "-package" "topkg" "pkg/build.native"] + ["./build.native" "build" + "--native" "%{ocaml-native}%" + "--native-dynlink" "%{ocaml-native-dynlink}%" +@@ -21,11 +21,11 @@ build: [ + ] + depends: [ + "ocamlfind" {build} +- "menhir" {= "20170418"} ++ "menhir" {>= "20170418" & <= "20170712"} + "utop" {>= "1.17"} + "merlin-extend" {>= "0.3"} + "result" {= "1.2"} +- "topkg" {>= "0.8.1" & < "0.9"} ++ "topkg" {>= "0.8.1"} + "ocaml-migrate-parsetree" + "ppx_tools_versioned" {>= "5.0beta"} + ] +@@ -34,4 +34,4 @@ depopts: [ + conflicts: [ + "utop" {< "1.17"} + ] +-available: [ ocaml-version >= "4.02" & ocaml-version < "4.05" ] ++available: [ ocaml-version >= "4.02" & ocaml-version < "4.06" ] +diff --git a/opam.in b/opam.in +index 69fe60f..18ca420 100644 +--- a/opam.in ++++ b/opam.in +@@ -12,7 +12,7 @@ tags: [ "syntax" ] + substs: [ "pkg/META" ] + build: [ + [make "compile_error"] +- ["ocamlbuild" "-package" "topkg" "pkg/build.native"] ++ ["ocamlbuild" "-use-ocamlfind" "-package" "topkg" "pkg/build.native"] + ["./build.native" "build" + "--native" "%{ocaml-native}%" + "--native-dynlink" "%{ocaml-native-dynlink}%" +@@ -20,11 +20,11 @@ build: [ + ] + depends: [ + "ocamlfind" {build} +- "menhir" {= "20170418"} ++ "menhir" {>= "20170418" & <= "20170712"} + "utop" {>= "1.17"} + "merlin-extend" {>= "0.3"} + "result" {= "1.2"} +- "topkg" {>= "0.8.1" & < "0.9"} ++ "topkg" {>= "0.8.1"} + "ocaml-migrate-parsetree" + "ppx_tools_versioned" {>= "5.0beta"} + ] +@@ -33,4 +33,4 @@ depopts: [ + conflicts: [ + "utop" {< "1.17"} + ] +-available: [ ocaml-version >= "4.02" & ocaml-version < "4.05" ] ++available: [ ocaml-version >= "4.02" & ocaml-version < "4.06" ] diff --git a/patches/regstab/opam.patch b/patches/regstab/opam.patch new file mode 100644 index 0000000..2aea74a --- /dev/null +++ b/patches/regstab/opam.patch @@ -0,0 +1,12 @@ +diff -ru regstab.2.0.0/myocamlbuild.ml regstab.2.0.0/myocamlbuild.ml +--- regstab.2.0.0/myocamlbuild.ml 2012-05-04 05:14:37.000000000 +0200 ++++ regstab.2.0.0/myocamlbuild.ml 2012-10-05 18:14:59.193868570 +0200 +@@ -55,7 +55,7 @@ + dirs#man/"man1"/"sch2ltl.opt.1" , "man"/"man1"/"sch2ltl.opt.1"; + dirs#doc/"manual.pdf" , "doc"/pkgbase; + dirs#doc/"developer" , "doc"/pkgbase/"developer_doc"; +- dirs#tools , "share"/pkgbase; ++ dirs#tools , "lib"/pkgbase/"share"/pkgbase; + dirs#ex , "doc"/pkgbase; + dirs#bin/"regstab" , "bin"/"regstab"; + dirs#bin/"regstab.opt" , "bin"/"regstab.opt"; diff --git a/patches/regstab/regstab.install b/patches/regstab/regstab.install new file mode 100644 index 0000000..050ffe7 --- /dev/null +++ b/patches/regstab/regstab.install @@ -0,0 +1,8 @@ +bin: [ + "_build/src/executables/sch2ltl.native" {"sch2ltl.opt"} + "_build/src/executables/sch2ltl.byte" {"sch2ltl"} + "_build/src/executables/sch2cnf.native" {"sch2cnf.opt"} + "_build/src/executables/sch2cnf.byte" {"sch2cnf"} + "_build/src/executables/main.native" {"regstab.opt"} + "_build/src/executables/main.byte" {"regstab"} +] diff --git a/patches/reins/fix_build.patch b/patches/reins/fix_build.patch new file mode 100644 index 0000000..280e7c6 --- /dev/null +++ b/patches/reins/fix_build.patch @@ -0,0 +1,88 @@ +diff --git a/OMakefile b/OMakefile +index b741412..a281ebc 100644 +--- a/OMakefile ++++ b/OMakefile +@@ -1,7 +1,7 @@ + + include config.omake + +-OCAMLFLAGS += -dtypes ++OCAMLFLAGS = -dtypes -w +a-4-27-k + + .SUBDIRS: src doc + +diff --git a/config.omake b/config.omake +index 4417254..2bbf1c6 100644 +--- a/config.omake ++++ b/config.omake +@@ -1,15 +1,11 @@ + + static. = ++ NATIVE_ENABLED = true + BYTE_ENABLED = true +- USE_OCAMLFIND=true ++ USE_OCAMLFIND = true + if $(not $(OCAMLFIND_EXISTS)) + eprintln(ocaml-findlib is required to build this project) + exit 1 + OCAMLDEP_MODULES_ENABLED = $(OCAMLDEP_MODULES_AVAILABLE) +- OCAMLDEP=$(OCAMLDEP_MODULES) +- PREFIX=$(shell ocamlc -where) + VERSION=0.1a +- ConfMsgChecking(oUnit) +- OUNIT_DIR=$(shell ocamlfind query oUnit) +- ConfMsgResult($(OUNIT_DIR)) + export +diff --git a/src/META.in b/src/META.in +index 6cbc725..ae33943 100644 +--- a/src/META.in ++++ b/src/META.in +@@ -1,3 +1,4 @@ +-version="0.1" ++version="0.1a" + archive(byte)="reins.cma" +-archive(native)="reins.cmxa" +\ No newline at end of file ++archive(native)="reins.cmxa" ++requires = "num" +diff --git a/src/OMakefile b/src/OMakefile +index 983799d..8a4b991 100644 +--- a/src/OMakefile ++++ b/src/OMakefile +@@ -51,6 +51,5 @@ doc: reins.mli + REINS_CMX=$(if $(NATIVE_ENABLED), reins.cmx) + + install: META $(REINS_LIB) +- mkdir -p $(PREFIX)/reins +- ocamlfind install reins META $(REINS_LIB) $(REINS_CMX) \ ++ ocamlfind install reins META $(REINS_LIB) reins.cmi $(REINS_CMX) \ + $(filter-exists $(addsuffix .mli, $(FILES))) +diff --git a/test/unit/OMakefile b/test/unit/OMakefile +index 565c83d..e040b4a 100644 +--- a/test/unit/OMakefile ++++ b/test/unit/OMakefile +@@ -1,9 +1,8 @@ + + TESTDIRS = list heap set map + +-OCAMLINCLUDES += \ +- $(shell $(OCAMLFIND) query oUnit) \ +- $(ROOT)/src ++OCAMLPACKS [] = oUnit num ++OCAMLINCLUDES += $(ROOT)/src + + FILES[] = + test_helper +@@ -17,10 +16,10 @@ FILES[] = + OCAMLINCLUDES += $(TESTDIRS) + + OCAML_LIBS = $(ROOT)/src/reins +-OCAML_OTHER_LIBS += str nums unix oUnit + TEST_PROGRAM = $(OCamlProgram run_unit_tests, $(FILES)) + + unit_tests.results: $(TEST_PROGRAM) + ./run_unit_tests |& tee $@ + +-.DEFAULT: $(TEST_PROGRAM) unit_tests.results ++.PHONY: test ++test: unit_tests.results diff --git a/patches/res/build_with_trunk.patch b/patches/res/build_with_trunk.patch new file mode 100644 index 0000000..46784ce --- /dev/null +++ b/patches/res/build_with_trunk.patch @@ -0,0 +1,26 @@ +diff -ur res.4.0.7/examples/weak_ex.ml res.4.0.7_mod/examples/weak_ex.ml +--- res.4.0.7/examples/weak_ex.ml 2014-12-19 02:37:15.000000000 +0100 ++++ res.4.0.7_mod/examples/weak_ex.ml 2015-01-13 16:29:48.025303723 +0100 +@@ -1,7 +1,6 @@ + (* Demonstrates the correct behaviour of resizable weak arrays. *) + + module W = Res.Weak +-module Array = W (* allows more convenient array access *) + + class foo = object end + +@@ -9,12 +8,12 @@ + + let _ = + W.add_one ra (Some (new foo)); +- match ra.(0) with ++ match W.get ra 0 with + | Some _ -> print_endline "Correctly allocated!" + | _ -> print_endline "Already deallocated??" + + let _ = + Gc.full_major (); +- match ra.(0) with ++ match W.get ra 0 with + | Some _ -> print_endline "Still not deallocated?" + | _ -> print_endline "Correctly deallocated!" diff --git a/patches/rubytt/rubytt.install b/patches/rubytt/rubytt.install new file mode 100644 index 0000000..935dbbc --- /dev/null +++ b/patches/rubytt/rubytt.install @@ -0,0 +1 @@ +bin: ["bin/main.native" {"rubytt"}] \ No newline at end of file diff --git a/patches/schoca/schoca.install b/patches/schoca/schoca.install new file mode 100644 index 0000000..1e024c1 --- /dev/null +++ b/patches/schoca/schoca.install @@ -0,0 +1,4 @@ +bin: [ + "shell/schoca.opt" {"schoca"} + "examples/read_ini_file.opt" {"read_ini_file"} +] diff --git a/patches/scrypt/no-ctypes-dependency.patch b/patches/scrypt/no-ctypes-dependency.patch new file mode 100644 index 0000000..90544cc --- /dev/null +++ b/patches/scrypt/no-ctypes-dependency.patch @@ -0,0 +1,10 @@ +diff --git a/META b/META +index f6b323d85..bc8c10e4b 100644 +--- a/META ++++ b/META +@@ -1,5 +1,4 @@ + version = "0.2.1" + description = "scrypt bindings for OCaml" +-requires = "ctypes.foreign" + archive(byte) = "scrypt.cma" + archive(native) = "scrypt.cmxa" diff --git a/patches/seq/META.seq b/patches/seq/META.seq new file mode 100644 index 0000000..06b95ef --- /dev/null +++ b/patches/seq/META.seq @@ -0,0 +1,4 @@ +name="seq" +version="[distributed with OCaml 4.07 or above]" +description="dummy backward-compatibility package for iterators" +requires="" diff --git a/patches/seq/seq.install b/patches/seq/seq.install new file mode 100644 index 0000000..c4d7020 --- /dev/null +++ b/patches/seq/seq.install @@ -0,0 +1,3 @@ +lib:[ + "META.seq" {"META"} +] diff --git a/patches/sexplib/disable_warn_error.patch b/patches/sexplib/disable_warn_error.patch new file mode 100644 index 0000000..baf6d2f --- /dev/null +++ b/patches/sexplib/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.503655726 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.646903881 -0500 +@@ -579,7 +579,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + Ocamlbuild_plugin.dispatch diff --git a/patches/sha/freebsd.patch b/patches/sha/freebsd.patch new file mode 100644 index 0000000..bdba79e --- /dev/null +++ b/patches/sha/freebsd.patch @@ -0,0 +1,24 @@ +From 56887bebdd395b9e98045d7d174d5d14a01c9e2b Mon Sep 17 00:00:00 2001 +From: Mykola Stryebkov +Date: Fri, 10 Jan 2014 17:02:42 +0200 +Subject: [PATCH] Get endian.h from the right place at FreeBSD + +--- + bitfn.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/bitfn.h b/bitfn.h +index 525043b..87f5cf2 100644 +--- a/bitfn.h ++++ b/bitfn.h +@@ -67,6 +67,8 @@ static inline uint64_t swap64(uint64_t a) + /* big endian to cpu */ + #ifdef __APPLE__ + #include ++#elif defined(__FreeBSD__) ++#include + #else + #include + #endif +-- +1.9.3 diff --git a/patches/sibylfs-lem/generate_install_manifest.sh b/patches/sibylfs-lem/generate_install_manifest.sh new file mode 100644 index 0000000..10b6efe --- /dev/null +++ b/patches/sibylfs-lem/generate_install_manifest.sh @@ -0,0 +1,9 @@ +#!/bin/sh -ex + +echo "bin: [" > sibylfs-lem.install +echo " \"src/main.native\" {\"lem\"}" >> sibylfs-lem.install +printf "]\nlib: [\n" >> sibylfs-lem.install + +ls -1 library/*.* hol-lib/*.* isabelle-lib/*.* coq-lib/*.* ocaml-lib/*.* \ +| sed -e "s/\\(.*\\)/ \"\1\" \{ \"\1\" \}/" >> sibylfs-lem.install +echo "]" >> sibylfs-lem.install diff --git a/patches/sibylfs-lem/ocamlfind_install.sh b/patches/sibylfs-lem/ocamlfind_install.sh new file mode 100644 index 0000000..1837af8 --- /dev/null +++ b/patches/sibylfs-lem/ocamlfind_install.sh @@ -0,0 +1,8 @@ +#!/bin/sh -ex + +ocamlfind install sibylfs-lem ocaml-lib/META \ + ocaml-lib/_build/extract.a \ + ocaml-lib/_build/extract.cma \ + ocaml-lib/_build/extract.cmxa \ + ocaml-lib/_build/*.mli \ + ocaml-lib/_build/*.cmi diff --git a/patches/sill/sill.install b/patches/sill/sill.install new file mode 100644 index 0000000..1bb39e5 --- /dev/null +++ b/patches/sill/sill.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/./sill.byte" {"sill"} + "?_build/./sill.native" {"sill"} +] diff --git a/patches/skkserv-lite/_oasis_remove_.ml b/patches/skkserv-lite/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/skkserv-lite/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/skkserv-lite/skkserv-lite.install b/patches/skkserv-lite/skkserv-lite.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/skkserv-lite/skkserv-lite.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/slack-backup/_oasis_remove_.ml b/patches/slack-backup/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/slack-backup/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/slack-backup/slack-backup.install b/patches/slack-backup/slack-backup.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/slack-backup/slack-backup.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/smart-print/operators.patch b/patches/smart-print/operators.patch new file mode 100644 index 0000000..d51e2db --- /dev/null +++ b/patches/smart-print/operators.patch @@ -0,0 +1,18 @@ +diff --git a/smartPrint.ml b/smartPrint.ml +index 8d1479a..90598b7 100644 +--- a/smartPrint.ml ++++ b/smartPrint.ml +@@ -1,3 +1,6 @@ ++external (|>) : 'a -> ('a -> 'b) -> 'b = "%revapply";; ++external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply" ++ + (* Separators. *) + module Break = struct + (* A break can be a whitespace or a newline if the text has to be splited. *) +@@ -418,4 +421,4 @@ let to_out_channel (width : int) (tab : int) (c : out_channel) (d : t) : unit = + (output_char c) (output_string c) output_sub_string d + + let to_stdout (width : int) (tab : int) (d : t) : unit = +- to_out_channel width tab stdout d +\ No newline at end of file ++ to_out_channel width tab stdout d diff --git a/patches/snappy/myocamlbuild.ml.osx.patch b/patches/snappy/myocamlbuild.ml.osx.patch new file mode 100644 index 0000000..ef48da7 --- /dev/null +++ b/patches/snappy/myocamlbuild.ml.osx.patch @@ -0,0 +1,21 @@ +--- myocamlbuild.ml 2016-02-14 13:30:11.000000000 +0000 ++++ myocamlbuild.ml 2016-02-14 13:33:23.000000000 +0000 +@@ -484,15 +484,15 @@ + (["oasis_library_snappy_ccopt"; "compile"], + [ + (OASISExpr.EBool true, +- S [A "-ccopt"; A "-x"; A "-ccopt"; A "c++"]) ++ S [A "-ccopt"; A "-x"; A "-ccopt"; A "c++"; A "-ccopt"; A "-I/usr/local/include"]) + ]); + (["oasis_library_snappy_cclib"; "link"], + [ + (OASISExpr.EBool true, +- S [A "-cclib"; A "-lstdc++"; A "-cclib"; A "-lsnappy"]) ++ S [A "-cclib"; A "-lstdc++"; A "-cclib"; A "-lsnappy"; A "-cclib"; A "-L/usr/local/lib"]) + ]); + (["oasis_library_snappy_cclib"; "ocamlmklib"; "c"], +- [(OASISExpr.EBool true, S [A "-lstdc++"; A "-lsnappy"])]) ++ [(OASISExpr.EBool true, S [A "-lstdc++"; A "-L/usr/local/lib"; A "-lsnappy"])]) + ]; + includes = [("", ["src"])]; + } diff --git a/patches/solo5-kernel-ukvm/solo5-no-asm-msr-index.diff b/patches/solo5-kernel-ukvm/solo5-no-asm-msr-index.diff new file mode 100644 index 0000000..dcacc6c --- /dev/null +++ b/patches/solo5-kernel-ukvm/solo5-no-asm-msr-index.diff @@ -0,0 +1,20 @@ +--- a/ukvm/ukvm-core.c ++++ b/ukvm/ukvm-core.c +@@ -36,7 +36,6 @@ + #include + #include + #include +-#include + #include + #include + #include +--- a/ukvm/ukvm-cpu.h ++++ b/ukvm/ukvm-cpu.h +@@ -133,4 +133,7 @@ struct _kvm_segment { + seg.avl = GDT_GET_AVL(gdt_ent); \ + } while (0) + ++#define EFER_LME_BIT 8 /* Long mode enable (R/W) */ ++#define EFER_LME _BITUL(EFER_LME_BIT) ++ + #endif diff --git a/patches/solo5-kernel-ukvm/solo5-no-werror.diff b/patches/solo5-kernel-ukvm/solo5-no-werror.diff new file mode 100644 index 0000000..e3b5879 --- /dev/null +++ b/patches/solo5-kernel-ukvm/solo5-no-werror.diff @@ -0,0 +1,19 @@ +--- a/ukvm/ukvm-configure ++++ b/ukvm/ukvm-configure +@@ -40,7 +40,7 @@ + + UKVM_CC?=cc + UKVM_FLAGS=-D__UKVM_HOST__ \$(UKVM_MODULE_FLAGS) +-UKVM_CFLAGS=-Wall -Werror -std=c99 -O2 -g \$(UKVM_FLAGS) ++UKVM_CFLAGS=-Wall -std=c99 -O2 -g \$(UKVM_FLAGS) + UKVM_OBJS=_build-ukvm/ukvm-core.o \$(UKVM_MODULE_OBJS) + ifdef UKVM_STATIC + UKVM_LDFLAGS=-static +--- a/Makefile.common ++++ b/Makefile.common +@@ -32,4 +32,4 @@ + # Likewise. + LDFLAGS=-nostdlib -z max-page-size=0x1000 -static + # CFLAGS used for building kernel/ and in-tree tests. +-CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -Werror -O2 -g ++CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -O2 -g diff --git a/patches/solo5-kernel-virtio/solo5-no-werror.diff b/patches/solo5-kernel-virtio/solo5-no-werror.diff new file mode 100644 index 0000000..e3b5879 --- /dev/null +++ b/patches/solo5-kernel-virtio/solo5-no-werror.diff @@ -0,0 +1,19 @@ +--- a/ukvm/ukvm-configure ++++ b/ukvm/ukvm-configure +@@ -40,7 +40,7 @@ + + UKVM_CC?=cc + UKVM_FLAGS=-D__UKVM_HOST__ \$(UKVM_MODULE_FLAGS) +-UKVM_CFLAGS=-Wall -Werror -std=c99 -O2 -g \$(UKVM_FLAGS) ++UKVM_CFLAGS=-Wall -std=c99 -O2 -g \$(UKVM_FLAGS) + UKVM_OBJS=_build-ukvm/ukvm-core.o \$(UKVM_MODULE_OBJS) + ifdef UKVM_STATIC + UKVM_LDFLAGS=-static +--- a/Makefile.common ++++ b/Makefile.common +@@ -32,4 +32,4 @@ + # Likewise. + LDFLAGS=-nostdlib -z max-page-size=0x1000 -static + # CFLAGS used for building kernel/ and in-tree tests. +-CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -Werror -O2 -g ++CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -O2 -g diff --git a/patches/spdiff/spdiff.install b/patches/spdiff/spdiff.install new file mode 100644 index 0000000..19d08cc --- /dev/null +++ b/patches/spdiff/spdiff.install @@ -0,0 +1,3 @@ +bin: [ + "spdiff.opt" {"spdiff"} +] diff --git a/patches/sqlgg/sqlgg.install b/patches/sqlgg/sqlgg.install new file mode 100644 index 0000000..0e487bd --- /dev/null +++ b/patches/sqlgg/sqlgg.install @@ -0,0 +1 @@ +bin: ["src/_build/sqlgg.byte" {"sqlgg"}] diff --git a/patches/ssl/configure b/patches/ssl/configure new file mode 100644 index 0000000..dedcd73 --- /dev/null +++ b/patches/ssl/configure @@ -0,0 +1,5964 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for ocaml-ssl 0.5.0. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: savonet-users@lists.sourceforge.net about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='ocaml-ssl' +PACKAGE_TARNAME='ocaml-ssl' +PACKAGE_VERSION='0.5.0' +PACKAGE_STRING='ocaml-ssl 0.5.0' +PACKAGE_BUGREPORT='savonet-users@lists.sourceforge.net' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +LIBOBJS +CAMLLIBPATH +OCAMLFIND_LDCONF +OCAMLBIN +OCAMLLIB +OCAMLVERSION +OCAMLBEST +BEST +OCAMLFLAGS +VERSION +PS2PDF +DVIPS +LATEX +OCAMLCP +OCAMLFIND +EGREP +GREP +CPP +OCAMLMKTOP +OCAMLDOC +OCAMLYACC +OCAMLLEX +OCAMLDEP +OCAMLOPTDOTOPT +OCAMLCDOTOPT +OCAMLOPT +OCAMLC +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_ldconf +enable_debugging +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures ocaml-ssl 0.5.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/ocaml-ssl] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of ocaml-ssl 0.5.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-ldconf don't modify the dynamic loader configuration file + (default is enable) + --enable-debugging compile with debugging information (backtrace + printing in particular) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +ocaml-ssl configure 0.5.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## -------------------------------------------------- ## +## Report this to savonet-users@lists.sourceforge.net ## +## -------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by ocaml-ssl $as_me 0.5.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +VERSION=$PACKAGE_VERSION +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring $PACKAGE_STRING" >&5 +$as_echo "configuring $PACKAGE_STRING" >&6; } + +MINGW=`uname -s | grep -c "MINGW"` + +OCAMLFIND_LDCONF="" +# Check whether --enable-ldconf was given. +if test "${enable_ldconf+set}" = set; then : + enableval=$enable_ldconf; ac_enable_ldconf=$enableval +else + ac_enable_ldconf=$enableval +fi + +if test "$ac_enable_ldconf" = no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabling modification of ld.conf" >&5 +$as_echo "disabling modification of ld.conf" >&6; } + OCAMLFIND_LDCONF=dummy +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_create (); +int +main () +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_create=yes +else + ac_cv_lib_pthread_pthread_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +fi + + +# Check for Ocaml compilers + +# we first look for ocamlc in the path; if not present, we fail +# Extract the first word of "ocamlc", so it can be a program name with args. +set dummy ocamlc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLC"; then + ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLC="`which ocamlc`" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_OCAMLC" && ac_cv_prog_OCAMLC="no" +fi +fi +OCAMLC=$ac_cv_prog_OCAMLC +if test -n "$OCAMLC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 +$as_echo "$OCAMLC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OCAMLC" = no ; then + as_fn_error $? "Cannot find ocamlc." "$LINENO" 5 +fi + +# we look for the directory of ocamlc in $OCAMLC +OCAMLBIN=`dirname $OCAMLC` + +# we extract Ocaml version number and library path +OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` +echo "ocaml version is $OCAMLVERSION" +OCAMLLIB=`$OCAMLC -v | tail -n 1 | cut -f 4 -d " "` +echo "ocaml library path is $OCAMLLIB" + +# then we look for ocamlopt; if not present, we issue a warning +# if the version is not the same, we also discard it +# we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not +# Extract the first word of "ocamlopt", so it can be a program name with args. +set dummy ocamlopt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLOPT in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLOPT="$OCAMLOPT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLOPT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLOPT" && ac_cv_path_OCAMLOPT="no" + ;; +esac +fi +OCAMLOPT=$ac_cv_path_OCAMLOPT +if test -n "$OCAMLOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 +$as_echo "$OCAMLOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +OCAMLBEST=byte +if test "$OCAMLOPT" = no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 +$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlopt version" >&5 +$as_echo_n "checking ocamlopt version... " >&6; } + TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlopt discarded." >&5 +$as_echo "differs from ocamlc; ocamlopt discarded." >&6; } + OCAMLOPT=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + OCAMLBEST=opt + fi +fi + +# checking for ocamlc.opt +# Extract the first word of "ocamlc.opt", so it can be a program name with args. +set dummy ocamlc.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLCDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLCDOTOPT in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLCDOTOPT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLCDOTOPT" && ac_cv_path_OCAMLCDOTOPT="no" + ;; +esac +fi +OCAMLCDOTOPT=$ac_cv_path_OCAMLCDOTOPT +if test -n "$OCAMLCDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 +$as_echo "$OCAMLCDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OCAMLCDOTOPT" != no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlc.opt version" >&5 +$as_echo_n "checking ocamlc.opt version... " >&6; } + TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlc.opt discarded." >&5 +$as_echo "differs from ocamlc; ocamlc.opt discarded." >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + OCAMLC=$OCAMLCDOTOPT + fi +fi + +# checking for ocamlopt.opt +if test "$OCAMLOPT" != no ; then + # Extract the first word of "ocamlopt.opt", so it can be a program name with args. +set dummy ocamlopt.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLOPTDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLOPTDOTOPT in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLOPTDOTOPT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLOPTDOTOPT" && ac_cv_path_OCAMLOPTDOTOPT="no" + ;; +esac +fi +OCAMLOPTDOTOPT=$ac_cv_path_OCAMLOPTDOTOPT +if test -n "$OCAMLOPTDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 +$as_echo "$OCAMLOPTDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "$OCAMLOPTDOTOPT" != no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlc.opt version" >&5 +$as_echo_n "checking ocamlc.opt version... " >&6; } + TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVER" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlopt.opt discarded." >&5 +$as_echo "differs from ocamlc; ocamlopt.opt discarded." >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + OCAMLOPT=$OCAMLOPTDOTOPT + fi + fi +fi + +if test "$OCAMLOPT" = no ; then + BEST="bcl" +else + BEST="bcl ncl" +fi + +# ocamldep, ocamllex and ocamlyacc should also be present in the path +# Extract the first word of "ocamldep", so it can be a program name with args. +set dummy ocamldep; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLDEP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLDEP in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLDEP="$OCAMLDEP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLDEP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLDEP" && ac_cv_path_OCAMLDEP="no" + ;; +esac +fi +OCAMLDEP=$ac_cv_path_OCAMLDEP +if test -n "$OCAMLDEP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 +$as_echo "$OCAMLDEP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OCAMLDEP" = no ; then + as_fn_error $? "Cannot find ocamldep." "$LINENO" 5 +fi + +# Extract the first word of "ocamllex", so it can be a program name with args. +set dummy ocamllex; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLLEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLLEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLLEX="$OCAMLLEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLLEX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLLEX" && ac_cv_path_OCAMLLEX="no" + ;; +esac +fi +OCAMLLEX=$ac_cv_path_OCAMLLEX +if test -n "$OCAMLLEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5 +$as_echo "$OCAMLLEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OCAMLLEX" = no ; then + as_fn_error $? "Cannot find ocamllex." "$LINENO" 5 +fi + +# Extract the first word of "ocamlyacc", so it can be a program name with args. +set dummy ocamlyacc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLYACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLYACC in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLYACC="$OCAMLYACC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLYACC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLYACC" && ac_cv_path_OCAMLYACC="no" + ;; +esac +fi +OCAMLYACC=$ac_cv_path_OCAMLYACC +if test -n "$OCAMLYACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5 +$as_echo "$OCAMLYACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OCAMLYACC" = no ; then + as_fn_error $? "Cannot find ocamlyacc." "$LINENO" 5 +fi + +# Extract the first word of "ocamldoc", so it can be a program name with args. +set dummy ocamldoc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLDOC="$OCAMLDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLDOC" && ac_cv_path_OCAMLDOC="no" + ;; +esac +fi +OCAMLDOC=$ac_cv_path_OCAMLDOC +if test -n "$OCAMLDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 +$as_echo "$OCAMLDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +# Check whether --enable-debugging was given. +if test "${enable_debugging+set}" = set; then : + enableval=$enable_debugging; +fi + + +if test "x$enable_debugging" = "xyes" ; then + OCAMLFLAGS="$OCAMLFLAGS -g" +fi + +# Extract the first word of "ocamlmktop", so it can be a program name with args. +set dummy ocamlmktop; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLMKTOP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLMKTOP in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLMKTOP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLMKTOP" && ac_cv_path_OCAMLMKTOP="no" + ;; +esac +fi +OCAMLMKTOP=$ac_cv_path_OCAMLMKTOP +if test -n "$OCAMLMKTOP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 +$as_echo "$OCAMLMKTOP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OCAMLMKTOP" = no ; then + as_fn_error $? "Cannot find ocamlmktop." "$LINENO" 5 +fi + +CAMLLIBPATH=`$OCAMLC -where` + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test "$MINGW" != 0; then + OTHER_LIBS="-lcrypto -lws2_32 -lgdi32 -lcrypt32" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5 +$as_echo_n "checking for SSL_new in -lssl... " >&6; } +if ${ac_cv_lib_ssl_SSL_new+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $OTHER_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char SSL_new (); +int +main () +{ +return SSL_new (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ssl_SSL_new=yes +else + ac_cv_lib_ssl_SSL_new=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5 +$as_echo "$ac_cv_lib_ssl_SSL_new" >&6; } +if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSSL 1 +_ACEOF + + LIBS="-lssl $LIBS" + +else + as_fn_error $? "Cannot find libssl." "$LINENO" 5 +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : + +else + as_fn_error $? "Cannot find libssl headers." "$LINENO" 5 +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLSv1_1_method in -lssl" >&5 +$as_echo_n "checking for TLSv1_1_method in -lssl... " >&6; } +if ${ac_cv_lib_ssl_TLSv1_1_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $OTHER_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char TLSv1_1_method (); +int +main () +{ +return TLSv1_1_method (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ssl_TLSv1_1_method=yes +else + ac_cv_lib_ssl_TLSv1_1_method=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_TLSv1_1_method" >&5 +$as_echo "$ac_cv_lib_ssl_TLSv1_1_method" >&6; } +if test "x$ac_cv_lib_ssl_TLSv1_1_method" = xyes; then : + CFLAGS="$CFLAGS -DHAVE_TLS11" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLSv1_2_method in -lssl" >&5 +$as_echo_n "checking for TLSv1_2_method in -lssl... " >&6; } +if ${ac_cv_lib_ssl_TLSv1_2_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $OTHER_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char TLSv1_2_method (); +int +main () +{ +return TLSv1_2_method (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ssl_TLSv1_2_method=yes +else + ac_cv_lib_ssl_TLSv1_2_method=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_TLSv1_2_method" >&5 +$as_echo "$ac_cv_lib_ssl_TLSv1_2_method" >&6; } +if test "x$ac_cv_lib_ssl_TLSv1_2_method" = xyes; then : + CFLAGS="$CFLAGS -DHAVE_TLS12" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EC_KEY_free in -lcrypto" >&5 +$as_echo_n "checking for EC_KEY_free in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_EC_KEY_free+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $OTHER_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char EC_KEY_free (); +int +main () +{ +return EC_KEY_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_EC_KEY_free=yes +else + ac_cv_lib_crypto_EC_KEY_free=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EC_KEY_free" >&5 +$as_echo "$ac_cv_lib_crypto_EC_KEY_free" >&6; } +if test "x$ac_cv_lib_crypto_EC_KEY_free" = xyes; then : + CFLAGS="$CFLAGS -DHAVE_EC" +fi + +ac_fn_c_check_decl "$LINENO" "SSL_set_tlsext_host_name" "ac_cv_have_decl_SSL_set_tlsext_host_name" "#include +" +if test "x$ac_cv_have_decl_SSL_set_tlsext_host_name" = xyes; then : + CFLAGS="$CFLAGS -DHAVE_SNI" +fi + + +# other progs +# Extract the first word of "ocamlfind", so it can be a program name with args. +set dummy ocamlfind; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLFIND+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLFIND in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLFIND="$OCAMLFIND" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLFIND="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLFIND" && ac_cv_path_OCAMLFIND="no" + ;; +esac +fi +OCAMLFIND=$ac_cv_path_OCAMLFIND +if test -n "$OCAMLFIND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5 +$as_echo "$OCAMLFIND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OCAMLFIND" = no ; then + as_fn_error $? "Cannot find ocamlfind." "$LINENO" 5 +fi + +# Extract the first word of "ocamlcp", so it can be a program name with args. +set dummy ocamlcp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCAMLCP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCAMLCP in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCAMLCP="$OCAMLCP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OCAMLCP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OCAMLCP" && ac_cv_path_OCAMLCP="no" + ;; +esac +fi +OCAMLCP=$ac_cv_path_OCAMLCP +if test -n "$OCAMLCP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCP" >&5 +$as_echo "$OCAMLCP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +#if test "$OCAMLCP" = no ; then +# AC_MSG_ERROR(Cannot find ocamlcp.) +#fi + +# Extract the first word of "latex", so it can be a program name with args. +set dummy latex; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_LATEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $LATEX in + [\\/]* | ?:[\\/]*) + ac_cv_path_LATEX="$LATEX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LATEX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_LATEX" && ac_cv_path_LATEX="no" + ;; +esac +fi +LATEX=$ac_cv_path_LATEX +if test -n "$LATEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LATEX" >&5 +$as_echo "$LATEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +#if test "$LATEX" = no ; then +# AC_MSG_ERROR(Cannot find LaTeX.) +#fi + +# Extract the first word of "dvips", so it can be a program name with args. +set dummy dvips; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DVIPS+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DVIPS in + [\\/]* | ?:[\\/]*) + ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DVIPS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_DVIPS" && ac_cv_path_DVIPS="no" + ;; +esac +fi +DVIPS=$ac_cv_path_DVIPS +if test -n "$DVIPS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DVIPS" >&5 +$as_echo "$DVIPS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +#if test "$DVIPS" = no ; then +# AC_MSG_ERROR(Cannot find dvips.) +#fi + +# Extract the first word of "ps2pdf", so it can be a program name with args. +set dummy ps2pdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PS2PDF+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PS2PDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_PS2PDF="$PS2PDF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PS2PDF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PS2PDF" && ac_cv_path_PS2PDF="no" + ;; +esac +fi +PS2PDF=$ac_cv_path_PS2PDF +if test -n "$PS2PDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PS2PDF" >&5 +$as_echo "$PS2PDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +#if test "$PS2PDF" = no ; then +# AC_MSG_ERROR(Cannot find ps2pdf.) +#fi + +# substitutions to perform + + + + + + + + + + + + + + # TODO + # TODO + + # TODO + + + # TODO + # TODO + # TODO + # TODO + +# Finally create the Makefile and samples +ac_config_files="$ac_config_files src/Makefile" + +ac_config_files="$ac_config_files src/META" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by ocaml-ssl $as_me 0.5.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +ocaml-ssl config.status 0.5.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/META") CONFIG_FILES="$CONFIG_FILES src/META" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + + + case $ac_file$ac_mode in + "src/Makefile":F) chmod a-w src/Makefile ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/patches/ssl/fix-accept.diff b/patches/ssl/fix-accept.diff new file mode 100644 index 0000000..abb36b6 --- /dev/null +++ b/patches/ssl/fix-accept.diff @@ -0,0 +1,51 @@ +commit 13f860b8165566bcf2b5c25ba5118eb330667625 +Author: Jérôme Vouillon +Date: Sun Jul 29 18:26:41 2012 +0200 + + A return value of 0 for SSL_connect/accept was not considered as an error + +diff --git a/src/ssl_stubs.c b/src/ssl_stubs.c +index 2c4e492..d15e705 100644 +--- a/src/ssl_stubs.c ++++ b/src/ssl_stubs.c +@@ -761,21 +761,15 @@ CAMLprim value ocaml_ssl_embed_socket(value socket_, value context) + CAMLprim value ocaml_ssl_connect(value socket) + { + CAMLparam1(socket); +- int ret; ++ int ret, err; + SSL *ssl = SSL_val(socket); + + caml_enter_blocking_section(); + ret = SSL_connect(ssl); ++ err = SSL_get_error(ssl, ret); + caml_leave_blocking_section(); +- if (ret < 0) +- { +- int err; +- +- caml_enter_blocking_section(); +- err = SSL_get_error(ssl, ret); +- caml_leave_blocking_section(); ++ if (err != SSL_ERROR_NONE) + caml_raise_with_arg(*caml_named_value("ssl_exn_connection_error"), Val_int(err)); +- } + + CAMLreturn(Val_unit); + } +@@ -859,12 +853,10 @@ CAMLprim value ocaml_ssl_accept(value socket) + int ret, err; + caml_enter_blocking_section(); + ret = SSL_accept(ssl); +- if (ret <= 0) +- { +- err = SSL_get_error(ssl, ret); +- caml_leave_blocking_section(); ++ err = SSL_get_error(ssl, ret); ++ caml_leave_blocking_section(); ++ if (err != SSL_ERROR_NONE) + caml_raise_with_arg(*caml_named_value("ssl_exn_accept_error"), Val_int(err)); +- } + caml_leave_blocking_section(); + + CAMLreturn(Val_unit); diff --git a/patches/ssl/fix-meta.diff b/patches/ssl/fix-meta.diff new file mode 100644 index 0000000..cf3ed8c --- /dev/null +++ b/patches/ssl/fix-meta.diff @@ -0,0 +1,14 @@ +diff --git a/src/META.in b/src/META.in +index 5c46a2b..afbd88e 100644 +--- a/src/META.in ++++ b/src/META.in +@@ -1,7 +1,7 @@ + name="Ssl" + version="@VERSION@" + description="OCaml bindings to libssl" +-requires="unix" ++requires="unix bytes" + archive(byte) = "ssl.cma" + archive(native) = "ssl.cmxa" + archive(mt,byte) = "ssl_threads.cma" + diff --git a/patches/ssl/osx-configure.sh b/patches/ssl/osx-configure.sh new file mode 100644 index 0000000..bd877a7 --- /dev/null +++ b/patches/ssl/osx-configure.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +PREFIX=$1 + +if [ -d "/usr/local/opt/openssl/" ]; then + # Homebrew + ./configure --prefix "${PREFIX}" CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" +else + # MacPorts + ./configure --prefix "${PREFIX}" CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" +fi diff --git a/patches/ssl/pkgconfigure b/patches/ssl/pkgconfigure new file mode 100644 index 0000000..b75d4c4 --- /dev/null +++ b/patches/ssl/pkgconfigure @@ -0,0 +1,5 @@ +#!/bin/sh + +export LDFLAGS=`pkg-config libssl --libs` +export CFLAGS=`pkg-config libssl --cflags` +./configure $* diff --git a/patches/stog/stog.install.0.10.0 b/patches/stog/stog.install.0.10.0 new file mode 100644 index 0000000..311fc33 --- /dev/null +++ b/patches/stog/stog.install.0.10.0 @@ -0,0 +1,10 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" + "latex2stog" + "latex2stog.byte" +] diff --git a/patches/stog/stog.install.0.11.0 b/patches/stog/stog.install.0.11.0 new file mode 100644 index 0000000..311fc33 --- /dev/null +++ b/patches/stog/stog.install.0.11.0 @@ -0,0 +1,10 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" + "latex2stog" + "latex2stog.byte" +] diff --git a/patches/stog/stog.install.0.11.1 b/patches/stog/stog.install.0.11.1 new file mode 100644 index 0000000..311fc33 --- /dev/null +++ b/patches/stog/stog.install.0.11.1 @@ -0,0 +1,10 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" + "latex2stog" + "latex2stog.byte" +] diff --git a/patches/stog/stog.install.0.12.0 b/patches/stog/stog.install.0.12.0 new file mode 100644 index 0000000..311fc33 --- /dev/null +++ b/patches/stog/stog.install.0.12.0 @@ -0,0 +1,10 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" + "latex2stog" + "latex2stog.byte" +] diff --git a/patches/stog/stog.install.0.13.0 b/patches/stog/stog.install.0.13.0 new file mode 100644 index 0000000..b33aaf5 --- /dev/null +++ b/patches/stog/stog.install.0.13.0 @@ -0,0 +1,12 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" + "?stog-server" + "?stog-server.byte" + "latex2stog" + "latex2stog.byte" +] diff --git a/patches/stog/stog.install.0.14.0 b/patches/stog/stog.install.0.14.0 new file mode 100644 index 0000000..b33aaf5 --- /dev/null +++ b/patches/stog/stog.install.0.14.0 @@ -0,0 +1,12 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" + "?stog-server" + "?stog-server.byte" + "latex2stog" + "latex2stog.byte" +] diff --git a/patches/stog/stog.install.0.15.0 b/patches/stog/stog.install.0.15.0 new file mode 100644 index 0000000..4b18530 --- /dev/null +++ b/patches/stog/stog.install.0.15.0 @@ -0,0 +1,16 @@ +bin: [ + "src/stog" + "src/stog.byte" + "src/stog-ocaml-session" + "src/mk-stog" + "src/mk-stog.byte" + "src/mk-stog-ocaml-session" + "?src/stog-server" + "?src/stog-server.byte" + "?src/stog-multi-server" + "?src/stog-multi-server.byte" + "src/latex2stog" + "src/latex2stog.byte" + "src/stog-tmpl" + "src/stog-tmpl.byte" +] diff --git a/patches/stog/stog.install.0.16.0 b/patches/stog/stog.install.0.16.0 new file mode 100644 index 0000000..4b18530 --- /dev/null +++ b/patches/stog/stog.install.0.16.0 @@ -0,0 +1,16 @@ +bin: [ + "src/stog" + "src/stog.byte" + "src/stog-ocaml-session" + "src/mk-stog" + "src/mk-stog.byte" + "src/mk-stog-ocaml-session" + "?src/stog-server" + "?src/stog-server.byte" + "?src/stog-multi-server" + "?src/stog-multi-server.byte" + "src/latex2stog" + "src/latex2stog.byte" + "src/stog-tmpl" + "src/stog-tmpl.byte" +] diff --git a/patches/stog/stog.install.0.17.0 b/patches/stog/stog.install.0.17.0 new file mode 100644 index 0000000..4b18530 --- /dev/null +++ b/patches/stog/stog.install.0.17.0 @@ -0,0 +1,16 @@ +bin: [ + "src/stog" + "src/stog.byte" + "src/stog-ocaml-session" + "src/mk-stog" + "src/mk-stog.byte" + "src/mk-stog-ocaml-session" + "?src/stog-server" + "?src/stog-server.byte" + "?src/stog-multi-server" + "?src/stog-multi-server.byte" + "src/latex2stog" + "src/latex2stog.byte" + "src/stog-tmpl" + "src/stog-tmpl.byte" +] diff --git a/patches/stog/stog.install.0.17.1 b/patches/stog/stog.install.0.17.1 new file mode 100644 index 0000000..4b18530 --- /dev/null +++ b/patches/stog/stog.install.0.17.1 @@ -0,0 +1,16 @@ +bin: [ + "src/stog" + "src/stog.byte" + "src/stog-ocaml-session" + "src/mk-stog" + "src/mk-stog.byte" + "src/mk-stog-ocaml-session" + "?src/stog-server" + "?src/stog-server.byte" + "?src/stog-multi-server" + "?src/stog-multi-server.byte" + "src/latex2stog" + "src/latex2stog.byte" + "src/stog-tmpl" + "src/stog-tmpl.byte" +] diff --git a/patches/stog/stog.install.0.4 b/patches/stog/stog.install.0.4 new file mode 100644 index 0000000..7c06ca2 --- /dev/null +++ b/patches/stog/stog.install.0.4 @@ -0,0 +1,5 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" +] diff --git a/patches/stog/stog.install.0.5 b/patches/stog/stog.install.0.5 new file mode 100644 index 0000000..7c06ca2 --- /dev/null +++ b/patches/stog/stog.install.0.5 @@ -0,0 +1,5 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" +] diff --git a/patches/stog/stog.install.0.6.1 b/patches/stog/stog.install.0.6.1 new file mode 100644 index 0000000..7c06ca2 --- /dev/null +++ b/patches/stog/stog.install.0.6.1 @@ -0,0 +1,5 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" +] diff --git a/patches/stog/stog.install.0.7.0 b/patches/stog/stog.install.0.7.0 new file mode 100644 index 0000000..3963cf3 --- /dev/null +++ b/patches/stog/stog.install.0.7.0 @@ -0,0 +1,8 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" +] diff --git a/patches/stog/stog.install.0.8.0 b/patches/stog/stog.install.0.8.0 new file mode 100644 index 0000000..3963cf3 --- /dev/null +++ b/patches/stog/stog.install.0.8.0 @@ -0,0 +1,8 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" +] diff --git a/patches/stog/stog.install.0.9.0 b/patches/stog/stog.install.0.9.0 new file mode 100644 index 0000000..3963cf3 --- /dev/null +++ b/patches/stog/stog.install.0.9.0 @@ -0,0 +1,8 @@ +bin: [ + "stog" + "stog.byte" + "stog-ocaml-session" + "mk-stog" + "mk-stog.byte" + "mk-stog-ocaml-session" +] diff --git a/patches/stone/configure.diff b/patches/stone/configure.diff new file mode 100644 index 0000000..2f40e30 --- /dev/null +++ b/patches/stone/configure.diff @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 8be972f..fc98909 100755 +--- a/configure ++++ b/configure +@@ -2,7 +2,7 @@ + + BIN_DIR="." + +-if [ "$1" == "--bin-dir" ]; then ++if [ "$1" = "--bin-dir" ]; then + BIN_DIR="$2" + fi + diff --git a/patches/stone/configure2.diff b/patches/stone/configure2.diff new file mode 100644 index 0000000..863bd54 --- /dev/null +++ b/patches/stone/configure2.diff @@ -0,0 +1,12 @@ +diff --git a/configure b/configure +index fc98909..23da9bc 100755 +--- a/configure ++++ b/configure +@@ -9,7 +9,7 @@ fi + cp Makefile.in Makefile + + if [ "$BIN_DIR" != "." ]; then +- echo -e " ++ printf " + install: stone + \tcp stone $BIN_DIR/ diff --git a/patches/swdogen/swdogen.install b/patches/swdogen/swdogen.install new file mode 100644 index 0000000..adb981f --- /dev/null +++ b/patches/swdogen/swdogen.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/main.byte" {"swdogen"} + "?_build/src/main.native" {"swdogen"} +] diff --git a/patches/tallgeese/_oasis_remove_.ml b/patches/tallgeese/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/tallgeese/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/tallgeese/tallgeese.install b/patches/tallgeese/tallgeese.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/tallgeese/tallgeese.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/tezos-clic/with-re.patch b/patches/tezos-clic/with-re.patch new file mode 100644 index 0000000..6884a39 --- /dev/null +++ b/patches/tezos-clic/with-re.patch @@ -0,0 +1,18 @@ +commit 2d04838fcff65c494316562bd415ec98e4a82703 +Author: Pierre Boutillier +Date: Fri Oct 16 18:05:19 2020 +0200 + + Opam: clic requires re + +diff --git a/src/lib_clic/dune b/src/lib_clic/dune +index 421a42c891..22f96d5f10 100644 +--- a/src/lib_clic/dune ++++ b/src/lib_clic/dune +@@ -5,6 +5,7 @@ + -open Tezos_error_monad)) + (libraries tezos-stdlib + lwt ++ re + tezos-error-monad)) + + (rule diff --git a/patches/tezos-crypto/crypto_for_ocaml12.diff b/patches/tezos-crypto/crypto_for_ocaml12.diff new file mode 100644 index 0000000..54e7d90 --- /dev/null +++ b/patches/tezos-crypto/crypto_for_ocaml12.diff @@ -0,0 +1,37 @@ +diff --git a/src/lib_crypto/dal/dal_cryptobox.ml b/src/lib_crypto/dal/dal_cryptobox.ml +index f5675497c9..b141337e5a 100644 +--- a/src/lib_crypto/dal/dal_cryptobox.ml ++++ b/src/lib_crypto/dal/dal_cryptobox.ml +@@ -695,25 +695,25 @@ module Make (C : CONSTANTS) = struct + + let _save_precompute_shards_proofs (preprocess : shards_proofs_precomputation) + filename = +- let chan = Out_channel.open_bin filename in +- Out_channel.output_bytes ++ let chan = Stdlib.open_out_bin filename in ++ Stdlib.output_bytes + chan + (Data_encoding.Binary.to_bytes_exn + Encoding.shards_proofs_precomputation_encoding + preprocess) ; +- Out_channel.close_noerr chan ++ Stdlib.close_out_noerr chan + + let _load_precompute_shards_proofs filename = +- let chan = In_channel.open_bin filename in +- let len = Int64.to_int (In_channel.length chan) in ++ let chan = Stdlib.open_in_bin filename in ++ let len = Int64.to_int (Stdlib.LargeFile.in_channel_length chan) in + let data = Bytes.create len in +- let (_ : unit option) = In_channel.really_input chan data 0 len in ++ let () = try Stdlib.really_input chan data 0 len with End_of_file -> () in + let precomp = + Data_encoding.Binary.of_bytes_exn + Encoding.shards_proofs_precomputation_encoding + data + in +- In_channel.close_noerr chan ; ++ Stdlib.close_in_noerr chan ; + precomp + + let prove_shards srs p = diff --git a/patches/tezos-hacl-glue/tests_in-packages.patch b/patches/tezos-hacl-glue/tests_in-packages.patch new file mode 100644 index 0000000..0a83561 --- /dev/null +++ b/patches/tezos-hacl-glue/tests_in-packages.patch @@ -0,0 +1,12 @@ +diff --git a/src/lib_time_measurement/ppx/test/dune b/src/lib_time_measurement/ppx/test/dune +index 89efb7b81a..0aa4f99e51 100644 +--- a/src/lib_time_measurement/ppx/test/dune ++++ b/src/lib_time_measurement/ppx/test/dune +@@ -1,6 +1,7 @@ + + (library + (name tezos_time_measurement_ppx_test) ++ (package tezos-time-measurement) + (modules utils) + (inline_tests) + (preprocess (pps ppx_inline_test))) diff --git a/patches/tezos-lmdb/tezos-lmdb_under_freebsd.diff b/patches/tezos-lmdb/tezos-lmdb_under_freebsd.diff new file mode 100644 index 0000000..8f68d20 --- /dev/null +++ b/patches/tezos-lmdb/tezos-lmdb_under_freebsd.diff @@ -0,0 +1,13 @@ +diff --git a/vendors/ocaml-lmdb/config/discover.ml b/vendors/ocaml-lmdb/config/discover.ml +index 1b0496ec98..52542cd24e 100644 +--- a/vendors/ocaml-lmdb/config/discover.ml ++++ b/vendors/ocaml-lmdb/config/discover.ml +@@ -3,6 +3,7 @@ let () = + let w = "-W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized" in + let thread = "-pthread" in + let opt = "-O2 -g" in +- Printf.fprintf oc "(%s %s %s %s)" w thread opt ++ let freebsd_stuff = "-I/usr/local/include -D_WANT_SEMUN" in ++ Printf.fprintf oc "(%s %s %s %s %s)" w thread opt freebsd_stuff + (if Sys.word_size = 32 then "-DMDB_VL32" else "") ; + close_out oc diff --git a/patches/tezos-lwt-result-stdlib/tests_in-packages.patch b/patches/tezos-lwt-result-stdlib/tests_in-packages.patch new file mode 100644 index 0000000..0a83561 --- /dev/null +++ b/patches/tezos-lwt-result-stdlib/tests_in-packages.patch @@ -0,0 +1,12 @@ +diff --git a/src/lib_time_measurement/ppx/test/dune b/src/lib_time_measurement/ppx/test/dune +index 89efb7b81a..0aa4f99e51 100644 +--- a/src/lib_time_measurement/ppx/test/dune ++++ b/src/lib_time_measurement/ppx/test/dune +@@ -1,6 +1,7 @@ + + (library + (name tezos_time_measurement_ppx_test) ++ (package tezos-time-measurement) + (modules utils) + (inline_tests) + (preprocess (pps ppx_inline_test))) diff --git a/patches/tezos-protocol-environment-packer/tests_in-packages.patch b/patches/tezos-protocol-environment-packer/tests_in-packages.patch new file mode 100644 index 0000000..0a83561 --- /dev/null +++ b/patches/tezos-protocol-environment-packer/tests_in-packages.patch @@ -0,0 +1,12 @@ +diff --git a/src/lib_time_measurement/ppx/test/dune b/src/lib_time_measurement/ppx/test/dune +index 89efb7b81a..0aa4f99e51 100644 +--- a/src/lib_time_measurement/ppx/test/dune ++++ b/src/lib_time_measurement/ppx/test/dune +@@ -1,6 +1,7 @@ + + (library + (name tezos_time_measurement_ppx_test) ++ (package tezos-time-measurement) + (modules utils) + (inline_tests) + (preprocess (pps ppx_inline_test))) diff --git a/patches/tezos-stdlib-unix/with-re.patch b/patches/tezos-stdlib-unix/with-re.patch new file mode 100644 index 0000000..31194f2 --- /dev/null +++ b/patches/tezos-stdlib-unix/with-re.patch @@ -0,0 +1,30 @@ +commit 11a5454ad16e0fa7c9ce74905609fbed9db18e1b +Author: Pierre Boutillier +Date: Fri Oct 16 17:35:04 2020 +0200 + + Build: tezos-stdlib-unix needs Re + +diff --git a/src/lib_stdlib_unix/dune b/src/lib_stdlib_unix/dune +index 4539125cf5..bbfbd85a28 100644 +--- a/src/lib_stdlib_unix/dune ++++ b/src/lib_stdlib_unix/dune +@@ -11,6 +11,7 @@ + tezos-stdlib + lwt.unix + ipaddr.unix ++ re + ptime + ptime.clock.os + mtime +diff --git a/src/lib_stdlib_unix/tezos-stdlib-unix.opam b/src/lib_stdlib_unix/tezos-stdlib-unix.opam +index 9ecebc4440..30b5d93df1 100644 +--- a/src/lib_stdlib_unix/tezos-stdlib-unix.opam ++++ b/src/lib_stdlib_unix/tezos-stdlib-unix.opam +@@ -13,6 +13,7 @@ depends: [ + "tezos-error-monad" + "tezos-event-logging" + "tezos-stdlib" ++ "re" + "lwt" { >= "3.0.0" } + "ptime" { >= "0.8.4" } + "mtime" { >= "1.0.0" } diff --git a/patches/tezos-test-helpers/tests_in-packages.patch b/patches/tezos-test-helpers/tests_in-packages.patch new file mode 100644 index 0000000..0a83561 --- /dev/null +++ b/patches/tezos-test-helpers/tests_in-packages.patch @@ -0,0 +1,12 @@ +diff --git a/src/lib_time_measurement/ppx/test/dune b/src/lib_time_measurement/ppx/test/dune +index 89efb7b81a..0aa4f99e51 100644 +--- a/src/lib_time_measurement/ppx/test/dune ++++ b/src/lib_time_measurement/ppx/test/dune +@@ -1,6 +1,7 @@ + + (library + (name tezos_time_measurement_ppx_test) ++ (package tezos-time-measurement) + (modules utils) + (inline_tests) + (preprocess (pps ppx_inline_test))) diff --git a/patches/tezos-webassembly-interpreter/webassembly_for_ocaml12.diff b/patches/tezos-webassembly-interpreter/webassembly_for_ocaml12.diff new file mode 100644 index 0000000..c558b30 --- /dev/null +++ b/patches/tezos-webassembly-interpreter/webassembly_for_ocaml12.diff @@ -0,0 +1,13 @@ +diff --git a/src/lib_webassembly/util/chunked_byte_vector.ml b/src/lib_webassembly/util/chunked_byte_vector.ml +index 0a0e829786..1b494f05b6 100644 +--- a/src/lib_webassembly/util/chunked_byte_vector.ml ++++ b/src/lib_webassembly/util/chunked_byte_vector.ml +@@ -26,7 +26,7 @@ module Chunk = struct + + let of_bytes bytes = + let chunk = alloc () in +- for i = 0 to Int.max (Int64.to_int size) (Bytes.length bytes) - 1 do ++ for i = 0 to max (Int64.to_int size) (Bytes.length bytes) - 1 do + Array1.set chunk i (Char.code (Bytes.get bytes i)) + done ; + chunk diff --git a/patches/tplib/fix-makefile.diff b/patches/tplib/fix-makefile.diff new file mode 100644 index 0000000..5a41016 --- /dev/null +++ b/patches/tplib/fix-makefile.diff @@ -0,0 +1,12 @@ +diff -u -r tplib.1.3-orig/Makefile.in tplib.1.3/Makefile.in +--- tplib.1.3-orig/Makefile.in 2013-02-14 12:08:25.000000000 +0100 ++++ tplib.1.3/Makefile.in 2014-08-28 18:31:03.000000000 +0200 +@@ -31,7 +31,7 @@ + CP = cp + RANLIB = ranlib + BUILD_DIR = _build +-OCAMLBUILD = @OCAMLBUILD@ -ocamlc ocp-ocamlc.opt -ocamlopt ocp-ocamlopt.opt -classic-display -no-links -build-dir $(BUILD_DIR) -use-ocamlfind ++OCAMLBUILD = @OCAMLBUILD@ -classic-display -no-links -build-dir $(BUILD_DIR) -use-ocamlfind + OCAMLFIND = @OCAMLFIND@ + TPLIB = @PACKAGE_NAME@ + diff --git a/patches/tuareg/0001-Run-opam-sexp-rather-than-parse-its-shell-output.patch b/patches/tuareg/0001-Run-opam-sexp-rather-than-parse-its-shell-output.patch new file mode 100644 index 0000000..f1918c7 --- /dev/null +++ b/patches/tuareg/0001-Run-opam-sexp-rather-than-parse-its-shell-output.patch @@ -0,0 +1,42 @@ +From 8796772964865d2055f07df51ddae8278b7b0f72 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Wed, 14 Sep 2016 12:35:27 +0200 +Subject: [PATCH] Run opam --sexp rather than parse its shell output! + +cd https://github.com/ocaml/tuareg/issues/94 ; this code should probably be removed instead (it just proved leading to difficult to track issues) ; but that's not my call, and not in a hot-patch. +--- + tuareg.el | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/tuareg.el b/tuareg.el +index 97e6107..ed0ce7a 100644 +--- a/tuareg.el ++++ b/tuareg.el +@@ -2383,19 +2383,17 @@ otherwise return non-nil." + (concat tuareg-opam " config exec -- ocaml")) + + (defun tuareg-opam-config-env() +- (let* ((get-env (concat tuareg-opam " config env")) ++ (let* ((get-env (concat tuareg-opam " config env --sexp")) + (opam-env (shell-command-to-string get-env))) +- (replace-regexp-in-string "; *export.*$" "" opam-env))) ++ (car (read-from-string opam-env)))) + + ;; OPAM compilation — one must update to the current compiler + ;; before launching the compilation. + (defadvice compile (before tuareg-compile-opam activate) + "Run opam to update environment variables." +- (let* ((env (tuareg-opam-config-env))) +- (set (make-local-variable 'compilation-environment) +- ;; Quotes MUST be removed. +- (split-string (replace-regexp-in-string "\"" "" env) +- "[\f\n\r]+" t)))) ++ (set (make-local-variable 'compilation-environment) ++ (mapcar (lambda (b) (concat (car b) "=" (cadr b))) ++ (tuareg-opam-config-env)))) + + (defvar merlin-command) + (defun merlin-command () +-- +2.1.4 + diff --git a/patches/tuareg/tuareg.install b/patches/tuareg/tuareg.install new file mode 100644 index 0000000..c32778f --- /dev/null +++ b/patches/tuareg/tuareg.install @@ -0,0 +1,5 @@ +share_root: [ + "tuareg.el" {"emacs/site-lisp/tuareg.el"} + "ocamldebug.el" {"emacs/site-lisp/ocamldebug.el"} + "tuareg-site-file.el" {"emacs/site-lisp/tuareg-site-file.el"} +] diff --git a/patches/type_conv/disable_warn_error.patch b/patches/type_conv/disable_warn_error.patch new file mode 100644 index 0000000..295fca6 --- /dev/null +++ b/patches/type_conv/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.506656289 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.647816901 -0500 +@@ -574,7 +574,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/typehashlib/disable_warn_error.patch b/patches/typehashlib/disable_warn_error.patch new file mode 100644 index 0000000..273be7f --- /dev/null +++ b/patches/typehashlib/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.510655716 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.649903887 -0500 +@@ -575,7 +575,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/tyxml/rm_netstring_pcre.patch b/patches/tyxml/rm_netstring_pcre.patch new file mode 100644 index 0000000..94ea97b --- /dev/null +++ b/patches/tyxml/rm_netstring_pcre.patch @@ -0,0 +1,64 @@ +diff -u -r tyxml-2.2.0.orig/files/META.in tyxml-2.2.0/files/META.in +--- tyxml-2.2.0.orig/files/META.in 2012-12-07 16:15:22.000000000 +0100 ++++ tyxml-2.2.0/files/META.in 2013-07-03 00:30:43.705255131 +0200 +@@ -2,7 +2,7 @@ + + description = "XHTML and HTML5 pages typed with polymorphic variants" + version = "dev" +-requires = "netstring" ++requires = "netstring pcre" + archive(byte) = "_LIBNAME_.cma" + archive(native) = "_LIBNAME_.cmxa" + +@@ -38,4 +38,4 @@ + version = "(distributed with _PACKAGENAME_)" + archive(byte) = "_LIBNAME__duce.cma" + archive(native) = "_LIBNAME__duce.cmxa" +-) +\ No newline at end of file ++) +diff -u -r tyxml-2.2.0.orig/lib/Makefile tyxml-2.2.0/lib/Makefile +--- tyxml-2.2.0.orig/lib/Makefile 2012-12-07 16:15:22.000000000 +0100 ++++ tyxml-2.2.0/lib/Makefile 2013-07-03 00:31:01.395255118 +0200 +@@ -13,7 +13,7 @@ + + DUCE_FILES := xml_print_duce.ml xhtml_duce.ml + +-LIBS := -package netstring ++LIBS := -package netstring -package pcre + + # SYNTAX := -ppopt ../syntax/pa_include.cmo -package camlp4 -syntax camlp4o + +diff -u -r tyxml-2.2.0.orig/lib/xml.ml tyxml-2.2.0/lib/xml.ml +--- tyxml-2.2.0.orig/lib/xml.ml 2012-12-07 16:15:22.000000000 +0100 ++++ tyxml-2.2.0/lib/xml.ml 2013-07-03 00:23:21.658588803 +0200 +@@ -83,8 +83,7 @@ + (as this string is to be considered as the end of the cdata) + *) + let s' = "\n") "" s) ++ (Pcre.replace ~rex:(Pcre.regexp(Pcre.quote "]]>")) s) + ^"\n]]>\n" in + encodedpcdata s' + +@@ -93,8 +92,7 @@ + (as this string is to be considered as the end of the cdata) + *) + let s' = "\n//") "" s) ++ (Pcre.replace ~rex:(Pcre.regexp(Pcre.quote "]]>")) s) + ^"\n//]]>\n" in + encodedpcdata s' + +@@ -103,8 +101,7 @@ + (as this string is to be considered as the end of the cdata) + *) + let s' = "\n/* ") "" s) ++ (Pcre.replace ~rex:(Pcre.regexp (Pcre.quote "]]>")) s) + ^"\n/* ]]> */\n" in + encodedpcdata s' + diff --git a/patches/tyxml/tyxml.install b/patches/tyxml/tyxml.install new file mode 100644 index 0000000..de8d452 --- /dev/null +++ b/patches/tyxml/tyxml.install @@ -0,0 +1,6 @@ +lib: "tyxml.opam" { "opam" } +doc: [ + "README.md" + "CHANGES" + "COPYING" { "LICENSE" } +] diff --git a/patches/ucaml/ucaml.install b/patches/ucaml/ucaml.install new file mode 100644 index 0000000..a31fc70 --- /dev/null +++ b/patches/ucaml/ucaml.install @@ -0,0 +1,3 @@ +bin: [ + "ucaml" +] diff --git a/patches/unison/ocaml48.patch.2.48.15v4 b/patches/unison/ocaml48.patch.2.48.15v4 new file mode 100644 index 0000000..d16fd86 --- /dev/null +++ b/patches/unison/ocaml48.patch.2.48.15v4 @@ -0,0 +1,65 @@ +--- a/src/Makefile.OCaml Sat Sep 21 12:54:52 2019 ++++ b/src/Makefile.OCaml Sat Sep 21 12:55:27 2019 +@@ -292,14 +292,14 @@ + + # Gtk GUI + ifeq ($(UISTYLE), gtk) +- CAMLFLAGS+=-I +lablgtk ++ CAMLFLAGS+=-I $(LABLGTKLIB) + OCAMLOBJS+=pixmaps.cmo uigtk.cmo linkgtk.cmo + OCAMLLIBS+=lablgtk.cma + endif + + # Gtk2 GUI + ifeq ($(UISTYLE), gtk2) +- CAMLFLAGS+=-I +lablgtk2 ++ CAMLFLAGS+=-I $(LABLGTK2LIB) + OCAMLOBJS+=pixmaps.cmo uigtk2.cmo linkgtk2.cmo + OCAMLLIBS+=lablgtk.cma + endifdiff --git src/files.ml src/files.ml +--- a/src/files.ml ++++ b/src/files.ml +@@ -722,7 +722,7 @@ let get_files_in_directory dir = + with End_of_file -> + dirh.System.closedir () + end; +- Sort.list (<) !files ++ List.sort String.compare !files + + let ls dir pattern = + Util.convertUnixErrorsToTransient +--- a/src/recon.ml ++++ b/src/recon.ml +@@ -651,8 +651,8 @@ let rec reconcile + + (* Sorts the paths so that they will be displayed in order *) + let sortPaths pathUpdatesList = +- Sort.list +- (fun (p1, _) (p2, _) -> Path.compare p1 p2 <= 0) ++ List.sort ++ Path.compare + pathUpdatesList + + let rec enterPath p1 p2 t = +--- a/src/system/system_generic.ml ++++ b/src/system/system_generic.ml +@@ -47,7 +47,7 @@ let open_out_gen = open_out_gen + let chmod = Unix.chmod + let chown = Unix.chown + let utimes = Unix.utimes +-let link = Unix.link ++let link s d = Unix.link s d + let openfile = Unix.openfile + let opendir f = + let h = Unix.opendir f in +--- a/src/uigtk2.ml ++++ b/src/uigtk2.ml +@@ -94,7 +94,7 @@ let icon = + let icon = + let p = GdkPixbuf.create ~width:48 ~height:48 ~has_alpha:true () in + Gpointer.blit +- (Gpointer.region_of_string Pixmaps.icon_data) (GdkPixbuf.get_pixels p); ++ (Gpointer.region_of_bytes Pixmaps.icon_data) (GdkPixbuf.get_pixels p); + p + + let leftPtrWatch = diff --git a/patches/unison/ocaml48.patch.2.51.2 b/patches/unison/ocaml48.patch.2.51.2 new file mode 100644 index 0000000..4b6e6b6 --- /dev/null +++ b/patches/unison/ocaml48.patch.2.51.2 @@ -0,0 +1,76 @@ +diff --git a/src/Makefile.OCaml b/src/Makefile.OCaml +index 7cefa2e..378fc8b 100644 +--- a/src/Makefile.OCaml ++++ b/src/Makefile.OCaml +@@ -272,7 +272,7 @@ endif + + # Gtk GUI + ifeq ($(UISTYLE), gtk) +- CAMLFLAGS+=-I +lablgtk ++ CAMLFLAGS+=-I $(LABLGTKLIB) + OCAMLOBJS+=pixmaps.cmo uigtk.cmo linkgtk.cmo + OCAMLLIBS+=lablgtk.cma + endif +@@ -282,7 +282,7 @@ OCAMLFIND := $(shell command -v ocamlfind 2> /dev/null) + + ifeq ($(UISTYLE), gtk2) + ifndef OCAMLFIND +- CAMLFLAGS+=-I +lablgtk2 ++ CAMLFLAGS+=-I $(LABLGTK2LIB) + else + CAMLFLAGS+=$(shell $(OCAMLFIND) query -i-format lablgtk2 ) + endif +diff --git a/src/files.ml b/src/files.ml +index 5ff1881..1d1fbcc 100644 +--- a/src/files.ml ++++ b/src/files.ml +@@ -734,7 +734,7 @@ let get_files_in_directory dir = + with End_of_file -> + dirh.System.closedir () + end; +- Sort.list (<) !files ++ List.sort String.compare !files + + let ls dir pattern = + Util.convertUnixErrorsToTransient +diff --git a/src/recon.ml b/src/recon.ml +index 2c619bb..2412c18 100644 +--- a/src/recon.ml ++++ b/src/recon.ml +@@ -661,8 +661,8 @@ let rec reconcile + + (* Sorts the paths so that they will be displayed in order *) + let sortPaths pathUpdatesList = +- Sort.list +- (fun (p1, _) (p2, _) -> Path.compare p1 p2 <= 0) ++ List.sort ++ Path.compare + pathUpdatesList + + let rec enterPath p1 p2 t = +diff --git a/src/system/system_generic.ml b/src/system/system_generic.ml +index 453027d..c2288b8 100755 +--- a/src/system/system_generic.ml ++++ b/src/system/system_generic.ml +@@ -47,7 +47,7 @@ let open_out_gen = open_out_gen + let chmod = Unix.chmod + let chown = Unix.chown + let utimes = Unix.utimes +-let link = Unix.link ++let link s d = Unix.link s d + let openfile = Unix.openfile + let opendir f = + let h = Unix.opendir f in +diff --git a/src/uigtk2.ml b/src/uigtk2.ml +index fbc5d8f..4e82cc2 100644 +--- a/src/uigtk2.ml ++++ b/src/uigtk2.ml +@@ -94,7 +94,7 @@ let icon = + let icon = + let p = GdkPixbuf.create ~width:48 ~height:48 ~has_alpha:true () in + Gpointer.blit +- (Gpointer.region_of_string Pixmaps.icon_data) (GdkPixbuf.get_pixels p); ++ (Gpointer.region_of_bytes Pixmaps.icon_data) (GdkPixbuf.get_pixels p); + p + + let leftPtrWatch = diff --git a/patches/unison/opam.patch b/patches/unison/opam.patch new file mode 100644 index 0000000..f6aa75f --- /dev/null +++ b/patches/unison/opam.patch @@ -0,0 +1,20 @@ +diff -ru unison.2.40.63/Makefile.OCaml unison.2.40.63/Makefile.OCaml +--- unison.2.40.63/Makefile.OCaml 2011-04-16 22:35:38.000000000 +0200 ++++ unison.2.40.63/Makefile.OCaml 2012-10-05 18:15:10.918222957 +0200 +@@ -285,14 +285,14 @@ + + # Gtk GUI + ifeq ($(UISTYLE), gtk) +- CAMLFLAGS+=-I +lablgtk ++ CAMLFLAGS+=-I $(LABLGTKLIB) + OCAMLOBJS+=pixmaps.cmo uigtk.cmo linkgtk.cmo + OCAMLLIBS+=lablgtk.cma + endif + + # Gtk2 GUI + ifeq ($(UISTYLE), gtk2) +- CAMLFLAGS+=-I +lablgtk2 ++ CAMLFLAGS+=-I $(LABLGTK2LIB) + OCAMLOBJS+=pixmaps.cmo uigtk2.cmo linkgtk2.cmo + OCAMLLIBS+=lablgtk.cma + endif diff --git a/patches/unison/unison.install.2.40.102 b/patches/unison/unison.install.2.40.102 new file mode 100644 index 0000000..e168591 --- /dev/null +++ b/patches/unison/unison.install.2.40.102 @@ -0,0 +1,4 @@ +bin: [ + "unison" {"unison-2.40"} + "unison" +] diff --git a/patches/unison/unison.install.2.40.63 b/patches/unison/unison.install.2.40.63 new file mode 100644 index 0000000..e168591 --- /dev/null +++ b/patches/unison/unison.install.2.40.63 @@ -0,0 +1,4 @@ +bin: [ + "unison" {"unison-2.40"} + "unison" +] diff --git a/patches/unison/unison.install.2.48.15v4 b/patches/unison/unison.install.2.48.15v4 new file mode 100644 index 0000000..d8c33c6 --- /dev/null +++ b/patches/unison/unison.install.2.48.15v4 @@ -0,0 +1,4 @@ +bin: [ + "src/unison" {"unison-2.48"} + "src/unison" +] diff --git a/patches/unison/unison.install.2.48.3 b/patches/unison/unison.install.2.48.3 new file mode 100644 index 0000000..adeb551 --- /dev/null +++ b/patches/unison/unison.install.2.48.3 @@ -0,0 +1,4 @@ +bin: [ + "unison" {"unison-2.48"} + "unison" +] diff --git a/patches/unison/unison.install.2.51.2 b/patches/unison/unison.install.2.51.2 new file mode 100644 index 0000000..a617b39 --- /dev/null +++ b/patches/unison/unison.install.2.51.2 @@ -0,0 +1,4 @@ +bin: [ + "src/unison" {"unison-2.51"} + "src/unison" +] diff --git a/patches/usbmux/_oasis_remove_.ml b/patches/usbmux/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/usbmux/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/usbmux/usbmux.install b/patches/usbmux/usbmux.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/usbmux/usbmux.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/utop/utop.install.1.10 b/patches/utop/utop.install.1.10 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.10 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.11 b/patches/utop/utop.install.1.11 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.11 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.12 b/patches/utop/utop.install.1.12 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.12 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.14 b/patches/utop/utop.install.1.14 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.14 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.15 b/patches/utop/utop.install.1.15 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.15 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.16 b/patches/utop/utop.install.1.16 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.16 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.17 b/patches/utop/utop.install.1.17 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.17 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.18 b/patches/utop/utop.install.1.18 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.18 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.18.1 b/patches/utop/utop.install.1.18.1 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.18.1 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.18.2 b/patches/utop/utop.install.1.18.2 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.18.2 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.19 b/patches/utop/utop.install.1.19 new file mode 100644 index 0000000..d7a90ed --- /dev/null +++ b/patches/utop/utop.install.1.19 @@ -0,0 +1,11 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] +man: [ + "man/utop.1" + "man/utop-full.1" + "man/utoprc.5" +] diff --git a/patches/utop/utop.install.1.19.1 b/patches/utop/utop.install.1.19.1 new file mode 100644 index 0000000..d7a90ed --- /dev/null +++ b/patches/utop/utop.install.1.19.1 @@ -0,0 +1,11 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] +man: [ + "man/utop.1" + "man/utop-full.1" + "man/utoprc.5" +] diff --git a/patches/utop/utop.install.1.19.2 b/patches/utop/utop.install.1.19.2 new file mode 100644 index 0000000..d7a90ed --- /dev/null +++ b/patches/utop/utop.install.1.19.2 @@ -0,0 +1,11 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] +man: [ + "man/utop.1" + "man/utop-full.1" + "man/utoprc.5" +] diff --git a/patches/utop/utop.install.1.19.3 b/patches/utop/utop.install.1.19.3 new file mode 100644 index 0000000..d7a90ed --- /dev/null +++ b/patches/utop/utop.install.1.19.3 @@ -0,0 +1,11 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] +man: [ + "man/utop.1" + "man/utop-full.1" + "man/utoprc.5" +] diff --git a/patches/utop/utop.install.1.4.0 b/patches/utop/utop.install.1.4.0 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.4.0 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.5 b/patches/utop/utop.install.1.5 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.5 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.6 b/patches/utop/utop.install.1.6 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.6 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.7 b/patches/utop/utop.install.1.7 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.7 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.8 b/patches/utop/utop.install.1.8 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.8 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/utop/utop.install.1.9 b/patches/utop/utop.install.1.9 new file mode 100644 index 0000000..c30b903 --- /dev/null +++ b/patches/utop/utop.install.1.9 @@ -0,0 +1,6 @@ +bin: [ + "?_build/src/top/uTop_top_full.byte" {"utop-full"} + "?_build/src/top/uTop_top_full.native" {"utop-full"} + "?_build/src/top/uTop_top.byte" {"utop"} + "?_build/src/top/uTop_top.native" {"utop"} +] diff --git a/patches/uuidm/uuidm.install b/patches/uuidm/uuidm.install new file mode 100644 index 0000000..009733c --- /dev/null +++ b/patches/uuidm/uuidm.install @@ -0,0 +1 @@ +bin: ["_build/test/uuidtrip.native" {"uuidtrip"}] diff --git a/patches/uunf/uunf.install b/patches/uunf/uunf.install new file mode 100644 index 0000000..fc25bdf --- /dev/null +++ b/patches/uunf/uunf.install @@ -0,0 +1 @@ +bin: ["_build/test/unftrip.native" {"unftrip"}] diff --git a/patches/uutf/uutf.install b/patches/uutf/uutf.install new file mode 100644 index 0000000..ddeb367 --- /dev/null +++ b/patches/uutf/uutf.install @@ -0,0 +1 @@ +bin: ["_build/test/utftrip.native" {"utftrip"}] diff --git a/patches/valentine/_oasis_remove_.ml b/patches/valentine/_oasis_remove_.ml new file mode 100644 index 0000000..0d23853 --- /dev/null +++ b/patches/valentine/_oasis_remove_.ml @@ -0,0 +1,7 @@ +open Printf + +let () = + let dir = Sys.argv.(1) in + (try Sys.chdir dir + with _ -> eprintf "Cannot change directory to %s\n%!" dir); + exit (Sys.command "ocaml setup.ml -uninstall") diff --git a/patches/valentine/valentine.install b/patches/valentine/valentine.install new file mode 100644 index 0000000..c6cfc2d --- /dev/null +++ b/patches/valentine/valentine.install @@ -0,0 +1,6 @@ +etc: [ + "setup.ml" + "setup.data" + "setup.log" + "_oasis_remove_.ml" +] diff --git a/patches/variantslib/disable_warn_error.patch b/patches/variantslib/disable_warn_error.patch new file mode 100644 index 0000000..df029d1 --- /dev/null +++ b/patches/variantslib/disable_warn_error.patch @@ -0,0 +1,11 @@ +--- myocamlbuild.ml.prev 2013-01-31 11:03:46.514655979 -0500 ++++ myocamlbuild.ml 2013-01-31 11:03:49.650903936 -0500 +@@ -575,7 +575,7 @@ + + (* enable warnings; make sure the '@' character isn't in the beginning; + ms-dos interprets that character specially *) +- flag ["compile"; "ocaml"] (S [A "-w"; A "A@Aemr-28"; A "-strict-sequence" ]) ++ flag ["compile"; "ocaml"] (S [A "-w"; A "Aemr-28"; A "-strict-sequence" ]) + ;; + + let dispatch = function diff --git a/patches/volt/opam.patch b/patches/volt/opam.patch new file mode 100644 index 0000000..fe151ec --- /dev/null +++ b/patches/volt/opam.patch @@ -0,0 +1,21 @@ +--- volt-1.4/Makefile 2019-12-17 18:43:40.000000000 +0200 ++++ volt-1.4.patched/Makefile 2021-02-13 00:23:46.000000000 +0200 +@@ -32,7 +32,7 @@ + + PROJECT_NAME=bolt + PROJECT_NAME_=volt +-OCAMLBUILD=$(PATH_OCAML_PREFIX)/bin/ocamlbuild ++OCAMLBUILD=ocamlbuild + OCAMLBUILD_ENV=WARNINGS=$(WARNINGS) PATH_OCAML_PREFIX=$(PATH_OCAML_PREFIX) + OCAMLBUILD_FLAGS=-classic-display -no-links + MODULES_ODOCL=$(PROJECT_NAME).odocl +@@ -103,7 +103,7 @@ + + generate: FORCE + echo '$(PROJECT_NAME).cma' > $(PROJECT_NAME).itarget +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true +- (test -x $(PATH_OCAML_PREFIX)/bin/ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true ++ (which ocamlopt && echo '$(PROJECT_NAME).cmxa' >> $(PROJECT_NAME).itarget) || true ++ (which ocamljava && echo '$(PROJECT_NAME).cmjo' >> $(PROJECT_NAME).itarget) || true + + FORCE: diff --git a/patches/wall/fix-ocaml-beta.patch.0.1 b/patches/wall/fix-ocaml-beta.patch.0.1 new file mode 100644 index 0000000..a3d4cb3 --- /dev/null +++ b/patches/wall/fix-ocaml-beta.patch.0.1 @@ -0,0 +1,15 @@ +diff --git a/lib/jbuild b/lib/jbuild +index 27194ae..06db428 100644 +--- a/lib/jbuild ++++ b/lib/jbuild +@@ -11,8 +11,8 @@ let at_least_4_03 = + | Some j -> String.sub s i (j - i) :: split s (j + 1) + | None -> [String.sub s i (String.length s - i)] + in +- let v = List.map int_of_string (split version 0) in +- v >= [4; 3] ++ let v = split version 0 in ++ v >= ["4"; "3"] + + let () = + Jbuild_plugin.V1.send @@ diff --git a/patches/wall/fix-ocaml-beta.patch.0.2 b/patches/wall/fix-ocaml-beta.patch.0.2 new file mode 100644 index 0000000..a3d4cb3 --- /dev/null +++ b/patches/wall/fix-ocaml-beta.patch.0.2 @@ -0,0 +1,15 @@ +diff --git a/lib/jbuild b/lib/jbuild +index 27194ae..06db428 100644 +--- a/lib/jbuild ++++ b/lib/jbuild +@@ -11,8 +11,8 @@ let at_least_4_03 = + | Some j -> String.sub s i (j - i) :: split s (j + 1) + | None -> [String.sub s i (String.length s - i)] + in +- let v = List.map int_of_string (split version 0) in +- v >= [4; 3] ++ let v = split version 0 in ++ v >= ["4"; "3"] + + let () = + Jbuild_plugin.V1.send @@ diff --git a/patches/wall/fix-ocaml-beta.patch.0.3 b/patches/wall/fix-ocaml-beta.patch.0.3 new file mode 100644 index 0000000..a301b63 --- /dev/null +++ b/patches/wall/fix-ocaml-beta.patch.0.3 @@ -0,0 +1,15 @@ +diff --git a/lib/dune b/lib/dune +index 27194ae..06db428 100644 +--- a/lib/dune ++++ b/lib/dune +@@ -11,8 +11,8 @@ let at_least_4_03 = + | Some j -> String.sub s i (j - i) :: split s (j + 1) + | None -> [String.sub s i (String.length s - i)] + in +- let v = List.map int_of_string (split version 0) in +- v >= [4; 3] ++ let v = split version 0 in ++ v >= ["4"; "3"] + + let () = + Jbuild_plugin.V1.send @@ diff --git a/patches/wall/fix-ocaml-dev.patch b/patches/wall/fix-ocaml-dev.patch new file mode 100644 index 0000000..bcfa72f --- /dev/null +++ b/patches/wall/fix-ocaml-dev.patch @@ -0,0 +1,19 @@ +commit c5f3e9ffe77df07b5b2cf49c69a809a6883b6faf +Author: Kate +Date: Fri May 22 13:36:09 2020 +0100 + + Fix compilation when using a development version of the OCaml compiler + +diff --git a/lib/dune b/lib/dune +index 27194ae..c4b9936 100644 +--- a/lib/dune ++++ b/lib/dune +@@ -11,7 +11,7 @@ let at_least_4_03 = + | Some j -> String.sub s i (j - i) :: split s (j + 1) + | None -> [String.sub s i (String.length s - i)] + in +- let v = List.map int_of_string (split version 0) in ++ let v = List.map (fun v -> try int_of_string v with Failure _ -> 0) (split version 0) in + v >= [4; 3] + + let () = diff --git a/patches/wasmer/lib-dune b/patches/wasmer/lib-dune new file mode 100644 index 0000000..c368f8a --- /dev/null +++ b/patches/wasmer/lib-dune @@ -0,0 +1,6 @@ +(library + (name wasmer) + (public_name wasmer) + (libraries ctypes ctypes.foreign) + (library_flags ("-cclib" "-Wl,-rpath,%{ocaml-config:standard_library}/../libwasmer" "-cclib" "-Wl,--no-as-needed" "-cclib" "%{ocaml-config:standard_library}/../libwasmer/libwasmer%{ocaml-config:ext_dll}" "-cclib" "-Wl,--as-needed")) + (flags -w -27-32)) diff --git a/patches/weberizer/weberizer.install b/patches/weberizer/weberizer.install new file mode 100644 index 0000000..1ddc46f --- /dev/null +++ b/patches/weberizer/weberizer.install @@ -0,0 +1,4 @@ +bin: [ + "?_build/src/app/weberizer_compile.byte" {"weberizer"} + "?_build/src/app/weberizer_compile.native" {"weberizer"} +] diff --git a/patches/websocket/websocket.install b/patches/websocket/websocket.install new file mode 100644 index 0000000..ff5aa20 --- /dev/null +++ b/patches/websocket/websocket.install @@ -0,0 +1 @@ +bin: ["_build/tests/wscat.native" {"wscat"}] diff --git a/patches/wget/wget.install b/patches/wget/wget.install new file mode 100644 index 0000000..2f0b986 --- /dev/null +++ b/patches/wget/wget.install @@ -0,0 +1 @@ +bin: ["_obuild/owget/owget.asm" {"owget"}] diff --git a/patches/why/configure.Fluorine-version.patch b/patches/why/configure.Fluorine-version.patch new file mode 100644 index 0000000..1e805a7 --- /dev/null +++ b/patches/why/configure.Fluorine-version.patch @@ -0,0 +1,34 @@ +diff -u why-2.33/configure why-2.33.new/configure +--- why-2.33/configure 2013-04-20 08:34:04.000000000 +0200 ++++ why-2.33.new/configure 2013-07-01 11:07:39.870593285 +0200 +@@ -2581,10 +2581,11 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FRAMACVERSION" >&5 + $as_echo "$FRAMACVERSION" >&6; } + case $FRAMACVERSION in +- Fluorine-20130401) ++ Fluorine-20130401|Fluorine-20130501|Fluorine-20130601) + FRAMAC=yes + ;; +- *) FRAMACMSG="you need Frama-C version Fluorine-20130401" ++ *) FRAMACMSG="you need Frama-C version Fluorine-2013(04|05|06)01" ++ exit 1 #For the opam package framac is required + FRAMAC=no + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FRAMACMSG" >&5 + $as_echo "$as_me: WARNING: $FRAMACMSG" >&2;} +diff -u why-2.33/configure.in why-2.33.new/configure.in +--- why-2.33/configure.in 2013-04-20 08:34:04.000000000 +0200 ++++ why-2.33.new/configure.in 2013-07-01 11:06:57.986592790 +0200 +@@ -300,10 +300,11 @@ + FRAMACVERSION=`$FRAMAC -version | sed -n -e 's|Version: *\(.*\)$|\1|p' ` + AC_MSG_RESULT($FRAMACVERSION) + case $FRAMACVERSION in +- Fluorine-20130401) ++ Fluorine-20130401|Fluorine-20130501|Fluorine-20130601) + FRAMAC=yes + ;; +- *) FRAMACMSG="you need Frama-C version Fluorine-20130401" ++ *) FRAMACMSG="you need Frama-C version Fluorine-2013(04|05|06)01" ++ exit 1 #For the opam package framac is required + FRAMAC=no + AC_MSG_WARN($FRAMACMSG) + ;; diff --git a/patches/why/opam.patch.in b/patches/why/opam.patch.in new file mode 100644 index 0000000..577f91d --- /dev/null +++ b/patches/why/opam.patch.in @@ -0,0 +1,30 @@ +diff -ru why.2.31/configure.in why.2.31/configure.in +--- why.2.31/configure.in 2012-07-19 20:33:10.000000000 +0200 ++++ why.2.31/configure.in 2012-10-05 18:15:13.738308197 +0200 +@@ -105,7 +105,7 @@ + + # Ocaml library path + # old way: OCAMLLIB=`$OCAMLC -v | tail -1 | cut -f 4 -d ' ' | tr -d '\\r'` +-OCAMLLIB=`$OCAMLC -where | tr -d '\\r'` ++OCAMLLIB=%{lib}% #`$OCAMLC -where | tr -d '\\r'` + echo "ocaml library path is $OCAMLLIB" + + +@@ -236,7 +236,7 @@ + LOCALOCAMLGRAPH=yes + fi + else +- OCAMLGRAPHLIB="-I +ocamlgraph" ++ OCAMLGRAPHLIB="-I %{lib}%/ocamlgraph" + OCAMLGRAPHVER=" in Ocaml lib, subdir ocamlgraph" + fi + +@@ -255,7 +255,7 @@ + AC_CHECK_FILE($OCAMLLIB/lablgtk2/lablgtk.cma,LABLGTK2=yes,LABLGTK2=no) + # AC_CHECK_PROG(LABLGTK2,lablgtk2,yes,no) not always available (Win32) + if test "$LABLGTK2" = yes ; then +- INCLUDEGTK2="-I +lablgtk2" ++ INCLUDEGTK2="-I %{lib}%/lablgtk2" + fi + + AC_CHECK_PROG(OCAMLWEB,ocamlweb,ocamlweb,true) diff --git a/patches/why/warn-error.patch b/patches/why/warn-error.patch new file mode 100644 index 0000000..17835bb --- /dev/null +++ b/patches/why/warn-error.patch @@ -0,0 +1,13 @@ +--- Makefile.in.orig 2013-02-14 13:58:30.984219962 +0000 ++++ Makefile.in 2013-02-14 13:58:40.380219678 +0000 +@@ -64,8 +64,8 @@ + CAMLP4 = @CAMLP4O@ + + INCLUDES = -I src -I jc -I c -I java -I intf -I tools -I mix -I ml +-BFLAGS = -w Z -warn-error A -dtypes -g $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ +-OFLAGS = -w Z -warn-error A -dtypes $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ ++BFLAGS = -w Z -dtypes -g $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ ++OFLAGS = -w Z -dtypes $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ + + LCFLAGS = -L/usr/lib -L/usr/local/lib/ocaml + diff --git a/patches/why/why-suppress-fatal-warnings.diff b/patches/why/why-suppress-fatal-warnings.diff new file mode 100644 index 0000000..a45eb7e --- /dev/null +++ b/patches/why/why-suppress-fatal-warnings.diff @@ -0,0 +1,13 @@ +--- why-2.34.orig/Makefile.in 2014-03-17 18:01:46.000000000 -0400 ++++ why-2.34/Makefile.in 2015-02-26 16:33:54.038580158 -0500 +@@ -64,8 +64,8 @@ + CAMLP4 = @CAMLP4O@ + + INCLUDES = -I src -I jc -I c -I java -I intf -I tools -I mix -I ml +-BFLAGS = -w Z -warn-error A -dtypes -g $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ +-OFLAGS = -w Z -warn-error A -dtypes $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ ++BFLAGS = -w Z -warn-error a -dtypes -g $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ ++OFLAGS = -w Z -warn-error a -dtypes $(INCLUDES) @INCLUDEGTK2@ -I +threads @OCAMLGRAPHLIB@ + + LCFLAGS = -L/usr/lib -L/usr/local/lib/ocaml + diff --git a/patches/why/why-tuple.diff b/patches/why/why-tuple.diff new file mode 100644 index 0000000..e72ee7a --- /dev/null +++ b/patches/why/why-tuple.diff @@ -0,0 +1,13 @@ +--- a/lib/coq/WhyTuples.v ++++ b/lib/coq/WhyTuples.v +@@ -23,8 +23,8 @@ Definition tuple_1 (X:Set) := X. + Definition tuple_2 := prod. + Definition Build_tuple_2 (A:Set) (B:Set) := pair A B. + Implicit Arguments Build_tuple_2. +-Definition proj_2_1 := fst. +-Definition proj_2_2 := snd. ++Definition proj_2_1 (X:Set * Set) := fst X. ++Definition proj_2_2 (X:Set * Set) := snd X. + + Record tuple_3 (T1 T2 T3:Set) : Set := + {proj_3_1 : T1; proj_3_2 : T2; proj_3_3 : T3}. diff --git a/patches/why/why.install b/patches/why/why.install new file mode 100644 index 0000000..2cde82c --- /dev/null +++ b/patches/why/why.install @@ -0,0 +1,16 @@ +bin: [ + "bin/why2html.opt" {"why2html"} + "bin/why-stat.opt" {"why-stat"} + "bin/why-obfuscator.opt" {"why-obfuscator"} + "bin/why-dp.opt" {"why-dp"} + "bin/why-cpulimit" + "bin/why-config.opt" {"why-config"} + "bin/why.opt" {"why"} + "bin/tool-stat.opt" {"tool-stat"} + "bin/simplify2why.opt" {"simplify2why"} + "bin/rv_merge.opt" {"rv_merge"} + "bin/krakatoa.opt" {"krakatoa"} + "bin/jessie.opt" {"jessie"} + "bin/gwhy.opt" {"gwhy-bin"} + "bin/gwhy.sh" {"gwhy"} +] diff --git a/patches/why3-base/disable-ocamldep-native.patch b/patches/why3-base/disable-ocamldep-native.patch new file mode 100644 index 0000000..bc5756d --- /dev/null +++ b/patches/why3-base/disable-ocamldep-native.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile.in b/Makefile.in +index 8c9d6ca..2c2b090 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -64,7 +64,8 @@ endif + + DEPFLAGS = -slash -I lib/why3 + ifeq (@OCAMLBEST@,opt) +-DEPFLAGS += -native ++# the semantics of the -native flag changed in ocaml 4.03.0 ++#DEPFLAGS += -native + endif + + RUBBER = @RUBBER@ diff --git a/patches/why3-base/gmain-build.patch b/patches/why3-base/gmain-build.patch new file mode 100644 index 0000000..ddc25c1 --- /dev/null +++ b/patches/why3-base/gmain-build.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile.in b/Makefile.in +index 6d16a15..467bfcb 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -1821,7 +1821,8 @@ clean:: + + # the generic rule cannot be applied since ocaml would confuse + # lib/why3/why3extract.cmi for the interface (!!!) +-src/tools/why3extract.cmx: src/tools/why3extract.ml ++# same for ocaml/lablgtk2/gMain.cmi on case-insensitive filesystems ++src/tools/why3extract.cmx src/ide/gmain.cmx: %.cmx: %.ml + $(SHOW) 'Ocamlopt $<' + $(HIDE)$(OCAMLOPT) -c $(OFLAGS) $< + diff --git a/patches/why3/Makefile.patch.0.81 b/patches/why3/Makefile.patch.0.81 new file mode 100644 index 0000000..348bb18 --- /dev/null +++ b/patches/why3/Makefile.patch.0.81 @@ -0,0 +1,55 @@ +diff --git a/Makefile.in b/Makefile.in +index 1f558fd..1db3805 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -43,6 +43,7 @@ OCAMLLEX = @OCAMLLEX@ + OCAMLYACC = @OCAMLYACC@ + OCAMLDOC = @OCAMLDOC@ + OCAMLLIB = @OCAMLLIB@ ++OCAMLINSTALLLIB = @OCAMLINSTALLLIB@ + OCAMLBEST = @OCAMLBEST@ + OCAMLVERSION = @OCAMLVERSION@ + COQC = @COQC@ +@@ -207,8 +208,10 @@ clean:: + clean_old_install: + rm -f $(BINDIR)/why3* + rm -rf $(DATADIR)/why3 ++ rm -rf $(OCAMLINSTALLLIB)/why3 + +-install_no_local:: ++ ++install_no_local:: clean_old_install + mkdir -p $(BINDIR) + mkdir -p $(DATADIR)/why3 + mkdir -p $(DATADIR)/why3/images +@@ -234,10 +237,9 @@ install_no_local:: + # if test -d /etc/bash_completion.d; then cp -f share/bash/why3 /etc/bash_completion.d; fi + + install_no_local_lib:: +- rm -rf $(OCAMLLIB)/why3 +- mkdir -p $(OCAMLLIB)/why3 ++ mkdir -p $(OCAMLINSTALLLIB)/why3 + cp -f lib/why3/why3.cm* lib/why3/why3.[ao] \ +- lib/why3/META $(OCAMLLIB)/why3 ++ lib/why3/META $(OCAMLINSTALLLIB)/why3 + + ifeq (@enable_local@,yes) + install install-lib: +@@ -1366,6 +1368,17 @@ stdlibdoc: $(STDLIBFILES) $(STDMODFILES) bin/why3doc.@OCAMLBEST@ + clean:: + rm -f doc/stdlibdoc/* + ++ifdef DOCDIR ++install-doc: ++ mkdir -p $(DOCDIR) ++ cp -rf doc/manual.pdf doc/stdlibdoc doc/apidoc $(DOCDIR) ++else ++install-doc: ++ @echo "You should set the variable DOCDIR to the destination directory" ++ @exit 1 ++endif ++ ++ + ################ + # generic rules + ################ diff --git a/patches/why3/Makefile.patch.0.82 b/patches/why3/Makefile.patch.0.82 new file mode 100644 index 0000000..f99d388 --- /dev/null +++ b/patches/why3/Makefile.patch.0.82 @@ -0,0 +1,21 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -1598,6 +1598,18 @@ + clean:: + rm -f doc/stdlibdoc/* + ++ifdef DOCDIR ++install-doc: ++ mkdir -p $(DOCDIR) ++ cp -rf doc/manual.pdf doc/stdlibdoc doc/apidoc $(DOCDIR) ++else ++install-doc: ++ @echo "You should set the variable DOCDIR to the destination directory" ++ @exit 1 ++endif ++ ++ ++ + ################ + # generic rules + ################ diff --git a/patches/why3/configure.patch b/patches/why3/configure.patch new file mode 100644 index 0000000..876f4ec --- /dev/null +++ b/patches/why3/configure.patch @@ -0,0 +1,43 @@ +--- /tmp/why3-0.81/configure 2013-03-27 07:08:28.000000000 +0100 ++++ configure 2013-04-05 14:45:02.311937591 +0200 +@@ -611,6 +611,7 @@ + enable_ide + enable_profiling + OCAMLGRAPHLIB ++OCAMLINSTALLLIB + OCAMLLIB + OCAMLVERSION + OCAMLBEST +@@ -3392,6 +3393,14 @@ + fi + fi + ++#if ocamlfind is used it gives the install path for ocaml library ++if test "$USEOCAMLFIND" = yes; then ++ OCAMLINSTALLLIB=$(ocamlfind printconf destdir) ++else ++ OCAMLINSTALLLIB=$OCAMLLIB ++fi ++ ++ + # checking for rubber + if test "$enable_doc" = yes ; then + # Extract the first word of "rubber", so it can be a program name with args. +@@ -4142,6 +4151,7 @@ + + + ++ + # Finally create the Makefile from Makefile.in + ac_config_files="$ac_config_files Makefile src/config.sh doc/version.tex" + +@@ -5377,7 +5387,9 @@ + echo "Installable : no" + else + echo "Installable : yes" + echo " Binary path : $bindir" ++ echo " Lib path : $libdir/why3" + echo " Data path : $datarootdir/why3" ++ echo " Ocaml Library : $OCAMLINSTALLLIB/why3" + echo " Relocatable : $enable_relocation" + fi diff --git a/patches/why3/cygwin.patch b/patches/why3/cygwin.patch new file mode 100644 index 0000000..8da5503 --- /dev/null +++ b/patches/why3/cygwin.patch @@ -0,0 +1,365 @@ +diff --git a/configure.in b/configure.in +index 0002665c0..9cb7151eb 100644 +--- a/configure.in ++++ b/configure.in +@@ -320,7 +320,7 @@ if test "$enable_ocamlfind" != no; then + if test "$OCAMLFIND" = no; then + reason_ocamlfind=" (not found)" + else +- OCAMLFINDLIB=$(ocamlfind printconf stdlib) ++ OCAMLFINDLIB=$(ocamlfind printconf stdlib | tr -d '\r') + if test "$OCAMLFINDLIB" != "$OCAMLLIB"; then + found_ocamlfind=no + reason_ocamlfind=" (incompatible with OCaml)" +@@ -341,7 +341,7 @@ fi + + if test "$enable_ocamlfind" != no; then + #if ocamlfind is used it gives the install path for ocaml library +- OCAMLINSTALLLIB=$($OCAMLFIND printconf destdir) ++ OCAMLINSTALLLIB=$($OCAMLFIND printconf destdir | tr -d '\r') + enable_ocamlfind=yes + else + OCAMLINSTALLLIB=$OCAMLLIB +@@ -356,7 +356,7 @@ else + fi + WHY3LIB=why3 + AC_MSG_CHECKING([for Why3 using ocamlfind]) +- DIR=$($OCAMLFIND query why3 2> /dev/null) ++ DIR=$($OCAMLFIND query why3 | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + WHY3INCLUDE="-I $DIR" +@@ -375,7 +375,7 @@ fi + # ppx + if test "$enable_ocamlfind" = yes; then + AC_MSG_CHECKING([for compiler-libs using ocamlfind]) +- COMPILERLIBS=$($OCAMLFIND query compiler-libs 2> /dev/null) ++ COMPILERLIBS=$($OCAMLFIND query compiler-libs | tr -d '\r' 2> /dev/null) + if test -n "$COMPILERLIBS"; then + AC_MSG_RESULT([yes]) + enable_ppx=yes +@@ -425,7 +425,7 @@ fi + found_num=no + if test "$enable_ocamlfind" = yes; then + AC_MSG_CHECKING([for num using ocamlfind]) +- DIR=$($OCAMLFIND query num 2> /dev/null) ++ DIR=$($OCAMLFIND query num | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find library Num using ocamlfind.]) +@@ -456,7 +456,7 @@ else + found_zarith=yes + if test "$enable_ocamlfind" = yes; then + AC_MSG_CHECKING([for zarith using ocamlfind]) +- DIR=$($OCAMLFIND query zarith 2> /dev/null) ++ DIR=$($OCAMLFIND query zarith | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + BIGINTINCLUDE="-I $DIR" +@@ -496,7 +496,7 @@ fi + if test "$enable_bddinfer" = yes; then + if test "$enable_ocamlfind" = yes; then + # gmp is a dependency of apron +- INFERINCLUDE=$($OCAMLFIND query -separator ' ' -i-format apron 2> /dev/null) ++ INFERINCLUDE=$($OCAMLFIND query -separator ' ' -i-format apron | tr -d '\r' 2> /dev/null) + fi + if test -n "$INFERINCLUDE"; then + echo "ocamlfind found apron in $INFERINCLUDE" +@@ -515,14 +515,14 @@ fi + if test "$enable_infer" = yes; then + if test "$enable_ocamlfind" = yes; then + # gmp is a dependency of apron +- INFERINCLUDE=$($OCAMLFIND query apron camllib 2> /dev/null) ++ INFERINCLUDE=$($OCAMLFIND query apron camllib | tr -d '\r' 2> /dev/null) + fi + if test -n "$INFERINCLUDE"; then + echo "ocamlfind found apron, camllib in $INFERINCLUDE" +- INFERINCLUDE=$($OCAMLFIND query fixpoint 2> /dev/null) ++ INFERINCLUDE=$($OCAMLFIND query fixpoint | tr -d '\r' 2> /dev/null) + if test -n "$INFERINCLUDE"; then + echo "ocamlfind found fixpoint in $INFERINCLUDE" +- INFERINCLUDE="$($OCAMLFIND query -separator ' ' -i-format apron fixpoint camllib gmp 2> /dev/null)" ++ INFERINCLUDE="$($OCAMLFIND query -separator ' ' -i-format apron fixpoint camllib gmp | tr -d '\r' 2> /dev/null)" + INFERLIB="apron fixpoint" + INFERPKG="apron fixpoint apron.boxMPQ apron.octMPQ apron.polkaMPQ" + else +@@ -547,7 +547,7 @@ else + found_zip=yes + if test "$enable_ocamlfind" = yes; then + AC_MSG_CHECKING([for camlzip using ocamlfind]) +- DIR=$($OCAMLFIND query zip 2> /dev/null) ++ DIR=$($OCAMLFIND query zip | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + ZIPINCLUDE="-I $DIR" +@@ -586,7 +586,7 @@ found_menhirlib=yes + DIR= + if test "$enable_ocamlfind" = yes; then + AC_MSG_CHECKING([for menhirLib using ocamlfind]) +- DIR=$($OCAMLFIND query menhirLib 2> /dev/null) ++ DIR=$($OCAMLFIND query menhirLib | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + MENHIRINCLUDE="-I $DIR" +@@ -618,7 +618,7 @@ else + DIR= + if test "$enable_ocamlfind" = yes; then + AC_MSG_CHECKING([for re using ocamlfind]) +- DIR=$($OCAMLFIND query re 2> /dev/null) ++ DIR=$($OCAMLFIND query re | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + REINCLUDE="-I $DIR" +@@ -667,7 +667,7 @@ fi + found_lablgtk=no + if test "$enable_ide" != no; then + AC_MSG_CHECKING([for lablgtk3 using ocamlfind]) +- DIR=$($OCAMLFIND query lablgtk3 2> /dev/null) ++ DIR=$($OCAMLFIND query lablgtk3 | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + found_lablgtk=yes +@@ -687,7 +687,7 @@ found_lablgtksourceview=no + if test "$found_lablgtk" = yes; then + for p in $PKGS_SOURCEVIEW; do + AC_MSG_CHECKING([for $p using ocamlfind]) +- DIR=$($OCAMLFIND query $p 2> /dev/null) ++ DIR=$($OCAMLFIND query $p | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + AC_CHECK_FILE($DIR/gSourceView$GTKVERSION.cmi,,p=) +@@ -732,7 +732,7 @@ if test "$enable_hypothesis_selection" != no -o "$enable_stackify" != no; then + DIR= + if test "$enable_ocamlfind" = yes; then + AC_MSG_CHECKING([for ocamlgraph using ocamlfind]) +- DIR=$($OCAMLFIND query ocamlgraph 2> /dev/null) ++ DIR=$($OCAMLFIND query ocamlgraph | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + OCAMLGRAPHLIB="$DIR" +@@ -802,14 +802,14 @@ elif test "$enable_js_of_ocaml" = yes -o "$enable_web_ide" = yes; then + else + found_mlmpfr=yes + AC_MSG_CHECKING([for mlmpfr]) +- DIR=$($OCAMLFIND query mlmpfr 2> /dev/null) ++ DIR=$($OCAMLFIND query mlmpfr | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + AC_MSG_RESULT([yes]) + old_mpfr=no + echo "ocamlfind found mlmpfr in $DIR" + # Test that MPFR version is higher than 4.0.0 (because of + # Faithful constructor incompatibility). +- MPFRVERSION=$($OCAMLFIND query -format "%v" mlmpfr 2> /dev/null) ++ MPFRVERSION=$($OCAMLFIND query -format "%v" mlmpfr | tr -d '\r' 2> /dev/null) + AX_VERSION_GE([$MPFRVERSION], 4.0.0, [], [ + found_mlmpfr=no + reason_mpfr=" (mlmpfr >= 4.0.0 not found)"]) +@@ -848,7 +848,7 @@ else + found_js_of_ocaml=yes + for p in js_of_ocaml js_of_ocaml-ppx; do + AC_MSG_CHECKING([for $p]) +- DIR=$($OCAMLFIND query $p 2> /dev/null) ++ DIR=$($OCAMLFIND query $p | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + AC_MSG_RESULT([no]) + found_js_of_ocaml=no +@@ -891,7 +891,7 @@ if test "$enable_statmemprof" = yes; then + enable_statmemprof=no + reason_statmemprof=" (ocamlfind not available)" + else +- DIR=$($OCAMLFIND query statmemprof-emacs 2> /dev/null) ++ DIR=$($OCAMLFIND query statmemprof-emacs | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + enable_statmemprof=no + reason_statmemprof=" (statmemprof-emacs not found)" +@@ -915,7 +915,7 @@ else + else + for p in ppx_sexp_conv sexplib ppx_deriving; do + AC_MSG_CHECKING([for $p using ocamlfind]) +- DIR=$($OCAMLFIND query $p 2> /dev/null) ++ DIR=$($OCAMLFIND query $p | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + AC_MSG_RESULT([no]) + enable_pp_sexp=no +--- a/configure ++++ b/configure +@@ -4564,7 +4564,7 @@ + if test "$OCAMLFIND" = no; then + reason_ocamlfind=" (not found)" + else +- OCAMLFINDLIB=$(ocamlfind printconf stdlib) ++ OCAMLFINDLIB=$(ocamlfind printconf stdlib | tr -d '\r') + if test "$OCAMLFINDLIB" != "$OCAMLLIB"; then + found_ocamlfind=no + reason_ocamlfind=" (incompatible with OCaml)" +@@ -4585,7 +4585,7 @@ + + if test "$enable_ocamlfind" != no; then + #if ocamlfind is used it gives the install path for ocaml library +- OCAMLINSTALLLIB=$($OCAMLFIND printconf destdir) ++ OCAMLINSTALLLIB=$($OCAMLFIND printconf destdir | tr -d '\r') + enable_ocamlfind=yes + else + OCAMLINSTALLLIB=$OCAMLLIB +@@ -4601,7 +4601,7 @@ + WHY3LIB=why3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Why3 using ocamlfind" >&5 + printf %s "checking for Why3 using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query why3 2> /dev/null) ++ DIR=$($OCAMLFIND query why3 | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -4623,7 +4623,7 @@ + if test "$enable_ocamlfind" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler-libs using ocamlfind" >&5 + printf %s "checking for compiler-libs using ocamlfind... " >&6; } +- COMPILERLIBS=$($OCAMLFIND query compiler-libs 2> /dev/null) ++ COMPILERLIBS=$($OCAMLFIND query compiler-libs | tr -d '\r' 2> /dev/null) + if test -n "$COMPILERLIBS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -4810,7 +4810,7 @@ + if test "$enable_ocamlfind" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for num using ocamlfind" >&5 + printf %s "checking for num using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query num 2> /dev/null) ++ DIR=$($OCAMLFIND query num | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + printf "%s\n" "no" >&6; } +@@ -4940,7 +4940,7 @@ + if test "$enable_ocamlfind" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zarith using ocamlfind" >&5 + printf %s "checking for zarith using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query zarith 2> /dev/null) ++ DIR=$($OCAMLFIND query zarith | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5031,7 +5031,7 @@ + if test "$enable_bddinfer" = yes; then + if test "$enable_ocamlfind" = yes; then + # gmp is a dependency of apron +- INFERINCLUDE=$($OCAMLFIND query -separator ' ' -i-format apron 2> /dev/null) ++ INFERINCLUDE=$($OCAMLFIND query -separator ' ' -i-format apron | tr -d '\r' 2> /dev/null) + fi + if test -n "$INFERINCLUDE"; then + echo "ocamlfind found apron in $INFERINCLUDE" +@@ -5051,14 +5051,14 @@ + if test "$enable_infer" = yes; then + if test "$enable_ocamlfind" = yes; then + # gmp is a dependency of apron +- INFERINCLUDE=$($OCAMLFIND query apron camllib 2> /dev/null) ++ INFERINCLUDE=$($OCAMLFIND query apron camllib | tr -d '\r' 2> /dev/null) + fi + if test -n "$INFERINCLUDE"; then + echo "ocamlfind found apron, camllib in $INFERINCLUDE" +- INFERINCLUDE=$($OCAMLFIND query fixpoint 2> /dev/null) ++ INFERINCLUDE=$($OCAMLFIND query fixpoint | tr -d '\r' 2> /dev/null) + if test -n "$INFERINCLUDE"; then + echo "ocamlfind found fixpoint in $INFERINCLUDE" +- INFERINCLUDE="$($OCAMLFIND query -separator ' ' -i-format apron fixpoint camllib gmp 2> /dev/null)" ++ INFERINCLUDE="$($OCAMLFIND query -separator ' ' -i-format apron fixpoint camllib gmp | tr -d '\r' 2> /dev/null)" + INFERLIB="apron fixpoint" + INFERPKG="apron fixpoint apron.boxMPQ apron.octMPQ apron.polkaMPQ" + else +@@ -5086,7 +5086,7 @@ + if test "$enable_ocamlfind" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for camlzip using ocamlfind" >&5 + printf %s "checking for camlzip using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query zip 2> /dev/null) ++ DIR=$($OCAMLFIND query zip | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5177,7 +5177,7 @@ + if test "$enable_ocamlfind" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for menhirLib using ocamlfind" >&5 + printf %s "checking for menhirLib using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query menhirLib 2> /dev/null) ++ DIR=$($OCAMLFIND query menhirLib | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5280,7 +5280,7 @@ + if test "$enable_ocamlfind" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for re using ocamlfind" >&5 + printf %s "checking for re using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query re 2> /dev/null) ++ DIR=$($OCAMLFIND query re | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5381,7 +5381,7 @@ + if test "$enable_ide" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lablgtk3 using ocamlfind" >&5 + printf %s "checking for lablgtk3 using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query lablgtk3 2> /dev/null) ++ DIR=$($OCAMLFIND query lablgtk3 | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5428,7 +5428,7 @@ + for p in $PKGS_SOURCEVIEW; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $p using ocamlfind" >&5 + printf %s "checking for $p using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query $p 2> /dev/null) ++ DIR=$($OCAMLFIND query $p | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5502,7 +5502,7 @@ + if test "$enable_ocamlfind" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ocamlgraph using ocamlfind" >&5 + printf %s "checking for ocamlgraph using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query ocamlgraph 2> /dev/null) ++ DIR=$($OCAMLFIND query ocamlgraph | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5625,7 +5625,7 @@ + found_mlmpfr=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mlmpfr" >&5 + printf %s "checking for mlmpfr... " >&6; } +- DIR=$($OCAMLFIND query mlmpfr 2> /dev/null) ++ DIR=$($OCAMLFIND query mlmpfr | tr -d '\r' 2> /dev/null) + if test -n "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +@@ -5633,7 +5633,7 @@ + echo "ocamlfind found mlmpfr in $DIR" + # Test that MPFR version is higher than 4.0.0 (because of + # Faithful constructor incompatibility). +- MPFRVERSION=$($OCAMLFIND query -format "%v" mlmpfr 2> /dev/null) ++ MPFRVERSION=$($OCAMLFIND query -format "%v" mlmpfr | tr -d '\r' 2> /dev/null) + as_arg_v1=$MPFRVERSION + as_arg_v2=4.0.0 + awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null +@@ -5732,7 +5732,7 @@ + for p in js_of_ocaml js_of_ocaml-ppx; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $p" >&5 + printf %s "checking for $p... " >&6; } +- DIR=$($OCAMLFIND query $p 2> /dev/null) ++ DIR=$($OCAMLFIND query $p | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + printf "%s\n" "no" >&6; } +@@ -5777,7 +5777,7 @@ + enable_statmemprof=no + reason_statmemprof=" (ocamlfind not available)" + else +- DIR=$($OCAMLFIND query statmemprof-emacs 2> /dev/null) ++ DIR=$($OCAMLFIND query statmemprof-emacs | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + enable_statmemprof=no + reason_statmemprof=" (statmemprof-emacs not found)" +@@ -5802,7 +5802,7 @@ + for p in ppx_sexp_conv sexplib ppx_deriving; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $p using ocamlfind" >&5 + printf %s "checking for $p using ocamlfind... " >&6; } +- DIR=$($OCAMLFIND query $p 2> /dev/null) ++ DIR=$($OCAMLFIND query $p | tr -d '\r' 2> /dev/null) + if test -z "$DIR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + printf "%s\n" "no" >&6; } diff --git a/patches/why3/opam.patch b/patches/why3/opam.patch new file mode 100644 index 0000000..60d4ecd --- /dev/null +++ b/patches/why3/opam.patch @@ -0,0 +1,12 @@ +diff -ru why3.0.73/configure why3.0.73/configure +--- why3.0.73/configure 2012-07-19 14:05:03.000000000 +0200 ++++ why3.0.73/configure 2012-10-05 18:15:11.894252466 +0200 +@@ -3464,7 +3464,7 @@ + # checking for lablgtksourceview2 + if test "$enable_ide" = yes ; then + if test "$USEOCAMLFIND" = yes; then +- LABLGTKSV2LIB=$(ocamlfind query lablgtksourceview2) ++ LABLGTKSV2LIB=$(ocamlfind query lablgtk2.sourceview2) + fi + if test -n "$LABLGTKSV2LIB";then + echo "ocamlfind found lablgtksourceview2 in $LABLGTKSV2LIB" diff --git a/patches/why3/why3.install.0.73 b/patches/why3/why3.install.0.73 new file mode 100644 index 0000000..811dccc --- /dev/null +++ b/patches/why3/why3.install.0.73 @@ -0,0 +1,11 @@ +bin: [ + "bin/why3session.opt" {"why3session"} + "bin/why3replayer.opt" {"why3replayer"} + "bin/why3ml.opt" {"why3ml"} + "?bin/why3ide.opt" {"why3ide"} + "bin/why3doc.opt" {"why3doc"} + "bin/why3config.opt" {"why3config"} + "bin/why3bench.opt" {"why3bench"} + "bin/why3-cpulimit" + "bin/why3.opt" {"why3"} +] diff --git a/patches/why3/why3.install.0.80 b/patches/why3/why3.install.0.80 new file mode 100644 index 0000000..016b9e4 --- /dev/null +++ b/patches/why3/why3.install.0.80 @@ -0,0 +1,11 @@ +bin: [ + "bin/why3session.opt" {"why3session"} + "bin/why3replayer.opt" {"why3replayer"} + "?bin/why3ml.opt" {"why3ml"} + "?bin/why3ide.opt" {"why3ide"} + "bin/why3doc.opt" {"why3doc"} + "bin/why3config.opt" {"why3config"} + "bin/why3bench.opt" {"why3bench"} + "bin/why3-cpulimit" + "bin/why3.opt" {"why3"} +] diff --git a/patches/wyrd/wyrd.install b/patches/wyrd/wyrd.install new file mode 100644 index 0000000..8c54fbf --- /dev/null +++ b/patches/wyrd/wyrd.install @@ -0,0 +1 @@ +bin: ["wyrd.opt" {"wyrd"}] diff --git a/patches/xapi-rrd-transport/use-xen-gnt-unix.patch b/patches/xapi-rrd-transport/use-xen-gnt-unix.patch new file mode 100644 index 0000000..672900f --- /dev/null +++ b/patches/xapi-rrd-transport/use-xen-gnt-unix.patch @@ -0,0 +1,26 @@ +From 50343916acec27b13c3e9101ca8bd84ecce98665 Mon Sep 17 00:00:00 2001 +From: Marcello Seri +Date: Wed, 21 Jun 2017 15:21:08 +0100 +Subject: [PATCH] Fix _oasis to use xen-gnt-unix + +Signed-off-by: Marcello Seri +--- + _oasis | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/_oasis b/_oasis +index 0aa7f86..f8b96b1 100644 +--- a/_oasis ++++ b/_oasis +@@ -12,7 +12,7 @@ Library rrd_transport + Path: lib + Findlibname: rrd-transport + Modules: Rrd_json, Rrd_protocol, Rrd_rpc, Rrd_protocol_v1, Rrd_protocol_v2, Rrd_io, Rrd_reader, Rrd_writer +- BuildDepends: bigarray, bytes, cstruct, stringext, xcp.rrd, rrd, xen-gnt, xen-gnt.unix, crc, threads ++ BuildDepends: bigarray, bytes, cstruct, stringext, xcp.rrd, rrd, xen-gnt, xen-gnt-unix, crc, threads + + Executable rrdreader + CompiledObject: best +-- +2.11.0 + diff --git a/patches/xapi-rrd/depend-on-rpclib.json.patch b/patches/xapi-rrd/depend-on-rpclib.json.patch new file mode 100644 index 0000000..be353cb --- /dev/null +++ b/patches/xapi-rrd/depend-on-rpclib.json.patch @@ -0,0 +1,32 @@ +From ec7c82d15945831cf0557c80cac7438e3cc54b59 Mon Sep 17 00:00:00 2001 +From: David Scott +Date: Sat, 24 Jun 2017 10:57:03 +0100 +Subject: [PATCH] Add dependency on rpclib.json + +Since rpclib.1.9.51, the Jsonrpc module has moved to a subpackage. +See the build breakage here: + +https://travis-ci.org/mirage/mirage-www/jobs/246491914 + +Signed-off-by: David Scott +Signed-off-by: Marcello Seri +--- + _oasis | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/_oasis b/_oasis +index be3531d..a734360 100644 +--- a/_oasis ++++ b/_oasis +@@ -14,7 +14,7 @@ Library rrd + Path: lib + Findlibname: rrd + Modules: Rrd, Rrd_fring, Rrd_updates, Rrd_utils, Rrd_timescales +- BuildDepends: rpclib, ppx_deriving_rpc ++ BuildDepends: rpclib.json, ppx_deriving_rpc + + Library rrd_unix + Pack: false +-- +2.11.0 + diff --git a/patches/xapi-rrdd/use-xen-gnt-unix.patch b/patches/xapi-rrdd/use-xen-gnt-unix.patch new file mode 100644 index 0000000..6a5fbbd --- /dev/null +++ b/patches/xapi-rrdd/use-xen-gnt-unix.patch @@ -0,0 +1,35 @@ +From f87e2e4641faea4ba8d1d96e5ed914cb02b69254 Mon Sep 17 00:00:00 2001 +From: Marcello Seri +Date: Wed, 21 Jun 2017 15:24:14 +0100 +Subject: [PATCH] Fix _oasis to use xen-gnt-unix + +Signed-off-by: Marcello Seri +--- + _oasis | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/_oasis b/_oasis +index 12ba1263..d8683bce 100644 +--- a/_oasis ++++ b/_oasis +@@ -59,7 +59,7 @@ Executable "xcp-rrdd" + threads, + ppx_deriving_rpc, + io-page.unix, +- xen-gnt.unix, ++ xen-gnt-unix, + oclock, + systemd, + inotify +@@ -96,7 +96,7 @@ Executable "test_rrdd_monitor" + threads, + ppx_deriving_rpc, + io-page.unix, +- xen-gnt.unix, ++ xen-gnt-unix, + oclock + + Test "test_rrdd_monitor" +-- +2.11.0 + diff --git a/patches/xmlm/xmlm.install b/patches/xmlm/xmlm.install new file mode 100644 index 0000000..5b9c813 --- /dev/null +++ b/patches/xmlm/xmlm.install @@ -0,0 +1 @@ +bin: ["_build/test/xmltrip.native" {"xmltrip"}] diff --git a/patches/xstrp4/version.patch b/patches/xstrp4/version.patch new file mode 100644 index 0000000..a755b40 --- /dev/null +++ b/patches/xstrp4/version.patch @@ -0,0 +1,8 @@ +--- a/META 2010-11-30 16:36:03.000000000 +0200 ++++ b/META 2015-05-10 23:04:48.960009677 +0300 +@@ -1,4 +1,4 @@ +-version = "1.7" ++version = "1.8" + requires = "camlp4" + + # This line counts when the compiler is invoked with diff --git a/patches/yojson/yojson.install b/patches/yojson/yojson.install new file mode 100644 index 0000000..89e77b0 --- /dev/null +++ b/patches/yojson/yojson.install @@ -0,0 +1 @@ +bin: ["ydump"] diff --git a/patches/z3/0001-OCaml-static-fix-linking-options.patch b/patches/z3/0001-OCaml-static-fix-linking-options.patch new file mode 100644 index 0000000..e54fee7 --- /dev/null +++ b/patches/z3/0001-OCaml-static-fix-linking-options.patch @@ -0,0 +1,39 @@ +From c1ad450f7cde79149b73f25cc632d15830b75829 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Tue, 21 May 2019 16:09:18 +0200 +Subject: [PATCH 1/2] OCaml / static: fix linking options + +--- + scripts/mk_util.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/scripts/mk_util.py b/scripts/mk_util.py +index 9076b582f..f076817d2 100644 +--- a/scripts/mk_util.py ++++ b/scripts/mk_util.py +@@ -2253,10 +2253,12 @@ class MLComponent(Component): + + OCAMLMKLIB = 'ocamlmklib' + +- LIBZ3 = '-L. -lz3' ++ LIBZ3 = '-lz3' + if is_cygwin() and not(is_cygwin_mingw()): + LIBZ3 = 'libz3.dll' + ++ LIBZ3 = LIBZ3 + ' ' + ' '.join(map(lambda x: '-cclib ' + x, LDFLAGS.split())) ++ + if DEBUG_MODE and not(is_cygwin()): + # Some ocamlmklib's don't like -g; observed on cygwin, but may be others as well. + OCAMLMKLIB += ' -g' +@@ -2267,7 +2269,7 @@ class MLComponent(Component): + out.write('%s.cmxa: %s %s %s %s.cma\n' % (z3mls, cmxs, stubso, z3dllso, z3mls)) + out.write('\t%s -o %s -I %s %s %s %s\n' % (OCAMLMKLIB, z3mls, self.sub_dir, stubso, cmxs, LIBZ3)) + out.write('%s.cmxs: %s.cmxa\n' % (z3mls, z3mls)) +- out.write('\t%s -linkall -shared -o %s.cmxs -I %s %s.cmxa\n' % (OCAMLOPTF, z3mls, self.sub_dir, z3mls)) ++ out.write('\t%s -linkall -shared -o %s.cmxs -I . -I %s %s.cmxa\n' % (OCAMLOPTF, z3mls, self.sub_dir, z3mls)) + + out.write('\n') + out.write('ml: %s.cma %s.cmxa %s.cmxs\n' % (z3mls, z3mls, z3mls)) +-- +2.11.0 + diff --git a/patches/z3/0002-OCaml-API-build-provide-static-linking-options-by-de.patch b/patches/z3/0002-OCaml-API-build-provide-static-linking-options-by-de.patch new file mode 100644 index 0000000..cff4639 --- /dev/null +++ b/patches/z3/0002-OCaml-API-build-provide-static-linking-options-by-de.patch @@ -0,0 +1,81 @@ +From 921613f4618045f6926bdf84b37fe020378534b0 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Tue, 21 May 2019 17:44:19 +0200 +Subject: [PATCH 2/2] OCaml API build: provide static linking options by + default + +when --staticlib is enabled, the linker will still choose to +dynamically link upon encountering `-lz3` when generating an +executable through OCaml. + +The interaction between the underlying C linker and OCaml make it very +hard to choose the static version instead. The present patch works +around this issue by copying `libz3.a` to `libz3-static.a`, and using +`-lz3-static` instead: the static version is chosen since no dynamic +one is found. + +One can get back to dynamically linking by compiling without +`--staticlib`, or switching back to `-lz3`, but will in the latter +case run into the same problem with specifying the option; if that +needs to be made easier, we could provide two versions of the `cm(x)a` +which differ only by their linking options. + +One last solution would be to remove `lz3` altogether from the linking +options included in the cm(x)a, requiring either `-lz3` or +`-lz3-static` to be specified at link time. Simpler and most flexible, +but requires an update of all users that link with the Z3 ml api... +--- + scripts/mk_util.py | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/scripts/mk_util.py b/scripts/mk_util.py +index f076817d2..2716052c0 100644 +--- a/scripts/mk_util.py ++++ b/scripts/mk_util.py +@@ -2221,8 +2221,16 @@ class MLComponent(Component): + + stubsc = os.path.join(src_dir, self.stubs + '.c') + stubso = os.path.join(self.sub_dir, self.stubs) + '$(OBJ_EXT)' +- z3dllso = get_component(Z3_DLL_COMPONENT).dll_name + '$(SO_EXT)' +- out.write('%s: %s %s\n' % (stubso, stubsc, z3dllso)) ++ base_dll_name = get_component(Z3_DLL_COMPONENT).dll_name ++ if STATIC_LIB: ++ z3link = 'z3-static' ++ z3linkdep = base_dll_name + '-static$(LIB_EXT)' ++ out.write('%s: %s\n' % (z3linkdep, base_dll_name + '$(LIB_EXT)')) ++ out.write('\tcp $< $@\n') ++ else: ++ z3link = 'z3' ++ z3linkdep = base_dll_name + '$(SO_EXT)' ++ out.write('%s: %s %s\n' % (stubso, stubsc, z3linkdep)) + out.write('\t%s -ccopt "$(CXXFLAGS_OCAML) -I %s -I %s -I %s $(CXX_OUT_FLAG)%s" -c %s\n' % + (OCAMLCF, OCAML_LIB, api_src, src_dir, stubso, stubsc)) + +@@ -2253,9 +2261,9 @@ class MLComponent(Component): + + OCAMLMKLIB = 'ocamlmklib' + +- LIBZ3 = '-lz3' ++ LIBZ3 = '-cclib -l' + z3link + if is_cygwin() and not(is_cygwin_mingw()): +- LIBZ3 = 'libz3.dll' ++ LIBZ3 = z3linkdep + + LIBZ3 = LIBZ3 + ' ' + ' '.join(map(lambda x: '-cclib ' + x, LDFLAGS.split())) + +@@ -2264,9 +2272,10 @@ class MLComponent(Component): + OCAMLMKLIB += ' -g' + + z3mls = os.path.join(self.sub_dir, 'z3ml') +- out.write('%s.cma: %s %s %s\n' % (z3mls, cmos, stubso, z3dllso)) ++ ++ out.write('%s.cma: %s %s %s\n' % (z3mls, cmos, stubso, z3linkdep)) + out.write('\t%s -o %s -I %s %s %s %s\n' % (OCAMLMKLIB, z3mls, self.sub_dir, stubso, cmos, LIBZ3)) +- out.write('%s.cmxa: %s %s %s %s.cma\n' % (z3mls, cmxs, stubso, z3dllso, z3mls)) ++ out.write('%s.cmxa: %s %s %s %s.cma\n' % (z3mls, cmxs, stubso, z3linkdep, z3mls)) + out.write('\t%s -o %s -I %s %s %s %s\n' % (OCAMLMKLIB, z3mls, self.sub_dir, stubso, cmxs, LIBZ3)) + out.write('%s.cmxs: %s.cmxa\n' % (z3mls, z3mls)) + out.write('\t%s -linkall -shared -o %s.cmxs -I . -I %s %s.cmxa\n' % (OCAMLOPTF, z3mls, self.sub_dir, z3mls)) +-- +2.11.0 + diff --git a/patches/z3/4468.patch b/patches/z3/4468.patch new file mode 100644 index 0000000..35ecea0 --- /dev/null +++ b/patches/z3/4468.patch @@ -0,0 +1,267 @@ +From 8179ae62817d46c7a3df82aded1ff105fa2c3646 Mon Sep 17 00:00:00 2001 +From: ivg +Date: Wed, 27 May 2020 07:52:52 -0400 +Subject: [PATCH] fixes numerous issues in OCaml bindings building process + +It now works both in dynamic and static mode and the compiled +libraries can be used by all linkers in the OCaml system, without +any specificy instructions other than specifying the dependency on +the z3 library. + +Using the libraries +=================== + +Compiling binaries +------------------ + +The libraries can be linked statically with both ocamlc and ocamlopt +compilers, e.g., + +``` +ocamlfind ocamlc -thread -package z3 -linkpkg run.ml -o run +``` +or +``` +ocamlfind ocamlopt -thread -package z3 -linkpkg run.ml -o run +``` + +When bindings compiled with the `--staticlib` the produced binary will +not have any dependencies on z3 +``` +$ ldd ./run + linux-vdso.so.1 (0x00007fff9c9ed000) + libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb56f09c000) + libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fb56ee1b000) + libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb56ebfc000) + libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb56e85e000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb56e65a000) + libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb56e442000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb56e051000) + /lib64/ld-linux-x86-64.so.2 (0x00007fb570de9000) +``` + +The bytecode version will have a depedency on z3 and other external +libraries (packed as dlls and usually installed in opam switch): +``` +$ ocamlobjinfo run | grep 'Used DLL' -A5 +Used DLLs: + dllz3ml + dllzarith + dllthreads + dllunix +``` + +But it is possible to compile a portable self-contained version of the +bytecode executable using the `-custom` switch: + +``` +ocamlfind ocamlc -custom -thread -package z3 -linkpkg run.ml -o run +``` + +The build binary is now quite large but doesn't have any external +dependencies (modulo the system dependencies): +``` +$ du -h run +27M run +$ ocamlobjinfo run | grep 'Used DLL' | wc -l +0 +$ ldd run + linux-vdso.so.1 (0x00007ffee42c2000) + libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdbdc415000) + libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fdbdc194000) + libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdbdbf75000) + libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdbdbbd7000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdbdb9d3000) + libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdbdb7bb000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdbdb3ca000) + /lib64/ld-linux-x86-64.so.2 (0x00007fdbde026000) +``` + +Loading in toplevel +------------------- + +It is also possible to use the built libraries in toplevel and use +them in ocaml scripts, e.g., +``` +$ ocaml + OCaml version 4.09.0 + + # #use "topfind";; + - : unit = () + Findlib has been successfully loaded. Additional directives: + #require "package";; to load a package + #list;; to list the available packages + #camlp4o;; to load camlp4 (standard syntax) + #camlp4r;; to load camlp4 (revised syntax) + #predicates "p,q,...";; to set these predicates + Topfind.reset();; to force that packages will be reloaded + #thread;; to enable threads + +- : unit = () + # #require "z3";; + /home/ivg/.opam/4.09.0/lib/zarith: added to search path + /home/ivg/.opam/4.09.0/lib/zarith/zarith.cma: loaded + /home/ivg/.opam/4.09.0/lib/z3: added to search path + /home/ivg/.opam/4.09.0/lib/z3/z3ml.cma: loaded + # +``` + +To use z3 in a script mode add the following preamble to a file with +OCaml code: +``` + #!/usr/bin/env ocaml + #use "topfind";; + #require "z3";; + + (* your OCaml code *) +``` + +Then it is possible to run it as `./script` (provided that the code is +in a file named `script` and permissions are set with `chmod a+x +script`). + +Of course, such scripts will depend on ocaml installation that shall +have z3 dependencies installed. + +Using Dynlink +------------- + +The built z3ml.cmxs file is a self-contained shared library that +doesn't have any depndencies on z3 (the z3 code is included in it) and +could be loaded with `Dynlink.loadfile` in runtime. + +Installation +============ + +I did not touch the installation part in this PR, as I was using opam +and installed artifacts as simple as: +``` +ocamlfind install z3 build/api/ml/* build/libz3-static.a +``` + +assuming that the following configuration and building process +``` +python2.7 scripts/mk_make.py --ml --staticlib +make -C build +``` + +Though the default installation script in the make file shall work. + +Dynamic Library mode +==================== + +The dynamic library mode is also supported provided that libz3.so is +installed in a search path of the dynamic loader (or the location is +added via the LD_LIBRARY_PATH) or stored in rpaths of the built +binary. + +Build Artifacts +=============== + +In the static mode (--staticlib), the following files are built and +installed: + +- `{z3,z3enums,z3native}.{cmi,cmo,cmx,o,mli}`: the three compilation +units (modules) that comprise Z3 bindings. The `*.mli` files are not +necessary but are installed for the user convenience and documentation +purposes. The *.cmi files enables access to the unit +definitions. Finally, `*.cmo` contain the bytecode and `*.cmx, *.o` +contain the native code. Files with the code are necessary for cross-module +optimization but are not strictly needed as the code is also +duplicated in the libraries. + +- libz3-static.a (OR libz3.so if built not in the staticlib mode) +contains the machine code of the Z3 library; + +- z3ml.{a,cma,cmxa,cmxs} - the OCaml code for the bindings. File +z3ml.a and z3ml.cmxa are static libraries with OCaml native code, +which will be included in the final binary when ocamlopt is used. The +z3 library code itself is not included in those three artifacts, but +the instructions where to find it are. The same is truce for `z3ml.a` +which includes the bytecode of the bindings as well as instructions +how to link the final product. Finally, `z3ml.cmxs` is a standalone +shared library that could be loaded in runtime use +`Dynlink.loadfile` (which used dlopen on posix machines underneath the +hood). + +- libz3ml.a is the archived machine code for `z3native_stubs.c`, which +is made by ocamlmklib: `ar rcs api/ml/libz3ml.a +api/ml/z3native_stubs.o` it is needed to build statically linked +binaries and libraries that use z3 bindings. + +- dllz3ml.so is the shared object that contains `z3native_stubs.o` as +well as correct ldd entries for C++ and Z3 libraries to enable proper +static and dynamic linking. The file is built with ocamlmklib on posix +systems as +``` +gcc -shared -o api/ml/dllz3ml.so api/ml/z3native_stubs.o -L. -lz3-static -lstdc++ +``` + +It is used by `ocaml`, `ocamlrun`, and `ocamlc` to link z3 and c++ +code into the OCaml runtime and enables usage of z3 bindings in +non-custom runtimes (default runtimes). + +The `dllz3ml.so` is usually installed in the stubs library in opam +installation (`$(opam config var lib)/stublibs`), it is done +automatically by `ocamlfind` so no special treatment is needed. + +Technical Details +================= + +The patch itself is rather small. First of all, we have to use +`-l` instead of `-cclib -l` in ocamlmklib since the latter +will pass the options only to the ocaml{c,opt} linker and will not +use the passed libraries when shared and non-shared versions of the +bindings are built (libz3ml.a and dllz3ml.so). They were both missing +either z3 code itself and ldd entries for stdc++ (and z3 if built not +in --staticlib mode). + +Having stdc++ entry streamlines the compilation process and makes +dynamic loading more resistant to the inclusion order. + +Finally, we had to add `-L.` to make sure that the built artifacts are +correctly found by gcc. + +I specifically left the cygwin part of the code intact as I have no +idea what the original author meant by this, neither do I use or +tested this patch in the cygwin or mingw environemt. I think that this +code is rather outdated and shouldn't really work. E.g., in the +--staticlib mode adding z3linkdep (which is libz3-static.a) as an +argument to `ocamlmklib` will yield the following broken archive +``` +ar rcs api/ml/libz3ml.a libz3-static.a api/ml/z3native_stubs.o +``` +and it is not allowed (or supported) to have .a in archives (though it +doesn't really hurt as most of the systems will just ignore it). + +But otherwise, cygwin, mingw shall behave as they did (the only change +that affects them is `-L.` which I believe should be benign). +--- + scripts/mk_util.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/mk_util.py b/scripts/mk_util.py +index 1a95ee20c3..156be9ca2f 100644 +--- a/scripts/mk_util.py ++++ b/scripts/mk_util.py +@@ -1957,7 +1957,7 @@ def mk_makefile(self, out): + + OCAMLMKLIB = 'ocamlmklib' + +- LIBZ3 = '-cclib -l' + z3link ++ LIBZ3 = '-l' + z3link + ' -lstdc++' + if is_cygwin() and not(is_cygwin_mingw()): + LIBZ3 = z3linkdep + +@@ -1970,9 +1970,9 @@ def mk_makefile(self, out): + z3mls = os.path.join(self.sub_dir, 'z3ml') + + out.write('%s.cma: %s %s %s\n' % (z3mls, cmos, stubso, z3linkdep)) +- out.write('\t%s -o %s -I %s %s %s %s\n' % (OCAMLMKLIB, z3mls, self.sub_dir, stubso, cmos, LIBZ3)) ++ out.write('\t%s -o %s -I %s -L. %s %s %s\n' % (OCAMLMKLIB, z3mls, self.sub_dir, stubso, cmos, LIBZ3)) + out.write('%s.cmxa: %s %s %s %s.cma\n' % (z3mls, cmxs, stubso, z3linkdep, z3mls)) +- out.write('\t%s -o %s -I %s %s %s %s\n' % (OCAMLMKLIB, z3mls, self.sub_dir, stubso, cmxs, LIBZ3)) ++ out.write('\t%s -o %s -I %s -L. %s %s %s\n' % (OCAMLMKLIB, z3mls, self.sub_dir, stubso, cmxs, LIBZ3)) + out.write('%s.cmxs: %s.cmxa\n' % (z3mls, z3mls)) + out.write('\t%s -linkall -shared -o %s.cmxs -I . -I %s %s.cmxa\n' % (OCAMLOPTF, z3mls, self.sub_dir, z3mls)) + diff --git a/patches/z3/fix-gcc-13.patch b/patches/z3/fix-gcc-13.patch new file mode 100644 index 0000000..8d189bf --- /dev/null +++ b/patches/z3/fix-gcc-13.patch @@ -0,0 +1,28 @@ +From 520e692a43c41e8981eb091494bef0297ecbe3c6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= + <31284574+kloczek@users.noreply.github.com> +Date: Sat, 13 May 2023 17:37:35 +0100 +Subject: [PATCH] Fix building with gcc 13 (#6723) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Trivial fix to build with gcc 13 reported in #6722. + +Signed-off-by: Tomasz Kłoczko +--- + src/util/tptr.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/util/tptr.h b/src/util/tptr.h +index 6213b2efa40..2a35af5353d 100644 +--- a/src/util/tptr.h ++++ b/src/util/tptr.h +@@ -20,6 +20,7 @@ Revision History: + #pragma once + + #include "util/machine.h" ++#include + + #define TAG_SHIFT PTR_ALIGNMENT + #define ALIGNMENT_VALUE (1 << PTR_ALIGNMENT) diff --git a/patches/z3/fix-parallel-build.patch b/patches/z3/fix-parallel-build.patch new file mode 100644 index 0000000..401534a --- /dev/null +++ b/patches/z3/fix-parallel-build.patch @@ -0,0 +1,19 @@ +commit 7d43a4bca5c11668d4a96872c96eb6af1d9fb253 +Author: Kate +Date: Wed Apr 10 13:49:26 2019 +0100 + + Fix Makefile generation for the OCaml api + +diff --git a/scripts/mk_util.py b/scripts/mk_util.py +index b8fbf9a45..3b71af793 100644 +--- a/scripts/mk_util.py ++++ b/scripts/mk_util.py +@@ -2255,7 +2255,7 @@ class MLComponent(Component): + for m in self.modules: + ff = os.path.join(src_dir, m + '.ml') + ft = os.path.join(self.sub_dir, m + '.cmx') +- out.write('%s: %s %s\n' % (ft, ff, cmos)) ++ out.write('%s: %s %s %s\n' % (ft, ff, cmos, cmxs)) + out.write('\t%s -I %s -o %s -c %s\n' % (OCAMLOPTF, self.sub_dir, ft, ff)) + cmxs = cmxs + ' ' + ft + diff --git a/patches/z3/libatomic.patch b/patches/z3/libatomic.patch new file mode 100644 index 0000000..4ed518f --- /dev/null +++ b/patches/z3/libatomic.patch @@ -0,0 +1,100 @@ +diff --git a/scripts/mk_util.py b/scripts/mk_util.py +index 014b0e40f..3e6da0b22 100644 +--- a/scripts/mk_util.py ++++ b/scripts/mk_util.py +@@ -314,6 +314,26 @@ def test_fpmath(cc): + FPMATH_FLAGS="" + return "UNKNOWN" + ++def test_atomic_required(cc): ++ t = TempFile('tstatomic.cpp') ++ t.add(""" ++ #include ++ std::atomic x; ++ std::atomic y; ++ std::atomic z; ++ std::atomic w; ++ int main() { ++ ++z; ++ ++y; ++ ++w; ++ return ++x; ++ } ++ """) ++ t.commit() ++ fails_without = exec_compiler_cmd([cc, CPPFLAGS, '', 'tstatomic.cpp', LDFLAGS, '']) != 0 ++ ok_with = exec_compiler_cmd([cc, CPPFLAGS, '', 'tstatomic.cpp', LDFLAGS + ' -latomic', '']) == 0 ++ return fails_without and ok_with ++ + + def find_jni_h(path): + for root, dirs, files in os.walk(path): +@@ -555,19 +575,19 @@ def set_version(major, minor, build, revision): + print("Set Assembly Version (BUILD):", VER_MAJOR, VER_MINOR, VER_BUILD, VER_TWEAK) + return + +- # use parameters to set up version if not provided by script args ++ # use parameters to set up version if not provided by script args + VER_MAJOR = major + VER_MINOR = minor + VER_BUILD = build + VER_TWEAK = revision + +- # update VER_TWEAK base on github ++ # update VER_TWEAK base on github + if GIT_DESCRIBE: + branch = check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) + VER_TWEAK = int(check_output(['git', 'rev-list', '--count', 'HEAD'])) +- ++ + print("Set Assembly Version (DEFAULT):", VER_MAJOR, VER_MINOR, VER_BUILD, VER_TWEAK) +- ++ + def get_version(): + return (VER_MAJOR, VER_MINOR, VER_BUILD, VER_TWEAK) + +@@ -1858,7 +1878,7 @@ class JavaDLLComponent(Component): + os.path.join('api', 'java', 'Native')) + elif IS_OSX and IS_ARCH_ARM64: + out.write('\t$(SLINK) $(SLINK_OUT_FLAG)libz3java$(SO_EXT) $(SLINK_FLAGS) -arch arm64 %s$(OBJ_EXT) libz3$(SO_EXT)\n' % +- os.path.join('api', 'java', 'Native')) ++ os.path.join('api', 'java', 'Native')) + else: + out.write('\t$(SLINK) $(SLINK_OUT_FLAG)libz3java$(SO_EXT) $(SLINK_FLAGS) %s$(OBJ_EXT) libz3$(SO_EXT)\n' % + os.path.join('api', 'java', 'Native')) +@@ -2600,6 +2620,9 @@ def mk_config(): + CXXFLAGS = '%s -fvisibility=hidden -fvisibility-inlines-hidden -c' % CXXFLAGS + FPMATH = test_fpmath(CXX) + CXXFLAGS = '%s %s' % (CXXFLAGS, FPMATH_FLAGS) ++ atomic_required = test_atomic_required(CXX) ++ if atomic_required: ++ LDFLAGS = '%s -latomic' % LDFLAGS + if LOG_SYNC: + CXXFLAGS = '%s -DZ3_LOG_SYNC' % CXXFLAGS + if SINGLE_THREADED: +@@ -2710,6 +2733,7 @@ def mk_config(): + print('Prefix: %s' % PREFIX) + print('64-bit: %s' % is64()) + print('FP math: %s' % FPMATH) ++ print('libatomic: %s' % ('required' if atomic_required else 'not required')) + print("Python pkg dir: %s" % PYTHON_PACKAGE_DIR) + if GPROF: + print('gprof: enabled') +@@ -2854,7 +2878,7 @@ def update_version(): + revision = VER_TWEAK + + print("UpdateVersion:", get_full_version_string(major, minor, build, revision)) +- ++ + if major is None or minor is None or build is None or revision is None: + raise MKException("set_version(major, minor, build, revision) must be used before invoking update_version()") + if not ONLY_MAKEFILES: +@@ -3068,7 +3092,7 @@ def mk_bindings(api_files): + z3py_output_dir=get_z3py_dir(), + dotnet_output_dir=dotnet_output_dir, + java_input_dir=java_input_dir, +- java_output_dir=java_output_dir, ++ java_output_dir=java_output_dir, + java_package_name=java_package_name, + ml_output_dir=ml_output_dir, + ml_src_dir=ml_output_dir diff --git a/patches/z3/optional-python-bytecode.patch b/patches/z3/optional-python-bytecode.patch new file mode 100644 index 0000000..d21f9d9 --- /dev/null +++ b/patches/z3/optional-python-bytecode.patch @@ -0,0 +1,64 @@ +diff --git a/scripts/mk_util.py b/scripts/mk_util.py +index 3d3996792..370d643b5 100644 +--- a/scripts/mk_util.py ++++ b/scripts/mk_util.py +@@ -555,19 +555,19 @@ def set_version(major, minor, build, revision): + print("Set Assembly Version (BUILD):", VER_MAJOR, VER_MINOR, VER_BUILD, VER_TWEAK) + return + +- # use parameters to set up version if not provided by script args ++ # use parameters to set up version if not provided by script args + VER_MAJOR = major + VER_MINOR = minor + VER_BUILD = build + VER_TWEAK = revision + +- # update VER_TWEAK base on github ++ # update VER_TWEAK base on github + if GIT_DESCRIBE: + branch = check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) + VER_TWEAK = int(check_output(['git', 'rev-list', '--count', 'HEAD'])) +- ++ + print("Set Assembly Version (DEFAULT):", VER_MAJOR, VER_MINOR, VER_BUILD, VER_TWEAK) +- ++ + def get_version(): + return (VER_MAJOR, VER_MINOR, VER_BUILD, VER_TWEAK) + +@@ -1856,7 +1856,7 @@ class JavaDLLComponent(Component): + os.path.join('api', 'java', 'Native')) + elif IS_OSX and IS_ARCH_ARM64: + out.write('\t$(SLINK) $(SLINK_OUT_FLAG)libz3java$(SO_EXT) $(SLINK_FLAGS) -arch arm64 %s$(OBJ_EXT) libz3$(SO_EXT)\n' % +- os.path.join('api', 'java', 'Native')) ++ os.path.join('api', 'java', 'Native')) + else: + out.write('\t$(SLINK) $(SLINK_OUT_FLAG)libz3java$(SO_EXT) $(SLINK_FLAGS) %s$(OBJ_EXT) libz3$(SO_EXT)\n' % + os.path.join('api', 'java', 'Native')) +@@ -2852,7 +2852,7 @@ def update_version(): + revision = VER_TWEAK + + print("UpdateVersion:", get_full_version_string(major, minor, build, revision)) +- ++ + if major is None or minor is None or build is None or revision is None: + raise MKException("set_version(major, minor, build, revision) must be used before invoking update_version()") + if not ONLY_MAKEFILES: +@@ -2994,7 +2994,7 @@ def cp_z3py_to_build(): + rmf(os.path.join(root, f)) + # Compile Z3Py files + if compileall.compile_dir(z3py_src, force=1) != 1: +- raise MKException("failed to compile Z3Py sources") ++ print("Python bytecode generation in %s failed, but that's ok" % z3py_src) + if is_verbose: + print("Generated python bytecode") + # Copy sources to build +@@ -3056,7 +3056,7 @@ def mk_bindings(api_files): + z3py_output_dir=get_z3py_dir(), + dotnet_output_dir=dotnet_output_dir, + java_input_dir=java_input_dir, +- java_output_dir=java_output_dir, ++ java_output_dir=java_output_dir, + java_package_name=java_package_name, + ml_output_dir=ml_output_dir, + ml_src_dir=ml_output_dir diff --git a/patches/zarith-freestanding/config.diff b/patches/zarith-freestanding/config.diff new file mode 100644 index 0000000..587951f --- /dev/null +++ b/patches/zarith-freestanding/config.diff @@ -0,0 +1,17 @@ +--- a/configure 2016-07-22 21:53:10.872919000 +0200 ++++ b/configure 2016-07-22 21:55:23.788871000 +0200 +@@ -340,12 +340,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then diff --git a/patches/zarith-freestanding/mirage-build.sh.1.10 b/patches/zarith-freestanding/mirage-build.sh.1.10 new file mode 100644 index 0000000..21eef37 --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.10 @@ -0,0 +1,15 @@ +#!/bin/sh -eux + +PREFIX=$1 +MAKE=$2 +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +CC=cc \ +./configure -nodynlink -gmp + +$MAKE diff --git a/patches/zarith-freestanding/mirage-build.sh.1.11 b/patches/zarith-freestanding/mirage-build.sh.1.11 new file mode 100644 index 0000000..21eef37 --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.11 @@ -0,0 +1,15 @@ +#!/bin/sh -eux + +PREFIX=$1 +MAKE=$2 +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +CC=cc \ +./configure -nodynlink -gmp + +$MAKE diff --git a/patches/zarith-freestanding/mirage-build.sh.1.12 b/patches/zarith-freestanding/mirage-build.sh.1.12 new file mode 100644 index 0000000..21eef37 --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.12 @@ -0,0 +1,15 @@ +#!/bin/sh -eux + +PREFIX=$1 +MAKE=$2 +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +CC=cc \ +./configure -nodynlink -gmp + +$MAKE diff --git a/patches/zarith-freestanding/mirage-build.sh.1.4 b/patches/zarith-freestanding/mirage-build.sh.1.4 new file mode 100644 index 0000000..44f0b9a --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.4 @@ -0,0 +1,17 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +./configure -gmp + +if [ `uname -s` = "FreeBSD" ]; then + gmake +else + make +fi diff --git a/patches/zarith-freestanding/mirage-build.sh.1.4.1 b/patches/zarith-freestanding/mirage-build.sh.1.4.1 new file mode 100644 index 0000000..44f0b9a --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.4.1 @@ -0,0 +1,17 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +./configure -gmp + +if [ `uname -s` = "FreeBSD" ]; then + gmake +else + make +fi diff --git a/patches/zarith-freestanding/mirage-build.sh.1.6 b/patches/zarith-freestanding/mirage-build.sh.1.6 new file mode 100644 index 0000000..44f0b9a --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.6 @@ -0,0 +1,17 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +./configure -gmp + +if [ `uname -s` = "FreeBSD" ]; then + gmake +else + make +fi diff --git a/patches/zarith-freestanding/mirage-build.sh.1.7 b/patches/zarith-freestanding/mirage-build.sh.1.7 new file mode 100644 index 0000000..92a08ee --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.7 @@ -0,0 +1,17 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +./configure -gmp + +if [ `uname -s` = "FreeBSD" ] || [ `uname -s` = "OpenBSD" ]; then + gmake +else + make +fi diff --git a/patches/zarith-freestanding/mirage-build.sh.1.7-1 b/patches/zarith-freestanding/mirage-build.sh.1.7-1 new file mode 100644 index 0000000..fcdc853 --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.7-1 @@ -0,0 +1,17 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +./configure -nodynlink -gmp + +if [ `uname -s` = "FreeBSD" ] || [ `uname -s` = "OpenBSD" ]; then + gmake +else + make +fi diff --git a/patches/zarith-freestanding/mirage-build.sh.1.7-2 b/patches/zarith-freestanding/mirage-build.sh.1.7-2 new file mode 100644 index 0000000..38199f2 --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.7-2 @@ -0,0 +1,18 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +CC=cc \ +./configure -nodynlink -gmp + +if [ `uname -s` = "FreeBSD" ] || [ `uname -s` = "OpenBSD" ]; then + gmake +else + make +fi diff --git a/patches/zarith-freestanding/mirage-build.sh.1.9.1 b/patches/zarith-freestanding/mirage-build.sh.1.9.1 new file mode 100644 index 0000000..38199f2 --- /dev/null +++ b/patches/zarith-freestanding/mirage-build.sh.1.9.1 @@ -0,0 +1,18 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="$(pkg-config --cflags gmp-freestanding ocaml-freestanding)" \ +LDFLAGS="$(pkg-config --libs gmp-freestanding)" \ +CC=cc \ +./configure -nodynlink -gmp + +if [ `uname -s` = "FreeBSD" ] || [ `uname -s` = "OpenBSD" ]; then + gmake +else + make +fi diff --git a/patches/zarith-freestanding/mirage-install.sh.1.10 b/patches/zarith-freestanding/mirage-install.sh.1.10 new file mode 100644 index 0000000..479d73d --- /dev/null +++ b/patches/zarith-freestanding/mirage-install.sh.1.10 @@ -0,0 +1,12 @@ +#!/bin/sh -eux + +PREFIX=$1 +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +cp libzarith.a "$PREFIX/lib/zarith/libzarith-freestanding.a" + +# This is a hack to get freestanding_linkopts into the host 'zarith' package. +cat >>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" < "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.11 b/patches/zarith-freestanding/mirage-uninstall.sh.1.11 new file mode 100644 index 0000000..12a9d04 --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.11 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=$1 + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.12 b/patches/zarith-freestanding/mirage-uninstall.sh.1.12 new file mode 100644 index 0000000..12a9d04 --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.12 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=$1 + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.4 b/patches/zarith-freestanding/mirage-uninstall.sh.1.4 new file mode 100644 index 0000000..e764dde --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.4 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.4.1 b/patches/zarith-freestanding/mirage-uninstall.sh.1.4.1 new file mode 100644 index 0000000..e764dde --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.4.1 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.6 b/patches/zarith-freestanding/mirage-uninstall.sh.1.6 new file mode 100644 index 0000000..e764dde --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.6 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.7 b/patches/zarith-freestanding/mirage-uninstall.sh.1.7 new file mode 100644 index 0000000..e764dde --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.7 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.7-1 b/patches/zarith-freestanding/mirage-uninstall.sh.1.7-1 new file mode 100644 index 0000000..e764dde --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.7-1 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.7-2 b/patches/zarith-freestanding/mirage-uninstall.sh.1.7-2 new file mode 100644 index 0000000..e764dde --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.7-2 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/mirage-uninstall.sh.1.9.1 b/patches/zarith-freestanding/mirage-uninstall.sh.1.9.1 new file mode 100644 index 0000000..e764dde --- /dev/null +++ b/patches/zarith-freestanding/mirage-uninstall.sh.1.9.1 @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` + +rm -f "$PREFIX/lib/zarith/libzarith-freestanding.a" + +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.tmp" +cat "$PREFIX/lib/zarith/META.tmp" | grep -v freestanding_linkopts > "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-freestanding/no-dynlink.patch.1.10 b/patches/zarith-freestanding/no-dynlink.patch.1.10 new file mode 100644 index 0000000..8680f70 --- /dev/null +++ b/patches/zarith-freestanding/no-dynlink.patch.1.10 @@ -0,0 +1,86 @@ +This patch is required to build Zarith on an ocaml-freestanding type setup. It +does three things: + +1. Add an option to configure to forcibly disable dynlink. +2. Stop configure from adding a host -lgmp. +3. In addition to (1), force project.mak to use "ocamlmklib -custom" instead of + "ocamlmklib -failsafe". + +We need all three because the Zarith build system is TOTALLY INSANE and has +never even remotely heard of such a thing as cross compiling, and we need it to +just shut up and build ONLY with the flags we pass it. KTHXBYE + +--- a/configure 2019-08-28 16:17:04.000000000 +0200 ++++ b/configure 2020-08-26 17:55:33.488824000 +0200 +@@ -21,6 +21,7 @@ + host='auto' + gmp='auto' + perf='no' ++nodynlink='no' + + ar='ar' + ocaml='ocaml' +@@ -59,6 +60,7 @@ + -gmp use GMP library (default if found) + -mpir use MPIR library instead of GMP + -perf enable performance statistics ++ -nodynlink disable dynamic linking + -prefixnonocaml add for non ocaml tool, e.g. -prefixnonocaml x86_64-w64-mingw32- + + Environment variables that affect configuration: +@@ -101,6 +103,8 @@ + gmp='mpir';; + -perf|--perf) + perf='yes';; ++ -nodynlink|--nodynlink) ++ nodynlink='yes';; + -prefixnonocaml|--prefixnonocaml) + prefixnonocaml="$2" + shift;; +@@ -268,7 +272,7 @@ + + hasdynlink='no' + +-if test $hasocamlopt = yes ++if test $hasocamlopt = yes -a $nodynlink = no + then + checkcmxalib dynlink.cmxa + if test $? -eq 1; then hasdynlink='yes'; fi +@@ -368,12 +372,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then +diff -ur zarith.1.9.1.orig/project.mak zarith.1.9.1/project.mak +--- a/project.mak 2019-08-28 16:17:04.000000000 +0200 ++++ b/project.mak 2020-08-26 17:55:49.996798000 +0200 +@@ -70,16 +70,16 @@ + make -C tests test + + zarith.cma: $(MLSRC:%.ml=%.cmo) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxa zarith.$(LIBSUFFIX): $(MLSRC:%.ml=%.cmx) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxs: zarith.cmxa libzarith.$(LIBSUFFIX) + $(OCAMLOPT) -shared -o $@ -I . zarith.cmxa -linkall + + libzarith.$(LIBSUFFIX) dllzarith.$(DLLSUFFIX): $(SSRC:%.S=%.$(OBJSUFFIX)) $(CSRC:%.c=%.$(OBJSUFFIX)) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith_top.cma: zarith_top.cmo + $(OCAMLC) -o $@ -a $< diff --git a/patches/zarith-freestanding/no-dynlink.patch.1.11 b/patches/zarith-freestanding/no-dynlink.patch.1.11 new file mode 100644 index 0000000..8680f70 --- /dev/null +++ b/patches/zarith-freestanding/no-dynlink.patch.1.11 @@ -0,0 +1,86 @@ +This patch is required to build Zarith on an ocaml-freestanding type setup. It +does three things: + +1. Add an option to configure to forcibly disable dynlink. +2. Stop configure from adding a host -lgmp. +3. In addition to (1), force project.mak to use "ocamlmklib -custom" instead of + "ocamlmklib -failsafe". + +We need all three because the Zarith build system is TOTALLY INSANE and has +never even remotely heard of such a thing as cross compiling, and we need it to +just shut up and build ONLY with the flags we pass it. KTHXBYE + +--- a/configure 2019-08-28 16:17:04.000000000 +0200 ++++ b/configure 2020-08-26 17:55:33.488824000 +0200 +@@ -21,6 +21,7 @@ + host='auto' + gmp='auto' + perf='no' ++nodynlink='no' + + ar='ar' + ocaml='ocaml' +@@ -59,6 +60,7 @@ + -gmp use GMP library (default if found) + -mpir use MPIR library instead of GMP + -perf enable performance statistics ++ -nodynlink disable dynamic linking + -prefixnonocaml add for non ocaml tool, e.g. -prefixnonocaml x86_64-w64-mingw32- + + Environment variables that affect configuration: +@@ -101,6 +103,8 @@ + gmp='mpir';; + -perf|--perf) + perf='yes';; ++ -nodynlink|--nodynlink) ++ nodynlink='yes';; + -prefixnonocaml|--prefixnonocaml) + prefixnonocaml="$2" + shift;; +@@ -268,7 +272,7 @@ + + hasdynlink='no' + +-if test $hasocamlopt = yes ++if test $hasocamlopt = yes -a $nodynlink = no + then + checkcmxalib dynlink.cmxa + if test $? -eq 1; then hasdynlink='yes'; fi +@@ -368,12 +372,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then +diff -ur zarith.1.9.1.orig/project.mak zarith.1.9.1/project.mak +--- a/project.mak 2019-08-28 16:17:04.000000000 +0200 ++++ b/project.mak 2020-08-26 17:55:49.996798000 +0200 +@@ -70,16 +70,16 @@ + make -C tests test + + zarith.cma: $(MLSRC:%.ml=%.cmo) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxa zarith.$(LIBSUFFIX): $(MLSRC:%.ml=%.cmx) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxs: zarith.cmxa libzarith.$(LIBSUFFIX) + $(OCAMLOPT) -shared -o $@ -I . zarith.cmxa -linkall + + libzarith.$(LIBSUFFIX) dllzarith.$(DLLSUFFIX): $(SSRC:%.S=%.$(OBJSUFFIX)) $(CSRC:%.c=%.$(OBJSUFFIX)) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith_top.cma: zarith_top.cmo + $(OCAMLC) -o $@ -a $< diff --git a/patches/zarith-freestanding/no-dynlink.patch.1.12 b/patches/zarith-freestanding/no-dynlink.patch.1.12 new file mode 100644 index 0000000..dedc1e6 --- /dev/null +++ b/patches/zarith-freestanding/no-dynlink.patch.1.12 @@ -0,0 +1,86 @@ +This patch is required to build Zarith on an ocaml-freestanding type setup. It +does three things: + +1. Add an option to configure to forcibly disable dynlink. +2. Stop configure from adding a host -lgmp. +3. In addition to (1), force project.mak to use "ocamlmklib -custom" instead of + "ocamlmklib -failsafe". + +We need all three because the Zarith build system is TOTALLY INSANE and has +never even remotely heard of such a thing as cross compiling, and we need it to +just shut up and build ONLY with the flags we pass it. KTHXBYE + +--- a/configure 2019-08-28 16:17:04.000000000 +0200 ++++ b/configure 2020-08-26 17:55:33.488824000 +0200 +@@ -21,6 +21,7 @@ + host='auto' + gmp='auto' + perf='no' ++nodynlink='no' + + ocaml='ocaml' + ocamlc='ocamlc' +@@ -55,6 +56,7 @@ + -gmp use GMP library (default if found) + -mpir use MPIR library instead of GMP + -perf enable performance statistics ++ -nodynlink disable dynamic linking + -prefixnonocaml add for non ocaml tool, e.g. -prefixnonocaml x86_64-w64-mingw32- + + Environment variables that affect configuration: +@@ -91,6 +93,8 @@ + gmp='mpir';; + -perf|--perf) + perf='yes';; ++ -nodynlink|--nodynlink) ++ nodynlink='yes';; + -prefixnonocaml|--prefixnonocaml) + prefixnonocaml="$2" + shift;; +@@ -255,7 +259,7 @@ + + hasdynlink='no' + +-if test $hasocamlopt = yes ++if test $hasocamlopt = yes -a $nodynlink = no + then + checkcmxalib dynlink.cmxa + if test $? -eq 1; then hasdynlink='yes'; fi +@@ -299,12 +303,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then +diff -ur zarith.1.12.orig/project.mak zarith.1.12/project.mak +--- a/project.mak 2019-08-28 16:17:04.000000000 +0200 ++++ b/project.mak 2020-08-26 17:55:49.996798000 +0200 +@@ -71,16 +71,16 @@ + make -C tests test + + zarith.cma: $(MLSRC:%.ml=%.cmo) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxa: $(MLSRC:%.ml=%.cmx) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxs: zarith.cmxa libzarith.$(LIBSUFFIX) + $(OCAMLOPT) -shared -o $@ -I . zarith.cmxa -linkall + + libzarith.$(LIBSUFFIX): $(CSRC:%.c=%.$(OBJSUFFIX)) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith_top.cma: zarith_top.cmo + $(OCAMLC) -o $@ -a $< diff --git a/patches/zarith-freestanding/no-dynlink.patch.1.7-1 b/patches/zarith-freestanding/no-dynlink.patch.1.7-1 new file mode 100644 index 0000000..2d68a1e --- /dev/null +++ b/patches/zarith-freestanding/no-dynlink.patch.1.7-1 @@ -0,0 +1,85 @@ +This patch is required to build Zarith on an ocaml-freestanding type setup. It +does three things: + +1. Add an option to configure to forcibly disable dynlink. +2. Stop configure from adding a host -lgmp. +3. In addition to (1), force project.mak to use "ocamlmklib -custom" instead of + "ocamlmklib -failsafe". + +We need all three because the Zarith build system is TOTALLY INSANE and has +never even remotely heard of such a thing as cross compiling, and we need it to +just shut up and build ONLY with the flags we pass it. KTHXBYE + +--- a/configure 2017-10-13 19:45:41.000000000 +0200 ++++ b/configure 2018-11-30 19:12:36.809951317 +0100 +@@ -21,6 +21,7 @@ + host='auto' + gmp='auto' + perf='no' ++nodynlink='no' + + ar='ar' + ocaml='ocaml' +@@ -59,6 +60,7 @@ + -gmp use GMP library (default if found) + -mpir use MPIR library instead of GMP + -perf enable performance statistics ++ -nodynlink disable dynamic linking + + Environment variables that affect configuration: + CC C compiler to use (default: try gcc, then cc) +@@ -99,6 +101,8 @@ + gmp='mpir';; + -perf|--perf) + perf='yes';; ++ -nodynlink|--nodynlink) ++ nodynlink='yes';; + *) + echo "unknown option $1, try -help" + exit 2;; +@@ -248,7 +252,7 @@ + + hasdynlink='no' + +-if test $hasocamlopt = yes ++if test $hasocamlopt = yes -a $nodynlink = no + then + checkcmxalib dynlink.cmxa + if test $? -eq 1; then hasdynlink='yes'; fi +@@ -340,12 +344,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then +--- a/project.mak 2017-10-13 19:45:41.000000000 +0200 ++++ b/project.mak 2018-11-30 19:11:16.205189144 +0100 +@@ -60,16 +60,16 @@ + make -C tests test + + zarith.cma: $(MLSRC:%.ml=%.cmo) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxa zarith.$(LIBSUFFIX): $(MLSRC:%.ml=%.cmx) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxs: zarith.cmxa libzarith.$(LIBSUFFIX) + $(OCAMLOPT) -shared -o $@ -I . zarith.cmxa -linkall + + libzarith.$(LIBSUFFIX) dllzarith.$(DLLSUFFIX): $(SSRC:%.S=%.$(OBJSUFFIX)) $(CSRC:%.c=%.$(OBJSUFFIX)) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + doc: $(MLISRC) + mkdir -p html diff --git a/patches/zarith-freestanding/no-dynlink.patch.1.7-2 b/patches/zarith-freestanding/no-dynlink.patch.1.7-2 new file mode 100644 index 0000000..2d68a1e --- /dev/null +++ b/patches/zarith-freestanding/no-dynlink.patch.1.7-2 @@ -0,0 +1,85 @@ +This patch is required to build Zarith on an ocaml-freestanding type setup. It +does three things: + +1. Add an option to configure to forcibly disable dynlink. +2. Stop configure from adding a host -lgmp. +3. In addition to (1), force project.mak to use "ocamlmklib -custom" instead of + "ocamlmklib -failsafe". + +We need all three because the Zarith build system is TOTALLY INSANE and has +never even remotely heard of such a thing as cross compiling, and we need it to +just shut up and build ONLY with the flags we pass it. KTHXBYE + +--- a/configure 2017-10-13 19:45:41.000000000 +0200 ++++ b/configure 2018-11-30 19:12:36.809951317 +0100 +@@ -21,6 +21,7 @@ + host='auto' + gmp='auto' + perf='no' ++nodynlink='no' + + ar='ar' + ocaml='ocaml' +@@ -59,6 +60,7 @@ + -gmp use GMP library (default if found) + -mpir use MPIR library instead of GMP + -perf enable performance statistics ++ -nodynlink disable dynamic linking + + Environment variables that affect configuration: + CC C compiler to use (default: try gcc, then cc) +@@ -99,6 +101,8 @@ + gmp='mpir';; + -perf|--perf) + perf='yes';; ++ -nodynlink|--nodynlink) ++ nodynlink='yes';; + *) + echo "unknown option $1, try -help" + exit 2;; +@@ -248,7 +252,7 @@ + + hasdynlink='no' + +-if test $hasocamlopt = yes ++if test $hasocamlopt = yes -a $nodynlink = no + then + checkcmxalib dynlink.cmxa + if test $? -eq 1; then hasdynlink='yes'; fi +@@ -340,12 +344,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then +--- a/project.mak 2017-10-13 19:45:41.000000000 +0200 ++++ b/project.mak 2018-11-30 19:11:16.205189144 +0100 +@@ -60,16 +60,16 @@ + make -C tests test + + zarith.cma: $(MLSRC:%.ml=%.cmo) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxa zarith.$(LIBSUFFIX): $(MLSRC:%.ml=%.cmx) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxs: zarith.cmxa libzarith.$(LIBSUFFIX) + $(OCAMLOPT) -shared -o $@ -I . zarith.cmxa -linkall + + libzarith.$(LIBSUFFIX) dllzarith.$(DLLSUFFIX): $(SSRC:%.S=%.$(OBJSUFFIX)) $(CSRC:%.c=%.$(OBJSUFFIX)) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + doc: $(MLISRC) + mkdir -p html diff --git a/patches/zarith-freestanding/no-dynlink.patch.1.9.1 b/patches/zarith-freestanding/no-dynlink.patch.1.9.1 new file mode 100644 index 0000000..8680f70 --- /dev/null +++ b/patches/zarith-freestanding/no-dynlink.patch.1.9.1 @@ -0,0 +1,86 @@ +This patch is required to build Zarith on an ocaml-freestanding type setup. It +does three things: + +1. Add an option to configure to forcibly disable dynlink. +2. Stop configure from adding a host -lgmp. +3. In addition to (1), force project.mak to use "ocamlmklib -custom" instead of + "ocamlmklib -failsafe". + +We need all three because the Zarith build system is TOTALLY INSANE and has +never even remotely heard of such a thing as cross compiling, and we need it to +just shut up and build ONLY with the flags we pass it. KTHXBYE + +--- a/configure 2019-08-28 16:17:04.000000000 +0200 ++++ b/configure 2020-08-26 17:55:33.488824000 +0200 +@@ -21,6 +21,7 @@ + host='auto' + gmp='auto' + perf='no' ++nodynlink='no' + + ar='ar' + ocaml='ocaml' +@@ -59,6 +60,7 @@ + -gmp use GMP library (default if found) + -mpir use MPIR library instead of GMP + -perf enable performance statistics ++ -nodynlink disable dynamic linking + -prefixnonocaml add for non ocaml tool, e.g. -prefixnonocaml x86_64-w64-mingw32- + + Environment variables that affect configuration: +@@ -101,6 +103,8 @@ + gmp='mpir';; + -perf|--perf) + perf='yes';; ++ -nodynlink|--nodynlink) ++ nodynlink='yes';; + -prefixnonocaml|--prefixnonocaml) + prefixnonocaml="$2" + shift;; +@@ -268,7 +272,7 @@ + + hasdynlink='no' + +-if test $hasocamlopt = yes ++if test $hasocamlopt = yes -a $nodynlink = no + then + checkcmxalib dynlink.cmxa + if test $? -eq 1; then hasdynlink='yes'; fi +@@ -368,12 +372,8 @@ + if test "$gmp" = 'gmp' -o "$gmp" = 'auto'; then + checkinc gmp.h + if test $? -eq 1; then +- checklib gmp +- if test $? -eq 1; then +- gmp='OK' +- cclib="$cclib -lgmp" +- ccdef="-DHAS_GMP $ccdef" +- fi ++ gmp='OK' ++ ccdef="-DHAS_GMP $ccdef" + fi + fi + if test "$gmp" = 'mpir' -o "$gmp" = 'auto'; then +diff -ur zarith.1.9.1.orig/project.mak zarith.1.9.1/project.mak +--- a/project.mak 2019-08-28 16:17:04.000000000 +0200 ++++ b/project.mak 2020-08-26 17:55:49.996798000 +0200 +@@ -70,16 +70,16 @@ + make -C tests test + + zarith.cma: $(MLSRC:%.ml=%.cmo) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxa zarith.$(LIBSUFFIX): $(MLSRC:%.ml=%.cmx) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith.cmxs: zarith.cmxa libzarith.$(LIBSUFFIX) + $(OCAMLOPT) -shared -o $@ -I . zarith.cmxa -linkall + + libzarith.$(LIBSUFFIX) dllzarith.$(DLLSUFFIX): $(SSRC:%.S=%.$(OBJSUFFIX)) $(CSRC:%.c=%.$(OBJSUFFIX)) +- $(OCAMLMKLIB) -failsafe -o zarith $+ $(LIBS) ++ $(OCAMLMKLIB) -custom -o zarith $+ $(LIBS) + + zarith_top.cma: zarith_top.cmo + $(OCAMLC) -o $@ -a $< diff --git a/patches/zarith-freestanding/z_pp.pl.patch b/patches/zarith-freestanding/z_pp.pl.patch new file mode 100644 index 0000000..cdf97ed --- /dev/null +++ b/patches/zarith-freestanding/z_pp.pl.patch @@ -0,0 +1,11 @@ +diff --git a/z_pp.pl b/z_pp.pl +--- a/z_pp.pl ++++ b/z_pp.pl +@@ -1,1 +1,3 @@ +-#!/usr/bin/perl -W ++#!/usr/bin/env perl ++ ++use warnings "all"; + + # Simple preprocessor to fix @ASM directives in z.mlp and z.mlip, and + # generate z.ml and z.mli diff --git a/patches/zarith-xen/mirage-install.sh.1.3 b/patches/zarith-xen/mirage-install.sh.1.3 new file mode 100644 index 0000000..cbcc5f6 --- /dev/null +++ b/patches/zarith-xen/mirage-install.sh.1.3 @@ -0,0 +1,18 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +LDFLAGS=`pkg-config --libs gmp-xen` +export LDFLAGS + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="`pkg-config --cflags gmp-xen mirage-xen-posix` -O2 -pedantic -fomit-frame-pointer -fno-builtin" +export CFLAGS +./configure +make +cp libzarith.a "$PREFIX/lib/zarith/libzarith-xen.a" +mv "$PREFIX/lib/zarith/META" "$PREFIX/lib/zarith/META.old" +cp META "$PREFIX/lib/zarith/META" diff --git a/patches/zarith-xen/mirage-install.sh.1.4 b/patches/zarith-xen/mirage-install.sh.1.4 new file mode 100644 index 0000000..53d421d --- /dev/null +++ b/patches/zarith-xen/mirage-install.sh.1.4 @@ -0,0 +1,21 @@ +#!/bin/sh -eux + +PREFIX=`opam config var prefix` +PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH + +LDFLAGS=`pkg-config --libs gmp-xen` +export LDFLAGS + +# WARNING: if you pass invalid cflags here, zarith will silently +# fall back to compiling with the default flags instead! +CFLAGS="`pkg-config --cflags gmp-xen mirage-xen-posix` -O2 -pedantic -fomit-frame-pointer -fno-builtin" +export CFLAGS +./configure +make + +cp libzarith.a "$PREFIX/lib/zarith/libzarith-xen.a" + +cat >>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" <>"$PREFIX/lib/zarith/META" < "$PREFIX/lib/zarith/META" +rm -f "$PREFIX/lib/zarith/META.tmp" diff --git a/patches/zarith-xen/xen_linkopts.patch b/patches/zarith-xen/xen_linkopts.patch new file mode 100644 index 0000000..b4d19a1 --- /dev/null +++ b/patches/zarith-xen/xen_linkopts.patch @@ -0,0 +1,9 @@ +diff --git a/META b/META +index c082c65..14394d1 100644 +--- a/META ++++ b/META +@@ -1,3 +1,4 @@ + version = "1.3" + archive(byte) = "zarith.cma" + archive(native) = "zarith.cmxa" ++xen_linkopts = "-lzarith-xen -L@gmp-xen -lgmp-xen" diff --git a/patches/zarith/absolute_CC.patch b/patches/zarith/absolute_CC.patch new file mode 100644 index 0000000..6cc9601 --- /dev/null +++ b/patches/zarith/absolute_CC.patch @@ -0,0 +1,35 @@ +commit 6681ae124c90489eba31cf3a6938cf31632f28ed +Author: Xavier Leroy +Date: Mon Jan 22 14:33:53 2018 +0100 + + PR#28: "configure" support for absolute paths + + Previously, "CC=/some/path/to/gcc configure" would not work. + + Also: use "test -f $i -a -x $i" to check that "$i" is an executable file. + Without the -f, a directory named "gcc", say, can fool the test. + +diff --git configure configure +index 1382309..3a55de5 100755 +--- a/configure ++++ b/configure +@@ -119,11 +119,18 @@ searchbin() + { + if test "x$1" = "x"; then return 0; fi + echo_n "binary $1: " ++ case "$1" in ++ /*|./*|../*) ++ if test -f "$1" -a -x "$1" ++ then echo "found"; return 1 ++ else echo "not found"; return 0 ++ fi;; ++ esac + IFS=':' + for i in $PATH + do + if test -z "$i"; then i='.'; fi +- if test -x $i/$1; then echo "found in $i"; unset IFS; return 1; fi ++ if test -f $i/$1 -a -x $i/$1; then echo "found in $i"; unset IFS; return 1; fi + done + echo "not found" + unset IFS diff --git a/patches/zarith/install_fix.patch b/patches/zarith/install_fix.patch new file mode 100644 index 0000000..9058486 --- /dev/null +++ b/patches/zarith/install_fix.patch @@ -0,0 +1,84 @@ +diff -u zarith-1.2.orig/Changes zarith-1.2/Changes +--- zarith-1.2.orig/Changes 2013-05-19 10:19:10.000000000 +0200 ++++ zarith-1.2/Changes 2013-05-21 13:34:31.000000000 +0200 +@@ -1,3 +1,5 @@ ++- Install fixes ++ + Release 1.2 (2013-05-19): + - Added fast asm path for ARMv7 processors. + - PR#1192: incorrect behavior of div_2exp +diff -u zarith-1.2.orig/META zarith-1.2/META +--- zarith-1.2.orig/META 2012-04-30 21:28:21.000000000 +0200 ++++ zarith-1.2/META 2013-05-21 13:34:31.000000000 +0200 +@@ -1,5 +1,5 @@ + description = "Arbitrary precision integers" + requires = "" +-version = "1.1" ++version = "1.2" + archive(byte) = "zarith.cma" + archive(native) = "zarith.cmxa" +diff -u zarith-1.2.orig/configure zarith-1.2/configure +--- zarith-1.2.orig/configure 2013-04-24 13:54:49.000000000 +0200 ++++ zarith-1.2/configure 2013-05-21 13:34:31.000000000 +0200 +@@ -88,10 +88,10 @@ + -installdir|--installdir) + installdir="$2" + shift;; +- -ocamllibdir|---ocamllibdir) ++ -ocamllibdir|--ocamllibdir) + ocamllibdir="$2" + shift;; +- -no-ocamlfind) ++ -no-ocamlfind|--no-ocamlfind) + ocamlfind="no" + shift;; + -host|--host) +@@ -263,7 +263,7 @@ + searchbin install + if test $? -eq 1; then instmeth='install' + else echo "no installation method found"; exit 2; fi +- if test "$installdir" = "auto"; then installdir="$ocamllibdir/zarith"; fi ++ if test "$installdir" = "auto"; then installdir="$ocamllibdir"; fi + fi + + +diff -u zarith-1.2.orig/project.mak zarith-1.2/project.mak +--- zarith-1.2.orig/project.mak 2012-12-10 10:47:31.000000000 +0100 ++++ zarith-1.2/project.mak 2013-05-21 13:34:31.000000000 +0200 +@@ -39,7 +39,7 @@ + AUTOGEN = z.ml z.mli + + CMIOBJ = $(MLISRC:%.mli=%.cmi) +-TOINSTALL := zarith.cma libzarith.$(LIBSUFFIX) $(MLISRC) $(CMIOBJ) ++TOINSTALL := zarith.h zarith.cma libzarith.$(LIBSUFFIX) $(MLISRC) $(CMIOBJ) + TESTS := testb$(EXE) + + ifeq ($(HASOCAMLOPT),yes) +@@ -94,22 +94,22 @@ + + ifeq ($(INSTMETH),install) + install: +- install -d $(INSTALLDIR) ++ install -d $(INSTALLDIR) $(INSTALLDIR)/zarith $(INSTALLDIR)/stublibs + for i in $(TOINSTALL); do \ +- if test -f $$i; then $(INSTALL) -m 0644 $$i $(INSTALLDIR); fi; \ ++ if test -f $$i; then $(INSTALL) -m 0644 $$i $(INSTALLDIR)/zarith/$$i; fi; \ + done +- if test -f dllzarith.$(DLLSUFFIX); then $(INSTALL) -m 0755 dllzarith.$(DLLSUFFIX) $(INSTALLDIR)/stublibs; fi ++ if test -f dllzarith.$(DLLSUFFIX); then $(INSTALL) -m 0755 dllzarith.$(DLLSUFFIX) $(INSTALLDIR)/stublibs/dllzarith.$(DLLSUFFIX); fi + + uninstall: + for i in $(TOINSTALL); do \ +- rm -f $(INSTALLDIR)/$$i; \ ++ rm -f $(INSTALLDIR)/zarith/$$i; \ + done + if test -f $(INSTALLDIR)/stublibs/dllzarith.$(DLLSUFFIX); then rm -f $(INSTALLDIR)/stublibs/dllzarith.$(DLLSUFFIX); fi + endif + + ifeq ($(INSTMETH),findlib) + install: +- $(OCAMLFIND) install -destdir "$(INSTALLDIR)" zarith META $(TOINSTALL) dllzarith.dll ++ $(OCAMLFIND) install -destdir "$(INSTALLDIR)" zarith META $(TOINSTALL) dllzarith.$(DLLSUFFIX) + + uninstall: + $(OCAMLFIND) remove -destdir "$(INSTALLDIR)" zarith diff --git a/patches/zarith/z_pp.pl.patch.1.3 b/patches/zarith/z_pp.pl.patch.1.3 new file mode 100644 index 0000000..e2ce217 --- /dev/null +++ b/patches/zarith/z_pp.pl.patch.1.3 @@ -0,0 +1,11 @@ +diff -ur zarith-1.3.orig/z_pp.pl zarith-1.3/z_pp.pl +--- zarith-1.3.orig/z_pp.pl 2013-07-30 17:49:15.000000000 +0100 ++++ zarith-1.3/z_pp.pl 2015-10-17 23:05:41.944161000 +0100 +@@ -1,4 +1,6 @@ +-#!/usr/bin/perl -W ++#!/usr/bin/env perl ++ ++use warnings "all" ; + + # Simple preprocessor to fix @ASM directives in z.mlp and z.mlip, and + # generate z.ml and z.mli diff --git a/patches/zarith/z_pp.pl.patch.1.4 b/patches/zarith/z_pp.pl.patch.1.4 new file mode 100644 index 0000000..cdf97ed --- /dev/null +++ b/patches/zarith/z_pp.pl.patch.1.4 @@ -0,0 +1,11 @@ +diff --git a/z_pp.pl b/z_pp.pl +--- a/z_pp.pl ++++ b/z_pp.pl +@@ -1,1 +1,3 @@ +-#!/usr/bin/perl -W ++#!/usr/bin/env perl ++ ++use warnings "all"; + + # Simple preprocessor to fix @ASM directives in z.mlp and z.mlip, and + # generate z.ml and z.mli From aecad3f6bc95706657e1c0d1720c80955aa277d5 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Thu, 23 May 2024 11:42:05 +0200 Subject: [PATCH 2/2] reconcile ocaml-variant fix-gcc10 patches --- ...ch.4.05.1+trunk => fix-gcc10.patch.4.05.1} | 0 .../fix-gcc10.patch.4.05.1+trunk+afl | 21 ------------ .../fix-gcc10.patch.4.05.1+trunk+flambda | 21 ------------ .../fix-gcc10.patch.4.05.1+trunk+fp | 21 ------------ .../fix-gcc10.patch.4.05.1+trunk+fp+flambda | 21 ------------ .../fix-gcc10.patch.4.05.1+trunk+safe-string | 21 ------------ ...ch.4.06.2+trunk => fix-gcc10.patch.4.06.2} | 0 .../fix-gcc10.patch.4.06.2+trunk+afl | 21 ------------ .../fix-gcc10.patch.4.06.2+trunk+flambda | 21 ------------ .../fix-gcc10.patch.4.06.2+trunk+fp | 21 ------------ .../fix-gcc10.patch.4.06.2+trunk+fp+flambda | 21 ------------ ...ch.4.07.2+trunk => fix-gcc10.patch.4.07.2} | 0 .../fix-gcc10.patch.4.07.2+trunk+afl | 21 ------------ ...0.patch.4.07.2+trunk+default-unsafe-string | 21 ------------ .../fix-gcc10.patch.4.07.2+trunk+flambda | 21 ------------ .../fix-gcc10.patch.4.07.2+trunk+fp | 21 ------------ .../fix-gcc10.patch.4.07.2+trunk+fp+flambda | 21 ------------ ...ch.4.08.2+trunk => fix-gcc10.patch.4.08.2} | 0 .../fix-gcc10.patch.4.08.2+trunk+afl | 34 ------------------- ...0.patch.4.08.2+trunk+default-unsafe-string | 34 ------------------- .../fix-gcc10.patch.4.08.2+trunk+flambda | 34 ------------------- .../fix-gcc10.patch.4.08.2+trunk+fp | 34 ------------------- .../fix-gcc10.patch.4.08.2+trunk+fp+flambda | 34 ------------------- 23 files changed, 464 deletions(-) rename patches/ocaml-variants/{fix-gcc10.patch.4.05.1+trunk => fix-gcc10.patch.4.05.1} (100%) delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string rename patches/ocaml-variants/{fix-gcc10.patch.4.06.2+trunk => fix-gcc10.patch.4.06.2} (100%) delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda rename patches/ocaml-variants/{fix-gcc10.patch.4.07.2+trunk => fix-gcc10.patch.4.07.2} (100%) delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda rename patches/ocaml-variants/{fix-gcc10.patch.4.08.2+trunk => fix-gcc10.patch.4.08.2} (100%) delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp delete mode 100644 patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.05.1 similarity index 100% rename from patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk rename to patches/ocaml-variants/fix-gcc10.patch.4.05.1 diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl deleted file mode 100644 index 6022cc3..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+afl +++ /dev/null @@ -1,21 +0,0 @@ -commit b3a3a9e79c310d3073b0117f81973f3b415fe316 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index e79659954..3cb87d807 100755 ---- a/configure -+++ b/configure -@@ -402,7 +402,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - byteccprivatecompopts="$gcc_warnings";; - gcc-*) -- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; -+ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - byteccprivatecompopts="$gcc_warnings";; - *) - bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda deleted file mode 100644 index 6022cc3..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+flambda +++ /dev/null @@ -1,21 +0,0 @@ -commit b3a3a9e79c310d3073b0117f81973f3b415fe316 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index e79659954..3cb87d807 100755 ---- a/configure -+++ b/configure -@@ -402,7 +402,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - byteccprivatecompopts="$gcc_warnings";; - gcc-*) -- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; -+ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - byteccprivatecompopts="$gcc_warnings";; - *) - bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp deleted file mode 100644 index 6022cc3..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp +++ /dev/null @@ -1,21 +0,0 @@ -commit b3a3a9e79c310d3073b0117f81973f3b415fe316 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index e79659954..3cb87d807 100755 ---- a/configure -+++ b/configure -@@ -402,7 +402,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - byteccprivatecompopts="$gcc_warnings";; - gcc-*) -- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; -+ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - byteccprivatecompopts="$gcc_warnings";; - *) - bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda deleted file mode 100644 index 6022cc3..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+fp+flambda +++ /dev/null @@ -1,21 +0,0 @@ -commit b3a3a9e79c310d3073b0117f81973f3b415fe316 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index e79659954..3cb87d807 100755 ---- a/configure -+++ b/configure -@@ -402,7 +402,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - byteccprivatecompopts="$gcc_warnings";; - gcc-*) -- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; -+ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - byteccprivatecompopts="$gcc_warnings";; - *) - bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string b/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string deleted file mode 100644 index 6022cc3..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.05.1+trunk+safe-string +++ /dev/null @@ -1,21 +0,0 @@ -commit b3a3a9e79c310d3073b0117f81973f3b415fe316 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index e79659954..3cb87d807 100755 ---- a/configure -+++ b/configure -@@ -402,7 +402,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - byteccprivatecompopts="$gcc_warnings";; - gcc-*) -- bytecccompopts="-O2 -fno-strict-aliasing -fwrapv"; -+ bytecccompopts="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - byteccprivatecompopts="$gcc_warnings";; - *) - bytecccompopts="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.06.2 similarity index 100% rename from patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk rename to patches/ocaml-variants/fix-gcc10.patch.4.06.2 diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl deleted file mode 100644 index e483449..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+afl +++ /dev/null @@ -1,21 +0,0 @@ -commit 003edfae7d004c9095d061517f193a2b821814e6 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 203396554..912e0214c 100755 ---- a/configure -+++ b/configure -@@ -467,7 +467,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda deleted file mode 100644 index e483449..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+flambda +++ /dev/null @@ -1,21 +0,0 @@ -commit 003edfae7d004c9095d061517f193a2b821814e6 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 203396554..912e0214c 100755 ---- a/configure -+++ b/configure -@@ -467,7 +467,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp deleted file mode 100644 index e483449..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp +++ /dev/null @@ -1,21 +0,0 @@ -commit 003edfae7d004c9095d061517f193a2b821814e6 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 203396554..912e0214c 100755 ---- a/configure -+++ b/configure -@@ -467,7 +467,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda deleted file mode 100644 index e483449..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.06.2+trunk+fp+flambda +++ /dev/null @@ -1,21 +0,0 @@ -commit 003edfae7d004c9095d061517f193a2b821814e6 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 203396554..912e0214c 100755 ---- a/configure -+++ b/configure -@@ -467,7 +467,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.07.2 similarity index 100% rename from patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk rename to patches/ocaml-variants/fix-gcc10.patch.4.07.2 diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl deleted file mode 100644 index d6c9827..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+afl +++ /dev/null @@ -1,21 +0,0 @@ -commit e0746ecf225f9928929162a9381acfe13cbe0cd2 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 1316b3c1e..74d4dc86e 100755 ---- a/configure -+++ b/configure -@@ -474,7 +474,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string deleted file mode 100644 index d6c9827..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+default-unsafe-string +++ /dev/null @@ -1,21 +0,0 @@ -commit e0746ecf225f9928929162a9381acfe13cbe0cd2 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 1316b3c1e..74d4dc86e 100755 ---- a/configure -+++ b/configure -@@ -474,7 +474,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda deleted file mode 100644 index d6c9827..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+flambda +++ /dev/null @@ -1,21 +0,0 @@ -commit e0746ecf225f9928929162a9381acfe13cbe0cd2 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 1316b3c1e..74d4dc86e 100755 ---- a/configure -+++ b/configure -@@ -474,7 +474,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp deleted file mode 100644 index d6c9827..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp +++ /dev/null @@ -1,21 +0,0 @@ -commit e0746ecf225f9928929162a9381acfe13cbe0cd2 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 1316b3c1e..74d4dc86e 100755 ---- a/configure -+++ b/configure -@@ -474,7 +474,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda deleted file mode 100644 index d6c9827..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.07.2+trunk+fp+flambda +++ /dev/null @@ -1,21 +0,0 @@ -commit e0746ecf225f9928929162a9381acfe13cbe0cd2 -Author: Anil Madhavapeddy -Date: Sun Jun 21 19:06:50 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 1316b3c1e..74d4dc86e 100755 ---- a/configure -+++ b/configure -@@ -474,7 +474,7 @@ case "$ccfamily" in - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings";; - gcc-*) -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings";; - *) - common_cflags="-O";; diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk b/patches/ocaml-variants/fix-gcc10.patch.4.08.2 similarity index 100% rename from patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk rename to patches/ocaml-variants/fix-gcc10.patch.4.08.2 diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl deleted file mode 100644 index e37b5e8..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+afl +++ /dev/null @@ -1,34 +0,0 @@ -commit 3f10a16153308f967149917585d2bc0b9c06492c -Author: Anil Madhavapeddy -Date: Sun Jun 21 18:40:27 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 9a78a4554..0c54b560b 100755 ---- a/configure -+++ b/configure -@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings" ;; #( - gcc-*) : -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings" ;; #( - msvc-*) : - common_cflags="-nologo -O2 -Gy- -MD" -diff --git a/configure.ac b/configure.ac -index f5d8a2687..775e0e2db 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -540,7 +540,7 @@ AS_CASE([$host], - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings"], - [gcc-*], -- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings"], - [msvc-*], - [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string deleted file mode 100644 index e37b5e8..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+default-unsafe-string +++ /dev/null @@ -1,34 +0,0 @@ -commit 3f10a16153308f967149917585d2bc0b9c06492c -Author: Anil Madhavapeddy -Date: Sun Jun 21 18:40:27 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 9a78a4554..0c54b560b 100755 ---- a/configure -+++ b/configure -@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings" ;; #( - gcc-*) : -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings" ;; #( - msvc-*) : - common_cflags="-nologo -O2 -Gy- -MD" -diff --git a/configure.ac b/configure.ac -index f5d8a2687..775e0e2db 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -540,7 +540,7 @@ AS_CASE([$host], - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings"], - [gcc-*], -- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings"], - [msvc-*], - [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda deleted file mode 100644 index e37b5e8..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+flambda +++ /dev/null @@ -1,34 +0,0 @@ -commit 3f10a16153308f967149917585d2bc0b9c06492c -Author: Anil Madhavapeddy -Date: Sun Jun 21 18:40:27 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 9a78a4554..0c54b560b 100755 ---- a/configure -+++ b/configure -@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings" ;; #( - gcc-*) : -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings" ;; #( - msvc-*) : - common_cflags="-nologo -O2 -Gy- -MD" -diff --git a/configure.ac b/configure.ac -index f5d8a2687..775e0e2db 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -540,7 +540,7 @@ AS_CASE([$host], - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings"], - [gcc-*], -- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings"], - [msvc-*], - [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp deleted file mode 100644 index e37b5e8..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp +++ /dev/null @@ -1,34 +0,0 @@ -commit 3f10a16153308f967149917585d2bc0b9c06492c -Author: Anil Madhavapeddy -Date: Sun Jun 21 18:40:27 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 9a78a4554..0c54b560b 100755 ---- a/configure -+++ b/configure -@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings" ;; #( - gcc-*) : -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings" ;; #( - msvc-*) : - common_cflags="-nologo -O2 -Gy- -MD" -diff --git a/configure.ac b/configure.ac -index f5d8a2687..775e0e2db 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -540,7 +540,7 @@ AS_CASE([$host], - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings"], - [gcc-*], -- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings"], - [msvc-*], - [common_cflags="-nologo -O2 -Gy- -MD" diff --git a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda b/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda deleted file mode 100644 index e37b5e8..0000000 --- a/patches/ocaml-variants/fix-gcc10.patch.4.08.2+trunk+fp+flambda +++ /dev/null @@ -1,34 +0,0 @@ -commit 3f10a16153308f967149917585d2bc0b9c06492c -Author: Anil Madhavapeddy -Date: Sun Jun 21 18:40:27 2020 +0100 - - Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build - - Signed-off-by: Anil Madhavapeddy - -diff --git a/configure b/configure -index 9a78a4554..0c54b560b 100755 ---- a/configure -+++ b/configure -@@ -12424,7 +12424,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;}; - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings" ;; #( - gcc-*) : -- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings" ;; #( - msvc-*) : - common_cflags="-nologo -O2 -Gy- -MD" -diff --git a/configure.ac b/configure.ac -index f5d8a2687..775e0e2db 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -540,7 +540,7 @@ AS_CASE([$host], - -fno-builtin-memcmp"; - internal_cflags="$gcc_warnings"], - [gcc-*], -- [common_cflags="-O2 -fno-strict-aliasing -fwrapv"; -+ [common_cflags="-O2 -fno-strict-aliasing -fwrapv -fcommon"; - internal_cflags="$gcc_warnings"], - [msvc-*], - [common_cflags="-nologo -O2 -Gy- -MD"