unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config
@ 2009-11-28 23:57 Jameson Graef Rollins
  2009-11-28 23:57 ` [PATCH 2/3] add checking for zlib development libraries to configure script Jameson Graef Rollins
  2009-12-05  0:12 ` [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config Carl Worth
  0 siblings, 2 replies; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-28 23:57 UTC (permalink / raw)
  To: notmuch

This also removes the Makefile.config from the repository, since it
shouldn't be kept in the repository and should be created by the
configure script.
---
 Makefile.config |    3 ---
 configure       |   12 +++++++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)
 delete mode 100644 Makefile.config

diff --git a/Makefile.config b/Makefile.config
deleted file mode 100644
index ddc7436..0000000
--- a/Makefile.config
+++ /dev/null
@@ -1,3 +0,0 @@
-prefix = /usr/local
-bash_completion_dir = /etc/bash_completion.d
-CFLAGS += -DHAVE_VALGRIND
diff --git a/configure b/configure
index e55f067..ab28fa3 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,15 @@
 #! /bin/sh
 
+# defaults
+PREFIX=/usr/local
+
+# option parsing
+for option; do
+    if [ "${option%=*}" = '--prefix' ] ; then
+	PREFIX="${option#*=}"
+    fi
+done
+
 cat <<EOF
 Welcome to Notmuch, a system for indexing, searching and tagging your email.
 
@@ -130,7 +140,7 @@ EOF
 
 # construct the Makefile.config
 cat > Makefile.config <<EOF
-prefix = /usr/local
+prefix = $PREFIX
 bash_completion_dir = /etc/bash_completion.d
 CFLAGS += ${have_valgrind}
 EOF
-- 
1.6.5

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

