unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* offlineimap
@ 2016-04-06  5:32 Efraim Flashner
  2016-04-06  9:09 ` offlineimap Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2016-04-06  5:32 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 733 bytes --]

I've looked around the website a bit but I haven't been able to find the
documentation on it. If we add sqlite as an input to offlineimap and in
the [Accounts] section of the config add `status_backed = sqlite` then
it'll index the emails in an sqlite database and make syncing the mail
faster. When I sync with my mailserver and have no mail change, without
sqlite my sync time is 55 seconds, and with sqlite it drops to 37
seconds. One downside- the initial add everything to the database takes
quite a while.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0001-gnu-offlineimap-Add-sqlite-support.patch --]
[-- Type: text/plain, Size: 933 bytes --]

From ef7af3b17fcf242af87ad4a86ea46bd340f94da8 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Wed, 6 Apr 2016 08:31:35 +0300
Subject: [PATCH] gnu: offlineimap: Add sqlite support.

* gnu/packages/mail.scm (offlineimap)[propagated-inputs]: Add python2-pysqlite.
---
 gnu/packages/mail.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 7bcb93c..fbcd841 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -302,6 +302,7 @@ and corrections.  It is based on a Bayesian filter.")
                 "0462mal2fxvavxhwjk1a6vsnspx07yniifa687dwg46aplqznin4"))))
     (build-system python-build-system)
     (native-inputs `(("python" ,python-2)))
+    (propagated-inputs `(("python2-pysqlite" ,python2-pysqlite)))
     (arguments
      ;; The setup.py script expects python-2.
      `(#:python ,python-2
-- 
2.8.0.rc3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: offlineimap
  2016-04-06  5:32 offlineimap Efraim Flashner
@ 2016-04-06  9:09 ` Ricardo Wurmus
  2016-04-06  9:14   ` offlineimap Efraim Flashner
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2016-04-06  9:09 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel


Efraim Flashner <efraim@flashner.co.il> writes:

> I've looked around the website a bit but I haven't been able to find the
> documentation on it. If we add sqlite as an input to offlineimap and in
> the [Accounts] section of the config add `status_backed = sqlite` then
> it'll index the emails in an sqlite database and make syncing the mail
> faster. When I sync with my mailserver and have no mail change, without
> sqlite my sync time is 55 seconds, and with sqlite it drops to 37
> seconds. One downside- the initial add everything to the database takes
> quite a while.

I’ve been using the sqlite backend for a while myself and it’s really
quite nice.

Does this dependency really need to be propagated, though?  Or could we
wrap the “offlineimap” executable in a suitable PYTHONPATH instead?

~~ Ricardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: offlineimap
  2016-04-06  9:09 ` offlineimap Ricardo Wurmus
@ 2016-04-06  9:14   ` Efraim Flashner
  2016-04-07  6:55     ` offlineimap Efraim Flashner
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2016-04-06  9:14 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

On Wed, 6 Apr 2016 11:09:34 +0200
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:

> Efraim Flashner <efraim@flashner.co.il> writes:
> 
>  [...]  
> 
> I’ve been using the sqlite backend for a while myself and it’s really
> quite nice.
> 
> Does this dependency really need to be propagated, though?  Or could we
> wrap the “offlineimap” executable in a suitable PYTHONPATH instead?
> 
> ~~ Ricardo

From my understanding it needs to "be available", which in FHS terms means be
installed, but I assume wrapping the offlineimap executable would work, and
without propagating more programs into the user's profile.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: offlineimap
  2016-04-06  9:14   ` offlineimap Efraim Flashner
@ 2016-04-07  6:55     ` Efraim Flashner
  2016-04-11  8:49       ` offlineimap Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2016-04-07  6:55 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1436 bytes --]

On Wed, Apr 06, 2016 at 12:14:36PM +0300, Efraim Flashner wrote:
> On Wed, 6 Apr 2016 11:09:34 +0200
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:
> 
> > Efraim Flashner <efraim@flashner.co.il> writes:
> > 
> >  [...]  
> > 
> > I’ve been using the sqlite backend for a while myself and it’s really
> > quite nice.
> > 
> > Does this dependency really need to be propagated, though?  Or could we
> > wrap the “offlineimap” executable in a suitable PYTHONPATH instead?
> > 
> > ~~ Ricardo
> 
> From my understanding it needs to "be available", which in FHS terms means be
> installed, but I assume wrapping the offlineimap executable would work, and
> without propagating more programs into the user's profile.
> 

I think I've gotten it right with the PYTHONPATH, this is my first time
tring it that way. Here's the output of `guix gc --references`:
$guix gc --referencesi /gnu/store/z1i4vkk8zpxszkavx5dmaq11lvkspp9y-offlineimap-6.7.0
/gnu/store/b1yqjimbdh5bf9jnizd4h7yf110744j2-bash-4.3.42
/gnu/store/kcc3cxnx9l2hbg7pjhxsa0r5yq2j2f38-python-2.7.10
/gnu/store/pdhx76bbawkwrlqql2yglcl91bi5yrrc-python2-pysqlite-2.8.1
/gnu/store/z1i4vkk8zpxszkavx5dmaq11lvkspp9y-offlineimap-6.7.0

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0001-gnu-offlineimap-Add-sqlite-support.patch --]
[-- Type: text/plain, Size: 1638 bytes --]

