-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
300 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,48 @@ | ||
sudo: required | ||
|
||
dist: trusty | ||
|
||
language: c | ||
language: generic | ||
|
||
compiler: | ||
- gcc | ||
sudo: required | ||
|
||
services: | ||
- docker | ||
|
||
env: | ||
- TARGET=LINUX VLC_VERSION=2.1 | ||
- TARGET=LINUX VLC_VERSION=2.2 | ||
- TARGET=WINDOWS VLC_VERSION=2.1 | ||
- TARGET=WINDOWS VLC_VERSION=2.2 | ||
|
||
before_script: | ||
- if [ "$TARGET" = "LINUX" ] && [ "$VLC_VERSION" = "2.2" ]; then sudo add-apt-repository ppa:mc3man/trusty-media -y; fi | ||
- sudo apt-get update -qq | ||
- if [ "$TARGET" = "LINUX" ]; then sudo apt-get install vlc pkg-config libvlccore-dev -qq; fi | ||
- if [ "$TARGET" = "WINDOWS" ]; then sudo apt-get install tree -qq; fi | ||
- if [ "$TARGET" = "WINDOWS" ]; then sudo docker build -t vlc-pause-click-plugin-windows-build docker ; fi | ||
matrix: | ||
include: | ||
- os: linux | ||
env: TARGET=Linux VLC_VERSION=2.1 DEBIAN=wheezy-backports | ||
- os: linux | ||
env: TARGET=Linux VLC_VERSION=2.2 DEBIAN=stretch | ||
- os: linux | ||
env: TARGET=Linux VLC_VERSION=3.0 DEBIAN=experimental | ||
- os: linux | ||
env: TARGET=Windows VLC_VERSION=2.1 | ||
- os: linux | ||
env: TARGET=Windows VLC_VERSION=2.2 | ||
- os: linux | ||
env: TARGET=Windows VLC_VERSION=3.0 | ||
- os: osx | ||
env: TARGET=macOS VLC_VERSION=2.1 | ||
language: c | ||
osx_image: xcode7.3 | ||
- os: osx | ||
env: TARGET=macOS VLC_VERSION=2.2 | ||
language: c | ||
osx_image: xcode7.3 | ||
- os: osx | ||
env: TARGET=macOS VLC_VERSION=3.0 | ||
language: c | ||
osx_image: xcode7.3 | ||
|
||
script: | ||
- if [ "$TARGET" = "LINUX" ]; then sudo make install; fi | ||
- if [ "$TARGET" = "WINDOWS" ]; then sudo docker run --rm -v `pwd`:/repo -v `pwd`/build:/build vlc-pause-click-plugin-windows-build $VLC_VERSION i686; fi | ||
- if [ "$TARGET" = "WINDOWS" ]; then sudo docker run --rm -v `pwd`:/repo -v `pwd`/build:/build vlc-pause-click-plugin-windows-build $VLC_VERSION x86_64; fi | ||
- if [ "$TARGET" = "WINDOWS" ]; then tree build -s --si --du; fi | ||
- if [ "$TARGET" = "WINDOWS" ] && [ $(find ./build -name "*.dll" | wc -l) != "2" ]; then false; fi | ||
- ./.travis/script.sh | ||
|
||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: BEBtgDclwqKqi1NWY26Af/5DalWJYFlxV36QMEC6EKajA5tv2GBR0nyjIpzG+wNeuqZitqYQaOG60F/UPD1xjbN1ZXdN4byuSaMKRUseO2H/7r3StMlTL3knVce4giIwaEe7Q05QtiV+3zLTcAxsEmzehQJZZpnYK0KXGqRyC/U= | ||
file: vlc-*-macosx.zip | ||
file_glob: true | ||
skip_cleanup: true | ||
on: | ||
condition: $TARGET == macOS | ||
repo: nurupo/vlc-pause-click-plugin | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
if [ "$TARGET" = "Linux" ]; then | ||
# start a docker container of a specific version of Debian | ||
# different Debian versions have different VLC versions packaged: 2.1, 2.2 and 3.0 | ||
sudo docker run -it -d --name ci -v ${PWD}:/repo debian:$DEBIAN /bin/bash | ||
# runs a command in the started continer | ||
RUN() { | ||
sudo docker exec ci "$@" | ||
} | ||
RUN apt-get update | ||
# for some reason apt is having issues with verifying packages due to old/missing keys? | ||
RUN apt-get install -y gnupg | ||
RUN apt-key update | ||
RUN apt-get install -y -t $DEBIAN build-essential pkg-config libvlccore-dev libvlc-dev | ||
# print the version before testing it as we won't see which version it is if the test fails | ||
RUN pkg-config --modversion libvlc | ||
RUN pkg-config --modversion libvlc | grep "^$VLC_VERSION" | ||
RUN pkg-config --modversion vlc-plugin | ||
RUN pkg-config --modversion vlc-plugin | grep "^$VLC_VERSION" | ||
if [ "$DEBIAN" = "wheezy-backports" ]; then | ||
# gcc on wheezy-backports doesn't support c11 | ||
RUN sed -i 's/gnu11/gnu99/g' /repo/Makefile | ||
fi | ||
RUN make -C /repo install | ||
elif [ "$TARGET" = "Windows" ]; then | ||
sudo apt-get install -y tree | ||
# use our own docker image for testing building of Windows binaries | ||
# makes sure that our docker image is not broken too | ||
sudo docker build -t vlc-pause-click-plugin-windows-build docker | ||
sudo docker run --rm -v `pwd`:/repo -v `pwd`/build:/build vlc-pause-click-plugin-windows-build $VLC_VERSION 32 | ||
sudo docker run --rm -v `pwd`:/repo -v `pwd`/build:/build vlc-pause-click-plugin-windows-build $VLC_VERSION 64 | ||
tree build -s --si --du | ||
# there should be exactly two dlls built, one for 32-bit VLC and another for 64-bit | ||
[ $(find ./build -name "*.dll" | wc -l) = "2" ] || false | ||
elif [ "$TARGET" = "macOS" ]; then | ||
brew update | ||
brew install p7zip | ||
mkdir -p tmp/tmp | ||
cd tmp/tmp | ||
wget https://download.videolan.org/pub/videolan/vlc/$VLC_VERSION.0/macosx/vlc-$VLC_VERSION.0.dmg | ||
# extracting contents of a .dmg file using 7-zip is more of a hack, and while it works 7z exits with an error code we want to supress | ||
7z x "*.dmg" "*/VLC.app/Contents/MacOS" || true | ||
mv */VLC.app/Contents/MacOS/lib .. | ||
mv */VLC.app/Contents/MacOS/include .. | ||
rm -rf ./* | ||
cd .. | ||
rm -rf ./tmp | ||
# in contrast to Windows VLC including a very nice and complete sdk directory, | ||
# macOS VLC doesn't package .pc files, plugin headers and in 2.1.0 libvlc_version.h is not generated off libvlc_version.h.in. | ||
# it just packags libvlc.dylib, libvlccore.dylib and libvlc headers. | ||
# honestly, wtf VLC team, get your game together. | ||
# we grab the missing pieces from the Windows VLC, there shouldn't be anything platform-specific in those so it should work | ||
wget https://download.videolan.org/pub/videolan/vlc/$VLC_VERSION.0/win32/vlc-$VLC_VERSION.0-win32.7z -O vlc-$VLC_VERSION.0-win32.7z | ||
7z x "*.7z" -o* "*/sdk" | ||
mv vlc-$VLC_VERSION.0-win32/*/sdk/include/vlc/libvlc_version.h include/vlc/ | ||
mv vlc-$VLC_VERSION.0-win32/*/sdk/include/vlc/plugins include/vlc/plugins | ||
mv vlc-$VLC_VERSION.0-win32/*/sdk/lib/pkgconfig lib/pkgconfig | ||
rm -rf ./vlc-$VLC_VERSION.0-win32 | ||
# fix paths in .pc files | ||
sed -i "" "s|^prefix=.*|prefix=$PWD|g" lib/pkgconfig/*.pc | ||
export PKG_CONFIG_PATH="${PWD}/lib/pkgconfig" | ||
cd lib | ||
# fix library symlink | ||
ln -sf libvlccore.*.dylib libvlccore.dylib | ||
cd ../.. | ||
make OS=macOS | ||
zip -j vlc-$VLC_VERSION-macosx.zip libpause_click_plugin.dylib | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.