Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/scrot/, media-gfx/scrot/files/
Date: Fri, 07 Aug 2020 11:29:21
Message-Id: 1596799753.a60996126492871f7f1d76985fb38afebd2a9079.jer@gentoo
1 commit: a60996126492871f7f1d76985fb38afebd2a9079
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 7 11:26:35 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 7 11:29:13 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6099612
7
8 media-gfx/scrot: Fix acinclude.m4
9
10 Package-Manager: Portage-3.0.1, Repoman-2.3.23
11 Closes: https://bugs.gentoo.org/726290
12 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
13
14 media-gfx/scrot/files/ax_prefix_config_h.m4 | 203 ++++++++++++++++++++++++++++
15 media-gfx/scrot/scrot-1.4.ebuild | 3 +
16 media-gfx/scrot/scrot-9999.ebuild | 3 +
17 3 files changed, 209 insertions(+)
18
19 diff --git a/media-gfx/scrot/files/ax_prefix_config_h.m4 b/media-gfx/scrot/files/ax_prefix_config_h.m4
20 new file mode 100644
21 index 00000000000..22acbac68d5
22 --- /dev/null
23 +++ b/media-gfx/scrot/files/ax_prefix_config_h.m4
24 @@ -0,0 +1,203 @@
25 +# ===========================================================================
26 +# https://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html
27 +# ===========================================================================
28 +#
29 +# SYNOPSIS
30 +#
31 +# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
32 +#
33 +# DESCRIPTION
34 +#
35 +# Generate an installable config.h.
36 +#
37 +# A package should not normally install its config.h as a system header,
38 +# but if it must, this macro can be used to avoid namespace pollution by
39 +# making a copy of config.h with a prefix added to all the macro names.
40 +#
41 +# Each "#define SOMEDEF" line of the configuration header has the given
42 +# prefix added, in the same case as the first character of the macro name.
43 +#
44 +# Defaults:
45 +#
46 +# OUTPUT-HEADER = $PACKAGE-config.h
47 +# PREFIX = $PACKAGE
48 +# ORIG-HEADER, from AM_CONFIG_HEADER(config.h)
49 +#
50 +# Your configure.ac script should contain both macros in this order.
51 +#
52 +# Example:
53 +#
54 +# AC_INIT(config.h.in) # config.h.in as created by "autoheader"
55 +# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE
56 +# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in
57 +# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..
58 +# AC_MEMORY_H # makes "#undef NEED_MEMORY_H"
59 +# AC_C_CONST_H # makes "#undef const"
60 +# AC_OUTPUT(Makefile) # creates the "config.h" now
61 +# # and also mylib/_config.h
62 +#
63 +# If the argument to AX_PREFIX_CONFIG_H would have been omitted then the
64 +# default output file would have been called simply "testpkg-config.h",
65 +# but even under the name "mylib/_config.h" it contains prefix-defines
66 +# like
67 +#
68 +# #ifndef TESTPKG_VERSION
69 +# #define TESTPKG_VERSION "0.1.1"
70 +# #endif
71 +# #ifndef TESTPKG_NEED_MEMORY_H
72 +# #define TESTPKG_NEED_MEMORY_H 1
73 +# #endif
74 +# #ifndef _testpkg_const
75 +# #define _testpkg_const _const
76 +# #endif
77 +#
78 +# and this "mylib/_config.h" can be installed along with other header
79 +# files, which is most convenient when creating a shared library (that has
80 +# some headers) whose functionality depends on features detected at
81 +# compile-time. No need to invent some "mylib-confdefs.h.in" manually.
82 +#
83 +# Note that some AC_DEFINEs that end up in the config.h file are actually
84 +# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T
85 +# say that they "will define inline|const|off_t if the system does not do
86 +# it by itself". You might want to clean up about these - consider an
87 +# extra mylib/conf.h that reads something like:
88 +#
89 +# #include <mylib/_config.h>
90 +# #ifndef _testpkg_const
91 +# #define _testpkg_const const
92 +# #endif
93 +#
94 +# and then start using _testpkg_const in the header files. That is also a
95 +# good thing to differentiate whether some library-user has starting to
96 +# take up with a different compiler, so perhaps it could read something
97 +# like this:
98 +#
99 +# #ifdef _MSC_VER
100 +# #include <mylib/_msvc.h>
101 +# #else
102 +# #include <mylib/_config.h>
103 +# #endif
104 +# #ifndef _testpkg_const
105 +# #define _testpkg_const const
106 +# #endif
107 +#
108 +# LICENSE
109 +#
110 +# Copyright (c) 2014 Reuben Thomas <rrt@××××.org>
111 +# Copyright (c) 2008 Guido U. Draheim <guidod@×××.de>
112 +# Copyright (c) 2008 Marten Svantesson
113 +# Copyright (c) 2008 Gerald Point <Gerald.Point@×××××.fr>
114 +#
115 +# This program is free software; you can redistribute it and/or modify it
116 +# under the terms of the GNU General Public License as published by the
117 +# Free Software Foundation; either version 3 of the License, or (at your
118 +# option) any later version.
119 +#
120 +# This program is distributed in the hope that it will be useful, but
121 +# WITHOUT ANY WARRANTY; without even the implied warranty of
122 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
123 +# Public License for more details.
124 +#
125 +# You should have received a copy of the GNU General Public License along
126 +# with this program. If not, see <https://www.gnu.org/licenses/>.
127 +#
128 +# As a special exception, the respective Autoconf Macro's copyright owner
129 +# gives unlimited permission to copy, distribute and modify the configure
130 +# scripts that are the output of Autoconf when processing the Macro. You
131 +# need not follow the terms of the GNU General Public License when using
132 +# or distributing such scripts, even though portions of the text of the
133 +# Macro appear in them. The GNU General Public License (GPL) does govern
134 +# all other use of the material that constitutes the Autoconf Macro.
135 +#
136 +# This special exception to the GPL applies to versions of the Autoconf
137 +# Macro released by the Autoconf Archive. When you make and distribute a
138 +# modified version of the Autoconf Macro, you may extend this special
139 +# exception to the GPL to apply to your modified version as well.
140 +
141 +#serial 16
142 +
143 +AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl
144 +AC_PREREQ([2.62])
145 +AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl
146 +AC_CONFIG_COMMANDS(m4_default([$1], [$PACKAGE-config.h]),[dnl
147 +AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
148 +AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl
149 +AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl
150 +AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl
151 +AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl
152 +AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl
153 +m4_pushdef([_script],[conftest.prefix])dnl
154 +m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
155 +_OUT=`echo m4_default([$1], [$PACKAGE-config.h])`
156 +_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
157 +_PKG=`echo m4_default([$2], [$PACKAGE])`
158 +_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
159 +_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
160 +_INP=`echo "$3" | sed -e 's/ *//'`
161 +if test ".$_INP" = "."; then
162 + for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
163 + case "$ac_file" in
164 + *.h) _INP=$ac_file ;;
165 + *)
166 + esac
167 + test ".$_INP" != "." && break
168 + done
169 +fi
170 +if test ".$_INP" = "."; then
171 + case "$_OUT" in
172 + */*) _INP=`basename "$_OUT"`
173 + ;;
174 + *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`
175 + ;;
176 + *) _INP=config.h
177 + ;;
178 + esac
179 +fi
180 +if test -z "$_PKG" ; then
181 + AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
182 +else
183 + if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
184 + _INP="$srcdir/$_INP"
185 + fi fi
186 + AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
187 + if test -f $_INP ; then
188 + AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/"]) > _script
189 + AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/"]) >> _script
190 + AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1\\"]) >> _script
191 + AS_ECHO(["@%:@def[]ine $_UPP""_\\1\\2\\"]) >> _script
192 + AS_ECHO(["@%:@endif/"]) >> _script
193 + AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1\\"]) >> _script
194 + AS_ECHO(["@%:@define $_LOW""_\\1\\2\\"]) >> _script
195 + AS_ECHO(["@%:@endif/"]) >> _script
196 + # now executing _script on _DEF input to create _OUT output file
197 + echo "@%:@ifndef $_DEF" >$tmp/pconfig.h
198 + echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
199 + echo ' ' >>$tmp/pconfig.h
200 + echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
201 +
202 + sed -f _script $_INP >>$tmp/pconfig.h
203 + echo ' ' >>$tmp/pconfig.h
204 + echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h
205 + echo "@%:@endif" >>$tmp/pconfig.h
206 + if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then
207 + AC_MSG_NOTICE([$_OUT is unchanged])
208 + else
209 + ac_dir=`AS_DIRNAME(["$_OUT"])`
210 + AS_MKDIR_P(["$ac_dir"])
211 + rm -f "$_OUT"
212 + mv $tmp/pconfig.h "$_OUT"
213 + fi
214 + else
215 + AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
216 + fi
217 + rm -f conftest.*
218 +fi
219 +m4_popdef([_symbol])dnl
220 +m4_popdef([_script])dnl
221 +AS_VAR_POPDEF([_INP])dnl
222 +AS_VAR_POPDEF([_UPP])dnl
223 +AS_VAR_POPDEF([_LOW])dnl
224 +AS_VAR_POPDEF([_PKG])dnl
225 +AS_VAR_POPDEF([_DEF])dnl
226 +AS_VAR_POPDEF([_OUT])dnl
227 +],[PACKAGE="$PACKAGE"])])
228
229 diff --git a/media-gfx/scrot/scrot-1.4.ebuild b/media-gfx/scrot/scrot-1.4.ebuild
230 index 4b8af98639c..a41006736fa 100644
231 --- a/media-gfx/scrot/scrot-1.4.ebuild
232 +++ b/media-gfx/scrot/scrot-1.4.ebuild
233 @@ -34,7 +34,10 @@ DOCS=(
234
235 src_prepare() {
236 sed -i -e 's#-g -O3##g' src/Makefile.am || die
237 + cat "${FILESDIR}"/ax_prefix_config_h.m4 >> acinclude.m4 || die
238 +
239 default
240 +
241 eautoreconf
242 }
243
244
245 diff --git a/media-gfx/scrot/scrot-9999.ebuild b/media-gfx/scrot/scrot-9999.ebuild
246 index 3bf57b1445b..605a004b710 100644
247 --- a/media-gfx/scrot/scrot-9999.ebuild
248 +++ b/media-gfx/scrot/scrot-9999.ebuild
249 @@ -34,7 +34,10 @@ DOCS=(
250
251 src_prepare() {
252 sed -i -e 's#-g -O3##g' src/Makefile.am || die
253 + cat "${FILESDIR}"/ax_prefix_config_h.m4 >> acinclude.m4 || die
254 +
255 default
256 +
257 eautoreconf
258 }