Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libpostal in mason #724

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions scripts/libpostal/1.1-alpha/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: generic

matrix:
include:
- os: osx
osx_image: xcode8
compiler: clang
- os: linux
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++-4.8-dev
- pandoc

script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
- nm $(./mason prefix ${MASON_NAME} ${MASON_VERSION})/bin/libpostal | grep "GLIBC" | c++filt || true
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
64 changes: 64 additions & 0 deletions scripts/libpostal/1.1-alpha/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash

MASON_NAME=libpostal
MASON_VERSION=1.1-alpha
MASON_LIB_FILE=bin/libpostal

. ${MASON_DIR}/mason.sh

function mason_load_source {
mason_download \
https://github.com/openvenues/${MASON_NAME}/archive/v${MASON_VERSION}.tar.gz \
b9a4972d0f2fcdc8b24ef91adf4a7749865f4865

mason_extract_tar_gz

export MASON_BUILD_PATH=${MASON_ROOT}/.build/${MASON_NAME}-${MASON_VERSION}
}

function mason_prepare_compile {

# installation instructions from https://github.com/openvenues/libpostal

if [[ $(uname -s) == 'Linux' ]]
then
yum install curl autoconf automake libtool pkgconfig
elif [[ $(uname -s) == 'Darwin' ]]
then
brew install curl autoconf automake libtool pkg-config
fi

}

function mason_compile {
./bootstrap.sh
./configure --datadir=${MASON_ROOT}/libpostal-data/

if [[ ${TRAVIS_OS_NAME:-} ]]; then
make VERBOSE=1 -j4
else
make VERBOSE=1 -j${MASON_CONCURRENCY}
fi

make install

if [[ $(uname -s) == 'Linux' ]]
then
ldconfig
fi

}

function mason_cflags {
:
}

function mason_ldflags {
:
}

function mason_static_libs {
:
}

mason_run "$@"