PROJECT_MOVED -> https://lab.nexedi.com/nexedi/slapos
[slapos.git] / component / chromium / buildout.cfg
1 [buildout]
2 extends =
3   ../dbus/buildout.cfg
4   ../fontconfig/buildout.cfg
5   ../glib/buildout.cfg
6   ../gtk-2/buildout.cfg
7   ../libpng/buildout.cfg
8   ../xorg/buildout.cfg
9
10 parts = 
11   chromium
12   
13 [chromium]
14 recipe = slapos.recipe.build
15 slapos_promise =
16   file:chrome
17   file:chrome-wrapper
18   file:chrome-slapos
19
20 #chromium zip files for linux seem to be corrupted : rights are not correctly
21 #set (+x) when unzipping using python, but it works when doing "unzip chromium.zip"
22 #AND it works when unzipping any other archive with python.
23 #Conclusion : Google, please, learn how to make zip files.
24 linux_x86 = http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/109696/chrome-linux.zip 8ba6c022849b2a882b6e65163c147eb9
25 linux_x86-64 = http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/109696/chrome-linux.zip a3ed3feb285ecfe7c722576db80d5099
26 mac_x86-64 = http://commondatastorage.googleapis.com/chromium-browser-continuous/Mac/100142/chrome-mac.zip cb3a76b8a1a93be94df2f500fb621131
27
28 script =
29   #If part directory already exist, will just throw an error.
30   import sys
31   platform = '%%s_%%s' %% (guessOperatingSystem(), guessPlatform())
32   if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[platform].split(' ')
33   extract_dir = self.extract(self.download(self.options['url'], self.options.get('md5sum')))
34   workdir = guessworkdir(extract_dir)
35   self.copyTree(workdir, "%(location)s")
36   wrapper_location = os.path.join("%(location)s", "chrome-slapos")
37   wrapper = open(wrapper_location, 'w')
38   wrapper.write("""#!/bin/sh
39   export LD_LIBRARY_PATH=${libXrender:location}/lib/:${fontconfig:location}/lib/:${dbus:location}/lib/:${dbus-glib:location}/lib/:${pango:location}/lib:${cairo:location}/lib:${glib:location}/lib:${gtk-2:location}/lib:${atk:location}/lib:${gdk-pixbuf:location}/lib:${libXt:location}/lib:${gtk-2:location}/lib:${libpng15:location}/lib:%(location)s
40   %(location)s/chrome""")
41   wrapper.flush()
42   wrapper.close()
43   os.chmod(wrapper_location, 0766)
44   os.chmod(os.path.join("%(location)s", 'chrome'), 0766)
45   os.chmod(os.path.join("%(location)s", 'chrome-wrapper'), 0766)
46
47 # requirements : libXrender1 libxss1 x11-common