[packages/ocaml-menhir] - up to 20210310

baggins baggins at pld-linux.org
Mon Mar 29 09:51:35 CEST 2021


commit 518d959172f5ca0343fe488c594ebcc4fb4fa4c8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Mar 29 09:50:58 2021 +0200

    - up to 20210310

 destdir.patch     | 38 ---------------------
 ocaml-menhir.spec | 99 ++++++++++++++++++++++++++++++++-----------------------
 2 files changed, 57 insertions(+), 80 deletions(-)
---
diff --git a/ocaml-menhir.spec b/ocaml-menhir.spec
index 1540f41..5235bc7 100644
--- a/ocaml-menhir.spec
+++ b/ocaml-menhir.spec
@@ -1,35 +1,34 @@
 #
 # Conditional build:
 %bcond_without	ocaml_opt	# skip building native optimized binaries (bytecode is always built)
+%bcond_without	coq		# 
 
 # not yet available on x32 (ocaml 4.02.1), update when upstream will support it
 %ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
 %undefine	with_ocaml_opt
+%undefine	with_coq
+%endif
+
+%if %{without ocaml_opt}
+%define		_enable_debug_packages	0
 %endif
 
 %define		module	menhir
 Summary:	LR(1) parser generator for the OCaml programming language
 Name:		ocaml-%{module}
-Version:	20170509
-Release:	3
+Version:	20210310
+Release:	1
 License:	GPL v2
 Group:		Libraries
-Source0:	http://gallium.inria.fr/~fpottier/menhir/%{module}-%{version}.tar.gz
-# Source0-md5:	b8ba18b5abda831cf41cd4fa65f4c51b
-Patch0:		destdir.patch
+Source0:	https://gitlab.inria.fr/fpottier/menhir/-/archive/%{version}/menhir-%{version}.tar.bz2
+# Source0-md5:	1a0388baec7a5ba7c931e074d2c322d7
 URL:		http://gallium.inria.fr/~fpottier/menhir/
+%{?with_coq:BuildRequires:	coq}
 BuildRequires:	ocaml >= 3.04-7
-BuildRequires:	ocaml-findlib
+BuildRequires:	ocaml-dune
 %requires_eq	ocaml-runtime
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		debug_package	%{nil}
-%if %{without ocaml_opt}
-%define		no_install_post_strip	1
-# no opt means no native binary, stripping bytecode breaks such programs
-%define		_enable_debug_packages	0
-%endif
-
 %description
 Menhir is a LR(1) parser generator for the OCaml programming language.
 That is, Menhir compiles LR(1) grammar specifications down to OCaml
@@ -55,60 +54,76 @@ Requires:	%{name} = %{version}-%{release}
 This package contains files needed to develop OCaml programs using
 menhir.
 
+%package -n coq-menhirlib
+Summary:	Support library for verified Coq parsers produced by Menhir
+License:	LGPLv3+
+Requires:	coq
+
+%description -n coq-menhirlib
+The Menhir parser generator, in --coq mode, can produce Coq parsers.
+These parsers must be linked against this library, which provides both
+an interpreter (which allows running the generated parser) and a
+validator (which allows verifying, at parser construction time, that
+the generated parser is correct and complete with respect to the
+grammar).
+
 %prep
 %setup -q -n %{module}-%{version}
-%patch0 -p1
 
 %build
-%{__make} all \
-	%{!?with_ocaml_opt:TARGET=byte} \
-	PREFIX=%{_prefix} \
-	USE_OCAMLFIND=true
+dune build --verbose %{?_smp_mflags}
+
+%if %{with coq}
+%{__make} -C coq-menhirlib
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
-install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
-%{__make} install \
-	%{!?with_ocaml_opt:TARGET=byte} \
-	PREFIX=%{_prefix} \
-	DESTDIR=$RPM_BUILD_ROOT
 
-# move to dir pld ocamlfind looks
-install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/menhir{Lib,Sdk}
-mv $OCAMLFIND_DESTDIR/menhirLib/META \
-	$RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/menhirLib
-cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/menhirLib/META
-directory="+menhirLib"
-EOF
+dune install \
+	--verbose \
+	--destdir=$RPM_BUILD_ROOT
 
-mv $OCAMLFIND_DESTDIR/menhirSdk/META \
-	$RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/menhirSdk
-cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/menhirSdk/META
-directory="+menhirSdk"
-EOF
+%if %{with coq}
+%{__make} -C coq-menhirlib install \
+	DESTDIR=$RPM_BUILD_ROOT
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc manual.pdf
+%doc doc/manual.pdf
 %attr(755,root,root) %{_bindir}/menhir
 %dir %{_libdir}/ocaml/%{module}*
