libgdiplus/libgdiplus.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 67
ce0d31e18b66
child 635
60d8c38e1900
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@67 1 ##
michael@67 2 ## libgdiplus.spec -- OpenPKG RPM Package Specification
michael@67 3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
michael@67 4 ##
michael@67 5 ## Permission to use, copy, modify, and distribute this software for
michael@67 6 ## any purpose with or without fee is hereby granted, provided that
michael@67 7 ## the above copyright notice and this permission notice appear in all
michael@67 8 ## copies.
michael@67 9 ##
michael@67 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@67 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@67 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@67 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@67 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@67 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@67 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@67 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@67 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@67 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@67 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@67 21 ## SUCH DAMAGE.
michael@67 22 ##
michael@67 23
michael@67 24 # package information
michael@67 25 Name: libgdiplus
michael@67 26 Summary: Unix GDI+ Development API
michael@67 27 URL: http://www.mono-project.com/Libgdiplus
michael@67 28 Packager: Michael Schloh von Bennewitz
michael@67 29 Distribution: Europalab Production
michael@67 30 Class: EVAL
michael@67 31 Group: XWindow
michael@67 32 License: MIT X11
michael@67 33 Version: 2.0
michael@67 34 Release: 20090106
michael@67 35
michael@67 36 # build options
michael@67 37 %option with_shared no
michael@67 38
michael@67 39 # list of sources
michael@67 40 Source0: ftp://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-%{version}.tar.bz2
michael@67 41
michael@67 42 # build information
michael@67 43 Prefix: %{l_prefix}
michael@67 44 BuildRoot: %{l_buildroot}
michael@85 45 BuildPreReq: OpenPKG, openpkg >= 20040130, make
michael@85 46 PreReq: OpenPKG, openpkg >= 20040130
michael@85 47 BuildPreReq: zlib, glib2, X11, xrender, cairo
michael@85 48 PreReq: zlib, glib2, X11, xrender, cairo
michael@85 49 BuildPreReq: fontconfig, freetype, giflib, jpeg, png, tiff
michael@85 50 PreReq: fontconfig, freetype, giflib, jpeg, png, tiff
michael@67 51 AutoReq: no
michael@67 52 AutoReqProv: no
michael@67 53 Conflicts: pnet
michael@67 54
michael@67 55 %description
michael@67 56 The Graphics Device Interface Plus (GDI+) development API exposes
michael@67 57 abstract graphics and formatted text logic. The calling process
michael@67 58 may write to those devices for which the GDI+ has a device driver,
michael@67 59 such as a video display or printer.
michael@67 60
michael@67 61 %track
michael@67 62 prog libgdiplus = {
michael@67 63 version = %{version}
michael@67 64 url = ftp://ftp.novell.com/pub/mono/sources/libgdiplus/
michael@67 65 regex = libgdiplus-(\d+\.\d+)\.tar\.bz2
michael@67 66 }
michael@67 67
michael@67 68 %prep
michael@67 69 # unpack sources
michael@67 70 %setup -q
michael@67 71
michael@67 72 # remove subdirectory builds to assure internal library usage
michael@67 73 rm -rf cairo
michael@67 74
michael@67 75 # correct flaws in the build configuration
michael@67 76 %{l_shtool} subst \
michael@67 77 -e 's;\(libexif_pkgconfig=\)\("No\.[^"]*"\);\1no \&\& echo \2;g' \
michael@67 78 configure
michael@67 79 %{l_shtool} subst \
michael@67 80 -e 's;^\(SUBDIRS\) *= *@CAIRO_DIR@ src tests;\1=src tests;' \
michael@67 81 Makefile.in
michael@67 82
michael@67 83 %build
michael@67 84 # detect X11 paths
michael@67 85 x11_incdir=`%{l_rc} --query x11_incdir`
michael@67 86 x11_libdir=`%{l_rc} --query x11_libdir`
michael@67 87
michael@67 88 %if "%{with_shared}" == "yes"
michael@67 89 # configure shared library
michael@67 90 CC="%{l_cc}" \
michael@67 91 CFLAGS="%{l_cflags -O}" \
michael@67 92 CPPFLAGS="%{l_cppflags tiff} -I${x11_incdir}" \
michael@67 93 LDFLAGS="%{l_ldflags}" \
michael@67 94 ./configure \
michael@67 95 --prefix=%{l_prefix} \
michael@67 96 --with-cairo=installed \
michael@67 97 --without-libexif \
michael@67 98 --disable-static \
michael@67 99 --enable-shared \
michael@67 100 --with-gnu-ld
michael@67 101
michael@67 102 # build shared library
michael@67 103 %{l_make} %{l_mflags -O}
michael@67 104
michael@67 105 # install early, as we delete to build again
michael@67 106 %{l_shtool} mkdir -f -p -m 755 gdidyn
michael@67 107 mv src/.libs/libgdiplus* gdidyn/
michael@67 108
michael@67 109 # reset build configuration
michael@67 110 %{l_make} %{l_mflags} distclean
michael@67 111 %endif
michael@67 112
michael@67 113 # configure static library
michael@67 114 CC="%{l_cc}" \
michael@67 115 CFLAGS="%{l_cflags -O}" \
michael@67 116 CPPFLAGS="%{l_cppflags tiff} -I${x11_incdir}" \
michael@67 117 LDFLAGS="%{l_ldflags}" \
michael@67 118 ./configure \
michael@67 119 --prefix=%{l_prefix} \
michael@67 120 --with-cairo=installed \
michael@67 121 --without-libexif \
michael@67 122 --enable-static \
michael@67 123 --disable-shared \
michael@67 124 --with-gnu-ld
michael@67 125
michael@67 126 # build static library
michael@67 127 %{l_make} %{l_mflags -O}
michael@67 128
michael@67 129 %install
michael@67 130 # install static library
michael@67 131 rm -rf $RPM_BUILD_ROOT
michael@67 132 %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT"
michael@67 133
michael@67 134 %if "%{with_shared}" == "yes"
michael@67 135 # install shared library
michael@67 136 %{l_tar} cf - gdidyn | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib
michael@67 137 %endif
michael@67 138
michael@67 139 # determine installation files
michael@67 140 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@67 141 %{l_files_std} \
michael@67 142 '%not %dir %{l_prefix}/lib/pkgconfig'
michael@67 143
michael@67 144 %files -f files
michael@67 145
michael@67 146 %clean
michael@67 147 rm -rf $RPM_BUILD_ROOT
michael@67 148

mercurial