Skip to content

Commit

Permalink
new travis
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcoding committed Nov 18, 2018
1 parent 9f8de02 commit a18c9aa
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
64 changes: 64 additions & 0 deletions .ci/tarantool.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
class Tarantool < Formula
desc "In-memory database and Lua application server"
homepage "https://tarantool.org/"
url "https://download.tarantool.org/tarantool/1.10/src/tarantool-1.10.2.1.tar.gz"
sha256 "2d077978a65e785349883ef3c98c46d35af26bcc10dae58eabfca27cfbcc6c6b"
head "https://github.com/tarantool/tarantool.git", :branch => "2.1", :shallow => false

bottle do
sha256 "9c881185602894a1c795bac55e714bfe4971e035aa03f1cf4ae0ae1592640c87" => :mojave
sha256 "d893c055938419f3d60319a8abd815a151459520ee2283fc5b3fe437a7538c53" => :high_sierra
sha256 "b4ddd59d9478c553c2bff11bcb0cbc0d52ab05560d1a7fd3a0b69c02386da2e5" => :sierra
end

depends_on "cmake" => :build
depends_on "icu4c"
depends_on "openssl"
depends_on "readline"

def install
sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path

# Necessary for luajit to build on macOS Mojave (see luajit formula)
ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version

args = std_cmake_args
args << "-DCMAKE_INSTALL_MANDIR=#{doc}"
args << "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}"
args << "-DCMAKE_INSTALL_LOCALSTATEDIR=#{var}"
args << "-DENABLE_DIST=ON"
args << "-DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix}"
args << "-DREADLINE_ROOT=#{Formula["readline"].opt_prefix}"
args << "-DCURL_INCLUDE_DIR=#{sdk}/usr/include"
args << "-DCURL_LIBRARY=/usr/lib/libcurl.dylib"

system "cmake", ".", *args
system "make"
system "make", "install"
end

def post_install
local_user = ENV["USER"]
inreplace etc/"default/tarantool", /(username\s*=).*/, "\\1 '#{local_user}'"

(var/"lib/tarantool").mkpath
(var/"log/tarantool").mkpath
(var/"run/tarantool").mkpath
end

test do
(testpath/"test.lua").write <<~EOS
box.cfg{}
local s = box.schema.create_space("test")
s:create_index("primary")
local tup = {1, 2, 3, 4}
s:insert(tup)
local ret = s:get(tup[1])
if (ret[3] ~= tup[3]) then
os.exit(-1)
end
os.exit(0)
EOS
system bin/"tarantool", "#{testpath}/test.lua"
end
end
4 changes: 2 additions & 2 deletions .ci/travis-before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew update
if [[ "${TARANTOOL_VERSION}" == "2_x" ]]; then
brew install tarantool --HEAD
brew install .ci/tarantool.rb --HEAD
else
brew install tarantool
brew install .ci/tarantool.rb
fi
fi
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ jobs:
env:
- CIBW_BUILD="cp35-* cp36-* cp37-*"

before_install:
- if [ "${TRAVIS_TAG:-}" = "" ]; then exit 0; fi
- echo "TRAVIS_BUILD_NUMBER=${TRAVIS_BUILD_NUMBER}"

install:
- pip3 install --upgrade cibuildwheel
- touch .cibuildwheel
Expand All @@ -166,6 +170,10 @@ jobs:
env:
- CIBW_BUILD="cp35-* cp36-* cp37-*"

before_install:
- if [ "${TRAVIS_TAG:-}" = "" ]; then exit 0; fi
- echo "TRAVIS_BUILD_NUMBER=${TRAVIS_BUILD_NUMBER}"

install:
- brew update
- brew upgrade python
Expand All @@ -190,6 +198,7 @@ jobs:

before_install:
- if [ "${TRAVIS_TAG:-}" = "" ]; then exit 0; fi
- echo "TRAVIS_BUILD_NUMBER=${TRAVIS_BUILD_NUMBER}"

install:
- mkdir -p wheelhouse
Expand Down

0 comments on commit a18c9aa

Please sign in to comment.