]>
Commit | Line | Data |
---|---|---|
28441938 | 1 | %define realname boost |
2 | Summary: The Boost C++ Libraries - Mingw32 cross version | |
f825d7b1 | 3 | Summary(pl.UTF-8): Biblioteki C++ "Boost" - wersja skrośna dla Mingw32 |
28441938 | 4 | Name: crossmingw32-%{realname} |
5 | Version: 1.32.0 | |
6 | %define _fver %(echo %{version} | tr . _) | |
7 | Release: 1 | |
8 | License: Boost Software License and others | |
9 | Group: Libraries | |
10 | Source0: http://dl.sourceforge.net/boost/%{realname}_%{_fver}.tar.bz2 | |
11 | # Source0-md5: e1d1fc7b8fc8c51df4564c2188ca51cb | |
12 | Patch0: %{name}-win.patch | |
13 | URL: http://www.boost.org/ | |
14 | Requires: crossmingw32-runtime | |
15 | BuildRequires: crossmingw32-gcc-c++ | |
16 | BuildRequires: crossmingw32-runtime | |
17 | BuildRequires: crossmingw32-w32api | |
18 | BuildRequires: boost-jam | |
19 | BuildRequires: libtool >= 2:1.4d | |
20 | BuildRequires: perl-base | |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
23 | %define no_install_post_strip 1 | |
24 | ||
25 | %define target i386-mingw32 | |
26 | %define target_platform i386-pc-mingw32 | |
27 | %define arch %{_prefix}/%{target} | |
28 | %define gccarch %{_prefix}/lib/gcc-lib/%{target} | |
29 | %define gcclib %{_prefix}/lib/gcc-lib/%{target}/%{version} | |
30 | ||
31 | %define __cc %{target}-gcc | |
32 | %define __cxx %{target}-g++ | |
33 | ||
34 | %ifarch alpha sparc sparc64 sparcv9 | |
35 | # alpha's -mieee and sparc's -mtune=* are not valid for target's gcc | |
36 | %define optflags -O2 | |
37 | %endif | |
38 | ||
39 | %description | |
40 | The Boost web site provides free peer-reviewed portable C++ source | |
41 | libraries. The emphasis is on libraries which work well with the C++ | |
42 | Standard Library. One goal is to establish "existing practice" and | |
43 | provide reference implementations so that the Boost libraries are | |
44 | suitable for eventual standardization. Some of the libraries have | |
45 | already been proposed for inclusion in the C++ Standards Committee's | |
46 | upcoming C++ Standard Library Technical Report. | |
47 | ||
241a7e06 | 48 | %description -l pl.UTF-8 |
28441938 | 49 | Strona http://www.boost.org/ dostarcza darmowe biblioteki C++ wraz z |
241a7e06 JR |
50 | kodem źródłowym. Nacisk położono na biblioteki, które dobrze |
51 | współpracują ze standardową biblioteką C++. Celem jest ustanowienie | |
52 | "istniejącej praktyki" i dostarczenie implementacji, tak że biblioteki | |
53 | "Boost" nadają się do ewentualnej standaryzacji. Niektóre z bibliotek | |
54 | już zostały zgłoszone do komitetu standaryzacyjnego C++ w nadchodzącym | |
28441938 | 55 | Raporcie Technicznym Biblioteki Standardowej C++ |
56 | ||
57 | %package dll | |
58 | Summary: %{realname} - DLL libraries for Windows | |
f825d7b1 | 59 | Summary(pl.UTF-8): %{realname} - biblioteki DLL dla Windows |
28441938 | 60 | Group: Applications/Emulators |
61 | ||
62 | %description dll | |
63 | %{realname} - DLL libraries for Windows. | |
64 | ||
241a7e06 | 65 | %description dll -l pl.UTF-8 |
28441938 | 66 | %{realname} - biblioteki DLL dla Windows. |
67 | ||
68 | %prep | |
69 | %setup -q -n %{realname}_%{_fver} | |
70 | %patch0 -p1 | |
71 | ||
72 | # don't know how to pass it through (b)jam -s (no way?) | |
73 | # due to oversophisticated build flags system | |
74 | %{__perl} -pi -e 's/ -O3 / %{rpmcflags} /' tools/build/v1/gcc-tools.jam | |
75 | ||
76 | %ifarch alpha | |
77 | # -pthread gcc parameter doesn't add _REENTRANT to cpp macros on alpha (only) | |
78 | # don't know, is it gcc bug or intentional omission? | |
79 | # anyway, boost check of -D_REENTRANT in its headers, so it's needed here | |
80 | %{__perl} -pi -e 's/(CFLAGS.*-pthread)/$1 -D_REENTRANT/' tools/build/v1/gcc-tools.jam | |
81 | %endif | |
82 | ||
83 | find . -type f -exec sed -e 's/#error "wide char i\/o not supported on this platform"//' -i \{\} \; | |
84 | ||
85 | %build | |
86 | CC=%{target}-gcc ; export CC | |
87 | CXX=%{target}-g++ ; export CXX | |
88 | LD=%{target}-ld ; export LD | |
89 | AR=%{target}-ar ; export AR | |
90 | AS=%{target}-as ; export AS | |
91 | CROSS_COMPILE=1 ; export CROSS_COMPILE | |
92 | CPPFLAGS="-I%{arch}/include" ; export CPPFLAGS | |
93 | RANLIB=%{target}-ranlib ; export RANLIB | |
94 | LDSHARED="%{target}-gcc -shared" ; export LDSHARED | |
95 | TARGET="%{target}" ; export TARGET | |
96 | ||
97 | PYTHON_ROOT= | |
98 | PYTHON_VERSION= | |
99 | ||
100 | bjam \ | |
101 | -d2 \ | |
102 | -sBUILD="release <threading>multi" \ | |
103 | -sPYTHON_ROOT=$PYTHON_ROOT \ | |
104 | -sPYTHON_VERSION=$PYTHON_VERSION \ | |
105 | -sGXX="$CXX" \ | |
106 | -sGCC="$CC" | |
107 | ||
108 | mkdir wlib | |
109 | cd bin/*/* | |
110 | rm -rf test | |
111 | rm -rf serialization | |
112 | for i in * | |
113 | do | |
114 | cd $i/* | |
115 | lib=`echo lib*so|sed -e 's/\.so//'` | |
116 | blib=`echo $lib|sed -e 's/^lib//'` | |
117 | ||
118 | cd $lib.a | |
119 | find -type f -exec mv \{\} . \; | |
120 | $AR cru ../../../../../../wlib/$lib.a *\.o | |
121 | $RANLIB ../../../../../../wlib/$lib.a | |
122 | cd .. | |
123 | ||
124 | cd $lib.so | |
125 | find -type f -exec mv \{\} . \; | |
126 | %{__cxx} --shared *\.o \ | |
127 | -Wl,--enable-auto-image-base \ | |
128 | -o ../../../../../../wlib/$blib.dll \ | |
129 | -Wl,--out-implib,$lib.dll.a | |
130 | mv $lib.dll.a ../../../../../../wlib/ | |
131 | cd .. | |
132 | ||
133 | cd ../.. | |
134 | done | |
135 | cd ../../.. | |
136 | ||
137 | %if 0%{!?debug:1} | |
138 | %{target}-strip wlib/*.dll | |
139 | %{target}-strip -g -R.comment -R.note wlib/*.a | |
140 | %endif | |
141 | ||
142 | %install | |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | install -d $RPM_BUILD_ROOT%{arch}/{include,lib} | |
145 | install -d $RPM_BUILD_ROOT%{_datadir}/wine/windows/system | |
146 | ||
147 | cp -r boost $RPM_BUILD_ROOT%{arch}/include | |
148 | install wlib/*.a $RPM_BUILD_ROOT%{arch}/lib | |
149 | install wlib/*.dll $RPM_BUILD_ROOT%{_datadir}/wine/windows/system/ | |
150 | ||
151 | %clean | |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | ||
154 | %files | |
155 | %defattr(644,root,root,755) | |
156 | %{arch}/include/boost | |
157 | %{arch}/lib/* | |
158 | ||
159 | %files dll | |
160 | %defattr(644,root,root,755) | |
161 | %{_datadir}/wine/windows/system/* |