[packages/ocaml-cstruct] - new - added patch to avoid stdlib-shims dependency

qboosh qboosh at pld-linux.org
Wed Jan 12 21:55:34 CET 2022


commit a47fc388fca0fd8a31989c23ffbe9a02bb323acf
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Jan 12 21:56:30 2022 +0100

    - new
    - added patch to avoid stdlib-shims dependency

 ocaml-cstruct-no-stdlib-shims.patch |  22 ++
 ocaml-cstruct.spec                  | 410 ++++++++++++++++++++++++++++++++++++
 2 files changed, 432 insertions(+)
---
diff --git a/ocaml-cstruct.spec b/ocaml-cstruct.spec
new file mode 100644
index 0000000..747d1cf
--- /dev/null
+++ b/ocaml-cstruct.spec
@@ -0,0 +1,410 @@
+#
+# Conditional build:
+%bcond_without	ocaml_opt	# native optimized binaries (bytecode is always built)
+
+# 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
+%endif
+
+Summary:	Access C-like structures directly from OCaml
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla
+Name:		ocaml-cstruct
+Version:	6.0.1
+Release:	1
+License:	ISC
+Group:		Libraries
+#Source0Download: https://github.com/mirage/ocaml-cstruct/releases
+Source0:	https://github.com/mirage/ocaml-cstruct/releases/download/v%{version}/cstruct-v%{version}.tbz
+# Source0-md5:	2c44b1381f1f7295a86be9e0f8aeab4b
+Patch0:		%{name}-no-stdlib-shims.patch
+URL:		https://github.com/mirage/ocaml-cstruct
+BuildRequires:	ocaml >= 1:4.07.0
+BuildRequires:	ocaml-async_kernel-devel >= 0.9.0
+BuildRequires:	ocaml-async_unix-devel >= 0.9.0
+BuildRequires:	ocaml-bigarray-compat-devel
+BuildRequires:	ocaml-core_kernel-devel >= 0.9.0
+BuildRequires:	ocaml-dune >= 2.0.0
+BuildRequires:	ocaml-lwt-devel
+BuildRequires:	ocaml-ppxlib-devel >= 0.16.0
+BuildRequires:	ocaml-sexplib-devel >= 0.9.0
+%requires_eq	ocaml-runtime
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Cstruct is a library and syntax extension to make it easier to access
+C-like structures directly from OCaml. It supports both reading and
+writing to these structures, and they are accessed via the Bigarray
+module.
+
+This package contains files needed to run bytecode executables using
+cstruct library.
+
+%description -l pl.UTF-8
+Cstruct to biblioteka i rozszerzenie składni ułatwiające dostęp do
+struktur w stylu C bezpośrednio z OCamla. Obsługuje zarówno odczyt,
+jak i zapis do takich struktur; dostęp jest realizowany poprzez moduł
+Bigarray.
+
+Pakiet ten zawiera binaria potrzebne do uruchamiania programów
+używających biblioteki cstruct.
+
+%package devel
+Summary:	Access C-like structures directly from OCaml - development part
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - cześć programistyczna
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+%requires_eq	ocaml
+Requires:	ocaml-bigarray-compat-devel
+
+%description devel
+This package contains files needed to develop OCaml programs using
+cstruct library.
+
+%description devel -l pl.UTF-8
+Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu
+używających biblioteki cstruct.
+
+%package async
+Summary:	Access C-like structures directly from OCaml - async interface
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs async
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	ocaml-async_unix >= 0.9.0
+Requires:	ocaml-core_kernel >= 0.9.0
+
+%description async
+Access C-like structures directly from OCaml - async interface.
+
+This package contains files needed to run bytecode executables using
+cstruct-async library.
+
+%description async -l pl.UTF-8
+Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs async.
+
+Pakiet ten zawiera binaria potrzebne do uruchamiania programów
+używających biblioteki cstruct-async.
+
+%package async-devel
+Summary:	Access C-like structures directly from OCaml - async interface, development part
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs async, cześć programistyczna
+Group:		Development/Libraries
+Requires:	%{name}-async = %{version}-%{release}
+Requires:	%{name}-devel = %{version}-%{release}
+%requires_eq	ocaml
+Requires:	ocaml-async_kernel-devel >= 0.9.0
+Requires:	ocaml-async_core-devel >= 0.9.0
+Requires:	ocaml-core_kernel-devel >= 0.9.0
+
+%description async-devel
+This package contains files needed to develop OCaml programs using
+cstruct-async library.
+
+%description async-devel -l pl.UTF-8
+Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu
+używających biblioteki cstruct-async.
+
+%package lwt
+Summary:	Access C-like structures directly from OCaml - lwt interface
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs lwt
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	ocaml-lwt
+
+%description lwt
+Access C-like structures directly from OCaml - lwt interface.
+
+This package contains files needed to run bytecode executables using
+cstruct-lwt library.
+
+%description lwt -l pl.UTF-8
+Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs lwt.
+
+Pakiet ten zawiera binaria potrzebne do uruchamiania programów
+używających biblioteki cstruct-lwt.
+
+%package lwt-devel
+Summary:	Access C-like structures directly from OCaml - lwt interface, development part
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs lwt, cześć programistyczna
+Group:		Development/Libraries
+Requires:	%{name}-lwt = %{version}-%{release}
+Requires:	%{name}-devel = %{version}-%{release}
+%requires_eq	ocaml
+Requires:	ocaml-lwt-devel
+
+%description lwt-devel
+This package contains files needed to develop OCaml programs using
+cstruct-lwt library.
+
+%description lwt-devel -l pl.UTF-8
+Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu
+używających biblioteki cstruct-lwt.
+
+%package sexp
+Summary:	S-expression serializers for C-like structures
+Summary(pl.UTF-8):	Serializacja do S-wyrażeń dla struktur w stylu C bezpośrednio z OCamla
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description sexp
+S-expression serializers for C-like structures.
+
+This package contains files needed to run bytecode executables using
+cstruct-sexp library.
+
+%description sexp -l pl.UTF-8
+Serializacja do S-wyrażeń dla struktur w stylu C bezpośrednio z
+OCamla.
+
+Pakiet ten zawiera binaria potrzebne do uruchamiania programów
+używających biblioteki cstruct-sexp.
+
+%package sexp-devel
+Summary:	S-expression serializers for C-like structures - development part
+Summary(pl.UTF-8):	Serializacja do S-wyrażeń dla struktur w stylu C bezpośrednio z OCamla - cześć programistyczna
+Group:		Development/Libraries
+Requires:	%{name}-sexp = %{version}-%{release}
+Requires:	%{name}-devel = %{version}-%{release}
+%requires_eq	ocaml
+Requires:	ocaml-sexplib-devel
+
+%description sexp-devel
+This package contains files needed to develop OCaml programs using
+cstruct-sexp library.
+
+%description sexp-devel -l pl.UTF-8
+Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu
+używających biblioteki cstruct-sexp.
+
+%package unix
+Summary:	Access C-like structures directly from OCaml - unix interface
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs unix
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description unix
+Access C-like structures directly from OCaml - unix interface.
+
+This package contains files needed to run bytecode executables using
+cstruct-unix library.
+
+%description unix -l pl.UTF-8
+Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs unix.
+
+Pakiet ten zawiera binaria potrzebne do uruchamiania programów
+używających biblioteki cstruct-unix.
+
+%package unix-devel
+Summary:	Access C-like structures directly from OCaml - unix interface, development part
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs unix, cześć programistyczna
+Group:		Development/Libraries
+Requires:	%{name}-unix = %{version}-%{release}
+Requires:	%{name}-devel = %{version}-%{release}
+%requires_eq	ocaml
+
+%description unix-devel
+This package contains files needed to develop OCaml programs using
+cstruct-unix library.
+
+%description unix-devel -l pl.UTF-8
+Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu
+używających biblioteki cstruct-unix.
+
+%package -n ocaml-ppx_cstruct
+Summary:	Access C-like structures directly from OCaml - ppx interface
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs ppx
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description -n ocaml-ppx_cstruct
+Access C-like structures directly from OCaml - ppx interface.
+
+This package contains files needed to run bytecode executables using
+ppx_cstruct library.
+
+%description -n ocaml-ppx_cstruct -l pl.UTF-8
+Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs ppx.
+
+Pakiet ten zawiera binaria potrzebne do uruchamiania programów
+używających biblioteki ppx_cstruct.
+
+%package -n ocaml-ppx_cstruct-devel
+Summary:	Access C-like structures directly from OCaml - unix interface, development part
+Summary(pl.UTF-8):	Dostęp do struktur w stylu C bezpośrednio z OCamla - interfejs unix, cześć programistyczna
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+Requires:	ocaml-ppx_cstruct-devel = %{version}-%{release}
+Requires:	ocaml-ppxlib-devel >= 0.16.0
+Requires:	ocaml-sexplib-devel >= 0.9.0
+%requires_eq	ocaml
+
+%description -n ocaml-ppx_cstruct-devel
+This package contains files needed to develop OCaml programs using
+ppx_cstruct library.
+
+%description -n ocaml-ppx_cstruct-devel -l pl.UTF-8
+Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu
+używających biblioteki ppx_cstruct.
+
+%prep
+%setup -q -n cstruct-v%{version}
+%patch0 -p1
+
+%build
+dune build @install --verbose
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+dune install --destdir=$RPM_BUILD_ROOT
+
+# sources
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/{cstruct,cstruct-*,ppx_cstruct}/*.ml
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc/{cstruct,cstruct-*,ppx_cstruct}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES.md LICENSE.md README.md
+%dir %{_libdir}/ocaml/cstruct
+%{_libdir}/ocaml/cstruct/META
+%{_libdir}/ocaml/cstruct/cstruct.js
+%{_libdir}/ocaml/cstruct/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/cstruct/*.cmxs
+%endif
+%attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcstruct_stubs.so
+
+%files devel
+%defattr(644,root,root,755)
+%{_libdir}/ocaml/cstruct/libcstruct_stubs.a
+%{_libdir}/ocaml/cstruct/*.cmi
+%{_libdir}/ocaml/cstruct/*.cmt
+%{_libdir}/ocaml/cstruct/*.cmti
+%{_libdir}/ocaml/cstruct/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/cstruct/cstruct.a
+%{_libdir}/ocaml/cstruct/*.cmx
+%{_libdir}/ocaml/cstruct/*.cmxa
+%endif
+%{_libdir}/ocaml/cstruct/dune-package
+%{_libdir}/ocaml/cstruct/opam
+
+%files async
+%defattr(644,root,root,755)
+%dir %{_libdir}/ocaml/cstruct-async
+%{_libdir}/ocaml/cstruct-async/META
+%{_libdir}/ocaml/cstruct-async/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/cstruct-async/*.cmxs
+%endif
+
+%files async-devel
+%defattr(644,root,root,755)
+%{_libdir}/ocaml/cstruct-async/*.cmi
+%{_libdir}/ocaml/cstruct-async/*.cmt
+%{_libdir}/ocaml/cstruct-async/*.cmti
+%{_libdir}/ocaml/cstruct-async/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/cstruct-async/async_cstruct.a
+%{_libdir}/ocaml/cstruct-async/*.cmx
+%{_libdir}/ocaml/cstruct-async/*.cmxa
+%endif
+%{_libdir}/ocaml/cstruct-async/dune-package
+%{_libdir}/ocaml/cstruct-async/opam
+
+%files lwt
+%defattr(644,root,root,755)
+%dir %{_libdir}/ocaml/cstruct-lwt
+%{_libdir}/ocaml/cstruct-lwt/META
+%{_libdir}/ocaml/cstruct-lwt/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/cstruct-lwt/*.cmxs
+%endif
+
+%files lwt-devel
+%defattr(644,root,root,755)
+%{_libdir}/ocaml/cstruct-lwt/*.cmi
+%{_libdir}/ocaml/cstruct-lwt/*.cmt
+%{_libdir}/ocaml/cstruct-lwt/*.cmti
+%{_libdir}/ocaml/cstruct-lwt/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/cstruct-lwt/cstruct_lwt.a
+%{_libdir}/ocaml/cstruct-lwt/*.cmx
+%{_libdir}/ocaml/cstruct-lwt/*.cmxa
+%endif
+%{_libdir}/ocaml/cstruct-lwt/dune-package
+%{_libdir}/ocaml/cstruct-lwt/opam
+
+%files sexp
+%defattr(644,root,root,755)
+%dir %{_libdir}/ocaml/cstruct-sexp
+%{_libdir}/ocaml/cstruct-sexp/META
+%{_libdir}/ocaml/cstruct-sexp/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/cstruct-sexp/*.cmxs
+%endif
+
+%files sexp-devel
+%defattr(644,root,root,755)
+%{_libdir}/ocaml/cstruct-sexp/*.cmi
+%{_libdir}/ocaml/cstruct-sexp/*.cmt
+%{_libdir}/ocaml/cstruct-sexp/*.cmti
+%{_libdir}/ocaml/cstruct-sexp/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/cstruct-sexp/cstruct_sexp.a
+%{_libdir}/ocaml/cstruct-sexp/*.cmx
+%{_libdir}/ocaml/cstruct-sexp/*.cmxa
+%endif
+%{_libdir}/ocaml/cstruct-sexp/dune-package
+%{_libdir}/ocaml/cstruct-sexp/opam
+
+%files unix
+%defattr(644,root,root,755)
+%dir %{_libdir}/ocaml/cstruct-unix
+%{_libdir}/ocaml/cstruct-unix/META
+%{_libdir}/ocaml/cstruct-unix/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/cstruct-unix/*.cmxs
+%endif
+
+%files unix-devel
+%defattr(644,root,root,755)
+%{_libdir}/ocaml/cstruct-unix/*.cmi
+%{_libdir}/ocaml/cstruct-unix/*.cmt
+%{_libdir}/ocaml/cstruct-unix/*.cmti
+%{_libdir}/ocaml/cstruct-unix/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/cstruct-unix/cstruct_unix.a
+%{_libdir}/ocaml/cstruct-unix/*.cmx
+%{_libdir}/ocaml/cstruct-unix/*.cmxa
+%endif
+%{_libdir}/ocaml/cstruct-unix/dune-package
+%{_libdir}/ocaml/cstruct-unix/opam
+
+%files -n ocaml-ppx_cstruct
+%defattr(644,root,root,755)
+%dir %{_libdir}/ocaml/ppx_cstruct
+%attr(755,root,root) %{_libdir}/ocaml/ppx_cstruct/ppx.exe
+%{_libdir}/ocaml/ppx_cstruct/META
+%{_libdir}/ocaml/ppx_cstruct/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/ppx_cstruct/*.cmxs
+%endif
+
+%files -n ocaml-ppx_cstruct-devel
+%defattr(644,root,root,755)
+%{_libdir}/ocaml/ppx_cstruct/*.cmi
+%{_libdir}/ocaml/ppx_cstruct/*.cmt
+%{_libdir}/ocaml/ppx_cstruct/*.cmti
+%{_libdir}/ocaml/ppx_cstruct/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/ppx_cstruct/ppx_cstruct.a
+%{_libdir}/ocaml/ppx_cstruct/*.cmx
+%{_libdir}/ocaml/ppx_cstruct/*.cmxa
+%endif
+%{_libdir}/ocaml/ppx_cstruct/dune-package
+%{_libdir}/ocaml/ppx_cstruct/opam
diff --git a/ocaml-cstruct-no-stdlib-shims.patch b/ocaml-cstruct-no-stdlib-shims.patch
new file mode 100644
index 0000000..08f7ded
--- /dev/null
+++ b/ocaml-cstruct-no-stdlib-shims.patch
@@ -0,0 +1,22 @@
+--- cstruct-v6.0.1/ppx_cstruct.opam.orig	2021-06-25 15:24:26.000000000 +0200
++++ cstruct-v6.0.1/ppx_cstruct.opam	2022-01-02 19:41:04.677361133 +0100
+@@ -27,7 +27,6 @@ depends: [
+   "cstruct-sexp" {with-test}
+   "cppo" {with-test}
+   "cstruct-unix" {with-test & =version}
+-  "stdlib-shims"
+   "ocaml-migrate-parsetree" {>= "2.1.0" & with-test}
+   "lwt_ppx" {>= "2.0.2" & with-test}
+ ]
+--- cstruct-v6.0.1/ppx/dune.orig	2021-06-25 15:24:26.000000000 +0200
++++ cstruct-v6.0.1/ppx/dune	2022-01-02 19:41:32.990541080 +0100
+@@ -3,7 +3,7 @@
+  (public_name ppx_cstruct)
+  (kind ppx_rewriter)
+  (wrapped false)
+- (ppx_runtime_libraries cstruct stdlib-shims)
++ (ppx_runtime_libraries cstruct)
+  (preprocess
+   (pps ppxlib.metaquot))
+- (libraries sexplib ppxlib bigarray stdlib-shims))
++ (libraries sexplib ppxlib bigarray))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ocaml-cstruct.git/commitdiff/a47fc388fca0fd8a31989c23ffbe9a02bb323acf



More information about the pld-cvs-commit mailing list