Move ocaml to core and upgrade to 4.13.1 (#1896)

This commit is contained in:
Thomas Crain 2022-01-13 15:28:31 -08:00 committed by GitHub
parent 53d25ff08a
commit c8a01fbd8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 162 additions and 2203 deletions

View File

@ -1,27 +0,0 @@
From bf123e43c444ff14fcb76f806d90806e4960a1a4 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 24 Jun 2014 10:00:15 +0100
Subject: [PATCH 1/5] Don't add rpaths to libraries.
---
tools/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile
index 18aead935..e374c05ee 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -153,8 +153,8 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo \
ocamlmklibconfig.ml: $(ROOTDIR)/Makefile.config Makefile
(echo 'let bindir = "$(BINDIR)"'; \
echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\
- echo 'let default_rpath = "$(RPATH)"'; \
- echo 'let mksharedlibrpath = "$(MKSHAREDLIBRPATH)"'; \
+ echo 'let default_rpath = ""'; \
+ echo 'let mksharedlibrpath = ""'; \
echo 'let toolpref = "$(TOOLPREF)"';) \
> ocamlmklibconfig.ml
--
2.25.0

View File

@ -1,43 +0,0 @@
From b32e6fc3318a2d25d7ae233a8999beb752d6131d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 26 Apr 2019 16:16:29 +0100
Subject: [PATCH 3/5] configure: Remove incorrect assumption about
cross-compiling.
See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390
---
configure.ac | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0648f0553..ad07516e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -505,10 +505,11 @@ AS_IF(
# Are we building a cross-compiler
-AS_IF(
- [test x"$host" = x"$target"],
- [cross_compiler=false],
- [cross_compiler=true])
+#AS_IF(
+# [test x"$host" = x"$target"],
+# [cross_compiler=false],
+# [cross_compiler=true])
+cross_compiler=false
# Checks for programs
@@ -970,7 +971,7 @@ AS_IF([test $arch != "none" && $arch64 ],
# Assembler
-AS_IF([test -n "$host_alias"], [toolpref="${host_alias}-"], [toolpref=""])
+#AS_IF([test -n "$host_alias"], [toolpref="${host_alias}-"], [toolpref=""])
# We first compute default values for as and aspp
# If values have been given by the user then they take precedence over
--
2.25.0

View File

@ -1,28 +0,0 @@
From 9ea729ce863396484d2e4c5a93af4b625fc5c90c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 18 Jan 2020 11:31:27 +0000
Subject: [PATCH 4/5] Remove configure from .gitattributes.
It's not a binary file.
---
.gitattributes | 4 ----
1 file changed, 4 deletions(-)
diff --git a/.gitattributes b/.gitattributes
index 9be9e33a0..5df88ab4e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -29,10 +29,6 @@
/boot/menhir/parser.ml* -diff
-# configure is declared as binary so that it doesn't get included in diffs.
-# This also means it will have the correct Unix line-endings, even on Windows.
-/configure binary
-
# 'union' merge driver just unions textual content in case of conflict
# http://krlmlr.github.io/using-gitattributes-to-avoid-merge-conflicts/
/.mailmap merge=union
--
2.25.0

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
{
"Signatures": {
"ocaml-4.10.0.tar.xz": "30734db17b609fdd1609c39a05912325c299023968a2c783e5955dd5163dfeb7"
}
}

View File

@ -0,0 +1,26 @@
From 23f2e84d360208759c7d82b7ff795770ce6cf0b2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 24 Jun 2014 10:00:15 +0100
Subject: [PATCH 1/3] Don't add rpaths to libraries.
---
utils/config.mlp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/config.mlp b/utils/config.mlp
index bbb3c5694..57d509cd0 100644
--- a/utils/config.mlp
+++ b/utils/config.mlp
@@ -55,8 +55,8 @@ let native_c_compiler =
let native_c_libraries = "%%NATIVECCLIBS%%"
let native_pack_linker = "%%PACKLD%%"
let ranlib = "%%RANLIBCMD%%"
-let default_rpath = "%%RPATH%%"
-let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%"
+let default_rpath = ""
+let mksharedlibrpath = ""
let ar = "%%ARCMD%%"
let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%%
let mkdll, mkexe, mkmaindll =
--
2.32.0

View File

@ -1,18 +1,18 @@
From 3a5dfecb2e4078bcd7388412783b50014006e7c9 Mon Sep 17 00:00:00 2001
From 9966786a7389dc6621f2bc2dce7c690c5a38b67d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:44:18 +0100
Subject: [PATCH 2/5] configure: Allow user defined C compiler flags.
Subject: [PATCH 2/3] configure: Allow user defined C compiler flags.
---
configure.ac | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configure.ac b/configure.ac
index e3e28fb6f..0648f0553 100644
index 3698c7cbf..e2a3cbea0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -590,6 +590,10 @@ AS_CASE([$host],
internal_cflags="$gcc_warnings"],
@@ -669,6 +669,10 @@ AS_CASE([$host],
internal_cflags="$cc_warnings"],
[common_cflags="-O"])])
+# Allow CFLAGS and LDFLAGS to be added.
@ -23,5 +23,4 @@ index e3e28fb6f..0648f0553 100644
# Enable SSE2 on x86 mingw to avoid using 80-bit registers.
--
2.25.0
2.32.0

