[PATCH v2] debian: package ruby bindings

2013-05-16 Thread Ali Polatel
2013/5/16 David Bremner :
> Felipe Contreras  writes:
>>
>> Yes. Do you have an old version of notmuch installed?
>>
>
> Yes I do. Hmm. It still seems like a bug to me; shouldn't the include
> paths be ordered to find the right include files first?
>
> d

Well I must accept I haven't spent much time on thinking how to make
extconf.rb perfect.
Excerpt from extconf.rb from bindings/ruby:

find_header('notmuch.h', '../../lib')
find_library('notmuch', 'notmuch_database_create', '../../lib')

Two problems here:
1. The library must be built before the bindings are built otherwise
the installed version is used.
However the installed version should never be used (or must be
made a non-default option somehow)
2. The library must be built in the source tree. Out-of-source tree
builds will cause extconf.rb to look for the installed version too.
Not sure whether this is a major concern because I don't know
whether out-of-tree builds are supported by the build system.

Having said that, I will try to have a look at solving these issues
this weekend.
Unfortunately I can't make promises because real-life is killing all
my time lately.

-alip


[PATCH] build: fix out-of-tree builds

2013-05-16 Thread Tomi Ollila
On Thu, May 16 2013, David Bremner  wrote:

> Jani Nikula  writes:
>
>> On Wed, 15 May 2013, David Bremner  wrote:
>>> Jani Nikula  writes:
  # List all subdirectories here. Each contains its own Makefile.local
 -subdirs := compat completion emacs lib man parse-time-string
 -subdirs += performance-test util test
 +subdirs = compat completion emacs lib man parse-time-string 
 performance-test util test
>>>
>>> Is this a functional change or a cosmetic one?
>>
>> Functional. All of it seems to be required for out-of-tree builds (*) to
>> work. I'm afraid I've forgotten exactly why both := and += make it fail
>> (I wrote the patch a few months ago).
>>
>
> Still I guess it deserves a comment so we don't break it again?

The following options could be tested (some day in (distant?) future):

subdirs = compat completion emacs lib man parse-time-string
subdirs += performance-test util test

or 

SUBDIRS := compat completion emacs lib man parse-time-string
SUBDIRS += performance-test util test
subdirs = $(SUBDIRS)

