The package rpms/ocaml-merlin.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/ocaml-merlin.git/commit/?id=f9ee3....
Change:
+%ifarch %{ix86}
Thanks.
Full change:
============
commit f9ee354c4fffa9b63a5d99dbff984b0c7da6c4c5
Author: Jerry James <loganjerry(a)gmail.com>
Date: Wed Apr 14 09:05:25 2021 -0600
Version 3.5.0.
- Fix tests on 64-bit systems with the -test-lib64 patch.
- Add -emacs patch to fix various Emacs issues.
- Add -textrel patch to fix FTBFS on i386.
- Generate autoloads for the Emacs interface.
diff --git a/.gitignore b/.gitignore
index 837a16f..30f0438 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,2 @@
-/merlin-3.2.2.tar.gz
-/merlin-3.3.1.tar.gz
-/merlin-3.3.2.tar.gz
-/merlin-3.3.3.tar.gz
-/merlin-v3.3.4-preview1.tbz
-/merlin-v3.3.4.tbz
-/merlin-3.3.7-4.11-preview1.tar.gz
+/merlin-*.tar.gz
+/merlin-*.tbz
diff --git a/ocaml-merlin-emacs.patch b/ocaml-merlin-emacs.patch
new file mode 100644
index 0000000..188461f
--- /dev/null
+++ b/ocaml-merlin-emacs.patch
@@ -0,0 +1,90 @@
+Fixes these warnings:
+
+In ac-merlin-locate:
+merlin-ac.el:142:8:Warning: merlin-locate called with 1 argument, but accepts
+ only 0
+
+In toplevel form:
+merlin-cap.el:30:1:Warning: Unused lexical argument `state'
+
+In merlin-company-backend:
+merlin-company.el:112:23:Warning: merlin-locate called with 1 argument, but
+ accepts only 0
+Iedit default key binding is C-;
+
+In toplevel form:
+merlin-iedit.el:49:1:Warning: Unused lexical argument `c'
+merlin-iedit.el:49:1:Warning: Unused lexical argument `b'
+
+In toplevel form:
+merlin-xref.el:16:1:Warning: Unused lexical argument `symbol'
+merlin-xref.el:24:1:Warning: Unused lexical argument `symbol'
+
+In end of data:
+merlin.el:1924:1:Warning: the following functions are not known to be defined:
+ first, rest
+
+--- a/emacs/merlin-ac.el 2021-04-13 02:53:39.000000000 -0600
++++ b/emacs/merlin-ac.el 2021-04-13 14:15:33.735325907 -0600
+@@ -139,7 +139,7 @@ wrong then recompute it."
+ (when (popup-hidden-p ac-menu)
+ (ac-show-menu))
+ (let ((merlin-locate-in-new-window 'always))
+- (merlin-locate (ac-selected-candidate)))
++ (merlin-locate-ident (ac-selected-candidate)))
+ (ac-show-menu)))
+
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+--- a/emacs/merlin-cap.el 2021-04-13 02:53:39.000000000 -0600
++++ b/emacs/merlin-cap.el 2021-04-13 14:18:43.383116394 -0600
+@@ -27,7 +27,7 @@ trigger useless merlin calls.")
+
+ ;; Internal functions
+
+-(defun merlin-cap--lookup (string state)
++(defun merlin-cap--lookup (string _state)
+ "Lookup the entry STRING inside the completion table."
+ (let ((ret (assoc string merlin-cap--table)))
+ (if ret (message "%s%s" (car ret) (cdr ret)))))
+--- a/emacs/merlin-company.el 2021-04-13 02:53:39.000000000 -0600
++++ b/emacs/merlin-company.el 2021-04-13 14:32:00.527211921 -0600
+@@ -109,7 +109,7 @@
+ (doc-buffer (merlin-company--doc-buffer arg))
+ (location
+ (ignore-errors
+- (let ((data (merlin-locate arg)))
++ (let ((data (merlin-locate-ident arg)))
+ (when (listp data)
+ (let ((filename (merlin-lookup 'file data (buffer-file-name)))
+ (linum (cdr (assoc 'line (assoc 'pos data)))))
+--- a/emacs/merlin-iedit.el 2021-04-13 02:53:39.000000000 -0600
++++ b/emacs/merlin-iedit.el 2021-04-13 14:19:18.000078147 -0600
+@@ -56,7 +56,7 @@
+ (if (listp r)
+ (cl-letf (((symbol-function 'iedit-printable)
#'merlin-iedit--printable)
+ ((symbol-function 'iedit-make-occurrences-overlays)
+- (lambda (a b c)
++ (lambda (a _b _c)
+ (merlin-iedit--make-occurrences-overlays a))))
+ (iedit-start r (point-min) (point-max)))
+ (message r))))))
+--- a/emacs/merlin-xref.el 2021-04-13 02:53:39.000000000 -0600
++++ b/emacs/merlin-xref.el 2021-04-13 14:19:51.431041212 -0600
+@@ -13,7 +13,7 @@
+ (goto-char loc)
+ (buffer-substring (line-beginning-position) (line-end-position))))
+
+-(cl-defmethod xref-backend-references ((_backend (eql merlin-xref)) symbol)
++(cl-defmethod xref-backend-references ((_backend (eql merlin-xref)) _symbol)
+ (mapcar
+ (lambda (loc)
+ (let ((pt (merlin-make-point (alist-get 'start loc))))
+@@ -21,7 +21,7 @@
+ (xref-make-buffer-location (current-buffer) pt))))
+ (merlin--occurrences)))
+
+-(cl-defmethod xref-backend-definitions ((_backend (eql merlin-xref)) symbol)
++(cl-defmethod xref-backend-definitions ((_backend (eql merlin-xref)) _symbol)
+ (let* ((loc (merlin-locate))
+ (file (alist-get 'file loc))
+ (pos (alist-get 'pos loc))
diff --git a/ocaml-merlin-fedora.patch b/ocaml-merlin-fedora.patch
new file mode 100644
index 0000000..c5314c4
--- /dev/null
+++ b/ocaml-merlin-fedora.patch
@@ -0,0 +1,11 @@
+--- a/tests/test-dirs/src-documentation.t/run.t 2021-04-13 03:21:51.000000000 -0600
++++ b/tests/test-dirs/src-documentation.t/run.t 2021-04-13 20:27:40.871998098 -0600
+@@ -15,7 +15,7 @@ documentation for the non-last defined v
+
+ $ $MERLIN single document -position 9:22 -filename doc.ml < doc.ml | \
+ > jq '.value'
+- " List reversal. "
++ "Needed cmti file of module 'Stdlib' to locate 'List.rev' but it
is not present"
+
+ $ dune build --root=. ./doc.exe
+
diff --git a/ocaml-merlin-test-lib64.patch b/ocaml-merlin-test-lib64.patch
new file mode 100644
index 0000000..5eadb8e
--- /dev/null
+++ b/ocaml-merlin-test-lib64.patch
@@ -0,0 +1,11 @@
+--- a/tests/merlin-wrapper-template 2021-04-13 20:22:45.919413740 -0600
++++ b/tests/merlin-wrapper-template 2021-04-13 20:23:21.039364246 -0600
+@@ -9,7 +9,7 @@ cd - > /dev/null
+ $(dirname ${BASH_SOURCE[0]})/%%OCAMLMERLIN_PATH%% "$@" \
+ | jq 'del(.timing)' \
+ | sed -e "s:$src_dir/::g" \
+- | sed -e 's:"[^"]*lib/ocaml:"lib/ocaml:g' \
++ | sed -re 's:"[^"]*lib(64)?/ocaml:"lib/ocaml:g' \
+ | sed -e
's:"/.*/\(\.opam\|opam2\)/[^/]*/\([^"]*\)":"~opam/\2":g'
\
+ | sed -e 's:\\n:\
+ :g'
diff --git a/ocaml-merlin-textrel.patch b/ocaml-merlin-textrel.patch
new file mode 100644
index 0000000..c40c7f2
--- /dev/null
+++ b/ocaml-merlin-textrel.patch
@@ -0,0 +1,12 @@
+--- a/tests/test-dirs/src-documentation.t/run.t 2021-04-13 20:28:50.866899455 -0600
++++ b/tests/test-dirs/src-documentation.t/run.t 2021-04-13 20:29:26.807854445 -0600
+@@ -18,6 +18,9 @@ documentation for the non-last defined v
+ "Needed cmti file of module 'Stdlib' to locate 'List.rev' but it
is not present"
+
+ $ dune build --root=. ./doc.exe
++ ocamlopt doc.exe
++ /usr/bin/ld: .doc.eobjs/native/doc.o: warning: relocation in read-only section
`.text'
++ /usr/bin/ld: warning: creating DT_TEXTREL in a PIE
+
+ $ $MERLIN single document -position 11:12 -filename doc.ml < doc.ml | \
+ > jq '.value'
diff --git a/ocaml-merlin.spec b/ocaml-merlin.spec
index 7fe8133..4b03659 100644
--- a/ocaml-merlin.spec
+++ b/ocaml-merlin.spec
@@ -1,46 +1,53 @@
-Name: ocaml-merlin
-Version: 3.3.7
-Release: 0.3.preview1%{?dist}.1
-Summary: Context sensitive completion for OCaml in Vim and Emacs
-
-%global libname %(echo %{name} | sed -e 's/^ocaml-//')
-%global upstream_version %{version}-4.11-preview1
-%global tag v%{upstream_version}
-
-# The entire source is MIT except src/ocaml are QPL
+%ifnarch %{ocaml_native_compiler}
+%global debug_package %{nil}
+%endif
+
+%global srcname merlin
+
+Name: ocaml-%{srcname}
+Version: 3.5.0
+Release: 1%{?dist}
+Summary: Context sensitive completion for OCaml
+
+# The entire source is MIT except:
+# - QPL: src/ocaml/driver/pparse.ml{,i}
+# - QPL: src/ocaml/preprocess/lexer_ident.mll
+# - QPL: src/ocaml/preprocess/lexer_raw.ml{i,l}
+# - LGPLv2 with exceptions: src/ocaml/preprocess/parser_raw.mly
+# - LGPLv2 with exceptions: upstream/ocaml_411/parsing/parser.mly
+# - LGPLv2 with exceptions: upstream/ocaml_412/parsing/parser.mly
+#
+# The final license is due to the linking exception on the LGPLv2 files.
License: MIT and QPL
-URL:
https://github.com/ocaml/%{libname}
-Source0:
https://github.com/ocaml/%{libname}/archive/%{tag}.tar.gz#/%{libname}-%{u...
+URL:
https://ocaml.github.io/%{srcname}/
+Source0:
https://github.com/ocaml/%{srcname}/releases/download/v%{version}/%{srcna...
+# Fix the tests to work with /usr/lib64 as well as /usr/lib
+Patch0: %{name}-test-lib64.patch
+# Fix various issues in the Emacs interface
+Patch1: %{name}-emacs.patch
+# Adapt a test that fails only on Fedora with OCaml 4.11.
+# It passes with OCaml 4.12, and on non-Fedora systems ... because the ocaml
+# .cmti files are missing?
+Patch2: %{name}-fedora.patch
+# On i386, we get extra output about text relocations
+# See
https://github.com/ocaml/ocaml/issues/9800
+Patch3: %{name}-textrel.patch
-BuildRequires: ocaml
-BuildRequires: ocaml-dune >= 1.8
-BuildRequires: ocaml-findlib-devel
-BuildRequires: ocaml-yojson-devel
+BuildRequires: emacs
+BuildRequires: emacs-tuareg
+BuildRequires: jq
+BuildRequires: ocaml >= 4.02.1
BuildRequires: ocaml-biniou-devel
+BuildRequires: ocaml-csexp-devel >= 1.2.3
+BuildRequires: ocaml-dune >= 1.8.0
BuildRequires: ocaml-easy-format-devel
-
-# For merlin-lsp
-#BuildRequires: ocaml-yojson-devel >= 1.6.0
-#BuildRequires: ocaml-menhir-devel
-#BuildRequires: ocaml-ppx-deriving-devel
-#BuildRequires: ocaml-ppx-deriving-yojson-devel
-#BuildRequires: ocaml-ppx-tools-devel
-#BuildRequires: ocaml-ppx-derivers-devel
-#BuildRequires: ocaml-migrate-parsetree-devel
-#BuildRequires: ocaml-result-devel
-
-# Required for tests, not available in Fedora
-#BuildRequires: craml
-BuildRequires: emacs
-# For byte-compile elisp
-#BuildRequires: emacs-auto-complete
-#BuildRequires: emacs-tuareg
-# The following two are not yet available in Fedora.
-# So byte compilation is disabled
-#BuildRequires: emacs-company
-#BuildRequires: emacs-iedit
+BuildRequires: ocaml-findlib-devel >= 1.6.0
+BuildRequires: ocaml-menhir
+BuildRequires: ocaml-result-devel >= 1.5
+BuildRequires: ocaml-yojson-devel >= 1.6.0
BuildRequires: vim-enhanced
-Requires: emacs-filesystem >= %{_emacs_version}
+
+Requires: emacs-filesystem >= %{?_emacs_version}%{!?_emacs_version:0}
Requires: vim-filesystem
%description
@@ -50,25 +57,45 @@ much more.
%prep
-%setup -q -n %{libname}-%{upstream_version}
+%autosetup -n %{srcname}-v%{version} -N
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%ifarch %{ix86}
+%patch3 -p1
+%endif
%build
-dune build %{_smp_mflags} --build-dir _build_%{libname} -p %{libname}
-#dune build --build-dir _build_%{libname}_lsp -p %{libname}-lsp
+dune build %{_smp_mflags}
%install
-dune install --build-dir _build_%{libname} --prefix=%{buildroot}%{_prefix}
--libdir=%{buildroot}%{_libdir}/ocaml %{libname}
-#dune install --build-dir _build_%{libname}_lsp --prefix=%{buildroot}%{_prefix}
--libdir=%{buildroot}%{_libdir}/ocaml %{libname}-lsp
+dune install --destdir=%{buildroot}
+
+# We do not want the ml files
+find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete
+
+# We install the documentation with the doc macro
+rm -fr %{buildroot}%{_prefix}/doc
# Reinstall vim files to Fedora default location
mkdir -p %{buildroot}%{vimfiles_root}
-mv %{buildroot}%{_datadir}/%{libname}/vim/* %{buildroot}%{vimfiles_root}
-rmdir %{buildroot}%{_datadir}/%{libname}/vim
-rmdir %{buildroot}%{_datadir}/%{libname}
-# Reinstall documents using %%doc later
-rm -fr %{buildroot}%{_prefix}/doc
+mv %{buildroot}%{_datadir}/%{srcname}/vim/* %{buildroot}%{vimfiles_root}
+rm -fr %{buildroot}%{_datadir}/%{srcname}
+
+# Generate the autoload file for the Emacs interface and byte compile
+# Add fake provides due to missing dependencies in F33
+cd %{buildroot}%{_emacs_sitelispdir}
+emacs -batch --no-init-file --no-site-file \
+ --eval "(progn (setq generated-autoload-file
\"$PWD/merlin-autoloads.el\" backup-inhibited t) (update-directory-autoloads
\".\"))"
+mkdir -p %{buildroot}%{_emacs_sitestartdir}
+mv merlin-autoloads.el %{buildroot}%{_emacs_sitestartdir}
+emacs -batch --no-init-file --no-site-file \
+ --eval '(progn (provide (quote auto-complete)) (provide (quote company)) (provide
(quote iedit)) (setq load-path (cons "." load-path)))' \
+ -f batch-byte-compile *.el
+cd -
+
%check
# Test requirement is not satisfied in Fedora
@@ -77,13 +104,24 @@ rm -fr %{buildroot}%{_prefix}/doc
%files
%doc doc/* featuremap.* README.md CHANGES.md
%license LICENSE
-%{_bindir}/*
-%{_libdir}/ocaml/%{libname}
-#%{_libdir}/ocaml/%{libname}-lsp
-%{_emacs_sitelispdir}/*
+%{_bindir}/dot-merlin-reader
+%{_bindir}/ocamlmerlin
+%{_bindir}/ocamlmerlin-server
+%{_libdir}/ocaml/%{srcname}/
+%{_libdir}/ocaml/dot-merlin-reader/
+%{_emacs_sitelispdir}/merlin*
+%{_emacs_sitestartdir}/merlin-autoloads.el
%{vimfiles_root}/*/*
+
%changelog
+* Wed Apr 14 2021 Jerry James <loganjerry(a)gmail.com> - 3.5.0-1
+- Version 3.5.0
+- Fix tests on 64-bit systems with the -test-lib64 patch
+- Add -emacs patch to fix various Emacs issues
+- Add -textrel patch to fix FTBFS on i386
+- Generate autoloads for the Emacs interface
+
* Wed Sep 02 2020 Richard W.M. Jones <rjones(a)redhat.com> - 3.3.7-0.3.preview1.1
- Bump release and rebuild.
diff --git a/sources b/sources
index 2e4ab57..e2426a8 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (merlin-3.3.7-4.11-preview1.tar.gz) =
4a5ba39e5353480b97e89ac9cd5c3f4bf66d2aa933920a86e695b9077d8238e4b043f4c406fc866da62839edc07a512ef2d636ddfe0a30e99f6133b74a48c629
+SHA512 (merlin-v3.5.0.tbz) =
77b89009ac57a7c4e524d1a091211dd75451fd7d342bccc37012ce0a7a488bf269631fede6cb75d345f521be7ad488416ec0282090d377225dba7e8b385bc1e2