From 3a7cc3ed9d6ed269665e02a52fb66409ae59577c Mon Sep 17 00:00:00 2001 From: vodka2 Date: Fri, 19 Apr 2019 10:41:55 +0700 Subject: [PATCH] Add Travis CI --- .travis.yml | 59 ++++++++++++++++++++ README.md | 2 + appimage/create_appimage.py | 107 ------------------------------------ 3 files changed, 61 insertions(+), 107 deletions(-) create mode 100644 .travis.yml delete mode 100644 appimage/create_appimage.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8d74c65 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,59 @@ +language: cpp +dist: trusty +compiler: gcc +env: + global: + - CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.0-Linux-x86_64.tar.gz" + - COMPILER_EVAL="CC=gcc-8 && CXX=g++-8" +matrix: + include: + - env: + - EXTRA_CMAKE_FLAGS="-DCMAKE_CXX_FLAGS=-m32 -DOPENSSL_ROOT_DIR=/usr/lib/i386-linux-gnu" + - APT_DEPS="g++-multilib libssl-dev:i386 libfuse-dev:i386 libboost-system1.67-dev:i386 libboost-thread1.67-dev:i386 libboost-filesystem1.67-dev:i386 libboost-program-options1.67-dev:i386 zlib1g-dev:i386" + - ARCH_SUFFIX="i686" + - ARCH_SUFFIX2="i386" + - env: + - EXTRA_CMAKE_FLAGS="" + - APT_DEPS="g++ libssl-dev libfuse-dev libboost-system1.67-dev libboost-thread1.67-dev libboost-filesystem1.67-dev libboost-program-options1.67-dev zlib1g-dev" + - ARCH_SUFFIX="x86_64" + - ARCH_SUFFIX2="x86_64" +install: + - sudo add-apt-repository 'deb http://us.archive.ubuntu.com/ubuntu/ xenial main' + - sudo apt-get update + - sudo apt-get install -y --allow-unauthenticated dpkg + - sudo add-apt-repository 'deb http://deb.debian.org/debian/ testing main' + - sudo apt-get update + - sudo apt-get install -o Dpkg::Options::="--force-all" -o APT::Force-LoopBreak=1 -y --allow-unauthenticated ${APT_DEPS} + - DEPS_DIR="${HOME}/deps" + - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} + - | + mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake + export PATH=${DEPS_DIR}/cmake/bin:${PATH} + - cmake --version + - eval "${COMPILER_EVAL}" +before_script: + - cd "${TRAVIS_BUILD_DIR}" && mkdir build && cd build + - cmake .. ${EXTRA_CMAKE_FLAGS} -DENABLE_TESTS=1 -DCMAKE_BUILD_TYPE=Release +script: + - cmake --build . --target AllTests + - ./tests/AllTests + - cmake --build . --target vk_music_fs + - mkdir -p appdir/usr/optional/ ; wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-${ARCH_SUFFIX}.so -O ./appdir/usr/optional/exec.so + - mkdir -p appdir/usr/optional/libstdc++/ ; cp /usr/lib/${ARCH_SUFFIX2}-linux-gnu/libstdc++.so.6 ./appdir/usr/optional/libstdc++/ + - ( cd appdir ; rm AppRun ; wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-${ARCH_SUFFIX} -O AppRun ; chmod a+x AppRun) + - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + - chmod a+x linuxdeploy-x86_64.AppImage + - OUTPUT="vk_music_fs-$ARCH_SUFFIX2.AppImage" ./linuxdeploy-x86_64.AppImage --appimage-extract-and-run -e vk_music_fs --appdir appdir -e vk_music_fs -i ../appimage/vk_music_fs-icon.svg -d ../appimage/vk_music_fs.desktop --output appimage +git: + submodules: true + depth: 1 +deploy: + file_glob: true + provider: releases + api_key: + secure: "eu9/Jq3thwP0Un5xdYPyz17/mkpPY4ol/CKdyDtqaWjIbVn4bqkoXOTwdDhQ6fEHR+qpm+jaVXZI7IRmnsXvNqr2KO6XHp7mSHQImuwpHwDmUE7dnlXhuGc/q+Uxq3B7YHnH11piZT3KTwT32xkyd1hBCo8FbfOpUv2oVmm0fwif5xljmPnSY/ZKBJxgDbNQK1OxIjYit8fwc7+9kCfSQjK97cjCUZBXC6zztI/vdd+0HHD8b7oQq6VXWT+rwsRMSMHRtfGZQPQsKfVh19MThNW6NxJaX7N8UCV9+54SvZG8qhNUnpQo5NriOR9Ku+2rxqCRtBut/yiijSKJrxf84iD2B0PHz0hOFhJZ+5AVAFywJxcHhw+VEIdeW/9Un8wxE4RPkAV0YPWWxdWTHtxUuQpF9O33zn/5Tl3IBexF6GbcNYeYJdUc0f0o5u17w9HujokygXh6tdeOFy6IEDhi+8ESN5sLQcgqwtVKrV8YbNP7eGSf6KZiga2XVK5euSaRyJgoPdZOJx5eSF5C+YSuWjgoF+gizASE/0eB4UrG2UpDbNg/+QKvEAyKPzXqzjBW4HISZUc8clgklFNGDbyYeTEuK7iq6hTO0PBpqKiwbWb+le6/fwkMjbExhZ2lETm0dw0vgotbiTxw+JC+RehWvuxjAUyRjkCrrgN30+eFi0c=" + file: "vk_music_fs*.AppImage*" + skip_cleanup: true + overwrite: true + on: + tags: true diff --git a/README.md b/README.md index 4c8049c..59308ee 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # VK Music FS +[![Build Status](https://travis-ci.com/vodka2/vk-music-fs.svg?branch=master)](https://travis-ci.com/vodka2/vk-music-fs) + ![VK Music FS screenshot](https://i.imgur.com/OoiJfaW.gif) FUSE virtual system for VK (Vkontakte) audios. VK account is required. diff --git a/appimage/create_appimage.py b/appimage/create_appimage.py deleted file mode 100644 index 7c8ae8b..0000000 --- a/appimage/create_appimage.py +++ /dev/null @@ -1,107 +0,0 @@ -import os -import shutil -import patoolib -import urllib.request as req -import os.path as path -from string import Template - -archparts = [ - { - 'app': 'x86_64', - 'remoteapp': '_x86_64', - 'pkg': 'amd64', - 'lib': 'x86_64', - 'apprun': 'x86_64' - }, - { - 'app': 'x86', - 'remoteapp': '', - 'pkg': 'i386', - 'lib': 'i386', - 'apprun': 'i686' - } -] - -for part in archparts: - appfile = Template(path.join('app-$app', 'vk_music_fs')).substitute(part) - appfile_remote = \ - Template('https://github.com/vodka2/vk-music-fs/releases/download/1.0/vk_music_fs$remoteapp').substitute(part) - - desktop = 'vk_music_fs.desktop' - icon = 'vk_music_fs-icon.svg' - - rootdir = Template('vk_music_fs-$app').substitute(part) - tmpdir = path.join(rootdir, 'tmp') - appdir = path.join(rootdir, 'vk_music_fs.AppDir') - - packages = map(lambda s: Template(s).substitute(part), [ - 'http://deb.debian.org/debian/pool/main/b/boost1.67/libboost-filesystem1.67.0_1.67.0-7_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/b/boost1.67/libboost-program-options1.67.0_1.67.0-7_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/b/boost1.67/libboost-system1.67.0_1.67.0-7_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/b/boost1.67/libboost-thread1.67.0_1.67.0-7_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/b/boost1.67/libboost-chrono1.67.0_1.67.0-7_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/b/boost1.67/libboost-atomic1.67.0_1.67.0-7_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/b/boost1.67/libboost-date-time1.67.0_1.67.0-7_$pkg.deb', - - 'http://deb.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.11.dfsg-1_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/g/gcc-8/libstdc++6_8.2.0-7_$pkg.deb', - 'http://deb.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.0h-4_$pkg.deb' - ]) - - deps = map(lambda s: Template(s).substitute(part), [ - 'lib/$lib-linux-gnu/libz.so.1', - 'usr/lib/$lib-linux-gnu/libboost_filesystem.so.1.67.0', - 'usr/lib/$lib-linux-gnu/libboost_thread.so.1.67.0', - 'usr/lib/$lib-linux-gnu/libboost_program_options.so.1.67.0', - 'usr/lib/$lib-linux-gnu/libboost_system.so.1.67.0', - 'usr/lib/$lib-linux-gnu/libboost_chrono.so.1.67.0', - 'usr/lib/$lib-linux-gnu/libboost_date_time.so.1.67.0', - 'usr/lib/$lib-linux-gnu/libboost_atomic.so.1.67.0', - 'usr/lib/$lib-linux-gnu/libssl.so.1.1', - 'usr/lib/$lib-linux-gnu/libcrypto.so.1.1', - ]) - - extradeps = dict(map(lambda o: (Template(o[0]).substitute(part), o[1]), { - 'usr/lib/$lib-linux-gnu/libstdc++.so.6': 'usr/optional/libstdc++/libstdc++.so.6' - }.items())) - - apprun = Template( - 'https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-$apprun' - ).substitute(part) - - os.makedirs(appdir) - os.makedirs(path.join(appdir, 'usr', 'bin')) - os.makedirs(tmpdir) - - if path.exists(appfile): - shutil.copy(appfile, path.join(appdir, 'usr', 'bin')) - else: - req.urlretrieve(appfile_remote, path.join(appdir, 'usr', 'bin', 'vk_music_fs')) - - shutil.copy(desktop, path.join(appdir, desktop)) - shutil.copy(icon, path.join(appdir, icon)) - req.urlretrieve(apprun, path.join(appdir, 'AppRun')) - - for package in packages: - print('Unpacking package ' + package) - fname_dir = path.join(tmpdir, path.basename(package)) - fname = path.join(fname_dir, path.basename(package)) - os.makedirs(fname_dir) - req.urlretrieve(package, fname) - patoolib.extract_archive(fname, outdir=fname_dir) - patoolib.extract_archive(path.join(fname_dir, 'data.tar'), outdir=tmpdir) - - for dep in deps: - print('Copying file ' + dep) - if not path.exists(path.join(appdir, path.dirname(dep))): - os.makedirs(path.join(appdir, path.dirname(dep))) - - shutil.copy(path.join(tmpdir, dep), path.join(appdir, dep), follow_symlinks=True) - - for src, dest in extradeps.items(): - print('Copying file ' + src) - - if not path.exists(path.join(appdir, path.dirname(dest))): - os.makedirs(path.join(appdir, path.dirname(dest))) - - shutil.copy(path.join(tmpdir, src), path.join(appdir, dest), follow_symlinks=True)