From c108ec58dbeccd324faf7c65a04054f24a096350 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Thu, 7 Apr 2016 09:51:21 +0300
Subject: [PATCH] gnu: offlineimap: Add sqlite support.

* gnu/packages/mail.scm (offlineimap)[inputs]: Add python2-pysqlite.
[arguments]: Wrap binary with python2-pysqlite's path.
---
 gnu/packages/mail.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 7bcb93c..e5eefc7 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -302,11 +302,21 @@ and corrections.  It is based on a Bayesian filter.")
                 "0462mal2fxvavxhwjk1a6vsnspx07yniifa687dwg46aplqznin4"))))
     (build-system python-build-system)
     (native-inputs `(("python" ,python-2)))
+    (inputs `(("python2-pysqlite" ,python2-pysqlite)))
     (arguments
      ;; The setup.py script expects python-2.
      `(#:python ,python-2
       ;; Tests require a modifiable IMAP account.
-       #:tests? #f))
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-binary
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin/offlineimap")))
+               (wrap-program bin
+                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
+               #t))))))
     (home-page "http://www.offlineimap.org")
     (synopsis "Sync emails between two repositories")
     (description
-- 
2.8.0.rc3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: offlineimap
  2016-04-07  6:55     ` offlineimap Efraim Flashner
@ 2016-04-11  8:49       ` Ricardo Wurmus
  0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Wurmus @ 2016-04-11  8:49 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel


Efraim Flashner <efraim@flashner.co.il> writes:

> On Wed, Apr 06, 2016 at 12:14:36PM +0300, Efraim Flashner wrote:
>> On Wed, 6 Apr 2016 11:09:34 +0200
>> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:
>> 
>> > Efraim Flashner <efraim@flashner.co.il> writes:
>> > 
>> >  [...]  
>> > 
>> > I’ve been using the sqlite backend for a while myself and it’s really
>> > quite nice.
>> > 
>> > Does this dependency really need to be propagated, though?  Or could we
>> > wrap the “offlineimap” executable in a suitable PYTHONPATH instead?
>> > 
>> > ~~ Ricardo
>> 
>> From my understanding it needs to "be available", which in FHS terms means be
>> installed, but I assume wrapping the offlineimap executable would work, and
>> without propagating more programs into the user's profile.
>> 
>
> I think I've gotten it right with the PYTHONPATH, this is my first time
> tring it that way. Here's the output of `guix gc --references`:
> $guix gc --referencesi /gnu/store/z1i4vkk8zpxszkavx5dmaq11lvkspp9y-offlineimap-6.7.0
> /gnu/store/b1yqjimbdh5bf9jnizd4h7yf110744j2-bash-4.3.42
> /gnu/store/kcc3cxnx9l2hbg7pjhxsa0r5yq2j2f38-python-2.7.10
> /gnu/store/pdhx76bbawkwrlqql2yglcl91bi5yrrc-python2-pysqlite-2.8.1
> /gnu/store/z1i4vkk8zpxszkavx5dmaq11lvkspp9y-offlineimap-6.7.0

The patch looks okay to me.  If you have confirmed that it works without
haviing the pysqlite package installed in the profile and without having
set PYTHONPATH then it’s good to push.

Thanks!

~~ Ricardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-11  8:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06  5:32 offlineimap Efraim Flashner
2016-04-06  9:09 ` offlineimap Ricardo Wurmus
2016-04-06  9:14   ` offlineimap Efraim Flashner
2016-04-07  6:55     ` offlineimap Efraim Flashner
2016-04-11  8:49       ` offlineimap Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).