libreoffice: reformat a bit kdeIntegration postPatch hook

Put the xdg-open -> kde-open5 substitution in the kdeIntegration
conditioned block, also put the comment about it from above the
postPatch near there.
This commit is contained in:
Doron Behar 2023-09-29 18:26:05 +03:00
parent eb6574af29
commit 159b8a6eb2

View file

@ -229,8 +229,19 @@ in stdenv.mkDerivation (finalAttrs: {
(x: lib.optional (x?dev) x.dev) (x: lib.optional (x?dev) x.dev)
finalAttrs.buildInputs); finalAttrs.buildInputs);
### QT/KDE postPatch = ''
# configure checks for header 'gpgme++/gpgmepp_version.h',
# and if it is found (no matter where) uses a hardcoded path
# in what presumably is an effort to make it possible to write
# '#include <context.h>' instead of '#include <gpgmepp/context.h>'.
# #
# Fix this path to point to where the headers can actually be found instead.
substituteInPlace configure.ac --replace \
'GPGMEPP_CFLAGS=-I/usr/include/gpgme++' \
'GPGMEPP_CFLAGS=-I${gpgme.dev}/include/gpgme++'
'' + optionalString kdeIntegration ''
substituteInPlace shell/source/unix/exec/shellexec.cxx \
--replace xdg-open kde-open5
# configure.ac assumes that the first directory that contains headers and # configure.ac assumes that the first directory that contains headers and
# libraries during its checks contains *all* the relevant headers/libs which # libraries during its checks contains *all* the relevant headers/libs which
# obviously doesn't work for us, so we have 2 options: # obviously doesn't work for us, so we have 2 options:
@ -244,20 +255,6 @@ in stdenv.mkDerivation (finalAttrs: {
# The 2nd option is not very Nix'y, but I'll take robust over nice any day. # The 2nd option is not very Nix'y, but I'll take robust over nice any day.
# Additionally, it's much easier to fix if LO breaks on the next upgrade (just # Additionally, it's much easier to fix if LO breaks on the next upgrade (just
# add the missing dependencies to it). # add the missing dependencies to it).
postPatch = ''
substituteInPlace shell/source/unix/exec/shellexec.cxx \
--replace xdg-open ${if kdeIntegration then "kde-open5" else "xdg-open"}
# configure checks for header 'gpgme++/gpgmepp_version.h',
# and if it is found (no matter where) uses a hardcoded path
# in what presumably is an effort to make it possible to write
# '#include <context.h>' instead of '#include <gpgmepp/context.h>'.
#
# Fix this path to point to where the headers can actually be found instead.
substituteInPlace configure.ac --replace \
'GPGMEPP_CFLAGS=-I/usr/include/gpgme++' \
'GPGMEPP_CFLAGS=-I${gpgme.dev}/include/gpgme++'
'' + optionalString kdeIntegration ''
substituteInPlace configure.ac \ substituteInPlace configure.ac \
--replace '$QT5INC ' '$QT5INC ${kdeDeps}/include ' \ --replace '$QT5INC ' '$QT5INC ${kdeDeps}/include ' \
--replace '$QT5LIB ' '$QT5LIB ${kdeDeps}/lib ' \ --replace '$QT5LIB ' '$QT5LIB ${kdeDeps}/lib ' \