* [PATCH 2/3] add checking for zlib development libraries to configure script
  2009-11-28 23:57 [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config Jameson Graef Rollins
@ 2009-11-28 23:57 ` Jameson Graef Rollins
  2009-11-28 23:57   ` [PATCH 3/3] fix Makefile.local to install bash completion definitions as not executable Jameson Graef Rollins
  2009-11-29 10:46   ` [PATCH 2/3] add checking for zlib development libraries to configure script Mikhail Gusarov
  2009-12-05  0:12 ` [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config Carl Worth
  1 sibling, 2 replies; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-28 23:57 UTC (permalink / raw)
  To: notmuch

---
 configure |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index ab28fa3..1010799 100755
--- a/configure
+++ b/configure
@@ -63,6 +63,15 @@ else
     errors=$((errors + 1))
 fi
 
+if printf 'int main(){return 0;}' | gcc -x c -lz -o /dev/null - > /dev/null 2>&1; then
+    echo "Checking for zlib development files... Yes."
+    have_zlib=1
+else
+    echo "Checking for zlib development files... No."
+    have_zlib=0
+    errors=$((errors + 1))
+fi
+
 if pkg-config --modversion valgrind > /dev/null 2>&1; then
     echo "Checking for valgrind development files... Yes."
     have_valgrind=-DHAVE_VALGRIND
@@ -91,13 +100,16 @@ EOF
 	echo "	The talloc library (including development files such as headers)"
 	echo "	http://talloc.samba.org/"
     fi
+    if [ $have_zlib -eq 0 ]; then
+	echo "	The zlib library (including development files such as headers)"
+    fi
     cat <<EOF
 
 On a modern, package-based operating system such as Debian, you can
 install all of the dependencies with the following simple command
 line:
 
-	sudo apt-get install libxapian-dev libgmime-2.4-dev libtalloc-dev
+	sudo apt-get install libxapian-dev libgmime-2.4-dev libtalloc-dev libz-dev
 
 On other systems, a similar command can be used, but the details of the 
 package names may be different, (such as "devel" in place of "dev").
-- 
1.6.5

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

* [PATCH 3/3] fix Makefile.local to install bash completion definitions as not executable
  2009-11-28 23:57 ` [PATCH 2/3] add checking for zlib development libraries to configure script Jameson Graef Rollins
@ 2009-11-28 23:57   ` Jameson Graef Rollins
  2009-12-05  0:16     ` Carl Worth
  2009-11-29 10:46   ` [PATCH 2/3] add checking for zlib development libraries to configure script Mikhail Gusarov
  1 sibling, 1 reply; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-28 23:57 UTC (permalink / raw)
  To: notmuch

---
 Makefile.local |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 1744747..b818627 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -36,7 +36,7 @@ install: all notmuch.1.gz
 	done ;
 	install notmuch $(DESTDIR)$(prefix)/bin/
 	install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
-	install contrib/notmuch-completion.bash \
+	install -m0644 contrib/notmuch-completion.bash \
 		$(DESTDIR)$(bash_completion_dir)/notmuch
 
 install-emacs: install emacs
-- 
1.6.5

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

* Re: [PATCH 2/3] add checking for zlib development libraries to configure script
  2009-11-28 23:57 ` [PATCH 2/3] add checking for zlib development libraries to configure script Jameson Graef Rollins
  2009-11-28 23:57   ` [PATCH 3/3] fix Makefile.local to install bash completion definitions as not executable Jameson Graef Rollins
@ 2009-11-29 10:46   ` Mikhail Gusarov
  2009-11-29 12:50     ` david
  1 sibling, 1 reply; 12+ messages in thread
From: Mikhail Gusarov @ 2009-11-29 10:46 UTC (permalink / raw)
  To: Jameson Graef Rollins; +Cc: notmuch

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


Twas brillig at 18:57:36 28.11.2009 UTC-05 when jrollins@finestructure.net did gyre and gimble:

 JGR> + sudo apt-get install libxapian-dev libgmime-2.4-dev
 JGR> libtalloc-dev libz-dev

Proper fix is to fix libgmime-2.4.pc upstream to stop exposing -lz

-- 
  http://fossarchy.blogspot.com/

[-- Attachment #2: Type: application/pgp-signature, Size: 834 bytes --]

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

* Re: [PATCH 2/3] add checking for zlib development libraries to configure script
  2009-11-29 10:46   ` [PATCH 2/3] add checking for zlib development libraries to configure script Mikhail Gusarov
@ 2009-11-29 12:50     ` david
  0 siblings, 0 replies; 12+ messages in thread
From: david @ 2009-11-29 12:50 UTC (permalink / raw)
  To: notmuch


Mikhail Gusarov wrote:

>Twas brillig at 18:57:36 28.11.2009 UTC-05 when jrollins@finestructure.net did gyre and gimble:

> JGR> + sudo apt-get install libxapian-dev libgmime-2.4-dev
> JGR> libtalloc-dev libz-dev

>Proper fix is to fix libgmime-2.4.pc upstream to stop exposing -lz

This is now upstream bug  

     https://bugzilla.gnome.org/show_bug.cgi?id=603273

People more knowledgable in the ways of pkg-config are welcome to
chime in if I said something wrong or misleading.

d

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

* Re: [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config
  2009-11-28 23:57 [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config Jameson Graef Rollins
  2009-11-28 23:57 ` [PATCH 2/3] add checking for zlib development libraries to configure script Jameson Graef Rollins
@ 2009-12-05  0:12 ` Carl Worth
  2009-12-05  0:20   ` Jameson Graef Rollins
  1 sibling, 1 reply; 12+ messages in thread
From: Carl Worth @ 2009-12-05  0:12 UTC (permalink / raw)
  To: Jameson Graef Rollins, notmuch

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

On Sat, 28 Nov 2009 18:57:35 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> This also removes the Makefile.config from the repository, since it
> shouldn't be kept in the repository and should be created by the
> configure script.

Hi Jamie,

Handling --prefix will be a nice addition to our configure script. So,
thanks!

Your commit message has that flag word of "also" in it, and as it turns
out, the removal of Makefile.config from the repository has actually
happened already. But that was easy enough to fix.

> +# option parsing
> +for option; do
> +    if [ "${option%=*}" = '--prefix' ] ; then
> +	PREFIX="${option#*=}"
> +    fi
> +done

I've gone ahead and committed that now. Then I noticed that we should
really use ${option%%=*} to support the case of an option value
containing an '=' character. So I fixed that.

Then, since I was in the area, I added support to configure for
capturing CFLAGS from the environment, I fixed this (and also "make
CFLAGS=") to also influence C++ compilation (still can be separately
overridden with CXXFLAGS), and I fixed our quiet-compilation mode to
actually print the (user-specified) CFLAGS.

Finally, I documented things by adding a "configure --help" to document
CC, CFLAGS, and --prefix; and by making "make" tell the user about
"./configure" and "./configure --help" when make runs configure
implicitly.

Our configuration system certainly isn't as full-featured yet as a
standard autoconf-based configure script, but I'm quite happy with how
clean it is for both users and developers.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH 3/3] fix Makefile.local to install bash completion definitions as not executable
  2009-11-28 23:57   ` [PATCH 3/3] fix Makefile.local to install bash completion definitions as not executable Jameson Graef Rollins
@ 2009-12-05  0:16     ` Carl Worth
  2009-12-05  0:21       ` Jameson Graef Rollins
  0 siblings, 1 reply; 12+ messages in thread
From: Carl Worth @ 2009-12-05  0:16 UTC (permalink / raw)
  To: Jameson Graef Rollins, notmuch

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

On Sat, 28 Nov 2009 18:57:37 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> -	install contrib/notmuch-completion.bash \
> +	install -m0644 contrib/notmuch-completion.bash \
>  		$(DESTDIR)$(bash_completion_dir)/notmuch

Thanks. I pushed this.

I didn't push the parent commit in the thread, (regarding zlib), since as
mentioned in another reply this is actually a bug in the GMime
pkg-config file.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config
  2009-12-05  0:12 ` [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config Carl Worth
@ 2009-12-05  0:20   ` Jameson Graef Rollins
  2009-12-05  0:56     ` Carl Worth
  0 siblings, 1 reply; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-12-05  0:20 UTC (permalink / raw)
  To: Carl Worth; +Cc: notmuch

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

On Fri, Dec 04, 2009 at 04:12:47PM -0800, Carl Worth wrote:
> Handling --prefix will be a nice addition to our configure script. So,
> thanks!

Yeah, it's definitely needed for the Debian packaging as well.

> Your commit message has that flag word of "also" in it, and as it turns
> out, the removal of Makefile.config from the repository has actually
> happened already. But that was easy enough to fix.

I was thinking that the removal of the Makefile.config from the repo
went together with the new auto-generation of that file from configure
script.  Do you think they still should have been separate patches?

> > +# option parsing
> > +for option; do
> > +    if [ "${option%=*}" = '--prefix' ] ; then
> > +	PREFIX="${option#*=}"
> > +    fi
> > +done
> 
> I've gone ahead and committed that now. Then I noticed that we should
> really use ${option%%=*} to support the case of an option value
> containing an '=' character. So I fixed that.

Ah, good catch.  Sorry about that.  

> Our configuration system certainly isn't as full-featured yet as a
> standard autoconf-based configure script, but I'm quite happy with how
> clean it is for both users and developers.

Autoconf terrifies me, so I agree I'm quite happy with the simple
configure script we have right now.  If it gets the job done without
having to deal with autoconf then that's great in my book.

jamie.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 3/3] fix Makefile.local to install bash completion definitions as not executable
  2009-12-05  0:16     ` Carl Worth
@ 2009-12-05  0:21       ` Jameson Graef Rollins
  0 siblings, 0 replies; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-12-05  0:21 UTC (permalink / raw)
  To: Carl Worth; +Cc: notmuch

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

On Fri, Dec 04, 2009 at 04:16:20PM -0800, Carl Worth wrote:
> On Sat, 28 Nov 2009 18:57:37 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> > -	install contrib/notmuch-completion.bash \
> > +	install -m0644 contrib/notmuch-completion.bash \
> >  		$(DESTDIR)$(bash_completion_dir)/notmuch
> 
> Thanks. I pushed this.
> 
> I didn't push the parent commit in the thread, (regarding zlib), since as
> mentioned in another reply this is actually a bug in the GMime
> pkg-config file.

Great.  That's fine with me (assuming that GMime actually gets fixed
upstream).

jamie.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config
  2009-12-05  0:20   ` Jameson Graef Rollins
@ 2009-12-05  0:56     ` Carl Worth
  2009-12-05  8:59       ` Ingmar Vanhassel
  0 siblings, 1 reply; 12+ messages in thread
From: Carl Worth @ 2009-12-05  0:56 UTC (permalink / raw)
  To: Jameson Graef Rollins; +Cc: notmuch

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

On Fri, 4 Dec 2009 19:20:50 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> > Your commit message has that flag word of "also" in it, and as it turns
> > out, the removal of Makefile.config from the repository has actually
> > happened already. But that was easy enough to fix.
> 
> I was thinking that the removal of the Makefile.config from the repo
> went together with the new auto-generation of that file from configure
> script.  Do you think they still should have been separate patches?

No, it was fine. It's just funny to me how often that word "also" in a
commit message seems to end up being a predictor for things later, (like
this case where half of a patch is already implemented, or much worse,
how often a bisect lands on a commit that makes multiple changes).

So I was really just expressing amusement at seeing it again.

> > > +# option parsing
> > > +for option; do
> > > +    if [ "${option%=*}" = '--prefix' ] ; then
> > > +	PREFIX="${option#*=}"
> > > +    fi
> > > +done
> > 
> > I've gone ahead and committed that now. Then I noticed that we should
> > really use ${option%%=*} to support the case of an option value
> > containing an '=' character. So I fixed that.
> 
> Ah, good catch.  Sorry about that.  

No worries. I was just impressed at the tiny amount of code needed for
the parsing here, so ended up looking closer to understand it.

> Autoconf terrifies me, so I agree I'm quite happy with the simple
> configure script we have right now.  If it gets the job done without
> having to deal with autoconf then that's great in my book.

Cool. At least not everyone thinks I'm crazy then. That's
encouraging. :-)

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config
  2009-12-05  0:56     ` Carl Worth
@ 2009-12-05  8:59       ` Ingmar Vanhassel
  2009-12-05 23:05         ` Carl Worth
  0 siblings, 1 reply; 12+ messages in thread
From: Ingmar Vanhassel @ 2009-12-05  8:59 UTC (permalink / raw)
  To: notmuch

Excerpts from Carl Worth's message of Sat Dec 05 01:56:56 +0100 2009:
> Cool. At least not everyone thinks I'm crazy then. That's
> encouraging. :-)

I'm not convinced that re-implementing lots of things that autoconf
already handles properly & portably is the better route to go. It's
purely a waste of time. Hence, I'll be happy to send patches to use
autoconf, if you change your mind on the subject.

Now when you say you hate automake & libtool, then I'll wholeheartedly
agree with you.

-Ingmar
-- 
Exherbo KDE, X.org maintainer

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

* Re: [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config
  2009-12-05  8:59       ` Ingmar Vanhassel
@ 2009-12-05 23:05         ` Carl Worth
  0 siblings, 0 replies; 12+ messages in thread
From: Carl Worth @ 2009-12-05 23:05 UTC (permalink / raw)
  To: Ingmar Vanhassel, notmuch

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

On Sat, 05 Dec 2009 09:59:12 +0100, Ingmar Vanhassel <ingmar@exherbo.org> wrote:
> Excerpts from Carl Worth's message of Sat Dec 05 01:56:56 +0100 2009:
> > Cool. At least not everyone thinks I'm crazy then. That's
> > encouraging. :-)
> 
> I'm not convinced that re-implementing lots of things that autoconf
> already handles properly & portably is the better route to go. It's
> purely a waste of time. Hence, I'll be happy to send patches to use
> autoconf, if you change your mind on the subject.

Let's test it.

If you could write a patch to replace our current configure script with
something based on autoconf, then I'll be glad to try it out and see
what I think.

If there are any differences that I find annoying, then we can see which
of those we can work around or get fixed in upstream autoconf.

I'm definitely open to exploration in this area.

> Now when you say you hate automake & libtool, then I'll wholeheartedly
> agree with you.

Hate is one emotion that I do my best to avoid. But I am quite glad to
have found no compelling reason to use either automake or libtool so
far in notmuch. :-)

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2009-12-05 23:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-28 23:57 [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config Jameson Graef Rollins
2009-11-28 23:57 ` [PATCH 2/3] add checking for zlib development libraries to configure script Jameson Graef Rollins
2009-11-28 23:57   ` [PATCH 3/3] fix Makefile.local to install bash completion definitions as not executable Jameson Graef Rollins
2009-12-05  0:16     ` Carl Worth
2009-12-05  0:21       ` Jameson Graef Rollins
2009-11-29 10:46   ` [PATCH 2/3] add checking for zlib development libraries to configure script Mikhail Gusarov
2009-11-29 12:50     ` david
2009-12-05  0:12 ` [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config Carl Worth
2009-12-05  0:20   ` Jameson Graef Rollins
2009-12-05  0:56     ` Carl Worth
2009-12-05  8:59       ` Ingmar Vanhassel
2009-12-05 23:05         ` Carl Worth

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

	https://yhetil.org/notmuch.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).