Skip to content

Instantly share code, notes, and snippets.

@Kelfitas
Last active February 7, 2024 02:47
Show Gist options
  • Save Kelfitas/f3fb99984698ccd79414c6a29e9f4edd to your computer and use it in GitHub Desktop.
Save Kelfitas/f3fb99984698ccd79414c6a29e9f4edd to your computer and use it in GitHub Desktop.
sudo su
apt-get install -y autoconf automake libtool nasm make pkg-config
cd /tmp
wget https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
tar -xvf mozjpeg-3.1-release-source.tar.gz
cd mozjpeg
autoreconf -fiv
mkdir build && cd build
sh ../configure
make install
ln -s /opt/libmozjpeg/bin/jpegtran /usr/local/bin/mozjpeg
@Mimoza
Copy link

Mimoza commented Feb 23, 2020

I know it's obvious but «gcc» or «clang» is mandatory.
In my case, i needed :
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu

Another thing, «/tmp» is sometime mounted with «noexec» option (security reason) so it's better to do that in other directory, otherwise the «configure» step fail.

«make deb» produce an .deb, who can be cleaner to install/uninstall on system.

@kepi
Copy link

kepi commented May 25, 2020

I belive its really bad idea to compile programs under root user. It might be better to minimize sudo commands, i.e.:

sudo apt-get install -y autoconf automake libtool nasm make pkg-config
cd /tmp
wget https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
tar -xvf mozjpeg-3.1-release-source.tar.gz
cd mozjpeg
autoreconf -fiv
mkdir build && cd build
sh ../configure
make
sudo make install
sudo ln -s /opt/mozjpeg/bin/jpegtran /usr/local/bin/mozjpeg

@vikas5914
Copy link

If anyone is looking for V4, please check this:https://gist.github.com/vikas5914/4affccdfa5c3a722808cd465f77866b9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment