On 10.02.22 11:13, Daniel P. Berrangé wrote:

FWIW, my proof of concept last year did the following to the
libvirt-glib.spec file:

  https://gitlab.com/berrange/libvirt-glib/-/commit/45994bf93bb4b030e3ab57c9b2e4e61e737d6d29

As you can tell, it is essentially just the contents of the
current mingw-libvirt-glib.spec file:

  https://gitlab.com/berrange/libvirt-glib/-/blob/mingw-rpm-merge2/mingw-libvirt-glib.spec.in

copied over into the libvirt-glib.spec

To repeat my previously reported interesting notes:

  * We need to set  mingw32_pkg_name/mingw64_pkg_name explicitly
     because the current logic that sets these doesn't work:
 
      %mingw32_pkg_name        %(echo %{name} | sed 's/^mingw-/mingw32-/')
 
     Presumably we can fix that macro so that it does the right thing
     when no mingw- prefix exists in the first place

Right, I'd suggest changing this to

%mingw32_pkg_name        %(echo %{name} | sed -E 's/^(mingw-|)/mingw32-/')
 
  * We can't use %mingw_package_header because that splatters the
    native debuginfo generation. So we must explicitly add mingw
    debuginfo packages by referencing
 
       %{?mingw_debug_package}
 
    and at end of %install add
 
       %mingw_debug_install_post
 
I guess this is acceptable.
 
  * %mingw_package_header has reference to overriding strip/objdump
    to prevent corruption of binaries. We can't do that override
    because we need native strip/objdump for the native builds.
    
    AFAICT though, no corruption happened to my DLLs even without
    this strip/objdump override. Looks like this caveat might be
    obsolete, unless the scenarios it hits are more niche than I
    tested. 
Thanks, I'll look out for these.
  * %mingw_package_header tries to disable the internal dependancy
    generator on RHEL 6. For reasons I don't understand, it ends
    up disabling it on Fedora too.
 
      %mingw_package_header                                         \
      %global __strip %{mingw_strip}                                \
      %global __objdump %{mingw_objdump}                            \
      %if 0%{?rhel} == 6                                            \
      %global _use_internal_dependency_generator 0                  \
      %global __find_requires %{mingw_findrequires}                 \
      %global __find_provides %{mingw_findprovides}                 \
      %endif                                                         \
      %global __debug_install_post %%{mingw_debug_install_post}     \
      %{nil} 

I actually already dropped this from mingw-filesystem (see https://src.fedoraproject.org/rpms/mingw-filesystem/c/f6cc2b6d756f8201c3119b34046a4da5bf85456a?branch=rawhide)

Thanks
SandrĂ´