Commit 9e16abb1 authored by Julien Lamy's avatar Julien Lamy
Browse files

New upstream version 0.9.1

parent 78d9019f
Loading
Loading
Loading
Loading

.ci/brew/build

0 → 100755
+19 −0
Original line number Diff line number Diff line
#!/bin/sh

set -ev

export Python=${Python:?}
export WORKSPACE=${WORKSPACE:?}

mkdir build
mkdir install
cd build

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig

cmake \
  -D CMAKE_INSTALL_PREFIX="${WORKSPACE}/install" \
  -D PYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \
  ${CMAKE_OPTIONS} \
  ..
make ${MAKE_OPTIONS} install

.ci/brew/install

0 → 100755
+51 −0
Original line number Diff line number Diff line
#!/usr/bin/env python

from __future__ import print_function

import json
import os
import subprocess
import sys

brew_conflicting = ["json-c"]
brew_required = [
    "boost", "boost-python", "cmake", "cppcheck", "dcmtk", "icu4c", "jsoncpp",
    "lcov", "log4cpp", "pkg-config", "python"+os.environ["Python"]
]

pip_required = ["cpp-coveralls", "nose"]

for formula in brew_conflicting:
    info = json.loads(
        subprocess.check_output(["brew", "info", "--json=v1", formula]))
    if len(info) > 1:
        print("Too many formulas matching {}".format(formula))
        sys.exit(1)
    elif len(info) == 0:
        continue
    installed = (len(info[0]["installed"]) != 0)
    if installed:
        print("Removing conflicting formula: {}".format(formula))
        subprocess.check_call(["brew", "unlink", formula])

for formula in brew_required:
    info = json.loads(
        subprocess.check_output(["brew", "info", "--json=v1", formula]))
    if len(info) > 1:
        print("Too many formulas matching {}".format(formula))
        sys.exit(1)
    elif len(info) == 0:
        print("No formula matching {}".format(formula))
        sys.exit(1)
    
    action = None
    if len(info[0]["installed"]) == 0:
        action = "install"
    elif info[0]["installed"][-1]["version"] != info[0]["versions"]["stable"]:
        action = "upgrade"
    
    if action is not None:
        subprocess.check_call(["brew", action, formula])

subprocess.check_call(
    ["pip"+os.environ["Python"], "install", "--user", "-U"]+pip_required)

.ci/brew/post_build

0 → 100755
+11 −0
Original line number Diff line number Diff line
#!/bin/sh

set -ev

export Python=${Python:?}
export WORKSPACE=${WORKSPACE:?}

cd build

export PYTHONPATH=${WORKSPACE}/install/$(python${Python} -c "from distutils.sysconfig import *; print(get_python_lib(True, prefix=''))")
../tests/run --no-network --nose ~/Library/Python/${Python}*/bin/nosetests

.ci/deb/build

0 → 100755
+43 −0
Original line number Diff line number Diff line
#!/bin/sh

set -ev

export Architecture=${Architecture:?}
export Distribution=${Distribution:?}
export Python=${Python:?}
export WORKSPACE=${WORKSPACE:?}

if [ "${Python}" = "2" ]
then
  PYTHON_VERSION="$(pyversions -dv)"
elif [ "${Python}" = "3" ]
then
  PYTHON_VERSION="$(py3versions -dv)"
else
  PYTHON_VERSION="UNKOWN"
fi

PYTHON_VERSION_NO_DOT=$(echo $PYTHON_VERSION | sed 's|\.||')

if [ "${Distribution}" != "ubuntu/precise" -a "${Distribution}" != "debian/wheezy" ]; then
  TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
else
  TRIPLET=""
fi

BOOST_PYTHON_LIBRARY=/usr/lib/${TRIPLET}/libboost_python-py${PYTHON_VERSION_NO_DOT}.so

cd ${WORKSPACE}

mkdir -p build
mkdir -p install
cd build
cmake \
  -D CMAKE_INSTALL_PREFIX="${WORKSPACE}/install" \
  -D Python_ADDITIONAL_VERSIONS=${PYTHON_VERSION} \
  -D PYTHON_EXECUTABLE=/usr/bin/python${PYTHON_VERSION} \
  -D Boost_PYTHON_LIBRARY_DEBUG=${BOOST_PYTHON_LIBRARY} \
  -D Boost_PYTHON_LIBRARY_RELEASE=${BOOST_PYTHON_LIBRARY} \
  ${CMAKE_OPTIONS} \
  ..
make ${MAKE_OPTIONS} install

.ci/deb/install

0 → 100755
+36 −0
Original line number Diff line number Diff line
#!/bin/sh

set -ev

export Architecture=${Architecture:?}
export Distribution=${Distribution:?}
export Python=${Python:?}
export WORKSPACE=${WORKSPACE:?}

if [ "${Python}" = "2" ]
then
  PYTHON_PREFIX="python"
elif [ "${Python}" = "3" ]
then
  PYTHON_PREFIX="python3"
fi

# Compilation toolchain
PACKAGES="build-essential cmake pkg-config python-minimal"
# Dependencies of main lib
PACKAGES="${PACKAGES} libboost-dev libboost-date-time-dev libboost-filesystem-dev"
PACKAGES="${PACKAGES} libdcmtk2-dev libicu-dev libjsoncpp-dev liblog4cpp5-dev zlib1g-dev"
# Dependencies of Python wrappers
PACKAGES="${PACKAGES} libboost-python-dev ${PYTHON_PREFIX}-dev"
# Dependencies of unit tests
PACKAGES="${PACKAGES} dcmtk libboost-test-dev ${PYTHON_PREFIX}-nose"
# Coverage and static analysis
PACKAGES="${PACKAGES} cppcheck lcov wget"

if [ "${Distribution}" = "ubuntu/precise" ]
then
  PACKAGES="${PACKAGES} libwrap0-dev"
fi

apt-get -y update
apt-get -y install ${PACKAGES}
Loading