Advertisement
timcowchip

gigolo build error

Sep 15th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.72 KB | None | 0 0
  1. ==> Making package: gigolo 0.4.1-3 (Sun Sep 15 11:41:26 PDT 2013)
  2. ==> Checking runtime dependencies...
  3. ==> Checking buildtime dependencies...
  4. ==> Retrieving sources...
  5. -> Found gigolo-0.4.1.tar.bz2
  6. ==> Validating source files with sha256sums...
  7. gigolo-0.4.1.tar.bz2 ... Passed
  8. ==> Extracting sources...
  9. -> Extracting gigolo-0.4.1.tar.bz2 with bsdtar
  10. ==> Removing existing pkg/ directory...
  11. ==> Starting build()...
  12. #!/usr/bin/env python
  13. # -*- coding: utf-8 -*-
  14. #
  15. # WAF build script
  16. #
  17. # Copyright 2008-2010 Enrico Tröger <enrico(at)xfce(dot)org>
  18. #
  19. # This program is free software; you can redistribute it and/or modify
  20. # it under the terms of the GNU General Public License as published by
  21. # the Free Software Foundation; version 2 of the License.
  22. #
  23. # This program is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU General Public License
  29. # along with this program; if not, write to the Free Software
  30. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  31.  
  32.  
  33.  
  34. from TaskGen import taskgen, feature
  35. import Build, Configure, Options, Utils, UnitTest
  36. import sys, os, shutil
  37.  
  38.  
  39. APPNAME = 'gigolo'
  40. VERSION = '0.4.1'
  41.  
  42. srcdir = '.'
  43. blddir = '_build_'
  44.  
  45.  
  46. sources = [ 'src/compat.c', 'src/window.c', 'src/bookmark.c', 'src/settings.c',
  47. 'src/menubuttonaction.c', 'src/mountoperation.c', 'src/bookmarkdialog.c',
  48. 'src/bookmarkeditdialog.c', 'src/preferencesdialog.c', 'src/backendgvfs.c',
  49. 'src/common.c', 'src/mountdialog.c', 'src/browsenetworkpanel.c',
  50. 'src/singleinstance.c', 'src/bookmarkpanel.c' ]
  51.  
  52.  
  53.  
  54. def configure(conf):
  55. conf.check_tool('compiler_cc intltool misc gnu_dirs')
  56.  
  57. conf.check_cfg(package='gtk+-2.0', atleast_version='2.12.0', uselib_store='GTK',
  58. mandatory=True, args='--cflags --libs')
  59. conf.check_cfg(package='gio-2.0', atleast_version='2.16.0', uselib_store='GIO',
  60. mandatory=True, args='--cflags --libs')
  61. conf.check_cfg(package='x11', uselib_store='X11', mandatory=True, args='--libs')
  62.  
  63. gtk_version = conf.check_cfg(modversion='gtk+-2.0', uselib_store='GTK')
  64. gio_version = conf.check_cfg(modversion='gio-2.0', uselib_store='GIO')
  65.  
  66. conf.define('GETTEXT_PACKAGE', APPNAME, 1)
  67. conf.define('PACKAGE', APPNAME, 1)
  68. conf.define('VERSION', VERSION, 1)
  69.  
  70. conf.write_config_header('config.h')
  71.  
  72. if 'LINGUAS' in os.environ:
  73. conf.env['LINGUAS'] = os.environ['LINGUAS']
  74.  
  75. # debug flags
  76. if Options.options.debug:
  77. conf.env.append_value('CCFLAGS', '-g -O0 -DDEBUG '.split())
  78.  
  79. Utils.pprint('BLUE', 'Summary:')
  80. print_message(conf, 'Install Gigolo ' + VERSION + ' in', conf.env['PREFIX'])
  81. print_message(conf, 'Using GTK version', gtk_version or 'Unknown')
  82. print_message(conf, 'Using GIO version', gio_version or 'Unknown')
  83. print_message(conf, 'Compiling with debugging support', Options.options.debug and 'yes' or 'no')
  84.  
  85.  
  86. def set_options(opt):
  87. opt.tool_options('compiler_cc')
  88. opt.tool_options('intltool')
  89. opt.tool_options('gnu_dirs')
  90.  
  91. # Features
  92. opt.add_option('--enable-debug', action='store_true', default=False,
  93. help='enable debug mode [default: No]', dest='debug')
  94. opt.add_option('--update-po', action='store_true', default=False,
  95. help='update the message catalogs for translation', dest='update_po')
  96.  
  97.  
  98. @taskgen
  99. @feature('intltool_po')
  100. def write_linguas_file(self):
  101. linguas = ''
  102. if 'LINGUAS' in Build.bld.env:
  103. files = Build.bld.env['LINGUAS']
  104. for po_filename in files.split(' '):
  105. if os.path.exists('po/%s.po' % po_filename):
  106. linguas += '%s ' % po_filename
  107. else:
  108. files = os.listdir('%s/po' % self.path.abspath())
  109. files.sort()
  110. for f in files:
  111. if f.endswith('.po'):
  112. linguas += '%s ' % f[:-3]
  113. f = open("po/LINGUAS", "w")
  114. f.write('# This file is autogenerated. Do not edit.\n%s\n' % linguas)
  115. f.close()
  116.  
  117.  
  118. def build(bld):
  119. def add_tests(bld):
  120. tests = os.listdir('tests')
  121. for test in tests:
  122. if test[-2:] != '.c':
  123. continue
  124. target = test[:-2]
  125. source = os.path.join("tests", test)
  126.  
  127. bld.new_task_gen(
  128. features = 'cc cprogram',
  129. target = 'test-' + target,
  130. source = source,
  131. includes = '. src',
  132. uselib = 'GTK GIO',
  133. uselib_local = 'gigolo_lib',
  134. unit_test = 1,
  135. install_path = None
  136. )
  137.  
  138.  
  139. bld.new_task_gen(
  140. features = 'cc cstaticlib',
  141. name = 'gigolo_lib',
  142. target = 'gigolo_lib',
  143. source = sources,
  144. includes = '.',
  145. uselib = 'GTK GIO',
  146. install_path = None
  147. )
  148.  
  149. bld.new_task_gen(
  150. features = 'cc cprogram',
  151. name = 'gigolo',
  152. target = 'gigolo',
  153. source = 'src/main.c',
  154. includes = '.',
  155. uselib = 'GTK GIO X11',
  156. uselib_local = 'gigolo_lib',
  157. )
  158.  
  159. if Options.commands['check']:
  160. add_tests(bld)
  161.  
  162. # Translations
  163. bld.new_task_gen(
  164. features = 'intltool_po',
  165. podir = 'po',
  166. appname = 'gigolo'
  167. )
  168.  
  169. # gigolo.desktop
  170. bld.new_task_gen(
  171. features = 'intltool_in',
  172. source = 'gigolo.desktop.in',
  173. flags = [ '-d', '-q', '-u', '-c' ],
  174. install_path = '${DATADIR}/applications'
  175. )
  176.  
  177. # gigolo.1
  178. bld.new_task_gen(
  179. features = 'subst',
  180. source = 'gigolo.1.in',
  181. target = 'gigolo.1',
  182. dict = { 'VERSION' : VERSION },
  183. install_path = '${MANDIR}/man1'
  184. )
  185.  
  186. # Docs
  187. bld.install_files('${DOCDIR}', 'AUTHORS ChangeLog README NEWS TODO')
  188.  
  189.  
  190. def dist():
  191. import md5
  192. from Scripting import dist, excludes
  193. excludes.append('gigolo-%s.tar.bz2.sig' % VERSION)
  194. filename = dist(APPNAME, VERSION)
  195. f = file(filename,'rb')
  196. m = md5.md5()
  197. readBytes = 100000
  198. while (readBytes):
  199. readString = f.read(readBytes)
  200. m.update(readString)
  201. readBytes = len(readString)
  202. f.close()
  203. launch('gpg --detach-sign --digest-algo SHA512 %s' % filename, 'Signing %s' % filename)
  204. print 'MD5 sum:', filename, m.hexdigest()
  205. sys.exit(0)
  206.  
  207.  
  208. def shutdown():
  209. # the following code was taken from midori's WAF script, thanks
  210. # (disabled because we don't need it at all as long as we don't have an own icon :( )
  211. #~ if Options.commands['install'] or Options.commands['uninstall']:
  212. #~ dir = Build.bld.get_install_path('${DATADIR}/icons/hicolor')
  213. #~ icon_cache_updated = False
  214. #~ if not Options.options.destdir:
  215. #~ try:
  216. #~ if not Utils.exec_command('gtk-update-icon-cache -q -f -t %s' % dir):
  217. #~ Utils.pprint('YELLOW', "Updated Gtk icon cache.")
  218. #~ icon_cache_updated = True
  219. #~ except:
  220. #~ Utils.pprint('RED', "Failed to update icon cache.")
  221. #~ if not icon_cache_updated:
  222. #~ Utils.pprint('YELLOW', "Icon cache not updated. After install, run this:")
  223. #~ Utils.pprint('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)
  224. if Options.options.update_po:
  225. os.chdir(os.path.join(srcdir, 'po'))
  226. try:
  227. try:
  228. size_old = os.stat('gigolo.pot').st_size
  229. except:
  230. size_old = 0
  231. Utils.exec_command(['intltool-update', '--pot', '-g', APPNAME])
  232. size_new = os.stat('gigolo.pot').st_size
  233. if size_new != size_old:
  234. Utils.pprint('CYAN', 'Updated POT file.')
  235. launch('intltool-update -r %s' % APPNAME, 'Updating translations', 'CYAN')
  236. else:
  237. Utils.pprint('CYAN', 'POT file is up to date.')
  238. except:
  239. Utils.pprint('RED', 'Failed to generate pot file.')
  240. os.chdir('..')
  241.  
  242.  
  243. def check(ch):
  244. test = UnitTest.unit_test()
  245. test.change_to_testfile_dir = False
  246. test.want_to_see_test_output = True
  247. test.want_to_see_test_error = True
  248. test.run()
  249. test.print_results()
  250.  
  251.  
  252. # Simple function to execute a command and print its exit status
  253. def launch(command, status, success_color='GREEN'):
  254. ret = 0
  255. Utils.pprint(success_color, status)
  256. try:
  257. ret = Utils.exec_command(command.split())
  258. except:
  259. ret = 1
  260.  
  261. if ret != 0:
  262. Utils.pprint('RED', status + ' failed')
  263.  
  264. return ret
  265.  
  266. def print_message(conf, msg, result, color = 'GREEN'):
  267. conf.check_message_1(msg)
  268. conf.check_message_2(result, color)
  269. #!/usr/bin/env python
  270. # -*- coding: utf-8 -*-
  271. #
  272. # WAF build script
  273. #
  274. # Copyright 2008-2010 Enrico Tröger <enrico(at)xfce(dot)org>
  275. #
  276. # This program is free software; you can redistribute it and/or modify
  277. # it under the terms of the GNU General Public License as published by
  278. # the Free Software Foundation; version 2 of the License.
  279. #
  280. # This program is distributed in the hope that it will be useful,
  281. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  282. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  283. # GNU General Public License for more details.
  284. #
  285. # You should have received a copy of the GNU General Public License
  286. # along with this program; if not, write to the Free Software
  287. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  288.  
  289.  
  290.  
  291. from TaskGen import taskgen, feature
  292. import Build, Configure, Options, Utils, UnitTest
  293. import sys, os, shutil
  294.  
  295.  
  296. APPNAME = 'gigolo'
  297. VERSION = '0.4.1'
  298.  
  299. srcdir = '.'
  300. blddir = '_build_'
  301.  
  302.  
  303. sources = [ 'src/compat.c', 'src/window.c', 'src/bookmark.c', 'src/settings.c',
  304. 'src/menubuttonaction.c', 'src/mountoperation.c', 'src/bookmarkdialog.c',
  305. 'src/bookmarkeditdialog.c', 'src/preferencesdialog.c', 'src/backendgvfs.c',
  306. 'src/common.c', 'src/mountdialog.c', 'src/browsenetworkpanel.c',
  307. 'src/singleinstance.c', 'src/bookmarkpanel.c' ]
  308.  
  309.  
  310.  
  311. def configure(conf):
  312. conf.check_tool('compiler_cc intltool misc gnu_dirs')
  313.  
  314. conf.check_cfg(package='gtk+-2.0', atleast_version='2.12.0', uselib_store='GTK',
  315. mandatory=True, args='--cflags --libs')
  316. conf.check_cfg(package='gio-2.0', atleast_version='2.16.0', uselib_store='GIO',
  317. mandatory=True, args='--cflags --libs')
  318. conf.check_cfg(package='x11', uselib_store='X11', mandatory=True, args='--libs')
  319.  
  320. gtk_version = conf.check_cfg(modversion='gtk+-2.0', uselib_store='GTK')
  321. gio_version = conf.check_cfg(modversion='gio-2.0', uselib_store='GIO')
  322.  
  323. conf.define('GETTEXT_PACKAGE', APPNAME, 1)
  324. conf.define('PACKAGE', APPNAME, 1)
  325. conf.define('VERSION', VERSION, 1)
  326.  
  327. conf.write_config_header('config.h')
  328.  
  329. if 'LINGUAS' in os.environ:
  330. conf.env['LINGUAS'] = os.environ['LINGUAS']
  331.  
  332. # debug flags
  333. if Options.options.debug:
  334. conf.env.append_value('CCFLAGS', '-g -O0 -DDEBUG '.split())
  335.  
  336. Utils.pprint('BLUE', 'Summary:')
  337. print_message(conf, 'Install Gigolo ' + VERSION + ' in', conf.env['PREFIX'])
  338. print_message(conf, 'Using GTK version', gtk_version or 'Unknown')
  339. print_message(conf, 'Using GIO version', gio_version or 'Unknown')
  340. print_message(conf, 'Compiling with debugging support', Options.options.debug and 'yes' or 'no')
  341.  
  342.  
  343. def set_options(opt):
  344. opt.tool_options('compiler_cc')
  345. opt.tool_options('intltool')
  346. opt.tool_options('gnu_dirs')
  347.  
  348. # Features
  349. opt.add_option('--enable-debug', action='store_true', default=False,
  350. help='enable debug mode [default: No]', dest='debug')
  351. opt.add_option('--update-po', action='store_true', default=False,
  352. help='update the message catalogs for translation', dest='update_po')
  353.  
  354.  
  355. @taskgen
  356. @feature('intltool_po')
  357. def write_linguas_file(self):
  358. linguas = ''
  359. if 'LINGUAS' in Build.bld.env:
  360. files = Build.bld.env['LINGUAS']
  361. for po_filename in files.split(' '):
  362. if os.path.exists('po/%s.po' % po_filename):
  363. linguas += '%s ' % po_filename
  364. else:
  365. files = os.listdir('%s/po' % self.path.abspath())
  366. files.sort()
  367. for f in files:
  368. if f.endswith('.po'):
  369. linguas += '%s ' % f[:-3]
  370. f = open("po/LINGUAS", "w")
  371. f.write('# This file is autogenerated. Do not edit.\n%s\n' % linguas)
  372. f.close()
  373.  
  374.  
  375. def build(bld):
  376. def add_tests(bld):
  377. tests = os.listdir('tests')
  378. for test in tests:
  379. if test[-2:] != '.c':
  380. continue
  381. target = test[:-2]
  382. source = os.path.join("tests", test)
  383.  
  384. bld.new_task_gen(
  385. features = 'cc cprogram',
  386. target = 'test-' + target,
  387. source = source,
  388. includes = '. src',
  389. uselib = 'GTK GIO',
  390. uselib_local = 'gigolo_lib',
  391. unit_test = 1,
  392. install_path = None
  393. )
  394.  
  395.  
  396. bld.new_task_gen(
  397. features = 'cc cstaticlib',
  398. name = 'gigolo_lib',
  399. target = 'gigolo_lib',
  400. source = sources,
  401. includes = '.',
  402. uselib = 'GTK GIO',
  403. install_path = None
  404. )
  405.  
  406. bld.new_task_gen(
  407. features = 'cc cprogram',
  408. name = 'gigolo',
  409. target = 'gigolo',
  410. source = 'src/main.c',
  411. includes = '.',
  412. uselib = 'GTK GIO X11',
  413. uselib_local = 'gigolo_lib',
  414. )
  415.  
  416. if Options.commands['check']:
  417. add_tests(bld)
  418.  
  419. # Translations
  420. bld.new_task_gen(
  421. features = 'intltool_po',
  422. podir = 'po',
  423. appname = 'gigolo'
  424. )
  425.  
  426. # gigolo.desktop
  427. bld.new_task_gen(
  428. features = 'intltool_in',
  429. source = 'gigolo.desktop.in',
  430. flags = [ '-d', '-q', '-u', '-c' ],
  431. install_path = '${DATADIR}/applications'
  432. )
  433.  
  434. # gigolo.1
  435. bld.new_task_gen(
  436. features = 'subst',
  437. source = 'gigolo.1.in',
  438. target = 'gigolo.1',
  439. dict = { 'VERSION' : VERSION },
  440. install_path = '${MANDIR}/man1'
  441. )
  442.  
  443. # Docs
  444. #bld.install_files('${DOCDIR}', 'AUTHORS ChangeLog COPYING README NEWS TODO')
  445.  
  446.  
  447. def dist():
  448. import md5
  449. from Scripting import dist, excludes
  450. excludes.append('gigolo-%s.tar.bz2.sig' % VERSION)
  451. filename = dist(APPNAME, VERSION)
  452. f = file(filename,'rb')
  453. m = md5.md5()
  454. readBytes = 100000
  455. while (readBytes):
  456. readString = f.read(readBytes)
  457. m.update(readString)
  458. readBytes = len(readString)
  459. f.close()
  460. launch('gpg --detach-sign --digest-algo SHA512 %s' % filename, 'Signing %s' % filename)
  461. print 'MD5 sum:', filename, m.hexdigest()
  462. sys.exit(0)
  463.  
  464.  
  465. def shutdown():
  466. # the following code was taken from midori's WAF script, thanks
  467. # (disabled because we don't need it at all as long as we don't have an own icon :( )
  468. #~ if Options.commands['install'] or Options.commands['uninstall']:
  469. #~ dir = Build.bld.get_install_path('${DATADIR}/icons/hicolor')
  470. #~ icon_cache_updated = False
  471. #~ if not Options.options.destdir:
  472. #~ try:
  473. #~ if not Utils.exec_command('gtk-update-icon-cache -q -f -t %s' % dir):
  474. #~ Utils.pprint('YELLOW', "Updated Gtk icon cache.")
  475. #~ icon_cache_updated = True
  476. #~ except:
  477. #~ Utils.pprint('RED', "Failed to update icon cache.")
  478. #~ if not icon_cache_updated:
  479. #~ Utils.pprint('YELLOW', "Icon cache not updated. After install, run this:")
  480. #~ Utils.pprint('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)
  481. if Options.options.update_po:
  482. os.chdir(os.path.join(srcdir, 'po'))
  483. try:
  484. try:
  485. size_old = os.stat('gigolo.pot').st_size
  486. except:
  487. size_old = 0
  488. Utils.exec_command(['intltool-update', '--pot', '-g', APPNAME])
  489. size_new = os.stat('gigolo.pot').st_size
  490. if size_new != size_old:
  491. Utils.pprint('CYAN', 'Updated POT file.')
  492. launch('intltool-update -r %s' % APPNAME, 'Updating translations', 'CYAN')
  493. else:
  494. Utils.pprint('CYAN', 'POT file is up to date.')
  495. except:
  496. Utils.pprint('RED', 'Failed to generate pot file.')
  497. os.chdir('..')
  498.  
  499.  
  500. def check(ch):
  501. test = UnitTest.unit_test()
  502. test.change_to_testfile_dir = False
  503. test.want_to_see_test_output = True
  504. test.want_to_see_test_error = True
  505. test.run()
  506. test.print_results()
  507.  
  508.  
  509. # Simple function to execute a command and print its exit status
  510. def launch(command, status, success_color='GREEN'):
  511. ret = 0
  512. Utils.pprint(success_color, status)
  513. try:
  514. ret = Utils.exec_command(command.split())
  515. except:
  516. ret = 1
  517.  
  518. if ret != 0:
  519. Utils.pprint('RED', status + ' failed')
  520.  
  521. return ret
  522.  
  523. def print_message(conf, msg, result, color = 'GREEN'):
  524. conf.check_message_1(msg)
  525. conf.check_message_2(result, color)
  526. #!/usr/bin/env python
  527. # -*- coding: utf-8 -*-
  528. #
  529. # WAF build script
  530. #
  531. # Copyright 2008-2010 Enrico Tröger <enrico(at)xfce(dot)org>
  532. #
  533. # This program is free software; you can redistribute it and/or modify
  534. # it under the terms of the GNU General Public License as published by
  535. # the Free Software Foundation; version 2 of the License.
  536. #
  537. # This program is distributed in the hope that it will be useful,
  538. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  539. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  540. # GNU General Public License for more details.
  541. #
  542. # You should have received a copy of the GNU General Public License
  543. # along with this program; if not, write to the Free Software
  544. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  545.  
  546.  
  547.  
  548. from TaskGen import taskgen, feature
  549. import Build, Configure, Options, Utils, UnitTest
  550. import sys, os, shutil
  551.  
  552.  
  553. APPNAME = 'gigolo'
  554. VERSION = '0.4.1'
  555.  
  556. srcdir = '.'
  557. blddir = '_build_'
  558.  
  559.  
  560. sources = [ 'src/compat.c', 'src/window.c', 'src/bookmark.c', 'src/settings.c',
  561. 'src/menubuttonaction.c', 'src/mountoperation.c', 'src/bookmarkdialog.c',
  562. 'src/bookmarkeditdialog.c', 'src/preferencesdialog.c', 'src/backendgvfs.c',
  563. 'src/common.c', 'src/mountdialog.c', 'src/browsenetworkpanel.c',
  564. 'src/singleinstance.c', 'src/bookmarkpanel.c' ]
  565.  
  566.  
  567.  
  568. def configure(conf):
  569. conf.check_tool('compiler_cc intltool misc gnu_dirs')
  570.  
  571. conf.check_cfg(package='gtk+-2.0', atleast_version='2.12.0', uselib_store='GTK',
  572. mandatory=True, args='--cflags --libs')
  573. conf.check_cfg(package='gio-2.0', atleast_version='2.16.0', uselib_store='GIO',
  574. mandatory=True, args='--cflags --libs')
  575. conf.check_cfg(package='x11', uselib_store='X11', mandatory=True, args='--libs')
  576.  
  577. gtk_version = conf.check_cfg(modversion='gtk+-2.0', uselib_store='GTK')
  578. gio_version = conf.check_cfg(modversion='gio-2.0', uselib_store='GIO')
  579.  
  580. conf.define('GETTEXT_PACKAGE', APPNAME, 1)
  581. conf.define('PACKAGE', APPNAME, 1)
  582. conf.define('VERSION', VERSION, 1)
  583.  
  584. conf.write_config_header('config.h')
  585.  
  586. if 'LINGUAS' in os.environ:
  587. conf.env['LINGUAS'] = os.environ['LINGUAS']
  588.  
  589. # debug flags
  590. if Options.options.debug:
  591. conf.env.append_value('CCFLAGS', '-g -O0 -DDEBUG '.split())
  592.  
  593. Utils.pprint('BLUE', 'Summary:')
  594. print_message(conf, 'Install Gigolo ' + VERSION + ' in', conf.env['PREFIX'])
  595. print_message(conf, 'Using GTK version', gtk_version or 'Unknown')
  596. print_message(conf, 'Using GIO version', gio_version or 'Unknown')
  597. print_message(conf, 'Compiling with debugging support', Options.options.debug and 'yes' or 'no')
  598.  
  599.  
  600. def set_options(opt):
  601. opt.tool_options('compiler_cc')
  602. opt.tool_options('intltool')
  603. opt.tool_options('gnu_dirs')
  604.  
  605. # Features
  606. opt.add_option('--enable-debug', action='store_true', default=False,
  607. help='enable debug mode [default: No]', dest='debug')
  608. opt.add_option('--update-po', action='store_true', default=False,
  609. help='update the message catalogs for translation', dest='update_po')
  610.  
  611.  
  612. @taskgen
  613. @feature('intltool_po')
  614. def write_linguas_file(self):
  615. linguas = ''
  616. if 'LINGUAS' in Build.bld.env:
  617. files = Build.bld.env['LINGUAS']
  618. for po_filename in files.split(' '):
  619. if os.path.exists('po/%s.po' % po_filename):
  620. linguas += '%s ' % po_filename
  621. else:
  622. files = os.listdir('%s/po' % self.path.abspath())
  623. files.sort()
  624. for f in files:
  625. if f.endswith('.po'):
  626. linguas += '%s ' % f[:-3]
  627. f = open("po/LINGUAS", "w")
  628. f.write('# This file is autogenerated. Do not edit.\n%s\n' % linguas)
  629. f.close()
  630.  
  631.  
  632. def build(bld):
  633. def add_tests(bld):
  634. tests = os.listdir('tests')
  635. for test in tests:
  636. if test[-2:] != '.c':
  637. continue
  638. target = test[:-2]
  639. source = os.path.join("tests", test)
  640.  
  641. bld.new_task_gen(
  642. features = 'cc cprogram',
  643. target = 'test-' + target,
  644. source = source,
  645. includes = '. src',
  646. uselib = 'GTK GIO',
  647. uselib_local = 'gigolo_lib',
  648. unit_test = 1,
  649. install_path = None
  650. )
  651.  
  652.  
  653. bld.new_task_gen(
  654. features = 'cc cstaticlib',
  655. name = 'gigolo_lib',
  656. target = 'gigolo_lib',
  657. source = sources,
  658. includes = '.',
  659. uselib = 'GTK GIO',
  660. install_path = None
  661. )
  662.  
  663. bld.new_task_gen(
  664. features = 'cc cprogram',
  665. name = 'gigolo',
  666. target = 'gigolo',
  667. source = 'src/main.c',
  668. includes = '.',
  669. uselib = 'GTK GIO X11',
  670. uselib_local = 'gigolo_lib',
  671. )
  672.  
  673. if Options.commands['check']:
  674. add_tests(bld)
  675.  
  676. # Translations
  677. bld.new_task_gen(
  678. features = 'intltool_po',
  679. podir = 'po',
  680. appname = 'gigolo'
  681. )
  682.  
  683. # gigolo.desktop
  684. bld.new_task_gen(
  685. features = 'intltool_in',
  686. source = 'gigolo.desktop.in',
  687. flags = [ '-d', '-q', '-u', '-c' ],
  688. install_path = '${DATADIR}/applications'
  689. )
  690.  
  691. # gigolo.1
  692. bld.new_task_gen(
  693. features = 'subst',
  694. source = 'gigolo.1.in',
  695. target = 'gigolo.1',
  696. dict = { 'VERSION' : VERSION },
  697. install_path = '${MANDIR}/man1'
  698. )
  699.  
  700. # Docs
  701. bld.install_files('${DOCDIR}', 'AUTHORS ChangeLog COPYING README NEWS TODO')
  702.  
  703.  
  704. def dist():
  705. import md5
  706. from Scripting import dist, excludes
  707. excludes.append('gigolo-%s.tar.bz2.sig' % VERSION)
  708. filename = dist(APPNAME, VERSION)
  709. f = file(filename,'rb')
  710. m = md5.md5()
  711. readBytes = 100000
  712. while (readBytes):
  713. readString = f.read(readBytes)
  714. m.update(readString)
  715. readBytes = len(readString)
  716. f.close()
  717. launch('gpg --detach-sign --digest-algo SHA512 %s' % filename, 'Signing %s' % filename)
  718. print 'MD5 sum:', filename, m.hexdigest()
  719. sys.exit(0)
  720.  
  721.  
  722. def shutdown():
  723. # the following code was taken from midori's WAF script, thanks
  724. # (disabled because we don't need it at all as long as we don't have an own icon :( )
  725. #~ if Options.commands['install'] or Options.commands['uninstall']:
  726. #~ dir = Build.bld.get_install_path('${DATADIR}/icons/hicolor')
  727. #~ icon_cache_updated = False
  728. #~ if not Options.options.destdir:
  729. #~ try:
  730. #~ if not Utils.exec_command('gtk-update-icon-cache -q -f -t %s' % dir):
  731. #~ Utils.pprint('YELLOW', "Updated Gtk icon cache.")
  732. #~ icon_cache_updated = True
  733. #~ except:
  734. #~ Utils.pprint('RED', "Failed to update icon cache.")
  735. #~ if not icon_cache_updated:
  736. #~ Utils.pprint('YELLOW', "Icon cache not updated. After install, run this:")
  737. #~ Utils.pprint('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)
  738. if Options.options.update_po:
  739. os.chdir(os.path.join(srcdir, 'po'))
  740. try:
  741. try:
  742. size_old = os.stat('gigolo.pot').st_size
  743. except:
  744. size_old = 0
  745. Utils.exec_command(['intltool-update', '--pot', '-g', APPNAME])
  746. size_new = os.stat('gigolo.pot').st_size
  747. if size_new != size_old:
  748. Utils.pprint('CYAN', 'Updated POT file.')
  749. launch('intltool-update -r %s' % APPNAME, 'Updating translations', 'CYAN')
  750. else:
  751. Utils.pprint('CYAN', 'POT file is up to date.')
  752. except:
  753. Utils.pprint('RED', 'Failed to generate pot file.')
  754. os.chdir('..')
  755.  
  756.  
  757. def check(ch):
  758. test = UnitTest.unit_test()
  759. test.change_to_testfile_dir = False
  760. test.want_to_see_test_output = True
  761. test.want_to_see_test_error = True
  762. test.run()
  763. test.print_results()
  764.  
  765.  
  766. # Simple function to execute a command and print its exit status
  767. def launch(command, status, success_color='GREEN'):
  768. ret = 0
  769. Utils.pprint(success_color, status)
  770. try:
  771. ret = Utils.exec_command(command.split())
  772. except:
  773. ret = 1
  774.  
  775. if ret != 0:
  776. Utils.pprint('RED', status + ' failed')
  777.  
  778. return ret
  779.  
  780. def print_message(conf, msg, result, color = 'GREEN'):
  781. conf.check_message_1(msg)
  782. conf.check_message_2(result, color)
  783. Traceback (most recent call last):
  784. File "./waf", line 148, in <module>
  785. File "/usr/home/chris/builds/gigolo/src/gigolo-0.4.1/.waf3-1.5.8-a59ac8bc7a852b42100aaac3bb0c0216/wafadmin/Scripting.py", line 102, in prepare
  786. prepare_impl(t,cwd,ver,wafdir)
  787. File "/usr/home/chris/builds/gigolo/src/gigolo-0.4.1/.waf3-1.5.8-a59ac8bc7a852b42100aaac3bb0c0216/wafadmin/Scripting.py", line 66, in prepare_impl
  788. Utils.set_main_module(os.path.join(candidate,WSCRIPT_FILE))
  789. File "/usr/home/chris/builds/gigolo/src/gigolo-0.4.1/.waf3-1.5.8-a59ac8bc7a852b42100aaac3bb0c0216/wafadmin/Utils.py", line 176, in set_main_module
  790. g_module=load_module(file_path,'wscript_main')
  791. File "/usr/home/chris/builds/gigolo/src/gigolo-0.4.1/.waf3-1.5.8-a59ac8bc7a852b42100aaac3bb0c0216/wafadmin/Utils.py", line 170, in load_module
  792. exec(code,module.__dict__)
  793. File "<string>", line 193
  794. print 'MD5 sum:', filename, m.hexdigest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement