- fixed linking against libpng (1.5, 1.6) [bnc#867041]

* added fontforge-libpng.diff
  * removed libpng14-dynamic.diff
- spec file cleanup
  * call spec-cleaner
  * fontforge-20090622-fdleak.patch renamed to fontforge-fdleak.patch
  * docdir.patch renamed to fontforge-docdir.patch

OBS-URL: https://build.opensuse.org/package/show/M17N/fontforge?expand=0&rev=34
This commit is contained in:
Petr Gajdos 2014-03-17 08:00:57 +00:00 committed by Git OBS Bridge
parent cbf967fa56
commit 8cf3b71501
6 changed files with 60 additions and 64 deletions

34
fontforge-libpng.diff Normal file
View File

@ -0,0 +1,34 @@
Index: configure
===================================================================
--- configure.orig 2012-08-02 17:09:08.000000000 +0200
+++ configure 2014-03-14 14:27:30.539876212 +0100
@@ -14074,6 +14074,12 @@
if test "$ac_cv_lib_png14_png_create_read_struct" = "yes"; then
STATIC_LIBS="$STATIC_LIBS -lpng14 -lz"
fi
+ if test "$ac_cv_lib_png15_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng15 -lz"
+ fi
+ if test "$ac_cv_lib_png16_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng16 -lz"
+ fi
if test "$ac_cv_lib_tiff_TIFFOpen" = "yes"; then
STATIC_LIBS="$STATIC_LIBS -ltiff"
fi
@@ -14178,6 +14184,16 @@
$as_echo "#define _STATIC_LIBPNG 1" >>confdefs.h
fi
+ if test "$ac_cv_lib_png15_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng15 -lz"
+ $as_echo "#define _STATIC_LIBPNG 1" >>confdefs.h
+
+ fi
+ if test "$ac_cv_lib_png16_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng16 -lz"
+ $as_echo "#define _STATIC_LIBPNG 1" >>confdefs.h
+
+ fi
if test "$ac_cv_lib_tiff_TIFFOpen" = "yes"; then
STATIC_LIBS="$STATIC_LIBS -ltiff"
$as_echo "#define _STATIC_LIBTIFF 1" >>confdefs.h

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Mar 17 07:21:51 UTC 2014 - pgajdos@suse.com
- fixed linking against libpng (1.5, 1.6) [bnc#867041]
* added fontforge-libpng.diff
* removed libpng14-dynamic.diff
- spec file cleanup
* call spec-cleaner
* fontforge-20090622-fdleak.patch renamed to fontforge-fdleak.patch
* docdir.patch renamed to fontforge-docdir.patch
-------------------------------------------------------------------
Sun Mar 9 13:40:08 UTC 2014 - schwab@linux-m68k.org

View File

@ -1,7 +1,7 @@
#
# spec file for package fontforge
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,27 +16,26 @@
#
%define src_version %{version}-b
Name: fontforge
Version: 20120731
Release: 0
%define src_version %{version}-b
Summary: A Font Editor
License: BSD-3-Clause
Group: Productivity/Graphics/Vector Editors
Url: http://fontforge.org/
Source0: http://downloads.sourceforge.net/%{name}/%{name}_full-%{src_version}.tar.bz2
Source1: http://downloads.sourceforge.net/%{name}/%{name}_htdocs-%{src_version}.tar.bz2
# PATCH-FIX-OPENSUSE -- set path to documentation
Patch0: docdir.patch
Patch1: fontforge-20090622-fdleak.patch
Patch2: libpng14-dynamic.diff
Patch0: fontforge-docdir.patch
Patch1: fontforge-fdleak.patch
# workaround, this should be resolved upstream (use pkg-config)
Patch2: fontforge-libpng.diff
# PATCH-FIX-OPENSUSE fontforge-python-module-name.diff -- change python module name according to naming policy
Patch3: fontforge-python-module-name.diff
Patch4: fontforge-fixgiflib.patch
# PATCH-FIX-UPSTREAM http://sourceforge.net/p/fontforge/git/ci/9ae25e0
Patch5: fontforge-arraysubscript.patch
BuildRequires: cairo-devel
BuildRequires: fdupes
BuildRequires: freetype2-devel
@ -44,9 +43,6 @@ BuildRequires: gettext-tools
BuildRequires: giflib-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
%if 0%{?suse_version} > 1210
BuildRequires: libspiro-devel
%endif
BuildRequires: libtiff-devel
BuildRequires: libuninameslist-devel
BuildRequires: libxml2-devel
@ -56,10 +52,13 @@ BuildRequires: update-desktop-files
BuildRequires: xorg-x11-devel
# following to avoid warning
# 'Application built with libpng-1.5.14 but running with 1.6.1'
%requires_eq libpng16-16
%requires_eq libpng16-16
Obsoletes: PfaEdit < 20110222
Provides: PfaEdit = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1210
BuildRequires: libspiro-devel
%endif
%description
FontForge allows editing of outline and bitmap fonts. With it, you can
@ -99,15 +98,12 @@ to develop applications that use FontForge libraries.
%setup -q -T -n fontforge-%{src_version} -b 0
%patch0 -p 1 -b .docdir
%patch1
%if 0%{?suse_version} > 1120
%patch2
%endif
%patch3
%if 0%{?suse_version} > 1230
%patch4 -p1
%endif
%patch5 -p1
mkdir docs
tar -jxvf %{SOURCE1} -C docs
chmod 644 docs/quadraticspline.gif
@ -119,6 +115,8 @@ find . -name CVS -type d | xargs rm -rf
sed -i 's/\r$//' docs/{Big5.txt,corpchar.txt}
%build
# workaround, this should be resolved upstream (use pkg-config)
pkg-config --exists 'libpng >= 1.7.0' && echo 'Libpng was updated to 1.7, fontforge-libpng.patch will probably need to be adapted.' && exit 1
export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure \
--disable-static \
@ -126,35 +124,30 @@ export CFLAGS="%{optflags} -fno-strict-aliasing"
--with-regular-link
make %{?_smp_mflags}
pushd pyhook
python setup.py build
popd
%install
make DESTDIR=%{buildroot} install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
# symlink for old FontForge name - PfaEdit
pushd %{buildroot}%{_bindir}
ln -s fontforge pfaedit
popd
# install CMaps to be able to edit CID-keyed fonts:
# install -m 644 Adobe* %{buildroot}%{_datadir}/fontforge
# desktop file and icon
install -Dm 644 Packaging/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm 644 Packaging/icons/48x48/apps/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%suse_update_desktop_file -i %{name} VectorGraphics
%find_lang FontForge
rm -f %{buildroot}%{_libdir}/*.la
find %{buildroot} -type f -name "*.la" -delete -print
pushd pyhook
python setup.py install \
--root=%{buildroot} \
--prefix=%{_prefix} \
--record-rpm=%{name}-python.files
popd
%fdupes -s %{buildroot}%{_datadir}/%{name}
%post -p /sbin/ldconfig
@ -170,7 +163,7 @@ popd
%{_mandir}/man1/*.1*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%py_sitedir/*
%{py_sitedir}/*
%files doc
%defattr(-,root,root)

View File

@ -1,42 +0,0 @@
--- gutils/gimagereadpng.c.old 2011-05-16 13:11:25.000000000 +0200
+++ gutils/gimagereadpng.c 2011-05-16 13:19:32.000000000 +0200
@@ -88,6 +88,7 @@ static int loadpng() {
return( 0 );
}
+#if 0
# if !defined(PNG_LIBPNG_VER_MAJOR) || (PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR<2)
/* Early versions are called libpng. Later libpng10/libpng12/libpng14... */
libpng = dlopen("libpng" SO_EXT,RTLD_LAZY);
@@ -112,6 +113,9 @@ return( 0 );
# endif
}
# endif
+#endif
+ libpng = dlopen("libpng14.so.14", RTLD_LAZY);
+
if ( libpng==NULL ) {
fprintf(stderr,"libpng: %s\n", dlerror());
return( 0 );
pgajdos@laura:~/branch/devel/fontforge/fontforge-20110222/gutils> diff -up gimagewritepng.c{.old,}
--- gutils/gimagewritepng.c.old 2011-05-16 13:20:47.000000000 +0200
+++ gutils/gimagewritepng.c 2011-05-16 13:21:44.000000000 +0200
@@ -72,6 +72,7 @@ static int loadpng() {
fprintf(stderr,"%s\n", dlerror());
return( 0 );
}
+#if 0
# if !defined(PNG_LIBPNG_VER_MAJOR) || (PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR<2)
/* Early versions are called libpng. Later libpng10/libpng12/libpng14... */
libpng = dlopen("libpng" SO_EXT,RTLD_LAZY);
@@ -96,6 +97,9 @@ return( 0 );
# endif
}
# endif
+#endif
+ libpng = dlopen("libpng14.so.14", RTLD_LAZY);
+
if ( libpng==NULL ) {
fprintf(stderr,"%s", dlerror());
return( 0 );