Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-findlib for openSUSE:Factory checked in at 2026-07-17 01:39:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-findlib (Old) and /work/SRC/openSUSE:Factory/.ocaml-findlib.new.24530 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-findlib" Fri Jul 17 01:39:44 2026 rev:15 rq:1365595 version:1.9.8 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-findlib/ocaml-findlib.changes 2022-06-21 16:33:10.839878808 +0200 +++ /work/SRC/openSUSE:Factory/.ocaml-findlib.new.24530/ocaml-findlib.changes 2026-07-17 01:41:49.485892668 +0200 @@ -1,0 +2,6 @@ +Tue Jul 7 07:07:07 UTC 2026 - [email protected] + +- Update to version 1.9.8 + Fix an incomaptibility with ocaml-5.2 + +------------------------------------------------------------------- @@ -267 +272,0 @@ -Wed May 18 19:12:42 UTC 2011 - [email protected] @@ -268,0 +274,2 @@ +Wed May 18 19:12:42 UTC 2011 - [email protected] + Old: ---- ocaml-findlib-1.9.5.tar.xz New: ---- ocaml-findlib-1.9.8.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-findlib.spec ++++++ --- /var/tmp/diff_new_pack.3SvEUj/_old 2026-07-17 01:41:50.085913184 +0200 +++ /var/tmp/diff_new_pack.3SvEUj/_new 2026-07-17 01:41:50.089913321 +0200 @@ -1,7 +1,7 @@ # # spec file for package ocaml-findlib # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # Copyright (c) 2010-2011 Andrew Psaltis <ampsaltis at gmail dot com> # # All modifications and additions to the file contributed by third parties @@ -18,24 +18,23 @@ Name: ocaml-findlib -Version: 1.9.5 +Version: 1.9.8 Release: 0 %{?ocaml_preserve_bytecode} Summary: Objective CAML package manager and build helper License: MIT -Group: Development/Languages/OCaml -URL: https://github.com/ocaml/ocamlfind +ExclusiveArch: aarch64 ppc64le riscv64 s390x x86_64 +URL: https://opam.ocaml.org/packages/ocamlfind/ Source0: %name-%version.tar.xz # Requires: ocaml-compiler-libs Requires: ocaml-runtime # -Provides: ocamlfind = %version +Provides: ocamlfind = %version-%release BuildRequires: ocaml BuildRequires: ocaml-ocamldoc -BuildRequires: ocaml-rpm-macros >= 20220409 +BuildRequires: ocaml-rpm-macros >= 20260707 # -BuildRoot: %_tmppath/%name-%version-build %description Findlib is a library manager for Objective Caml. It provides a @@ -45,15 +44,14 @@ libraries in programs and scripts. %package devel -Summary: Development files for ocaml-findlib -Group: Development/Languages/OCaml -Requires: %name = %version +Summary: Development files for %name +Requires: %name = %version-%release Provides: %name-camlp4 = %version-%release Obsoletes: %name-camlp4 < %version-%release %description devel -The ocaml-findlib-devel package contains libraries and signature files -for developing applications that use ocaml-findlib. +The %name-devel package contains libraries and signature files for +developing applications that use %name. %prep %setup -q @@ -77,13 +75,11 @@ %ocaml_create_file_list %files -f %name.files -%defattr(-,root,root,-) %ocaml_standard_library/ocamlfind.conf %ocaml_standard_library/topfind %_bindir/* # %files devel -f %name.files.devel -%defattr(-,root,root,-) %ocaml_standard_library/*/Makefile.config ++++++ _service ++++++ --- /var/tmp/diff_new_pack.3SvEUj/_old 2026-07-17 01:41:50.121914415 +0200 +++ /var/tmp/diff_new_pack.3SvEUj/_new 2026-07-17 01:41:50.129914689 +0200 @@ -1,7 +1,7 @@ <services> - <service name="tar_scm" mode="disabled"> + <service name="tar_scm" mode="manual"> <param name="filename">ocaml-findlib</param> - <param name="revision">19b0334c467f97328d5005511c34ac9c36235efe</param> + <param name="revision">bd9aad183f0d1c2caf3ec29e4f52bc69361f266d</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/ocaml/ocamlfind.git</param> @@ -9,10 +9,10 @@ <param name="versionrewrite-pattern">findlib-([^\+]+)(.*)</param> <param name="versionrewrite-replacement">\1</param> </service> - <service name="recompress" mode="disabled"> + <service name="recompress" mode="manual"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> - <service name="set_version" mode="disabled"/> + <service name="set_version" mode="manual"/> </services> ++++++ ocaml-findlib-1.9.5.tar.xz -> ocaml-findlib-1.9.8.tar.xz ++++++ ++++ 2019 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/.gitignore new/ocaml-findlib-1.9.8/.gitignore --- old/ocaml-findlib-1.9.5/.gitignore 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/.gitignore 2024-11-17 00:00:17.000000000 +0100 @@ -21,5 +21,6 @@ src/findlib/ocamlfind src/findlib/topfind src/findlib/topfind.ml +src/findlib/topfind.compat.in tools/extract_args/extract_args tools/extract_args/extract_args.ml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/INSTALL new/ocaml-findlib-1.9.8/INSTALL --- old/ocaml-findlib-1.9.5/INSTALL 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/INSTALL 2024-11-17 00:00:17.000000000 +0100 @@ -85,7 +85,7 @@ Note: The META files are generated from the META.in files in the same directories by sed: - sed -e 's/%%os%%/<os>/g' <more parameters...> site-lib/<name>/META.in + sed -e 's/%%findlib_version%%/<version>/g' <more parameters...> site-lib/<name>/META.in >site-lib/<name>/META You may invoke sed manually to create different META files, but this diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/Makefile new/ocaml-findlib-1.9.8/Makefile --- old/ocaml-findlib-1.9.5/Makefile 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/Makefile 2024-11-17 00:00:17.000000000 +0100 @@ -50,11 +50,13 @@ .PHONY: all-config all-config: findlib.conf -findlib.conf: findlib.conf.in +.PHONY: findlib-template +findlib-template: findlib.conf.in USE_CYGPATH="$(USE_CYGPATH)"; \ export USE_CYGPATH; \ cat findlib.conf.in | \ - $(SH) tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf + $(SH) tools/patch '@SITELIB@' '$(FINDLIB_OCAML_SITELIB)' | \ + $(SH) tools/patch '@FINDLIB_PATH@' '$(FINDLIB_PATH)' -p >findlib.conf if ./tools/cmd_from_same_dir ocamlc; then \ echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \ fi @@ -68,11 +70,26 @@ echo 'ocamldoc="ocamldoc.opt"' >>findlib.conf; \ fi +.PHONY: findlib-relative +findlib-relative: FINDLIB_OCAML_SITELIB=$(RELATIVE_OCAML_SITELIB) +findlib-relative: findlib-template + +.PHONY: findlib-absolute +findlib-absolute: FINDLIB_OCAML_SITELIB=$(OCAML_SITELIB) +findlib-absolute: findlib-template + +findlib.conf: findlib.conf.in + if [ "$(RELATIVE_PATHS)" = "true" ]; then \ + $(MAKE) findlib-relative; \ + else \ + $(MAKE) findlib-absolute; \ + fi + .PHONY: install-doc install-doc: $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAMLFIND_MAN)/man1" "$(DESTDIR)$(prefix)$(OCAMLFIND_MAN)/man3" "$(DESTDIR)$(prefix)$(OCAMLFIND_MAN)/man5" - -$(INSTALLFILE) doc/ref-man/ocamlfind.1 "$(DESTDIR)$(prefix)$(OCAMLFIND_MAN)/man1" - -$(INSTALLFILE) doc/ref-man/META.5 doc/ref-man/site-lib.5 doc/ref-man/findlib.conf.5 "$(DESTDIR)$(prefix)$(OCAMLFIND_MAN)/man5" + -$(CP) doc/ref-man/ocamlfind.1 "$(DESTDIR)$(prefix)$(OCAMLFIND_MAN)/man1" + -$(CP) doc/ref-man/META.5 doc/ref-man/site-lib.5 doc/ref-man/findlib.conf.5 "$(DESTDIR)$(prefix)$(OCAMLFIND_MAN)/man5" .PHONY: uninstall-doc uninstall-doc: @@ -102,8 +119,8 @@ .PHONY: install-meta install-meta: - for x in $(SITELIB_META); do $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x"; $(INSTALLFILE) site-lib-src/$$x/META "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x/META.tmp" && mv "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x/META.tmp" "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x/META"; done - $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/findlib"; $(INSTALLFILE) Makefile.packages "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/findlib/Makefile.packages" + for x in $(SITELIB_META); do $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x"; $(CP) site-lib-src/$$x/META "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x/META.tmp" && mv "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x/META.tmp" "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$$x/META"; done + $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/findlib"; $(CP) Makefile.packages "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/findlib/Makefile.packages" .PHONY: uninstall-meta uninstall-meta: @@ -113,7 +130,7 @@ install-config: $(INSTALLDIR) "`dirname \"$(DESTDIR)$(prefix)$(OCAMLFIND_CONF)\"`" @if [ -f "$(DESTDIR)$(prefix)$(OCAMLFIND_CONF)" ]; then echo "!!! Keeping old $(DESTDIR)$(prefix)$(OCAMLFIND_CONF) !!!"; fi - test -f "$(DESTDIR)$(prefix)$(OCAMLFIND_CONF)" || $(INSTALLFILE) findlib.conf "$(DESTDIR)$(prefix)$(OCAMLFIND_CONF)" + test -f "$(DESTDIR)$(prefix)$(OCAMLFIND_CONF)" || $(CP) findlib.conf "$(DESTDIR)$(prefix)$(OCAMLFIND_CONF)" .PHONY: uninstall-config uninstall-config: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/Makefile.config.pattern new/ocaml-findlib-1.9.8/Makefile.config.pattern --- old/ocaml-findlib-1.9.5/Makefile.config.pattern 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/Makefile.config.pattern 2024-11-17 00:00:17.000000000 +0100 @@ -24,6 +24,11 @@ OCAML_SITELIB=/usr/local/lib/ocaml/site-lib #---------------------------------------------------------------------- +# What the path setting will be +#---------------------------------------------------------------------- +FINDLIB_PATH=/usr/local/lib/ocaml/site-lib:/usr/local/lib/ocaml + +#---------------------------------------------------------------------- # Where binaries and manual pages will be installed #---------------------------------------------------------------------- OCAMLFIND_BIN=/usr/local/bin @@ -61,6 +66,13 @@ INSTALL_TOPFIND=1 #---------------------------------------------------------------------- +# Whether the config and paths are looked up relative to the +# installation +#---------------------------------------------------------------------- +RELATIVE_PATHS=0 +RELATIVE_OCAML_SITELIB=$$PREFIX/lib + +#---------------------------------------------------------------------- # Whether make install should update Makefile.packages just before # running #---------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/doc/QUICKSTART.xml new/ocaml-findlib-1.9.8/doc/QUICKSTART.xml --- old/ocaml-findlib-1.9.5/doc/QUICKSTART.xml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/doc/QUICKSTART.xml 2024-11-17 00:00:17.000000000 +0100 @@ -268,7 +268,7 @@ <p>Findlib is neither a patch of OCaml nor uses it internal features of the OCaml programming environment. It is only a convention to install software components in filesystem hierarchies, a library interpreting -this convention, and some frontend applications making the library useable for +this convention, and some frontend applications making the library usable for you.</p> <p>One important consequence is that you can only refer to those diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/doc/README.xml new/ocaml-findlib-1.9.8/doc/README.xml --- old/ocaml-findlib-1.9.5/doc/README.xml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/doc/README.xml 2024-11-17 00:00:17.000000000 +0100 @@ -110,6 +110,35 @@ <ul> <li> + <p><em>1.9.8:</em>: A few build-related fixes.</p> + </li> + + <li> + <p><em>1.9.7:</em>: Allow overriding low-level module loader + in `Fl_dynload.load_packages`. This is very useful in JSOO + where we may want to implement a `.cma` -> `.js` cache instead + of calling `Dynlink.loadfile` dynamically. (Emilio J. Gallego + Arias).</p> + <p>Fix auto-detection of -opaque (Stephen Dolan)</p> + <p>Fix linking of threads.cmxa in OCaml-5.2 (David Allsopp)</p> + <p>Improved scripts (shellcheck) (Marek Kubica)</p> + <p>Support for relocatable installations (Marek Kubica)</p> + <p>Support OCAMLOPT_SHARED (Chen Qi)</p> + <p>Avoid exception for PATH containing "." (Dmetry Bely)</p> + <p>Fixes for Windows (David Allsopp)</p> + <p>Typos in documentation (Antonin Décimo)</p> + <p>Upgrade ocamlfind for OCaml-5 (David Allsopp)</p> + </li> + + <li> + <p><em>1.9.6:</em>: Support for OCaml-5 (as far as foreseeable) + (David Allsopp).</p> + <p>Again buildable since OCaml-3.08 (David Allsopp).</p> + <p>Fix an install problem when building with a system-provided + OCaml compiler (Louis Gesbert).</p> + </li> + + <li> <p><em>1.9.5:</em>: fixes a bug in the scripting that slipped into 1.9.4</p> </li> @@ -240,7 +269,7 @@ </li> <li> - <p><em>1.5.5:</em> fixes a build problem for BSD systens</p> + <p><em>1.5.5:</em> fixes a build problem for BSD systems</p> </li> <li> @@ -500,7 +529,7 @@ packages.</p> <p>The set of predicates is extended by "package predicates" -after the dependency analysis, making conditions expressable that +after the dependency analysis, making conditions expressible that depend on whether other packages are selected.</p> <p>The "+=" operator in META files adds words to variables rather diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/doc/src/findlib.sgml new/ocaml-findlib-1.9.8/doc/src/findlib.sgml --- old/ocaml-findlib-1.9.5/doc/src/findlib.sgml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/doc/src/findlib.sgml 2024-11-17 00:00:17.000000000 +0100 @@ -181,7 +181,7 @@ generalize types of values, but can even generalize structures, i.e. types with associated operations. Third, the class construct allows us to adopt the object-oriented techniques of abstraction such -as inheritage and dynamic method lookup. +as inheritance and dynamic method lookup. </para> <para> @@ -204,7 +204,7 @@ </para> <para> -The library is also called a "package" when it is seen as a removeable +The library is also called a "package" when it is seen as a removable and replaceable set of files. Findlib requires that there is a certain directory structure; it is not possible to install the files at arbitrary places (findlib does not even maintain a file list). @@ -303,7 +303,7 @@ -package name_of_package_to_use -linkpkg program.ml", and you can refer to the named package within program.ml. If you want to turn your collection of modules into a package, you need only to write one -adminstrative file (META) containing all extra information such as +administrative file (META) containing all extra information such as required other packages. </para> @@ -366,7 +366,7 @@ <para> Historically, this kind of query was the first and only way of using -ocamlfind, and because of the similiarity to the Unix find command it +ocamlfind, and because of the similarity to the Unix find command it got its name. Finding out package locations is a basic but nethertheless important feature because it hides the details of the filesystem hierarchy. It is sufficient only to know the name of the @@ -441,7 +441,7 @@ <para>The variable "archive" denotes the files that have to be actually linked in if the package is used. This is again a list of (file) names. In contrast to the other variables, "archive" has a -condition, written in parantheses. This value of "archive" will only +condition, written in parentheses. This value of "archive" will only be used if the predicate "byte" is true; this predicate is usually given if the program is compiled to bytecode. If you have a native archive, p.cmxa, of the two modules M1 and M2, you can add another @@ -518,7 +518,7 @@ <para> As both settings for "archive" are now equally like, the extraction -mechnism chooses simply the first. The general rule is that the first +mechanism chooses simply the first. The general rule is that the first most special value is selected. </para> </sect1> @@ -605,7 +605,7 @@ M2. At the first glance, we can ignore this when describing the package, as we could always add "-package p" and "-package q" options when compiling programs using q. This solution is not optimal, as the -user of a package must have knowlege about details of the package that +user of a package must have knowledge about details of the package that should normally be hidden. When we introduced the notion of packages, one of the most important properties was that we can replace packages by improved versions. Imagine that q is replaced by q', but q' uses @@ -697,7 +697,7 @@ <para> <emphasis> Beginning with OCaml 3.00, the compiler itself has an interesting feature -called "automatic linking" that makes the following mechanism superflous in +called "automatic linking" that makes the following mechanism superfluous in most cases. Automatic linking means that it is possible to store the linker options into the cma or cmxa file such that the compiler itself knows which options are necessary. Of course, the following mechanism still works, and it @@ -1170,7 +1170,7 @@ <para> Note that such a toploop includes the code of the packages given -on the commmand line, but that it does not automatically add the +on the command line, but that it does not automatically add the package directories to the search path (in previous versions of findlib this was tried, but it never really worked). To do so, you still have to #require the packages. @@ -1324,7 +1324,7 @@ </programlisting> <para> -The names in the parantheses are called <emphasis>formal +The names in the parentheses are called <emphasis>formal predicates</emphasis> and express a condition which must hold such that the value on the right side is selected. When querying information you can specify a set of <emphasis> actual @@ -1665,7 +1665,7 @@ ) </programlisting> -Of couse, the program using both libraries must explicitly enable +Of course, the program using both libraries must explicitly enable the subpackages by mentioning "q.use_p" on the ocamlfind command line, otherwise the glue code would be omitted. </para> @@ -2091,7 +2091,7 @@ <para> This means for findlib that most of the "linkopts" attributes in META files -have become superflous: The compiler itself already knows the linker options, +have become superfluous: The compiler itself already knows the linker options, we do not need to tell the compiler the options. We could simply leave all "linkopts" attributes out. </para> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/doc/src/findlib_meta.mod new/ocaml-findlib-1.9.8/doc/src/findlib_meta.mod --- old/ocaml-findlib-1.9.5/doc/src/findlib_meta.mod 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/doc/src/findlib_meta.mod 2024-11-17 00:00:17.000000000 +0100 @@ -90,7 +90,7 @@ <para>The keyword <literal>package</literal> starts the definition of a subpackage. There must not be two such definitions with the -same name. Within the parantheses, the variable assignments and +same name. Within the parentheses, the variable assignments and additions refer to the subpackage. It is allowed that a subpackage contains further subpackages.</para> @@ -122,7 +122,7 @@ <para> The most specific assignment is selected upon a set of actual predicates, i.e. the set of predicates that are assumed to be true. -The predicates occuring in the definitions of assignments and +The predicates occurring in the definitions of assignments and additions are called formal predicates. They may be positive or negative; the latter are prepended by a '-' sign. In order to determine the value after the evaluation of the assignments, the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/doc/src/findlib_ocamlfind.mod new/ocaml-findlib-1.9.8/doc/src/findlib_ocamlfind.mod --- old/ocaml-findlib-1.9.5/doc/src/findlib_ocamlfind.mod 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/doc/src/findlib_ocamlfind.mod 2024-11-17 00:00:17.000000000 +0100 @@ -1077,7 +1077,7 @@ If there are files ending in the suffixes <literal>.so</literal> or <literal>.dll</literal>, the package directory will be added to the DLL configuration file <literal>ld.conf</literal>, such that the dynamic -loader can find the DLL. The location of this file can be overriden by +loader can find the DLL. The location of this file can be overridden by the -ldconf option. To turn this feature off, use "-ldconf ignore"; this causes that the ld.conf file is not modified. </para> @@ -1180,7 +1180,7 @@ <para> If the package directory is mentioned in the <literal>ld.conf</literal> configuration file for DLLs, it will be tried to remove this entry -from the file. The location of this file can be overriden by +from the file. The location of this file can be overridden by the -ldconf option. To turn this feature off, use "-ldconf ignore"; this causes that the ld.conf file is not modified. </para> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/doc/src/findlib_topfind.mod new/ocaml-findlib-1.9.8/doc/src/findlib_topfind.mod --- old/ocaml-findlib-1.9.5/doc/src/findlib_topfind.mod 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/doc/src/findlib_topfind.mod 2024-11-17 00:00:17.000000000 +0100 @@ -261,7 +261,7 @@ </programlisting> <para> This function causes that Topfind forgets that any package has already -been loaded. Infomation about packages linked into the toploop remain +been loaded. Information about packages linked into the toploop remain intact. The effect of this function is that all dynamically loaded packages will be loaded again when <link linkend="Topfind.load">load</link>, <link diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/findlib.conf.in new/ocaml-findlib-1.9.8/findlib.conf.in --- old/ocaml-findlib-1.9.5/findlib.conf.in 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/findlib.conf.in 2024-11-17 00:00:17.000000000 +0100 @@ -1,2 +1,2 @@ destdir="@SITELIB@" -path="@SITELIB@" +path="@FINDLIB_PATH@" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/findlib.files new/ocaml-findlib-1.9.8/findlib.files --- old/ocaml-findlib-1.9.5/findlib.files 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/findlib.files 2024-11-17 00:00:17.000000000 +0100 @@ -90,9 +90,6 @@ d site-lib-src/unix f site-lib-src/unix/META.in f site-lib-src/unix/interfaces.in -d site-lib-src/runtime_events -f site-lib-src/runtime_events/META.in -f site-lib-src/runtime_events/interfaces.in d site-lib-src/ocamlbuild f site-lib-src/ocamlbuild/META.in d site-lib-src/ocamldoc @@ -118,6 +115,7 @@ x src/findlib/findlib_config.ml x src/findlib/ocaml_args.ml x src/findlib/topfind.ml +f src/findlib/topfind.in p src/findlib/.*\.ml p src/findlib/.*\.mli p src/findlib/.*\.mll diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/mini/ocamlfind-mini new/ocaml-findlib-1.9.8/mini/ocamlfind-mini --- old/ocaml-findlib-1.9.5/mini/ocamlfind-mini 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/mini/ocamlfind-mini 2024-11-17 00:00:17.000000000 +0100 @@ -384,7 +384,7 @@ A/a enable/disable all warnings C/c enable/disable suspicious comment F/f enable/disable partially applied function - M/m enable/disable overriden methods + M/m enable/disable overridden methods P/p enable/disable partial match S/s enable/disable non-unit statement U/u enable/disable unused match case diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/opam new/ocaml-findlib-1.9.8/opam --- old/ocaml-findlib-1.9.5/opam 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/opam 2024-11-17 00:00:17.000000000 +0100 @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ocamlfind" -version: "1.9.5.git" +version: "1.9.8.git" license: "MIT" synopsis: "A library manager for OCaml" maintainer: "Thomas Gazagnaire <[email protected]>" @@ -34,6 +34,6 @@ ["install" "-m" "0755" "ocaml-stub" "%{bin}%/ocaml"] {ocaml:preinstalled} ] depends: [ - "ocaml" {>= "4.00.0"} # ocamlfind uses String.map + "ocaml" {>= "3.08.0"} ] depopts: ["graphics"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/site-lib-src/camlp4.310/META.in new/ocaml-findlib-1.9.8/site-lib-src/camlp4.310/META.in --- old/ocaml-findlib-1.9.5/site-lib-src/camlp4.310/META.in 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/site-lib-src/camlp4.310/META.in 2024-11-17 00:00:17.000000000 +0100 @@ -26,7 +26,7 @@ package "gramlib" ( requires = "camlp4.lib" version = "[distributed with Ocaml]" - description = "Compatibilty name for camlp4.lib" + description = "Compatibility name for camlp4.lib" ) # don't use camlp4.lib and camlp4.fulllib together diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/site-lib-src/runtime_events/META.in new/ocaml-findlib-1.9.8/site-lib-src/runtime_events/META.in --- old/ocaml-findlib-1.9.5/site-lib-src/runtime_events/META.in 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/site-lib-src/runtime_events/META.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -# Specifications for the "runtime_events" library: -requires = "" -description = "Runtime events" -version = "[distributed with OCaml]" -directory = "+runtime_events" -browse_interfaces = "%%interfaces%%" -archive(byte) = "runtime_events.cma" -archive(native) = "runtime_events.cmxa" -plugin(byte) = "runtime_events.cma" -plugin(native) = "runtime_events.cmxs" - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/site-lib-src/runtime_events/interfaces.in new/ocaml-findlib-1.9.8/site-lib-src/runtime_events/interfaces.in --- old/ocaml-findlib-1.9.5/site-lib-src/runtime_events/interfaces.in 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/site-lib-src/runtime_events/interfaces.in 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -runtime_events.cma diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/bytes/Makefile new/ocaml-findlib-1.9.8/src/bytes/Makefile --- old/ocaml-findlib-1.9.5/src/bytes/Makefile 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/bytes/Makefile 2024-11-17 00:00:17.000000000 +0100 @@ -6,7 +6,8 @@ include $(TOP)/Makefile.config OCAMLC = ocamlc -OCAMLOPT = ocamlopt -g +OCAMLOPT = ocamlopt $(OCAMLOPT_G) +OCAMLOPT_SHARED = $(OCAMLOPT) build: all opt @@ -16,13 +17,13 @@ opt: $(OCAMLOPT) -a -o bytes.cmxa bytes.ml if [ $(HAVE_NATDYNLINK) -gt 0 ]; then \ - $(OCAMLOPT) -shared -o bytes.cmxs bytes.cmxa; \ + $(OCAMLOPT_SHARED) -shared -o bytes.cmxs bytes.cmxa; \ fi install: all $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/bytes" - $(INSTALLFILE) META $(BYTE_FILES) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/bytes/" - for f in $(NATIVE_FILES) $(NATIVE_FILES_DYNLINK); do if [ -f "$$f" ]; then $(INSTALLFILE) $$f "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/bytes/"; fi; done + $(CP) META $(BYTE_FILES) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/bytes/" + for f in $(NATIVE_FILES) $(NATIVE_FILES_DYNLINK); do if [ -f "$$f" ]; then $(CP) $$f "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/bytes/"; fi; done uninstall: rm -rf "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/bytes" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/Makefile new/ocaml-findlib-1.9.8/src/findlib/Makefile --- old/ocaml-findlib-1.9.5/src/findlib/Makefile 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/Makefile 2024-11-17 00:00:17.000000000 +0100 @@ -14,23 +14,24 @@ # Need compiler-libs since ocaml-4.00 OCAMLC = ocamlc -I +compiler-libs -OCAMLOPT = ocamlopt -I +compiler-libs -g +OCAMLOPT = ocamlopt -I +compiler-libs $(OCAMLOPT_G) +OCAMLOPT_SHARED = $(OCAMLOPT) OCAMLDEP = ocamldep OCAMLLEX = ocamllex #CAMLP4O = camlp4 pa_o.cmo pa_op.cmo pr_o.cmo -- #CAMLP4O = camlp4 pa_o.cmo pa_op.cmo pr_dump.cmo -- -OBJECTS = findlib_config.cmo fl_split.cmo fl_metatoken.cmo fl_meta.cmo \ - fl_metascanner.cmo fl_topo.cmo fl_package_base.cmo \ - findlib.cmo fl_args.cmo fl_lint.cmo +OBJECTS = fl_compat.cmo fl_split.cmo findlib_config.cmo \ + fl_metatoken.cmo fl_meta.cmo fl_metascanner.cmo fl_topo.cmo \ + fl_package_base.cmo findlib.cmo fl_args.cmo fl_lint.cmo TOBJECTS = topfind.cmo XOBJECTS = $(OBJECTS:.cmo=.cmx) -TXOBJECTS = topfind.cmx +TXOBJECTS = $(TOBJECTS:.cmo=.cmx) OCAMLFIND_OBJECTS = ocaml_args.cmo frontend.cmo -OCAMLFIND_XOBJECTS = ocaml_args.cmx frontend.cmx +OCAMLFIND_XOBJECTS = $(OCAMLFIND_OBJECTS:.cmo=.cmx) # OCAMLFIND_ARCHIVES: set in Makefile.config OCAMLFIND_XARCHIVES = $(OCAMLFIND_ARCHIVES:.cma=.cmxa) @@ -69,13 +70,13 @@ findlib.cmxa: $(XOBJECTS) $(OCAMLOPT) -a -o findlib.cmxa $(XOBJECTS) if [ $(HAVE_NATDYNLINK) -gt 0 ]; then \ - $(OCAMLOPT) -shared -o findlib.cmxs $(XOBJECTS); \ + $(OCAMLOPT_SHARED) -shared -o findlib.cmxs $(XOBJECTS); \ fi findlib_top.cmxa: $(TXOBJECTS) $(OCAMLOPT) -a -o findlib_top.cmxa $(TXOBJECTS) if [ $(HAVE_NATDYNLINK) -gt 0 ]; then \ - $(OCAMLOPT) -shared -o findlib_top.cmxs $(TXOBJECTS); \ + $(OCAMLOPT_SHARED) -shared -o findlib_top.cmxs $(TXOBJECTS); \ fi findlib_dynload.cma: $(DYNLOAD_OBJECTS) @@ -84,7 +85,7 @@ findlib_dynload.cmxa: $(DYNLOAD_XOBJECTS) $(OCAMLOPT) -a -o findlib_dynload.cmxa $(DYNLOAD_XOBJECTS) if [ $(HAVE_NATDYNLINK) -gt 0 ]; then \ - $(OCAMLOPT) -shared -o findlib_dynload.cmxs $(DYNLOAD_XOBJECTS); \ + $(OCAMLOPT_SHARED) -shared -o findlib_dynload.cmxs $(DYNLOAD_XOBJECTS); \ fi findlib_config.ml: findlib_config.mlp $(TOP)/Makefile.config @@ -93,6 +94,7 @@ cat findlib_config.mlp | \ $(SH) $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ $(SH) $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ + $(SH) $(TOP)/tools/patch '@RELATIVE_PATHS@' '$(RELATIVE_PATHS)' | \ sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \ -e 's;@SYSTEM@;$(SYSTEM);g' \ >findlib_config.ml @@ -105,11 +107,20 @@ > topfind.ml ; \ fi -topfind: topfind_rd$(OCAML_REMOVE_DIRECTORY).p +topfind.compat.in: topfind.in + if [ "$(OCAML_REMOVE_DIRECTORY)" = "1" ]; then \ + cp $< $@; \ + else \ + sed -e '/REMOVE_DIRECTORY_BEGIN/,/REMOVE_DIRECTORY_END/ d' $< \ + > $@ ; \ + fi + +topfind: topfind.compat.in USE_CYGPATH="$(USE_CYGPATH)"; \ export USE_CYGPATH; \ - cat topfind_rd$(OCAML_REMOVE_DIRECTORY).p | \ - $(SH) $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' \ + cat topfind.compat.in | \ + $(SH) $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' | \ + $(SH) $(TOP)/tools/patch '@RELATIVE_PATHS@' '$(RELATIVE_PATHS)' \ >topfind num_top.cma: $(NUMTOP_OBJECTS) @@ -117,14 +128,14 @@ clean: rm -f *.cmi *.cmo *.cma *.cmx *.a *.lib *.o *.obj *.cmxa \ - fl_meta.ml findlib_config.ml findlib.mml topfind.ml topfind \ + fl_meta.ml findlib_config.ml topfind.ml topfind.compat.in topfind \ ocamlfind$(EXEC_SUFFIX) ocamlfind_opt$(EXEC_SUFFIX) install: all $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$(NAME)" $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAMLFIND_BIN)" - $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_CORE_STDLIB)" - test $(INSTALL_TOPFIND) -eq 0 || $(INSTALLFILE) topfind "$(DESTDIR)$(prefix)$(OCAML_CORE_STDLIB)/" + test $(INSTALL_TOPFIND) -eq 0 || $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_CORE_STDLIB)" + test $(INSTALL_TOPFIND) -eq 0 || $(CP) 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 \ findlib_config.cmi findlib_config.ml topfind.cmi topfind.mli \ @@ -133,18 +144,18 @@ fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top$(LIB_SUFFIX) findlib_top.cmxs \ findlib_dynload.cma findlib_dynload.cmxa findlib_dynload$(LIB_SUFFIX) findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi \ META` && \ - $(INSTALLFILE) $$files "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$(NAME)/" + $(CP) $$files "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$(NAME)/" f="ocamlfind$(EXEC_SUFFIX)"; { test -f ocamlfind_opt$(EXEC_SUFFIX) && f="ocamlfind_opt$(EXEC_SUFFIX)"; }; \ $(INSTALLFILE) $$f "$(DESTDIR)$(prefix)$(OCAMLFIND_BIN)/ocamlfind$(EXEC_SUFFIX)" # the following "if" block is only needed for 4.00beta2 if [ $(OCAML_REMOVE_DIRECTORY) -eq 0 -a -f "$(OCAML_CORE_STDLIB)/compiler-libs/topdirs.cmi" ]; then \ cd "$(OCAML_CORE_STDLIB)/compiler-libs/"; \ - $(INSTALLFILE) topdirs.cmi toploop.cmi "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$(NAME)/"; \ + $(CP) topdirs.cmi toploop.cmi "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/$(NAME)/"; \ fi install-num-top: $(INSTALLDIR) "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/num-top" - $(INSTALLFILE) num_top.cma num_top.cmi num_top_printers.cmi \ + $(CP) num_top.cma num_top.cmi num_top_printers.cmi \ "$(DESTDIR)$(prefix)$(OCAML_SITELIB)/num-top/" # Note: uninstall-num-top is part of the removal of the META files. @@ -160,15 +171,9 @@ # Some 'make' implementations require that .SUFFIXES must occur before # the first suffix rule. (E.g. AIX) -.SUFFIXES: .mll .cmo .cmi .cmx .ml .mli .mml +.SUFFIXES: .mll .cmo .cmi .cmx .ml .mli # .src -.mml.cmo: - $(OCAMLC) $(OPAQUE) $(OCAMLC_FLAGS) $(OCAMLFIND_OCAMLFLAGS) -g -vmthread -c -impl $< - -.mml.cmx: - $(OCAMLOPT) $(OPAQUE) $(OCAMLOPT_FLAGS) $(OCAMLFIND_OCAMLFLAGS) -thread -c -impl $< - .ml.cmx: $(OCAMLOPT) $(OPAQUE) $(OCAMLOPT_FLAGS) $(OCAMLFIND_OCAMLFLAGS) -c $< diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/findlib.ml new/ocaml-findlib-1.9.8/src/findlib/findlib.ml --- old/ocaml-findlib-1.9.5/src/findlib/findlib.ml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/findlib.ml 2024-11-17 00:00:17.000000000 +0100 @@ -3,6 +3,8 @@ * *) +open Fl_compat + module StrSet = Set.Make(String) exception No_such_package @@ -53,7 +55,7 @@ ?(ignore_dups_in_list = []) ?(stdlib = Findlib_config.ocaml_stdlib) ?(ldconf = Findlib_config.ocaml_ldconf) - ?(config = Findlib_config.config_file) + ?config ~install_dir ~meta_dir ~search_path () = @@ -67,6 +69,10 @@ `ocamlbrowser, ocamlbrowser_command; `ocamldoc, ocamldoc_command; ]; + let config = match config with + | Some config -> config + | None -> Lazy.force Findlib_config.config_file + in conf_config_file := config; conf_search_path := search_path; conf_default_location := install_dir; @@ -109,9 +115,31 @@ let auto_config_file() = let p = ( try Sys.getenv "OCAMLFIND_CONF" with Not_found -> "") in - if p = "" then Findlib_config.config_file else p + if p = "" then Lazy.force Findlib_config.config_file else p + +let path_to_relocate path = + let prefix = "$PREFIX" in + let len = String.length prefix in + match String.starts_with ~prefix path with + | false -> None + | true -> Some (String.sub path len (String.length path - len)) - +let relocate_paths paths = + let paths = + String.split_on_char Fl_split.path_separator paths + |> List.filter_map (fun path -> + match path_to_relocate path with + | None -> Some path + | Some path -> ( + match Lazy.force Findlib_config.location with + | Some install_location -> + Some (Filename.concat install_location path) + | None -> None)) + in + let sep = String.make 1 Fl_split.path_separator in + String.concat sep paths +;; + let init ?env_ocamlpath ?env_ocamlfind_destdir ?env_ocamlfind_metadir ?env_ocamlfind_commands ?env_ocamlfind_ignore_dups_in @@ -186,6 +214,7 @@ found := !found || explicit_preds; try Fl_metascanner.lookup name config_preds vars + |> relocate_paths with Not_found -> default in let config_tuple = @@ -385,15 +414,15 @@ ;; -let package_ancestors predlist pkg = +let package_ancestors preds pkg = lazy_init(); - Fl_package_base.requires predlist pkg + Fl_package_base.requires ~preds pkg ;; -let package_deep_ancestors predlist pkglist = +let package_deep_ancestors preds pkglist = lazy_init(); - Fl_package_base.requires_deeply predlist pkglist + Fl_package_base.requires_deeply ~preds pkglist ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/findlib.mli new/ocaml-findlib-1.9.8/src/findlib/findlib.mli --- old/ocaml-findlib-1.9.5/src/findlib/findlib.mli 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/findlib.mli 2024-11-17 00:00:17.000000000 +0100 @@ -25,8 +25,8 @@ type formal_pred = - [ `Pred of string (** Positive occurence of a formal predicate var *) - | `NegPred of string (** Negative occurence of a formal predicate var *) + [ `Pred of string (** Positive occurrence of a formal predicate var *) + | `NegPred of string (** Negative occurrence of a formal predicate var *) ] (** A formal predicate as it occurs in a package definition *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/findlib_config.mlp new/ocaml-findlib-1.9.8/src/findlib/findlib_config.mlp --- old/ocaml-findlib-1.9.5/src/findlib/findlib_config.mlp 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/findlib_config.mlp 2024-11-17 00:00:17.000000000 +0100 @@ -2,12 +2,101 @@ * ---------------------------------------------------------------------- * *) +open Fl_compat -let config_file = "@CONFIGFILE@";; +let ( / ) = Filename.concat + +let exists path = + match Sys.file_exists path with + | true -> Some path + | false -> None + +let findlib_conf_of_path path = + match exists (path / "etc" / "findlib.conf") with + | Some etc_path -> etc_path + | None -> path / "lib" / "findlib.conf" + +let install_dir_from_binary path = + let exe_dir = Filename.dirname path in + let install_dir = Filename.dirname exe_dir in + let config_path = findlib_conf_of_path install_dir in + match Sys.file_exists config_path with + | true -> Some install_dir + | false -> None +;; + +let find_in_path name = + match Sys.getenv_opt "PATH" with + | None -> None + | Some search_in -> ( + let paths = String.split_on_char Fl_split.path_separator search_in in + match List.find_map (fun path -> path / name |> exists) paths with + | None -> None + | Some location -> install_dir_from_binary location) +;; + +let install_dir_from_ld_library_path paths = + String.split_on_char Fl_split.path_separator paths + |> List.find_map (fun path -> + let parent = Filename.dirname path in + let parent' = Filename.dirname parent in + match Sys.file_exists (findlib_conf_of_path parent') with + | true -> Some parent' + | false -> None) +;; + +let install_dir_from_ocaml_toplevel_path = install_dir_from_binary + +let install_dir_from_opam_switch_prefix path = + match Sys.file_exists (findlib_conf_of_path path) with + | false -> None + | true -> Some path + +let default = "@CONFIGFILE@" +let fallback = Option.value ~default + +let rec try_vars = function + | [] -> None + | (var, mapper)::xs -> ( + match Sys.getenv_opt var with + | None -> try_vars xs + | Some content -> ( + match mapper content with + | None -> try_vars xs + | Some _ as found -> found)) + +(* exposed condfigure-time setting *) +let uses_relative_paths = @RELATIVE_PATHS@ + +(* the location where we assume to be installed in *) +let location = lazy ( + try_vars [ + ("OPAM_SWITCH_PREFIX", install_dir_from_opam_switch_prefix); + ("CAML_LD_LIBRARY_PATH", install_dir_from_ld_library_path); + ("OCAML_TOPLEVEL_PATH", install_dir_from_ocaml_toplevel_path); + ]) + +let findlib_conf = lazy ( + match Lazy.force location with + | None -> default + | Some location -> location + |> findlib_conf_of_path + |> exists + |> fallback) + +let config_file = lazy ( + match uses_relative_paths with + | false -> default + | true -> Lazy.force findlib_conf) + +let ocaml_has_meta_files = + let ocaml_major = + String.sub Sys.ocaml_version 0 (String.index Sys.ocaml_version '.') in + int_of_string ocaml_major >= 5;; let ocaml_stdlib = "@STDLIB@";; -let ocaml_ldconf = Filename.concat ocaml_stdlib "ld.conf";; +let ocaml_ldconf = ocaml_stdlib / "ld.conf";; let ocaml_has_autolinking = @AUTOLINK@;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/fl_compat.ml new/ocaml-findlib-1.9.8/src/findlib/fl_compat.ml --- old/ocaml-findlib-1.9.5/src/findlib/fl_compat.ml 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-findlib-1.9.8/src/findlib/fl_compat.ml 2024-11-17 00:00:17.000000000 +0100 @@ -0,0 +1,59 @@ +let ( |> ) x f = f x + +module String = struct + 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.unsafe_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 starts_with ~prefix s = + let len_s = String.length s + and len_pre = String.length prefix in + let rec aux i = + if i = len_pre then true + else if String.unsafe_get s i <> String.unsafe_get prefix i then false + else aux (i + 1) + in len_s >= len_pre && aux 0 + + include String +end + +module List = struct + let rec find_map f = function + | [] -> None + | x :: l -> + begin match f x with + | Some _ as result -> result + | None -> find_map f l + end + + let rec filter_map f = function + | [] -> [] + | x :: l -> ( + match f x with + | None -> filter_map f l + | Some v -> v :: filter_map f l) + + include List +end + +module Option = struct + let value o ~default = match o with Some v -> v | None -> default + + (* can't include Option because it was only introduced in 4.08 *) + (* include Option *) +end + +module Sys = struct + let getenv_opt s = + try Some (Sys.getenv s) + with Not_found -> None + + include Sys +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/fl_dynload.ml new/ocaml-findlib-1.9.8/src/findlib/fl_dynload.ml --- old/ocaml-findlib-1.9.5/src/findlib/fl_dynload.ml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/fl_dynload.ml 2024-11-17 00:00:17.000000000 +0100 @@ -4,7 +4,7 @@ open Printf -let load_pkg ~debug pkg = +let load_pkg ~debug ~loadfile pkg = if not (Findlib.is_recorded_package pkg) then ( if debug then eprintf "[DEBUG] Fl_dynload: about to load: %s\n%!" pkg; @@ -34,12 +34,12 @@ let files = Fl_split.in_words archive in if debug then eprintf "[DEBUG] Fl_dynload: files=%S\n%!" archive; - List.iter + List.iter (fun file -> if debug then eprintf "[DEBUG] Fl_dynload: loading %S\n%!" file; let file = Findlib.resolve_path ~base:d file in - Dynlink.loadfile file + loadfile file ) files; Findlib.record_package Findlib.Record_load pkg ) @@ -48,8 +48,8 @@ eprintf "[DEBUG] Fl_dynload: not loading: %s\n%!" pkg -let load_packages ?(debug=false) pkgs = +let load_packages ?(debug=false) ?(loadfile=Dynlink.loadfile) pkgs = let preds = Findlib.recorded_predicates() in let eff_pkglist = Findlib.package_deep_ancestors preds pkgs in - List.iter (load_pkg ~debug) eff_pkglist + List.iter (load_pkg ~debug ~loadfile) eff_pkglist diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/fl_dynload.mli new/ocaml-findlib-1.9.8/src/findlib/fl_dynload.mli --- old/ocaml-findlib-1.9.5/src/findlib/fl_dynload.mli 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/fl_dynload.mli 2024-11-17 00:00:17.000000000 +0100 @@ -2,7 +2,7 @@ (** Utilities for loading dynamically packages *) -val load_packages : ?debug:bool -> string list -> unit +val load_packages : ?debug:bool -> ?loadfile:(string -> unit) -> string list -> unit (** Load the given packages and all their dependencies dynamically. Packages already loaded or already in-core are not loaded again. The predicates are taken from {!Findlib.recorded_predicates}, which are normally the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/fl_metascanner.mli new/ocaml-findlib-1.9.8/src/findlib/fl_metascanner.mli --- old/ocaml-findlib-1.9.5/src/findlib/fl_metascanner.mli 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/fl_metascanner.mli 2024-11-17 00:00:17.000000000 +0100 @@ -8,8 +8,8 @@ open Fl_metatoken type formal_pred = - [ `Pred of string (** Positive occurence of a formal predicate var *) - | `NegPred of string (** Negative occurence of a formal predicate var *) + [ `Pred of string (** Positive occurrence of a formal predicate var *) + | `NegPred of string (** Negative occurrence of a formal predicate var *) ] type flavour = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/fl_package_base.ml new/ocaml-findlib-1.9.8/src/findlib/fl_package_base.ml --- old/ocaml-findlib-1.9.5/src/findlib/fl_package_base.ml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/fl_package_base.ml 2024-11-17 00:00:17.000000000 +0100 @@ -71,7 +71,7 @@ (* Parses the META file whose name is [meta_file]. In [package_name], the * name of the main package must be passed. [package_dir] is the * directory associated with the package by default (i.e. before - * it is overriden by the "directory" directive). + * it is overridden by the "directory" directive). * * directory_required: If true, a "directory" directive is necessary. * @@ -285,7 +285,7 @@ ;; -let add_all_relations predlist s = +let add_all_relations preds s = (* Adds all relations for the packages currently defined in [s]. Note that missing requirements are not reported immediately (we do not know here which part of the graph [s] is really accessed), and @@ -301,7 +301,7 @@ (fun p -> let pkg = p.package_name in try - let pkg_ancestors = query_requirements predlist pkg in + let pkg_ancestors = query_requirements ~preds pkg in add_relations s pkg_ancestors pkg with | No_such_package(n,reason) -> @@ -341,27 +341,27 @@ ;; -let requires ~preds:predlist package_name = +let requires ~preds package_name = (* returns names of packages required by [package_name], the fully qualified * name of the package. It is checked that the packages really exist. - * [predlist]: list of true predicates + * [preds]: list of true predicates * May raise [No_such_package] or [Package_loop]. *) - let ancestors = query_requirements predlist package_name in + let ancestors = query_requirements ~preds package_name in let store' = Fl_metastore.copy store in (* work with a copy *) add_relations store' ancestors package_name; - if List.mem "mt" predlist then fixup_thread_deps store'; + if List.mem "mt" preds then fixup_thread_deps store'; ancestors ;; -let requires_deeply ~preds:predlist package_list = +let requires_deeply ~preds package_list = (* returns names of packages required by the packages in [package_list], * either directly or indirectly. * It is checked that the packages really exist. * The list of names is sorted topologically; first comes the deepest * ancestor. - * [predlist]: list of true predicates + * [preds]: list of true predicates * - raises [Not_found] if there is no 'package' * - raises [Failure] if some of the ancestors do not exist *) @@ -372,7 +372,7 @@ match pkglist with pkg :: pkglist' -> if not(StringSet.mem pkg !pkgset) then begin - let pkg_ancestors = query_requirements predlist pkg in + let pkg_ancestors = query_requirements ~preds pkg in pkgset := StringSet.add pkg !pkgset; query_packages pkg_ancestors end; @@ -386,8 +386,8 @@ (* Now make a copy of the store, and add the relations: *) let store' = Fl_metastore.copy store in - add_all_relations predlist store'; - if List.mem "mt" predlist then fixup_thread_deps store'; + add_all_relations preds store'; + if List.mem "mt" preds then fixup_thread_deps store'; (* Finally, iterate through the graph. Note that the graph may * contain more members than required, so we have to test explicitly @@ -507,7 +507,7 @@ match package_name_comps with [_] -> (* pkg is a main package *) - ( let c = package_definitions search_path pkg.package_name in + ( let c = package_definitions ~search_path pkg.package_name in match c with [] | [_] -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/fl_package_base.mli new/ocaml-findlib-1.9.8/src/findlib/fl_package_base.mli --- old/ocaml-findlib-1.9.5/src/findlib/fl_package_base.mli 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/fl_package_base.mli 2024-11-17 00:00:17.000000000 +0100 @@ -161,7 +161,7 @@ (** Parses the META file whose name is [meta_file]. In [name], the * name of the main package must be passed. [dir] is the * directory associated with the package by default (i.e. before - * it is overriden by the "directory" directive). + * it is overridden by the "directory" directive). * * Returns the package records found in this file. The "directory" * directive is already applied. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/fl_split.ml new/ocaml-findlib-1.9.8/src/findlib/fl_split.ml --- old/ocaml-findlib-1.9.5/src/findlib/fl_split.ml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/fl_split.ml 2024-11-17 00:00:17.000000000 +0100 @@ -126,10 +126,10 @@ | '/' | '\\' -> true | _ -> false in let norm_dir_win() = - if l >= 1 && s.[0] = '/' then - Buffer.add_char b '\\' else Buffer.add_char b s.[0]; - if l >= 2 && s.[1] = '/' then - Buffer.add_char b '\\' else Buffer.add_char b s.[1]; + if l >= 1 then + if s.[0] = '/' then Buffer.add_char b '\\' else Buffer.add_char b s.[0]; + if l >= 2 then + if s.[1] = '/' then Buffer.add_char b '\\' else Buffer.add_char b s.[1]; for k = 2 to l - 1 do let c = s.[k] in if is_slash c then ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/frontend.ml new/ocaml-findlib-1.9.8/src/findlib/frontend.ml --- old/ocaml-findlib-1.9.5/src/findlib/frontend.ml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/frontend.ml 2024-11-17 00:00:17.000000000 +0100 @@ -856,7 +856,7 @@ let eff_packages = if !recursive then begin if !descendants then - Fl_package_base.package_users predicates1 packages1 + Fl_package_base.package_users ~preds:predicates1 packages1 else package_deep_ancestors predicates1 packages1 end @@ -1100,7 +1100,8 @@ predicates := "mt" :: "mt_vm" :: !predicates; | `POSIX_threads -> - pass_options := !pass_options @ [ "-thread" ]; + if not Findlib_config.ocaml_has_meta_files then + pass_options := !pass_options @ [ "-thread" ]; predicates := "mt" :: "mt_posix" :: !predicates; ); @@ -1253,7 +1254,11 @@ tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmo"); ); - let exclude_list = [ stdlibdir; threads_dir; vmthreads_dir ] in + let exclude_list = + if Findlib_config.ocaml_has_meta_files then + [ stdlibdir ] + else + [ stdlibdir; threads_dir; vmthreads_dir ] in (* Don't generate -I options for these directories because there is * also some magic in ocamlc/ocamlopt that would not work otherwise *) @@ -1311,7 +1316,8 @@ else [] in let pkg_dir = - if pkg = "threads" then (* MAGIC *) + if not Findlib_config.ocaml_has_meta_files && pkg = "threads" then + (* MAGIC for pre-5.x days *) match !threads with `None -> stdlibdir | `VM_threads -> vmthreads_dir @@ -2027,8 +2033,13 @@ then Char.unsafe_chr(Char.code c + 32) else c -let string_lowercase_ascii = - String.map char_lowercase_ascii +let string_lowercase_ascii s = + let n = String.length s in + let b = Bytes.create n in + for i = 0 to n - 1 do + Bytes.unsafe_set b i (char_lowercase_ascii (String.unsafe_get s i)) + done; + Bytes.to_string b let install_package () = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/num_top.ml new/ocaml-findlib-1.9.8/src/findlib/num_top.ml --- old/ocaml-findlib-1.9.5/src/findlib/num_top.ml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/num_top.ml 2024-11-17 00:00:17.000000000 +0100 @@ -27,6 +27,6 @@ let _ = if not (install_all ()) then begin Format.fprintf error_fmt - "Something weird appened while installing Num library printers"; + "Something weird happened while installing Num library printers"; Format.pp_print_flush error_fmt () end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/topfind.in new/ocaml-findlib-1.9.8/src/findlib/topfind.in --- old/ocaml-findlib-1.9.5/src/findlib/topfind.in 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-findlib-1.9.8/src/findlib/topfind.in 2024-11-17 00:00:17.000000000 +0100 @@ -0,0 +1,148 @@ +(* $Id$ -*- tuareg -*- *) + +(* For Ocaml-3.03 and up, so you can do: #use "topfind" and get a + * working findlib toploop. + *) + +(* To access Toploop in OCaml >= 4.00. This directory will be later removed from path if possible *) +#directory "+compiler-libs";; + +let exists path = + match Sys.file_exists path with + | true -> Some path + | false -> None +in + +let ( / ) = Filename.concat in + +let findlib_conf_of_path path = + match exists (path / "etc" / "findlib.conf") with + | Some etc_path -> etc_path + | None -> path / "lib" / "findlib.conf" +in + +let install_dir_from_opam_switch_prefix path = + match Sys.file_exists (findlib_conf_of_path path) with + | false -> None + | true -> Some path +in + +let install_dir_from_ocaml_toplevel_path path = + let exe_dir = Filename.dirname path in + let install_dir = Filename.dirname exe_dir in + let config_path = findlib_conf_of_path install_dir in + match Sys.file_exists config_path with + | true -> Some install_dir + | false -> None +in + +let fl_split_path_separator = + match Sys.os_type with + | "Unix" | "BeOS" -> ':' + | "Cygwin" -> ';' (* You might want to change this *) + | "Win32" -> ';' + | "MacOS" -> failwith "Findlib: I do not know what is the correct path separator for MacOS. If you can help me, write a mail to [email protected]" + | _ -> failwith "Findlib: unknown operating system" +in + +let string_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.unsafe_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 +in + +let rec list_find_map f = function + | [] -> None + | x :: l -> + begin match f x with + | Some _ as result -> result + | None -> list_find_map f l + end +in + +let install_dir_from_ld_library_path paths = + let v = string_split_on_char fl_split_path_separator paths in + list_find_map (fun path -> + let parent = Filename.dirname path in + let parent' = Filename.dirname parent in + match Sys.file_exists (findlib_conf_of_path parent') with + | true -> Some parent' + | false -> None) v +in + +let getenv_opt v = try Some (Sys.getenv v) with Not_found -> None in + +let rec try_vars = function + | [] -> None + | (var, mapper)::xs -> ( + match getenv_opt var with + | None -> try_vars xs + | Some content -> ( + match mapper content with + | None -> try_vars xs + | Some _ as found -> found)) +in + +let location = + match try_vars [ + ("OPAM_SWITCH_PREFIX", install_dir_from_opam_switch_prefix); + ("CAML_LD_LIBRARY_PATH", install_dir_from_ld_library_path); + ("OCAML_TOPLEVEL_PATH", install_dir_from_ocaml_toplevel_path); + ] with + | Some location -> location + | None -> "@SITELIB@" +in + +let findlib_directory = match @RELATIVE_PATHS@ with + | true -> location / "lib" / "findlib" + | false -> "@SITELIB@/findlib" +in + +let () = Topdirs.dir_directory findlib_directory in + (* OCaml-4.00 requires to use dir_directory before we load anything *) + +let exec_test s = + let l = Lexing.from_string s in + let ph = !Toploop.parse_toplevel_phrase l in + let fmt = Format.make_formatter (fun _ _ _ -> ()) (fun _ -> ()) in + try + Toploop.execute_phrase false fmt ph + with + _ -> false +in + +(* one of the few observable differences... *) +let is_native = (Gc.get ()).Gc.stack_limit = 0 in + +let suffix = if is_native then "cmxs" else "cma" in + +(* First test whether findlib_top is already loaded. If not, load it now. + * The test works by executing the toplevel phrase "Topfind.reset" and + * checking whether this causes an error. + *) +if not (exec_test "Topfind.reset;;") then ( + Topdirs.dir_load Format.err_formatter (findlib_directory / ("findlib." ^ suffix)); + Topdirs.dir_load Format.err_formatter (findlib_directory / ("findlib_top." ^ suffix))) +;; +(* phrase has to end here otherwise Topfind is not accessible *) + +(* REMOVE_DIRECTORY_BEGIN *) +(* OCaml < 4.00 do not have this so only include this code if it was detected *) +let () = Topdirs.dir_remove_directory "+compiler-libs" in +(* REMOVE_DIRECTORY_END *) + +(* The following is always executed. It is harmless if findlib was already + * initialized + *) +let is_native = (Gc.get ()).Gc.stack_limit = 0 in +let pred = if is_native then "native" else "byte" in + +Topfind.add_predicates [ pred; "toploop" ]; +Topfind.don't_load ["findlib"]; +Topfind.announce ();; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/topfind.ml.in new/ocaml-findlib-1.9.8/src/findlib/topfind.ml.in --- old/ocaml-findlib-1.9.5/src/findlib/topfind.ml.in 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/topfind.ml.in 2024-11-17 00:00:17.000000000 +0100 @@ -8,7 +8,8 @@ Findlib, hence we maintain our own list *) -let directories = ref [ Findlib.ocaml_stdlib() ];; +let ocaml_stdlib = lazy (Findlib.ocaml_stdlib ());; +let directories = ref [ ] ;; (* Note: Sys.interactive is always _true_ during toploop startup. @@ -43,7 +44,8 @@ let add_dir d = let d = Fl_split.norm_dir d in - if not (List.mem d !directories) then begin + let ocaml_stdlib = Lazy.force ocaml_stdlib in + if d <> ocaml_stdlib && not (List.mem d !directories) then begin Topdirs.dir_directory d; directories := d :: !directories; !log (d ^ ": added to search path") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/topfind_rd0.p new/ocaml-findlib-1.9.8/src/findlib/topfind_rd0.p --- old/ocaml-findlib-1.9.5/src/findlib/topfind_rd0.p 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/topfind_rd0.p 1970-01-01 01:00:00.000000000 +0100 @@ -1,40 +0,0 @@ -(* $Id$ -*- tuareg -*- *) - -(* For Ocaml-3.03 and up, so you can do: #use "topfind" and get a - * working findlib toploop. - *) - -#directory "@SITELIB@/findlib";; - (* OCaml-4.00 requires to have #directory before we load anything *) - -(* First test whether findlib_top is already loaded. If not, load it now. - * The test works by executing the toplevel phrase "Topfind.reset" and - * checking whether this causes an error. - *) -let exec_test s = - let l = Lexing.from_string s in - let ph = !Toploop.parse_toplevel_phrase l in - let fmt = Format.make_formatter (fun _ _ _ -> ()) (fun _ -> ()) in - try - Toploop.execute_phrase false fmt ph - with - _ -> false -in - -if not(exec_test "Topfind.reset;;") then ( - Topdirs.dir_load Format.err_formatter "@SITELIB@/findlib/findlib.cma"; - Topdirs.dir_load Format.err_formatter "@SITELIB@/findlib/findlib_top.cma"; -);; - -(* Old: *) -(* #load "@SITELIB@/findlib/findlib.cma";; *) -(* #load "@SITELIB@/findlib/findlib_top.cma";; *) - - -(* The following is always executed. It is harmless if findlib was already - * initialized - *) - -Topfind.add_predicates [ "byte"; "toploop" ]; -Topfind.don't_load ["findlib"]; -Topfind.announce();; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib/topfind_rd1.p new/ocaml-findlib-1.9.8/src/findlib/topfind_rd1.p --- old/ocaml-findlib-1.9.5/src/findlib/topfind_rd1.p 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib/topfind_rd1.p 1970-01-01 01:00:00.000000000 +0100 @@ -1,55 +0,0 @@ -(* $Id$ -*- tuareg -*- *) - -(* For Ocaml-3.03 and up, so you can do: #use "topfind" and get a - * working findlib toploop. - *) - -#directory "@SITELIB@/findlib";; - (* OCaml-4.00 requires to have #directory before we load anything *) - -#directory "+compiler-libs";; - (* For OCaml-4.00. This directory will be later removed from path *) - -(* First test whether findlib_top is already loaded. If not, load it now. - * The test works by executing the toplevel phrase "Topfind.reset" and - * checking whether this causes an error. - *) -let exec_test s = - let l = Lexing.from_string s in - let ph = !Toploop.parse_toplevel_phrase l in - let fmt = Format.make_formatter (fun _ _ _ -> ()) (fun _ -> ()) in - try - Toploop.execute_phrase false fmt ph - with - _ -> false -in -let is_native = - (* one of the few observable differences... *) - Gc.((get()).stack_limit) = 0 in -let suffix = - if is_native then "cmxs" else "cma" in -if not(exec_test "Topfind.reset;;") then ( - Topdirs.dir_load Format.err_formatter ("@SITELIB@/findlib/findlib." ^ suffix); - Topdirs.dir_load Format.err_formatter ("@SITELIB@/findlib/findlib_top." ^ suffix); -); -;; - -#remove_directory "+compiler-libs";; - -(* Old: *) -(* #load "@SITELIB@/findlib/findlib.cma";; *) -(* #load "@SITELIB@/findlib/findlib_top.cma";; *) - - -(* The following is always executed. It is harmless if findlib was already - * initialized - *) - -let is_native = - (* one of the few observable differences... *) - Gc.((get()).stack_limit) = 0 in -let pred = - if is_native then "native" else "byte" in -Topfind.add_predicates [ pred; "toploop" ]; -Topfind.don't_load ["findlib"]; -Topfind.announce();; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/src/findlib-toolbox/make_wizard.ml new/ocaml-findlib-1.9.8/src/findlib-toolbox/make_wizard.ml --- old/ocaml-findlib-1.9.5/src/findlib-toolbox/make_wizard.ml 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/src/findlib-toolbox/make_wizard.ml 2024-11-17 00:00:17.000000000 +0100 @@ -1324,7 +1324,7 @@ let buildexec_screen frame = add_headline frame "Build Executables"; add_para frame "You can specify the executables to build in the following \ -way. Press \"New\" and enter the name of the excutable, then add the modules \ +way. Press \"New\" and enter the name of the executable, then add the modules \ to link in the box that appears. The cma/cmxa archive from the previous \ screen is linked anyway, so its modules cannot be selected again."; add_para frame "Leave the list of executables empty if you do not want to \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ocaml-findlib-1.9.5/tools/patch new/ocaml-findlib-1.9.8/tools/patch --- old/ocaml-findlib-1.9.5/tools/patch 2022-06-12 21:43:42.000000000 +0200 +++ new/ocaml-findlib-1.9.8/tools/patch 2024-11-17 00:00:17.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh -# Usage: patch @VARIABLE@ value +# Usage: patch @VARIABLE@ value [extra-args-for-cygpath] # Environment variable USE_CYGPATH is honoured. varname="$1" @@ -8,8 +8,8 @@ if [ "${USE_CYGPATH}" = "1" ]; then #varvalue="$(echo "$varvalue" | sed -e 's;/;\\;g')" - varvalue="$(cygpath -w -l "$varvalue")" - varvalue="$(echo "$varvalue" | sed -e 's;\\;\\\\\\\\;g')" + varvalue="$(cygpath -w -l $3 "$varvalue")" + varvalue="$(echo "$varvalue" | sed -e 's;\\;\\\\\\\\;g;s/;/\\;/g')" # e.g. c:\file is transformed to c:\\\\file else case `uname` in
