Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/mongrel2/files/, www-servers/mongrel2/
Date: Sun, 25 Apr 2021 19:13:51
Message-Id: 1619378010.6b44b84acbbfffbfdfee27d28380f0ea3489eb3b.sam@gentoo
1 commit: 6b44b84acbbfffbfdfee27d28380f0ea3489eb3b
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 25 18:52:44 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 25 19:13:30 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b44b84a
7
8 www-servers/mongrel2: respect *FLAGS, $(AR) and $(RANLIB)
9
10 Closes: https://bugs.gentoo.org/771852
11 Closes: https://bugs.gentoo.org/742608
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 .../files/mongrel2-1.11.0-respect-FLAGS.patch | 146 +++++++++++++++++++++
15 www-servers/mongrel2/files/systemtls.mak | 10 +-
16 www-servers/mongrel2/mongrel2-1.11.0-r1.ebuild | 3 +-
17 3 files changed, 153 insertions(+), 6 deletions(-)
18
19 diff --git a/www-servers/mongrel2/files/mongrel2-1.11.0-respect-FLAGS.patch b/www-servers/mongrel2/files/mongrel2-1.11.0-respect-FLAGS.patch
20 new file mode 100644
21 index 00000000000..17b5da34006
22 --- /dev/null
23 +++ b/www-servers/mongrel2/files/mongrel2-1.11.0-respect-FLAGS.patch
24 @@ -0,0 +1,146 @@
25 +--- a/examples/kegogi/Makefile
26 ++++ b/examples/kegogi/Makefile
27 +@@ -1,4 +1,4 @@
28 +-CFLAGS=-g -I../../src -Isrc -Wall -Wextra
29 ++CFLAGS+=-I../../src -Isrc -Wall -Wextra
30 + LIBS=-lzmq -lsqlite3
31 +
32 + all: kegogi
33 +@@ -8,10 +8,10 @@ install: all
34 +
35 + kegogi: src/kegogi.o src/fuzzrnd.o src/kegogi_parser.o src/httpclient.o src/param.o src/kegogi_lexer.o src/kegogi_tokens.o
36 + mkdir -p build
37 +- $(CC) ${CFLAGS} -o build/kegogi src/kegogi.o src/kegogi_parser.o src/kegogi_lexer.o src/fuzzrnd.o src/httpclient.o src/param.o src/kegogi_tokens.o ${LIBS} ../../build/libm2.a
38 ++ $(CC) $(CPPFLAGS) ${CFLAGS} $(LDFLAGS) -o build/kegogi src/kegogi.o src/kegogi_parser.o src/kegogi_lexer.o src/fuzzrnd.o src/httpclient.o src/param.o src/kegogi_tokens.o ${LIBS} ../../build/libm2.a
39 +
40 + src/kegogi_lexer.o: src/kegogi_lexer.c
41 +- $(CC) $(CFLAGS) -c src/kegogi_lexer.c -o src/kegogi_lexer.o
42 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c src/kegogi_lexer.c -o src/kegogi_lexer.o
43 +
44 + src/kegogi_lexer.c: src/kegogi_lexer.rl src/kegogi_parser.h
45 + ragel src/kegogi_lexer.rl -C -o src/kegogi_lexer.c
46 +--- a/tests/filters/Makefile
47 ++++ b/tests/filters/Makefile
48 +@@ -1,12 +1,12 @@
49 + PREFIX?=/usr/local
50 +-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
51 +-LDFLAGS=$(OPTLIBS)
52 ++CFLAGS+=-I../../src -I../../src/mbedtls/include -fPIC -shared -nostartfiles -L../../build
53 ++LDFLAGS+=$(OPTLIBS)
54 +
55 + all: test_filter.so test_filter_a.so test_filter_b.so test_filter_c.so
56 +
57 +
58 + %.so : %.c ../../build/libm2.a
59 +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
60 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
61 +
62 + clean:
63 + rm -f *.so
64 +--- a/tools/config_modules/Makefile
65 ++++ b/tools/config_modules/Makefile
66 +@@ -1,6 +1,6 @@
67 + PREFIX?=/usr/local
68 +-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
69 +-LDFLAGS=$(OPTLIBS)
70 ++CFLAGS+=-I../../src -I../../src/mbedtls/include -fPIC -shared -nostartfiles -L../../build
71 ++LDFLAGS+=$(OPTLIBS)
72 +
73 + MONGO_SRC = mongo-c-driver/src/bson.c \
74 + mongo-c-driver/src/encoding.c \
75 +@@ -22,11 +22,11 @@ fetch_mongo_c_driver:
76 + mongodb.so: CFLAGS += $(MONGO_CFLAGS)
77 + mongodb.so: fetch_mongo_c_driver
78 + mongodb.so: mongodb.c
79 +- $(CC) $(CFLAGS) -c $(MONGO_SRC)
80 +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< bson.o encoding.o gridfs.o md5.o mongo.o env_posix.o numbers.o ../../build/libm2.a
81 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $(MONGO_SRC)
82 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< bson.o encoding.o gridfs.o md5.o mongo.o env_posix.o numbers.o ../../build/libm2.a
83 +
84 + %.so : %.c
85 +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
86 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
87 +
88 + clean:
89 + rm -f *.o *.so
90 +--- a/tools/filters/Makefile
91 ++++ b/tools/filters/Makefile
92 +@@ -1,12 +1,12 @@
93 + PREFIX?=/usr/local
94 +-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -g -fPIC -shared -nostartfiles -L../../build
95 +-LDFLAGS=$(OPTLIBS)
96 ++CFLAGS+=-I../../src -I../../src/mbedtls/include -fPIC -shared -nostartfiles -L../../build
97 ++LDFLAGS+=$(OPTLIBS)
98 +
99 + all: null.so rewrite.so sendfile.so
100 +
101 +
102 + %.so : %.c
103 +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
104 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
105 +
106 + clean:
107 + rm -f *.so
108 +--- a/tools/m2sh/Makefile
109 ++++ b/tools/m2sh/Makefile
110 +@@ -1,4 +1,4 @@
111 +-CFLAGS=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
112 ++CFLAGS+=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall
113 + LIBS=-lzmq -lsqlite3 ../../build/libm2.a $(OPTLIBS)
114 +
115 + PREFIX?=/usr/local
116 +@@ -11,7 +11,7 @@ LIB_OBJ=$(filter-out src/m2sh.o,${OBJECTS})
117 +
118 + all: ../lemon/lemon tests build/m2sh
119 +
120 +-dev: CFLAGS=-g -Wall -Wextra -Isrc -I../../src $(OPTFLAGS)
121 ++dev: CFLAGS+=-Wall -Wextra -Isrc -I../../src $(OPTFLAGS)
122 + dev: all
123 +
124 + install: build/m2sh
125 +@@ -19,15 +19,15 @@ install: build/m2sh
126 +
127 + build/libm2sh.a: ${LIB_OBJ}
128 + mkdir -p build
129 +- ar rcs $@ ${LIB_OBJ}
130 +- ranlib $@
131 ++ $(AR) rcs $@ ${LIB_OBJ}
132 ++ $(RANLIB) $@
133 +
134 + build/m2sh: ../lemon/lemon ../../build/libm2.a ${OBJECTS}
135 + mkdir -p build
136 +- $(CC) $(CFLAGS) -o build/m2sh ${OBJECTS} ../../build/libm2.a $(LIBS)
137 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o build/m2sh ${OBJECTS} ../../build/libm2.a $(LIBS)
138 +
139 + ../lemon/lemon: ../lemon/lemon.c
140 +- $(CC) -O2 ../lemon/lemon.c -o ../lemon/lemon
141 ++ $(CC) $(CPPFLAGS) $(LDFLAGS) ../lemon/lemon.c -o ../lemon/lemon
142 +
143 + tests: build/libm2sh.a ${TESTS}
144 + sh ./tests/runtests.sh
145 +@@ -39,7 +39,7 @@ tests: build/libm2sh.a ${TESTS}
146 + ragel -G2 $<
147 +
148 + $(TESTS): %: %.c build/libm2sh.a
149 +- $(CC) $(CFLAGS) -o $@ $< build/libm2sh.a ../../build/libm2.a $(LIBS)
150 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< build/libm2sh.a ../../build/libm2.a $(LIBS)
151 +
152 + ../../build/libm2.a:
153 + cd ../.. && make clean all
154 +--- a/tools/procer/Makefile
155 ++++ b/tools/procer/Makefile
156 +@@ -1,4 +1,4 @@
157 +-CFLAGS=-DNDEBUG -pthread -g -I../../src -Wall $(OPTFLAGS)
158 ++CFLAGS+=-DNDEBUG -pthread -g -I../../src -Wall
159 + PREFIX?=/usr/local
160 + LIBS?=-lzmq
161 + SOURCES=$(wildcard *.c)
162 +@@ -8,7 +8,7 @@ all: procer
163 +
164 +
165 + procer: ../../build/libm2.a ${OBJECTS}
166 +- $(CC) $(OPTFLAGS) $(OPTLIBS) -o $@ ${OBJECTS} ../../build/libm2.a ${LIBS}
167 ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ ${OBJECTS} ../../build/libm2.a ${LIBS}
168 +
169 + clean:
170 + rm -f *.o procer
171
172 diff --git a/www-servers/mongrel2/files/systemtls.mak b/www-servers/mongrel2/files/systemtls.mak
173 index e449b762af3..a536094b3f5 100644
174 --- a/www-servers/mongrel2/files/systemtls.mak
175 +++ b/www-servers/mongrel2/files/systemtls.mak
176 @@ -43,12 +43,12 @@ builddirs:
177 @mkdir -p bin
178
179 bin/mongrel2: build/libm2.a src/mongrel2.o
180 - $(CC) $(CFLAGS) $(LDFLAGS) src/mongrel2.o -o $@ $< $(LIBS)
181 + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) src/mongrel2.o -o $@ $< $(LIBS)
182
183 build/libm2.a: CFLAGS += -fPIC
184 build/libm2.a: ${LIB_OBJ}
185 - ar rcs $@ ${LIB_OBJ}
186 - ranlib $@
187 + $(AR) rcs $@ ${LIB_OBJ}
188 + $(RANLIB) $@
189
190 clean:
191 rm -rf build bin lib ${OBJECTS} ${TESTS} tests/config.sqlite
192 @@ -88,7 +88,7 @@ tests/config.sqlite: src/config/config.sql src/config/example.sql src/config/mim
193 sqlite3 $@ < src/config/mimetypes.sql
194
195 $(TESTS): %: %.c build/libm2.a
196 - $(CC) $(CFLAGS) -o $@ $< build/libm2.a $(LIBS)
197 + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< build/libm2.a $(LIBS)
198
199 src/state.c: src/state.rl src/state_machine.rl
200 src/http11/http11_parser.c: src/http11/http11_parser.rl
201 @@ -133,4 +133,4 @@ ragel:
202 ragel -G2 src/http11/httpclient_parser.rl
203
204 %.o: %.S
205 - $(CC) $(CFLAGS) -c $< -o $@
206 + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $< -o $@
207
208 diff --git a/www-servers/mongrel2/mongrel2-1.11.0-r1.ebuild b/www-servers/mongrel2/mongrel2-1.11.0-r1.ebuild
209 index 5ba0b548663..0317876c263 100644
210 --- a/www-servers/mongrel2/mongrel2-1.11.0-r1.ebuild
211 +++ b/www-servers/mongrel2/mongrel2-1.11.0-r1.ebuild
212 @@ -22,6 +22,7 @@ RDEPEND="${DEPEND}"
213 PATCHES=(
214 "${FILESDIR}"/${P}-polarssl-platform-590512.patch
215 "${FILESDIR}"/${P}-fno-common.patch
216 + "${FILESDIR}"/${PN}-1.11.0-respect-FLAGS.patch
217 )
218
219 src_prepare() {
220 @@ -30,7 +31,7 @@ src_prepare() {
221 }
222
223 src_configure() {
224 - tc-export CC
225 + tc-export AR CC RANLIB
226 default
227 }