@ -1,10 +1,7 @@
{ stdenv , lib , fetchgit , fetchpatch , wrapGAppsHook , autoreconfHook , bison , flex
, curl , gtk2 , gtk 3 , pkg-config , python2 , python3 , shared-mime-info
, curl , gtk3 , pkg-config , python3 , shared-mime-info
, glib-networking , gsettings-desktop-schemas
# Selector between the GTK+ 3 and GTK+ 2 releases.
, useGtk3
# Package compatibility: old parameters whose name were not directly derived
, enablePgp ? true
, enablePluginNotificationDialogs ? true
@ -34,14 +31,14 @@
, enablePluginBsfilter ? true
, enablePluginClamd ? true
, enablePluginDillo ? true
, enablePluginFancy ? us eGtk3 , libsoup , webkitgtk
, enablePluginFancy ? tr ue, libsoup , webkitgtk
, enablePluginFetchInfo ? true
, enablePluginLibravatar ? enablePluginRavatar
, enablePluginLitehtmlViewer ? true , gumbo
, enablePluginMailmbox ? true
, enablePluginManageSieve ? true
, enablePluginNewMail ? true
, enablePluginNotification ? ( enablePluginNotificationDialogs || enablePluginNotificationSounds ) , libcanberra-gtk2 , libcanberra-gtk 3 , libnotify
, enablePluginNotification ? ( enablePluginNotificationDialogs || enablePluginNotificationSounds ) , libcanberra-gtk3 , libnotify
, enablePluginPdfViewer ? enablePluginPdf , poppler
, enablePluginPerl ? true , perl
, enablePluginPython ? true
@ -57,23 +54,7 @@
with lib ;
let
# Last release and hash for both the GTK+ 3 and GTK+ 2 version.
version = if useGtk3 then " 4 . 0 . 0 " else " 3 . 1 8 . 0 " ;
gtk2src = {
sha256 = " 1 v s i y 3 x s p p w 4 d 8 y l s z 7 0 w s y r v m g y 8 8 l p 2 h j 7 v r c 3 5 3 c k n y 8 0 r 9 l h " ;
} ;
gtk3src = {
sha256 = " 0 m w n j i q g 2 s j 6 1 v a 0 y 9 y i 3 v 5 2 i y r 5 k z m b n v s q x a v 3 a 4 8 m 2 f 8 p 2 7 q n " ;
} ;
python = if useGtk3 then python3 else python2 ;
pythonPkgs = if useGtk3
then
with python . pkgs ; [ python wrapPython pygobject3 ]
else
with python . pkgs ; [ python wrapPython pygtk pygobject2 ] ;
pythonPkgs = with python3 . pkgs ; [ python3 wrapPython pygobject3 ] ;
features = [
{ flags = [ " a c p i _ n o t i f i e r - p l u g i n " ] ; enabled = enablePluginAcpiNotifier ; }
@ -99,7 +80,7 @@ let
{ flags = [ " m a n a g e s i e v e - p l u g i n " ] ; enabled = enablePluginManageSieve ; }
{ flags = [ " n e t w o r k m a n a g e r " ] ; enabled = enableNetworkManager ; deps = [ networkmanager ] ; }
{ flags = [ " n e w m a i l - p l u g i n " ] ; enabled = enablePluginNewMail ; }
{ flags = [ " n o t i f i c a t i o n - p l u g i n " ] ; enabled = enablePluginNotification ; deps = [ libnotify ] ++ [ ( if useGtk3 then libcanberra-gtk3 else libcanberra-gtk2 ) ] ; }
{ flags = [ " n o t i f i c a t i o n - p l u g i n " ] ; enabled = enablePluginNotification ; deps = [ libnotify ] ++ [ libcanberra-gtk3 ] ; }
{ flags = [ " p d f _ v i e w e r - p l u g i n " ] ; enabled = enablePluginPdfViewer ; deps = [ poppler ] ; }
{ flags = [ " p e r l - p l u g i n " ] ; enabled = enablePluginPerl ; deps = [ perl ] ; }
{ flags = [ " p g p c o r e - p l u g i n " " p g p i n l i n e - p l u g i n " " p g p m i m e - p l u g i n " ] ; enabled = enablePluginPgp ; deps = [ gnupg gpgme ] ; }
@ -115,12 +96,13 @@ let
] ;
in stdenv . mkDerivation rec {
pname = " c l a w s - m a i l " ;
inherit version ;
version = " 4 . 0 . 0 " ;
src = fetchgit ( {
src = fetchgit {
rev = version ;
url = " g i t : / / g i t . c l a w s - m a i l . o r g / c l a w s . g i t " ;
} // ( if useGtk3 then gtk3src else gtk2src ) ) ;
sha256 = " 0 m w n j i q g 2 s j 6 1 v a 0 y 9 y i 3 v 5 2 i y r 5 k z m b n v s q x a v 3 a 4 8 m 2 f 8 p 2 7 q n " ;
} ;
outputs = [ " o u t " " d e v " ] ;
@ -140,7 +122,7 @@ in stdenv.mkDerivation rec {
preConfigure = ''
# autotools check tries to dlopen libpython as a requirement for the python plugin
export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH'' $ { LD_LIBRARY_PATH : + : } $ { python } /lib
export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH'' $ { LD_LIBRARY_PATH : + : } $ { python3 } /lib
# generate version without .git
[ - e version ] || echo " e c h o ${ version } " > version
'' ;
@ -154,8 +136,7 @@ in stdenv.mkDerivation rec {
propagatedBuildInputs = pythonPkgs ;
buildInputs =
[ curl gsettings-desktop-schemas glib-networking ]
++ [ ( if useGtk3 then gtk3 else gtk2 ) ]
[ curl gsettings-desktop-schemas glib-networking gtk3 ]
++ concatMap ( f : optionals f . enabled f . deps ) ( filter ( f : f ? deps ) features )
;