Package Details: mozjpeg 4.0.3-1

Git Clone URL: (read-only, click to copy)
Package Base: mozjpeg
Description: JPEG image codec with accelerated baseline decoding and superior encoding
Upstream URL:
Licenses: BSD
Conflicts: libjpeg, libjpeg-turbo, mozjpeg-git, turbojpeg
Provides: libjpeg, libjpeg-turbo,, turbojpeg
Submitter: afontenot
Maintainer: afontenot
Last Packager: afontenot
Votes: 22
Popularity: 1.59
First Submitted: 2015-08-14 12:26
Last Updated: 2021-02-28 04:05

Required by (886)

Sources (1)

Latest Comments

1 2 Next › Last »

afontenot commented on 2021-05-20 10:48

@juliusk: you can work around this by changing the provides to "libjpeg-turbo=2.1.0" in this PKGBUILD (or whatever the required version is when you read this).

I'm going to have to have a think (and possibly ask on the mailing list) about the best way to go here. The issue is that lib32-libjpeg-turbo is requiring a specific version of libjpeg-turbo. Several problems:

  1. I don't know if lib32-libjpeg-turbo actually needs a very specific version of the libjpeg-turbo library or not.

  2. I don't know if the version of libjpeg-turbo that the latest release of mozjpeg is based on is actually drop in compatible with the specific version of libjpeg-turbo requested. Unfortunately mozjpeg doesn't get updated very often. Promising users that it's compatible by changing the PKGBUILD seems risky.

  3. This is probably a moving target, since any time anything bumps the version requirement for libjpeg-turbo I'd have to update the PKGBUILD. In light of 1 and 2 I don't know that that's advisable.

Quick edit: now that I think about it, it seems like the solution might be removing lib32-libjpeg-turbo and using lib32-mozjpeg instead. That's not my package so I'm not sure why it might not work, but I'll try to have a look at that too.

juliusk commented on 2021-01-15 10:12

The install fails for me:

error: failed to prepare transaction (could not satisfy dependencies)
:: removing libjpeg-turbo breaks dependency 'libjpeg-turbo=2.0.6' required by lib32-libjpeg-turbo

afontenot commented on 2020-11-25 23:19

@eschwartz: thank you as well! I was pretty sure about the libjpeg-turbo dependency being wrong (because it would prevent you from using certain drop-ins), but it looks like that's now been fixed in the mpv package.

afontenot commented on 2020-11-25 23:17

@eworm: thank you for the explanation! I'll fix that right away. I was looking at the mpv PKGBUILD, but I was so honed in on the libjpeg-turbo dependency (which doesn't have an .so) that I didn't realize that was there or could be a problem.

Appreciate the information, and the fix to the mpv PKGBUILD (although my end needs to be fixed too).

eschwartz commented on 2020-11-25 23:17

Please add provides+=( note the .so at the end. This does automatic versioning of the version of shared libraries.

Note it's more or less completely useless for very stable library definitions. But libjpeg-turbo's PKGBUILD provides it for its libjpeg ABI emulation, therefore packages will potentially depend on it.

This is completely separate from the fact that things depending on should depend on it, not on "libjpeg-turbo", since that would prevent the use of the drop-in compatible IJG libjpeg version 8 project... but your package is broken either way.

eworm commented on 2020-11-25 23:09

The mpv package depends on a libjpeg soname. To make it happy with mozjpeg you need to add '' to privides array.

graysky commented on 2020-11-21 12:02

As caltigin mentioned, you are missing some deps.

katt commented on 2020-11-13 22:45

Updated to 4.0.0 and fixed source filename

diff --git a/PKGBUILD b/PKGBUILD
index 952f1ab..762d8d1 100644
@@ -5,41 +5,42 @@
 # Contributor: N30N <>

 pkgdesc="JPEG image codec with accelerated baseline decoding and superior encoding"
 arch=("i686" "x86_64" "armv7h")
+makedepends=("nasm" "cmake")

 provides=("libjpeg=8.1.2" "turbojpeg" "libjpeg-turbo")
 conflicts=("libjpeg" "mozjpeg-git" "turbojpeg" "libjpeg-turbo")

 build() {
-       cd "${srcdir}/${pkgname}-${pkgver}"
-       autoreconf -fiv
-       ./configure --prefix=/usr --with-jpeg8 --mandir=/usr/share/man
-       make
+       cmake -B build -S ${pkgname}-${pkgver} \
+               -DCMAKE_INSTALL_PREFIX=/usr \
+               -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+               -DWITH_JPEG8=ON \
+               -DPNG_SUPPORTED=OFF
+       make -C build

 # much too slow for default, can be enabled if desired
 #check() {
-#      cd "${srcdir}/${pkgname}-${pkgver}"
-#      make test
+#      make test -C build

 package() {
-       cd "${srcdir}/${pkgname}-${pkgver}"
-       make \
+       make -C build \
                DESTDIR="${pkgdir}" \
                docdir="/usr/share/doc/${pkgname}" \
                exampledir="/usr/share/doc/${pkgname}" \

+       cd ${pkgname}-${pkgver}
        install -D "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
        install -m644 jpegint.h "${pkgdir}/usr/include"

graysky commented on 2019-08-15 18:37

Could you add "armv7h" to the arch list? Package builds fine.

In the future, just build with makepkg -sA

afontenot commented on 2019-03-29 04:35

Note that mozjpeg does not yet have a released version based on the latest turbojpeg. Fortunately this doesn't seem to be a problem for most applications. If you have issues with mozjpeg crashing, however, you may need to switch back to turbojpeg and use mozjpeg-opt (not maintained by me) for the time being.