]> git.pld-linux.org Git - packages/crossmingw32-boost.git/blob - crossmingw32-boost.spec
- up to 1.34
[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.34.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:  ed5b9291ffad776f8757a916e1726ad0
12 Patch0:         %{name}-win.patch
13 URL:            http://www.boost.org/
14 BuildRequires:  boost-jam
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 %define         arch            %{_prefix}/%{target}
32 %define         gccarch         %{_prefix}/lib/gcc-lib/%{target}
33 %define         gcclib          %{_prefix}/lib/gcc-lib/%{target}/%{version}
34
35 %define         __cc            %{target}-gcc
36 %define         __cxx           %{target}-g++
37
38 %ifarch alpha sparc sparc64 sparcv9
39 # alpha's -mieee and sparc's -mtune=* are not valid for target's gcc
40 %define         optflags        -O2
41 %endif
42
43 %description
44 The Boost web site provides free peer-reviewed portable C++ source
45 libraries. The emphasis is on libraries which work well with the C++
46 Standard Library. One goal is to establish "existing practice" and
47 provide reference implementations so that the Boost libraries are
48 suitable for eventual standardization. Some of the libraries have
49 already been proposed for inclusion in the C++ Standards Committee's
50 upcoming C++ Standard Library Technical Report.
51
52 %description -l pl.UTF-8
53 Strona http://www.boost.org/ dostarcza darmowe biblioteki C++ wraz z
54 kodem źródłowym. Nacisk położono na biblioteki, które dobrze
55 współpracują ze standardową biblioteką C++. Celem jest ustanowienie
56 "istniejącej praktyki" i dostarczenie implementacji, tak że biblioteki
57 "Boost" nadają się do ewentualnej standaryzacji. Niektóre z bibliotek
58 już zostały zgłoszone do komitetu standaryzacyjnego C++ w nadchodzącym
59 Raporcie Technicznym Biblioteki Standardowej C++
60
61 %package dll
62 Summary:        %{realname} - DLL libraries for Windows
63 Summary(pl.UTF-8):      %{realname} - biblioteki DLL dla Windows
64 Group:          Applications/Emulators
65
66 %description dll
67 %{realname} - DLL libraries for Windows.
68
69 %description dll -l pl.UTF-8
70 %{realname} - biblioteki DLL dla Windows.
71
72 %prep
73 %setup -q -n %{realname}_%{_fver}
74 %patch0 -p1
75
76 # - don't know how to pass it through (b)jam -s (no way?)
77 #   due to oversophisticated build flags system.
78 %{__perl} -pi -e 's/ -O3 / %{rpmcxxflags} /' tools/build/v2/tools/gcc.jam
79
80 find . -type f -exec sed -e 's/#error "wide char i\/o not supported on this platform"//' -i \{\} \;
81
82 %build
83 CC=%{target}-gcc ; export CC
84 CXX=%{target}-g++ ; export CXX
85 LD=%{target}-ld ; export LD
86 AR=%{target}-ar ; export AR
87 AS=%{target}-as ; export AS
88 CROSS_COMPILE=1 ; export CROSS_COMPILE
89 CPPFLAGS="-I%{arch}/include" ; export CPPFLAGS
90 RANLIB=%{target}-ranlib ; export RANLIB
91 LDSHARED="%{target}-gcc -shared" ; export LDSHARED
92 TARGET="%{target}" ; export TARGET
93
94 bjam \
95         -q -d2 --toolset=gcc \
96         --without-python --without-serialization --without-test \
97         variant=release threading=multi inlining=on debug-symbols=on \
98         -sBZIP2_BINARY=bzip2
99
100 mkdir wlib
101 cd bin.v2/*
102 for i in *
103 do
104         cd $i/*/*/*/*/*
105         cd link-static/*
106         $AR cru ../../../../../../../../../../wlib/libboost_$i.a *\.o
107         $RANLIB ../../../../../../../../../../wlib/libboost_$i.a
108
109         cd ../..
110
111         # if there is threading-multi dir 
112         # it's content is used for dll and implib
113         dll_dir='link-static/*'
114         up_dir='../..'
115         if [ -d threading-multi ]; then
116                 dll_dir='threading-multi'
117                 up_dir='./..'
118         fi
119
120         cd $dll_dir
121
122         # libboost_iostreams requires additional
123         # libraries
124         additional_so_params=
125         if [ $i = "iostreams" ]; then
126                 additional_so_params="-lz.dll -lbzip2.dll"
127         fi
128
129         # there are some issuses with dynamic libboost_wave
130         if [ $i != "wave" ]; then
131                 $CXX --shared *\.o $additional_so_params \
132                         -Wl,--enable-auto-image-base \
133                         -o $up_dir/../../../../../../../../wlib/boost_$i.dll \
134                         -Wl,--out-implib,libboost_$i.dll.a
135                 mv libboost_$i.dll.a $up_dir/../../../../../../../../wlib/
136         fi
137
138         cd $up_dir/../../../../../..
139 done
140 cd ../..
141
142 %if 0%{!?debug:1}
143 %{target}-strip wlib/*.dll
144 %{target}-strip -g -R.comment -R.note wlib/*.a
145 %endif
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT%{arch}/{include,lib}
150 install -d $RPM_BUILD_ROOT%{_datadir}/wine/windows/system
151
152 cp -r boost $RPM_BUILD_ROOT%{arch}/include
153 install wlib/*.a $RPM_BUILD_ROOT%{arch}/lib
154 install wlib/*.dll $RPM_BUILD_ROOT%{_datadir}/wine/windows/system/
155
156 %clean
157 rm -rf $RPM_BUILD_ROOT
158
159 %files
160 %defattr(644,root,root,755)
161 %{arch}/include/boost
162 %{arch}/lib/*
163
164 %files dll
165 %defattr(644,root,root,755)
166 %{_datadir}/wine/windows/system/*
This page took 0.036316 seconds and 3 git commands to generate.