Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Default behaviour, for if core.autocrlf isn't set
* text=auto
text eol=lf
/ocaml-stub text eol=lf
/release text eol=lf
/itest text eol=lf
/configure text eol=lf
/mini/ocamlfind-mini text eol=lf
/tools/cmd_in_different_dirs text eol=lf
/tools/file_exists text eol=lf
/tools/safe_camlp4 text eol=lf
/tools/make-package-macosx text eol=lf
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@ on: [push, pull_request]

jobs:
build:
name: ${{ matrix.os }} - OCaml ${{ matrix.ocaml-version }}
name: ${{ matrix.os.windows_environment == '' && matrix.os.name || format('windows-latest/{0}', matrix.os.windows_environment) }} - OCaml ${{ matrix.ocaml-version }}

strategy:
fail-fast: false
# Test Linux, macOS and Windows with the oldest, LTS, and newest supported
# OCaml versions.
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
- name: macos-latest
- name: ubuntu-latest
- name: windows-latest
windows_environment: cygwin
- name: windows-latest
windows_environment: msys2
ocaml-version:
- "4.14"
- "5.4"
- "5.5"
include:
- os: ubuntu-latest
- os:
name: ubuntu-latest
ocaml-version: "3.08"

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os.name }}

steps:
- name: Checkout code
Expand All @@ -32,13 +37,17 @@ jobs:
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
windows-environment: ${{ matrix.os.windows_environment == '' && 'cygwin' || matrix.os.windows_environment }}
opam-repositories: |
default: git+https://github.com/ocaml/opam-repository.git
archive: git+https://github.com/ocaml/opam-repository-archive.git

- name: Build with make
run: |
opam exec -- ${{ runner.os == 'Windows' && 'sh ' || '' }}./configure
echo ------------
grep "[\\\\/]" Makefile.config
echo ------------
opam exec -- make all opt

- name: Build and install with opam
Expand All @@ -49,8 +58,12 @@ jobs:
OPT: ${{ matrix.ocaml-version == '3.08' && '-version' || '-config' }}
run: |
opam exec -- ocamlfind list
echo ------------
opam exec -- ocamlfind printconf
echo ------------
opam exec -- ocamlfind opt ${{ env.OPT }}
echo ------------
opam exec -- ocamlfind printconf conf | tr -d '\r' | tr '\\' '/' | xargs cat

- name: Test the toplevel plugin
run: opam exec -- ocaml .github/workflows/toplist.ml
6 changes: 6 additions & 0 deletions .github/workflows/toplist.ml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
#use "topfind";;
#list;;
#require "findlib";;
let () =
let ld_conf = Findlib.ocaml_ldconf () in
let print_line = Printf.printf " %s\n" in
Printf.printf "Reading %s\n" ld_conf;
List.iter print_line (Findlib.read_ldconf ld_conf);;
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
*.cmxs
*.a
*.so
*.exe
META

Makefile.config
Makefile.packages
findlib.conf.in
findlib.conf
ocargs.log
src/findlib/depend
Expand Down
40 changes: 7 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,14 @@ README: doc/README
.PHONY: all-config
all-config: findlib.conf

.PHONY: findlib-template
findlib-template: findlib.conf.in
USE_CYGPATH="$(USE_CYGPATH)"; \
export USE_CYGPATH; \
cat findlib.conf.in | \
$(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
if ./tools/cmd_from_same_dir ocamlopt; then \
echo 'ocamlopt="ocamlopt.opt"' >>findlib.conf; \
fi
if ./tools/cmd_from_same_dir ocamldep; then \
echo 'ocamldep="ocamldep.opt"' >>findlib.conf; \
fi
if ./tools/cmd_from_same_dir ocamldoc; then \
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
{ \
cat $<; \
./tools/cmd_in_different_dirs ocamlc || echo 'ocamlc="ocamlc.opt"'; \
./tools/cmd_in_different_dirs ocamlopt || echo 'ocamlopt="ocamlopt.opt"'; \
./tools/cmd_in_different_dirs ocamldep || echo 'ocamldep="ocamldep.opt"'; \
./tools/cmd_in_different_dirs ocamldoc || echo 'ocamldoc="ocamldoc.opt"'; \
} > $@

.PHONY: install-doc
install-doc:
Expand Down
11 changes: 3 additions & 8 deletions Makefile.config.pattern
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
# Where the OCAML core is installed:
#----------------------------------------------------------------------
OCAML_CORE_STDLIB=/usr/local/lib/ocaml
OCAML_CORE_BIN=/usr/local/bin
OCAML_CORE_MAN=/usr/local/man
OCAML_CORE_STDLIB_NATIVE=$(OCAML_CORE_STDLIB)

#----------------------------------------------------------------------
# Type of multi-threading support: either vm or posix
Expand All @@ -22,11 +21,7 @@ OCAML_THREADS=vm
# Where the site-lib directory will be
#----------------------------------------------------------------------
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
OCAML_SITELIB_NATIVE=$(OCAML_SITELIB)

#----------------------------------------------------------------------
# Where binaries and manual pages will be installed
Expand All @@ -38,6 +33,7 @@ OCAMLFIND_MAN=/usr/local/man
# The absolute location of the configuration file
#----------------------------------------------------------------------
OCAMLFIND_CONF=/usr/local/etc/ocamlfind.conf
OCAMLFIND_CONF_NATIVE=$(OCAMLFIND_CONF)

#----------------------------------------------------------------------
# Autolinking is usually on
Expand Down Expand Up @@ -70,7 +66,6 @@ INSTALL_TOPFIND=1
# installation
#----------------------------------------------------------------------
RELATIVE_PATHS=0
RELATIVE_OCAML_SITELIB=$$PREFIX/lib

#----------------------------------------------------------------------
# Whether make install should update Makefile.packages just before
Expand Down
Loading
Loading