Add pkg-config executable to mydumper
[slapos.git] / component / mydumper / buildout.cfg
1 [buildout]
2
3 extends =
4     ../cmake/buildout.cfg
5     ../glib/buildout.cfg
6     ../pkgconfig/buildout.cfg
7     ../openssl/buildout.cfg
8     ../pcre/buildout.cfg
9     ../mariadb/buildout.cfg
10
11 parts = mydumper
12
13 # XXX-Antoine:
14 # This is really dirty, but it's the only way to install
15 # mydumper that works
16 [mydumper]
17 recipe = slapos.recipe.build
18 depends =
19   ${mariadb:version}
20 url = https://launchpad.net/mydumper/0.5/0.5.1/+download/mydumper-0.5.1.tar.gz
21 md5sum = b4df42dfe23f308ab13eb6ecb73a0d21
22 buildout-bin-dir = ${buildout:bin-directory}
23 cmake-command = ${cmake:location}/bin/cmake
24 mysql-config = ${mariadb:location}/bin/mysql_config
25 mysqllib = ${mariadb:location}/lib
26 path = ${pkgconfig:location}/bin
27 pkg-config-path = ${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/:${openssl:location}/lib/pkgconfig/
28 libraries = ${zlib:location}/lib/:${glib:location}/lib/:${pcre:location}/lib/:${mariadb:location}/lib/:${openssl:location}/lib/
29 includes = ${zlib:location}/include/:${glib:location}/include/:${pcre:location}/include/:${mariadb:location}/include:${openssl:location}/include/
30 cflags = -I${zlib:location}/include/ -I${glib:location}/include/ -I${pcre:location}/include/ -I${mariadb:location}/include -I${openssl:location}/include/
31 mysql-include-dir = ${mariadb:location}/include
32 mydumper-patches =
33    ${:_profile_base_location_}/mydumper-remove-warnings-errors.patch 917fea16b5ddea195cfa33fbd9827f57 -p1
34 slapos_promise =
35     directory:bin
36     file:bin/mydumper
37     file:bin/myloader
38 script =
39     import os
40     url = self.download(self.options['url'], self.options.get('md5sum'))
41     extract_dir = self.extract(url)
42     workdir = guessworkdir(extract_dir)
43     self.applyPatchList(self.options['mydumper-patches'], cwd=workdir)
44     env['PATH'] = self.options['path'] + ':' + self.options['buildout-bin-dir'] + ':' + env.get('PATH', '')
45     env['PKG_CONFIG_PATH'] = self.options['pkg-config-path'] + ':' + \
46                              env.get('PKG_CONFIG_PATH', '')
47     env['CMAKE_INCLUDE_PATH'] = self.options['includes']
48     env['CMAKE_LIBRARY_PATH'] = self.options['libraries']
49     env['CFLAGS'] = self.options['cflags']
50     command_line = [self.options['cmake-command'],
51                     '-DCMAKE_INSTALL_PREFIX=%%s' %% self.options['location'],
52                     '-DMYSQL_CONFIG=%%s' %% self.options['mysql-config'],
53                     '-DCMAKE_C_FLAGS=%%s' %% self.options['cflags'],
54                     '-DCMAKE_INSTALL_RPATH=%%s' %% self.options['libraries'],
55                     '-DMYSQL_INCLUDE_DIR=%%s' %% self.options['mysql-include-dir'],
56                     '-DBUILD_DOCS=OFF',
57                     '.']
58     call(command_line, cwd=workdir, env=env)
59     call(['make'], cwd=workdir, env=env)
60     call(['make', 'install'], cwd=workdir, env=env)
61
62 # XXX-Antoine: here's what I did using hexagonit.recipe.cmmi.
63 # and it wasn't working !
64 #[mydumper]
65 #recipe = hexagonit.recipe.cmmi
66 #url = http://launchpad.net/mydumper/0.2/0.2.3/+download/mydumper-0.2.3.tar.gz
67 #md5sum = 36e6a1c97a9634a6882ddaac5e2697d5
68 #strip-top-level-dir = true
69 #location = ${buildout:parts-directory}/${:_buildout_section_name_}
70 #configure-command =
71 #    ${cmake:location}/bin/cmake \
72 #    -DCMAKE_INSTALL_PREFIX=${:location} \
73 #    -DMYSQL_CONFIG=${mariadb:location}/bin/mysql_config \
74 #    -DCMAKE_INCLUDE_PATH=${zlib:location}/include \
75 #    -DCMAKE_LIBRARY_PATH=${zlib:location}/lib \
76 #    .
77 #environment=
78 #    PATH=$PATH:${buildout:bin-directory}
79 #    PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/