View File

@ -0,0 +1,66 @@
From 5eff09224929f8fa1a2e19f9a15befd3a4a395ea Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 26 Apr 2019 16:16:29 +0100
Subject: [PATCH 3/3] configure: Remove incorrect assumption about
cross-compiling.
See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390
The error seen without this patch is:
sh: line 1: x86_64-pc-linux-gnu-as: command not found
---
configure.ac | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index e2a3cbea0..07c005f09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -560,10 +560,11 @@ AS_IF(
# Are we building a cross-compiler
-AS_IF(
- [test x"$host" = x"$target"],
- [cross_compiler=false],
- [cross_compiler=true])
+#AS_IF(
+# [test x"$host" = x"$target"],
+# [cross_compiler=false],
+# [cross_compiler=true])
+cross_compiler=false
# Checks for programs
@@ -1186,17 +1187,17 @@ AS_CASE([$arch],
# Assembler
-AS_IF([test -n "$target_alias"],
- [toolpref="${target_alias}-"
- as_target="$target"
- as_cpu="$target_cpu"],
- [AS_IF([test -n "$host_alias"],
- [toolpref="${host_alias}-"
- as_target="$host"
- as_cpu="$host_cpu"],
- [toolpref=""
- as_target="$build"
- as_cpu="$build_cpu"])])
+dnl AS_IF([test -n "$target_alias"],
+dnl [toolpref="${target_alias}-"
+dnl as_target="$target"
+dnl as_cpu="$target_cpu"],
+dnl [AS_IF([test -n "$host_alias"],
+dnl [toolpref="${host_alias}-"
+dnl as_target="$host"
+dnl as_cpu="$host_cpu"],
+dnl [toolpref=""
+dnl as_target="$build"
+dnl as_cpu="$build_cpu"])])
# Finding the assembler
# The OCaml build system distinguishes two different assemblers:
--
2.32.0

View File

@ -0,0 +1,5 @@
{
"Signatures": {
"ocaml-4.13.1.tar.xz": "931d78dfad5bf938800c7a00eb647a27bbfe465a96a8eaae858ecbdb22e6fde8"
}
}

View File

@ -1,104 +1,44 @@
# OCaml has a bytecode backend that works on anything with a C
# compiler, and a native code backend available on a subset of
# architectures. A further subset of architectures support native
# dynamic linking.
%ifarch %{ocaml_native_compiler}
%global native_compiler 1
%else
%global native_compiler 0
%endif
%ifarch %{ocaml_natdynlink}
%global natdynlink 1
%else
%global natdynlink 0
%endif
# These are all the architectures that the tests run on. The tests
# take a long time to run, so don't run them on slow machines.
%global test_arches aarch64 %{power64} x86_64
# These are the architectures for which the tests must pass otherwise
# the build will fail.
#global test_arches_required aarch64 ppc64le x86_64
%global test_arches_required NONE
# Architectures where parallel builds fail.
#global no_parallel_build_arches aarch64
#global rcver +beta1
%global rcver %{nil}
Name: ocaml
Version: 4.10.0
Release: 3%{?dist}
%global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte'
%global __ocaml_provides_opts -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte'
%global majmin %(echo %{version} | cut -d. -f1-2)
Summary: OCaml compiler and programming environment
Name: ocaml
Version: 4.13.1
Release: 1%{?dist}
License: QPL and (LGPLv2+ with exceptions)
Vendor: Microsoft Corporation
Distribution: Mariner
URL: http://www.ocaml.org
Source0: http://caml.inria.fr/pub/distrib/ocaml-4.10/ocaml-%{version}%{rcver}.tar.xz
# IMPORTANT NOTE:
#
# These patches are generated from unpacked sources stored in a
# pagure.io git repository. If you change the patches here, they will
# be OVERWRITTEN by the next update. Instead, request commit access
# to the pagure project:
#
# https://pagure.io/fedora-ocaml
#
# Current branch: fedora-32-4.10.0
#
# ALTERNATIVELY add a patch to the end of the list (leaving the
# existing patches unchanged) adding a comment to note that it should
# be incorporated into the git repo at a later time.
#
# Fedora-specific downstream patches.
URL: https://www.ocaml.org
Source0: https://caml.inria.fr/pub/distrib/%{name}-%{majmin}/%{name}-%{version}.tar.xz
Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch
Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch
Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch
Patch0004: 0004-Remove-configure-from-.gitattributes.patch
# Out of tree patch for RISC-V support.
# https://github.com/nojb/riscv-ocaml
# Resets the version number back to 4.09.0.
Patch0005: 0005-Add-riscv64-backend.patch
BuildRequires: git
BuildRequires: gcc
BuildRequires: autoconf
BuildRequires: binutils-devel
BuildRequires: ncurses-devel
BuildRequires: gdbm-devel
BuildRequires: chrpath
BuildRequires: gawk
BuildRequires: gcc
BuildRequires: gdbm-devel
BuildRequires: git
BuildRequires: make
BuildRequires: ncurses-devel
BuildRequires: perl-interpreter
BuildRequires: util-linux
BuildRequires: chrpath
# ocamlopt runs gcc to link binaries. Because Fedora includes
# hardening flags automatically, redhat-rpm-config is also required.
%if %{with_check}
BuildRequires: diffutils
%endif
# ocamlopt runs gcc to link binaries. Because Mariner includes
# hardening flags automatically, mariner-rpm-macros is also required.
Requires: gcc
Requires: redhat-rpm-config
Requires: mariner-rpm-macros
# Because we pass -c flag to ocaml-find-requires (to avoid circular
# dependencies) we also have to explicitly depend on the right version
# of ocaml-runtime.
Requires: ocaml-runtime = %{version}-%{release}
# Bundles an MD5 implementation in byterun/md5.{c,h}
Provides: bundled(md5-plumb)
Provides: ocaml(compiler) = %{version}
%global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte'
%global __ocaml_provides_opts -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte'
%description
OCaml is a high-level, strongly-typed, functional and object-oriented
programming language from the ML family of languages.
@ -108,7 +48,6 @@ and an optimizing native-code compiler), an interactive toplevel system,
parsing tools (Lex,Yacc), a replay debugger, a documentation generator,
and a comprehensive library.
%package runtime
Summary: OCaml runtime environment
Requires: util-linux
@ -121,7 +60,6 @@ programming language from the ML family of languages.
This package contains the runtime environment needed to run OCaml
bytecode.
%package source
Summary: Source code for OCaml libraries
Requires: ocaml = %{version}-%{release}
@ -129,33 +67,28 @@ Requires: ocaml = %{version}-%{release}
%description source
Source code for OCaml libraries.
%package ocamldoc
Summary: Documentation generator for OCaml
Requires: ocaml = %{version}-%{release}
Provides: ocamldoc
Provides: ocamldoc = %{version}-%{release}
%description ocamldoc
Documentation generator for OCaml.
%package docs
Summary: Documentation for OCaml
Requires: ocaml = %{version}-%{release}
%description docs
OCaml is a high-level, strongly-typed, functional and object-oriented
programming language from the ML family of languages.
This package contains man pages.
%package compiler-libs
Summary: Compiler libraries for OCaml
Requires: ocaml = %{version}-%{release}
%description compiler-libs
OCaml is a high-level, strongly-typed, functional and object-oriented
programming language from the ML family of languages.
@ -165,21 +98,12 @@ compilers, useful for the development of some OCaml applications.
Note that this exposes internal details of the OCaml compiler which
may not be portable between versions.
%prep
%autosetup -S git -n %{name}-%{version}%{rcver}
%autosetup -p1
# Patches touch configure.ac, so rebuild it:
autoconf --force
%build
%ifnarch %{no_parallel_build_arches}
make="make %{?_smp_mflags}"
%else
unset MAKEFLAGS
make=make
%endif
# We set --libdir to the unusual directory because we want OCaml to
# install its libraries and other files into a subdirectory.
#
@ -194,51 +118,41 @@ make=make
%configure \
OC_CFLAGS="$CFLAGS" \
OC_LDFLAGS="$LDFLAGS" \
%if %{with_check}
--enable-ocamltest \
%endif
--libdir=%{_libdir}/ocaml \
--host=`./build-aux/config.guess`
$make world
%if %{native_compiler}
$make opt
$make opt.opt
%endif
%check
%ifarch %{test_arches}
cd testsuite
%ifarch %{test_arches_required}
make -j1 all
%else
make -j1 all ||:
%endif
%endif
%make_build world
%make_build opt
%make_build opt.opt
%install
make install DESTDIR=$RPM_BUILD_ROOT
perl -pi -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf
%make_install
perl -pi -e "s|^%{buildroot}||" %{buildroot}%{_libdir}/ocaml/ld.conf
echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release
echo %{version} > %{buildroot}%{_libdir}/ocaml/fedora-ocaml-release
# Remove rpaths from stublibs .so files.
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so
chrpath --delete %{buildroot}%{_libdir}/ocaml/stublibs/*.so
find $RPM_BUILD_ROOT -name .ignore -delete
find %{buildroot} -type f -name "*.la" -delete -print
# Remove .cmt and .cmti files, for now. We could package them later.
# See also: http://www.ocamlpro.com/blog/2012/08/20/ocamlpro-and-4.00.0.html
find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
find %{buildroot} \( -name '*.cmt' -o -name '*.cmti' \) -a -delete -print
%check
cd testsuite
make -j1 all
%files
%doc LICENSE
%license LICENSE
%{_bindir}/ocaml
%{_bindir}/ocamlcmt
%{_bindir}/ocamldebug
%{_bindir}/ocaml-instr-graph
%{_bindir}/ocaml-instr-report
%{_bindir}/ocamlyacc
# symlink to either .byte or .opt version
@ -249,6 +163,7 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
%{_bindir}/ocamlmklib
%{_bindir}/ocamlmktop
%{_bindir}/ocamlobjinfo
%{_bindir}/ocamloptp
%{_bindir}/ocamlprof
# bytecode versions
@ -259,9 +174,9 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
%{_bindir}/ocamlmklib.byte
%{_bindir}/ocamlmktop.byte
%{_bindir}/ocamlobjinfo.byte
%{_bindir}/ocamloptp.byte
%{_bindir}/ocamlprof.byte
%if %{native_compiler}
# native code versions
%{_bindir}/ocamlc.opt
%{_bindir}/ocamlcp.opt
@ -270,52 +185,40 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
%{_bindir}/ocamlmklib.opt
%{_bindir}/ocamlmktop.opt
%{_bindir}/ocamlobjinfo.opt
%{_bindir}/ocamloptp.opt
%{_bindir}/ocamlprof.opt
%endif
%if %{native_compiler}
%{_bindir}/ocamlopt
%{_bindir}/ocamlopt.byte
%{_bindir}/ocamlopt.opt
%endif
#%{_libdir}/ocaml/addlabels
#%{_libdir}/ocaml/scrapelabels
%{_libdir}/ocaml/camlheader
%{_libdir}/ocaml/camlheader_ur
%{_libdir}/ocaml/expunge
%{_libdir}/ocaml/eventlog_metadata
%{_libdir}/ocaml/extract_crc
%{_libdir}/ocaml/ld.conf
%{_libdir}/ocaml/Makefile.config
%{_libdir}/ocaml/*.a
%if %{natdynlink}
%{_libdir}/ocaml/*.cmxs
%endif
%if %{native_compiler}
%{_libdir}/ocaml/*.cmxa
%{_libdir}/ocaml/*.cmx
%{_libdir}/ocaml/*.o
%{_libdir}/ocaml/libasmrun_shared.so
%endif
%{_libdir}/ocaml/*.mli
%{_libdir}/ocaml/libcamlrun_shared.so
%{_libdir}/ocaml/objinfo_helper
%{_libdir}/ocaml/threads/*.mli
%if %{native_compiler}
%{_libdir}/ocaml/threads/*.a
%{_libdir}/ocaml/threads/*.cmxa
%{_libdir}/ocaml/threads/*.cmx
%endif
%{_libdir}/ocaml/caml
%files runtime
%doc README.adoc LICENSE Changes
%license LICENSE
%doc README.adoc Changes
%{_bindir}/ocamlrun
%{_bindir}/ocamlrund
%{_bindir}/ocamlruni
%dir %{_libdir}/ocaml
%{_libdir}/ocaml/VERSION
%{_libdir}/ocaml/*.cmo
%{_libdir}/ocaml/*.cmi
%{_libdir}/ocaml/*.cma
@ -327,40 +230,38 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
%{_libdir}/ocaml/threads/*.cma
%{_libdir}/ocaml/fedora-ocaml-release
%files source
%doc LICENSE
%license LICENSE
%{_libdir}/ocaml/*.ml
%files ocamldoc
%doc LICENSE
%license LICENSE
%doc ocamldoc/Changes.txt
%{_bindir}/ocamldoc*
%{_libdir}/ocaml/ocamldoc
%files docs
%{_mandir}/man1/*
%{_mandir}/man3/*
%files compiler-libs
%doc LICENSE
%license LICENSE
%dir %{_libdir}/ocaml/compiler-libs
%{_libdir}/ocaml/compiler-libs/*.mli
%{_libdir}/ocaml/compiler-libs/*.cmi
%{_libdir}/ocaml/compiler-libs/*.cmo
%{_libdir}/ocaml/compiler-libs/*.cma
%if %{native_compiler}
%{_libdir}/ocaml/compiler-libs/*.a
%{_libdir}/ocaml/compiler-libs/*.cmxa
%{_libdir}/ocaml/compiler-libs/*.cmx
%{_libdir}/ocaml/compiler-libs/*.o
%endif
%changelog
* Mon Jan 10 2022 Thomas Crain <thcrain@microsoft.com> - 4.13.1-1
- Upgrade to latest upstream release and rebase relevant patches
- Remove arch-specific gating- only applies to arches Mariner does not support
- License verified
* Wed Nov 11 2020 Joe Schmitt <joschmit@microsoft.com> - 4.10.0-3
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
- Remove annobin integration.

View File

@ -14933,8 +14933,8 @@
"type": "other",
"other": {
"name": "ocaml",
"version": "4.10.0",
"downloadUrl": "http://caml.inria.fr/pub/distrib/ocaml-4.10/ocaml-4.10.0.tar.xz"
"version": "4.13.1",
"downloadUrl": "https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.1.tar.xz"
}
}
},