From Fedora Project Wiki

(Initial creation)
 
m (Add stellarium man page fix)
 
(5 intermediate revisions by the same user not shown)
Line 13: Line 13:
Similarly, sometimes spec files use %{_prefix} to refer to the location of their dependencies:
Similarly, sometimes spec files use %{_prefix} to refer to the location of their dependencies:


'''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/pull-request/1 Remove manual updating of config.{guess,sub}] <br />


== Fixing installation ===
== 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''' [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 />
'''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 ==
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 />
✓ '''libnatpmp''' [https://src.fedoraproject.org/rpms/libnatpmp/pull-request/1 Fix to properly install into %{_bindir} / %{_includedir}] <br />
✓ '''libnatpmp''' [https://src.fedoraproject.org/rpms/libnatpmp/pull-request/1 Fix to properly install into %{_bindir} / %{_includedir}] <br />
✓ '''libvpx''' [https://src.fedoraproject.org/rpms/libvpx/pull-request/1 Avoid hardcoding prefix=/usr] <br />
✓ '''libvpx''' [https://src.fedoraproject.org/rpms/libvpx/pull-request/1 Avoid hardcoding prefix=/usr] <br />
✓ '''phonon''' [https://src.fedoraproject.org/rpms/phonon/pull-request/1 Pass Qt paths we'll use in the file list to CMake; In %check, augment PKG_CONFIG_PATH, not replace it] <br />
✓ '''phonon''' [https://src.fedoraproject.org/rpms/phonon/pull-request/1 Pass Qt paths we'll use in the file list to CMake] <br />
✓ '''polkit''' [https://src.fedoraproject.org/rpms/polkit/c/98744d97b3f3c305af250c59a8871a4b676c5eea?branch=master Fix installation with prefix != /usr] <br />
✓ '''polkit''' [https://src.fedoraproject.org/rpms/polkit/c/98744d97b3f3c305af250c59a8871a4b676c5eea?branch=master Fix installation with prefix != /usr] <br />


Line 31: 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 ==
Line 39: Line 48:


✓ '''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 />

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