Include a bugfix for GCC 4.4
[fedora-mingw.git] / boost / mingw32-boost.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 Name:           mingw32-boost
8 Version:        1.34.1
9 Release:        6%{?dist}
10 Summary:        MinGW Windows port of Boost C++ Libraries
11
12 License:        Boost
13 Group:          Development/Libraries
14 URL:            http://www.boost.org/
15 Source0:        http://downloads.sourceforge.net/boost/boost_1_34_1.tar.bz2
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17
18 Patch0:         boost-configure.patch
19 Patch1:         boost-gcc-soname.patch
20 #Patch2:         boost-use-rpm-optflags.patch
21 Patch3:         boost-run-tests.patch
22 Patch4:         boost-regex.patch
23 Patch5:         boost-gcc43.patch
24
25 # For GCC 4.4, https://svn.boost.org/trac/boost/ticket/2069
26 Patch1000:      svn-r48960.diff
27
28 BuildArch:      noarch
29
30 BuildRequires:  mingw32-filesystem >= 30
31 BuildRequires:  mingw32-gcc
32 BuildRequires:  mingw32-gcc-c++
33 BuildRequires:  mingw32-binutils
34 #BuildRequires:  mingw-libstdc++
35 BuildRequires:  mingw32-bzip2
36 BuildRequires:  mingw32-zlib
37 # These are required by the native package:
38 #BuildRequires:  mingw32-python
39 #BuildRequires:  mingw32-libicu
40
41
42 %description
43 Boost provides free peer-reviewed portable C++ source libraries.  The
44 emphasis is on libraries which work well with the C++ Standard
45 Library, in the hopes of establishing "existing practice" for
46 extensions and providing reference implementations so that the Boost
47 libraries are suitable for eventual standardization. (Some of the
48 libraries have already been proposed for inclusion in the C++
49 Standards Committee's upcoming C++ Standard Library Technical Report.)
50
51
52 %prep
53 %setup -q -n boost_1_34_1
54 %patch0 -p0
55 %patch1 -p0
56 #%patch2 -p0
57 %patch3 -p0
58 %patch4 -p0
59 %patch5 -p1
60
61 %patch1000 -p2
62
63
64 %build
65 BOOST_ROOT=`pwd`
66 staged_dir=stage
67 export BOOST_ROOT
68
69 # build make tools, ie bjam, necessary for building libs, docs, and testing
70 (cd tools/jam/src && ./build.sh)
71 BJAM=`find tools/jam/src/ -name bjam -a -type f`
72
73 #BUILD_FLAGS="--with-toolset=gcc --prefix=$RPM_BUILD_ROOT%{_prefix}"
74 BUILD_FLAGS="--with-toolset=gcc --with-bjam=$BJAM"
75 #PYTHON_VERSION=$(python -c 'import sys; print sys.version[:3]')
76 #PYTHON_FLAGS="--with-python-root=/usr --with-python-version=$PYTHON_VERSION"
77 PYTHON_FLAGS="--without-libraries=python"
78 #REGEX_FLAGS="--with-icu"
79 REGEX_FLAGS="--without-icu"
80
81 ./configure $BUILD_FLAGS $PYTHON_FLAGS $REGEX_FLAGS
82
83 # Make it use the cross-compiler instead of gcc.
84 rm user-config.jam
85 echo "using gcc : : %{_mingw32_cc} : ;" > user-config.jam
86
87 make %{?_smp_mflags} all
88
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
93 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
94 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
95
96 # Boost doesn't build shared libraries for some reason.  However it
97 # builds *.a files which we can trivially convert to *.dll (they
98 # contain objects which are already compiled for PIC).
99 function a2dll
100 {
101   rm -rf .a2dll
102   mkdir .a2dll
103   pushd .a2dll
104   ar x ../$1
105   error=0
106   i686-pc-mingw32-gcc -shared \
107     -o ../$2.dll \
108     -Wl,--out-implib,../$2.dll.a \
109     *.o -lbz2 -lz -lstdc++ || error=1
110   popd
111   rm -rf .a2dll
112   return $error
113 }
114
115 for f in `find bin.v2 -name '*.a'`; do
116   b=`basename $f .a`
117   d=`dirname $f`
118   if a2dll $f $d/$b; then
119     install $d/$b.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
120     install $d/$b.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}
121   else
122     echo '*** FAILED TO BUILD' $d/$b.dll
123   fi
124 done
125
126 # install include files
127 find boost -type d | while read a; do
128   mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}/$a
129   find $a -mindepth 1 -maxdepth 1 -type f \
130     | xargs -r install -m 644 -p -t $RPM_BUILD_ROOT%{_mingw32_includedir}/$a
131 done
132
133 # remove scripts used to generate include files
134 find $RPM_BUILD_ROOT%{_mingw32_includedir}/ \( -name '*.pl' -o -name '*.sh' \) -exec rm {} \;
135
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140
141 %files
142 %defattr(-,root,root)
143 %doc LICENSE_1_0.txt
144 %{_mingw32_includedir}/boost
145 %{_mingw32_bindir}/libboost_date_time.dll
146 %{_mingw32_libdir}/libboost_date_time.dll.a
147 %{_mingw32_bindir}/libboost_date_time-mt.dll
148 %{_mingw32_libdir}/libboost_date_time-mt.dll.a
149 %{_mingw32_bindir}/libboost_filesystem.dll
150 %{_mingw32_libdir}/libboost_filesystem.dll.a
151 %{_mingw32_bindir}/libboost_filesystem-mt.dll
152 %{_mingw32_libdir}/libboost_filesystem-mt.dll.a
153 %{_mingw32_bindir}/libboost_graph.dll
154 %{_mingw32_libdir}/libboost_graph.dll.a
155 %{_mingw32_bindir}/libboost_graph-mt.dll
156 %{_mingw32_libdir}/libboost_graph-mt.dll.a
157 %{_mingw32_bindir}/libboost_iostreams.dll
158 %{_mingw32_libdir}/libboost_iostreams.dll.a
159 %{_mingw32_bindir}/libboost_iostreams-mt.dll
160 %{_mingw32_libdir}/libboost_iostreams-mt.dll.a
161 %{_mingw32_bindir}/libboost_program_options.dll
162 %{_mingw32_libdir}/libboost_program_options.dll.a
163 %{_mingw32_bindir}/libboost_program_options-mt.dll
164 %{_mingw32_libdir}/libboost_program_options-mt.dll.a
165 %{_mingw32_bindir}/libboost_regex.dll
166 %{_mingw32_libdir}/libboost_regex.dll.a
167 %{_mingw32_bindir}/libboost_regex-mt.dll
168 %{_mingw32_libdir}/libboost_regex-mt.dll.a
169 %{_mingw32_bindir}/libboost_serialization.dll
170 %{_mingw32_libdir}/libboost_serialization.dll.a
171 %{_mingw32_bindir}/libboost_serialization-mt.dll
172 %{_mingw32_libdir}/libboost_serialization-mt.dll.a
173 %{_mingw32_bindir}/libboost_signals.dll
174 %{_mingw32_libdir}/libboost_signals.dll.a
175 %{_mingw32_bindir}/libboost_signals-mt.dll
176 %{_mingw32_libdir}/libboost_signals-mt.dll.a
177 %{_mingw32_bindir}/libboost_wave.dll
178 %{_mingw32_libdir}/libboost_wave.dll.a
179 %{_mingw32_bindir}/libboost_wave-mt.dll
180 %{_mingw32_libdir}/libboost_wave-mt.dll.a
181 # These fail to build: they depend on linking with other parts of boost.
182 #libboost_prg_exec_monitor.dll
183 #libboost_test_exec_monitor.dll
184 #libboost_unit_test_framework.dll
185 #libboost_unit_test_framework-mt.dll
186 #libboost_test_exec_monitor-mt.dll
187 #libboost_prg_exec_monitor-mt.dll
188 #libboost_wserialization.dll
189 #libboost_wserialization-mt.dll
190 #libboost_thread-mt.dll
191
192
193 %changelog
194 * Sat Feb 21 2009 Richard W.M. Jones <rjones@redhat.com> - 1.34.1-6
195 - Rebuild for mingw32-gcc 4.4
196
197 * Fri Jan 23 2009 Richard W.M. Jones <rjones@redhat.com> - 1.34.1-4
198 - Include license file.
199
200 * Fri Jan 23 2009 Richard W.M. Jones <rjones@redhat.com> - 1.34.1-3
201 - Use _smp_mflags.
202
203 * Sat Oct 24 2008 Richard W.M. Jones <rjones@redhat.com> - 1.34.1-2
204 - Initial RPM release.