[SCM] blender/master: debian/patches/: patchset re-worked against v2.75a

mfv at users.alioth.debian.org mfv at users.alioth.debian.org
Thu Feb 4 22:46:21 UTC 2016


The following commit has been merged in the master branch:
commit 097a51a9c985f8f90aee14fde725030c3e5082e7
Author: Matteo F. Vescovi <mfv at debian.org>
Date:   Sat Jul 18 21:32:41 2015 +0200

    debian/patches/: patchset re-worked against v2.75a
    
    - 0001-blender_thumbnailer.patch refreshed
    - 0002-install_in_usr_share.patch refreshed
    - 0003-filter_docs_to_install.patch dropped
    - #0004 updated and renamed to #0003
    - #0005 renamed to #0004
    - #0006 renamed to #0005
    - #0008 renamed to #0006
    - 0007-look_for_droid_ttf_with_fontconfig.patch improved

diff --git a/debian/patches/0001-blender_thumbnailer.patch b/debian/patches/0001-blender_thumbnailer.patch
index fd8939c..9908aff 100644
--- a/debian/patches/0001-blender_thumbnailer.patch
+++ b/debian/patches/0001-blender_thumbnailer.patch
@@ -1,5 +1,5 @@
 From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Thu, 8 Jan 2015 12:35:02 +0100
+Date: Thu, 9 Jul 2015 22:31:02 +0200
 Subject: blender_thumbnailer
 
 * Add blender.thumbnailer file
@@ -23,7 +23,7 @@ index 0000000..05d4fae
 +Exec=/usr/share/blender/scripts/blender-thumbnailer.py %i %o
 +MimeType=application/x-blender;
 diff --git a/release/bin/blender-thumbnailer.py b/release/bin/blender-thumbnailer.py
-index 779c615..dbcd865 100755
+index d3b31d6..9685d46 100755
 --- a/release/bin/blender-thumbnailer.py
 +++ b/release/bin/blender-thumbnailer.py
 @@ -1,4 +1,4 @@
@@ -33,15 +33,15 @@ index 779c615..dbcd865 100755
  # ##### BEGIN GPL LICENSE BLOCK #####
  #
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index f51b7be..f849f6a 100644
+index 1b2dd21..ef7b0b0 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -484,7 +484,7 @@ if(UNIX AND NOT APPLE)
+@@ -487,7 +487,7 @@ if(UNIX AND NOT APPLE)
  		)
  		install(
  			PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
 -			DESTINATION bin
 +			DESTINATION ${CMAKE_INSTALL_PREFIX}/share/blender/scripts
  		)
