wxWidgets(2.8.9) RPM spec for F11

Michael Ansel redhat-lists at anselcomputers.com
Sat Sep 5 16:06:56 UTC 2009


While working on a project for class, I needed to cross-compile a
program built with wxWidgets onto Windows. Since all I could find was
an RPM built for F10, I went ahead and updated the spec to build on
F11, and would really love to include it in the Fedora repos. However,
as I am a double major (EE/CompSci) taking 4 lab classes, I don't
think I'm going to have much more time to work on this. :-/ As such, I
wanted to post this out for anyone with a little available time to
take a shot at fixing it up to the Fedora Standard and then pushing it
through the proper review process. Two notes on the spec: 1) It builds
a standard and a static package, but I have no idea if they are
properly separated; 2) I think all the BuildPrereqs are correct, but
someone more familiar with wxWidgets should probably double check
them. Thanks to everyone for the awesome work on mingw32: the package
build and cross-compilation processes were a breeze! :-D

Michael Ansel


$ cat mingw-wxWidgets.spec
# $Id: mingw32-wxWidgets.spec,v 1.6 2008/12/18 10:13:33 bitwalk Exp $
# Workaround for the problem of /usr/bin/strip not handling PE binaries.
%define __strip /usr/bin/i686-pc-mingw32-strip

# Don't build debuginfo packages
%define debug_package %{nil}

%define pkgVer   2.8.9

Summary:   wxWidgets
Name:      mingw32-wxWidgets
Version:   %{pkgVer}
Release:   2%{?dist}
License:   wxWidgets Library Licence
Packager:  Keiichi Takahashi <bitwalk at users.soureforge.net>
Vendor:    bitWalk Co., Ltd.

Group:     Development/Libraries
URL:       http://wxwidgets.org
Source:    http://prdownloads.sourceforge.net/wxwindows/wxWidgets-%{pkgVer}.tar.gz
Buildroot: %{_tmppath}/%{name}-root
BuildPrereq: mingw32-runtime, mingw32-w32api, mingw32-binutils,
mingw32-expat, mingw32-gcc, mingw32-gcc-c++, mingw32-libjpeg,
mingw32-libpng, mingw32-libtiff, mingw32-zlib
Requires: mingw32-runtime, mingw32-expat, mingw32-libjpeg,
mingw32-libpng, mingw32-libtiff, mingw32-zlib

%description
wxWidgets is the C++ cross-platform GUI library, offering classes for all
common GUI controls as well as a comprehensive set of helper classes for most
common application tasks, ranging from networking to HTML display and image
manipulation.

%package static
Summary:  Static libraries for mingw32-wxWidgets development.
Group:    Development/Libraries
Requires: mingw32-wxWidgets = %{version}-%{release}

%description static
The mingw32-wxWidgets-static package contains static library for
mingw32-wxWidgets development.


%prep
%setup -q -n wxWidgets-%{pkgVer}

#==========================================
%build
#========= Shared Libraries ==========
mkdir obj-shared
cd obj-shared
%_mingw32_configure --enable-shared \
  --with-msw \
  --with-sdl \
  --enable-unicode \
  --enable-optimise \
  --with-regex=builtin \
  --disable-rpath \
  --without-subdirs

if [ "$SMP" != "" ]; then
  %_mingw32_make -j$SMP
else
  %_mingw32_make
fi
cd ..
#========= Static Libraries ==========
mkdir obj-static
cd obj-static
%_mingw32_configure --disable-shared \
  --with-msw \
  --with-sdl \
  --enable-unicode \
  --enable-optimise \
  --with-regex=builtin \
  --disable-rpath \
  --without-subdirs

if [ "$SMP" != "" ]; then
  %_mingw32_make -j$SMP
else
  %_mingw32_make
fi
cd ..

#==========================================
%install
rm -rf $RPM_BUILD_ROOT
%_mingw32_makeinstall -C obj-shared
%_mingw32_makeinstall -C obj-static
if ls $RPM_BUILD_ROOT%{_mingw32_libdir}/*.dll ; then
  mv $RPM_BUILD_ROOT%{_mingw32_libdir}/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
else
  echo "No shared libraries found."
fi

# we need to modify the absolute wx-config link to be relative or rpm complains
# (and our package wouldn't be relocatable)
wx_config_filename=$(basename
$RPM_BUILD_ROOT%{_mingw32_libdir}/wx/config/%{_mingw32_target}-*-release-[0-9]*)
ln -sf ../lib/wx/config/$wx_config_filename
$RPM_BUILD_ROOT%{_mingw32_bindir}/wx-config

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_mingw32_prefix}
#TODO Need to select all files EXCEPT for static libraries

%files static
%defattr(-,root,root,-)
%{_mingw32_libdir}/*.a
%{_mingw32_libdir}/wx/config/%{_mingw32_target}-*-static-*

%changelog
* Wed Aug 26 2009 Michael Ansel <michael.ansel at gmail.com>               2.8.9-2
- update for Fedora 11 (mingw -> mingw32)
- use mingw32 macros
- add static subpackage

* Thu Dec 18 2008 Keiichi Takahashi <bitwalk at users.soureforge.net>      2.8.9-1
- update to 2.8.9

* Tue Aug 12 2008 Keiichi Takahashi <bitwalk at users.soureforge.net>      2.8.8-1
- update to 2.8.8

* Sat Mar 15 2008 Keiichi Takahashi <bitwalk at users.soureforge.net>      2.8.7-2
- rebuilt with current libraries.
- add BuildPrereq and Requires more explicitly.

* Thu Feb 28 2008 Keiichi Takahashi <bitwalk at users.soureforge.net>      2.8.7-1
- initial release



More information about the mingw mailing list