[mariarocks-source]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://github.com/MariaDB/server.git
branch = bb-10.2-mariarocks

[mariadb]
url =
path = ${mariarocks-source:location}
patches =
pre-configure =
  ${:clean}
  ${git:location}/bin/git submodule update --init
  sed -i -e '/(rc == -1 || errno == EINTR)/s/||/\&\&/' libmariadb/plugins/pvio/pvio_socket.c
  sed -i -e 's, rocksdblib, rocksdblib "rt",' storage/rocksdb/CMakeLists.txt
post-install +=
  ${:clean}
clean =
  ${git:location}/bin/git clean -Xdf
  ${git:location}/bin/git submodule foreach ${git:location}/bin/git clean -Xdf
  ${git:location}/bin/git -C libmariadb checkout plugins/pvio/pvio_socket.c
  ${git:location}/bin/git checkout storage/rocksdb/CMakeLists.txt
configure-options +=
  -DPLUGIN_DAEMON_EXAMPLE=NO
  -DPLUGIN_EXAMPLE=NO
  -DCMAKE_C_COMPILER=${gcc:location}/bin/gcc
  -DCMAKE_CXX_COMPILER=${gcc:location}/bin/g++
  -DCMAKE_INSTALL_RPATH=${gcc:location}/lib:${gcc:location}/lib64:${:CMAKE_INSTALL_RPATH}
  -DCMAKE_PROGRAM_PATH=${bison:location}/bin
