buildout.cfg 3.42 KB
Newer Older
1 2 3 4 5
[buildout]

extends =
    ../cmake/buildout.cfg
    ../glib/buildout.cfg
6
    ../libressl/buildout.cfg
7
    ../mariadb/buildout.cfg
8 9
    ../pcre/buildout.cfg
    ../pkgconfig/buildout.cfg
10 11 12 13 14 15 16 17

parts = mydumper

# XXX-Antoine:
# This is really dirty, but it's the only way to install
# mydumper that works
[mydumper]
recipe = slapos.recipe.build
18 19
url = https://launchpad.net/mydumper/0.5/0.5.1/+download/mydumper-0.5.1.tar.gz
md5sum = b4df42dfe23f308ab13eb6ecb73a0d21
20 21 22 23
buildout-bin-dir = ${buildout:bin-directory}
cmake-command = ${cmake:location}/bin/cmake
mysql-config = ${mariadb:location}/bin/mysql_config
mysqllib = ${mariadb:location}/lib
24
path = ${pkgconfig:location}/bin
25 26 27 28
pkg-config-path = ${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/:${libressl:location}/lib/pkgconfig/
libraries = ${zlib:location}/lib/:${glib:location}/lib/:${pcre:location}/lib/:${mariadb:location}/lib/:${libressl:location}/lib/
includes = ${zlib:location}/include/:${glib:location}/include/:${pcre:location}/include/:${mariadb:location}/include:${libressl:location}/include/
cflags = -I${zlib:location}/include/ -I${glib:location}/include/ -I${pcre:location}/include/ -I${mariadb:location}/include -I${libressl:location}/include/
29
mysql-include-dir = ${mariadb:location}/include
30 31 32 33 34 35 36 37 38 39 40 41
mydumper-patches =
   ${:_profile_base_location_}/mydumper-remove-warnings-errors.patch 917fea16b5ddea195cfa33fbd9827f57 -p1
slapos_promise =
    directory:bin
    file:bin/mydumper
    file:bin/myloader
script =
    import os
    url = self.download(self.options['url'], self.options.get('md5sum'))
    extract_dir = self.extract(url)
    workdir = guessworkdir(extract_dir)
    self.applyPatchList(self.options['mydumper-patches'], cwd=workdir)
42
    env['PATH'] = self.options['path'] + ':' + self.options['buildout-bin-dir'] + ':' + env.get('PATH', '')
43 44 45 46 47 48 49 50 51 52
    env['PKG_CONFIG_PATH'] = self.options['pkg-config-path'] + ':' + \
                             env.get('PKG_CONFIG_PATH', '')
    env['CMAKE_INCLUDE_PATH'] = self.options['includes']
    env['CMAKE_LIBRARY_PATH'] = self.options['libraries']
    env['CFLAGS'] = self.options['cflags']
    command_line = [self.options['cmake-command'],
                    '-DCMAKE_INSTALL_PREFIX=%%s' %% self.options['location'],
                    '-DMYSQL_CONFIG=%%s' %% self.options['mysql-config'],
                    '-DCMAKE_C_FLAGS=%%s' %% self.options['cflags'],
                    '-DCMAKE_INSTALL_RPATH=%%s' %% self.options['libraries'],
53 54
                    '-DMYSQL_INCLUDE_DIR=%%s' %% self.options['mysql-include-dir'],
                    '-DBUILD_DOCS=OFF',
55 56 57 58 59
                    '.']
    call(command_line, cwd=workdir, env=env)
    call(['make'], cwd=workdir, env=env)
    call(['make', 'install'], cwd=workdir, env=env)

60
# XXX-Antoine: here's what I did using slapos.recipe.cmmi.
61 62
# and it wasn't working !
#[mydumper]
63
#recipe = slapos.recipe.cmmi
64 65 66 67 68 69 70 71 72 73 74 75 76 77
#url = http://launchpad.net/mydumper/0.2/0.2.3/+download/mydumper-0.2.3.tar.gz
#md5sum = 36e6a1c97a9634a6882ddaac5e2697d5
#strip-top-level-dir = true
#location = ${buildout:parts-directory}/${:_buildout_section_name_}
#configure-command =
#    ${cmake:location}/bin/cmake \
#    -DCMAKE_INSTALL_PREFIX=${:location} \
#    -DMYSQL_CONFIG=${mariadb:location}/bin/mysql_config \
#    -DCMAKE_INCLUDE_PATH=${zlib:location}/include \
#    -DCMAKE_LIBRARY_PATH=${zlib:location}/lib \
#    .
#environment=
#    PATH=$PATH:${buildout:bin-directory}
#    PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/