2019-03-10 02:10:28 +01:00
{ stdenv , fetchFromGitHub , substituteAll , python3 , openssl , folks , gsound
2018-09-20 22:31:51 +02:00
, meson , ninja , libxml2 , pkgconfig , gobject-introspection , wrapGAppsHook
, glib , gtk3 , at-spi2-core , upower , openssh , gnome3 } :
stdenv . mkDerivation rec {
2019-08-15 14:41:18 +02:00
pname = " g n o m e - s h e l l - g s c o n n e c t " ;
2019-05-01 15:05:03 +02:00
version = " 2 3 " ;
2018-09-20 22:31:51 +02: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 15:05:03 +02: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 22:31:51 +02: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 " ;
2019-08-27 20:25:43 +02:00
mutter_gsettings_path = glib . getSchemaPath gnome3 . mutter ;
2018-09-20 22:31:51 +02:00
} )
] ;
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 02:10:28 +01:00
folks # libfolks
2018-09-20 22:31:51 +02: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 02:10:28 +01:00
gsound
2018-09-20 22:31:51 +02: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 "
2019-08-26 09:44:25 +02:00
" - D g s e t t i n g s _ s c h e m a d i r = ${ glib . makeSchemaPath ( placeholder " o u t " ) " ${ pname } - ${ version } " } "
2018-09-20 22:31:51 +02:00
" - 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 02:10:28 +01:00
gappsWrapperArgs + = ( - - prefix LD_LIBRARY_PATH : " ${ stdenv . lib . makeLibraryPath [ folks ] } " )
2018-09-20 22:31:51 +02: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
2019-09-22 09:38:09 +02:00
echo " W r a p p i n g p r o g r a m $ f i l e "
wrapGApp " $ f i l e "
2018-09-20 22:31:51 +02:00
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 ;
} ;
}