Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- INSTALL_PATH=~/ubin
- WORK_PATH=/media/ramdisk
- GIT_URL=git://git.videolan.org/x264.git
- typeset -i CORES=$(grep -m 1 "cpu cores" /proc/cpuinfo | awk '{print $4}')+1
- function ERROR()
- {
- echo -e "\n\033[0;31m"$1"\n\033[0m"
- if [ -d $WORK_PATH/x264 ]; then rm -rf $WORK_PATH/x264; fi
- exit 1
- }
- echo -e "\n\033[0;32mGrabbing source...\033[0m"
- if git clone $GIT_URL $WORK_PATH/x264; then
- cd $WORK_PATH/x264
- echo -e "\n\033[0;32mConfiguring source and building binary...\033[0m"
- ./configure --disable-avs --disable-swscale --disable-lavf --disable-ffms --disable-gpac --disable-lsmash --enable-strip --bit-depth=all > /dev/null
- if make -s -j$CORES; then
- echo -e "\n\033[0;32mCompressing and moving binary to "$INSTALL_PATH"...\033[0m"
- if [ -f "$INSTALL_PATH/x264" ]; then mv $INSTALL_PATH/x264 $INSTALL_PATH/x264~; fi
- upx --lzma --ultra-brute x264 -o $INSTALL_PATH/x264
- fi
- echo -e "\n\033[0;32mDone - binary copied to "$INSTALL_PATH". Cleaning up...\033[0m"
- cd ..
- rm -rf $WORK_PATH/x264
- else
- ERROR "Unable to obtain source. Try again later!"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement