]> git.pld-linux.org Git - packages/crossmingw32-boost.git/blob - crossmingw32-boost.spec
- up to 1.36.0; still doesn't build
[packages/crossmingw32-boost.git] / crossmingw32-boost.spec
1 %define         realname        boost
2 Summary:        The Boost C++ Libraries - Mingw32 cross version
3 Summary(pl.UTF-8):      Biblioteki C++ "Boost" - wersja skrośna dla Mingw32
4 Name:           crossmingw32-%{realname}
5 Version:        1.36.0
6 %define fver    %(echo %{version} | tr . _)
7 Release:        0.1
8 License:        Boost Software License and others
9 Group:          Development/Libraries
10 Source0:        http://dl.sourceforge.net/boost/%{realname}_%{fver}.tar.bz2
11 # Source0-md5:  328bfec66c312150e4c2a78dcecb504b
12 Patch0:         %{name}-win.patch
13 URL:            http://www.boost.org/
14 BuildRequires:  boost-jam >= 3.1.12
15 BuildRequires:  crossmingw32-bzip2
16 BuildRequires:  crossmingw32-gcc-c++
17 BuildRequires:  crossmingw32-runtime
18 BuildRequires:  crossmingw32-w32api
19 BuildRequires:  crossmingw32-zlib
20 BuildRequires:  libtool >= 2:1.4d
21 BuildRequires:  perl-base
22 Requires:       crossmingw32-bzip2
23 Requires:       crossmingw32-runtime
24 Requires:       crossmingw32-zlib
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         no_install_post_strip   1
28
29 %define         target          i386-mingw32
30 %define         target_platform i386-pc-mingw32
31
32 %define         _sysprefix      /usr
33 %define         _prefix         %{_sysprefix}/%{target}
34 %define         _libdir         %{_prefix}/lib
35 %define         _dlldir         /usr/share/wine/windows/system
36
37 %define         __cc            %{target}-gcc
38 %define         __cxx           %{target}-g++
39
40 %ifnarch %{ix86}
41 # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
42 %define         optflags        -O2
43 %endif
44
45 %description
46 The Boost web site provides free peer-reviewed portable C++ source
47 libraries. The emphasis is on libraries which work well with the C++
48 Standard Library. One goal is to establish "existing practice" and
49 provide reference implementations so that the Boost libraries are
50 suitable for eventual standardization. Some of the libraries have
51 already been proposed for inclusion in the C++ Standards Committee's
52 upcoming C++ Standard Library Technical Report.
53
54 %description -l pl.UTF-8
55 Strona http://www.boost.org/ dostarcza darmowe biblioteki C++ wraz z
56 kodem źródłowym. Nacisk położono na biblioteki, które dobrze
57 współpracują ze standardową biblioteką C++. Celem jest ustanowienie
58 "istniejącej praktyki" i dostarczenie implementacji, tak że biblioteki
59 "Boost" nadają się do ewentualnej standaryzacji. Niektóre z bibliotek
60 już zostały zgłoszone do komitetu standaryzacyjnego C++ w nadchodzącym
61 Raporcie Technicznym Biblioteki Standardowej C++
62
63 %package dll
64 Summary:        Boost - DLL libraries for Windows
65 Summary(pl.UTF-8):      Boost - biblioteki DLL dla Windows
66 Group:          Applications/Emulators
67 Requires:       crossmingw32-bzip2-dll
68 Requires:       crossmingw32-zlib-dll
69 Requires:       wine
70
71 %description dll
72 Boost - DLL libraries for Windows.
73
74 %description dll -l pl.UTF-8
75 Boost - biblioteki DLL dla Windows.
76
77 %prep
78 %setup -q -n %{realname}_%{fver}
79 %patch0 -p1
80
81 # - don't know how to pass it through (b)jam -s (no way?)
82 #   due to oversophisticated build flags system.
83 %{__perl} -pi -e 's/ -O3 / %{rpmcxxflags} /' tools/build/v2/tools/gcc.jam
84
85 sed -i -e 's/#error "wide char i\/o not supported on this platform"//' \
86         boost/archive/*.hpp \
87         libs/serialization/src/*.cpp \
88         libs/serialization/test/*.hpp
89
90 %build
91 CC=%{__cc} ; export CC
92 CXX=%{__cxx} ; export CXX
93 LD=%{target}-ld ; export LD
94 AR=%{target}-ar ; export AR
95 AS=%{target}-as ; export AS
96 CROSS_COMPILE=1 ; export CROSS_COMPILE
97 RANLIB=%{target}-ranlib ; export RANLIB
98 LDSHARED="%{__cc} -shared" ; export LDSHARED
99 TARGET="%{target}" ; export TARGET
100
101 bjam \
102         -q -d2 \
103         -sBZIP2_BINARY=bzip2 \
104         --toolset=gcc \
105         --without-python \
106         --without-serialization \
107         --without-test \
108         variant=release \
109         debug-symbols=on \
110         inlining=on \
111         link=static,shared \
112         threading=multi \
113         threadapi=win32
114
115 mkdir wlib
116 cd bin.v2/libs
117 for i in *
118 do
119         cd $i/build/gcc-mingw-*/release/debug-symbols-on/inlining-on
120         cd link-static/threadapi-win32/threading-multi
121         $AR cru ../../../../../../../../../../../wlib/libboost_$i.a *.o
122         $RANLIB ../../../../../../../../../../../wlib/libboost_$i.a
123
124         cd ../../..
125
126         # if there is threading-multi dir 
127         # it's content is used for dll and implib
128         dll_dir='link-static/threadapi-win32/threading-multi'
129         up_dir='../../..'
130         if [ -d threading-multi ]; then
131                 dll_dir='threadapi-win32/threading-multi'
132                 up_dir='../..'
133         fi
134
135         cd $dll_dir
136
137         # libboost_iostreams requires additional
138         # libraries
139         additional_so_params=
140         if [ $i = "iostreams" ]; then
141                 additional_so_params="-lz.dll -lbzip2.dll"
142         fi
143
144         # there are some issuses with dynamic libboost_wave
145         if [ $i != "wave" ]; then
146                 $CXX --shared *.o $additional_so_params \
147                         -Wl,--enable-auto-image-base \
148                         -o $up_dir/../../../../../../../../wlib/boost_$i.dll \
149                         -Wl,--out-implib,libboost_$i.dll.a
150                 mv libboost_$i.dll.a $up_dir/../../../../../../../../wlib/
151         fi
152
153         cd $up_dir/../../../../../..
154 done
155 cd ../..
156
157 %if 0%{!?debug:1}
158 %{target}-strip wlib/*.dll
159 %{target}-strip -g -R.comment -R.note wlib/*.a
160 %endif
161
162 %install
163 rm -rf $RPM_BUILD_ROOT
164 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_dlldir}}
165
166 cp -r boost $RPM_BUILD_ROOT%{_includedir}
167 install wlib/*.a $RPM_BUILD_ROOT%{_libdir}
168 install wlib/*.dll $RPM_BUILD_ROOT%{_dlldir}
169
170 %clean
171 rm -rf $RPM_BUILD_ROOT
172
173 %files
174 %defattr(644,root,root,755)
175 %{_includedir}/boost
176 %{_libdir}/*.a
177
178 %files dll
179 %defattr(644,root,root,755)
180 %{_dlldir}/*.dll
This page took 0.050331 seconds and 3 git commands to generate.