-%dir %{_datadir}/menhir
-%{_datadir}/menhir/standard.mly
+%{_libdir}/ocaml/%{module}*/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/%{module}*/*.cmxs
+%endif
+%{_libdir}/ocaml/%{module}*/META
 %{_mandir}/man1/menhir.1*
 
 %files devel
 %defattr(644,root,root,755)
 %doc LICENSE
-%{_libdir}/ocaml/menhirLib/menhirLib.ml
 %{_libdir}/ocaml/%{module}*/*.cmi
-%{_libdir}/ocaml/%{module}*/*.cmo
+%{_libdir}/ocaml/%{module}*/*.cmt
+%{_libdir}/ocaml/%{module}*/*.cmti
 %{_libdir}/ocaml/%{module}*/*.mli
 %if %{with ocaml_opt}
 %{_libdir}/ocaml/%{module}*/*.[ao]
 %{_libdir}/ocaml/%{module}*/*.cmx
+%{_libdir}/ocaml/%{module}*/*.cmxa
+%endif
+%{_libdir}/ocaml/%{module}*/dune-package
+
+%if %{with coq}
+%files -n coq-menhirlib
+%defattr(644,root,root,755)
+%doc coq-menhirlib/CHANGES.md coq-menhirlib/README.md
+%dir %{_libdir}/ocaml/coq-menhirlib
+%{_libdir}/ocaml/coq-menhirlib/META
+%{_libdir}/ocaml/coq-menhirlib/dune-package
+%{_libdir}/coq/user-contrib/MenhirLib
 %endif
-%{_libdir}/ocaml/site-lib/%{module}*
diff --git a/destdir.patch b/destdir.patch
deleted file mode 100644
index eab884c..0000000
--- a/destdir.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- menhir-20170509/Makefile~	2017-05-09 21:26:09.000000000 +0200
-+++ menhir-20170509/Makefile	2017-06-06 19:09:55.839985076 +0200
-@@ -178,11 +178,11 @@
- 
- install:
- # Install the executable.
--	mkdir -p $(bindir)
--	install $(BUILDDIR)/menhir.$(TARGET) $(bindir)/$(MENHIREXE)
-+	mkdir -p $(DESTDIR)$(bindir)
-+	install $(BUILDDIR)/menhir.$(TARGET) $(DESTDIR)$(bindir)/$(MENHIREXE)
- # Install Menhir's standard library.
--	mkdir -p $(libdir)
--	install -m 644 $(MLYLIB) $(libdir)
-+	mkdir -p $(DESTDIR)$(libdir)
-+	install -m 644 $(MLYLIB) $(DESTDIR)$(libdir)
- # Install MenhirLib and MenhirSdk.
- 	@if `$(BUILDDIR)/menhir.$(TARGET) --suggest-ocamlfind | tr -d '\r'` ; then \
- 	  echo 'Installing MenhirLib and MenhirSdk via ocamlfind.' ; \
-@@ -193,14 +193,14 @@
- 	  rm -f META ; \
- 	else \
- 	  echo 'Installing MenhirLib and MenhirSdk manually.' ; \
--	  install -m 644 $(patsubst %,$(BUILDDIR)/%,$(MENHIRLIB)) $(libdir) ; \
--	  install -m 644 $(patsubst %,$(SDKDIR)/%,$(MENHIRSDK)) $(libdir) ; \
-+	  install -m 644 $(patsubst %,$(BUILDDIR)/%,$(MENHIRLIB)) $(DESTDIR)$(libdir) ; \
-+	  install -m 644 $(patsubst %,$(SDKDIR)/%,$(MENHIRSDK)) $(DESTDIR)$(libdir) ; \
- 	fi
- # Install the documentation, if it has been built.
- 	if [ -f manual.pdf ] ; then \
--	  mkdir -p $(docdir) $(mandir) && \
--	  cp -r $(DOCS) $(docdir) && \
--	  cp -r $(MANS) $(mandir) ; \
-+	  mkdir -p $(DESTDIR)$(docdir) $(DESTDIR)$(mandir) && \
-+	  cp -r $(DOCS) $(DESTDIR)$(docdir) && \
-+	  cp -r $(MANS) $(DESTDIR)$(mandir) ; \
- 	fi
- 
- uninstall:
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ocaml-menhir.git/commitdiff/518d959172f5ca0343fe488c594ebcc4fb4fa4c8



More information about the pld-cvs-commit mailing list