diff options
author | Cosima Neidahl <opna2608@protonmail.com> | 2024-04-13 14:20:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-13 14:20:04 +0200 |
commit | 5ff628396c9ca617f395122bbb143c97c09b2962 (patch) | |
tree | 15a210ccf61a0b6aa13c4075b3b1ea565ab908c5 /pkgs/desktops | |
parent | fdfe57cda614d0961cbf4bab6a11f308f0c0a03d (diff) | |
parent | 40e6d7af2e2da507f725beefa087ec2cd57f7ff9 (diff) |
Merge pull request #303595 from OPNA2608/fix/lomiri-pkgconfig-files
lomiri.* Fix lack of output fixup in pkg-config files, update pkg-config calls with new CMake option
Diffstat (limited to 'pkgs/desktops')
5 files changed, 48 insertions, 14 deletions
diff --git a/pkgs/desktops/lomiri/development/deviceinfo/default.nix b/pkgs/desktops/lomiri/development/deviceinfo/default.nix index 9ddadb83cbec9..6b05a4adddcf3 100644 --- a/pkgs/desktops/lomiri/development/deviceinfo/default.nix +++ b/pkgs/desktops/lomiri/development/deviceinfo/default.nix @@ -27,6 +27,12 @@ stdenv.mkDerivation (finalAttrs: { "bin" ]; + postPatch = '' + # For our automatic pkg-config output patcher to work, prefix must be used here + substituteInPlace headers/deviceinfo.pc.in \ + --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' + ''; + strictDeps = true; nativeBuildInputs = [ diff --git a/pkgs/desktops/lomiri/development/trust-store/default.nix b/pkgs/desktops/lomiri/development/trust-store/default.nix index d797fbd8f6883..fbbd8cf4ac6f3 100644 --- a/pkgs/desktops/lomiri/development/trust-store/default.nix +++ b/pkgs/desktops/lomiri/development/trust-store/default.nix @@ -44,12 +44,14 @@ stdenv.mkDerivation (finalAttrs: { postPatch = '' # pkg-config patching hook expects prefix variable substituteInPlace data/trust-store.pc.in \ - --replace 'includedir=''${exec_prefix}' 'includedir=''${prefix}' + --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \ + --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' substituteInPlace src/core/trust/terminal_agent.h \ - --replace '/bin/whiptail' '${lib.getExe' newt "whiptail"}' + --replace-fail '/bin/whiptail' '${lib.getExe' newt "whiptail"}' '' + lib.optionalString (!finalAttrs.doCheck) '' - sed -i CMakeLists.txt -e '/add_subdirectory(tests)/d' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(tests)' "" ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/development/u1db-qt/default.nix b/pkgs/desktops/lomiri/development/u1db-qt/default.nix index 275fe85a55d24..a141abb79d699 100644 --- a/pkgs/desktops/lomiri/development/u1db-qt/default.nix +++ b/pkgs/desktops/lomiri/development/u1db-qt/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchFromGitLab +, fetchpatch , gitUpdater , testers , cmake @@ -27,16 +28,30 @@ stdenv.mkDerivation (finalAttrs: { "examples" ]; + patches = [ + # Fixes some issues with the pkg-config file + # Remove when https://gitlab.com/ubports/development/core/u1db-qt/-/merge_requests/7 merged & in release + (fetchpatch { + name = "0001-u1db-qt-Fix-pkg-config-files-includedir-variable.patch"; + url = "https://gitlab.com/ubports/development/core/u1db-qt/-/commit/ddafbfadfad6dfc508a866835354a4701dda1fe1.patch"; + hash = "sha256-entwjU9TiHuSuht7Cdl0k1v0cP7350a04/FXgTVhGmk="; + }) + ]; + postPatch = '' patchShebangs tests/strict-qmltestrunner.sh - # QMake query response is broken + # QMake query response is broken, just hardcode the expected location substituteInPlace modules/U1db/CMakeLists.txt \ - --replace "\''${QT_IMPORTS_DIR}" "$out/$qtQmlPrefix" + --replace-fail 'exec_program(''${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML"' 'exec_program(echo ARGS "''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"' + + # For our automatic pkg-config output patcher to work, prefix must be used here + substituteInPlace libu1db-qt.pc.in \ + --replace-fail 'libdir=''${exec_prefix}/lib' 'libdir=''${prefix}/lib' '' + lib.optionalString (!finalAttrs.doCheck) '' # Other locations add dependencies to custom check target from tests substituteInPlace CMakeLists.txt \ - --replace 'add_subdirectory(tests)' 'add_custom_target(check COMMAND "echo check dummy")' + --replace-fail 'add_subdirectory(tests)' 'add_custom_target(check COMMAND "echo check dummy")' ''; strictDeps = true; @@ -57,8 +72,8 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - # Needs qdoc - "-DBUILD_DOCS=OFF" + # Needs qdoc, see https://github.com/NixOS/nixpkgs/pull/245379 + (lib.cmakeBool "BUILD_DOCS" false) ]; dontWrapQtApps = true; diff --git a/pkgs/desktops/lomiri/services/biometryd/default.nix b/pkgs/desktops/lomiri/services/biometryd/default.nix index 418a39ebb6e02..d06ecf16942ef 100644 --- a/pkgs/desktops/lomiri/services/biometryd/default.nix +++ b/pkgs/desktops/lomiri/services/biometryd/default.nix @@ -38,12 +38,17 @@ stdenv.mkDerivation (finalAttrs: { ]; postPatch = '' - # Uses pkg_get_variable, cannot substitute prefix with that + # Substitute systemd's prefix in pkg-config call substituteInPlace data/CMakeLists.txt \ - --replace 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)' 'set(SYSTEMD_SYSTEM_UNIT_DIR "''${CMAKE_INSTALL_PREFIX}/lib/systemd/system")' + --replace-fail 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)' 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' substituteInPlace src/biometry/qml/Biometryd/CMakeLists.txt \ - --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + --replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + + # For our automatic pkg-config output patcher to work, prefix must be used here + substituteInPlace data/biometryd.pc.in \ + --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \ + --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' \ '' + lib.optionalString (!finalAttrs.doCheck) '' sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt ''; diff --git a/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix b/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix index 5c2f02b596fb5..6174bd9c54b07 100644 --- a/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix @@ -55,10 +55,16 @@ stdenv.mkDerivation (finalAttrs: { ]; postPatch = '' - # pkg_get_variable doesn't let us substitute prefix pkg-config variable from systemd + # Substitute systemd's prefix in pkg-config call substituteInPlace CMakeLists.txt \ - --replace 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'set(SYSTEMD_USER_DIR "${placeholder "out"}/lib/systemd/user")' \ - --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \ + --replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + + # For our automatic pkg-config output patcher to work, prefix must be used here + substituteInPlace src/{common/public,downloads/client,downloads/common,uploads/common}/*.pc.in \ + --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' + substituteInPlace src/downloads/client/lomiri-download-manager-client.pc.in \ + --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' ''; strictDeps = true; |