Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanionut/084c2b44973bb0c300bc7c71f4b83c14 to your computer and use it in GitHub Desktop.
Save ivanionut/084c2b44973bb0c300bc7c71f4b83c14 to your computer and use it in GitHub Desktop.
Install Mozjpeg 4 on debian / Ubuntu
#!/bin/bash
echo ""
echo "---------------------------------"
echo "| AUTO COMPILE MOZJPEG |"
echo "---------------------------------"
echo ""
echo "Apt update"
sudo apt update && apt upgrade && apt remove $(deborphan) && apt autoremove && apt clean
echo "Update"
sudo apt update
echo "-----------------------"
echo "Installing build-essential"
sudo apt install build-essential libboost-all-dev pkg-config -y
echo "-----------------------"
echo "Installing compiler"
sudo apt install autoconf automake libtool nasm make cmake flex -y
echo "-----------------------"
echo "Installing lib tool for image manipulation"
sudo apt install libpng-tools libpng-dev zlib1g-dev -y
echo "-----------------------"
echo "Installing imagemagick"
sudo apt install imagemagick
echo "-----------------------"
echo "Installing optipng and advdef"
sudo apt install optipng advancecomp
echo "-----------------------"
echo "Installing gnu parallel"
sudo apt install parallel
echo "-----------------------"
echo "Cloning mozjpeg packages"
cd /opt
sudo git clone https://github.com/mozilla/mozjpeg.git
cd mozjpeg
echo "-----------------------"
echo "compilling mozjpeg" && cat CMakeLists.txt | grep "set(VERSION"
sudo cmake .
sudo make
sudo rm /usr/bin/cjpeg
sudo ln -s /opt/mozjpeg/cjpeg /usr/bin/
cjpeg -v
# TODO check why it's failing
# make cmake -G"Unix Makefiles" -CFLAGS=-m64 -LDFLAGS=-m64 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment