lxqt: use modified LXQtConfigVars CMake macro

LXQt uses the values in this macro to set installation
directories and in the case of lxqt-session to substitute in paths.
However, by doing this all the paths are from within lxqt-build-tools
prefix. By utilizing a setup hook we can set the directories with the
correct prefix as cmake flags.
This commit is contained in:
worldofpeace 2019-08-22 00:42:28 -04:00
parent 3167eb3780
commit e34de045b6
19 changed files with 31 additions and 133 deletions

View file

@ -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; {

View file

@ -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;

View file

@ -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; {

View file

@ -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";

View file

@ -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}\"")

View file

@ -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";

View file

@ -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)

View file

@ -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
'';

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;