From ee7041cdf6fa87ac5117e1bcf8d6f5fc9173757c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Mon, 12 Nov 2018 18:51:50 -0200 Subject: [PATCH 1/6] deepin.startdde: init at 5.0.1 --- pkgs/desktops/deepin/default.nix | 1 + pkgs/desktops/deepin/startdde/default.nix | 136 ++++++++++++++++++++++ pkgs/desktops/deepin/startdde/deps.nix | 30 +++++ 3 files changed, 167 insertions(+) create mode 100644 pkgs/desktops/deepin/startdde/default.nix create mode 100644 pkgs/desktops/deepin/startdde/deps.nix diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix index 57b0b35a5327..64dbdbfd104c 100644 --- a/pkgs/desktops/deepin/default.nix +++ b/pkgs/desktops/deepin/default.nix @@ -50,6 +50,7 @@ let qcef = callPackage ./qcef { }; qt5dxcb-plugin = callPackage ./qt5dxcb-plugin { }; qt5integration = callPackage ./qt5integration { }; + startdde = callPackage ./startdde { }; udisks2-qt5 = callPackage ./udisks2-qt5 { }; }; diff --git a/pkgs/desktops/deepin/startdde/default.nix b/pkgs/desktops/deepin/startdde/default.nix new file mode 100644 index 000000000000..137b3f690a67 --- /dev/null +++ b/pkgs/desktops/deepin/startdde/default.nix @@ -0,0 +1,136 @@ +{ stdenv, buildGoPackage, fetchFromGitHub, pkgconfig, alsaLib, + coreutils, dbus-factory, dde-api, dde-daemon, dde-dock, + dde-file-manager, dde-polkit-agent, dde-session-ui, deepin, + deepin-desktop-base, deepin-desktop-schemas, deepin-turbo, + dde-kwin, glib, gnome3, go, go-dbus-factory, go-gir-generator, + go-lib, gtk3, jq, kmod, libX11, libXi, libcgroup, pciutils, psmisc, + pulseaudio, systemd, xorg, wrapGAppsHook }: + +buildGoPackage rec { + name = "${pname}-${version}"; + pname = "startdde"; + version = "5.0.1"; + + goPackagePath = "pkg.deepin.io/dde/startdde"; + + src = fetchFromGitHub { + owner = "linuxdeepin"; + repo = pname; + rev = version; + sha256 = "1xydmglydksy7hjlavf5pbfy0s0lndgavh8x3kg2mg7d36mbra43"; + }; + + goDeps = ./deps.nix; + + outputs = [ "out" ]; + + nativeBuildInputs = [ + pkgconfig + dbus-factory + dde-api + go-dbus-factory + go-gir-generator + go-lib + jq + wrapGAppsHook + deepin.setupHook + ]; + + buildInputs = [ + alsaLib + dde-daemon + dde-dock + dde-file-manager + dde-kwin + dde-polkit-agent + dde-session-ui + deepin-desktop-schemas + deepin-turbo + glib + gnome3.dconf + gnome3.gnome-keyring + gnome3.libgnome-keyring + gtk3 + kmod + libX11 + libXi + libcgroup + pciutils + psmisc + pulseaudio + systemd + xorg.xdriinfo + ]; + + postPatch = '' + searchHardCodedPaths # debugging + + # Commented lines below indicates a doubt about how to fix the hard coded path + + fixPath $out /etc/X11 Makefile + #fixPath ? /etc/xdg/autostop autostop/autostop.go + fixPath ${coreutils} /bin/ls copyfile_test.go + fixPath $out /usr/share/startdde/auto_launch.json launch_group.go + #fixPath ? /usr/bin/kwin_no_scale main.go # not found on deepin linux and archlinux + fixPath $out /usr/share/startdde/memchecker.json memchecker/config.go + fixPath $out /usr/bin/startdde misc/00deepin-dde-env + fixPath ${dde-file-manager} /usr/bin/dde-file-manager misc/auto_launch/chinese.json + fixPath ${deepin-turbo} /usr/lib/deepin-turbo/booster-dtkwidget misc/auto_launch/chinese.json + fixPath ${dde-daemon} /usr/lib/deepin-daemon/dde-session-daemon misc/auto_launch/chinese.json misc/auto_launch/default.json + fixPath ${dde-dock} /usr/bin/dde-dock misc/auto_launch/chinese.json misc/auto_launch/default.json + fixPath ${dde-file-manager} /usr/bin/dde-desktop misc/auto_launch/chinese.json misc/auto_launch/default.json + fixPath $out /usr/bin/startdde misc/deepin-session + #fixPath ? /usr/lib/lightdm/config-error-dialog.sh misc/deepin-session # provided by lightdm on deepin linux + #fixPath ? /usr/sbin/lightdm-session misc/deepin-session # provided by lightdm on deepin linux + fixPath ${dde-session-ui} /usr/bin/dde-lock session.go + fixPath ${dde-session-ui} /usr/bin/dde-shutdown session.go + fixPath ${dde-session-ui} /usr/lib/deepin-daemon/dde-osd session.go + fixPath ${deepin-desktop-base} /etc/deepin-version session.go + fixPath ${gnome3.gnome-keyring} /usr/bin/gnome-keyring-daemon session.go + fixPath ${pulseaudio} /usr/bin/pulseaudio sound_effect.go + #fixPath ? /usr/lib/UIAppSched.hooks startmanager.go # not found anything about this + fixPath ${dde-session-ui} /usr/lib/deepin-daemon/dde-welcome utils.go + fixPath ${dde-polkit-agent} /usr/lib/polkit-1-dde/dde-polkit-agent watchdog/dde_polkit_agent.go + #fixPath ? /var/log/Xorg.0.log wm/driver.go + #fixPath ? /etc/deepin-wm-switcher/config.json wm/switcher_config.go # not present on nixos, deepin linux and archlinux + + substituteInPlace wm/driver.go --replace '/sbin/lsmod' "${kmod}/bin/lsmod" + + substituteInPlace session.go --replace 'LookPath("cgexec"' 'LookPath("${libcgroup}/bin/cgexec"' + substituteInPlace vm.go --replace 'Command("dde-wm-chooser"' 'Command("${dde-session-ui}/bin/dde-wm-chooser"' + substituteInPlace vm.go --replace 'Command("systemd-detect-virt"' 'Command("${systemd}/bin/systemd-detect-virt"' + substituteInPlace wm/card_info.go --replace 'Command("lspci"' 'Command("${pciutils}/bin/lspci"' + substituteInPlace wm/driver.go --replace 'Command("lspci"' 'Command("${pciutils}/bin/lspci"' + substituteInPlace wm/driver.go --replace 'Command("xdriinfo"' 'Command("${xorg.xdriinfo}/bin/xdriinfo"' + substituteInPlace wm/platform.go --replace 'Command("gsettings"' 'Command("${glib}/bin/gsettings"' + substituteInPlace wm/platform.go --replace 'Command("uname"' 'Command("${coreutils}/bin/uname"' + substituteInPlace wm/switcher.go --replace 'Command("killall"' 'Command("${psmisc}/bin/killall"' + ''; + + buildPhase = '' + make -C go/src/${goPackagePath} + ''; + + installPhase = '' + make install PREFIX="$out" -C go/src/${goPackagePath} + rm -rf $out/share/lightdm # this is uselesss for NixOS + remove-references-to -t ${go} $out/bin/* $out/sbin/* + ''; + + postFixup = '' + searchHardCodedPaths $out # debugging + ''; + + passthru = { + updateScript = deepin.updateScript { inherit name; }; + providedSessions = [ "deepin" ]; + }; + + meta = with stdenv.lib; { + description = "Starter of deepin desktop environment"; + homepage = https://github.com/linuxdeepin/startdde; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ romildo ]; + }; +} diff --git a/pkgs/desktops/deepin/startdde/deps.nix b/pkgs/desktops/deepin/startdde/deps.nix new file mode 100644 index 000000000000..8898b8c50fb7 --- /dev/null +++ b/pkgs/desktops/deepin/startdde/deps.nix @@ -0,0 +1,30 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.3.0 +[ + { + goPackagePath = "github.com/cryptix/wav"; + fetch = { + type = "git"; + url = "https://github.com/cryptix/wav"; + rev = "8bdace674401f0bd3b63c65479b6a6ff1f9d5e44"; + sha256 = "18nyqv0ic35fs9fny8sj84c00vbxs8mnric6vr6yl42624fh5id6"; + }; + } + { + goPackagePath = "github.com/linuxdeepin/go-x11-client"; + fetch = { + type = "git"; + url = "https://github.com/linuxdeepin/go-x11-client"; + rev = "b5b01565d224d5ccd5a4143d9099acceb23e182a"; + sha256 = "1lnffjp8bqy6f8caw6drg1js6hny5w7432riqchcrcd4q85d94rs"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "daa7c04131f568e31c51927b359a2d197a357058"; + sha256 = "17gbfvb5iqyayzw0zd6q218zsbf7x74rflvn18wkxvsw95n1y54h"; + }; + } +] From ff72e1dfc10889a56c512521ff9a224183133810 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 8 Aug 2019 10:59:58 -0400 Subject: [PATCH 2/6] deepin.dde-control-center: use gapps wrapper Forgot about wrapQtAppsHook only wrapping binaries that are ELF headers. So it can't wrap it if it already is. --- pkgs/desktops/deepin/dde-control-center/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/desktops/deepin/dde-control-center/default.nix b/pkgs/desktops/deepin/dde-control-center/default.nix index 97e44c6c36ea..a644da2e9a9c 100644 --- a/pkgs/desktops/deepin/dde-control-center/default.nix +++ b/pkgs/desktops/deepin/dde-control-center/default.nix @@ -93,6 +93,14 @@ mkDerivation rec { --replace "/bin/systemctl" "${systemd}/bin/systemctl" ''; + dontWrapQtApps = true; + + preFixup = '' + gappsWrapperArgs+=( + "''${qtWrapperArgs[@]}" + ) + ''; + postFixup = '' # debuging searchForUnresolvedDLL $out From 2fe9525dff97d848c47085d6786cba146d91d156 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 8 Aug 2019 11:00:08 -0400 Subject: [PATCH 3/6] deepin.dde-dock: use gapps wrapper Forgot about wrapQtAppsHook only wrapping binaries that are ELF headers. So it can't wrap it if it already is. --- pkgs/desktops/deepin/dde-dock/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/deepin/dde-dock/default.nix b/pkgs/desktops/deepin/dde-dock/default.nix index 7b44b69d5b7b..62d5622340c2 100644 --- a/pkgs/desktops/deepin/dde-dock/default.nix +++ b/pkgs/desktops/deepin/dde-dock/default.nix @@ -31,7 +31,7 @@ unwrapped = mkDerivation rec { deepin-desktop-schemas dtkcore dtkwidget - glib.bin + glib gsettings-qt libdbusmenu polkit @@ -64,6 +64,14 @@ unwrapped = mkDerivation rec { cmakeFlags = [ "-DDOCK_TRAY_USE_NATIVE_POPUP=YES" ]; + dontWrapQtApps = true; + + preFixup = '' + gappsWrapperArgs+=( + "''${qtWrapperArgs[@]}" + ) + ''; + postFixup = '' searchHardCodedPaths $out ''; From f4e0ae2bb2fd811570d54f029ae3818266809515 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 8 Aug 2019 11:00:20 -0400 Subject: [PATCH 4/6] deepin.dde-file-manager: use gapps wrapper Forgot about wrapQtAppsHook only wrapping binaries that are ELF headers. So it can't wrap it if it already is. --- pkgs/desktops/deepin/dde-file-manager/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/deepin/dde-file-manager/default.nix b/pkgs/desktops/deepin/dde-file-manager/default.nix index 62b4da71dd62..5d0d04bfb764 100644 --- a/pkgs/desktops/deepin/dde-file-manager/default.nix +++ b/pkgs/desktops/deepin/dde-file-manager/default.nix @@ -45,8 +45,7 @@ mkDerivation rec { dtkwidget ffmpegthumbnailer file - glib.bin - glib.dev + glib gnugrep gsettings-qt gvfs @@ -233,6 +232,14 @@ mkDerivation rec { export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libX11}/lib"; ''; + dontWrapQtApps = true; + + preFixup = '' + gappsWrapperArgs+=( + "''${qtWrapperArgs[@]}" + ) + ''; + postFixup = '' # debuging unset LD_LIBRARY_PATH From 62095621d7a953f4e6da9d857a90200dce8c7707 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 8 Aug 2019 11:00:30 -0400 Subject: [PATCH 5/6] deepin.dde-launcher: use gapps wrapper Forgot about wrapQtAppsHook only wrapping binaries that are ELF headers. So it can't wrap it if it already is. --- pkgs/desktops/deepin/dde-launcher/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/deepin/dde-launcher/default.nix b/pkgs/desktops/deepin/dde-launcher/default.nix index f5e5f23cc2cd..eae074381f3b 100644 --- a/pkgs/desktops/deepin/dde-launcher/default.nix +++ b/pkgs/desktops/deepin/dde-launcher/default.nix @@ -1,7 +1,7 @@ { stdenv, mkDerivation, fetchFromGitHub, pkgconfig, cmake, dde-qt-dbus-factory, dde-session-ui, deepin, deepin-desktop-schemas, deepin-wallpapers, dtkcore, dtkwidget, gsettings-qt, qtsvg, qttools, qtx11extras, - which, xdg_utils, wrapGAppsHook }: + which, xdg_utils, wrapGAppsHook, glib }: mkDerivation rec { pname = "dde-launcher"; @@ -29,6 +29,7 @@ mkDerivation rec { deepin-wallpapers dtkcore dtkwidget + glib gsettings-qt qtsvg qtx11extras @@ -58,6 +59,14 @@ mkDerivation rec { # note: `dbus-send` path does not need to be hard coded because it is not used for dtkcore >= 2.0.8.0 ''; + dontWrapQtApps = true; + + preFixup = '' + gappsWrapperArgs+=( + "''${qtWrapperArgs[@]}" + ) + ''; + postFixup = '' # debugging searchHardCodedPaths $out From 02543efd835a9ce0548118ec3c36c20abfedff2b Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 8 Aug 2019 11:00:39 -0400 Subject: [PATCH 6/6] deepin.dde-session-ui: use gapps wrapper Forgot about wrapQtAppsHook only wrapping binaries that are ELF headers. So it can't wrap it if it already is. --- pkgs/desktops/deepin/dde-session-ui/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/deepin/dde-session-ui/default.nix b/pkgs/desktops/deepin/dde-session-ui/default.nix index 699403567b7b..a664defae563 100644 --- a/pkgs/desktops/deepin/dde-session-ui/default.nix +++ b/pkgs/desktops/deepin/dde-session-ui/default.nix @@ -104,10 +104,18 @@ mkDerivation rec { # - do not wrap dde-dman-portal related files: it appears it has been removed: https://github.com/linuxdeepin/dde-session-ui/commit/3bd028cf135ad22c784c0146e447ef34a69af768 ''; + dontWrapQtApps = true; + + preFixup = '' + gappsWrapperArgs+=( + "''${qtWrapperArgs[@]}" + ) + ''; + postFixup = '' - # wrapGAppsHook does not work with binaries outside of $out/bin or $out/libexec + # wrapGAppsHook or wrapQtAppsHook does not work with binaries outside of $out/bin or $out/libexec for binary in $out/lib/deepin-daemon/*; do - wrapProgram $binary "''${qtWrapperArgs[@]}" + wrapProgram $binary "''${gappsWrapperArgs[@]}" done searchHardCodedPaths $out # debugging