[Bf-blender-cvs] [a1651ddc98e] master: Build: require OpenJPEG 2.x minimum, remove bundled version.

Brecht Van Lommel noreply at git.blender.org
Tue Sep 11 12:47:49 CEST 2018


Commit: a1651ddc98ec760e522ea2ea8169b726661fa2e6
Author: Brecht Van Lommel
Date:   Thu Aug 30 14:20:19 2018 +0200
Branches: master
https://developer.blender.org/rBa1651ddc98ec760e522ea2ea8169b726661fa2e6

Build: require OpenJPEG 2.x minimum, remove bundled version.

* WITH_SYSTEM_OPENJPEG is removed and is now always on, this was already
  the case for macOS and Windows.
* This should not break existing Linx builds. If there is no new enough
  OpenJPEG installed, CMake will no find libopenjp2 and WITH_IMAGE_OPENJPEG
  will be disabled.
* install_deps.sh was updated with new package names, since distributions
  put this version in a new package.

Differential Revision: https://developer.blender.org/D3663

===================================================================

M	CMakeLists.txt
M	build_files/build_environment/install_deps.sh
M	build_files/buildbot/config/blender_linux.cmake
M	build_files/cmake/Modules/FindOpenJPEG.cmake
M	build_files/cmake/macros.cmake
M	build_files/cmake/platform/platform_apple.cmake
M	extern/CMakeLists.txt
D	extern/libopenjpeg/CMakeLists.txt
D	extern/libopenjpeg/README.blender
D	extern/libopenjpeg/bio.c
D	extern/libopenjpeg/bio.h
D	extern/libopenjpeg/cidx_manager.c
D	extern/libopenjpeg/cidx_manager.h
D	extern/libopenjpeg/cio.c
D	extern/libopenjpeg/cio.h
D	extern/libopenjpeg/dwt.c
D	extern/libopenjpeg/dwt.h
D	extern/libopenjpeg/event.c
D	extern/libopenjpeg/event.h
D	extern/libopenjpeg/fix.h
D	extern/libopenjpeg/image.c
D	extern/libopenjpeg/image.h
D	extern/libopenjpeg/indexbox_manager.h
D	extern/libopenjpeg/int.h
D	extern/libopenjpeg/j2k.c
D	extern/libopenjpeg/j2k.h
D	extern/libopenjpeg/j2k_lib.c
D	extern/libopenjpeg/j2k_lib.h
D	extern/libopenjpeg/jp2.c
D	extern/libopenjpeg/jp2.h
D	extern/libopenjpeg/jpt.c
D	extern/libopenjpeg/jpt.h
D	extern/libopenjpeg/license.txt
D	extern/libopenjpeg/mct.c
D	extern/libopenjpeg/mct.h
D	extern/libopenjpeg/mqc.c
D	extern/libopenjpeg/mqc.h
D	extern/libopenjpeg/openjpeg.c
D	extern/libopenjpeg/openjpeg.h
D	extern/libopenjpeg/opj_config.h
D	extern/libopenjpeg/opj_includes.h
D	extern/libopenjpeg/opj_malloc.h
D	extern/libopenjpeg/phix_manager.c
D	extern/libopenjpeg/pi.c
D	extern/libopenjpeg/pi.h
D	extern/libopenjpeg/ppix_manager.c
D	extern/libopenjpeg/raw.c
D	extern/libopenjpeg/raw.h
D	extern/libopenjpeg/t1.c
D	extern/libopenjpeg/t1.h
D	extern/libopenjpeg/t1_luts.h
D	extern/libopenjpeg/t2.c
D	extern/libopenjpeg/t2.h
D	extern/libopenjpeg/tcd.c
D	extern/libopenjpeg/tcd.h
D	extern/libopenjpeg/tgt.c
D	extern/libopenjpeg/tgt.h
D	extern/libopenjpeg/thix_manager.c
D	extern/libopenjpeg/tpix_manager.c
M	intern/cycles/test/CMakeLists.txt
M	source/blender/imbuf/intern/jp2.c

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c9e650b26a0..91a79af8141 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,7 +167,6 @@ option_defaults_init(
 	_init_FFTW3
 	_init_GAMEENGINE
 	_init_OPENSUBDIV
-	_init_SYSTEM_OPENJPG
 )
 
 # customize...
@@ -184,13 +183,11 @@ if(UNIX AND NOT APPLE)
 	set(_init_SDL                            OFF)
 	set(_init_FFTW3                          OFF)
 	set(_init_OPENSUBDIV                     OFF)
-	set(_init_SYSTEM_OPENJPG                 OFF)
 elseif(WIN32)
 	set(_init_JACK                           OFF)
 elseif(APPLE)
 	set(_init_JACK                           OFF)
 	set(_init_OPENSUBDIV                     OFF)
-	set(_init_SYSTEM_OPENJPG                 OFF)
 endif()
 
 
@@ -304,9 +301,6 @@ else()
 endif()
 
 
-# (unix defaults to System OpenJPEG On)
-option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" ${_init_SYSTEM_OPENJPG})
-
 if(UNIX AND NOT APPLE)
 	option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
 endif()
@@ -1019,16 +1013,11 @@ else()
 	unset(_SYSTEM_BIG_ENDIAN)
 endif()
 if(WITH_IMAGE_OPENJPEG)
-	if(WITH_SYSTEM_OPENJPEG)
-		# dealt with above
-		set(OPENJPEG_DEFINES "")
-	else()
-		set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
-		set(OPENJPEG_DEFINES "-DOPJ_STATIC")
-	endif()
 	# Special handling of Windows platform where openjpeg is always static.
 	if(WIN32)
 		set(OPENJPEG_DEFINES "-DOPJ_STATIC")
+	else()
+		set(OPENJPEG_DEFINES "")
 	endif()
 endif()
 
@@ -1751,7 +1740,6 @@ if(FIRST_RUN)
 	info_cfg_option(WITH_MEM_JEMALLOC)
 	info_cfg_option(WITH_MEM_VALGRIND)
 	info_cfg_option(WITH_SYSTEM_GLEW)
-	info_cfg_option(WITH_SYSTEM_OPENJPEG)
 
 	info_cfg_text("Image Formats:")
 	info_cfg_option(WITH_OPENIMAGEIO)
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
index b6b7ba1f743..b47c01d52cb 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -815,7 +815,7 @@ DEPS_COMMON_INFO="\"COMMON DEPENDENCIES:
 Those libraries should be available as packages in all recent distributions (optional ones are [between brackets]):
 
     * Basics of dev environment (cmake, gcc, svn , git, ...).
-    * libjpeg, libpng, libtiff, [libopenjpeg], [libopenal].
+    * libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
     * libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
     * libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
     * libsdl1.2, libglew, [libglewmx].\""
@@ -2631,8 +2631,8 @@ install_DEB() {
   THEORA_USE=true
 
   PRINT ""
-  # New Ubuntu crap (17.04 and more) have no openjpeg lib!
-  OPENJPEG_DEV="libopenjpeg-dev"
+  # We need openjp2, libopenjpeg is an old version
+  OPENJPEG_DEV="libopenjp2-7-dev"
   check_package_DEB $OPENJPEG_DEV
   if [ $? -eq 0 ]; then
     _packages="$_packages $OPENJPEG_DEV"
@@ -3169,7 +3169,7 @@ install_RPM() {
   fi
 
   # These libs should always be available in fedora/suse official repository...
-  OPENJPEG_DEV="openjpeg-devel"
+  OPENJPEG_DEV="openjpeg2-devel"
   VORBIS_DEV="libvorbis-devel"
   OGG_DEV="libogg-devel"
   THEORA_DEV="libtheora-devel"
@@ -3639,7 +3639,7 @@ install_ARCH() {
   fi
 
   # These libs should always be available in arch official repository...
-  OPENJPEG_DEV="openjpeg"
+  OPENJPEG_DEV="openjpeg2"
   VORBIS_DEV="libvorbis"
   OGG_DEV="libogg"
   THEORA_DEV="libtheora"
diff --git a/build_files/buildbot/config/blender_linux.cmake b/build_files/buildbot/config/blender_linux.cmake
index 1c400339dfe..9ba91a9a463 100644
--- a/build_files/buildbot/config/blender_linux.cmake
+++ b/build_files/buildbot/config/blender_linux.cmake
@@ -172,10 +172,6 @@ set(PYTHON_VERSION    3.7 CACHE BOOL "" FORCE)
 
 set(Boost_USE_STATIC_LIBS    ON CACHE BOOL "" FORCE)
 
-# TODO(sergey): Move up to the rest of WITH_SYSTEM and DYNLOAD configuration,
-# once old chroot is officially retired.
-set(WITH_SYSTEM_OPENJPEG     ON CACHE BOOL "" FORCE)
-
 # We need to link OpenCOLLADA against PCRE library. Even though it is not installed
 # on /usr, we do not really care -- all we care is PCRE_FOUND be TRUE and its
 # library pointing to a valid one.
diff --git a/build_files/cmake/Modules/FindOpenJPEG.cmake b/build_files/cmake/Modules/FindOpenJPEG.cmake
index a6c28be6782..20d1994c7ba 100644
--- a/build_files/cmake/Modules/FindOpenJPEG.cmake
+++ b/build_files/cmake/Modules/FindOpenJPEG.cmake
@@ -41,12 +41,10 @@ FIND_PATH(OPENJPEG_INCLUDE_DIR
     ${_openjpeg_SEARCH_DIRS}
   PATH_SUFFIXES
     include
-    include/openjpeg-1.5
 )
 
 FIND_LIBRARY(OPENJPEG_LIBRARY
   NAMES
-    openjpeg
     openjp2
   HINTS
     ${_openjpeg_SEARCH_DIRS}
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 54a41f95819..69a1eb2eb3a 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -448,7 +448,7 @@ function(setup_liblinks
 	if(WITH_IMAGE_OPENEXR)
 		target_link_libraries(${target} ${OPENEXR_LIBRARIES})
 	endif()
-	if(WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_OPENJPEG)
+	if(WITH_IMAGE_OPENJPEG)
 		target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
 	endif()
 	if(WITH_CODEC_FFMPEG)
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 2fc7c2cdd9d..b10a2e175c1 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -166,7 +166,6 @@ endif()
 if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
 	# use openjpeg from libdir that is linked into ffmpeg
 	set(OPENJPEG ${LIBDIR}/openjpeg)
-	set(WITH_SYSTEM_OPENJPEG ON)
 	set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
 	set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
 endif()
diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt
index 2e8589ffd17..5e89ecc1d92 100644
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -67,10 +67,6 @@ if(WITH_GAMEENGINE)
 	add_subdirectory(recastnavigation)
 endif()
 
-if(WITH_IMAGE_OPENJPEG AND (NOT WITH_SYSTEM_OPENJPEG))
-	add_subdirectory(libopenjpeg)
-endif()
-
 if(WITH_LZO AND NOT WITH_SYSTEM_LZO)
 	add_subdirectory(lzo)
 endif()
diff --git a/extern/libopenjpeg/CMakeLists.txt b/extern/libopenjpeg/CMakeLists.txt
deleted file mode 100644
index ad49eee25b6..00000000000
--- a/extern/libopenjpeg/CMakeLists.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-set(INC
-	.
-)
-
-set(INC_SYS
-
-)
-
-add_definitions(${OPENJPEG_DEFINES})
-
-set(SRC
-	bio.c
-	cio.c
-	dwt.c
-	event.c
-	image.c
-	j2k.c
-	j2k_lib.c
-	jp2.c
-	jpt.c
-	mct.c
-	mqc.c
-	openjpeg.c
-	pi.c
-	raw.c
-	t1.c
-	t2.c
-	tcd.c
-	tgt.c
-	cidx_manager.c
-	phix_manager.c
-	ppix_manager.c
-	thix_manager.c
-	tpix_manager.c
-
-	bio.h
-	cio.h
-	dwt.h
-	event.h
-	fix.h
-	image.h
-	int.h
-	j2k.h
-	j2k_lib.h
-	jp2.h
-	jpt.h
-	mct.h
-	mqc.h
-	openjpeg.h
-	opj_includes.h
-	opj_malloc.h
-	pi.h
-	raw.h
-	t1.h
-	t1_luts.h
-	t2.h
-	tcd.h
-	tgt.h
-	cidx_manager.h
-	indexbox_manager.h
-	opj_config.h
-)
-
-blender_add_lib(extern_openjpeg "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/extern/libopenjpeg/README.blender b/extern/libopenjpeg/README.blender
deleted file mode 100644
index 5aa213c7707..00000000000
--- a/extern/libopenjpeg/README.blender
+++ /dev/null
@@ -1,5 +0,0 @@
-Project: OpenJPEG
-URL: http://www.openjpeg.org
-License: BSD 2-Clause
-Upstream version: 1.5.2
-Local modifications:
diff --git a/extern/libopenjpeg/bio.c b/extern/libopenjpeg/bio.c
deleted file mode 100644
index f04f3e503fb..00000000000
--- a/extern/libopenjpeg/bio.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2001-2003, David Janssens
- * Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF T

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list