Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 1b / a863899ba125dc4eddcc59de2c11d624787ba1
1 Return-Path: <tomi.ollila@iki.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 4EB93431FC7\r
6         for <notmuch@notmuchmail.org>; Mon, 12 May 2014 08:22:06 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id RYGYR-0vovMt for <notmuch@notmuchmail.org>;\r
16         Mon, 12 May 2014 08:22:01 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 75477431FC2\r
19         for <notmuch@notmuchmail.org>; Mon, 12 May 2014 08:22:01 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 47FE2100051;\r
22         Mon, 12 May 2014 18:21:52 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Felipe Contreras <felipe.contreras@gmail.com>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] configure: add workaround for systems without zlib.pc\r
26 In-Reply-To: <1399864172-28227-1-git-send-email-felipe.contreras@gmail.com>\r
27 References: <1399864172-28227-1-git-send-email-felipe.contreras@gmail.com>\r
28 User-Agent: Notmuch/0.18+11~gb21401f (http://notmuchmail.org) Emacs/24.3.1\r
29         (x86_64-unknown-linux-gnu)\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
31         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
32         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
33 Date: Mon, 12 May 2014 18:21:51 +0300\r
34 Message-ID: <m2wqdrqay8.fsf@guru.guru-group.fi>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Mon, 12 May 2014 15:22:06 -0000\r
50 \r
51 On Mon, May 12 2014, Felipe Contreras <felipe.contreras@gmail.com> wrote:\r
52 \r
53 > Some systems (e.g. FreeBSD) might not have installed the appropriate\r
54 > pkg-config file as they should. We can workaround the issue by creating\r
55 > the .pc file they should have distributed.\r
56 \r
57 I agree with David that this is easier to follow (and don't have those\r
58 sneaky zv? -variables ;D\r
59 \r
60 2 comments inline.\r
61 \r
62 >\r
63 > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
64 > ---\r
65 >  compat/.gitignore    |  1 +\r
66 >  compat/gen_zlib_pc.c | 18 ++++++++++++++++++\r
67 >  configure            |  9 +++++++++\r
68 >  3 files changed, 28 insertions(+)\r
69 >  create mode 100644 compat/.gitignore\r
70 >  create mode 100644 compat/gen_zlib_pc.c\r
71 >\r
72 > diff --git a/compat/.gitignore b/compat/.gitignore\r
73 > new file mode 100644\r
74 > index 0000000..107ba17\r
75 > --- /dev/null\r
76 > +++ b/compat/.gitignore\r
77 > @@ -0,0 +1 @@\r
78 > +zlib.pc\r
79 > diff --git a/compat/gen_zlib_pc.c b/compat/gen_zlib_pc.c\r
80 > new file mode 100644\r
81 > index 0000000..198a727\r
82 > --- /dev/null\r
83 > +++ b/compat/gen_zlib_pc.c\r
84 > @@ -0,0 +1,18 @@\r
85 > +#include <stdio.h>\r
86 > +#include <zlib.h>\r
87 > +\r
88 > +static const char *template =\r
89 > +     "prefix=/usr\n"\r
90 > +     "exec_prefix=${prefix}\n"\r
91 > +     "libdir=${exec_prefix}/lib\n"\r
92 > +     "\n"\r
93 > +     "Name: zlib\n"\r
94 > +     "Description: zlib compression library\n"\r
95 > +     "Version: %s\n"\r
96 > +     "Libs: -lz\n";\r
97 \r
98 The above is bit different what zlib.pc files have in e.g. Fedora 20 and\r
99 Ubuntu 14.04 machines: those have 'Requires: before Libs: (and Cflags:)'\r
100 But probably that is unnecessary (and just some sugar coating...?).\r
101 \r
102 \r
103 > +int main(void)\r
104 > +{\r
105 > +     printf(template, ZLIB_VERSION);\r
106 > +     return 0;\r
107 > +}\r
108 > diff --git a/configure b/configure\r
109 > index 9bde2eb..35dd21f 100755\r
110 > --- a/configure\r
111 > +++ b/configure\r
112 > @@ -340,6 +340,15 @@ else\r
113 >      errors=$((errors + 1))\r
114 >  fi\r
115 >  \r
116 > +if ! pkg-config --exists zlib; then\r
117 > +  ${CC} ${zlib_cflags} -o compat/gen_zlib_pc \\r
118 > +       "$srcdir"/compat/gen_zlib_pc.c ${zlib_ldflags} > /dev/null 2>&1 &&\r
119 > +  compat/gen_zlib_pc > compat/zlib.pc &&\r
120 > +  PKG_CONFIG_PATH="$PKG_CONFIG_PATH":compat &&\r
121 \r
122 To be consistent what we do elsewhere:\r
123 \r
124   PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+$PKG_CONFIG_PATH:}compat &&\r
125 \r
126 i.e. don't add ':' in case $PKG_CONFIG_PATH is not defined or is empty string.\r
127 \r
128 \r
129 Tomi\r
130 \r
131 \r
132 > +  export PKG_CONFIG_PATH\r
133 > +  rm -f compat/gen_zlib_pc\r
134 > +fi\r
135 > +\r
136 >  printf "Checking for zlib (>= 1.2.5.2)... "\r
137 >  have_zlib=0\r
138 >  if pkg-config --atleast-version=1.2.5.2 zlib; then\r
139 > -- \r
140 > 1.9.2+fc1~45~g3953d93\r