From Fedora Project Wiki

(Update SDL fix and mark some other fixes as applied)
m (Add stellarium man page fix)
 
(2 intermediate revisions by the same user not shown)
Line 22: Line 22:
✓ '''OpenEXR''' [https://src.fedoraproject.org/rpms/OpenEXR/pull-request/1 In %check, augment PKG_CONFIG_PATH, not replace it ] <br />
✓ '''OpenEXR''' [https://src.fedoraproject.org/rpms/OpenEXR/pull-request/1 In %check, augment PKG_CONFIG_PATH, not replace it ] <br />
✓ '''phonon''' [https://src.fedoraproject.org/rpms/phonon/pull-request/1 In %check, augment PKG_CONFIG_PATH, not replace it] <br />
✓ '''phonon''' [https://src.fedoraproject.org/rpms/phonon/pull-request/1 In %check, augment PKG_CONFIG_PATH, not replace it] <br />
'''endless-sky''' [https://src.fedoraproject.org/rpms/endless-sky/pull-request/2 Fix compilation with CPLUS_INCLUDE_PATH set for Flatpak builds] (Scons doesn't pass environment variables through by default)


== Fixing installation ==
== Fixing installation ==
Line 38: Line 39:


✓ '''jbig2dec''' [https://src.fedoraproject.org/rpms/jbig2dec/pull-request/1 Handle both compressed and uncompressed man pages] <br />
✓ '''jbig2dec''' [https://src.fedoraproject.org/rpms/jbig2dec/pull-request/1 Handle both compressed and uncompressed man pages] <br />
✓ '''mcpp''' [https://src.fedoraproject.org/rpms/mcpp/pull-request/1 Handle both compressed and uncompressed manual pages] <br />
✓ '''libidn''' [https://src.fedoraproject.org/rpms/libidn/pull-request/1 Handle uncompressed info pages] <br />
✓ '''libidn''' [https://src.fedoraproject.org/rpms/libidn/pull-request/1 Handle uncompressed info pages] <br />
✓ '''libraw1394''' [https://src.fedoraproject.org/rpms/libraw1394/pull-request/1 Handle both compressed and uncompressed man pages] <br />
✓ '''libraw1394''' [https://src.fedoraproject.org/rpms/libraw1394/pull-request/1 Handle both compressed and uncompressed man pages] <br />
✓ '''mcpp''' [https://src.fedoraproject.org/rpms/mcpp/pull-request/1 Handle both compressed and uncompressed manual pages] <br />
'''stellarium'''  [https://src.fedoraproject.org/rpms/stellarium/pull-request/1 Handle both compressed and uncompressed man pages] <br />


== Stripping down dependencies ==
== Stripping down dependencies ==

Latest revision as of 21:12, 15 January 2019

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 Remove manual updating of config.{guess,sub}

Respecting the build environment

Overwriting an environment variable like PKG_CONFIG_PATH will cause the paths to /app in the build environment not to take effect:

OpenEXR In %check, augment PKG_CONFIG_PATH, not replace it
phonon In %check, augment PKG_CONFIG_PATH, not replace it
endless-sky Fix compilation with CPLUS_INCLUDE_PATH set for Flatpak builds (Scons doesn't pass environment variables through by default)

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
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
libidn Handle uncompressed info pages
libraw1394 Handle both compressed and uncompressed man pages
mcpp Handle both compressed and uncompressed manual pages
stellarium 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