summary refs log tree commit diff
path: root/pkgs/desktops/deepin
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-10-21 22:19:43 -0400
committerworldofpeace <worldofpeace@protonmail.ch>2019-10-22 08:50:30 -0400
commit69e90bd1a7c2bd65307b1db2192c621cbc0734be (patch)
tree1c51800e7b0ec378de5cb7d2e8c9ab0880b73494 /pkgs/desktops/deepin
parentd797361cc70e3a31b5190cea3b744a245052902d (diff)
downloadnixpkgs-69e90bd1a7c2bd65307b1db2192c621cbc0734be.tar
nixpkgs-69e90bd1a7c2bd65307b1db2192c621cbc0734be.tar.gz
nixpkgs-69e90bd1a7c2bd65307b1db2192c621cbc0734be.tar.bz2
nixpkgs-69e90bd1a7c2bd65307b1db2192c621cbc0734be.tar.lz
nixpkgs-69e90bd1a7c2bd65307b1db2192c621cbc0734be.tar.xz
nixpkgs-69e90bd1a7c2bd65307b1db2192c621cbc0734be.tar.zst
nixpkgs-69e90bd1a7c2bd65307b1db2192c621cbc0734be.zip
deepin.dde-kwin: init at 5.0.0
Diffstat (limited to 'pkgs/desktops/deepin')
-rw-r--r--pkgs/desktops/deepin/dde-kwin/default.nix124
-rw-r--r--pkgs/desktops/deepin/dde-kwin/plugin-paths.patch16
-rw-r--r--pkgs/desktops/deepin/default.nix1
3 files changed, 141 insertions, 0 deletions
diff --git a/pkgs/desktops/deepin/dde-kwin/default.nix b/pkgs/desktops/deepin/dde-kwin/default.nix
new file mode 100644
index 00000000000..002971ca077
--- /dev/null
+++ b/pkgs/desktops/deepin/dde-kwin/default.nix
@@ -0,0 +1,124 @@
+{ stdenv
+, mkDerivation
+, pkgconfig
+, fetchFromGitHub
+, deepin
+, cmake
+, extra-cmake-modules
+, qtbase
+, libxcb
+, kglobalaccel
+, kwindowsystem
+, kcoreaddons
+, kwin
+, dtkcore
+, gsettings-qt
+, fontconfig
+, deepin-desktop-schemas
+, glib
+, libXrender
+, mtdev
+, qttools
+, deepin-gettext-tools
+, kwayland
+, qtx11extras
+, qtquickcontrols2
+, epoxy
+, qt5integration
+, dde-session-ui
+, dbus
+, wrapGAppsHook
+}:
+
+mkDerivation rec {
+  pname = "dde-kwin";
+  version = "5.0.0";
+
+  src = fetchFromGitHub {
+    owner = "linuxdeepin";
+    repo = pname;
+    rev = version;
+    sha256 = "0bvkx9h5ygj46a0j76kfyq3gvk6zn4fx6clhrmcr40hbi2k33cbl";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    deepin-gettext-tools
+    deepin.setupHook
+    extra-cmake-modules
+    pkgconfig
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    deepin-desktop-schemas
+    dtkcore
+    epoxy
+    fontconfig
+    glib
+    gsettings-qt
+    kcoreaddons
+    kglobalaccel
+    kwayland
+    kwin
+    kwindowsystem
+    libXrender
+    libxcb
+    mtdev
+    qtbase
+    qtquickcontrols2
+    qttools
+    qtx11extras
+    qt5integration
+  ];
+
+  NIX_CFLAGS_COMPILE = "-I${kwayland.dev}/include/KF5";
+
+  cmakeFlags = [
+    "-DKWIN_VERSION=${(builtins.parseDrvName kwin.name).version}"
+  ];
+
+  patches = [
+    ./plugin-paths.patch
+  ];
+
+  postPatch = ''
+    searchHardCodedPaths
+
+    patchShebangs translate_ts2desktop.sh \
+      translate_generation.sh \
+      translate_desktop2ts.sh \
+      plugins/kwin-xcb/plugin/translate_generation.sh
+
+    fixPath ${deepin-gettext-tools} /usr/bin/deepin-desktop-ts-convert translate_desktop2ts.sh translate_ts2desktop.sh
+
+    fixPath $out /etc/xdg configures/CMakeLists.txt deepin-wm-dbus/deepinwmfaker.cpp
+
+    # Need environmental patch
+    fixPath /run/current-system/sw /usr/lib plugins/kwin-xcb/plugin/main.cpp
+
+    substituteInPlace configures/kwin-wm-multitaskingview.desktop \
+      --replace "dbus-send" "${dbus}/bin/dbus-send"
+
+    fixPath ${dde-session-ui} /usr/lib/deepin-daemon/dde-warning-dialog deepin-wm-dbus/deepinwmfaker.cpp
+
+    substituteInPlace CMakeLists.txt \
+      --subst-var-by plugin_path "$out/$qtPluginPrefix"
+  '';
+
+  postFixup = ''
+    chmod +x $out/bin/kwin_no_scale
+  '';
+
+  enableParallelBuilding = true;
+
+  passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
+
+  meta = with stdenv.lib; {
+    description = "KWin configures on DDE";
+    homepage = "https://github.com/linuxdeepin/dde-kwin";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ romildo worldofpeace ];
+  };
+}
diff --git a/pkgs/desktops/deepin/dde-kwin/plugin-paths.patch b/pkgs/desktops/deepin/dde-kwin/plugin-paths.patch
new file mode 100644
index 00000000000..1bf576e5c1a
--- /dev/null
+++ b/pkgs/desktops/deepin/dde-kwin/plugin-paths.patch
@@ -0,0 +1,16 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index feef49d..ecb7ed2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -26,9 +26,9 @@ macro(query_qmake args output)
+     endif()
+ endmacro()
+
+-query_qmake("QT_INSTALL_PLUGINS" QT_INSTALL_PLUGINS)
++set(QT_INSTALL_PLUGINS @plugin_path@)
+
+-set(PLUGIN_INSTALL_PATH ${QT_INSTALL_PLUGINS}/platforms)
++set(PLUGIN_INSTALL_PATH @plugin_path@/platforms)
+ # Find includes in corresponding build directories
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ # Instruct CMake to run moc automatically when needed
diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix
index cec6abca40b..5d4b6f73244 100644
--- a/pkgs/desktops/deepin/default.nix
+++ b/pkgs/desktops/deepin/default.nix
@@ -13,6 +13,7 @@ let
     dde-daemon = callPackage ./dde-daemon { };
     dde-dock = callPackage ./dde-dock { };
     dde-file-manager = callPackage ./dde-file-manager { };
+    dde-kwin = callPackage ./dde-kwin { };
     dde-launcher = callPackage ./dde-launcher { };
     dde-network-utils = callPackage ./dde-network-utils { };
     dde-polkit-agent = callPackage ./dde-polkit-agent { };