diff --git a/libinstpatch.spec b/libinstpatch.spec index 50e9d17..c341dbb 100644 --- a/libinstpatch.spec +++ b/libinstpatch.spec @@ -122,28 +122,34 @@ find examples -type f -name '*.py' -print -delete %build -# In the RPM build environment, a parallel build with gtkdoc documentation -# enabled fails with: -# /usr/bin/ld: cannot find -linstpatch-1.0: No such file or directory +# We cannot reliably build gtkdoc documentation at the same time as the +# library. It appears that gtkdoc-scangobj attempts to link the library before +# it is built. # # The best fix would be to find the missing dependency relationship or other # problem in the CMake build scripts, but this is not quite obvious. # -# Additionally, the problem seems to be triggered by something in the RPM build -# environment (CMake options, CFLAGS, etc.), and we haven’t narrowed this down -# yet, which means we aren’t prepared to report the problem upstream. -# Assistance is welcome. +# Historically this could be worked around by setting _smp_ncpus_max to 1, but +# this has stopped working. # -# https://bugzilla.redhat.com/show_bug.cgi?id=2210347#c6 -%global _smp_ncpus_max 1 +# Instead, we build with gtkdoc documenatgion disabled to get the library, then +# enable the gtkdoc documentation and rebuild. This guarantees the library is +# ready when gtkdoc-scangobj runs. +# +# See: 1.1.6: build with GTKDOC_ENABLED=ON fails +# https://github.com/swami/libinstpatch/issues/65 %cmake \ - -DGTKDOC_ENABLED:BOOL=ON \ + -DGTKDOC_ENABLED:BOOL=OFF \ -DINTROSPECTION_ENABLED:BOOL=\ %{?with_introspection:ON}%{!?with_introspection:OFF} \ -GNinja %cmake_build +# Enable the GTK docs and build again. +%{__cmake} %{_vpath_builddir} -DGTKDOC_ENABLED:BOOL=ON +%cmake_build + %install %cmake_install