@ -1,79 +1,108 @@
%ifarch %{ocaml_native_compiler}
%global native_compiler 1
%else
%global native_compiler 0
%endif
# 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
# OCaml packages not built on i686 since OCaml 5 / Fedora 39.
ExcludeArch: %{ix86}
Name: ocaml-labltk
Version: 8.06.5
Release: 25 %{?dist}
Version: 8.06.13
Release: 14 %{?dist}
Summary: Tcl/Tk interface for OCaml
License: LGPLv2+ with exceptions
License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception
URL: https://forge.ocamlcore.org/projects/labltk/
Source0: https://forge.ocamlcore.org/frs/download.php/1727/labltk-%{version}.tar.gz
URL: https://garrigue.github.io/labltk/
VCS: https://github.com/garrigue/labltk
Source0: %{vcs}/archive/%{version}/labltk-%{version}.tar.gz
# This adds debugging (-g) everywhere.
Patch1: labltk-8.06.0-enable-debugging.patch
Patch2: labltk-8.06.4-enable-more-debugging.patch
Patch1: labltk-8.06.11-enable-debugging.patch
# Resolve an issue with ./configure and Tcl detection.
Patch2: labltk-8.06.12-use-fpic-configure.patch
# Avoid implicit int because it was removed from the C language
Patch3: ocaml-labltk-configure-c99.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
%description doc %_desc
This package contains the API reference.
%patch1 -p1
%patch2 -p1
%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
./configure -verbose
# 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}
@ -82,55 +111,127 @@ mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
make install \
BINDIR=$RPM_BUILD_ROOT%{_bindir} \
INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/labltk \
STUBLIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
%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
STUBLIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs \
RANLIB=:
sed 's/8\.06\.6/%{version}/' support/META > \
$RPM_BUILD_ROOT%{ocamldir}/labltk/META
%files
%ocaml_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
* Fri Mar 11 2022 Richard W.M. Jones <rjones@redhat.com> - 8.06.5-25
- Rebuild for EPEL
resolves: rhbz#2060850
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 8.06.13-14
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 8.06.13-13
- Rebuilt for MSVSphere 10
* Tue Jun 25 2024 Troy Dawson <tdawson@redhat.com> - 8.06.13-13
- Bump release for June 2024 mass rebuild
* Wed Jun 19 2024 Richard W.M. Jones <rjones@redhat.com> - 8.06.13-12
- OCaml 5.2.0 ppc64le fix
* Wed May 29 2024 Richard W.M. Jones <rjones@redhat.com> - 8.06.13-11
- OCaml 5.2.0 for Fedora 41
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.13-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.13-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Dec 18 2023 Richard W.M. Jones <rjones@redhat.com> - 8.06.13-8
- OCaml 5.1.1 + s390x code gen fix for Fedora 40
* Tue Dec 12 2023 Richard W.M. Jones <rjones@redhat.com> - 8.06.13-7
- OCaml 5.1.1 rebuild for Fedora 40
* Thu Oct 05 2023 Richard W.M. Jones <rjones@redhat.com> - 8.06.13-6
- OCaml 5.1 rebuild for Fedora 40
* Wed Oct 4 2023 Jerry James <loganjerry@gmail.com> - 8.06.13-5
- Depend on ocaml-rpm-macros instead of python3
* Sat Sep 9 2023 Jerry James <loganjerry@gmail.com> - 8.06.13-4
- Add devel package dependency on tcl-/tk-devel
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 8.06.5-24
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jul 11 2023 Richard W.M. Jones <rjones@redhat.com> - 8.06.13-2
- OCaml 5.0 rebuild for Fedora 39
* Wed Jun 23 2021 Richard W.M. Jones <rjones@redhat.com> - 8.06.5-23
- Bump and rebuild
resolves: rhbz#1975310
* Mon Jul 10 2023 Jerry James <loganjerry@gmail.com> - 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 <fweimer@redhat.com> - 8.06.12-4
- Port configure stage to C99
* Tue Jan 24 2023 Richard W.M. Jones <rjones@redhat.com> - 8.06.12-3
- Rebuild OCaml packages for F38
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Sep 20 2022 Richard W.M. Jones <rjones@redhat.com> - 8.06.12-1
- New upstream version 8.06.12
- Enable verbose output from configure script.
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Jun 18 2022 Richard W.M. Jones <rjones@redhat.com> - 8.06.11-4
- OCaml 4.14.0 rebuild
* Fri Feb 04 2022 Richard W.M. Jones <rjones@redhat.com> - 8.06.11-3
- OCaml 4.13.1 rebuild to remove package notes
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Oct 04 2021 Richard W.M. Jones <rjones@redhat.com> - 8.06.11-1
- New upstream version 8.06.11
- OCaml 4.13.1 build
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Mar 15 2021 Richard W.M. Jones <rjones@redhat.com> - 8.06.10-2
- Bump and rebuild for ELN broken deps.
* Mon Mar 1 22:24:19 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 8.06.10-1
- New upstream version 8.06.10.
- Now hosted on github.
* Sun Feb 28 22:24:19 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 8.06.5-23
- Bump release and rebuild.
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 8.06.5-22
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Sun Feb 28 22:16:43 GMT 2021 Richard W.M. Jones <rjones @redhat.com> - 8.06.5-22
- OCaml 4.12.0 build
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.06.5-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild