Skip to content

Commit

Permalink
(#18417) libjpeg-turbo: add version 3.0.0
Browse files Browse the repository at this point in the history
* libjpeg-turbo: add version 3.0.0

* simplify version comparison

* libjpeg-turbo: remove older versions

per https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/sources_and_patches.md#removing-old-versions
  • Loading branch information
mayeut authored Aug 3, 2023
1 parent e72d332 commit 243374c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 37 deletions.
21 changes: 3 additions & 18 deletions recipes/libjpeg-turbo/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
sources:
"3.0.0":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/3.0.0/libjpeg-turbo-3.0.0.tar.gz"
sha256: "c77c65fcce3d33417b2e90432e7a0eb05f59a7fff884022a9d931775d583bfaa"
"2.1.5":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.5/libjpeg-turbo-2.1.5.tar.gz"
sha256: "bc12bc9dce55300c6bf4342bc233bcc26bd38bf289eedf147360d731c668ddaf"
"2.1.4":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.4/libjpeg-turbo-2.1.4.tar.gz"
sha256: "d3ed26a1131a13686dfca4935e520eb7c90ae76fbc45d98bb50a8dc86230342b"
"2.1.3":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.3/libjpeg-turbo-2.1.3.tar.gz"
sha256: "467b310903832b033fe56cd37720d1b73a6a3bd0171dbf6ff0b620385f4f76d0"
"2.1.2":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.2/libjpeg-turbo-2.1.2.tar.gz"
sha256: "09b96cb8cbff9ea556a9c2d173485fd19488844d55276ed4f42240e1e2073ce5"
"2.1.1":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.1/libjpeg-turbo-2.1.1.tar.gz"
sha256: "b76aaedefb71ba882cbad4e9275b30c2ae493e3195be0a099425b5c6b99bd510"
"2.1.0":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.1.0/libjpeg-turbo-2.1.0.tar.gz"
sha256: "bef89803e506f27715c5627b1e3219c95b80fc31465d4452de2a909d382e4444"
"2.0.6":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.0.6/libjpeg-turbo-2.0.6.tar.gz"
sha256: "d74b92ac33b0e3657123ddcf6728788c90dc84dcb6a52013d758af3c4af481bb"
"2.0.5":
url: "https://sourceforge.net/projects/libjpeg-turbo/files/2.0.5/libjpeg-turbo-2.0.5.tar.gz"
sha256: "16f8f6f2715b3a38ab562a84357c793dd56ae9899ce130563c72cd93d8357b5d"
18 changes: 11 additions & 7 deletions recipes/libjpeg-turbo/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,32 @@ class LibjpegTurboConan(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
if Version(self.version) >= "3.0.0":
del self.options.enable12bit
del self.options.mem_src_dst

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")

if self.options.enable12bit:
if self.options.get_safe("enable12bit"):
del self.options.java
del self.options.turbojpeg
if self.options.enable12bit or self.settings.os == "Emscripten":
if self.options.get_safe("enable12bit") or self.settings.os == "Emscripten":
del self.options.SIMD
if self.options.enable12bit or self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility:
if self.options.get_safe("enable12bit") or self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility:
del self.options.arithmetic_encoder
del self.options.arithmetic_decoder
if self.options.libjpeg8_compatibility:
del self.options.mem_src_dst
self.options.rm_safe("mem_src_dst")

def layout(self):
cmake_layout(self, src_folder="src")

def validate(self):
if self.options.enable12bit and (self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility):
if self.options.get_safe("enable12bit") and (self.options.libjpeg7_compatibility or self.options.libjpeg8_compatibility):
raise ConanInvalidConfiguration("12-bit samples is not allowed with libjpeg v7/v8 API/ABI")
if self.options.get_safe("java") and not self.options.shared:
raise ConanInvalidConfiguration("java wrapper requires shared libjpeg-turbo")
Expand Down Expand Up @@ -107,10 +110,11 @@ def generate(self):
tc.variables["WITH_ARITH_DEC"] = self._is_arithmetic_decoding_enabled
tc.variables["WITH_JPEG7"] = self.options.libjpeg7_compatibility
tc.variables["WITH_JPEG8"] = self.options.libjpeg8_compatibility
tc.variables["WITH_MEM_SRCDST"] = self.options.get_safe("mem_src_dst", False)
tc.variables["WITH_TURBOJPEG"] = self.options.get_safe("turbojpeg", False)
tc.variables["WITH_JAVA"] = self.options.get_safe("java", False)
tc.variables["WITH_12BIT"] = self.options.enable12bit
if Version(self.version) < "3.0.0":
tc.variables["WITH_MEM_SRCDST"] = self.options.get_safe("mem_src_dst", False)
tc.variables["WITH_12BIT"] = self.options.enable12bit
if is_msvc(self):
tc.variables["WITH_CRT_DLL"] = True # avoid replacing /MD by /MT in compiler flags
if Version(self.version) <= "2.1.0":
Expand Down
14 changes: 2 additions & 12 deletions recipes/libjpeg-turbo/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
versions:
"2.1.5":
folder: all
"2.1.4":
folder: all
"2.1.3":
folder: all
"2.1.2":
"3.0.0":
folder: all
"2.1.1":
folder: all
"2.1.0":
"2.1.5":
folder: all
"2.0.6":
folder: all
"2.0.5":
folder: all

0 comments on commit 243374c

Please sign in to comment.