Browse Source

Start with CI

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.0
falkTX 5 years ago
parent
commit
c8c6389391
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 121 additions and 40 deletions
  1. +49
    -0
      .travis.yml
  2. +10
    -0
      .travis/before_install.sh
  3. +18
    -0
      .travis/install.sh
  4. +44
    -40
      build-plugin.sh

+ 49
- 0
.travis.yml View File

@@ -0,0 +1,49 @@
language: cpp

os: linux

dist: bionic

jobs:
include:
# linux native build
- os: linux
compiler: gcc
env:
- TARGET="linux"
- PLUGINS="dpf-plugins"

# linux with macOS cross-compilation
- os: linux
compiler: gcc
env:
- TARGET="macos-old"
- PLUGINS="dpf-plugins"

# linux with win32 cross-compilation
- os: linux
compiler: gcc
env:
- TARGET="win32"
- PLUGINS="dpf-plugins"

# linux with win64 cross-compilation
- os: linux
compiler: gcc
env:
- TARGET="win64"
- PLUGINS="dpf-plugins"

before_install:
- sh ${TRAVIS_BUILD_DIR}/.travis/before_install.sh

install:
- sh ${TRAVIS_BUILD_DIR}/.travis/install.sh

script:
- sh ${TRAVIS_BUILD_DIR}/bootstrap.sh ${TARGET}
- sh ${TRAVIS_BUILD_DIR}/build-plugin.sh ${TARGET} ${PLUGINS}

notifications:
email: true
irc: "ircs://chat.freenode.net:7070/#kxstudio"

+ 10
- 0
.travis/before_install.sh View File

@@ -0,0 +1,10 @@
#!/bin/bash

set -e

sudo add-apt-repository -y ppa:kxstudio-debian/kxstudio
sudo add-apt-repository -y ppa:kxstudio-debian/toolchain

sudo apt-get update -qq
sudo apt-get install kxstudio-repos
sudo apt-get update -qq

+ 18
- 0
.travis/install.sh View File

@@ -0,0 +1,18 @@
#!/bin/bash

set -e

# common
sudo apt-get install -y build-essential curl cmake jq

# for cross-compilation
if [ "${TARGET}" = "macos-old" ]; then
sudo apt-get install -y apple-x86-gcc apple-uni-sdk-10.5

elif [ "${TARGET}" = "win32" ]; then
sudo apt-get install -y mingw-w64 binutils-mingw-w64-i686 g++-mingw-w64-i686

elif [ "${TARGET}" = "win64" ]; then
sudo apt-get install -y mingw-w64 binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64

fi

+ 44
- 40
build-plugin.sh View File

@@ -26,46 +26,50 @@ source setup/versions.sh

# ---------------------------------------------------------------------------------------------------------------------

pfile="${PAWPAW_ROOT}/plugins/${plugin}.json"

if [ ! -e "${pfile}" ]; then
echo "Requested plugin file '${pfile}' does not exist"
exit 2
# TODO: make loop

if true; then
pfile="${PAWPAW_ROOT}/plugins/${plugin}.json"

if [ ! -e "${pfile}" ]; then
echo "Requested plugin file '${pfile}' does not exist"
exit 2
fi

name=$(jq -crM .name ${pfile})
version=$(jq -crM .version ${pfile})
buildtype=$(jq -crM .buildtype ${pfile})
dlbaseurl=$(jq -crM .dlbaseurl ${pfile})

# optional args
buildargs=$(echo -e $(jq -ecrM .buildargs ${pfile} || echo '\n\n') | tail -n 1)
dlext=$(echo -e $(jq -ecrM .dlext ${pfile} || echo '\n\n') | tail -n 1)
dlmethod=$(echo -e $(jq -ecrM .dlmethod ${pfile} || echo '\n\n') | tail -n 1)

download "${name}" "${version}" "${dlbaseurl}" "${dlext}" "${dlmethod}"

# TODO patch_file support?

case ${buildtype} in
"autoconf")
build_autoconf "${name}" "${version}" "${buildargs}"
;;
"conf")
build_conf "${name}" "${version}" "${buildargs}"
;;
"cmake")
build_cmake "${name}" "${version}" "${buildargs}"
;;
"make")
build_make "${name}" "${version}" "${buildargs}"
;;
"meson")
build_meson "${name}" "${version}" "${buildargs}"
;;
"waf")
build_waf "${name}" "${version}" "${buildargs}"
;;
esac
fi

name=$(jq -crM .name ${pfile})
version=$(jq -crM .version ${pfile})
buildtype=$(jq -crM .buildtype ${pfile})
dlbaseurl=$(jq -crM .dlbaseurl ${pfile})

# optional args
buildargs=$(echo -e $(jq -ecrM .buildargs ${pfile} || echo '\n\n') | tail -n 1)
dlext=$(echo -e $(jq -ecrM .dlext ${pfile} || echo '\n\n') | tail -n 1)
dlmethod=$(echo -e $(jq -ecrM .dlmethod ${pfile} || echo '\n\n') | tail -n 1)

download "${name}" "${version}" "${dlbaseurl}" "${dlext}" "${dlmethod}"

# TODO patch_file support?

case ${buildtype} in
"autoconf")
build_autoconf "${name}" "${version}" "${buildargs}"
;;
"conf")
build_conf "${name}" "${version}" "${buildargs}"
;;
"cmake")
build_cmake "${name}" "${version}" "${buildargs}"
;;
"make")
build_make "${name}" "${version}" "${buildargs}"
;;
"meson")
build_meson "${name}" "${version}" "${buildargs}"
;;
"waf")
build_waf "${name}" "${version}" "${buildargs}"
;;
esac

# ---------------------------------------------------------------------------------------------------------------------

Loading…
Cancel
Save