about summary refs log tree commit diff
path: root/pkgs/desktops
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-04-28 16:18:21 +0800
committerGitHub <noreply@github.com>2023-04-28 16:18:21 +0800
commitb90d93cb33c1f7861b2382894d27d4575a332e91 (patch)
treeed9b1f031b2af2871777aee07122540aaf0a9a92 /pkgs/desktops
parent8d9c7264719920080eec355feeece3127b3d27f6 (diff)
parent952dceb87b2ebf6ba011ac029b138b2c482b9202 (diff)
downloadnixlib-b90d93cb33c1f7861b2382894d27d4575a332e91.tar
nixlib-b90d93cb33c1f7861b2382894d27d4575a332e91.tar.gz
nixlib-b90d93cb33c1f7861b2382894d27d4575a332e91.tar.bz2
nixlib-b90d93cb33c1f7861b2382894d27d4575a332e91.tar.lz
nixlib-b90d93cb33c1f7861b2382894d27d4575a332e91.tar.xz
nixlib-b90d93cb33c1f7861b2382894d27d4575a332e91.tar.zst
nixlib-b90d93cb33c1f7861b2382894d27d4575a332e91.zip
Merge pull request #215075 from wineee/kwin
{deepin/dde}-kwin: init
Diffstat (limited to 'pkgs/desktops')
-rw-r--r--pkgs/desktops/deepin/core/dde-kwin/default.nix92
-rw-r--r--pkgs/desktops/deepin/core/deepin-kwin/default.nix120
-rw-r--r--pkgs/desktops/deepin/default.nix2
3 files changed, 214 insertions, 0 deletions
diff --git a/pkgs/desktops/deepin/core/dde-kwin/default.nix b/pkgs/desktops/deepin/core/dde-kwin/default.nix
new file mode 100644
index 000000000000..bf1ca7317a40
--- /dev/null
+++ b/pkgs/desktops/deepin/core/dde-kwin/default.nix
@@ -0,0 +1,92 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, pkg-config
+, extra-cmake-modules
+, deepin-gettext-tools
+, wrapQtAppsHook
+, makeWrapper
+, dtkcore
+, qtbase
+, qtx11extras
+, gsettings-qt
+, xorg
+, libepoxy
+, deepin-kwin
+, kdecoration
+, kconfig
+, kwayland
+, kwindowsystem
+, kglobalaccel
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dde-kwin";
+  version = "5.6.5";
+
+  src = fetchFromGitHub {
+    owner = "linuxdeepin";
+    repo = pname;
+    rev = "b5c00527b86f773595c786c8015d60f8be3a681b";
+    sha256 = "sha256-qXN9AwjLnqO5BpnrX5PaSCKZ6ff874r08ubCMM272tA=";
+  };
+
+  /*
+    This is the final version of dde-kwin, upstream has been archived.
+    We should remove this package when deepin-kwin release a new version.
+  */
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "/usr/include/KWaylandServer" "${kwayland.dev}/include/KWaylandServer"
+    substituteInPlace deepin-wm-dbus/deepinwmfaker.cpp \
+      --replace "/usr/lib/deepin-daemon" "/run/current-system/sw/lib/deepin-daemon" \
+      --replace "/usr/share/backgrounds" "/run/current-system/sw/share/backgrounds" \
+      --replace "/usr/share/wallpapers" "/run/current-system/sw/share/wallpapers"
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    extra-cmake-modules
+    deepin-gettext-tools
+    wrapQtAppsHook
+    makeWrapper
+  ];
+
+  buildInputs = [
+    dtkcore
+    qtbase
+    qtx11extras
+    gsettings-qt
+    xorg.libXdmcp
+    libepoxy
+    deepin-kwin
+    kdecoration
+    kconfig
+    kwayland
+    kwindowsystem
+    kglobalaccel
+  ];
+
+  cmakeFlags = [
+    "-DPROJECT_VERSION=${version}"
+    "-DQT_INSTALL_PLUGINS=${placeholder "out"}/${qtbase.qtPluginPrefix}"
+  ];
+
+  # kwin_no_scale is a shell script
+  postFixup = ''
+    wrapProgram $out/bin/kwin_no_scale \
+      --set QT_QPA_PLATFORM_PLUGIN_PATH "${placeholder "out"}/${qtbase.qtPluginPrefix}"
+  '';
+
+  meta = with lib; {
+    description = "KWin configuration for Deepin Desktop Environment";
+    homepage = "https://github.com/linuxdeepin/dde-kwin";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = teams.deepin.members;
+  };
+}
diff --git a/pkgs/desktops/deepin/core/deepin-kwin/default.nix b/pkgs/desktops/deepin/core/deepin-kwin/default.nix
new file mode 100644
index 000000000000..456f20b51906
--- /dev/null
+++ b/pkgs/desktops/deepin/core/deepin-kwin/default.nix
@@ -0,0 +1,120 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, pkg-config
+, wayland
+, dwayland
+, qtbase
+, qttools
+, qtx11extras
+, wrapQtAppsHook
+, extra-cmake-modules
+, gsettings-qt
+, libepoxy
+, kconfig
+, kconfigwidgets
+, kcoreaddons
+, kcrash
+, kdbusaddons
+, kiconthemes
+, kglobalaccel
+, kidletime
+, knotifications
+, kpackage
+, plasma-framework
+, kcmutils
+, knewstuff
+, kdecoration
+, kscreenlocker
+, breeze-qt5
+, libinput
+, mesa
+, lcms2
+, xorg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "deepin-kwin";
+  version = "5.24.3-deepin.1.9";
+
+  /*
+    There are no buildable tag in github:
+      - 5.15 tag in eagel branch is used for UOS, it's too old to compile.
+      - 5.25 tag in master branch only work on unreleased deepin v23.
+    Since deepin-kwin was not maintained on github before, we lost all
+    tags in master branch, this version is read from debian/changelog
+  */
+
+  src = fetchFromGitHub {
+    owner = "linuxdeepin";
+    repo = pname;
+    rev = "98c9085670938937e2a1ce964f6acddc5c1d6eb5";
+    sha256 = "sha256-/hgDuaDrpwAQsMIoaS8pGBJwWfJSrq6Yjic3a60ITtM=";
+  };
+
+  # Avoid using absolute path to distinguish applications
+  postPatch = ''
+    substituteInPlace src/effects/screenshot/screenshotdbusinterface1.cpp \
+      --replace 'file.readAll().startsWith(DEFINE_DDE_DOCK_PATH"dde-dock")' 'file.readAll().contains("dde-dock")'
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    extra-cmake-modules
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    qtbase
+    qttools
+    qtx11extras
+    wayland
+    dwayland
+    libepoxy
+    gsettings-qt
+
+    kconfig
+    kconfigwidgets
+    kcoreaddons
+    kcrash
+    kdbusaddons
+    kiconthemes
+
+    kglobalaccel
+    kidletime
+    knotifications
+    kpackage
+    plasma-framework
+    kcmutils
+    knewstuff
+    kdecoration
+    kscreenlocker
+
+    breeze-qt5
+    libinput
+    mesa
+    lcms2
+
+    xorg.libxcb
+    xorg.libXdmcp
+    xorg.libXcursor
+    xorg.xcbutilcursor
+    xorg.libXtst
+  ];
+
+  cmakeFlags = [
+    "-DKWIN_BUILD_RUNNERS=OFF"
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  meta = with lib; {
+    description = "Fork of kwin, an easy to use, but flexible, composited Window Manager";
+    homepage = "https://github.com/linuxdeepin/deepin-kwin";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = teams.deepin.members;
+  };
+}
diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix
index 0b4bffe38438..7f89e20a7a34 100644
--- a/pkgs/desktops/deepin/default.nix
+++ b/pkgs/desktops/deepin/default.nix
@@ -23,6 +23,8 @@ let
     util-dfm = callPackage ./library/util-dfm { };
 
     #### CORE
+    dde-kwin = callPackage ./core/dde-kwin { };
+    deepin-kwin = callPackage ./core/deepin-kwin { };
     dde-app-services = callPackage ./core/dde-app-services { };
     dde-control-center = callPackage ./core/dde-control-center { };
     dde-calendar = callPackage ./core/dde-calendar { };