2020-05-15 21:57:56 +00:00
{ stdenv
, mkDerivation
, fetchFromGitHub
, pkgconfig
, qmake
, dbus
, dde-daemon
, dde-qt-dbus-factory
, deepin
, deepin-desktop-schemas
, deepin-gettext-tools
, deepin-icon-theme
, deepin-wallpapers
, dtkcore
, dtkwidget
, gnugrep
, gsettings-qt
, lightdm_qt
, onboard
, qtsvg
, qttools
, qtx11extras
, setxkbmap
, utillinux
, which
, xkeyboard_config
, xorg
, xrandr
, wrapGAppsHook
} :
2020-04-24 23:36:52 +00:00
mkDerivation rec {
pname = " d d e - s e s s i o n - u i " ;
version = " 5 . 0 . 0 " ;
src = fetchFromGitHub {
owner = " l i n u x d e e p i n " ;
repo = pname ;
rev = version ;
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 " ;
} ;
nativeBuildInputs = [
pkgconfig
qmake
qttools
deepin-gettext-tools
wrapGAppsHook
deepin . setupHook
] ;
buildInputs = [
dbus
dde-daemon
dde-qt-dbus-factory
deepin-desktop-schemas
deepin-icon-theme
deepin-wallpapers
dtkcore
dtkwidget
gnugrep
gsettings-qt
lightdm_qt
onboard
qtsvg
qtx11extras
setxkbmap
utillinux
which
xkeyboard_config
xorg . libXcursor
xorg . libXrandr
xorg . libXtst
xrandr
] ;
postPatch = ''
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 "
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 , " { } +
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 "
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 "
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 "
# fix default background url
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
'' ;
dontWrapQtApps = true ;
preFixup = ''
gappsWrapperArgs + = (
" ' ' ${ qtWrapperArgs [ @ ] } "
)
'' ;
postFixup = ''
# wrapGAppsHook or wrapQtAppsHook does not work with binaries outside of $out/bin or $out/libexec
for binary in $ out/lib/deepin-daemon /* ; d o
wrapProgram $ binary " ' ' ${ gappsWrapperArgs [ @ ] } "
done
searchHardCodedPaths $ out # debugging
'' ;
2020-05-15 21:57:56 +00:00
passthru . updateScript = deepin . updateScript { inherit pname version src ; } ;
2020-04-24 23:36:52 +00: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 = " h t t p s : / / g i t h u b . c o m / l i n u x d e e p i n / d d e - s e s s i o n - u i " ;
license = licenses . gpl3 ;
platforms = platforms . linux ;
maintainers = with maintainers ; [ romildo ] ;
} ;
}