From Fedora Project Wiki

(Initial creation)
 
(Update status of changes)
Line 14: Line 14:
  
 
'''endless-sky''' [https://src.fedoraproject.org/rpms/endless-sky/pull-request/1 scons is in /usr/bin, even if we're compiling with a different %{_prefix}]  <br />
 
'''endless-sky''' [https://src.fedoraproject.org/rpms/endless-sky/pull-request/1 scons is in /usr/bin, even if we're compiling with a different %{_prefix}]  <br />
'''SDL''' [https://src.fedoraproject.org/rpms/SDL/c/ed85024942eb2e84f6496b59b11ca2d62ce07e7d Always look for automake scripts in /usr/share, not in %{_datadir}] <br />
+
'''SDL''' [https://src.fedoraproject.org/rpms/SDL/c/ed85024942eb2e84f6496b59b11ca2d62ce07e7d Always look for automake scripts in /usr/share, not in %{_datadir}] <br />
  
== Fixing installation ===
+
== Fixing installation ==
 
Often spec files need minor adjustment to make sure everything get installed under %{_prefix}
 
Often spec files need minor adjustment to make sure everything get installed under %{_prefix}
  
'''kde-settings''' [https://src.fedoraproject.org/rpms/kde-settings/pull-request/1 Handle %{_prefix} != /usr] <br />
+
'''kde-settings''' [https://src.fedoraproject.org/rpms/kde-settings/pull-request/1 Handle %{_prefix} != /usr] <br />
 
✓ '''glew''' [https://src.fedoraproject.org/rpms/glew/c/7efa2c56459d0e94324051aa89158abfcdcfc9b1?branch=master Fix installation with prefix=/app] <br />
 
✓ '''glew''' [https://src.fedoraproject.org/rpms/glew/c/7efa2c56459d0e94324051aa89158abfcdcfc9b1?branch=master Fix installation with prefix=/app] <br />
 
✓ '''libgee''' [https://src.fedoraproject.org/rpms/libgee/c/8357ed9983e421b22b8cb50f8d42aed7660dd60b?branch=master Fix installation with /usr != /usr] <br />
 
✓ '''libgee''' [https://src.fedoraproject.org/rpms/libgee/c/8357ed9983e421b22b8cb50f8d42aed7660dd60b?branch=master Fix installation with /usr != /usr] <br />
Line 39: Line 39:
  
 
✓ '''boost''' [https://src.fedoraproject.org/rpms/boost/pull-request/1 Disable openmpi and mpich for Flatpak-bundled builds] <br/>
 
✓ '''boost''' [https://src.fedoraproject.org/rpms/boost/pull-request/1 Disable openmpi and mpich for Flatpak-bundled builds] <br/>
'''kf5-kio''' [https://src.fedoraproject.org/rpms/kf5-kio/pull-request/1 Disable help/ghelp protocols for Flatpak builds] <br/>
+
'''kf5-kio''' [https://src.fedoraproject.org/rpms/kf5-kio/pull-request/1 Disable help/ghelp protocols for Flatpak builds] <br/>
 
✓ '''pycairo''' [https://src.fedoraproject.org/rpms/pycairo/pull-request/1 Disable xpyb support] <br/>
 
✓ '''pycairo''' [https://src.fedoraproject.org/rpms/pycairo/pull-request/1 Disable xpyb support] <br/>
 
✓ '''qt''' [https://src.fedoraproject.org/rpms/qt/pull-request/2 Disable qtchooser for Flatpak builds] <br/>
 
✓ '''qt''' [https://src.fedoraproject.org/rpms/qt/pull-request/2 Disable qtchooser for Flatpak builds] <br/>
 
✓ '''rawtherapee''' [https://src.fedoraproject.org/rpms/rawtherapee/pull-request/1 Don't explicitly require fftw] <br/>
 
✓ '''rawtherapee''' [https://src.fedoraproject.org/rpms/rawtherapee/pull-request/1 Don't explicitly require fftw] <br/>
 
✓ '''SuperLU''' [https://src.fedoraproject.org/rpms/SuperLU/c/28eec82e83b8cae34e2abe1b80f9762966a3f25a?branch=master Remove gcc-gfortran as required package] <br/>
 
✓ '''SuperLU''' [https://src.fedoraproject.org/rpms/SuperLU/c/28eec82e83b8cae34e2abe1b80f9762966a3f25a?branch=master Remove gcc-gfortran as required package] <br/>
'''fluidsynth''' [https://src.fedoraproject.org/rpms/fluidsynth/pull-request/2 Disable jack for Flatpak builds] <br/>
+
'''fluidsynth''' [https://src.fedoraproject.org/rpms/fluidsynth/pull-request/2 Disable jack for Flatpak builds] <br/>
  
 
== Other changes ==
 
== Other changes ==
 
'''perl''' [https://src.fedoraproject.org/rpms/perl/pull-request/1 Make builds for inclusion in an application Flatpak work] (add a /usr/bin/perl symlink and look for modules in /usr/ as well as /app.)<br />
 
'''perl''' [https://src.fedoraproject.org/rpms/perl/pull-request/1 Make builds for inclusion in an application Flatpak work] (add a /usr/bin/perl symlink and look for modules in /usr/ as well as /app.)<br />
 
'''lua-posix''' [https://src.fedoraproject.org/rpms/lua-posix/pull-request/1 Use RPM macros from lua-devel] <br />
 
'''lua-posix''' [https://src.fedoraproject.org/rpms/lua-posix/pull-request/1 Use RPM macros from lua-devel] <br />

Revision as of 16:14, 1 October 2018

Flatpak spec file fixes

This page lists fixes that were needed to make packages rebuild and work properly with a prefix of /app, which is needed to include them in an application flatpak. See the Fedora Flatpak documentation.

Fixing RPM Macros

Macros installed in /usr/lib/rpm/macros.d should reference the %{_bindir} of the tool, not the %{_bindir} of the package being compiled:

meson Fix binddir usage in macros.meson
ninja-build Fix binddir usage in macros.ninja
qt5 always refer to binaries in their installed location

Not using %{_prefix} for build dependencies

Similarly, sometimes spec files use %{_prefix} to refer to the location of their dependencies:

endless-sky scons is in /usr/bin, even if we're compiling with a different %{_prefix}
SDL Always look for automake scripts in /usr/share, not in %{_datadir}

Fixing installation

Often spec files need minor adjustment to make sure everything get installed under %{_prefix}

kde-settings Handle %{_prefix} != /usr
glew Fix installation with prefix=/app
libgee Fix installation with /usr != /usr
libnatpmp Fix to properly install into %{_bindir} / %{_includedir}
libvpx Avoid hardcoding prefix=/usr
phonon Pass Qt paths we'll use in the file list to CMake; In %check, augment PKG_CONFIG_PATH, not replace it
polkit Fix installation with prefix != /usr

Fixing man pages

rpm-build's brp-compress doesn't find manual packages in /app/share/man, so if a package hard codes the .gz suffix for man pages in the file list (the recommendation is to use globbing), then building fails. There is an accepted upstream PR to fix brp-compress.

jbig2dec Handle both compressed and uncompressed man pages
mcpp Handle both compressed and uncompressed manual pages
libidn Handle uncompressed info pages
libraw1394 Handle both compressed and uncompressed man pages

Stripping down dependencies

Sometimes you run into big dependency chains or other complexity that can be determined to just not matter in the flatpak context. In this case, conditionalization: %if 0%{?flatpak} is the easiest approach.

boost Disable openmpi and mpich for Flatpak-bundled builds
kf5-kio Disable help/ghelp protocols for Flatpak builds
pycairo Disable xpyb support
qt Disable qtchooser for Flatpak builds
rawtherapee Don't explicitly require fftw
SuperLU Remove gcc-gfortran as required package
fluidsynth Disable jack for Flatpak builds

Other changes

perl Make builds for inclusion in an application Flatpak work (add a /usr/bin/perl symlink and look for modules in /usr/ as well as /app.)
lua-posix Use RPM macros from lua-devel