- 		install(
- 			FILES ${BLENDER_TEXT_FILES}
+ 		set(BLENDER_TEXT_FILES_DESTINATION share/doc/blender)
+ 	endif()
diff --git a/debian/patches/0002-install_in_usr_share.patch b/debian/patches/0002-install_in_usr_share.patch
index e640b0e..b0e9e6b 100644
--- a/debian/patches/0002-install_in_usr_share.patch
+++ b/debian/patches/0002-install_in_usr_share.patch
@@ -9,10 +9,10 @@ Subject: install_in_usr_share
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index f849f6a..fad5a6e 100644
+index ef7b0b0..19113e3 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -312,8 +312,8 @@ if(WITH_PYTHON)
+@@ -317,8 +317,8 @@ if(WITH_PYTHON)
  	endif()
  
  	install(
diff --git a/debian/patches/0003-filter_docs_to_install.patch b/debian/patches/0003-filter_docs_to_install.patch
deleted file mode 100644
index 2991e8c..0000000
--- a/debian/patches/0003-filter_docs_to_install.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Thu, 8 Jan 2015 12:39:04 +0100
-Subject: filter_docs_to_install
-
-Install only relevant documentation.
----
- source/creator/CMakeLists.txt | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index fad5a6e..c914eac 100644
---- a/source/creator/CMakeLists.txt
-+++ b/source/creator/CMakeLists.txt
-@@ -242,8 +242,6 @@ endif()
- # Post build steps for bundling/packaging.
- 
- set(BLENDER_TEXT_FILES
--	${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
--	${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
- 	${CMAKE_SOURCE_DIR}/release/text/copyright.txt
- 	${CMAKE_SOURCE_DIR}/release/text/readme.html
- 	${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-bfont.ttf.txt
diff --git a/debian/patches/0004-locales_directory_install.patch b/debian/patches/0003-locales_directory_install.patch
similarity index 77%
rename from debian/patches/0004-locales_directory_install.patch
rename to debian/patches/0003-locales_directory_install.patch
index 3915e2a..d80f18b 100644
--- a/debian/patches/0004-locales_directory_install.patch
+++ b/debian/patches/0003-locales_directory_install.patch
@@ -1,5 +1,5 @@
 From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Fri, 3 Apr 2015 09:42:30 +0200
+Date: Fri, 17 Jul 2015 22:10:32 +0200
 Subject: locales_directory_install
 
 Change where locales are installed.
@@ -9,11 +9,12 @@ Contributions by:
 ---
  source/blender/blenfont/intern/blf_lang.c | 10 +++++-----
  source/blender/blenkernel/BKE_appdir.h    |  1 +
+ source/blender/blenkernel/intern/appdir.c |  3 +++
  source/creator/CMakeLists.txt             |  4 ++--
- 3 files changed, 8 insertions(+), 7 deletions(-)
+ 4 files changed, 11 insertions(+), 7 deletions(-)
 
 diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
-index 99e1aa5..4a8b0d6 100644
+index 4683081..121e15d 100644
 --- a/source/blender/blenfont/intern/blf_lang.c
 +++ b/source/blender/blenfont/intern/blf_lang.c
 @@ -82,9 +82,9 @@ static void free_locales(void)
@@ -56,10 +57,10 @@ index 99e1aa5..4a8b0d6 100644
  	else {
  		printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
 diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h
-index 5e42f17..d6838bc 100644
+index 077fe2a..905106d 100644
 --- a/source/blender/blenkernel/BKE_appdir.h
 +++ b/source/blender/blenkernel/BKE_appdir.h
-@@ -62,6 +62,7 @@ enum {
+@@ -67,6 +67,7 @@ enum {
  	BLENDER_SYSTEM_DATAFILES    = 52,
  	BLENDER_SYSTEM_SCRIPTS      = 53,
  	BLENDER_SYSTEM_PYTHON       = 54,
@@ -67,11 +68,25 @@ index 5e42f17..d6838bc 100644
  };
  
  /* for BKE_appdir_folder_id_version only */
+diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
+index b1b32e7..8d89ce8 100644
+--- a/source/blender/blenkernel/intern/appdir.c
++++ b/source/blender/blenkernel/intern/appdir.c
+@@ -399,6 +399,9 @@ const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder)
+ 			if (get_path_system(path, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
+ 			return NULL;
+ 
++		case BLENDER_SYSTEM_LOCALE:
++			BLI_strncpy(path, "/usr/share/locale", FILE_MAX); break;
++
+ 		default:
+ 			BLI_assert(0);
+ 			break;
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index c914eac..2b11015 100644
+index 19113e3..4848d65 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -327,11 +327,11 @@ if(WITH_INTERNATIONAL)
+@@ -334,11 +334,11 @@ if(WITH_INTERNATIONAL)
  	install(
  		DIRECTORY
  			${CMAKE_SOURCE_DIR}/release/datafiles/fonts
diff --git a/debian/patches/0005-update_manpages.patch b/debian/patches/0004-update_manpages.patch
similarity index 88%
rename from debian/patches/0005-update_manpages.patch
rename to debian/patches/0004-update_manpages.patch
index 136d036..c4e4b4d 100644
--- a/debian/patches/0005-update_manpages.patch
+++ b/debian/patches/0004-update_manpages.patch
@@ -1,9 +1,9 @@
 From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Thu, 8 Jan 2015 15:21:01 +0100
+Date: Thu, 9 Jul 2015 22:43:20 +0200
 Subject: update_manpages
 
 * Add blenderplayer manpage.
-* Update blender manpage.
+* Install blenderplayer manpage to appropriate location.
 ---
  doc/manpage/blenderplayer.1   | 131 ++++++++++++++++++++++++++++++++++++++++++
  source/creator/CMakeLists.txt |   5 ++
@@ -12,7 +12,7 @@ Subject: update_manpages
 
 diff --git a/doc/manpage/blenderplayer.1 b/doc/manpage/blenderplayer.1
 new file mode 100644
-index 0000000..d15b0c9
+index 0000000..5435c63
 --- /dev/null
 +++ b/doc/manpage/blenderplayer.1
 @@ -0,0 +1,131 @@
@@ -146,12 +146,12 @@ index 0000000..d15b0c9
 +
 +.br
 +.SH AUTHORS
-+This manpage was written for a Debian GNU/Linux by Kevin Roy <kiniou at gmail.com>.
++This manpage was written for a Debian by Kevin Roy <kiniou at gmail.com>.
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 2b11015..25cf67d 100644
+index 4848d65..fab2491 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -425,6 +425,7 @@ if(UNIX AND NOT APPLE)
+@@ -441,6 +441,7 @@ if(UNIX AND NOT APPLE)
  			FILES
  				${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
  				${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
@@ -159,14 +159,14 @@ index 2b11015..25cf67d 100644
  			DESTINATION "."
  		)
  
-@@ -457,6 +458,10 @@ if(UNIX AND NOT APPLE)
- 					FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
- 					DESTINATION share/man/man1
- 				)
-+				install(
-+					FILES ${CMAKE_SOURCE_DIR}/doc/manpage/blenderplayer.1
-+					DESTINATION share/man/man1
-+				)
- 			endif()
+@@ -463,6 +464,10 @@ if(UNIX AND NOT APPLE)
+ 				FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
+ 				DESTINATION share/man/man1
+ 			)
++			install(
++				FILES ${CMAKE_SOURCE_DIR}/doc/manpage/blenderplayer.1
++				DESTINATION share/man/man1
++			)
  		endif()
  
+ 		# misc files
diff --git a/debian/patches/0006-do_not_use_version_number_in_system_path.patch b/debian/patches/0005-do_not_use_version_number_in_system_path.patch
similarity index 83%
rename from debian/patches/0006-do_not_use_version_number_in_system_path.patch
rename to debian/patches/0005-do_not_use_version_number_in_system_path.patch
index 802e71a..3099439 100644
--- a/debian/patches/0006-do_not_use_version_number_in_system_path.patch
+++ b/debian/patches/0005-do_not_use_version_number_in_system_path.patch
@@ -1,5 +1,5 @@
 From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Thu, 8 Jan 2015 15:34:28 +0100
+Date: Thu, 9 Jul 2015 22:47:24 +0200
 Subject: do_not_use_version_number_in_system_path
 
 Global installation expects system path to be
@@ -14,7 +14,7 @@ Contributions by:
  2 files changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.cpp b/intern/ghost/intern/GHOST_SystemPathsX11.cpp
-index e2d9733..ec0e691 100644
+index 5473e40..348b9c3 100644
 --- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp
 +++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp
 @@ -62,6 +62,9 @@ GHOST_SystemPathsX11::~GHOST_SystemPathsX11()
@@ -28,12 +28,12 @@ index e2d9733..ec0e691 100644
  	if (static_path) {
  		static string system_path = string(static_path) + "/blender/" + versionstr;
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 25cf67d..9e8777a 100644
+index fab2491..15c906e 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -265,7 +265,7 @@ if(UNIX AND NOT APPLE)
- 		if(WITH_PYTHON_MODULE)
- 			set(TARGETDIR_VER ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${BLENDER_VERSION})
+@@ -272,7 +272,7 @@ if(UNIX AND NOT APPLE)
+ 		if(WITH_INSTALL_PORTABLE)
+ 			set(TARGETDIR_VER ${BLENDER_VERSION})
  		else()
 -			set(TARGETDIR_VER share/blender/${BLENDER_VERSION})
 +			set(TARGETDIR_VER share/blender)
diff --git a/debian/patches/0008-blender_desktop.patch b/debian/patches/0006-blender_desktop.patch
similarity index 100%
rename from debian/patches/0008-blender_desktop.patch
rename to debian/patches/0006-blender_desktop.patch
diff --git a/debian/patches/0007-look_for_droid_ttf_with_fontconfig.patch b/debian/patches/0007-look_for_droid_ttf_with_fontconfig.patch
index 3e16710..921e924 100644
--- a/debian/patches/0007-look_for_droid_ttf_with_fontconfig.patch
+++ b/debian/patches/0007-look_for_droid_ttf_with_fontconfig.patch
@@ -1,25 +1,37 @@
 From: "Matteo F. Vescovi" <mfv at debian.org>
-Date: Fri, 3 Apr 2015 09:50:43 +0200
+Date: Sat, 18 Jul 2015 21:30:33 +0200
 Subject: look_for_droid_ttf_with_fontconfig
 
 * Remove bad installation of fonts directory into locales.
 * Avoid using the droid font shipped with upstream source
   and use fontconfig to get it.
 ---
- CMakeLists.txt                                   |  7 ++++
- build_files/cmake/macros.cmake                   |  3 ++
+ CMakeLists.txt                                   | 11 ++++++
+ build_files/cmake/Modules/FindFontconfig.cmake   | 48 ++++++++++++++++++++++++
+ build_files/cmake/macros.cmake                   |  6 +++
  source/blender/blenfont/CMakeLists.txt           |  7 ++++
- source/blender/blenfont/intern/blf_translation.c | 23 +++++++++++++
+ source/blender/blenfont/intern/blf_translation.c | 44 +++++++++++++++++++++-
  source/blender/blenlib/BLI_fileops.h             |  1 +
- source/blender/blenlib/intern/fileops.c          | 44 ++++++++++++++++++++++++
- source/creator/CMakeLists.txt                    |  6 ----
- 7 files changed, 85 insertions(+), 6 deletions(-)
+ source/blender/blenlib/intern/fileops.c          | 43 +++++++++++++++++++++
+ source/creator/CMakeLists.txt                    |  6 ---
+ 8 files changed, 159 insertions(+), 7 deletions(-)
+ create mode 100644 build_files/cmake/Modules/FindFontconfig.cmake
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index b52dd05..08529c5 100644
+index 1f0be6c..0e726c0 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -872,6 +872,13 @@ if(UNIX AND NOT APPLE)
+@@ -192,6 +192,9 @@ option(WITH_BLENDER "Build blender (disable to build only the blender player)" O
+ mark_as_advanced(WITH_BLENDER)
+ 
+ option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
++if(UNIX AND NOT APPLE)
++    option(WITH_FONTCONFIG "Enable Fontconfig (discovering fonts installed on Linux)" OFF)
++endif()
+ 
+ option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
+ option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON) 
+@@ -903,6 +906,13 @@ if(UNIX AND NOT APPLE)
  		endif()
  	endif()
  
@@ -33,11 +45,83 @@ index b52dd05..08529c5 100644
  	# Codecs
  	if(WITH_CODEC_SNDFILE)
  		find_package_wrapper(SndFile)
+@@ -2864,6 +2874,7 @@ if(FIRST_RUN)
+ 
+ 	info_cfg_text("Other:")
+ 	info_cfg_option(WITH_OPENNL)
++	info_cfg_option(WITH_FONTCONFIG)
+ 
+ 	# debug
+ 	message(STATUS "HAVE_STDBOOL_H = ${HAVE_STDBOOL_H}")
+diff --git a/build_files/cmake/Modules/FindFontconfig.cmake b/build_files/cmake/Modules/FindFontconfig.cmake
+new file mode 100644
+index 0000000..7dc09f3
+--- /dev/null
++++ b/build_files/cmake/Modules/FindFontconfig.cmake
+@@ -0,0 +1,48 @@
++# Try to find the Fontconfig
++# Once done this will define
++#
++#  FONTCONFIG_FOUND - system has Fontconfig
++#  FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers
++#  FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG
++#  FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG
++
++# Copyright (c) 2006,2007 Laurent Montel <montel at kde.org>
++#
++# Redistribution and use is allowed according to the terms of the BSD license.
++# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
++
++if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
++
++  # in cache already
++  set(FONTCONFIG_FOUND TRUE)
++
++else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
++
++  if (NOT WIN32)
++    # use pkg-config to get the directories and then use these values
++    # in the FIND_PATH() and FIND_LIBRARY() calls
++    find_package(PkgConfig)
++    pkg_check_modules(FONTCONFIG fontconfig)
++
++    set(FONTCONFIG_DEFINITIONS ${FONTCONFIG_CFLAGS_OTHER})
++  endif (NOT WIN32)
++
++  find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
++    PATHS
++    ${FONTCONFIG_INCLUDEDIR}
++    ${FONTCONFIG_INCLUDE_DIRS}
++    /usr/X11/include
++  )
++
++  find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
++    PATHS
++    ${FONTCONFIG_LIBDIR}
++    ${FONTCONFIG_LIBRARY_DIRS}
++  )
++
++  include(FindPackageHandleStandardArgs)
++  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
++
++  mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
++
++endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
 diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
-index 33c7644..73e3a86 100644
+index 7de2b25..364c120 100644
 --- a/build_files/cmake/macros.cmake
 +++ b/build_files/cmake/macros.cmake
-@@ -324,6 +324,9 @@ macro(setup_liblinks
+@@ -284,6 +284,9 @@ macro(SETUP_LIBDIRS)
+ 	if(WITH_MEM_JEMALLOC)
+ 		link_directories(${JEMALLOC_LIBPATH})
+ 	endif()
++	if(WITH_FONTCONFIG)
++		link_directories(${FONTCONFIG_LIBPATH})
++	endif()
+ 
+ 	if(WIN32 AND NOT UNIX)
+ 		link_directories(${PTHREADS_LIBPATH})
+@@ -327,6 +330,9 @@ macro(setup_liblinks
  	if(WITH_SYSTEM_GLEW)
  		target_link_libraries(${target} ${BLENDER_GLEW_LIBRARIES})
  	endif()
@@ -48,7 +132,7 @@ index 33c7644..73e3a86 100644
  		target_link_libraries(${target} ${BULLET_LIBRARIES})
  	endif()
 diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt
-index 392a9ed..deb1f3c 100644
+index 059e2ca..b744a8a 100644
 --- a/source/blender/blenfont/CMakeLists.txt
 +++ b/source/blender/blenfont/CMakeLists.txt
 @@ -66,6 +66,13 @@ if(WITH_INTERNATIONAL)
@@ -62,14 +146,14 @@ index 392a9ed..deb1f3c 100644
 +	add_definitions(-DWITH_FONTCONFIG)
 +endif()
 +
- add_definitions(${GL_DEFINITIONS})
- 
- blender_add_lib(bf_blenfont "${SRC}" "${INC}" "${INC_SYS}")
+ if(WITH_PYTHON)
+ 	add_definitions(-DWITH_PYTHON)
+ 	list(APPEND INC
 diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
-index 2a4a152..7fd4b5c 100644
+index 5d828d9..602af66 100644
 --- a/source/blender/blenfont/intern/blf_translation.c
 +++ b/source/blender/blenfont/intern/blf_translation.c
-@@ -52,7 +52,11 @@
+@@ -54,10 +54,14 @@
  
  #include "boost_locale_wrapper.h"
  
@@ -77,115 +161,151 @@ index 2a4a152..7fd4b5c 100644
 +#include <fontconfig/fontconfig.h>
 +#else
  static const char unifont_filename[] = "droidsans.ttf.gz";
++static const char unifont_mono_filename[] = "bmonofont-i18n.ttf.gz";
 +#endif
  static unsigned char *unifont_ttf = NULL;
  static int unifont_size = 0;
- static const char unifont_mono_filename[] = "bmonofont-i18n.ttf.gz";
-@@ -64,6 +68,24 @@ unsigned char *BLF_get_unifont(int *r_unifont_size)
+-static const char unifont_mono_filename[] = "bmonofont-i18n.ttf.gz";
+ static unsigned char *unifont_mono_ttf = NULL;
+ static int unifont_mono_size = 0;
+ #endif  /* WITH_INTERNATIONAL */
+@@ -66,6 +70,24 @@ unsigned char *BLF_get_unifont(int *r_unifont_size)
  {
  #ifdef WITH_INTERNATIONAL
  	if (unifont_ttf == NULL) {
 +#ifdef WITH_FONTCONFIG
 +		FcFontSet *fontset = NULL;
 +		FcValue v;
-+		FcPattern *pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Droid Sans",FC_STYLE, FcTypeString, "Regular", (char *) 0);
++		FcPattern *pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Droid Sans", FC_STYLE, FcTypeString, "Regular", (char *) 0);
 +		fontset = FcFontList(0,pattern,0);
 +		if (fontset->nfont > 0) {
-+			//get the file of the first font in the fontset that match pattern
++			// Get the file of the first font in the fontset that match pattern
 +			FcPatternGet(fontset->fonts[0], FC_FILE, 0, &v);
-+			//load the file stored in the union of FcValue into memory
++			// Load the file stored in the union of FcValue into memory
 +			unifont_ttf = (unsigned char*)BLI_file_to_mem(
 +				(const char *)v.u.s,
 +				&unifont_size
 +			);
 +		}
 +		else {
-+			printf("%s: 'Droid Sans Regular' font not found with fontconfig\n",__func__);
++			printf("%s: 'Droid Sans Regular' font not found with fontconfig\n", __func__);
 +		}
 +#else
  		const char * const fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts");
  		if (fontpath) {
  			char unifont_path[1024];
-@@ -74,6 +96,7 @@ unsigned char *BLF_get_unifont(int *r_unifont_size)
- 		}
+@@ -77,6 +99,7 @@ unsigned char *BLF_get_unifont(int *r_unifont_size)
  		else {
  			printf("%s: 'fonts' data path not found for international font, continuing\n", __func__);
+ 		}
 +#endif
+ 	}
+ 
+ 	*r_unifont_size = unifont_size;
+@@ -101,6 +124,24 @@ unsigned char *BLF_get_unifont_mono(int *r_unifont_size)
+ {
+ #ifdef WITH_INTERNATIONAL
+ 	if (unifont_mono_ttf == NULL) {
++#ifdef WITH_FONTCONFIG
++		FcFontSet *fontset = NULL;
++		FcValue v;
++		FcPattern *pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Droid Sans Mono", FC_STYLE, FcTypeString, "Regular", (char *) 0);
++		fontset = FcFontList(0,pattern,0);
++		if (fontset->nfont > 0) {
++			// Get the file of the first font in the fontset that match pattern
++			FcPatternGet(fontset->fonts[0], FC_FILE, 0, &v);
++			// Load the file stored in the union of FcValue into memory
++			unifont_mono_ttf = (unsigned char*)BLI_file_to_mem(
++				(const char *)v.u.s,
++				&unifont_mono_size
++			);
++		}
++		else {
++			printf("%s: 'Droid Sans Mono' font not found with fontconfig\n", __func__);
++		}
++#else
+ 		const char *fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts");
+ 		if (fontpath) {
+ 			char unifont_path[1024];
+@@ -112,6 +153,7 @@ unsigned char *BLF_get_unifont_mono(int *r_unifont_size)
+ 		else {
+ 			printf("%s: 'fonts' data path not found for international monospace font, continuing\n", __func__);
  		}
++#endif
  	}
  
+ 	*r_unifont_size = unifont_mono_size;
 diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
-index 7898a54..7db1d2e 100644
+index 01aa5d3..644991b 100644
 --- a/source/blender/blenlib/BLI_fileops.h
 +++ b/source/blender/blenlib/BLI_fileops.h
-@@ -89,6 +89,7 @@ bool   BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+@@ -88,6 +88,7 @@ bool   BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
  void   BLI_dir_create_recursive(const char *dir) ATTR_NONNULL();
  double BLI_dir_free_space(const char *dir) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
  char  *BLI_current_working_dir(char *dir, const size_t maxlen) ATTR_NONNULL();
-+char  *BLI_file_to_mem(const char *from_file, int *size_r);
++char  *BLI_file_to_mem(const char *from_file, int *size_r) ATTR_NONNULL();
  
  /* Filelist */
  
 diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
-index d6fe5e5..52e2c33 100644
+index d6fe5e5..beb01da 100644
 --- a/source/blender/blenlib/intern/fileops.c
 +++ b/source/blender/blenlib/intern/fileops.c
-@@ -159,6 +159,50 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size)
+@@ -159,6 +159,49 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size)
  	return mem;
  }
  
-+/* read the file in from_file and write it to memory to_mem, at most size bytes.
-+   return the file size
-+  */
++/* Read the file in from_file and write it to memory to_mem,
++   at most size bytes. Return the file size.
++*/
 +char *BLI_file_to_mem(const char *from_file, int *size_r) {
 +
 +    FILE * file;
-+    int readsize, size, alloc_size=0;
-+    char *mem= NULL;
-+    const int chunk_size= 512*1024;
++    int readsize, size, alloc_size = 0;
++    char *mem = NULL;
++    const int chunk_size = 512*1024;
 +
 +    size= 0;
 +
-+    file = fopen( from_file, "rb" );
++    file = fopen(from_file, "rb");
 +
 +    for(;;) {
-+        if(mem==NULL) {
-+            mem= MEM_callocN(chunk_size, "BLI_file_to_mem");
-+            alloc_size= chunk_size;
++        if(mem == NULL) {
++            mem = MEM_callocN(chunk_size, "BLI_file_to_mem");
++            alloc_size = chunk_size;
 +        } else {
-+            mem= MEM_reallocN(mem, size+chunk_size);
-+            alloc_size+= chunk_size;
++            mem = MEM_reallocN(mem, size+chunk_size);
++            alloc_size += chunk_size;
 +        }
 +
-+        readsize= fread(mem+size, 1, chunk_size, file);
-+        if(readsize>0) {
-+            size+= readsize;
++        readsize = fread(mem+size, 1, chunk_size, file);
++        if(readsize > 0) {
++            size += readsize;
 +        }
 +        else break;
 +    }
 +
-+    if(size==0) {
++    if(size == 0) {
 +        MEM_freeN(mem);
-+        mem= NULL;
++        mem = NULL;
 +    }
-+    else if(alloc_size!=size)
-+        mem= MEM_reallocN(mem, size);
++    else if(alloc_size != size)
++        mem = MEM_reallocN(mem, size);
 +
 +    fclose(file);
-+    *size_r= size;
++    *size_r = size;
 +
 +    return mem;
-+
 +}
 +
  /**
   * Returns true if the file with the specified name can be written.
   * This implementation uses access(2), which makes the check according
 diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 9e8777a..2279826 100644
+index 15c906e..444d39c 100644
 --- a/source/creator/CMakeLists.txt
 +++ b/source/creator/CMakeLists.txt
-@@ -324,12 +324,6 @@ endif()
+@@ -331,12 +331,6 @@ endif()
  
  # localization
  if(WITH_INTERNATIONAL)
diff --git a/debian/patches/series b/debian/patches/series
index bddec51..6cc6086 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,8 +1,7 @@
 0001-blender_thumbnailer.patch
 0002-install_in_usr_share.patch
-0003-filter_docs_to_install.patch
-0004-locales_directory_install.patch
-0005-update_manpages.patch
-0006-do_not_use_version_number_in_system_path.patch
+0003-locales_directory_install.patch
+0004-update_manpages.patch
+0005-do_not_use_version_number_in_system_path.patch
+0006-blender_desktop.patch
 0007-look_for_droid_ttf_with_fontconfig.patch
-0008-blender_desktop.patch

-- 
blender packaging



More information about the pkg-multimedia-commits mailing list