mirror of
https://github.com/mpv-player/mpv
synced 2024-12-19 05:15:12 +00:00
TOOLS: remove obsolete travisCI-related scripts
This commit is contained in:
parent
d46a31317f
commit
608b430b56
@ -1,139 +0,0 @@
|
||||
#!/usr/bin/ruby
|
||||
|
||||
class TravisDepsBuilder
|
||||
def self.make(name)
|
||||
instance = klass.new(name)
|
||||
instance.fill_data
|
||||
instance.deps
|
||||
instance.build
|
||||
end
|
||||
|
||||
def self.klass
|
||||
Module.const_get([self.name, self.os.capitalize].join)
|
||||
rescue NameError
|
||||
self
|
||||
end
|
||||
|
||||
def self.os
|
||||
ENV['TRAVIS_OS_NAME']
|
||||
end
|
||||
|
||||
attr_reader :name, :url, :action, :os
|
||||
|
||||
def initialize(name)
|
||||
@name, @os = name, self.class.os
|
||||
end
|
||||
|
||||
def fill_data
|
||||
data = build_map.fetch(name)
|
||||
@url, @action = data[:url], data[:action]
|
||||
end
|
||||
|
||||
def build
|
||||
send(action)
|
||||
end
|
||||
|
||||
def deps; end
|
||||
|
||||
private
|
||||
def package_manager_update
|
||||
# yes class variable, you wanna update only once across all instances
|
||||
@@updated ||= false
|
||||
return if @@updated
|
||||
sh({'linux' => 'sudo apt-get update -y', 'osx' => 'brew update'}[os])
|
||||
@@updated = true
|
||||
end
|
||||
|
||||
def package_install(*packages)
|
||||
cmd = {
|
||||
'linux' => 'sudo apt-get install %s -y',
|
||||
'osx' => 'brew install %s'
|
||||
}[os] % [packages.join(" ")]
|
||||
|
||||
sh cmd
|
||||
end
|
||||
|
||||
def git
|
||||
sh "git clone --depth=1 #{url} #{name}"
|
||||
compile name
|
||||
end
|
||||
|
||||
def stable
|
||||
filename = File.basename(url)
|
||||
sh "wget #{url}"
|
||||
sh "tar -xzvf #{filename}"
|
||||
dirname = File.basename(url, ".tar.gz" )
|
||||
compile dirname
|
||||
end
|
||||
|
||||
def package
|
||||
package_install(url)
|
||||
end
|
||||
|
||||
def compile(dirname)
|
||||
sh "cd #{dirname} && #{configure} && make && sudo make install"
|
||||
sh "cd $TRAVIS_BUILD_DIR"
|
||||
end
|
||||
|
||||
def configure
|
||||
"./configure"
|
||||
end
|
||||
|
||||
def sh(command)
|
||||
`#{command}`
|
||||
end
|
||||
end
|
||||
|
||||
class Libav < TravisDepsBuilder
|
||||
def build_map
|
||||
{
|
||||
"libav-git" => {
|
||||
:action => :git,
|
||||
:url => "git://git.libav.org/libav.git"
|
||||
},
|
||||
"ffmpeg-git" => {
|
||||
:action => :git,
|
||||
:url => "https://github.com/FFmpeg/FFmpeg.git"
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def configure
|
||||
[super, "--cc=#{ENV['CC']} --disable-asm"].join(" ")
|
||||
end
|
||||
end
|
||||
|
||||
class LibavOsx < Libav
|
||||
def build_map
|
||||
{
|
||||
"ffmpeg-git" => { :action => :package, :url => 'ffmpeg' },
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
class Libass < TravisDepsBuilder
|
||||
def build_map
|
||||
{
|
||||
"libass-stable" => {
|
||||
:action => :stable,
|
||||
:url => 'https://github.com/libass/libass/releases/download/0.12.1/libass-0.12.1.tar.gz'
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
class Dependencies < TravisDepsBuilder
|
||||
def deps
|
||||
packages = {
|
||||
'linux' => 'pkg-config fontconfig libfribidi-dev yasm libxinerama-dev libxrandr-dev',
|
||||
'osx' => 'pkg-config fontconfig freetype fribidi yasm'
|
||||
}
|
||||
package_manager_update
|
||||
package_install(packages.fetch(os))
|
||||
end
|
||||
end
|
||||
|
||||
Dependencies.new(:deps).deps
|
||||
|
||||
Libass.make(ARGV[0])
|
||||
Libav.make(ARGV[1])
|
@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" != "linux" ] || [ "$CC" != "clang" ]; then
|
||||
# trigger build only on one of the matrix nodes
|
||||
exit;
|
||||
fi
|
||||
|
||||
if [ "x$TRAVIS_BRANCH" != "xmaster" ]; then
|
||||
# only rebuild website with pushes to master
|
||||
exit;
|
||||
fi
|
||||
|
||||
TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE:-HEAD^..}
|
||||
if git diff --quiet --name-only --exit-code "$TRAVIS_COMMIT_RANGE" DOCS/ VERSION; then
|
||||
exit;
|
||||
fi
|
||||
|
||||
body='{
|
||||
"request": {
|
||||
"branch":"master"
|
||||
}}'
|
||||
|
||||
curl -s -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: application/json" \
|
||||
-H "Travis-API-Version: 3" \
|
||||
-H "Authorization: token $WEBSITE_TRAVIS_TOKEN" \
|
||||
-d "$body" \
|
||||
https://api.travis-ci.org/repo/mpv-player%2Fmpv.io/requests
|
Loading…
Reference in New Issue
Block a user