diff --git a/pkgs/desktops/lxqt/liblxqt/default.nix b/pkgs/desktops/lxqt/liblxqt/default.nix index 964931494204..d94b1ac0d030 100644 --- a/pkgs/desktops/lxqt/liblxqt/default.nix +++ b/pkgs/desktops/lxqt/liblxqt/default.nix @@ -27,15 +27,8 @@ mkDerivation rec { xorg.libXScrnSaver ]; - cmakeFlags = [ - "-DLXQT_ETC_XDG_DIR=/run/current-system/sw/etc/xdg" - ]; - postPatch = '' - sed -i 's|set(LXQT_SHARE_DIR .*)|set(LXQT_SHARE_DIR "/run/current-system/sw/share/lxqt")|' CMakeLists.txt sed -i "s|\''${POLKITQT-1_POLICY_FILES_INSTALL_DIR}|''${out}/share/polkit-1/actions|" CMakeLists.txt - substituteInPlace CMakeLists.txt \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" ''; meta = with lib; { diff --git a/pkgs/desktops/lxqt/lxqt-about/default.nix b/pkgs/desktops/lxqt/lxqt-about/default.nix index 784968bc9df9..595141daffc7 100644 --- a/pkgs/desktops/lxqt/lxqt-about/default.nix +++ b/pkgs/desktops/lxqt/lxqt-about/default.nix @@ -25,11 +25,6 @@ mkDerivation rec { libqtxdg ]; - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - ''; - meta = with lib; { description = "Dialogue window providing information about LXQt and the system it's running on"; homepage = https://github.com/lxqt/lxqt-about; diff --git a/pkgs/desktops/lxqt/lxqt-admin/default.nix b/pkgs/desktops/lxqt/lxqt-admin/default.nix index ea5b4010e662..a49bb120791a 100644 --- a/pkgs/desktops/lxqt/lxqt-admin/default.nix +++ b/pkgs/desktops/lxqt/lxqt-admin/default.nix @@ -29,11 +29,6 @@ mkDerivation rec { postPatch = '' sed "s|\''${POLKITQT-1_POLICY_FILES_INSTALL_DIR}|''${out}/share/polkit-1/actions|" \ -i lxqt-admin-user/CMakeLists.txt - - for f in lxqt-admin-{user,time}/CMakeLists.txt; do - substituteInPlace $f \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - done ''; meta = with lib; { diff --git a/pkgs/desktops/lxqt/lxqt-archiver/default.nix b/pkgs/desktops/lxqt/lxqt-archiver/default.nix index bf3c1596f22d..da90826116f2 100644 --- a/pkgs/desktops/lxqt/lxqt-archiver/default.nix +++ b/pkgs/desktops/lxqt/lxqt-archiver/default.nix @@ -1,7 +1,6 @@ { lib, mkDerivation, fetchFromGitHub, cmake, pkgconfig, lxqt-build-tools, json-glib, libfm-qt, qtbase, qttools, qtx11extras }: mkDerivation rec { - name = "${pname}-${version}"; pname = "lxqt-archiver"; version = "0.0.96"; diff --git a/pkgs/desktops/lxqt/lxqt-build-tools/LXQtConfigVars.cmake b/pkgs/desktops/lxqt/lxqt-build-tools/LXQtConfigVars.cmake new file mode 100644 index 000000000000..fd7ef927f8b3 --- /dev/null +++ b/pkgs/desktops/lxqt/lxqt-build-tools/LXQtConfigVars.cmake @@ -0,0 +1,7 @@ +add_definitions("-DLXQT_RELATIVE_SHARE_DIR=\"${LXQT_RELATIVE_SHARE_DIR}\"") +add_definitions("-DLXQT_SHARE_DIR=\"${LXQT_SHARE_DIR}\"") +add_definitions("-DLXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=\"${LXQT_RELATIVE_TRANSLATIONS_DIR}\"") +add_definitions("-DLXQT_SHARE_TRANSLATIONS_DIR=\"${LXQT_TRANSLATIONS_DIR}\"") +add_definitions("-DLXQT_GRAPHICS_DIR=\"${LXQT_GRAPHICS_DIR}\"") +add_definitions("-DLXQT_ETC_XDG_DIR=\"${LXQT_ETC_XDG_DIR}\"") +add_definitions("-DLXQT_DATA_DIR=\"${LXQT_DATA_DIR}\"") diff --git a/pkgs/desktops/lxqt/lxqt-build-tools/default.nix b/pkgs/desktops/lxqt/lxqt-build-tools/default.nix index d202ba95d3e6..626c99fcf9c9 100644 --- a/pkgs/desktops/lxqt/lxqt-build-tools/default.nix +++ b/pkgs/desktops/lxqt/lxqt-build-tools/default.nix @@ -11,11 +11,18 @@ mkDerivation rec { sha256 = "0i7m9s4g5rsw28vclc9nh0zcapx85cqfwxkx7rrw7wa12svy7pm2"; }; - nativeBuildInputs = [ cmake pkgconfig ]; + nativeBuildInputs = [ cmake pkgconfig setupHook ]; buildInputs = [ qtbase glib pcre ]; - preConfigure = ''cmakeFlags+=" -DLXQT_ETC_XDG_DIR=$out/etc/xdg"''; + setupHook = ./setup-hook.sh; + + # We're dependent on this macro doing add_definitions in most places + # But we have the setup-hook to set the values. + postInstall = '' + rm $out/share/cmake/lxqt-build-tools/modules/LXQtConfigVars.cmake + cp ${./LXQtConfigVars.cmake} $out/share/cmake/lxqt-build-tools/modules/LXQtConfigVars.cmake + ''; meta = with lib; { description = "Various packaging tools and scripts for LXQt applications"; diff --git a/pkgs/desktops/lxqt/lxqt-build-tools/setup-hook.sh b/pkgs/desktops/lxqt/lxqt-build-tools/setup-hook.sh new file mode 100644 index 000000000000..e40765116e9c --- /dev/null +++ b/pkgs/desktops/lxqt/lxqt-build-tools/setup-hook.sh @@ -0,0 +1,15 @@ +LXQtCMakePostHook() { + cmakeFlagsArray+=( + -DLXQT_LIBRARY_NAME=lxqt + -DLXQT_SHARE_DIR=$out/share/lxqt + -DLXQT_TRANSLATIONS_DIR=$out/share/lxqt/translations + -DLXQT_GRAPHICS_DIR=$out/share/lxqt/graphics + -DLXQT_ETC_XDG_DIR=$out/etc/xdg + -DLXQT_DATA_DIR=$out/share + -DLXQT_RELATIVE_SHARE_DIR=lxqt + -DLXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=lxqt/translations + ) + +} + +postHooks+=(LXQtCMakePostHook) diff --git a/pkgs/desktops/lxqt/lxqt-config/default.nix b/pkgs/desktops/lxqt/lxqt-config/default.nix index 9d27beab2d63..d775a93fff4c 100644 --- a/pkgs/desktops/lxqt/lxqt-config/default.nix +++ b/pkgs/desktops/lxqt/lxqt-config/default.nix @@ -38,23 +38,6 @@ mkDerivation rec { ]; postPatch = '' - substituteInPlace src/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - - for f in \ - lxqt-config-file-associations/CMakeLists.txt \ - lxqt-config-brightness/CMakeLists.txt \ - lxqt-config-appearance/CMakeLists.txt \ - lxqt-config-locale/CMakeLists.txt \ - lxqt-config-monitor/CMakeLists.txt \ - lxqt-config-input/CMakeLists.txt \ - liblxqt-config-cursor/CMakeLists.txt \ - src/CMakeLists.txt - do - substituteInPlace $f \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - done - sed -i "/\''${XORG_LIBINPUT_INCLUDE_DIRS}/a ${xorg.xf86inputlibinput.dev}/include/xorg" lxqt-config-input/CMakeLists.txt ''; diff --git a/pkgs/desktops/lxqt/lxqt-globalkeys/default.nix b/pkgs/desktops/lxqt/lxqt-globalkeys/default.nix index b9d3e8a7e4c5..d836ddeea38f 100644 --- a/pkgs/desktops/lxqt/lxqt-globalkeys/default.nix +++ b/pkgs/desktops/lxqt/lxqt-globalkeys/default.nix @@ -26,16 +26,6 @@ mkDerivation rec { libqtxdg ]; - postPatch = '' - for dir in autostart xdg; do - substituteInPlace $dir/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - done - - substituteInPlace config/CMakeLists.txt \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - ''; - meta = with lib; { description = "Daemon used to register global keyboard shortcuts"; homepage = https://github.com/lxqt/lxqt-globalkeys; diff --git a/pkgs/desktops/lxqt/lxqt-notificationd/default.nix b/pkgs/desktops/lxqt/lxqt-notificationd/default.nix index 7e32e0454f8b..81a6a423a210 100644 --- a/pkgs/desktops/lxqt/lxqt-notificationd/default.nix +++ b/pkgs/desktops/lxqt/lxqt-notificationd/default.nix @@ -16,16 +16,6 @@ mkDerivation rec { lxqt-build-tools ]; - postPatch = '' - substituteInPlace autostart/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - - for f in {config,src}/CMakeLists.txt; do - substituteInPlace $f \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - done - ''; - buildInputs = [ qtbase qttools diff --git a/pkgs/desktops/lxqt/lxqt-openssh-askpass/default.nix b/pkgs/desktops/lxqt/lxqt-openssh-askpass/default.nix index 8e361caf6e34..83048ed7d578 100644 --- a/pkgs/desktops/lxqt/lxqt-openssh-askpass/default.nix +++ b/pkgs/desktops/lxqt/lxqt-openssh-askpass/default.nix @@ -26,11 +26,6 @@ mkDerivation rec { libqtxdg ]; - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - ''; - meta = with lib; { description = "GUI to query passwords on behalf of SSH agents"; homepage = https://github.com/lxqt/lxqt-openssh-askpass; diff --git a/pkgs/desktops/lxqt/lxqt-panel/default.nix b/pkgs/desktops/lxqt/lxqt-panel/default.nix index e107cde6e041..4558d36e554e 100644 --- a/pkgs/desktops/lxqt/lxqt-panel/default.nix +++ b/pkgs/desktops/lxqt/lxqt-panel/default.nix @@ -49,20 +49,6 @@ mkDerivation rec { libXdamage ]; - postPatch = '' - for dir in autostart menu; do - substituteInPlace $dir/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - done - substituteInPlace panel/CMakeLists.txt \ - --replace "DESTINATION \''${LXQT_ETC_XDG_DIR}" "DESTINATION etc/xdg" - - for f in cmake/BuildPlugin.cmake panel/CMakeLists.txt; do - substituteInPlace $f \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - done - ''; - meta = with lib; { description = "The LXQt desktop panel"; homepage = https://github.com/lxqt/lxqt-panel; diff --git a/pkgs/desktops/lxqt/lxqt-policykit/default.nix b/pkgs/desktops/lxqt/lxqt-policykit/default.nix index 47122d00eb8e..d501d83947ec 100644 --- a/pkgs/desktops/lxqt/lxqt-policykit/default.nix +++ b/pkgs/desktops/lxqt/lxqt-policykit/default.nix @@ -33,14 +33,6 @@ mkDerivation rec { pcre ]; - postPatch = '' - substituteInPlace autostart/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - - substituteInPlace CMakeLists.txt \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - ''; - meta = with lib; { description = "The LXQt PolicyKit agent"; homepage = https://github.com/lxqt/lxqt-policykit; diff --git a/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix b/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix index e9e6a41a62f6..9f8c66d826c5 100644 --- a/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix +++ b/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix @@ -28,16 +28,6 @@ mkDerivation rec { libqtxdg ]; - postPatch = '' - substituteInPlace autostart/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - - for f in {config,src}/CMakeLists.txt; do - substituteInPlace $f \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - done - ''; - meta = with lib; { description = "Power management module for LXQt"; homepage = https://github.com/lxqt/lxqt-powermanagement; diff --git a/pkgs/desktops/lxqt/lxqt-runner/default.nix b/pkgs/desktops/lxqt/lxqt-runner/default.nix index 7581899b5afc..d737bd91c916 100644 --- a/pkgs/desktops/lxqt/lxqt-runner/default.nix +++ b/pkgs/desktops/lxqt/lxqt-runner/default.nix @@ -32,14 +32,6 @@ mkDerivation rec { pcre ]; - postPatch = '' - substituteInPlace autostart/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - - substituteInPlace CMakeLists.txt \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - ''; - meta = with lib; { description = "Tool used to launch programs quickly by typing their names"; homepage = https://github.com/lxqt/lxqt-runner; diff --git a/pkgs/desktops/lxqt/lxqt-session/default.nix b/pkgs/desktops/lxqt/lxqt-session/default.nix index 8bf384c8f4ce..fbf2c7ddde7c 100644 --- a/pkgs/desktops/lxqt/lxqt-session/default.nix +++ b/pkgs/desktops/lxqt/lxqt-session/default.nix @@ -30,18 +30,6 @@ mkDerivation rec { xdg-user-dirs ]; - postPatch = '' - for dir in autostart config; do - substituteInPlace $dir/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - done - - for f in lxqt-{config-session,leave,session}/CMakeLists.txt; do - substituteInPlace $f \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - done - ''; - meta = with lib; { description = "An alternative session manager ported from the original razor-session"; homepage = https://github.com/lxqt/lxqt-session; diff --git a/pkgs/desktops/lxqt/lxqt-sudo/default.nix b/pkgs/desktops/lxqt/lxqt-sudo/default.nix index 10630f0f7d00..91159398b8fc 100644 --- a/pkgs/desktops/lxqt/lxqt-sudo/default.nix +++ b/pkgs/desktops/lxqt/lxqt-sudo/default.nix @@ -27,11 +27,6 @@ mkDerivation rec { sudo ]; - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace "\''${LXQT_TRANSLATIONS_DIR}" "''${out}/share/lxqt/translations" - ''; - meta = with lib; { description = "GUI frontend for sudo/su"; homepage = https://github.com/lxqt/lxqt-sudo; diff --git a/pkgs/desktops/lxqt/lxqt-themes/default.nix b/pkgs/desktops/lxqt/lxqt-themes/default.nix index a52515b73ab2..9d8da87fd5d4 100644 --- a/pkgs/desktops/lxqt/lxqt-themes/default.nix +++ b/pkgs/desktops/lxqt/lxqt-themes/default.nix @@ -16,13 +16,6 @@ mkDerivation rec { lxqt-build-tools ]; - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_GRAPHICS_DIR}" "DESTINATION \"share/lxqt/graphics" - substituteInPlace themes/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_SHARE_DIR}" "DESTINATION \"share/lxqt" - ''; - meta = with lib; { description = "Themes, graphics and icons for LXQt"; homepage = https://github.com/lxqt/lxqt-themes; diff --git a/pkgs/desktops/lxqt/pcmanfm-qt/default.nix b/pkgs/desktops/lxqt/pcmanfm-qt/default.nix index 3adf6fc90bce..168b7f35ad27 100644 --- a/pkgs/desktops/lxqt/pcmanfm-qt/default.nix +++ b/pkgs/desktops/lxqt/pcmanfm-qt/default.nix @@ -28,13 +28,6 @@ mkDerivation rec { lxmenu-data ]; - postPatch = '' - for dir in autostart config; do - substituteInPlace $dir/CMakeLists.txt \ - --replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" - done - ''; - meta = with lib; { description = "File manager and desktop icon manager (Qt port of PCManFM and libfm)"; homepage = https://github.com/lxqt/pcmanfm-qt;