Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- TMP_DIR="/media/ramdisk/mpv-build"
- BIN_DIR="/home/pintcat/ubin"
- function CLEAN()
- {
- echo -ne "\n\033[0;32mCleaning up... "
- cd $TMP_DIR/..
- rm -rf $TMP_DIR
- echo -e "done.\033[0m\n"
- }
- function FAIL()
- {
- echo -e "\n\033[0;31mError - something went wrong :(\033[0m"
- CLEAN
- exit 1
- }
- if [ -d "$TMP_DIR" ]; then
- echo -ne "\n\033[0;32mFolder \""$TMP_DIR"\" already exists and it's content will be deleted. Continue (Y/N)? \033[0m"
- read -n 1 YN
- case $YN in
- y|Y)
- rm -rf $TMP_DIR
- echo
- ;;
- n|N)
- echo -e "\n\033[0;32mDone - nothing changed.\033[0m\n"
- exit
- ;;
- esac
- fi
- echo -e "\n\033[0;32mDownloading build scripts...\033[0m\n"
- if git clone https://github.com/mpv-player/mpv-build.git $TMP_DIR; then
- echo -e "\n\033[0;32mDownloading and building components and linking final binary...\033[0m\n"
- echo "--enable-gpl --enable-nonfree --enable-version3 --enable-static" >> ffmpeg_options
- cd $TMP_DIR
- ./use-ffmpeg-release
- ./use-mpv-release
- if ./rebuild -j5; then
- echo -e "\n\033[0;32mCompressing and installing binary to \""$BIN_DIR"\".\033[0m\n"
- if [ -f "$BIN_DIR/mpv~" ]; then rm -f $BIN_DIR/mpv~; fi
- if [ -f "$BIN_DIR/mpv" ]; then mv $BIN_DIR/mpv $BIN_DIR/mpv~; fi
- upx --lzma --ultra-brute mpv/build/mpv -o $BIN_DIR/mpv
- CLEAN
- else
- FAIL
- fi
- else
- FAIL
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement