From 072a7558708c9d37607d7383738bc6ef2584ac90 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Wed, 26 Jun 2019 14:19:43 -0400 Subject: [PATCH 1/2] deepin.dde-control-center: init at 4.10.11 --- .../deepin/dde-control-center/default.nix | 112 ++++++++++++++++++ .../deepin/dde-control-center/fix-paths.patch | 65 ++++++++++ pkgs/desktops/deepin/default.nix | 1 + 3 files changed, 178 insertions(+) create mode 100644 pkgs/desktops/deepin/dde-control-center/default.nix create mode 100644 pkgs/desktops/deepin/dde-control-center/fix-paths.patch diff --git a/pkgs/desktops/deepin/dde-control-center/default.nix b/pkgs/desktops/deepin/dde-control-center/default.nix new file mode 100644 index 0000000000000..906812cf98b47 --- /dev/null +++ b/pkgs/desktops/deepin/dde-control-center/default.nix @@ -0,0 +1,112 @@ +{ stdenv, fetchFromGitHub, pkgconfig, cmake, deepin, qttools, qtdeclarative, + networkmanager, qtsvg, qtx11extras, dtkcore, dtkwidget, geoip, gsettings-qt, + dde-network-utils, networkmanager-qt, xorg, mtdev, fontconfig, freetype, dde-api, + dde-daemon, qt5integration, deepin-desktop-base, deepin-desktop-schemas, dbus, + systemd, dde-qt-dbus-factory, qtmultimedia, qtbase, glib, gnome3, which, + substituteAll, wrapGAppsHook, tzdata +}: + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + pname = "dde-control-center"; + version = "4.10.11"; + + src = fetchFromGitHub { + owner = "linuxdeepin"; + repo = pname; + rev = version; + sha256 = "1ip8wjwf0n9q8xnqymzh8lz0j5gcnns976n291np6k5kdh2wqhr5"; + }; + + nativeBuildInputs = [ + cmake + deepin.setupHook + pkgconfig + wrapGAppsHook + ]; + + buildInputs = [ + dde-api + dde-daemon + dde-network-utils + dde-qt-dbus-factory + deepin-desktop-base + deepin-desktop-schemas + dtkcore + dtkwidget + fontconfig + freetype + geoip + glib + gnome3.networkmanager-l2tp + gnome3.networkmanager-openconnect + gnome3.networkmanager-openvpn + gnome3.networkmanager-vpnc + gsettings-qt + mtdev + networkmanager-qt + qt5integration + qtbase + qtdeclarative + qtmultimedia + qtsvg + qttools + qtx11extras + xorg.libX11 + xorg.libXext + xorg.libXrandr + xorg.libxcb + ]; + + cmakeFlags = [ + "-DDISABLE_SYS_UPDATE=YES" + "-DDCC_DISABLE_GRUB=YES" + ]; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + nmcli = "${networkmanager}/bin/nmcli"; + which = "${which}/bin/which"; + # not packaged + # dman = "${deepin-manual}/bin/dman"; + inherit tzdata; + # exclusive to deepin linux? + # allows to synchronize configuration files to cloud networks + # deepin_sync = "${deepin-sync}"; + }) + ]; + + postPatch = '' + searchHardCodedPaths + + patchShebangs translate_ts2desktop.sh + patchShebangs translate_generation.sh + patchShebangs translate_desktop2ts.sh + + fixPath $out /usr dde-control-center-autostart.desktop \ + com.deepin.dde.ControlCenter.service \ + src/frame/widgets/utils.h + + substituteInPlace dde-control-center.desktop \ + --replace "dbus-send" "${dbus}/bin/dbus-send" + substituteInPlace com.deepin.controlcenter.addomain.policy \ + --replace "/bin/systemctl" "${systemd}/bin/systemctl" + ''; + + postFixup = '' + # debuging + searchForUnresolvedDLL $out + searchHardCodedPaths $out + ''; + + passthru.updateScript = deepin.updateScript { inherit name; }; + + meta = with stdenv.lib; { + description = "Control panel of Deepin Desktop Environment"; + homepage = https://github.com/linuxdeepin/dde-control-center; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ romildo worldofpeace ]; + }; +} diff --git a/pkgs/desktops/deepin/dde-control-center/fix-paths.patch b/pkgs/desktops/deepin/dde-control-center/fix-paths.patch new file mode 100644 index 0000000000000..2c6e204d34379 --- /dev/null +++ b/pkgs/desktops/deepin/dde-control-center/fix-paths.patch @@ -0,0 +1,65 @@ +diff --git a/src/frame/frame.cpp b/src/frame/frame.cpp +index 90d06f8..7cdad04 100644 +--- a/src/frame/frame.cpp ++++ b/src/frame/frame.cpp +@@ -375,7 +375,7 @@ void Frame::keyPressEvent(QKeyEvent *e) + #ifdef QT_DEBUG + case Qt::Key_Escape: qApp->quit(); break; + #endif +- case Qt::Key_F1: QProcess::startDetached("dman", QStringList("dde")); break; ++ case Qt::Key_F1: QProcess::startDetached("@dman@", QStringList("dde")); break; + default:; + } + } +diff --git a/src/frame/modules/datetime/timezone_dialog/timezone.cpp b/src/frame/modules/datetime/timezone_dialog/timezone.cpp +index 3dd4aad..5f1b363 100644 +--- a/src/frame/modules/datetime/timezone_dialog/timezone.cpp ++++ b/src/frame/modules/datetime/timezone_dialog/timezone.cpp +@@ -46,7 +46,7 @@ namespace installer { + namespace { + + // Absolute path to zone.tab file. +-const char kZoneTabFile[] = "/usr/share/zoneinfo/zone.tab"; ++const char kZoneTabFile[] = "@tzdata@/share/zoneinfo/zone.tab"; + + // Absolute path to backward timezone file. + const char kTimezoneAliasFile[] = "/timezone_alias"; +diff --git a/src/frame/modules/network/connectionvpneditpage.cpp b/src/frame/modules/network/connectionvpneditpage.cpp +index e292865..95c5a2b 100644 +--- a/src/frame/modules/network/connectionvpneditpage.cpp ++++ b/src/frame/modules/network/connectionvpneditpage.cpp +@@ -215,7 +215,7 @@ void ConnectionVpnEditPage::exportConnConfig() + qDebug() << Q_FUNC_INFO << args; + + QProcess p; +- p.start("nmcli", args); ++ p.start("@nmcli@", args); + p.waitForFinished(); + qDebug() << p.readAllStandardOutput(); + qDebug() << p.readAllStandardError(); +diff --git a/src/frame/modules/network/vpnpage.cpp b/src/frame/modules/network/vpnpage.cpp +index 521a603..450d1a6 100644 +--- a/src/frame/modules/network/vpnpage.cpp ++++ b/src/frame/modules/network/vpnpage.cpp +@@ -224,7 +224,7 @@ void VpnPage::importVPN() + qDebug() << args; + + QProcess p; +- p.start("nmcli", args); ++ p.start("@nmcli@", args); + p.waitForFinished(); + const auto stat = p.exitCode(); + const QString output = p.readAllStandardOutput(); +diff --git a/src/frame/modules/sync/syncworker.cpp b/src/frame/modules/sync/syncworker.cpp +index 3f929bf..6f240d9 100644 +--- a/src/frame/modules/sync/syncworker.cpp ++++ b/src/frame/modules/sync/syncworker.cpp +@@ -24,7 +24,7 @@ SyncWorker::SyncWorker(SyncModel *model, QObject *parent) + + m_model->setSyncIsValid( + QProcess::execute( +- "which", QStringList() << "/usr/lib/deepin-sync-daemon/deepin-sync-daemon") == ++ "@which@", QStringList() << "@deepin_sync@/lib/deepin-sync-daemon/deepin-sync-daemon") == + 0 && + valueByQSettings(DCC_CONFIG_FILES, "CloudSync", "AllowCloudSync", false)); + } diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix index 6077591bb4f78..346b0fa1ee6f0 100644 --- a/pkgs/desktops/deepin/default.nix +++ b/pkgs/desktops/deepin/default.nix @@ -9,6 +9,7 @@ let dbus-factory = callPackage ./dbus-factory { }; dde-api = callPackage ./dde-api { }; dde-calendar = callPackage ./dde-calendar { }; + dde-control-center = callPackage ./dde-control-center { }; dde-daemon = callPackage ./dde-daemon { }; dde-dock = callPackage ./dde-dock { }; dde-file-manager = callPackage ./dde-file-manager { }; From 8c2bcb181e9394b0b5980402eb1a6ddd1bd9e9b1 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Wed, 26 Jun 2019 14:19:54 -0400 Subject: [PATCH 2/2] nixos/deepin: add dde-control-center --- nixos/modules/services/desktops/deepin/deepin.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/desktops/deepin/deepin.nix b/nixos/modules/services/desktops/deepin/deepin.nix index 1e46ad8329968..931bac58aceb1 100644 --- a/nixos/modules/services/desktops/deepin/deepin.nix +++ b/nixos/modules/services/desktops/deepin/deepin.nix @@ -33,6 +33,7 @@ environment.systemPackages = [ pkgs.deepin.dde-api pkgs.deepin.dde-calendar + pkgs.deepin.dde-control-center pkgs.deepin.dde-daemon pkgs.deepin.dde-dock pkgs.deepin.dde-launcher @@ -46,6 +47,7 @@ services.dbus.packages = [ pkgs.deepin.dde-api pkgs.deepin.dde-calendar + pkgs.deepin.dde-control-center pkgs.deepin.dde-daemon pkgs.deepin.dde-dock pkgs.deepin.dde-launcher