Don't return flags of privately used libraries

- Don't return flags of privately used libraries when
  calling "freetype-config --libs"
- Resolves: #1079302
This commit is contained in:
Marek Kasik 2014-03-25 13:40:54 +01:00
parent 27e95cfb6b
commit 934384ee44
2 changed files with 107 additions and 4 deletions

View File

@ -0,0 +1,96 @@
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -937,21 +937,6 @@ LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
-e 's/ *$//' \
-e 's/ */ /g'`
-LIBS_CONFIG="-lfreetype \
- $ZLIB_LIBS \
- $BZIP2_LIBS \
- $LIBPNG_LIBS \
- $HARFBUZZ_LIBS \
- $ft2_extra_libs"
-# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
-# on if necessary; also beautify
-LIBS_CONFIG=`echo "$LIBS_CONFIG" \
- | sed -e 's|-L */usr/lib64/* | |g' \
- -e 's|-L */usr/lib/* | |g' \
- -e 's/^ *//' \
- -e 's/ *$//' \
- -e 's/ */ /g'`
-
LIBSSTATIC_CONFIG="-lfreetype \
$zlib_libstaticconf \
$bzip2_libstaticconf \
@@ -971,7 +956,6 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
AC_SUBST([ftmac_c])
AC_SUBST([REQUIRES_PRIVATE])
AC_SUBST([LIBS_PRIVATE])
-AC_SUBST([LIBS_CONFIG])
AC_SUBST([LIBSSTATIC_CONFIG])
AC_SUBST([hardcode_libdir_flag_spec])
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -142,7 +142,7 @@ if test "$echo_cflags" = "yes" ; then
fi
if test "$echo_libs" = "yes" ; then
- libs="%LIBS_CONFIG%"
+ libs="-lfreetype"
staticlibs="%LIBSSTATIC_CONFIG%"
if test "$show_static" = "yes" ; then
libs="$staticlibs"
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -64,7 +64,6 @@ version_info := @version_info@
#
REQUIRES_PRIVATE := @REQUIRES_PRIVATE@
LIBS_PRIVATE := @LIBS_PRIVATE@
-LIBS_CONFIG := @LIBS_CONFIG@
LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
build_libtool_libs := @build_libtool_libs@
ft_version := @ft_version@
@@ -102,8 +101,7 @@ NO_OUTPUT := 2> /dev/null
$(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
rm -f $@ $@.tmp
- sed -e 's|%LIBS_CONFIG%|$(LIBS_CONFIG)|' \
- -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|' \
+ sed -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|' \
-e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
-e 's|%exec_prefix%|$(exec_prefix)|' \
-e 's|%ft_version%|$(ft_version)|' \
--- a/builds/unix/configure
+++ b/builds/unix/configure
@@ -639,7 +639,6 @@ build_libtool_libs
wl
hardcode_libdir_flag_spec
LIBSSTATIC_CONFIG
-LIBS_CONFIG
LIBS_PRIVATE
REQUIRES_PRIVATE
ftmac_c
@@ -13715,21 +13714,6 @@ LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
-e 's/ *$//' \
-e 's/ */ /g'`
-LIBS_CONFIG="-lfreetype \
- $ZLIB_LIBS \
- $BZIP2_LIBS \
- $LIBPNG_LIBS \
- $HARFBUZZ_LIBS \
- $ft2_extra_libs"
-# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
-# on if necessary; also beautify
-LIBS_CONFIG=`echo "$LIBS_CONFIG" \
- | sed -e 's|-L */usr/lib64/* | |g' \
- -e 's|-L */usr/lib/* | |g' \
- -e 's/^ *//' \
- -e 's/ *$//' \
- -e 's/ */ /g'`
-
LIBSSTATIC_CONFIG="-lfreetype \
$zlib_libstaticconf \
$bzip2_libstaticconf \

View File

@ -7,7 +7,7 @@
Summary: A free and portable font rendering engine
Name: freetype
Version: 2.5.3
Release: 3%{?dist}
Release: 4%{?dist}
License: (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement
Group: System Environment/Libraries
URL: http://www.freetype.org
@ -29,6 +29,9 @@ Patch88: freetype-multilib.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=961855
Patch90: freetype-2.4.12-pkgconfig.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1079302
Patch91: freetype-2.5.3-freetype-config-libs.patch
Buildroot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
BuildRequires: libX11-devel
@ -92,6 +95,8 @@ popd
%patch90 -p1 -b .pkgconfig
%patch91 -p1 -b .freetype-config-libs
%build
%configure --disable-static
@ -122,9 +127,6 @@ popd
rm -rf $RPM_BUILD_ROOT
# HACK - drop private libs from freetype-config --libs option
sed -i -e 's| -lz -lbz2 -lpng16||' builds/unix/freetype-config
%makeinstall gnulocaledir=$RPM_BUILD_ROOT%{_datadir}/locale
{
@ -215,6 +217,11 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/*
%changelog
* Tue Mar 25 2014 Marek Kasik <mkasik@redhat.com> - 2.5.3-4
- Don't return flags of privately used libraries when
- calling "freetype-config --libs"
- Resolves: #1079302
* Fri Mar 21 2014 Dan Horák <dan[at]danny.cz> - 2.5.3-3
- drop private libs from freetype-config so it returns the same libs as pkg-config