diff --git a/.gitignore b/.gitignore index 97d27c1..8c6f0c8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ /8.06.10.tar.gz /labltk-8.06.11.tar.gz /labltk-8.06.12.tar.gz +/labltk-8.06.13.tar.gz +/labltk-8.06.14.tar.gz +/labltk-8.06.15.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100755 index 0000000..2c7ed80 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/labltk-8.06.11-enable-debugging.patch b/labltk-8.06.11-enable-debugging.patch index 71d64a5..8d34e81 100644 --- a/labltk-8.06.11-enable-debugging.patch +++ b/labltk-8.06.11-enable-debugging.patch @@ -1,6 +1,6 @@ -diff -ur labltk-8.06.11.old/support/Makefile labltk-8.06.11/support/Makefile ---- labltk-8.06.11.old/support/Makefile 2021-10-04 19:10:57.000196523 +0100 -+++ labltk-8.06.11/support/Makefile 2021-10-04 19:18:06.263137991 +0100 +diff -ur labltk-8.06.13.old/support/Makefile labltk-8.06.13/support/Makefile +--- labltk-8.06.13.old/support/Makefile 2022-10-31 16:54:15.000000000 -0600 ++++ labltk-8.06.13/support/Makefile 2023-06-15 20:40:04.891751478 -0600 @@ -28,7 +28,7 @@ cltkFile.$(O) cltkMain.$(O) cltkMisc.$(O) cltkTimer.$(O) \ cltkVar.$(O) cltkWait.$(O) cltkImg.$(O) @@ -8,12 +8,12 @@ diff -ur labltk-8.06.11.old/support/Makefile labltk-8.06.11/support/Makefile -CCFLAGS=-I$(LIBDIR)/caml $(TK_DEFS) $(SHAREDCCCOMPOPTS) +CCFLAGS=-I$(LIBDIR)/caml $(TK_DEFS) $(SHAREDCCCOMPOPTS) -g - COMPFLAGS= + COMPFLAGS=-I +unix THFLAGS=-I +threads -I vmthreads -diff -ur labltk-8.06.11.old/support/Makefile.common labltk-8.06.11/support/Makefile.common ---- labltk-8.06.11.old/support/Makefile.common 2021-10-04 19:10:56.990196618 +0100 -+++ labltk-8.06.11/support/Makefile.common 2021-10-04 19:18:06.264137981 +0100 -@@ -21,17 +21,17 @@ +diff -ur labltk-8.06.13.old/support/Makefile.common labltk-8.06.13/support/Makefile.common +--- labltk-8.06.13.old/support/Makefile.common.orig 2022-10-31 16:54:15.000000000 -0600 ++++ labltk-8.06.13/support/Makefile.common 2023-06-15 20:40:04.891751478 -0600 +@@ -21,19 +21,19 @@ ## Tools from the OCaml distribution CAMLRUN=$(BINDIR)/ocamlrun @@ -39,3 +39,5 @@ diff -ur labltk-8.06.11.old/support/Makefile.common labltk-8.06.11/support/Makef +CAMLOPTLIBR=$(CAMLOPT) -a -g +MKLIB=$(BINDIR)/ocamlmklib -g CAMLRUNGEN=$(BINDIR)/ocamlrun + ifeq (x$(RANLIB),x) + RANLIB=":" diff --git a/ocaml-labltk.spec b/ocaml-labltk.spec index eeec469..5fb9fda 100644 --- a/ocaml-labltk.spec +++ b/ocaml-labltk.spec @@ -1,20 +1,24 @@ +# This breaks basic usage of the package: +# ocamlfind ocamlopt -package labltk tktest.ml -linkpkg -o tktest +# gcc: fatal error: environment variable ‘RPM_ARCH’ not defined %undefine _package_note_flags -%ifarch %{ocaml_native_compiler} -%global native_compiler 1 -%else -%global native_compiler 0 -%endif + +# OCaml packages not built on i686 since OCaml 5 / Fedora 39. +ExcludeArch: %{ix86} + +%global giturl https://github.com/garrigue/labltk Name: ocaml-labltk -Version: 8.06.12 -Release: 3%{?dist} +Version: 8.06.15 +Release: 4%{?dist} Summary: Tcl/Tk interface for OCaml -License: LGPLv2+ with exceptions +License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception -URL: https://github.com/garrigue/labltk -Source0: https://github.com/garrigue/labltk/archive/%{version}/labltk-%{version}.tar.gz +URL: https://garrigue.github.io/labltk/ +VCS: git:%{giturl}.git +Source0: %{giturl}/archive/%{version}/labltk-%{version}.tar.gz # This adds debugging (-g) everywhere. Patch1: labltk-8.06.11-enable-debugging.patch @@ -24,44 +28,56 @@ Patch2: labltk-8.06.12-use-fpic-configure.patch BuildRequires: make BuildRequires: ocaml +BuildRequires: ocaml-ocamldoc +BuildRequires: ocaml-rpm-macros BuildRequires: tcl-devel, tk-devel - -%description +%global _desc %{expand: labltk or mlTk is a library for interfacing OCaml with the scripting -language Tcl/Tk (all versions since 8.0.3, but no betas). +language Tcl/Tk (all versions since 8.0.3, but no betas).} + + +%description %_desc %package devel Summary: Tcl/Tk interface for OCaml Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: tcl-devel%{?_isa} +Requires: tk-devel%{?_isa} -%description devel -labltk or mlTk is a library for interfacing OCaml with the scripting -language Tcl/Tk (all versions since 8.0.3, but no betas). +%description devel %_desc This package contains the development files. -%prep -%setup -q -n labltk-%{version} +%package doc +Summary: Documentation for labltk +BuildArch: noarch -%patch1 -p1 -%patch2 -p1 + +%description doc %_desc + +This package contains the API reference. + + +%prep +%autosetup -n labltk-%{version} -p1 # Remove version control files which might get copied into documentation. find -name .gitignore -delete -# Kill -warn-error. -find -type f | xargs sed -i -e 's/-warn-error/-w/g' - # Don't build ocamlbrowser. mv browser browser.old mkdir browser echo -e 'all:\ninstall:\n' > browser/Makefile +# Use of the hardening linker flags without the hardening C flags leads to +# failure of the configure script. We don't need linker flags for this step. +sed -i 's/^cclibs=.*/cclibs=/' configure + %build ./configure -verbose @@ -69,14 +85,23 @@ echo -e 'all:\ninstall:\n' > browser/Makefile # Build does not work in parallel. unset MAKEFLAGS -%if !%{native_compiler} -make byte -%else +%ifarch %{ocaml_native_compiler} make all opt \ - SHAREDCCCOMPOPTS="%{optflags} -fPIC" \ - TK_LINK="%{__global_ldflags} -ltk8.6 -ltcl8.6" + SHAREDCCCOMPOPTS='%{build_cflags} -fPIC' \ + TK_LINK="%{build_ldflags} $(pkg-config --libs tk)" +%else +make byte %endif +# Build documentation +# make apiref does not work +MLIS=$(ls -1d labltk/*.mli | grep -Fv _tkgen.mli) +mkdir apiref +/usr/bin/ocamldoc -I +unix -I +threads -I support -I labltk -I camltk \ + support/fileevent.mli support/support.mli support/textvariable.mli \ + support/timer.mli support/tkthread.mli support/widget.mli $MLIS \ + labltk/tk.ml -sort -d apiref -html + %install mkdir -p $RPM_BUILD_ROOT%{_bindir} @@ -87,40 +112,100 @@ make install \ INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/labltk \ STUBLIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs \ RANLIB=: -%if %{native_compiler} -# The *.o files are not installed by the Makefile. AIUI -# that prevents linking with native code programs. -install -m 0644 camltk/*.o $RPM_BUILD_ROOT%{_libdir}/ocaml/labltk -%endif + +sed 's/8\.06\.6/%{version}/' support/META > \ + $RPM_BUILD_ROOT%{ocamldir}/labltk/META + +%ocaml_files -%files +%files -f .ofiles %doc Changes README.mlTk -%dir %{_libdir}/ocaml/labltk -%{_libdir}/ocaml/labltk/*.cmi -%{_libdir}/ocaml/labltk/*.cma -%{_libdir}/ocaml/labltk/*.cmo -%{_libdir}/ocaml/stublibs/dlllabltk.so -%files devel +%files devel -f .ofiles-devel %doc README.mlTk + + +%files doc %doc examples_camltk %doc examples_labltk -%{_bindir}/labltk -%{_libdir}/ocaml/labltk/labltktop -%{_libdir}/ocaml/labltk/pp -%{_libdir}/ocaml/labltk/tkcompiler -%{_libdir}/ocaml/labltk/*.a -%if %{native_compiler} -%{_libdir}/ocaml/labltk/*.cmxa -%{_libdir}/ocaml/labltk/*.cmx -%{_libdir}/ocaml/labltk/*.o -%endif -%{_libdir}/ocaml/labltk/*.mli +%doc apiref %changelog +* Mon Oct 13 2025 Richard W.M. Jones - 8.06.15-4 +- OCaml 5.4.0 rebuild + +* Thu Jul 24 2025 Fedora Release Engineering - 8.06.15-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Fri Jul 11 2025 Jerry James - 8.06.15-2 +- Rebuild to fix OCaml dependencies + +* Mon Feb 03 2025 Richard W.M. Jones - 8.06.15-1 +- New upstream version 8.06.15 +- Includes Tcl 9 support (RHBZ#2337740) + +* Fri Jan 17 2025 Fedora Release Engineering - 8.06.14-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jan 9 2025 Jerry James - 8.06.14-2 +- OCaml 5.3.0 rebuild for Fedora 42 + +* Thu Aug 1 2024 Jerry James - 8.06.14-1 +- Version 8.06.14 +- Drop upstreamed patch to avoid implicit int in configure + +* Thu Jul 18 2024 Fedora Release Engineering - 8.06.13-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed Jun 19 2024 Richard W.M. Jones - 8.06.13-12 +- OCaml 5.2.0 ppc64le fix + +* Wed May 29 2024 Richard W.M. Jones - 8.06.13-11 +- OCaml 5.2.0 for Fedora 41 + +* Thu Jan 25 2024 Fedora Release Engineering - 8.06.13-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 8.06.13-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Dec 18 2023 Richard W.M. Jones - 8.06.13-8 +- OCaml 5.1.1 + s390x code gen fix for Fedora 40 + +* Tue Dec 12 2023 Richard W.M. Jones - 8.06.13-7 +- OCaml 5.1.1 rebuild for Fedora 40 + +* Thu Oct 05 2023 Richard W.M. Jones - 8.06.13-6 +- OCaml 5.1 rebuild for Fedora 40 + +* Wed Oct 4 2023 Jerry James - 8.06.13-5 +- Depend on ocaml-rpm-macros instead of python3 + +* Sat Sep 9 2023 Jerry James - 8.06.13-4 +- Add devel package dependency on tcl-/tk-devel + +* Thu Jul 20 2023 Fedora Release Engineering - 8.06.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jul 11 2023 Richard W.M. Jones - 8.06.13-2 +- OCaml 5.0 rebuild for Fedora 39 + +* Mon Jul 10 2023 Jerry James - 8.06.13-1 +- Version 8.06.13 +- Convert License tag to SPDX +- Update project URL +- Install META file +- New doc subpackage for the documentation +- Fix configure script failure +- Compute linker flags more robustly +- Use new OCaml macros + +* Sat Apr 15 2023 Florian Weimer - 8.06.12-4 +- Port configure stage to C99 + * Tue Jan 24 2023 Richard W.M. Jones - 8.06.12-3 - Rebuild OCaml packages for F38 diff --git a/sources b/sources index d78eff7..6a1bdd8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (labltk-8.06.12.tar.gz) = e1564ab2d8922276bd8ad586b37308d60ca2dd563bac3cdd992d8a6ba4de26e5499350a62a1d4cb2bbb9a5b7aff609b5187aad5fba118eb55d1b4c8355d2979a +SHA512 (labltk-8.06.15.tar.gz) = 67feb7f51be2a837050dc0b94a4cd185f05db240cdbb1188d5787465dd2abed98b17244c66893ad18ef912fbbe960b90a3e116a9f283a6277b6a747043780e24 diff --git a/tests/basic-test.sh b/tests/basic-test.sh new file mode 100755 index 0000000..1f39c11 --- /dev/null +++ b/tests/basic-test.sh @@ -0,0 +1,9 @@ +#!/bin/bash - +set -e +set -x + +# Compile trivial tk program. +echo 'ignore (Tk.opentk ())' > tktest.ml +ocamlfind ocamlopt -package labltk tktest.ml -linkpkg -o tktest +# Unfortunately we can't run this as we won't have an X server available. +#./tktest diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100755 index 0000000..a6423db --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,13 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - ocaml + - ocaml-findlib + - ocaml-labltk-devel + tests: + - simple: + dir: . + run: ./basic-test.sh