but as Jani has already tested his version works just adding that
comment David asked is the least labor-intensive thing to do --
and therefore IMHO the best thing to do for this case
(for sure I'm not going to spend more time on this now :D).

> d

Tomi


[PATCH v2] debian: package ruby bindings

2013-05-16 Thread David Bremner
Felipe Contreras  writes:
>
> Yes. Do you have an old version of notmuch installed?
>

Yes I do. Hmm. It still seems like a bug to me; shouldn't the include
paths be ordered to find the right include files first?

d


[PATCH v2] debian: package ruby bindings

2013-05-16 Thread David Bremner
Felipe Contreras  writes:

> Signed-off-by: Felipe Contreras 
> ---
>  debian/control  | 14 ++
>  debian/notmuch-ruby.install |  1 +
>  debian/rules|  3 +++
>  3 files changed, 18 insertions(+)
>  create mode 100644 debian/notmuch-ruby.install
>

I get a build failure here; I installed ruby-dev and ran the usual 
"make debian-snapshot".

Does it work for you in a clean with only the declared build-depends
installed?


cd bindings/ruby && ruby extconf.rb --vendor && make
checking for notmuch.h in ../../lib... yes
checking for notmuch_database_create() in -lnotmuch... yes
creating Makefile
make[2]: Entering directory 
`/home/bremner/software/upstream/notmuch/bindings/ruby'
compiling status.c
status.c: In function ?notmuch_rb_status_raise?:
status.c:46:10: error: ?NOTMUCH_STATUS_UNBALANCED_ATOMIC? undeclared (first use 
in this function)
status.c:46:10: note: each undeclared identifier is reported only once for each 
function it appears in
make[2]: *** [status.o] Error 1
make[2]: Leaving directory 
`/home/bremner/software/upstream/notmuch/bindings/ruby'
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory `/home/bremner/software/upstream/notmuch'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -D -us -uc -i failed


[PATCH v2] debian: package ruby bindings

2013-05-16 Thread Felipe Contreras
On Thu, May 16, 2013 at 9:31 AM, David Bremner  wrote:
> Felipe Contreras  writes:
>>
>> Yes. Do you have an old version of notmuch installed?
>>
>
> Yes I do. Hmm. It still seems like a bug to me; shouldn't the include
> paths be ordered to find the right include files first?

Yes, it is a bug. And there were attempts to fix it, but it broke the
normal build AFAICR.

-- 
Felipe Contreras


[PATCH v2] debian: package ruby bindings

2013-05-16 Thread Felipe Contreras
On Thu, May 16, 2013 at 8:51 AM, David Bremner  wrote:
> Felipe Contreras  writes:
>
>> Signed-off-by: Felipe Contreras 
>> ---
>>  debian/control  | 14 ++
>>  debian/notmuch-ruby.install |  1 +
>>  debian/rules|  3 +++
>>  3 files changed, 18 insertions(+)
>>  create mode 100644 debian/notmuch-ruby.install
>>
>
> I get a build failure here; I installed ruby-dev and ran the usual
> "make debian-snapshot".
>
> Does it work for you in a clean with only the declared build-depends
> installed?

Yes. Do you have an old version of notmuch installed?

-- 
Felipe Contreras


[PATCH] build: fix out-of-tree builds

2013-05-16 Thread David Bremner
Jani Nikula  writes:

> On Wed, 15 May 2013, David Bremner  wrote:
>> Jani Nikula  writes:
>>>  # List all subdirectories here. Each contains its own Makefile.local
>>> -subdirs := compat completion emacs lib man parse-time-string
>>> -subdirs += performance-test util test
>>> +subdirs = compat completion emacs lib man parse-time-string 
>>> performance-test util test
>>
>> Is this a functional change or a cosmetic one?
>
> Functional. All of it seems to be required for out-of-tree builds (*) to
> work. I'm afraid I've forgotten exactly why both := and += make it fail
> (I wrote the patch a few months ago).
>

Still I guess it deserves a comment so we don't break it again?

d


Re: [PATCH v2] debian: package ruby bindings

2013-05-16 Thread Felipe Contreras
On Thu, May 16, 2013 at 9:31 AM, David Bremner  wrote:
> Felipe Contreras  writes:
>>
>> Yes. Do you have an old version of notmuch installed?
>>
>
> Yes I do. Hmm. It still seems like a bug to me; shouldn't the include
> paths be ordered to find the right include files first?

Yes, it is a bug. And there were attempts to fix it, but it broke the
normal build AFAICR.

-- 
Felipe Contreras
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] debian: package ruby bindings

2013-05-16 Thread Ali Polatel
2013/5/16 David Bremner :
> Felipe Contreras  writes:
>>
>> Yes. Do you have an old version of notmuch installed?
>>
>
> Yes I do. Hmm. It still seems like a bug to me; shouldn't the include
> paths be ordered to find the right include files first?
>
> d

Well I must accept I haven't spent much time on thinking how to make
extconf.rb perfect.
Excerpt from extconf.rb from bindings/ruby:

find_header('notmuch.h', '../../lib')
find_library('notmuch', 'notmuch_database_create', '../../lib')

Two problems here:
1. The library must be built before the bindings are built otherwise
the installed version is used.
However the installed version should never be used (or must be
made a non-default option somehow)
2. The library must be built in the source tree. Out-of-source tree
builds will cause extconf.rb to look for the installed version too.
Not sure whether this is a major concern because I don't know
whether out-of-tree builds are supported by the build system.

Having said that, I will try to have a look at solving these issues
this weekend.
Unfortunately I can't make promises because real-life is killing all
my time lately.

-alip
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] debian: package ruby bindings

2013-05-16 Thread David Bremner
Felipe Contreras  writes:
>
> Yes. Do you have an old version of notmuch installed?
>

Yes I do. Hmm. It still seems like a bug to me; shouldn't the include
paths be ordered to find the right include files first?

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] debian: package ruby bindings

2013-05-16 Thread Felipe Contreras
On Thu, May 16, 2013 at 8:51 AM, David Bremner  wrote:
> Felipe Contreras  writes:
>
>> Signed-off-by: Felipe Contreras 
>> ---
>>  debian/control  | 14 ++
>>  debian/notmuch-ruby.install |  1 +
>>  debian/rules|  3 +++
>>  3 files changed, 18 insertions(+)
>>  create mode 100644 debian/notmuch-ruby.install
>>
>
> I get a build failure here; I installed ruby-dev and ran the usual
> "make debian-snapshot".
>
> Does it work for you in a clean with only the declared build-depends
> installed?

Yes. Do you have an old version of notmuch installed?

-- 
Felipe Contreras
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] debian: package ruby bindings

2013-05-16 Thread David Bremner
Felipe Contreras  writes:

> Signed-off-by: Felipe Contreras 
> ---
>  debian/control  | 14 ++
>  debian/notmuch-ruby.install |  1 +
>  debian/rules|  3 +++
>  3 files changed, 18 insertions(+)
>  create mode 100644 debian/notmuch-ruby.install
>

I get a build failure here; I installed ruby-dev and ran the usual 
"make debian-snapshot".

Does it work for you in a clean with only the declared build-depends
installed?


cd bindings/ruby && ruby extconf.rb --vendor && make
checking for notmuch.h in ../../lib... yes
checking for notmuch_database_create() in -lnotmuch... yes
creating Makefile
make[2]: Entering directory 
`/home/bremner/software/upstream/notmuch/bindings/ruby'
compiling status.c
status.c: In function ‘notmuch_rb_status_raise’:
status.c:46:10: error: ‘NOTMUCH_STATUS_UNBALANCED_ATOMIC’ undeclared (first use 
in this function)
status.c:46:10: note: each undeclared identifier is reported only once for each 
function it appears in
make[2]: *** [status.o] Error 1
make[2]: Leaving directory 
`/home/bremner/software/upstream/notmuch/bindings/ruby'
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory `/home/bremner/software/upstream/notmuch'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -D -us -uc -i failed
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] build: fix out-of-tree builds

