Gentoo Archives: gentoo-commits

From: "Andreas HAttel (dilfridge)" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-video/bombono-dvd/files: bombono-dvd-0.8.0-boost.patch
Date: Thu, 04 Nov 2010 23:15:53
Message-Id: 20101104231548.3E32B20054@flycatcher.gentoo.org
1 dilfridge 10/11/04 23:15:48
2
3 Added: bombono-dvd-0.8.0-boost.patch
4 Log:
5 Added upstream patch to build against system boost
6
7 (Portage version: 2.1.9.24/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-video/bombono-dvd/files/bombono-dvd-0.8.0-boost.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/bombono-dvd/files/bombono-dvd-0.8.0-boost.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/bombono-dvd/files/bombono-dvd-0.8.0-boost.patch?rev=1.1&content-type=text/plain
14
15 Index: bombono-dvd-0.8.0-boost.patch
16 ===================================================================
17 diff --git a/SConstruct b/SConstruct
18 index fa391c9..4ca4bd1 100644
19 --- a/SConstruct
20 +++ b/SConstruct
21 @@ -107,6 +107,13 @@ def CalcCommonFlags():
22 '_ISOC99_SOURCE' # C99 extentions: snprintf()
23 ]
24
25 +#
26 +# Users CPPFLAGS support
27 +# Because SCons cannot handle -U option (~ #undef) it is done via
28 +# additional variable named POST_CPPFLAGS
29 +#
30 +UserCppFlags = ''
31 +
32 def AdjustConfigOptions(env):
33 CalcCommonFlags()
34
35 @@ -130,6 +137,7 @@ def AdjustConfigOptions(env):
36 env.Append(CCFLAGS = BV.CFlags.split())
37 env.Append(CXXFLAGS = BV.CxxFlags.split())
38 env.Append(LINKFLAGS = BV.LdFlags.split())
39 + env.Append(POST_CPPFLAGS = UserCppFlags.split())
40
41 # :TODO: set them when need
42 #env.Replace (PATH = user_options_dict['PATH'])
43 @@ -185,9 +193,10 @@ def ParseVariables(user_options):
44 ('DESTDIR', 'Set the intermediate install directory.', ''),
45 ('CC', 'C compiler.'),
46 ('CXX', 'C++ compiler.'),
47 - ('CFLAGS', 'Extra C Compiler flags (for C++ too).', ''),
48 - ('CXXFLAGS','Extra C++ Compiler flags.', ''),
49 - ('LDFLAGS', 'Extra Linker flags.', ''),
50 + ('CPPFLAGS','Extra CPP flags.', ''),
51 + ('CFLAGS', 'Extra C Compiler flags (for C++ too).', ''),
52 + ('CXXFLAGS','Extra C++ Compiler flags.', ''),
53 + ('LDFLAGS', 'Extra Linker flags.', ''),
54 (BoolVariable('TEST',
55 'Set to 1 if you want to build and run tests.',
56 'false')),
57 @@ -230,6 +239,8 @@ def ParseVariables(user_options):
58
59 BV.Cc = user_options_dict['CC']
60 BV.Cxx = user_options_dict['CXX']
61 + global UserCppFlags
62 + UserCppFlags = user_options_dict['CPPFLAGS']
63 BV.CFlags = user_options_dict['CFLAGS']
64 BV.CxxFlags = user_options_dict['CXXFLAGS']
65 BV.LdFlags = user_options_dict['LDFLAGS']
66 @@ -262,8 +273,10 @@ else:
67 user_options = Variables(None, BV.Args)
68 ParseVariables(user_options)
69 try:
70 + def write_name_value(name, val):
71 + config.write('%s = %r\n' % (name, val))
72 def write_dict_value(name):
73 - config.write('%s = %r\n' % (name, user_options_dict[name]))
74 + write_name_value(name, user_options_dict[name])
75
76 # save to file
77 config = open(BV.CfgFile, 'w')
78 @@ -280,6 +293,7 @@ else:
79 config.write('\n# Compiler information\n')
80 config.write('CC = %r\n' % (BV.Cc))
81 config.write('CXX = %r\n' % (BV.Cxx))
82 + write_name_value('CPPFLAGS', UserCppFlags)
83 config.write('CFLAGS = %r\n' % (BV.CFlags))
84 config.write('CXXFLAGS = %r\n' % (BV.CxxFlags))
85 config.write('LDFLAGS = %r\n' % (BV.LdFlags))
86 diff --git a/libs/SConscript b/libs/SConscript
87 index 043b809..bbb1072 100644
88 --- a/libs/SConscript
89 +++ b/libs/SConscript
90 @@ -19,7 +19,7 @@ else:
91
92 boost_dict = { 'LIBPATH' : user_options_dict['BOOST_LIBPATH'] }
93 if BV.IsToBuildQuick():
94 - boost_dict['CPP_POST_FLAGS'] = BV.MakeIncludeOptions(user_options_dict['BOOST_INCLUDE'], 1)
95 + boost_dict['POST_CPPINCFLAGS'] = BV.MakeIncludeOptions(user_options_dict['BOOST_INCLUDE'], 1)
96 else:
97 boost_dict['CPPPATH'] = user_options_dict['BOOST_INCLUDE']
98 if not embedded_boost:
99 diff --git a/src/mgui/author/render.cpp b/src/mgui/author/render.cpp
100 index c91a244..4310898 100644
101 --- a/src/mgui/author/render.cpp
102 +++ b/src/mgui/author/render.cpp
103 @@ -453,6 +453,17 @@ static void FFmpegError(const std::string& msg)
104 Author::Error(FFmpegErrorTemplate(), msg);
105 }
106
107 +static std::string errno2str()
108 +{
109 + namespace bs = boost::system;
110 +#if BOOST_MINOR_VERSION >= 44
111 + const bs::error_category& s_cat = bs::system_category();
112 +#else
113 + const bs::error_category& s_cat = bs::system_category; // = bs::get_system_category();
114 +#endif
115 + return bs::error_code(errno, s_cat).message();
116 +}
117 +
118 static void WriteAsPPM(int fd, RefPtr<Gdk::Pixbuf> pix, TrackBuf& buf)
119 {
120 int wdh = pix->get_width();
121 @@ -491,10 +502,7 @@ static void WriteAsPPM(int fd, RefPtr<Gdk::Pixbuf> pix, TrackBuf& buf)
122 ASSERT( cur - beg == sz );
123 //checked_writeall(fd, beg, sz);
124 if( !writeall(fd, beg, sz) )
125 - {
126 - namespace bs = boost::system;
127 - FFmpegError(bs::error_code(errno, bs::system_category()).message());
128 - }
129 + FFmpegError(errno2str());
130 }
131
132 std::string FFmpegPostArgs(const std::string& out_fname, bool is_4_3, bool is_pal,
133 diff --git a/src/mlib/tech.h b/src/mlib/tech.h
134 index 771c463..0cd9867 100644
135 --- a/src/mlib/tech.h
136 +++ b/src/mlib/tech.h
137 @@ -27,6 +27,7 @@
138 //
139 #include <boost/current_function.hpp> // для BOOST_CURRENT_FUNCTION
140 #include <boost/detail/endian.hpp> // для BOOST_XXX_ENDIAN
141 +#include <boost/version.hpp> // для BOOST_MINOR_VERSION
142
143 // для С-шного кода в С++
144 #if defined(__cplusplus) || defined(c_plusplus)
145 @@ -85,6 +86,8 @@ void AssertImpl(const char* assertion, const char* file,
146 # error mlib/tech.h: unknown endianness (legacy PDP arch?)
147 #endif
148
149 +#define BOOST_MINOR_VERSION (BOOST_VERSION / 100 % 1000)
150 +
151 // gcc 4.4 вываливает кучу предупреждений о strict-alias rules
152 // (только при >= -O2), но чувствую, что неправильно
153
154 diff --git a/src/mlib/tests/turn_on_test_main.h b/src/mlib/tests/turn_on_test_main.h
155 index fa3e545..f67e4aa 100644
156 --- a/src/mlib/tests/turn_on_test_main.h
157 +++ b/src/mlib/tests/turn_on_test_main.h
158 @@ -22,12 +22,12 @@
159 #ifndef __MLIB_TESTS_TEST_TOTM_H__
160 #define __MLIB_TESTS_TEST_TOTM_H__
161
162 -#include <boost/version.hpp>
163 +#include <mlib/tech.h>
164
165 //
166 // for Boost > 1.33 dynamic version begin to be built
167 //
168 -#if BOOST_VERSION / 100 % 1000 > 33
169 +#if BOOST_MINOR_VERSION > 33
170 # ifndef STILL_HAVE_STATIC_BOOST_WITH_MAIN
171 # define BOOST_TEST_DYN_LINK
172 # endif
173 diff --git a/tools/scripts/BuildVars.py b/tools/scripts/BuildVars.py
174 index fe992e4..59408ac 100644
175 --- a/tools/scripts/BuildVars.py
176 +++ b/tools/scripts/BuildVars.py
177 @@ -458,12 +458,12 @@ def MakeIncludeOptions(dir_list, to_convert=0):
178
179 def MoveIncludeOptions(dict):
180 if 'CPPPATH' in dict.keys():
181 - dict['CPP_POST_FLAGS'] = MakeIncludeOptions(dict['CPPPATH'])
182 + dict['POST_CPPINCFLAGS'] = MakeIncludeOptions(dict['CPPPATH'])
183 del dict['CPPPATH']
184
185 def GetDict(name):
186 dict = UserOptDict[MakeDictName(name)]
187 - #reduce SCons' C scanner area, CPPPATH -> CPP_POST_FLAGS
188 + #reduce SCons' C scanner area, CPPPATH -> POST_CPPINCFLAGS
189 if IsToBuildQuick():
190 MoveIncludeOptions(dict)
191 return dict
192 @@ -499,6 +499,9 @@ def IsToBuildQuick():
193
194 return res
195
196 +def ExtendEnvVariable(env, name, add_name):
197 + env[name] = '%s $%s' % (env[name], add_name)
198 +
199 def CreateEnvVersion2(**kw):
200 tools = ['default', 'AuxTools']
201 if kw.has_key('tools'):
202 @@ -514,6 +517,12 @@ def CreateEnvVersion2(**kw):
203 # thin archives ('T' option) are to speed up static libraries build
204 # :TRICKY: libmpeg2.a and etc have to be built directly to build/lib (withour copying/symlinking)
205 env.Replace(ARFLAGS = str(env['ARFLAGS']) + 'T')
206 +
207 + # User defines
208 + # it is cosmetically better to place POST_CPPFLAGS just after _CPPDEFFLAGS
209 + # but 1) extending _CPPDEFFLAGS is bad such way 2) it still works
210 + ExtendEnvVariable(env, '_CCCOMCOM', 'POST_CPPFLAGS')
211 +
212 return env
213
214 def MakeMainEnv():
215 @@ -562,8 +571,9 @@ def MakeMainEnv():
216 suffix = '.pch' if is_clang else '.gch'
217 env['GCHSUFFIX'] = suffix
218
219 - # 2 - reduce SCons' C scanner area, CPPPATH -> CPP_POST_FLAGS
220 - env['_CPPINCFLAGS'] = env['_CPPINCFLAGS'] + ' $CPP_POST_FLAGS'
221 + # 2 - reduce SCons' C scanner area, CPPPATH -> POST_CPPINCFLAGS
222 + #env['_CPPINCFLAGS'] = env['_CPPINCFLAGS'] + ' $POST_CPPINCFLAGS'
223 + ExtendEnvVariable(env, '_CPPINCFLAGS', 'POST_CPPINCFLAGS')
224 else:
225 def SetPCH(env, header_name, additional_envs=[]):
226 pass