@@ -0,0 +1,32 @@
1+{ stdenv, fetchurl, file, libpng, nasm }:
2+
3+stdenv.mkDerivation rec {
4+ version = "3.1";
5+ name = "mozjpeg-${version}";
6+
7+ src = fetchurl {
8+ url = "https://github.com/mozilla/mozjpeg/releases/download/v${version}/mozjpeg-${version}-release-source.tar.gz";
9+ sha256 = "07vs0xq9di7bv3y68daig8dvxvjqrn8a5na702gj3nn58a1xivfy";
10+ };
11+
12+ postPatch = ''
13+
14+ sed -i -e "s!/usr/bin/file!${file}/bin/file!g" configure
15+ '';
16+
17+ buildInputs = [ libpng nasm ];
18+
19+ meta = {
20+ description = "Mozilla JPEG Encoder Project";
21+ longDescription = ''
22+ This project's goal is to reduce the size of JPEG files without reducing quality or compatibility with the
23+ vast majority of the world's deployed decoders.
24+
25+ The idea is to reduce transfer times for JPEGs on the Web, thus reducing page load times.
26+ '';
27+ homepage = https://github.com/mozilla/mozjpeg ;
28+ license = stdenv.lib.licenses.bsd3;
29+ maintainers = [ stdenv.lib.maintainers.aristid ];
30+ platforms = stdenv.lib.platforms.all;
31+ };
32+}