summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.sh30
-rw-r--r--.travis.yml16
-rw-r--r--Makefile22
3 files changed, 57 insertions, 11 deletions
diff --git a/.travis.sh b/.travis.sh
new file mode 100644
index 0000000..2d0cc78
--- /dev/null
+++ b/.travis.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+MAKEOPTS="-j$(nproc)"
+
+case "$1" in
+ before_install)
+ sudo apt-get update -qq
+ sudo apt-get install -qq git
+
+ git clone --depth 1 git://source.ffmpeg.org/ffmpeg
+ git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
+ ;;
+ install)
+ sudo apt-get install -qq autoconf automake build-essential git imagemagick libjpeg-progs libopus0 libtheora-dev libtool libvpx-dev libx264-dev nodejs optipng pkg-config zlib1g-dev
+
+ cd fdk-aac
+ autoreconf -fiv
+ ./configure --disable-shared
+ make $MAKEOPTS
+ sudo make install
+ cd ..
+
+ cd ffmpeg
+ ./configure --disable-everything --disable-programs --disable-runtime-cpudetect --enable-decoder=mpeg4 --enable-decoder=pcm_s16le --enable-decoder=vorbis --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=wav --enable-encoder=huffyuv --enable-encoder=libfdk_aac --enable-encoder=libopus --enable-encoder=libtheora --enable-encoder=libvpx_vp8 --enable-encoder=libvpx_vp9 --enable-encoder=libx264 --enable-encoder=pcm_s16le --enable-encoder=rawvideo --enable-ffmpeg --enable-filter=aresample --enable-gpl --enable-hardcoded-tables --enable-libfdk_aac --enable-libopus --enable-libtheora --enable-libvpx --enable-libx264 --enable-muxer=ipod --enable-muxer=mp4 --enable-muxer=ogg --enable-muxer=wav --enable-muxer=webm --enable-muxer=yuv4mpegpipe --enable-nonfree --enable-protocol=file
+ make $MAKEOPTS
+ sudo make install
+ cd ..
+ script)
+ exec ./setup.sh "$@"
+esac
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..0cf6c69
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,16 @@
+language: c
+env:
+ - MINIMAL=1
+ - CFLAGS="-O2 -march=native -pipe"
+ - CXXFLAGS="-O2 -march=native -pipe"
+before_install: ./.travis.sh before_install
+install: ./.travis.sh install
+script: ./.travis.sh script
+notifications:
+ email:
+ - alex_y_xu@yahoo.ca
+ irc:
+ channels:
+ - "chat.freenode.net#html5ks"
+ on_success: change
+ on_failure: always
diff --git a/Makefile b/Makefile
index df09c28..55d9c63 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,7 @@ modules:
# === VIDEO ===
VIDEO := $(wildcard $(DUMP)/video/*.mkv)
+Y4M := $(patsubst %.mkv,%.y4m,$(VIDEO))
MP4 := $(patsubst %.mkv,%.mp4,$(VIDEO))
WEBM := $(patsubst %.mkv,%.webm,$(VIDEO))
VP9 := $(patsubst %.mkv,%.vp9.webm,$(VIDEO))
@@ -45,21 +46,21 @@ video: $(CVIDEO)
%.y4m: %.mkv
$(FFMPEG) -i "$<" -c:a copy "$@"
-%.mp4: %.mkv
+%.mp4: %.y4m
$(FFMPEG) -i "$<" -c:v libx264 -preset slower -tune animation -movflags empty_moov -profile:v baseline -c:a libfdk_aac -vbr 1 "$@"
-%.webm: %.mkv
+%.webm: %.y4m
$(FFMPEG) -i "$<" -crf 10 -b:v 1M -c:a copy "$@"
-%.vp9.webm: %.mkv
+%.vp9.webm: %.y4m
$(FFMPEG) -i "$<" -strict -2 -c:v libvpx-vp9 -crf 8 -b:v 1M -c:a libopus -vbr 1 -b:a 64k "$@"
-%.ogv: %.mkv
+%.ogv: %.y4m
$(FFMPEG) -i "$<" -c:v libtheora -qscale:v 10 -c:a copy "$@"
# === AUDIO ===
-AUDIO := $(shell find $(DUMP)/bgm $(DUMP)/sfx -name '*.ogg')
+AUDIO := $(wildcard $(DUMP)/bgm/*.ogg) $(wildcard $(DUMP)/sfx/*.ogg)
OPUS := $(patsubst %.ogg,%.opus,$(AUDIO))
M4A := $(patsubst %.ogg,%.m4a,$(AUDIO))
WAV := $(patsubst %.ogg,%.wav,$(AUDIO))
@@ -135,10 +136,11 @@ JSLIBS := www/js/lib/when/when.js www/js/lib/fastclick/lib/fastclick.js \
www/js/lib/Modernizr/dist/modernizr-build.js www/js/lib/spin.js/spin.js
JSDATA := www/js/play.js www/js/images.js
JS := $(JSLIBS) $(MYJS) $(JSDATA)
+JSOUT := www/js/all.min.js
-js: www/js/all.min.js
+js: $(JSOUT)
-www/js/all.min.js: $(JS) .modules
+$(JSOUT): $(JS) .modules
$(UGLIFYJS) $(JS) -o "$@" --source-map "$@".map --source-map-url ./all.min.js.map -p 2 -m -c drop_debugger=false
# === MISC ===
@@ -150,10 +152,8 @@ jshint: $(MYJS)
jshint $^
space:
- find $(DUMP)/bgm $(DUMP)/sfx $(DUMP)/video \( -name '*.wav' -o -name '*.mkv' \) -delete
$(RM) -r $(DUMP)/font
- $(RM) $(CTC_ANIM_TMP) $(CTC_ANIM_TMP_WEBP)
- $(RM) www/js/all.min.js www/js/all.min.js.map
+ $(RM) $(WAV) $(VIDEO) $(CTC_ANIM_TMP) $(CTC_ANIM_TMP_WEBP) $(JSOUT) $(JSOUT).map
watch:
$(MAKE)
@@ -164,5 +164,5 @@ watch:
# disable default rules, increases `make` speed by 3 seconds
.SUFFIXES:
-.INTERMEDIATE: $(CTC_ANIM_TMP) $(CTC_ANIM_TMP_WEBP)
+.INTERMEDIATE: $(Y4M) $(CTC_ANIM_TMP) $(CTC_ANIM_TMP_WEBP)
.PHONY: modules video audio images js jshint clean space watch