2019-03-10 01:10:28 +00:00
{ stdenv , fetchFromGitHub , substituteAll , python3 , openssl , folks , gsound
2018-09-20 21:31:51 +01:00
, meson , ninja , libxml2 , pkgconfig , gobject-introspection , wrapGAppsHook
, glib , gtk3 , at-spi2-core , upower , openssh , gnome3 } :
stdenv . mkDerivation rec {
name = " g n o m e - s h e l l - g s c o n n e c t - ${ version } " ;
2019-05-01 14:05:03 +01:00
version = " 2 3 " ;
2018-09-20 21:31:51 +01:00
src = fetchFromGitHub {
owner = " a n d y h o l m e s " ;
repo = " g n o m e - s h e l l - e x t e n s i o n - g s c o n n e c t " ;
rev = " v ${ version } " ;
2019-05-01 14:05:03 +01:00
sha256 = " 0 1 1 a s r h k l y 9 z h v n n g 2 m h 9 v 0 6 y w 3 9 f x 2 4 4 p m q z 5 y k 9 r d 9 m 4 c 3 2 x i d " ;
2018-09-20 21:31:51 +01:00
} ;
patches = [
# Make typelibs available in the extension
( substituteAll {
src = ./fix-paths.patch ;
gapplication = " ${ glib . bin } / b i n / g a p p l i c a t i o n " ;
mutter_gsettings_path = " ${ gnome3 . mutter } / s h a r e / g s e t t i n g s - s c h e m a s / ${ gnome3 . mutter . name } / g l i b - 2 . 0 / s c h e m a s " ;
} )
] ;
nativeBuildInputs = [
meson ninja pkgconfig
gobject-introspection # for locating typelibs
wrapGAppsHook # for wrapping daemons
libxml2 # xmllint
] ;
buildInputs = [
( python3 . withPackages ( pkgs : [ python3 . pkgs . pygobject3 ] ) ) # for folks.py
glib # libgobject
gtk3
at-spi2-core # atspi
2019-03-10 01:10:28 +00:00
folks # libfolks
2018-09-20 21:31:51 +01:00
gnome3 . nautilus # TODO: this contaminates the package with nautilus and gnome-autoar typelibs but it is only needed for the extension
gnome3 . nautilus-python
2019-03-10 01:10:28 +00:00
gsound
2018-09-20 21:31:51 +01:00
upower
gnome3 . caribou
gnome3 . gjs # for running daemon
gnome3 . evolution-data-server # folks.py requires org.gnome.Evolution.DefaultSources gsettings; TODO: hardcode the schema path to the library (similarly to https://github.com/NixOS/nixpkgs/issues/47226)
] ;
mesonFlags = [
" - D g n o m e _ s h e l l _ l i b d i r = ${ gnome3 . gnome-shell } / l i b "
" - D g s e t t i n g s _ s c h e m a d i r = ${ placeholder " o u t " } / s h a r e / g s e t t i n g s - s c h e m a s / ${ name } / g l i b - 2 . 0 / s c h e m a s "
" - D c h r o m e _ n m h d i r = ${ placeholder " o u t " } / e t c / o p t / c h r o m e / n a t i v e - m e s s a g i n g - h o s t s "
" - D c h r o m i u m _ n m h d i r = ${ placeholder " o u t " } / e t c / c h r o m i u m / n a t i v e - m e s s a g i n g - h o s t s "
" - D o p e n s s l _ p a t h = ${ openssl } / b i n / o p e n s s l "
" - D s s h a d d _ p a t h = ${ openssh } / b i n / s s h - a d d "
" - D s s h k e y g e n _ p a t h = ${ openssh } / b i n / s s h - k e y g e n "
" - D p o s t _ i n s t a l l = t r u e "
] ;
postPatch = ''
patchShebangs meson/nmh.sh
patchShebangs meson/post-install.sh
# TODO: do not include every typelib everywhere
# for example, we definitely do not need nautilus
for file in src/extension.js src/prefs.js ; do
substituteInPlace " $ f i l e " \
- - subst-var-by typelibPath " $ G I _ T Y P E L I B _ P A T H "
done
'' ;
preFixup = ''
# TODO: figure out why folks GIR does not contain shared-library attribute
# https://github.com/NixOS/nixpkgs/issues/47226
2019-03-10 01:10:28 +00:00
gappsWrapperArgs + = ( - - prefix LD_LIBRARY_PATH : " ${ stdenv . lib . makeLibraryPath [ folks ] } " )
2018-09-20 21:31:51 +01:00
'' ;
postFixup = ''
# Let’ s wrap the daemons
for file in $ out/share/gnome-shell/extensions/gsconnect @ andyholmes.github.io/service / { { daemon , nativeMessagingHost } . js , components/folks.py } ; do
echo " W r a p p i n g p r o g r a m ' ' ${ file } "
wrapProgram " ' ' ${ file } " " ' ' ${ gappsWrapperArgs [ @ ] } "
done
'' ;
meta = with stdenv . lib ; {
description = " K D E C o n n e c t i m p l e m e n t a t i o n f o r G n o m e S h e l l " ;
homepage = https://github.com/andyholmes/gnome-shell-extension-gsconnect/wiki ;
license = licenses . gpl2 ;
maintainers = with maintainers ; [ etu ] ;
platforms = platforms . linux ;
} ;
}