2019-07-22 04:53:18 +02:00
{ stdenv , mkDerivation , fetchFromGitHub , pkgconfig , qmake , dbus , dde-daemon ,
2019-06-25 22:06:19 +02:00
dde-qt-dbus-factory , deepin , deepin-desktop-schemas ,
deepin-gettext-tools , deepin-icon-theme , deepin-wallpapers , dtkcore ,
2019-09-12 16:25:05 +02:00
dtkwidget , gnugrep , gsettings-qt , lightdm_qt ,
2019-06-25 22:06:19 +02:00
onboard , qtsvg , qttools , qtx11extras , setxkbmap , utillinux , which ,
xkeyboard_config , xorg , xrandr , wrapGAppsHook } :
2018-10-21 23:00:55 +02:00
2019-07-22 04:53:18 +02:00
mkDerivation rec {
2018-10-21 23:00:55 +02:00
pname = " d d e - s e s s i o n - u i " ;
2019-11-12 02:08:38 +01:00
version = " 5 . 0 . 0 " ;
2018-10-21 23:00:55 +02:00
src = fetchFromGitHub {
owner = " l i n u x d e e p i n " ;
repo = pname ;
rev = version ;
2019-11-12 02:08:38 +01:00
sha256 = " 1 g y 9 n l p k r 9 a y r s 1 z 2 d v d 7 h 0 d q l w 6 f q 2 m 6 6 d 9 c s 4 8 q y f k r 6 c 8 l 9 j j " ;
2018-10-21 23:00:55 +02:00
} ;
nativeBuildInputs = [
pkgconfig
qmake
qttools
deepin-gettext-tools
2018-11-14 13:27:51 +01:00
wrapGAppsHook
deepin . setupHook
2018-10-21 23:00:55 +02:00
] ;
buildInputs = [
2019-06-25 22:06:19 +02:00
dbus
dde-daemon
2018-10-21 23:00:55 +02:00
dde-qt-dbus-factory
2019-06-25 22:06:19 +02:00
deepin-desktop-schemas
deepin-icon-theme
deepin-wallpapers
2018-10-21 23:00:55 +02:00
dtkcore
dtkwidget
2019-06-25 22:06:19 +02:00
gnugrep
2018-10-21 23:00:55 +02:00
gsettings-qt
lightdm_qt
2019-06-25 22:06:19 +02:00
onboard
2018-10-21 23:00:55 +02:00
qtsvg
qtx11extras
2019-06-25 22:06:19 +02:00
setxkbmap
utillinux
which
xkeyboard_config
2018-10-21 23:00:55 +02:00
xorg . libXcursor
xorg . libXrandr
xorg . libXtst
2019-06-25 22:06:19 +02:00
xrandr
2018-10-21 23:00:55 +02:00
] ;
postPatch = ''
2019-06-25 22:06:19 +02:00
searchHardCodedPaths # debugging
patchShebangs translate_generation . sh translate_desktop . sh
substituteInPlace translate_desktop . sh - - replace " / u s r / b i n / d e e p i n - d e s k t o p - t s - c o n v e r t " " d e e p i n - d e s k t o p - t s - c o n v e r t "
2018-10-21 23:00:55 +02:00
find - type f - exec sed - i - e " s , p a t h = / e t c , p a t h = $ o u t / e t c , " { } +
find - type f - exec sed - i - e " s , p a t h = / u s r , p a t h = $ o u t , " { } +
find - type f - exec sed - i - e " s , / u s r / s h a r e / d d e - s e s s i o n - u i , $ o u t / s h a r e / d d e - s e s s i o n - u i , " { } +
2019-06-25 22:06:19 +02:00
substituteInPlace dde-osd/dde-osd_autostart.desktop - - replace " E x e c = / u s r / l i b / d e e p i n - d a e m o n / d d e - o s d " " E x e c = $ o u t / l i b / d e e p i n - d a e m o n / d d e - o s d "
substituteInPlace dde-osd/com.deepin.dde.osd.service - - replace " E x e c = / u s r / l i b / d e e p i n - d a e m o n / d d e - o s d " " E x e c = $ o u t / l i b / d e e p i n - d a e m o n / d d e - o s d "
substituteInPlace dde-lock/com.deepin.dde.lockFront.service - - replace " E x e c = / u s r / b i n / d d e - l o c k " " E x e c = $ o u t / b i n / d d e - l o c k "
substituteInPlace dmemory-warning-dialog/com.deepin.dde.MemoryWarningDialog.service - - replace " E x e c = / u s r / b i n / d m e m o r y - w a r n i n g - d i a l o g " " E x e c = $ o u t / b i n / d m e m o r y - w a r n i n g - d i a l o g "
substituteInPlace dde-warning-dialog/com.deepin.dde.WarningDialog.service - - replace " E x e c = / u s r / l i b / d e e p i n - d a e m o n / d d e - w a r n i n g - d i a l o g " " E x e c = $ o u t / l i b / d e e p i n - d a e m o n / d d e - w a r n i n g - d i a l o g "
substituteInPlace dde-shutdown/com.deepin.dde.shutdownFront.service - - replace " E x e c = / u s r / b i n / d d e - s h u t d o w n " " E x e c = $ o u t / b i n / d d e - s h u t d o w n "
substituteInPlace dde-welcome/com.deepin.dde.welcome.service - - replace " E x e c = / u s r / l i b / d e e p i n - d a e m o n / d d e - w e l c o m e " " E x e c = $ o u t / l i b / d e e p i n - d a e m o n / d d e - w e l c o m e "
substituteInPlace session-ui-guardien/session-ui-guardien.desktop - - replace " E x e c = / u s r / b i n / s e s s i o n - u i - g u a r d i e n " " E x e c = $ o u t / b i n / s e s s i o n - u i - g u a r d i e n "
substituteInPlace lightdm-deepin-greeter/lightdm-deepin-greeter.desktop - - replace " E x e c = / u s r / b i n / d e e p i n - g r e e t e r " " E x e c = $ o u t / b i n / d e e p i n - g r e e t e r "
substituteInPlace misc/applications/deepin-toggle-desktop.desktop.in - - replace " E x e c = / u s r / l i b / d e e p i n - d a e m o n / d e s k t o p - t o g g l e " " E x e c = ${ dde-daemon } / l i b / d e e p i n - d a e m o n / d e s k t o p - t o g g l e "
# Uncomment (and remove space after $) after packaging deepin-system-monitor
#substituteInPlace dde-shutdown/view/contentwidget.cpp --replace "/usr/bin/deepin-system-monitor" "$ {deepin-system-monitor}/bin/deepin-system-monitor"
substituteInPlace dde-offline-upgrader/main.cpp - - replace " d b u s - s e n d " " ${ dbus } / b i n / d b u s - s e n d "
substituteInPlace dde-osd/kblayoutindicator.cpp - - replace " d b u s - s e n d " " ${ dbus } / b i n / d b u s - s e n d "
substituteInPlace dde-shutdown/view/contentwidget.cpp - - replace " / u s r / s h a r e / b a c k g r o u n d s / d e e p i n " " ${ deepin-wallpapers } / s h a r e / b a c k g r o u n d s / d e e p i n "
substituteInPlace dde-welcome/mainwidget.cpp - - replace " d b u s - s e n d " " ${ dbus } / b i n / d b u s - s e n d "
substituteInPlace dmemory-warning-dialog/src/buttondelegate.cpp - - replace " d b u s - s e n d " " ${ dbus } / b i n / d b u s - s e n d "
substituteInPlace dmemory-warning-dialog/src/buttondelegate.cpp - - replace " k i l l " " ${ utillinux } / b i n / d b u s - s e n d "
substituteInPlace global_util/xkbparser.h - - replace " / u s r / s h a r e / X 1 1 / x k b / r u l e s / b a s e . x m l " " ${ xkeyboard_config } / s h a r e / X 1 1 / x k b / r u l e s / b a s e . x m l "
substituteInPlace lightdm-deepin-greeter/deepin-greeter - - replace " / e t c / d e e p i n / g r e e t e r s . d " " $ o u t / e t c / d e e p i n / g r e e t e r s . d "
substituteInPlace lightdm-deepin-greeter/main.cpp - - replace " / u s r / s h a r e / i c o n s / d e e p i n " " ${ deepin-icon-theme } / s h a r e / i c o n s / d e e p i n "
substituteInPlace lightdm-deepin-greeter/scripts/00-xrandr - - replace " e g r e p " " ${ gnugrep } / b i n / e g r e p "
substituteInPlace lightdm-deepin-greeter/scripts/00-xrandr - - replace " x r a n d r " " ${ xrandr } / b i n / x r a n d r "
substituteInPlace lightdm-deepin-greeter/scripts/lightdm-deepin-greeter - - replace " / u s r / b i n / l i g h t d m - d e e p i n - g r e e t e r " " $ o u t / b i n / l i g h t d m - d e e p i n - g r e e t e r "
substituteInPlace session-ui-guardien/guardien.cpp - - replace " d d e - l o c k " " $ o u t / b i n / d d e - l o c k "
substituteInPlace session-ui-guardien/guardien.cpp - - replace " d d e - s h u t d o w n " " $ o u t / b i n / d d e - s h u t d o w n "
2019-11-12 02:08:38 +01:00
substituteInPlace dde-lock/lockworker.cpp - - replace " d d e - s w i t c h t o g r e e t e r " " $ o u t / b i n / d d e - s w i t c h t o g r e e t e r "
substituteInPlace dde-lock/lockworker.cpp - - replace " w h i c h " " ${ which } / b i n / w h i c h "
2019-06-25 22:06:19 +02:00
substituteInPlace session-widgets/userinfo.cpp - - replace " / u s r / s h a r e / w a l l p a p e r s / d e e p i n " " ${ deepin-wallpapers } / s h a r e / w a l l p a p e r s / d e e p i n "
substituteInPlace widgets/fullscreenbackground.cpp - - replace " / u s r / s h a r e / w a l l p a p e r s / d e e p i n " " ${ deepin-wallpapers } / s h a r e / w a l l p a p e r s / d e e p i n "
substituteInPlace widgets/kblayoutwidget.cpp - - replace " s e t x k b m a p " " ${ setxkbmap } / b i n / s e t x k b m a p "
substituteInPlace widgets/virtualkbinstance.cpp - - replace " o n b o a r d " " ${ onboard } / b i n / o n b o a r d "
2018-10-21 23:00:55 +02:00
# fix default background url
2019-06-25 22:06:19 +02:00
substituteInPlace widgets/fullscreenbackground.cpp - - replace " / u s r / s h a r e / b a c k g r o u n d s / d e f a u l t _ b a c k g r o u n d . j p g " " ${ deepin-wallpapers } / s h a r e / b a c k g r o u n d s / d e e p i n / d e s k t o p . j p g "
# NOTES
# - on deepin linux /usr/share/icons/default/index.theme is controlled by alternatives, without an equivalent mechanism in NixOS
# - do not wrap dde-dman-portal related files: it appears it has been removed: https://github.com/linuxdeepin/dde-session-ui/commit/3bd028cf135ad22c784c0146e447ef34a69af768
'' ;
2019-08-08 17:00:39 +02:00
dontWrapQtApps = true ;
preFixup = ''
gappsWrapperArgs + = (
" ' ' ${ qtWrapperArgs [ @ ] } "
)
'' ;
2019-06-25 22:06:19 +02:00
postFixup = ''
2019-08-08 17:00:39 +02:00
# wrapGAppsHook or wrapQtAppsHook does not work with binaries outside of $out/bin or $out/libexec
2019-06-25 22:06:19 +02:00
for binary in $ out/lib/deepin-daemon /* ; d o
2019-08-08 17:00:39 +02:00
wrapProgram $ binary " ' ' ${ gappsWrapperArgs [ @ ] } "
2019-06-25 22:06:19 +02:00
done
searchHardCodedPaths $ out # debugging
2018-10-21 23:00:55 +02:00
'' ;
2019-12-04 10:20:00 +01:00
passthru . updateScript = deepin . updateScript { name = " ${ pname } - ${ version } " ; } ;
2018-10-30 23:17:45 +01:00
2018-10-21 23:00:55 +02:00
meta = with stdenv . lib ; {
description = " D e e p i n d e s k t o p - e n v i r o n m e n t - S e s s i o n U I m o d u l e " ;
homepage = https://github.com/linuxdeepin/dde-session-ui ;
license = licenses . gpl3 ;
platforms = platforms . linux ;
maintainers = with maintainers ; [ romildo ] ;
} ;
}