From 4f9339f6c4564ba618bde6f5d3097757635fa0d6 Mon Sep 17 00:00:00 2001 From: rewine Date: Thu, 12 Jan 2023 16:06:06 +0800 Subject: [PATCH] deepin.dde-control-center: init at 5.6.3 --- .../core/dde-control-center/default.nix | 140 ++++++++++++++++++ ...endUserLicenseAgreement-for-deepinos.patch | 29 ++++ pkgs/desktops/deepin/default.nix | 1 + 3 files changed, 170 insertions(+) create mode 100644 pkgs/desktops/deepin/core/dde-control-center/default.nix create mode 100644 pkgs/desktops/deepin/core/dde-control-center/dont-show-endUserLicenseAgreement-for-deepinos.patch diff --git a/pkgs/desktops/deepin/core/dde-control-center/default.nix b/pkgs/desktops/deepin/core/dde-control-center/default.nix new file mode 100644 index 0000000000000..ffa77afa6cde8 --- /dev/null +++ b/pkgs/desktops/deepin/core/dde-control-center/default.nix @@ -0,0 +1,140 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchpatch +, dtkwidget +, qt5integration +, qt5platform-plugins +, dde-qt-dbus-factory +, deepin-pw-check +, udisks2-qt5 +, cmake +, qttools +, qtbase +, pkg-config +, qtx11extras +, qtmultimedia +, wrapQtAppsHook +, wrapGAppsHook +, gsettings-qt +, wayland +, kwayland +, qtwayland +, polkit-qt +, pcre +, xorg +, libselinux +, libsepol +, libxcrypt +, librsvg +, networkmanager-qt +, glib +, runtimeShell +, tzdata +, dbus +, gtest +}: + +stdenv.mkDerivation rec { + pname = "dde-control-center"; + version = "5.6.3"; + + src = fetchFromGitHub { + owner = "linuxdeepin"; + repo = pname; + rev = version; + sha256 = "sha256-/gzS+IbopIDRpufsa9cEfFBOqehPUnF4IozvwW8UEbY="; + }; + + patches = [ + # UserExperienceProgramLicenseAgreement comes from a non-open source component(deepin-deepinid-client) + # If we don't block it, only an empty page will be displayed here + # Remove this patch when dde-control-center is upgraded to 6.0.0 + ./dont-show-endUserLicenseAgreement-for-deepinos.patch + ]; + + postPatch = '' + substituteInPlace src/frame/window/{mainwindow.cpp,insertplugin.cpp} com.deepin.controlcenter.develop.policy \ + --replace "/usr/lib/dde-control-center" "/run/current-system/sw/lib/dde-control-center" + + substituteInPlace src/frame/modules/datetime/timezone_dialog/timezone.cpp \ + --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" + + substituteInPlace src/frame/modules/accounts/accountsworker.cpp \ + --replace "/bin/bash" "${runtimeShell}" + + substituteInPlace dde-control-center-autostart.desktop \ + --replace "/usr" "$out" + + substituteInPlace com.deepin.dde.ControlCenter.service \ + --replace "/usr/bin/dbus-send" "${dbus}/bin/dbus-send" \ + --replace "/usr/share" "$out/share" + + substituteInPlace include/widgets/utils.h src/{reboot-reminder-dialog/main.cpp,frame/main.cpp,reset-password-dialog/main.cpp} \ + --replace "/usr/share/dde-control-center" "$out/share/dde-control-center" + + substituteInPlace dde-control-center-wapper \ + --replace "qdbus" "${qttools.bin}/bin/qdbus" \ + --replace "/usr/share" "$out/share" + ''; + + nativeBuildInputs = [ + cmake + qttools + pkg-config + wrapQtAppsHook + wrapGAppsHook + ]; + dontWrapGApps = true; + + buildInputs = [ + dtkwidget + qt5platform-plugins + dde-qt-dbus-factory + deepin-pw-check + qtbase + qtx11extras + qtmultimedia + gsettings-qt + udisks2-qt5 + wayland + kwayland + qtwayland + polkit-qt + pcre + xorg.libXdmcp + libselinux + libsepol + libxcrypt + librsvg + networkmanager-qt + gtest + ]; + + cmakeFlags = [ + "-DCVERSION=${version}" + "-DDISABLE_AUTHENTICATION=YES" + "-DDISABLE_ACTIVATOR=YES" + "-DDISABLE_SYS_UPDATE=YES" + "-DDISABLE_RECOVERY=YES" + ]; + + # qt5integration must be placed before qtsvg in QT_PLUGIN_PATH + qtWrapperArgs = [ + "--prefix QT_PLUGIN_PATH : ${qt5integration}/${qtbase.qtPluginPrefix}" + "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ librsvg ]}" + ]; + + preFixup = '' + glib-compile-schemas ${glib.makeSchemaPath "$out" "${pname}-${version}"} + qtWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + meta = with lib; { + description = "Control panel of Deepin Desktop Environment"; + homepage = "https://github.com/linuxdeepin/dde-control-center"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = teams.deepin.members; + }; +} diff --git a/pkgs/desktops/deepin/core/dde-control-center/dont-show-endUserLicenseAgreement-for-deepinos.patch b/pkgs/desktops/deepin/core/dde-control-center/dont-show-endUserLicenseAgreement-for-deepinos.patch new file mode 100644 index 0000000000000..491007ea2bf39 --- /dev/null +++ b/pkgs/desktops/deepin/core/dde-control-center/dont-show-endUserLicenseAgreement-for-deepinos.patch @@ -0,0 +1,29 @@ +From adcc5eb58e2dcd06810a40c237bc7984c2c5af4b Mon Sep 17 00:00:00 2001 +From: rewine +Date: Sun, 8 Jan 2023 13:46:17 +0800 +Subject: [PATCH] dont show endUserLicenseAgreement for deepinos + +--- + src/frame/window/modules/systeminfo/systeminfowidget.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/frame/window/modules/systeminfo/systeminfowidget.cpp b/src/frame/window/modules/systeminfo/systeminfowidget.cpp +index 8e62604fb..0f443ee20 100644 +--- a/src/frame/window/modules/systeminfo/systeminfowidget.cpp ++++ b/src/frame/window/modules/systeminfo/systeminfowidget.cpp +@@ -78,6 +78,12 @@ void SystemInfoWidget::initData() + m_listView->setRowHidden(i, true); + } + } ++ ++ if (IsNotDeepinUos) { ++ if (m.gsettingsName == "endUserLicenseAgreement") { ++ m_listView->setRowHidden(i, true); ++ } ++ } + } + + if (InsertPlugin::instance()->updatePluginInfo("systeminfo")) +-- +2.38.1 + diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix index f9bbf7df5eb73..c61d4d724c7b6 100644 --- a/pkgs/desktops/deepin/default.nix +++ b/pkgs/desktops/deepin/default.nix @@ -30,6 +30,7 @@ let udisks2-qt5 = callPackage ./library/udisks2-qt5 { }; #### CORE + dde-control-center = callPackage ./core/dde-control-center { }; dde-calendar = callPackage ./core/dde-calendar { }; dde-polkit-agent = callPackage ./core/dde-polkit-agent { }; dpa-ext-gnomekeyring = callPackage ./core/dpa-ext-gnomekeyring { };