Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/ustr/, dev-libs/ustr/files/
Date: Wed, 17 Feb 2016 18:42:42
Message-Id: 1455734546.2d365dd353b15bf43b65049f4f9056f379607200.vapier@gentoo
1 commit: 2d365dd353b15bf43b65049f4f9056f379607200
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 17 18:31:53 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 17 18:42:26 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d365dd3
7
8 dev-libs/ustr: make installed file set more minimal
9
10 Add USE=static-libs to control install of the static archive.
11
12 Add USE=ustr-import to control install of the dev tool and source tree.
13
14 Punt the xxx-debug libs as this isn't how we handle debugging in Gentoo.
15
16 dev-libs/ustr/files/ustr-1.0.4-build-libs.patch | 49 +++++++++++++++
17 dev-libs/ustr/metadata.xml | 3 +
18 dev-libs/ustr/ustr-1.0.4-r8.ebuild | 84 +++++++++++++++++++++++++
19 3 files changed, 136 insertions(+)
20
21 diff --git a/dev-libs/ustr/files/ustr-1.0.4-build-libs.patch b/dev-libs/ustr/files/ustr-1.0.4-build-libs.patch
22 new file mode 100644
23 index 0000000..79fe818
24 --- /dev/null
25 +++ b/dev-libs/ustr/files/ustr-1.0.4-build-libs.patch
26 @@ -0,0 +1,49 @@
27 +make static lib build/install controllable so we can disable it by default
28 +
29 +punt the -debug lib variants ... if people want debug libs, they can rebuild
30 +the package using their desired build settings.
31 +
32 +--- a/Makefile
33 ++++ b/Makefile
34 +@@ -291,8 +291,10 @@
35 + OPT_LIB_SHARED = libustr-$(VERS_BSO).so.$(VERS_ESO)
36 + OPT_LIB_STATIC = libustr.a
37 +
38 +-LIB_SHARED = $(DBG_LIB_SHARED) $(OPT_LIB_SHARED)
39 +-LIB_STATIC = $(DBG_LIB_STATIC) $(OPT_LIB_STATIC)
40 ++LIB_SHARED = $(OPT_LIB_SHARED)
41 ++ifeq ($(USE_STATIC),yes)
42 ++LIB_STATIC = $(OPT_LIB_STATIC)
43 ++endif
44 +
45 + DEPS_NONC_ALL = $(SRC_HDRS) $(SRC_SRCS_H)
46 + DEPS_C_ALL = $(SRC_HDRS)
47 +@@ -388,17 +390,14 @@
48 + install -d $(DESTDIR)$(bindir)
49 + install -d $(DESTDIR)$(libdir)/pkgconfig
50 + $(HIDE)echo Installing files
51 ++ifeq ($(USE_STATIC),yes)
52 + install -m 644 -t $(DESTDIR)$(libdir) $(LIB_STATIC)
53 ++endif
54 + install -m 755 -t $(DESTDIR)$(libdir) $(LIB_SHARED)
55 + -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
56 + ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
57 + -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
58 + ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
59 +- -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
60 +- ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
61 +- -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
62 +- ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
63 +- $(LDCONFIG) -n $(DESTDIR)$(libdir)
64 + install -pm 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS)
65 + install -pm 644 -t $(DESTDIR)$(SHRDIR) $(SRC_SRCS)
66 + install -pm 644 -t $(DESTDIR)$(SHRDIR) $(XSRC_SRCS)
67 +@@ -406,7 +406,7 @@ endif
68 + install -pm 644 -t $(DESTDIR)$(mandir)/man1 $(MAN_PAGES_1)
69 + install -pm 644 -t $(DESTDIR)$(mandir)/man3 $(MAN_PAGES_3)
70 + install -m 755 -t $(DESTDIR)$(bindir) ustr-import
71 +- install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc ustr-debug.pc
72 ++ install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc
73 +
74 + ustr-import-multilib: ustr-import-multilib.in
75 + sed -e 's,@INCLUDEDIR@,$(includedir),g' -e 's,@MBINDIR@,$(MBINDIR),g' < $< > $@
76
77 diff --git a/dev-libs/ustr/metadata.xml b/dev-libs/ustr/metadata.xml
78 index 3d12db6..524aa43 100644
79 --- a/dev-libs/ustr/metadata.xml
80 +++ b/dev-libs/ustr/metadata.xml
81 @@ -10,4 +10,7 @@
82 <email>proxy-maint@g.o</email>
83 <name>Proxy Maintainers</name>
84 </maintainer>
85 +<use>
86 + <flag name="ustr-import">Install ustr-import developer program and source code for bundling.</flag>
87 +</use>
88 </pkgmetadata>
89
90 diff --git a/dev-libs/ustr/ustr-1.0.4-r8.ebuild b/dev-libs/ustr/ustr-1.0.4-r8.ebuild
91 new file mode 100644
92 index 0000000..a540dad
93 --- /dev/null
94 +++ b/dev-libs/ustr/ustr-1.0.4-r8.ebuild
95 @@ -0,0 +1,84 @@
96 +# Copyright 1999-2016 Gentoo Foundation
97 +# Distributed under the terms of the GNU General Public License v2
98 +# $Id$
99 +
100 +EAPI="5"
101 +
102 +inherit toolchain-funcs multilib-minimal
103 +
104 +DESCRIPTION="Low-overhead managed string library for C"
105 +HOMEPAGE="http://www.and.org/ustr"
106 +SRC_URI="ftp://ftp.and.org/pub/james/ustr/${PV}/${P}.tar.bz2"
107 +
108 +LICENSE="|| ( BSD-2 MIT LGPL-2 )"
109 +SLOT="0"
110 +KEYWORDS="~amd64 ~arm ~mips ~x86"
111 +IUSE="static-libs ustr-import"
112 +
113 +DOCS=(ChangeLog README README-DEVELOPERS AUTHORS NEWS TODO)
114 +
115 +MULTILIB_WRAPPED_HEADERS=(
116 + /usr/include/ustr-conf.h
117 + /usr/include/ustr-conf-debug.h
118 +)
119 +
120 +src_prepare() {
121 + epatch "${FILESDIR}/${P}-gcc_5-check.patch"
122 + epatch "${FILESDIR}/${PN}-1.0.4-build-libs.patch"
123 + multilib_copy_sources
124 +}
125 +
126 +_emake() {
127 + emake \
128 + USE_STATIC=$(usex static-libs) \
129 + AR="$(tc-getAR)" \
130 + CC="$(tc-getCC)" \
131 + CFLAGS="${CFLAGS} ${CPPFLAGS}" \
132 + LDFLAGS="${LDFLAGS}" \
133 + prefix="${EPREFIX}/usr" \
134 + libdir="${EPREFIX}/usr/$(get_libdir)" \
135 + mandir="${EPREFIX}/usr/share/man" \
136 + SHRDIR="${EPREFIX}/usr/share/${P}" \
137 + DOCSHRDIR="${EPREFIX}/usr/share/doc/${PF}" \
138 + HIDE= \
139 + "$@"
140 +}
141 +
142 +multilib_src_configure() {
143 + # The included configure tests require execution.
144 +
145 + # We require vsnprintf everywhere as it's in POSIX.
146 + printf '#!/bin/sh\necho 0\n' > autoconf_vsnprintf
147 + chmod a+rx autoconf_vsnprintf
148 +
149 + # Always use stdint.h as it's in POSIX.
150 + sed -i '/have_stdint_h=0/s:=0:=1:' Makefile || die
151 +
152 + # Figure out the size of size_t.
153 + printf '#include <sys/types.h>\nint main() { char buf[sizeof(size_t) - 8]; }\n' > sizet_test.c
154 + $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -c sizet_test.c 2>/dev/null
155 + printf '#!/bin/sh\necho %s\n' $(( $? == 0 )) > autoconf_64b
156 + chmod a+rx autoconf_64b
157 +
158 + # Generate the config file now to avoid bad makefile deps.
159 + _emake ustr-import
160 +}
161 +
162 +multilib_src_compile() {
163 + _emake all-shared
164 +}
165 +
166 +multilib_src_install() {
167 + _emake DESTDIR="${D}" install
168 +
169 + if ! use ustr-import ; then
170 + rm -r \
171 + "${ED}/usr/bin/ustr-import" \
172 + "${ED}/usr/share/man/man1/ustr-import.1" \
173 + "${ED}/usr/share/${P}" || die
174 + fi
175 +}
176 +
177 +multilib_src_test() {
178 + _emake check
179 +}