deepin.dde-dock: init at 4.9.9

This commit is contained in:
José Romildo Malaquias 2018-11-14 12:37:07 -02:00
parent e1a2c1572a
commit 3ed9e690a1
4 changed files with 149 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From c48867b73485b34b95f14e9b9bbb54507fc77648 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
Date: Fri, 19 Apr 2019 18:21:49 -0300
Subject: [PATCH] Use an environment variable for the plugins directory
---
frame/controller/dockpluginscontroller.cpp | 2 +-
plugins/tray/system-trays/systemtrayscontroller.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/frame/controller/dockpluginscontroller.cpp b/frame/controller/dockpluginscontroller.cpp
index 32a5885..efd53c8 100644
--- a/frame/controller/dockpluginscontroller.cpp
+++ b/frame/controller/dockpluginscontroller.cpp
@@ -126,7 +126,7 @@ void DockPluginsController::startLoader()
{
QString pluginsDir("../plugins");
if (!QDir(pluginsDir).exists()) {
- pluginsDir = "/usr/lib/dde-dock/plugins";
+ pluginsDir = QProcessEnvironment::systemEnvironment().value("DDE_DOCK_PLUGINS_DIR", "@out@/lib/dde-dock/plugins");
}
qDebug() << "using dock plugins dir:" << pluginsDir;
diff --git a/plugins/tray/system-trays/systemtrayscontroller.cpp b/plugins/tray/system-trays/systemtrayscontroller.cpp
index 0c8ca88..7c47d25 100644
--- a/plugins/tray/system-trays/systemtrayscontroller.cpp
+++ b/plugins/tray/system-trays/systemtrayscontroller.cpp
@@ -159,7 +159,7 @@ void SystemTraysController::startLoader()
{
QString pluginsDir("../plugins/system-trays");
if (!QDir(pluginsDir).exists()) {
- pluginsDir = "/usr/lib/dde-dock/plugins/system-trays";
+ pluginsDir = QProcessEnvironment::systemEnvironment().value("DDE_DOCK_PLUGINS_DIR", "@out@/lib/dde-dock/plugins") + "/system-trays";
}
qDebug() << "using system tray plugins dir:" << pluginsDir;
--
2.21.0

View File

@ -0,0 +1,87 @@
{ stdenv, fetchFromGitHub, cmake, pkgconfig, qttools, qtx11extras,
qtsvg, libsForQt5, polkit, gsettings-qt, dtkcore, dtkwidget,
dde-qt-dbus-factory, dde-network-utils, dde-daemon,
deepin-desktop-schemas, xorg, glib, wrapGAppsHook, deepin,
plugins ? [], symlinkJoin, makeWrapper }:
let
unwrapped = stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "dde-dock";
version = "4.9.9";
src = fetchFromGitHub {
owner = "linuxdeepin";
repo = pname;
rev = version;
sha256 = "0vscm808q63bbl84q9l3vhhd8mw86wfjdh55rvyj42qpa5q4mvlz";
};
nativeBuildInputs = [
cmake
pkgconfig
qttools
wrapGAppsHook
deepin.setupHook
];
buildInputs = [
dde-daemon
dde-network-utils
dde-qt-dbus-factory
deepin-desktop-schemas
dtkcore
dtkwidget
glib.bin
gsettings-qt
libsForQt5.libdbusmenu
polkit
qtsvg
qtx11extras
xorg.libXdmcp
xorg.libXtst
xorg.libpthreadstubs
];
patches = [
./dde-dock.plugins-dir.patch
];
postPatch = ''
searchHardCodedPaths
patchShebangs translate_generation.sh
fixPath $out /etc/dde-dock plugins/keyboard-layout/CMakeLists.txt
fixPath $out /usr cmake/DdeDock/DdeDockConfig.cmake
fixPath $out /usr dde-dock.pc
fixPath $out /usr/bin/dde-dock frame/com.deepin.dde.Dock.service
fixPath $out /usr/share/dbus-1 CMakeLists.txt
fixPath ${dde-daemon} /usr/lib/deepin-daemon frame/item/showdesktopitem.cpp
fixPath ${dde-network-utils} /usr/share/dde-network-utils frame/main.cpp
fixPath ${polkit} /usr/bin/pkexec plugins/overlay-warning/overlay-warning-plugin.cpp
substituteInPlace frame/controller/dockpluginscontroller.cpp --subst-var-by out $out
substituteInPlace plugins/tray/system-trays/systemtrayscontroller.cpp --subst-var-by out $out
'';
cmakeFlags = [ "-DDOCK_TRAY_USE_NATIVE_POPUP=YES" ];
postFixup = ''
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { inherit name; };
meta = with stdenv.lib; {
description = "Dock for Deepin Desktop Environment";
homepage = https://github.com/linuxdeepin/dde-dock;
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ romildo ];
};
};
in if plugins == [] then unwrapped
else import ./wrapper.nix {
inherit makeWrapper symlinkJoin plugins;
dde-dock = unwrapped;
}

View File

@ -0,0 +1,21 @@
{ makeWrapper, symlinkJoin, dde-dock, plugins }:
symlinkJoin {
name = "dde-dock-with-plugins-${dde-dock.version}";
paths = [ dde-dock ] ++ plugins;
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/dde-dock \
--set DDE_DOCK_PLUGINS_DIR "$out/lib/dde-dock/plugins"
rm $out/share/dbus-1/services/com.deepin.dde.Dock.service
substitute ${dde-dock}/share/dbus-1/services/com.deepin.dde.Dock.service $out/share/dbus-1/services/com.deepin.dde.Dock.service \
--replace ${dde-dock} $out
'';
inherit (dde-dock) meta;
}

View File

@ -10,8 +10,9 @@ let
dde-api = callPackage ./dde-api { };
dde-calendar = callPackage ./dde-calendar { };
dde-daemon = callPackage ./dde-daemon { };
dde-polkit-agent = callPackage ./dde-polkit-agent { };
dde-dock = callPackage ./dde-dock { };
dde-network-utils = callPackage ./dde-network-utils { };
dde-polkit-agent = callPackage ./dde-polkit-agent { };
dde-qt-dbus-factory = callPackage ./dde-qt-dbus-factory { };
dde-session-ui = callPackage ./dde-session-ui { };
deepin-desktop-base = callPackage ./deepin-desktop-base { };