phantomjs: update to latest version
[slapos.git] / component / phantomjs / buildout.cfg
1 [buildout]
2 extends =
3   ../fontconfig/buildout.cfg
4   ../libexpat/buildout.cfg
5   ../dash/buildout.cfg
6 parts =
7   phantomjs
8
9 [phantomjs]
10 recipe = slapos.recipe.build
11 slapos_promise =
12   file:phantomjs-slapos
13
14 depends =
15   ${liberation-fonts:location}
16   ${ipaex-fonts:location}
17
18 x86 = https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2 9c1426eef5b04679d65198b1bdd6ef88
19 x86-64 = https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 f278996c3edd0e8d8ec4893807f27d71
20
21 script =
22   if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[guessPlatform()].split(' ')
23   extract_dir = self.extract(self.download(self.options['url'], self.options.get('md5sum')))
24   workdir = guessworkdir(extract_dir)
25   self.copyTree(workdir, "%(location)s")
26   wrapper_location = os.path.join("%(location)s", "phantomjs-slapos")
27   wrapper = open(wrapper_location, 'w')
28   wrapper.write("""#!${dash:location}/bin/dash
29   cd %(location)s
30   export LD_LIBRARY_PATH=%(location)s:${freetype:location}/lib/:${fontconfig:location}/lib/:${libexpat:location}/lib
31   export PATH=${fontconfig:location}/bin:$PATH
32   exec %(location)s/bin/phantomjs $*""")
33   wrapper.flush()
34   wrapper.close()
35   os.chmod(wrapper_location, 0755)