2013-05-16 Thread Tomi Ollila
On Thu, May 16 2013, David Bremner  wrote:

> Jani Nikula  writes:
>
>> On Wed, 15 May 2013, David Bremner  wrote:
>>> Jani Nikula  writes:
  # List all subdirectories here. Each contains its own Makefile.local
 -subdirs := compat completion emacs lib man parse-time-string
 -subdirs += performance-test util test
 +subdirs = compat completion emacs lib man parse-time-string 
 performance-test util test
>>>
>>> Is this a functional change or a cosmetic one?
>>
>> Functional. All of it seems to be required for out-of-tree builds (*) to
>> work. I'm afraid I've forgotten exactly why both := and += make it fail
>> (I wrote the patch a few months ago).
>>
>
> Still I guess it deserves a comment so we don't break it again?

The following options could be tested (some day in (distant?) future):

subdirs = compat completion emacs lib man parse-time-string
subdirs += performance-test util test

or 

SUBDIRS := compat completion emacs lib man parse-time-string
SUBDIRS += performance-test util test
subdirs = $(SUBDIRS)

but as Jani has already tested his version works just adding that
comment David asked is the least labor-intensive thing to do --
and therefore IMHO the best thing to do for this case
(for sure I'm not going to spend more time on this now :D).

> d

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] build: fix out-of-tree builds

2013-05-16 Thread David Bremner
Jani Nikula  writes:

> On Wed, 15 May 2013, David Bremner  wrote:
>> Jani Nikula  writes:
>>>  # List all subdirectories here. Each contains its own Makefile.local
>>> -subdirs := compat completion emacs lib man parse-time-string
>>> -subdirs += performance-test util test
>>> +subdirs = compat completion emacs lib man parse-time-string 
>>> performance-test util test
>>
>> Is this a functional change or a cosmetic one?
>
> Functional. All of it seems to be required for out-of-tree builds (*) to
> work. I'm afraid I've forgotten exactly why both := and += make it fail
> (I wrote the patch a few months ago).
>

Still I guess it deserves a comment so we don't break it again?

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch