diff --git a/.gitignore b/.gitignore index d3a5318..9bbee33 100644 --- a/.gitignore +++ b/.gitignore @@ -41,12 +41,8 @@ /blender-2.78.tar.gz /blender-2.78a.tar.gz /blender-2.78b.tar.gz -/blender-2.78b-amd-gpu-support.patch /blender-2.78c.tar.gz /blender-2.79.tar.gz /blender-2.79a.tar.gz -/util_sseb.patch -/tree_hpp.patch /blender-2.79b.tar.gz /blender-2.80.tar.gz -/blender-2.80-locale.patch diff --git a/0001-Fix-for-GCC9-new-OpenMP-data-sharing.patch b/0001-Fix-for-GCC9-new-OpenMP-data-sharing.patch deleted file mode 100644 index 11dcb75..0000000 --- a/0001-Fix-for-GCC9-new-OpenMP-data-sharing.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 043c52d3d2df6f6d0780acd02a3dd4e25b7ba7f0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= -Date: Wed, 3 Apr 2019 01:36:52 +0200 -Subject: [PATCH] Fix for GCC9 new OpenMP data sharing -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -GCC 9 started implementing the OpenMP 4.0 and later behavior. When not using -default clause or when using default(shared), this makes no difference, but -if using default(none), previously the choice was not specify the const -qualified variables on the construct at all, or specify in firstprivate -clause. In GCC 9 as well as for OpenMP 4.0 compliance, those variables need -to be specified on constructs in which they are used, either in shared or -in firstprivate clause. Specifying them in firstprivate clause is one way to -achieve compatibility with both older GCC versions and GCC 9, -another option is to drop the default(none) clause. - -This patch thus drops the default(none) clause. - -See https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing - -Signed-off-by: Robert-AndrĂ© Mauchin ---- - intern/elbeem/intern/solver_main.cpp | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp -index 68f7c04cd54..514087b6130 100644 ---- a/intern/elbeem/intern/solver_main.cpp -+++ b/intern/elbeem/intern/solver_main.cpp -@@ -381,7 +381,7 @@ LbmFsgrSolver::mainLoop(const int lev) - GRID_REGION_INIT(); - #if PARALLEL==1 - const int gDebugLevel = ::gDebugLevel; --#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ -+#pragma omp parallel num_threads(mNumOMPThreads) \ - reduction(+: \ - calcCurrentMass,calcCurrentVolume, \ - calcCellsFilled,calcCellsEmptied, \ -@@ -1126,7 +1126,7 @@ LbmFsgrSolver::preinitGrids() - GRID_REGION_INIT(); - #if PARALLEL==1 - const int gDebugLevel = ::gDebugLevel; --#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ -+#pragma omp parallel num_threads(mNumOMPThreads) \ - reduction(+: \ - calcCurrentMass,calcCurrentVolume, \ - calcCellsFilled,calcCellsEmptied, \ -@@ -1164,7 +1164,7 @@ LbmFsgrSolver::standingFluidPreinit() - GRID_REGION_INIT(); - #if PARALLEL==1 - const int gDebugLevel = ::gDebugLevel; --#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ -+#pragma omp parallel num_threads(mNumOMPThreads) \ - reduction(+: \ - calcCurrentMass,calcCurrentVolume, \ - calcCellsFilled,calcCellsEmptied, \ --- -2.20.1 - diff --git a/blender-2.79-droid.patch b/blender-2.79-droid.patch deleted file mode 100644 index ec5f101..0000000 --- a/blender-2.79-droid.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -Naur blender-2.79.old/source/blender/blenfont/intern/blf_font_i18n.c blender-2.79/source/blender/blenfont/intern/blf_font_i18n.c ---- blender-2.79.old/source/blender/blenfont/intern/blf_font_i18n.c 2017-09-11 06:34:59.000000000 +0200 -+++ blender-2.79/source/blender/blenfont/intern/blf_font_i18n.c 2017-09-12 14:12:51.239473283 +0200 -@@ -57,7 +57,7 @@ - { - #ifdef WITH_INTERNATIONAL - if (unifont_ttf == NULL) { -- const char * const fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts"); -+ const char * const fontpath = "/usr/share/fonts/blender"; - if (fontpath) { - char unifont_path[1024]; - -@@ -92,7 +92,7 @@ - { - #ifdef WITH_INTERNATIONAL - if (unifont_mono_ttf == NULL) { -- const char *fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts"); -+ const char * const fontpath = "/usr/share/fonts/blender"; - if (fontpath) { - char unifont_path[1024]; - -diff -Naur blender-2.79.old/source/creator/CMakeLists.txt blender-2.79/source/creator/CMakeLists.txt ---- blender-2.79.old/source/creator/CMakeLists.txt 2017-09-12 05:44:18.000000000 +0200 -+++ blender-2.79/source/creator/CMakeLists.txt 2017-09-12 14:12:51.239473283 +0200 -@@ -359,9 +359,8 @@ - # localization - if(WITH_INTERNATIONAL) - install( -- DIRECTORY -- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts -- DESTINATION ${TARGETDIR_VER}/datafiles -+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/fonts/ -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/fonts/blender - ) - - set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale") diff --git a/blender-2.79-locale.patch b/blender-2.79-locale.patch deleted file mode 100644 index a57e9f2..0000000 --- a/blender-2.79-locale.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff -Naur blender-2.79.old/source/blender/blenkernel/BKE_appdir.h blender-2.79/source/blender/blenkernel/BKE_appdir.h ---- blender-2.79.old/source/blender/blenkernel/BKE_appdir.h 2017-09-12 05:44:17.000000000 +0200 -+++ blender-2.79/source/blender/blenkernel/BKE_appdir.h 2017-09-12 14:18:41.069008086 +0200 -@@ -71,6 +71,7 @@ - BLENDER_SYSTEM_DATAFILES = 52, - BLENDER_SYSTEM_SCRIPTS = 53, - BLENDER_SYSTEM_PYTHON = 54, -+ BLENDER_SYSTEM_LOCALE = 55, - }; - - /* for BKE_appdir_folder_id_version only */ -diff -Naur blender-2.79.old/source/blender/blenkernel/intern/appdir.c blender-2.79/source/blender/blenkernel/intern/appdir.c ---- blender-2.79.old/source/blender/blenkernel/intern/appdir.c 2017-09-12 05:44:17.000000000 +0200 -+++ blender-2.79/source/blender/blenkernel/intern/appdir.c 2017-09-12 14:18:41.070008105 +0200 -@@ -421,6 +421,9 @@ - if (get_path_system(path, path_len, "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 -Naur blender-2.79.old/source/blender/blentranslation/intern/blt_lang.c blender-2.79/source/blender/blentranslation/intern/blt_lang.c ---- blender-2.79.old/source/blender/blentranslation/intern/blt_lang.c 2017-09-11 06:34:59.000000000 +0200 -+++ blender-2.79/source/blender/blentranslation/intern/blt_lang.c 2017-09-12 14:18:41.070008105 +0200 -@@ -88,9 +88,9 @@ - num_locales = num_locales_menu = 0; - } - --static void fill_locales(void) -+static void fill_locales(char *locale_path) - { -- const char * const languages_path = BKE_appdir_folder_id(BLENDER_DATAFILES, "locale"); -+ const char * const languages_path = locale_path; - char languages[FILE_MAX]; - LinkNode *lines = NULL, *line; - char *str; -@@ -98,7 +98,7 @@ - - free_locales(); - -- BLI_join_dirfile(languages, FILE_MAX, languages_path, "languages"); -+ BLI_join_dirfile(languages, FILE_MAX, locale_path, "languages"); - line = lines = BLI_file_read_as_lines(languages); - - /* This whole "parsing" code is a bit weak, in that it expects strictly formatted input file... -@@ -198,7 +198,7 @@ - void BLT_lang_init(void) - { - #ifdef WITH_INTERNATIONAL -- const char * const messagepath = BKE_appdir_folder_id(BLENDER_DATAFILES, "locale"); -+ const char * const messagepath = BKE_appdir_folder_id(BLENDER_SYSTEM_LOCALE, NULL); - #endif - - /* Make sure LANG is correct and wouldn't cause std::rumtime_error. */ -@@ -231,7 +231,7 @@ - #ifdef WITH_INTERNATIONAL - if (messagepath) { - bl_locale_init(messagepath, TEXT_DOMAIN_NAME); -- fill_locales(); -+ fill_locales(messagepath); - } - else { - printf("%s: 'locale' data path for translations not found, continuing\n", __func__); -diff -Naur blender-2.79.old/source/creator/CMakeLists.txt blender-2.79/source/creator/CMakeLists.txt ---- blender-2.79.old/source/creator/CMakeLists.txt 2017-09-12 14:18:20.233618882 +0200 -+++ blender-2.79/source/creator/CMakeLists.txt 2017-09-12 14:18:41.070008105 +0200 -@@ -364,7 +364,7 @@ - ) - - set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale") -- set(_locale_target_dir ${TARGETDIR_VER}/datafiles/locale) -+ set(_locale_target_dir ${CMAKE_INSTALL_PREFIX}/share/locale) - - file(GLOB _po_files "${_locale_dir}/po/*.po") - foreach(_po_file ${_po_files}) diff --git a/blender-2.79-manpages.patch b/blender-2.79-manpages.patch deleted file mode 100644 index c180a8e..0000000 --- a/blender-2.79-manpages.patch +++ /dev/null @@ -1,157 +0,0 @@ -diff -Naur blender-2.79.old/doc/manpage/blenderplayer.1 blender-2.79/doc/manpage/blenderplayer.1 ---- blender-2.79.old/doc/manpage/blenderplayer.1 1970-01-01 01:00:00.000000000 +0100 -+++ blender-2.79/doc/manpage/blenderplayer.1 2017-09-12 14:20:26.719981643 +0200 -@@ -0,0 +1,131 @@ -+.TH "BLENDERPLAYER" "1" "October 17, 2011" "Blender 2\&.60 (sub 0)" -+.SH "NAME" -+blenderplayer \- the blender game engine runner -+.SH "SYNOPSIS" -+usage: blenderplayer [\-w [w h l t]] [\-f [fw fh fb ff]] [\-g gamengineoptions] [\-s stereomode] [\-m aasamples] filename.blend -+.SH "DESCRIPTION" -+.B blenderplayer -+is the 3D and physics game engine -+.SH "OPTIONS" -+.PP -+.B -h -+: Prints this command summary -+.PP -+.B -w -+: display in a window -+ optional parameters -+ w = window width -+ h = window height -+ l = window left coordinate -+ t = window top coordinate -+ Note: If w or h is defined, both must be defined. -+ Also, if l or t is defined, all options must be used. -+.PP -+.B -f -+: start game in full screen mode -+ optional parameters -+ fw = full screen mode pixel width -+ fh = full screen mode pixel height -+ fb = full screen mode bits per pixel -+ ff = full screen mode frequency -+ Note: If fw or fh is defined, both must be defined. -+ Also, if fb is used, fw and fh must be used. ff requires all options. -+.PP -+.B -s -+: start player in stereo -+.PP -+ depending on the type of stereo you want: -+.PP -+ stereomode: hwpageflip -+ (Quad buffered shutter glasses) -+.PP -+ syncdoubling -+ (Above Below) -+.PP -+ sidebyside -+ (Left Right) -+.PP -+ anaglyph -+ (Red\-Blue glasses) -+.PP -+ vinterlace -+ (Vertical interlace for autostereo display) -+.PP -+.B -D -+: start player in dome mode -+.PP -+ Optional parameters: -+.PP -+ angle = field of view in degrees -+.PP -+ tilt = tilt angle in degrees -+.PP -+ warpdata = a file to use for warping the image (absolute path) -+.PP -+ mode = fisheye (Fisheye), truncatedfront (Front\-Truncated), -+ truncatedrear (Rear\-Truncated), cubemap(Cube Map), -+ sphericalpanoramic (Spherical Panoramic) -+.PP -+ depending on the type of dome you are using -+.PP -+.B -m -+: maximum anti-aliasing (eg. 2,4,8,16) -+.PP -+.B -i -+: parent windows ID -+.PP -+.B -d -+: turn debugging on -+.PP -+.B -g -+: game engine options -+.RS 4 -+.TP 29 -+Name -+Default Description -+.TP -+--------------------------- -+------------------------------------ -+.TP -+fixedtime -+0 "Enable all frames" -+.TP -+nomipmap -+0 Disable mipmaps -+.TP -+show_framerate -+0 Show the frame rate -+.TP -+show_properties -+0 Show debug properties -+.TP -+show_profile -+0 Show profiling information -+.TP -+blender_material -+0 Enable material settings -+.TP -+ignore_deprecation_warnings -+1 Ignore deprecation warnings -+.RE -+.PP -+.B - -+: all arguments after this are ignored, allowing python to access them from sys.argv -+.SH "EXAMPLES" -+.TP -+.B blenderplayer -w 320 200 10 10 -g noaudio //home//user//filename.blend -+Launch blenderplayer in window mode with size 320x200 at 10 pixels from left and 10 pixels -+from top of the screen without audio. -+.TP -+.B blenderplayer -g show_framerate = 0 //home//user//filename.blend -+Disable framerate reports. -+.TP -+.B blenderplayer -i 232421 -m 16 //home//user//filename.blend -+Launch blenderplayer embedded in an existing window and set antialiasing to 16. -+ -+.SH "SEE ALSO" -+.B blender(1) -+ -+.br -+.SH AUTHORS -+This manpage was written for a Debian by Kevin Roy . -diff -Naur blender-2.79.old/source/creator/CMakeLists.txt blender-2.79/source/creator/CMakeLists.txt ---- blender-2.79.old/source/creator/CMakeLists.txt 2017-09-12 14:20:11.165691089 +0200 -+++ blender-2.79/source/creator/CMakeLists.txt 2017-09-12 14:20:26.719981643 +0200 -@@ -468,6 +468,7 @@ - FILES - ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg -+ ${CMAKE_SOURCE_DIR}/doc/manpage/blenderplayer.1 - DESTINATION "." - ) - -@@ -490,6 +491,10 @@ - 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/blender-2.79-openjpeg2.patch b/blender-2.79-openjpeg2.patch deleted file mode 100644 index f1c1bc1..0000000 --- a/blender-2.79-openjpeg2.patch +++ /dev/null @@ -1,734 +0,0 @@ -diff -rupN blender-2.79/source/blender/imbuf/intern/filetype.c blender-2.79-new/source/blender/imbuf/intern/filetype.c ---- blender-2.79/source/blender/imbuf/intern/filetype.c 2017-09-11 06:34:59.000000000 +0200 -+++ blender-2.79-new/source/blender/imbuf/intern/filetype.c 2018-01-17 23:00:18.267393200 +0100 -@@ -81,7 +81,7 @@ const ImFileType IMB_FILE_TYPES[] = { - {imb_initopenexr, NULL, imb_is_a_openexr, NULL, imb_ftype_default, imb_load_openexr, NULL, imb_save_openexr, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_OPENEXR, COLOR_ROLE_DEFAULT_FLOAT}, - #endif - #ifdef WITH_OPENJPEG -- {NULL, NULL, imb_is_a_jp2, NULL, imb_ftype_default, imb_jp2_decode, NULL, imb_savejp2, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_JP2, COLOR_ROLE_DEFAULT_BYTE}, -+ {NULL, NULL, imb_is_a_jp2, NULL, imb_ftype_default, imb_load_jp2, imb_load_jp2_filepath, imb_save_jp2, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_JP2, COLOR_ROLE_DEFAULT_BYTE}, - #endif - #ifdef WITH_DDS - {NULL, NULL, imb_is_a_dds, NULL, imb_ftype_default, imb_load_dds, NULL, NULL, NULL, 0, IMB_FTYPE_DDS, COLOR_ROLE_DEFAULT_BYTE}, -diff -rupN blender-2.79/source/blender/imbuf/intern/IMB_filetype.h blender-2.79-new/source/blender/imbuf/intern/IMB_filetype.h ---- blender-2.79/source/blender/imbuf/intern/IMB_filetype.h 2017-09-11 06:34:59.000000000 +0200 -+++ blender-2.79-new/source/blender/imbuf/intern/IMB_filetype.h 2018-01-17 23:00:18.267393200 +0100 -@@ -82,8 +82,9 @@ int imb_saveiris(struct ImBuf *ibuf, con - - /* jp2 */ - int imb_is_a_jp2(const unsigned char *buf); --struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]); --int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags); -+struct ImBuf *imb_load_jp2(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]); -+struct ImBuf *imb_load_jp2_filepath(const char *name, int flags, char colorspace[IM_MAX_SPACE]); -+int imb_save_jp2(struct ImBuf *ibuf, const char *name, int flags); - - /* jpeg */ - int imb_is_a_jpeg(const unsigned char *mem); -diff -rupN blender-2.79/source/blender/imbuf/intern/jp2.c blender-2.79-new/source/blender/imbuf/intern/jp2.c ---- blender-2.79/source/blender/imbuf/intern/jp2.c 2017-09-11 06:34:59.000000000 +0200 -+++ blender-2.79-new/source/blender/imbuf/intern/jp2.c 2018-01-17 23:00:18.268393200 +0100 -@@ -38,7 +38,7 @@ - - #include "openjpeg.h" - --// #define JP2_FILEHEADER_SIZE 14 /* UNUSED */ -+#define JP2_FILEHEADER_SIZE 12 - - static const char JP2_HEAD[] = {0x0, 0x0, 0x0, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A}; - static const char J2K_HEAD[] = {0xFF, 0x4F, 0xFF, 0x51, 0x00}; -@@ -73,6 +73,19 @@ static bool check_j2k(const unsigned cha - return memcmp(J2K_HEAD, mem, sizeof(J2K_HEAD)) ? 0 : 1; - } - -+static OPJ_CODEC_FORMAT format_from_header(const unsigned char mem[JP2_FILEHEADER_SIZE]) -+{ -+ if (check_jp2(mem)) { -+ return OPJ_CODEC_JP2; -+ } -+ else if (check_j2k(mem)) { -+ return OPJ_CODEC_J2K; -+ } -+ else { -+ return OPJ_CODEC_UNKNOWN; -+ } -+} -+ - int imb_is_a_jp2(const unsigned char *buf) - { - return check_jp2(buf); -@@ -99,8 +112,8 @@ static void warning_callback(const char - */ - static void info_callback(const char *msg, void *client_data) - { -- (void)client_data; -- fprintf(stdout, "[INFO] %s", msg); -+ FILE *stream = (FILE *)client_data; -+ fprintf(stream, "[INFO] %s", msg); - } - - # define PIXEL_LOOPER_BEGIN(_rect) \ -@@ -121,8 +134,233 @@ static void info_callback(const char *ms - } \ - } (void)0 \ - --struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) -+ -+/** \name Buffer Stream -+ * \{ */ -+ -+struct BufInfo { -+ const unsigned char *buf; -+ const unsigned char *cur; -+ off_t len; -+}; -+ -+static void opj_read_from_buffer_free(void *UNUSED(p_user_data)) -+{ -+ /* nop */ -+} -+ -+static OPJ_SIZE_T opj_read_from_buffer(void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data) -+{ -+ struct BufInfo *p_file = p_user_data; -+ OPJ_UINT32 l_nb_read; -+ -+ if (p_file->cur + p_nb_bytes < p_file->buf + p_file->len ) { -+ l_nb_read = p_nb_bytes; -+ } -+ else { -+ l_nb_read = (OPJ_UINT32)(p_file->buf + p_file->len - p_file->cur); -+ } -+ memcpy(p_buffer, p_file->cur, l_nb_read); -+ p_file->cur += l_nb_read; -+ -+ return l_nb_read ? l_nb_read : ((OPJ_SIZE_T)-1); -+} -+ -+#if 0 -+static OPJ_SIZE_T opj_write_from_buffer(void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data) -+{ -+ struct BufInfo *p_file = p_user_data; -+ memcpy(p_file->cur, p_buffer, p_nb_bytes); -+ p_file->cur += p_nb_bytes; -+ p_file->len += p_nb_bytes; -+ return p_nb_bytes; -+} -+#endif -+ -+static OPJ_OFF_T opj_skip_from_buffer(OPJ_OFF_T p_nb_bytes, void *p_user_data) -+{ -+ struct BufInfo *p_file = p_user_data; -+ if (p_file->cur + p_nb_bytes < p_file->buf + p_file->len) { -+ p_file->cur += p_nb_bytes; -+ return p_nb_bytes; -+ } -+ p_file->cur = p_file->buf + p_file->len; -+ return (OPJ_OFF_T)-1; -+} -+ -+static OPJ_BOOL opj_seek_from_buffer(OPJ_OFF_T p_nb_bytes, void *p_user_data) -+{ -+ struct BufInfo *p_file = p_user_data; -+ if (p_file->cur + p_nb_bytes < p_file->buf + p_file->len) { -+ p_file->cur += p_nb_bytes; -+ return OPJ_TRUE; -+ } -+ p_file->cur = p_file->buf + p_file->len; -+ return OPJ_FALSE; -+} -+ -+/** -+ * Stream wrapper for memory buffer -+ * (would be nice if this was supported by the API). -+ */ -+ -+static opj_stream_t *opj_stream_create_from_buffer( -+ struct BufInfo *p_file, OPJ_UINT32 p_size, -+ OPJ_BOOL p_is_read_stream) -+{ -+ opj_stream_t *l_stream = opj_stream_create(p_size, p_is_read_stream); -+ if (l_stream == NULL) { -+ return NULL; -+ } -+ opj_stream_set_user_data(l_stream, p_file , opj_read_from_buffer_free); -+ opj_stream_set_user_data_length(l_stream, p_file->len); -+ opj_stream_set_read_function(l_stream, opj_read_from_buffer); -+#if 0 /* UNUSED */ -+ opj_stream_set_write_function(l_stream, opj_write_from_buffer); -+#endif -+ opj_stream_set_skip_function(l_stream, opj_skip_from_buffer); -+ opj_stream_set_seek_function(l_stream, opj_seek_from_buffer); -+ -+ return l_stream; -+} -+ -+/** \} */ -+ -+ -+/** \name File Stream -+ * \{ */ -+ -+static void opj_free_from_file(void *p_user_data) -+{ -+ FILE *f = p_user_data; -+ fclose(f); -+} -+ -+static OPJ_UINT64 opj_get_data_length_from_file (void *p_user_data) -+{ -+ FILE *p_file = p_user_data; -+ OPJ_OFF_T file_length = 0; -+ -+ fseek(p_file, 0, SEEK_END); -+ file_length = ftell(p_file); -+ fseek(p_file, 0, SEEK_SET); -+ -+ return (OPJ_UINT64)file_length; -+} -+ -+static OPJ_SIZE_T opj_read_from_file(void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data) -+{ -+ FILE *p_file = p_user_data; -+ OPJ_SIZE_T l_nb_read = fread(p_buffer, 1, p_nb_bytes, p_file); -+ return l_nb_read ? l_nb_read : (OPJ_SIZE_T)-1; -+} -+ -+static OPJ_SIZE_T opj_write_from_file(void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data) -+{ -+ FILE *p_file = p_user_data; -+ return fwrite(p_buffer, 1, p_nb_bytes, p_file); -+} -+ -+static OPJ_OFF_T opj_skip_from_file(OPJ_OFF_T p_nb_bytes, void *p_user_data) -+{ -+ FILE *p_file = p_user_data; -+ if (fseek(p_file, p_nb_bytes, SEEK_CUR)) { -+ return -1; -+ } -+ return p_nb_bytes; -+} -+ -+static OPJ_BOOL opj_seek_from_file(OPJ_OFF_T p_nb_bytes, void *p_user_data) -+{ -+ FILE *p_file = p_user_data; -+ if (fseek(p_file, p_nb_bytes, SEEK_SET)) { -+ return OPJ_FALSE; -+ } -+ return OPJ_TRUE; -+} -+ -+/** -+ * Stream wrapper for memory file -+ * (would be nice if this was supported by the API). -+ */ -+ -+static opj_stream_t *opj_stream_create_from_file( -+ const char *filepath, OPJ_UINT32 p_size, OPJ_BOOL p_is_read_stream, -+ FILE **r_file) -+{ -+ FILE *p_file = BLI_fopen(filepath, p_is_read_stream ? "rb" : "wb"); -+ if (p_file == NULL) { -+ return NULL; -+ } -+ -+ opj_stream_t *l_stream = opj_stream_create(p_size, p_is_read_stream); -+ if (l_stream == NULL) { -+ fclose(p_file); -+ return NULL; -+ } -+ -+ opj_stream_set_user_data(l_stream, p_file, opj_free_from_file); -+ opj_stream_set_user_data_length(l_stream, opj_get_data_length_from_file(p_file)); -+ opj_stream_set_write_function(l_stream, opj_write_from_file); -+ opj_stream_set_read_function(l_stream, opj_read_from_file); -+ opj_stream_set_skip_function(l_stream, opj_skip_from_file); -+ opj_stream_set_seek_function(l_stream, opj_seek_from_file); -+ -+ if (r_file) { -+ *r_file = p_file; -+ } -+ return l_stream; -+} -+ -+/** \} */ -+ -+static ImBuf *imb_load_jp2_stream( -+ opj_stream_t stream, OPJ_CODEC_FORMAT p_format, -+ int flags, char colorspace[IM_MAX_SPACE]); -+ -+ImBuf *imb_load_jp2(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) - { -+ const OPJ_CODEC_FORMAT format = (size > JP2_FILEHEADER_SIZE) ? format_from_header(mem) : OPJ_CODEC_UNKNOWN; -+ struct BufInfo buf_wrapper = { .buf = mem, .cur = mem, .len = size, }; -+ opj_stream_t stream = opj_stream_create_from_buffer(&buf_wrapper, OPJ_J2K_STREAM_CHUNK_SIZE, true); -+ ImBuf *ibuf = imb_load_jp2_stream(stream, format, flags, colorspace); -+ opj_stream_destroy(stream); -+ return ibuf; -+} -+ -+ImBuf *imb_load_jp2_filepath(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]) -+{ -+ FILE *p_file = NULL; -+ unsigned char mem[JP2_FILEHEADER_SIZE]; -+ opj_stream_t *stream = opj_stream_create_from_file(filepath, OPJ_J2K_STREAM_CHUNK_SIZE, false, &p_file); -+ if (stream) { -+ return NULL; -+ } -+ else { -+ if (fread(mem, sizeof(mem), 1, p_file) != sizeof(mem)) { -+ opj_stream_destroy(stream); -+ return NULL; -+ } -+ else { -+ fseek(p_file, 0, SEEK_SET); -+ } -+ } -+ -+ const OPJ_CODEC_FORMAT format = format_from_header(mem); -+ ImBuf *ibuf = imb_load_jp2_stream(stream, format, flags, colorspace); -+ opj_stream_destroy(stream); -+ return ibuf; -+} -+ -+ -+static ImBuf *imb_load_jp2_stream( -+ opj_stream_t stream, const OPJ_CODEC_FORMAT format, -+ int flags, char colorspace[IM_MAX_SPACE]) -+{ -+ if (format == OPJ_CODEC_UNKNOWN) { -+ return NULL; -+ } -+ - struct ImBuf *ibuf = NULL; - bool use_float = false; /* for precision higher then 8 use float */ - bool use_alpha = false; -@@ -133,68 +371,49 @@ struct ImBuf *imb_jp2_decode(const unsig - unsigned int i, i_next, w, h, planes; - unsigned int y; - int *r, *g, *b, *a; /* matching 'opj_image_comp.data' type */ -- bool is_jp2, is_j2k; - - opj_dparameters_t parameters; /* decompression parameters */ - -- opj_event_mgr_t event_mgr; /* event manager */ - opj_image_t *image = NULL; -- -- opj_dinfo_t *dinfo = NULL; /* handle to a decompressor */ -- opj_cio_t *cio = NULL; -- -- is_jp2 = check_jp2(mem); -- is_j2k = check_j2k(mem); -- -- if (!is_jp2 && !is_j2k) -- return(NULL); -+ opj_codec_t *codec = NULL; /* handle to a decompressor */ - - /* both 8, 12 and 16 bit JP2Ks are default to standard byte colorspace */ - colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE); - -- /* configure the event callbacks (not required) */ -- memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); -- event_mgr.error_handler = error_callback; -- event_mgr.warning_handler = warning_callback; -- event_mgr.info_handler = info_callback; -- -- - /* set decoding parameters to default values */ - opj_set_default_decoder_parameters(¶meters); - -- - /* JPEG 2000 compressed image data */ - - /* get a decoder handle */ -- dinfo = opj_create_decompress(is_jp2 ? CODEC_JP2 : CODEC_J2K); -+ codec = opj_create_decompress(format); - -- /* catch events using our callbacks and give a local context */ -- opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr); -+ /* configure the event callbacks (not required) */ -+ opj_set_error_handler(codec, error_callback, stderr); -+ opj_set_warning_handler(codec, warning_callback, stderr); -+#ifdef DEBUG /* too noisy */ -+ opj_set_info_handler(codec, info_callback, stderr); -+#endif - - /* setup the decoder decoding parameters using the current image and user parameters */ -- opj_setup_decoder(dinfo, ¶meters); -+ if (opj_setup_decoder(codec, ¶meters) == false) { -+ goto finally; -+ } - -- /* open a byte stream */ -- /* note, we can't avoid removing 'const' cast here */ -- cio = opj_cio_open((opj_common_ptr)dinfo, (unsigned char *)mem, size); -+ if (opj_read_header(stream, codec, &image) == false) { -+ printf("OpenJPEG error: failed to read the header\n"); -+ goto finally; -+ } - - /* decode the stream and fill the image structure */ -- image = opj_decode(dinfo, cio); -- -- if (!image) { -+ if (opj_decode(codec, stream, image) == false) { - fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n"); -- opj_destroy_decompress(dinfo); -- opj_cio_close(cio); -- return NULL; -+ goto finally; - } - -- /* close the byte stream */ -- opj_cio_close(cio); -- -- - if ((image->numcomps * image->x1 * image->y1) == 0) { - fprintf(stderr, "\nError: invalid raw image parameters\n"); -- return NULL; -+ goto finally; - } - - w = image->comps[0].w; -@@ -232,16 +451,16 @@ struct ImBuf *imb_jp2_decode(const unsig - ibuf = IMB_allocImBuf(w, h, planes, use_float ? IB_rectfloat : IB_rect); - - if (ibuf == NULL) { -- if (dinfo) -- opj_destroy_decompress(dinfo); -- return NULL; -+ goto finally; - } - - ibuf->ftype = IMB_FTYPE_JP2; -- if (is_jp2) -+ if (1 /* is_jp2 */ ) { - ibuf->foptions.flag |= JP2_JP2; -- else -+ } -+ else { - ibuf->foptions.flag |= JP2_J2K; -+ } - - if (use_float) { - float *rect_float = ibuf->rect_float; -@@ -347,19 +566,23 @@ struct ImBuf *imb_jp2_decode(const unsig - } - } - -- /* free remaining structures */ -- if (dinfo) { -- opj_destroy_decompress(dinfo); -- } -- -- /* free image data structure */ -- opj_image_destroy(image); -- - if (flags & IB_rect) { - IMB_rect_from_float(ibuf); - } -- -- return(ibuf); -+ -+ -+finally: -+ -+ /* free remaining structures */ -+ if (codec) { -+ opj_destroy_codec(codec); -+ } -+ -+ if (image) { -+ opj_image_destroy(image); -+ } -+ -+ return ibuf; - } - - //static opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp) -@@ -422,14 +645,14 @@ static int initialise_4K_poc(opj_poc_t * - POC[0].layno1 = 1; - POC[0].resno1 = numres - 1; - POC[0].compno1 = 3; -- POC[0].prg1 = CPRL; -+ POC[0].prg1 = OPJ_CPRL; - POC[1].tile = 1; - POC[1].resno0 = numres - 1; - POC[1].compno0 = 0; - POC[1].layno1 = 1; - POC[1].resno1 = numres; - POC[1].compno1 = 3; -- POC[1].prg1 = CPRL; -+ POC[1].prg1 = OPJ_CPRL; - return 2; - } - -@@ -455,7 +678,7 @@ static void cinema_parameters(opj_cparam - parameters->csty |= 0x01; - - /*The progression order shall be CPRL*/ -- parameters->prog_order = CPRL; -+ parameters->prog_order = OPJ_CPRL; - - /* No ROI */ - parameters->roi_compno = -1; -@@ -472,23 +695,23 @@ static void cinema_setup_encoder(opj_cpa - float temp_rate; - - switch (parameters->cp_cinema) { -- case CINEMA2K_24: -- case CINEMA2K_48: -+ case OPJ_CINEMA2K_24: -+ case OPJ_CINEMA2K_48: - if (parameters->numresolution > 6) { - parameters->numresolution = 6; - } - if (!((image->comps[0].w == 2048) || (image->comps[0].h == 1080))) { -- fprintf(stdout, "Image coordinates %d x %d is not 2K compliant.\nJPEG Digital Cinema Profile-3 " -+ fprintf(stdout, "Image coordinates %u x %u is not 2K compliant.\nJPEG Digital Cinema Profile-3 " - "(2K profile) compliance requires that at least one of coordinates match 2048 x 1080\n", - image->comps[0].w, image->comps[0].h); -- parameters->cp_rsiz = STD_RSIZ; -+ parameters->cp_rsiz = OPJ_STD_RSIZ; - } - else { - parameters->cp_rsiz = DCP_CINEMA2K; - } - break; - -- case CINEMA4K_24: -+ case OPJ_CINEMA4K_24: - if (parameters->numresolution < 1) { - parameters->numresolution = 1; - } -@@ -496,24 +719,24 @@ static void cinema_setup_encoder(opj_cpa - parameters->numresolution = 7; - } - if (!((image->comps[0].w == 4096) || (image->comps[0].h == 2160))) { -- fprintf(stdout, "Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4" -+ fprintf(stdout, "Image coordinates %u x %u is not 4K compliant.\nJPEG Digital Cinema Profile-4" - "(4K profile) compliance requires that at least one of coordinates match 4096 x 2160\n", - image->comps[0].w, image->comps[0].h); -- parameters->cp_rsiz = STD_RSIZ; -+ parameters->cp_rsiz = OPJ_STD_RSIZ; - } - else { - parameters->cp_rsiz = DCP_CINEMA2K; - } - parameters->numpocs = initialise_4K_poc(parameters->POC, parameters->numresolution); - break; -- case OFF: -+ case OPJ_OFF: - /* do nothing */ - break; - } - - switch (parameters->cp_cinema) { -- case CINEMA2K_24: -- case CINEMA4K_24: -+ case OPJ_CINEMA2K_24: -+ case OPJ_CINEMA4K_24: - for (i = 0; i < parameters->tcp_numlayers; i++) { - temp_rate = 0; - if (img_fol->rates[i] == 0) { -@@ -535,7 +758,7 @@ static void cinema_setup_encoder(opj_cpa - parameters->max_comp_size = COMP_24_CS; - break; - -- case CINEMA2K_48: -+ case OPJ_CINEMA2K_48: - for (i = 0; i < parameters->tcp_numlayers; i++) { - temp_rate = 0; - if (img_fol->rates[i] == 0) { -@@ -556,7 +779,7 @@ static void cinema_setup_encoder(opj_cpa - } - parameters->max_comp_size = COMP_48_CS; - break; -- case OFF: -+ case OPJ_OFF: - /* do nothing */ - break; - } -@@ -600,13 +823,13 @@ static opj_image_t *ibuftoimage(ImBuf *i - if (ibuf->foptions.flag & JP2_CINE) { - - if (ibuf->x == 4096 || ibuf->y == 2160) -- parameters->cp_cinema = CINEMA4K_24; -+ parameters->cp_cinema = OPJ_CINEMA4K_24; - else { - if (ibuf->foptions.flag & JP2_CINE_48FPS) { -- parameters->cp_cinema = CINEMA2K_48; -+ parameters->cp_cinema = OPJ_CINEMA2K_48; - } - else { -- parameters->cp_cinema = CINEMA2K_24; -+ parameters->cp_cinema = OPJ_CINEMA2K_24; - } - } - if (parameters->cp_cinema) { -@@ -617,13 +840,13 @@ static opj_image_t *ibuftoimage(ImBuf *i - cinema_parameters(parameters); - } - -- color_space = (ibuf->foptions.flag & JP2_YCC) ? CLRSPC_SYCC : CLRSPC_SRGB; -+ color_space = (ibuf->foptions.flag & JP2_YCC) ? OPJ_CLRSPC_SYCC : OPJ_CLRSPC_SRGB; - prec = 12; - numcomps = 3; - } - else { - /* Get settings from the imbuf */ -- color_space = (ibuf->foptions.flag & JP2_YCC) ? CLRSPC_SYCC : CLRSPC_SRGB; -+ color_space = (ibuf->foptions.flag & JP2_YCC) ? OPJ_CLRSPC_SYCC : OPJ_CLRSPC_SRGB; - - if (ibuf->foptions.flag & JP2_16BIT) prec = 16; - else if (ibuf->foptions.flag & JP2_12BIT) prec = 12; -@@ -958,28 +1181,27 @@ static opj_image_t *ibuftoimage(ImBuf *i - return image; - } - -+int imb_save_jp2_stream(struct ImBuf *ibuf, opj_stream_t stream, int flags); -+ -+int imb_save_jp2(struct ImBuf *ibuf, const char *filepath, int flags) -+{ -+ opj_stream_t stream = opj_stream_create_from_file(filepath, OPJ_J2K_STREAM_CHUNK_SIZE, false, NULL); -+ if (stream == NULL) { -+ return 0; -+ } -+ int ret = imb_save_jp2_stream(ibuf, stream, flags); -+ opj_stream_destroy(stream); -+ return ret; -+} - - /* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */ --int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) -+int imb_save_jp2_stream(struct ImBuf *ibuf, opj_stream_t stream, int UNUSED(flags)) - { - int quality = ibuf->foptions.quality; - -- int bSuccess; - opj_cparameters_t parameters; /* compression parameters */ -- opj_event_mgr_t event_mgr; /* event manager */ - opj_image_t *image = NULL; - -- (void)flags; /* unused */ -- -- /* -- * configure the event callbacks (not required) -- * setting of each callback is optional -- */ -- memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); -- event_mgr.error_handler = error_callback; -- event_mgr.warning_handler = warning_callback; -- event_mgr.info_handler = info_callback; -- - /* set encoding parameters to default values */ - opj_set_default_encoder_parameters(¶meters); - -@@ -993,61 +1215,61 @@ int imb_savejp2(struct ImBuf *ibuf, cons - parameters.cp_disto_alloc = 1; - - image = ibuftoimage(ibuf, ¶meters); -- -- -- { /* JP2 format output */ -- int codestream_length; -- opj_cio_t *cio = NULL; -- FILE *f = NULL; -- opj_cinfo_t *cinfo = NULL; - -+ opj_codec_t *codec = NULL; -+ int ok = false; -+ /* JP2 format output */ -+ { - /* get a JP2 compressor handle */ -- if (ibuf->foptions.flag & JP2_JP2) -- cinfo = opj_create_compress(CODEC_JP2); -- else if (ibuf->foptions.flag & JP2_J2K) -- cinfo = opj_create_compress(CODEC_J2K); -- else -- BLI_assert(!"Unsupported codec was specified in save settings"); -+ OPJ_CODEC_FORMAT format = OPJ_CODEC_JP2; -+ if (ibuf->foptions.flag & JP2_J2K) { -+ format = OPJ_CODEC_J2K; -+ } -+ else if (ibuf->foptions.flag & JP2_JP2) { -+ format = OPJ_CODEC_JP2; -+ } - -- /* catch events using our callbacks and give a local context */ -- opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr); -+ codec = opj_create_compress(format); - -- /* setup the encoder parameters using the current image and using user parameters */ -- opj_setup_encoder(cinfo, ¶meters, image); -+ /* configure the event callbacks (not required) */ -+ opj_set_error_handler(codec, error_callback, stderr); -+ opj_set_warning_handler(codec, warning_callback, stderr); -+#ifdef DEBUG /* too noisy */ -+ opj_set_info_handler(codec, info_callback, stderr); -+#endif - -- /* open a byte stream for writing */ -- /* allocate memory for all tiles */ -- cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0); -+ /* setup the encoder parameters using the current image and using user parameters */ -+ if (opj_setup_encoder(codec, ¶meters, image) == false) { -+ goto finally; -+ } - -- /* encode the image */ -- bSuccess = opj_encode(cinfo, cio, image, NULL); /* last arg used to be parameters.index but this deprecated */ -- -- if (!bSuccess) { -- opj_cio_close(cio); -- fprintf(stderr, "failed to encode image\n"); -- return 0; -+ if (opj_start_compress(codec, image, stream) == false) { -+ goto finally; -+ } -+ if (opj_encode(codec, stream) == false) { -+ goto finally; - } -- codestream_length = cio_tell(cio); -+ if (opj_end_compress(codec, stream) == false) { -+ goto finally; -+ } -+ } - -- /* write the buffer to disk */ -- f = BLI_fopen(name, "wb"); -- -- if (!f) { -- fprintf(stderr, "failed to open %s for writing\n", name); -- return 1; -- } -- fwrite(cio->buffer, 1, codestream_length, f); -- fclose(f); -- fprintf(stderr, "Generated outfile %s\n", name); -- /* close and free the byte stream */ -- opj_cio_close(cio); -- -- /* free remaining compression structures */ -- opj_destroy_compress(cinfo); -+ ok = true; -+ -+finally: -+ /* free remaining compression structures */ -+ if (codec) { -+ opj_destroy_codec(codec); - } - - /* free image data */ -- opj_image_destroy(image); -- -- return 1; -+ if (image) { -+ opj_image_destroy(image); -+ } -+ -+ if (ok == false) { -+ fprintf(stderr, "failed to encode image\n"); -+ } -+ -+ return ok; - } diff --git a/blender-2.79-openvdb3-abi.patch b/blender-2.79-openvdb3-abi.patch deleted file mode 100644 index 7a6d5ea..0000000 --- a/blender-2.79-openvdb3-abi.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur blender-2.79.old/CMakeLists.txt blender-2.79/CMakeLists.txt ---- blender-2.79.old/CMakeLists.txt 2017-09-12 05:44:17.000000000 +0200 -+++ blender-2.79/CMakeLists.txt 2017-09-12 14:25:57.685127782 +0200 -@@ -252,6 +252,10 @@ - option(WITH_OPENVDB "Enable features relying on OpenVDB" OFF) - option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" OFF) - -+if(WITH_OPENVDB) -+ add_definitions(-DOPENVDB_3_ABI_COMPATIBLE) -+endif() -+ - # GHOST Windowing Library Options - option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF) - mark_as_advanced(WITH_GHOST_DEBUG) diff --git a/blender-2.79-python37.patch b/blender-2.79-python37.patch deleted file mode 100644 index f693f2a..0000000 --- a/blender-2.79-python37.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -r -U3 blender-2.79b-orig/source/blender/python/intern/bpy_rna.c blender-2.79b/source/blender/python/intern/bpy_rna.c ---- blender-2.79b-orig/source/blender/python/intern/bpy_rna.c 2018-03-23 16:22:25.000000000 +0100 -+++ blender-2.79b/source/blender/python/intern/bpy_rna.c 2018-11-02 14:15:34.311361383 +0100 -@@ -7389,6 +7389,7 @@ - item = PyObject_GetAttrString(py_class, identifier); - - if (item == NULL) { -+ PyErr_Clear(); - /* Sneaky workaround to use the class name as the bl_idname */ - - #define BPY_REPLACEMENT_STRING(rna_attr, py_attr) \ -@@ -7418,8 +7419,9 @@ - class_type, py_class_name, identifier); - return -1; - } -- -- PyErr_Clear(); -+ else { -+ PyErr_Clear(); -+ } - } - else { - if (pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class:") != 0) { diff --git a/blender-2.79-scripts.patch b/blender-2.79-scripts.patch deleted file mode 100644 index 7f0aa4b..0000000 --- a/blender-2.79-scripts.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur blender-2.79.old/source/creator/CMakeLists.txt blender-2.79/source/creator/CMakeLists.txt ---- blender-2.79.old/source/creator/CMakeLists.txt 2017-09-12 14:17:03.361182908 +0200 -+++ blender-2.79/source/creator/CMakeLists.txt 2017-09-12 14:17:22.264536022 +0200 -@@ -342,8 +342,8 @@ - endif() - - install( -- DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts -- DESTINATION ${TARGETDIR_VER} -+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts/ -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/blender/scripts/ - PATTERN ".git" EXCLUDE - PATTERN ".gitignore" EXCLUDE - PATTERN ".arcconfig" EXCLUDE diff --git a/blender-2.79-thumbnailer.patch b/blender-2.79-thumbnailer.patch deleted file mode 100644 index 59a71fb..0000000 --- a/blender-2.79-thumbnailer.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Naur blender-2.79.old/blender.thumbnailer blender-2.79/blender.thumbnailer ---- blender-2.79.old/blender.thumbnailer 1970-01-01 01:00:00.000000000 +0100 -+++ blender-2.79/blender.thumbnailer 2017-09-12 14:14:51.034711054 +0200 -@@ -0,0 +1,4 @@ -+[Thumbnailer Entry] -+TryExec=/usr/share/blender/scripts/blender-thumbnailer.py -+Exec=/usr/share/blender/scripts/blender-thumbnailer.py %i %o -+MimeType=application/x-blender; -diff -Naur blender-2.79.old/source/creator/CMakeLists.txt blender-2.79/source/creator/CMakeLists.txt ---- blender-2.79.old/source/creator/CMakeLists.txt 2017-09-12 14:15:10.335071584 +0200 -+++ blender-2.79/source/creator/CMakeLists.txt 2017-09-12 14:14:51.034711054 +0200 -@@ -514,7 +514,7 @@ - ) - install( - PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py -- DESTINATION bin -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/blender/scripts - ) - set(BLENDER_TEXT_FILES_DESTINATION share/doc/blender) - endif() diff --git a/blender-2.79-unversioned-system-path.patch b/blender-2.79-unversioned-system-path.patch deleted file mode 100644 index 0818fd2..0000000 --- a/blender-2.79-unversioned-system-path.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naur blender-2.79.old/intern/ghost/intern/GHOST_SystemPathsUnix.cpp blender-2.79/intern/ghost/intern/GHOST_SystemPathsUnix.cpp ---- blender-2.79.old/intern/ghost/intern/GHOST_SystemPathsUnix.cpp 2017-09-12 14:49:10.055232962 +0200 -+++ blender-2.79/intern/ghost/intern/GHOST_SystemPathsUnix.cpp 2017-09-12 14:50:46.149035501 +0200 -@@ -61,6 +61,9 @@ - - const GHOST_TUns8 *GHOST_SystemPathsUnix::getSystemDir(int, const char *versionstr) const - { -+ /* ignore versionstr when building the system path */ -+ versionstr = ""; -+ - /* no prefix assumes a portable build which only uses bundled scripts */ - if (static_path) { - static string system_path = string(static_path) + "/blender/" + versionstr; -diff -Naur blender-2.79.old/source/creator/CMakeLists.txt blender-2.79/source/creator/CMakeLists.txt ---- blender-2.79.old/source/creator/CMakeLists.txt 2017-09-12 14:49:10.243236700 +0200 -+++ blender-2.79/source/creator/CMakeLists.txt 2017-09-12 14:50:46.149035501 +0200 -@@ -295,7 +295,7 @@ - if(WITH_INSTALL_PORTABLE) - set(TARGETDIR_VER ${BLENDER_VERSION}) - else() -- set(TARGETDIR_VER share/blender/${BLENDER_VERSION}) -+ set(TARGETDIR_VER share/blender) - endif() - endif() - diff --git a/blender-2.80-droid.patch b/blender-2.80-droid.patch index db823e2..5173380 100644 --- a/blender-2.80-droid.patch +++ b/blender-2.80-droid.patch @@ -9,3 +9,17 @@ if (fontpath) { char unifont_path[1024]; BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, fb->filename); +--- blender-2.80.old/source/creator/CMakeLists.txt 2019-07-24 00:41:39.000000000 -0700 ++++ blender-2.80/source/creator/CMakeLists.txt 2019-08-05 17:38:34.223948608 -0700 +@@ -393,9 +393,8 @@ + # localization + if(WITH_INTERNATIONAL) + install( +- DIRECTORY +- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts +- DESTINATION ${TARGETDIR_VER}/datafiles ++ DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/fonts/ ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/fonts/blender + ) + + set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale") diff --git a/blender-2.80-scripts.patch b/blender-2.80-scripts.patch deleted file mode 100644 index 4aa0827..0000000 --- a/blender-2.80-scripts.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- blender-2.80.old/source/creator/CMakeLists.txt 2019-07-24 00:41:39.000000000 -0700 -+++ blender-2.80/source/creator/CMakeLists.txt 2019-08-05 17:38:34.223948608 -0700 -@@ -376,8 +376,8 @@ - endif() - - install( -- DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts -- DESTINATION ${TARGETDIR_VER} -+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts/ -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/blender/scripts/ - PATTERN ".git" EXCLUDE - PATTERN ".gitignore" EXCLUDE - PATTERN ".arcconfig" EXCLUDE -@@ -393,9 +393,8 @@ - # localization - if(WITH_INTERNATIONAL) - install( -- DIRECTORY -- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts -- DESTINATION ${TARGETDIR_VER}/datafiles -+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/fonts/ -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/fonts/blender - ) - - set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale") diff --git a/blender-2.80-thumbnailer.patch b/blender-2.80-thumbnailer.patch deleted file mode 100644 index de9051c..0000000 --- a/blender-2.80-thumbnailer.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- blender-2.80.old/source/creator/CMakeLists.txt 2019-07-24 00:41:39.000000000 -0700 -+++ blender-2.80/source/creator/CMakeLists.txt 2019-08-05 17:23:40.387690190 -0700 -@@ -393,9 +393,8 @@ - # localization - if(WITH_INTERNATIONAL) - install( -- DIRECTORY -- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts -- DESTINATION ${TARGETDIR_VER}/datafiles -+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/fonts/ -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/fonts/blender - ) - - set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale") -@@ -518,7 +517,7 @@ - # main blender binary - install( - TARGETS blender -- DESTINATION bin -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/blender/scripts - ) - if(WITH_DOC_MANPAGE) - # manpage only with 'blender' binary diff --git a/blender-cmake_opengl.patch b/blender-cmake_opengl.patch deleted file mode 100644 index 2266a4e..0000000 --- a/blender-cmake_opengl.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -45,7 +45,14 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_ - endif() - endif() - --cmake_minimum_required(VERSION 2.8) -+cmake_minimum_required(VERSION 3.5) -+ -+# Prever LEGACY OpenGL to eb compatible with all the existing releases and -+# platforms which don't hare GLVND yet. Only do it if preference was not set -+# externally. -+if(NOT DEFINED OpenGL_GL_PREFERENCE) -+ set(OpenGL_GL_PREFERENCE "LEGACY") -+endif() - - if(NOT EXECUTABLE_OUTPUT_PATH) - set(FIRST_RUN TRUE) -@@ -987,7 +994,7 @@ if(WITH_SYSTEM_GLES) - endif() - - if(WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE) -- list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}") -+ list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_LIBRARIES}") - - elseif(WITH_GL_PROFILE_ES20) - if(WITH_SYSTEM_GLES) diff --git a/blender-oiio2.patch b/blender-oiio2.patch deleted file mode 100644 index a85fddf..0000000 --- a/blender-oiio2.patch +++ /dev/null @@ -1,258 +0,0 @@ ---- a/intern/cycles/blender/blender_python.cpp -+++ b/intern/cycles/blender/blender_python.cpp -@@ -493,7 +493,7 @@ static PyObject *osl_update_node_func(Py - socket_type = "NodeSocketString"; - data_type = BL::NodeSocket::type_STRING; - if(param->validdefault) -- default_string = param->sdefault[0]; -+ default_string = param->sdefault[0].string(); - } - else - continue; ---- a/intern/cycles/graph/node_xml.cpp -+++ b/intern/cycles/graph/node_xml.cpp -@@ -250,7 +250,7 @@ void xml_read_node(XMLReader& reader, No - } - } - -- if(node->name) -+ if(!node->name.empty()) - reader.node_map[node->name] = node; - } - ---- a/intern/cycles/render/buffers.cpp -+++ b/intern/cycles/render/buffers.cpp -@@ -27,6 +27,7 @@ - #include "util/util_opengl.h" - #include "util/util_time.h" - #include "util/util_types.h" -+#include "util/util_unique_ptr.h" - - CCL_NAMESPACE_BEGIN - -@@ -453,7 +454,7 @@ void DisplayBuffer::write(Device *device - device->pixels_copy_from(rgba, 0, w, h); - - /* write image */ -- ImageOutput *out = ImageOutput::create(filename); -+ unique_ptr out(ImageOutput::create(filename)); - ImageSpec spec(w, h, 4, TypeDesc::UINT8); - int scanlinesize = w*4*sizeof(uchar); - -@@ -467,8 +468,6 @@ void DisplayBuffer::write(Device *device - AutoStride); - - out->close(); -- -- delete out; - } - - device_memory& DisplayBuffer::rgba_data() ---- a/intern/cycles/render/image.cpp -+++ b/intern/cycles/render/image.cpp -@@ -23,6 +23,7 @@ - #include "util/util_path.h" - #include "util/util_progress.h" - #include "util/util_texture.h" -+#include "util/util_unique_ptr.h" - - #ifdef WITH_OSL - #include -@@ -148,7 +149,7 @@ ImageDataType ImageManager::get_image_me - return IMAGE_DATA_TYPE_BYTE4; - } - -- ImageInput *in = ImageInput::create(filename); -+ unique_ptr in(ImageInput::create(filename)); - - if(in) { - ImageSpec spec; -@@ -193,8 +194,6 @@ ImageDataType ImageManager::get_image_me - - in->close(); - } -- -- delete in; - } - - if(is_half) { -@@ -449,7 +448,7 @@ void ImageManager::tag_reload_image(cons - } - - bool ImageManager::file_load_image_generic(Image *img, -- ImageInput **in, -+ unique_ptr *in, - int &width, - int &height, - int &depth, -@@ -465,7 +464,7 @@ bool ImageManager::file_load_image_gener - } - - /* load image from file through OIIO */ -- *in = ImageInput::create(img->filename); -+ *in = unique_ptr(ImageInput::create(img->filename)); - - if(!*in) - return false; -@@ -477,8 +476,6 @@ bool ImageManager::file_load_image_gener - config.attribute("oiio:UnassociatedAlpha", 1); - - if(!(*in)->open(img->filename, spec, config)) { -- delete *in; -- *in = NULL; - return false; - } - -@@ -500,10 +497,7 @@ bool ImageManager::file_load_image_gener - if(!(components >= 1 && components <= 4)) { - if(*in) { - (*in)->close(); -- delete *in; -- *in = NULL; - } -- - return false; - } - -@@ -519,7 +513,7 @@ bool ImageManager::file_load_image(Image - device_vector& tex_img) - { - const StorageType alpha_one = (FileFormat == TypeDesc::UINT8)? 255 : 1; -- ImageInput *in = NULL; -+ unique_ptr in = NULL; - int width, height, depth, components; - if(!file_load_image_generic(img, &in, width, height, depth, components)) { - return false; -@@ -575,7 +569,6 @@ bool ImageManager::file_load_image(Image - } - cmyk = strcmp(in->format_name(), "jpeg") == 0 && components == 4; - in->close(); -- delete in; - } - else { - if(FileFormat == TypeDesc::FLOAT) { ---- a/intern/cycles/render/image.h -+++ b/intern/cycles/render/image.h -@@ -23,6 +23,7 @@ - #include "util/util_image.h" - #include "util/util_string.h" - #include "util/util_thread.h" -+#include "util/util_unique_ptr.h" - #include "util/util_vector.h" - - CCL_NAMESPACE_BEGIN -@@ -133,7 +134,7 @@ private: - bool pack_images; - - bool file_load_image_generic(Image *img, -- ImageInput **in, -+ unique_ptr *in, - int &width, - int &height, - int &depth, ---- /dev/null -+++ b/intern/cycles/util/util_unique_ptr.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright 2011-2013 Blender Foundation -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef __UTIL_UNIQUE_PTR_H__ -+#define __UTIL_UNIQUE_PTR_H__ -+ -+#include -+ -+CCL_NAMESPACE_BEGIN -+ -+using std::unique_ptr; -+ -+CCL_NAMESPACE_END -+ -+#endif /* __UTIL_UNIQUE_PTR_H__ */ ---- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp -+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp -@@ -35,6 +35,11 @@ - #include "utfconv.h" - #endif - -+// NOTE: Keep first, BLI_path_util conflicts with OIIO's format. -+#include -+#include -+#include -+ - extern "C" - { - #include "MEM_guardedalloc.h" -@@ -48,12 +53,10 @@ extern "C" - #include "IMB_colormanagement_intern.h" - } - --#include --#include -- - OIIO_NAMESPACE_USING - - using std::string; -+using std::unique_ptr; - - typedef unsigned char uchar; - -@@ -197,7 +200,6 @@ int imb_save_photoshop(struct ImBuf *ibu - - struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspace[IM_MAX_SPACE]) - { -- ImageInput *in = NULL; - struct ImBuf *ibuf = NULL; - int width, height, components; - bool is_float, is_alpha; -@@ -210,7 +212,7 @@ struct ImBuf *imb_load_photoshop(const c - - colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE); - -- in = ImageInput::create(filename); -+ unique_ptr in(ImageInput::create(filename)); - if (!in) { - std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl - << OIIO_NAMESPACE::geterror() << std::endl; -@@ -223,7 +225,6 @@ struct ImBuf *imb_load_photoshop(const c - if (!in->open(filename, spec, config)) { - std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl - << in->geterror() << std::endl; -- delete in; - return NULL; - } - -@@ -249,19 +250,17 @@ struct ImBuf *imb_load_photoshop(const c - if (!(components >= 1 && components <= 4)) { - if (in) { - in->close(); -- delete in; - } - return NULL; - } - - if (is_float) -- ibuf = imb_oiio_load_image_float(in, width, height, components, flags, is_alpha); -+ ibuf = imb_oiio_load_image_float(in.get(), width, height, components, flags, is_alpha); - else -- ibuf = imb_oiio_load_image(in, width, height, components, flags, is_alpha); -+ ibuf = imb_oiio_load_image(in.get(), width, height, components, flags, is_alpha); - - if (in) { - in->close(); -- delete in; - } - - if (!ibuf) diff --git a/blender.spec b/blender.spec index 3a88b2a..cfce1fc 100644 --- a/blender.spec +++ b/blender.spec @@ -17,47 +17,25 @@ # Enable this or rebuild the package with "--with=openvdb" to enable OpenVDB # support. -#%%global _with_openvdb 1 +# %%global _with_openvdb 1 Name: blender Epoch: 1 Version: %{blender_api} -Release: 4%{?dist} +Release: 5%{?dist} Summary: 3D modeling, animation, rendering and post-production License: GPLv2 URL: http://www.blender.org Source0: http://download.%{name}.org/source/%{name}-%{version}.tar.gz +Source1: %{name}.thumbnailer Source2: %{name}-fonts.metainfo.xml Source5: %{name}.xml Source6: %{name}.appdata.xml Source10: macros.%{name} Patch0: %{name}-2.80-droid.patch -#Patch1: %%{name}-2.79-thumbnailer.patch -Patch2: %{name}-2.80-scripts.patch -Patch3: %%{name}-2.80-locale.patch -#Patch4: %%{name}-2.79-manpages.patch -#Patch5: %%{name}-2.79-unversioned-system-path.patch -#Patch6: %%{name}-2.79-openvdb3-abi.patch -# Backported patch for openjpeg2 support from -# https://lists.blender.org/pipermail/bf-blender-cvs/2016-July/088691.html -# but without patch-updating the bundled openjpeg2 version -#Patch7: blender-2.79-openjpeg2.patch -#Patch8: util_sseb.patch -#Patch9: tree_hpp.patch -# Backported from https://developer.blender.org/rB1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f -#Patch10: %%{name}-2.79-python37.patch -# Patch mostly from upstream, for more details see: -# https://developer.blender.org/rB66d8bfb85c61aafe3bad2edf0e7b4d9d694ee2e7 -# https://github.com/OpenImageIO/oiio/wiki/OIIO-2.0-Porting-Guide -#Patch11: blender-oiio2.patch -# Commit to make OpenGL_GL_PREFERENCES=GLVND work -# https://developer.blender.org/rB0658d047a94a86060f039790898a80a7adb0dcd9 -# Patch12: blender-cmake_opengl.patch -# Patch to build with GCC9 -#Patch13: 0001-Fix-for-GCC9-new-OpenMP-data-sharing.patch # Development stuff BuildRequires: boost-devel @@ -242,7 +220,10 @@ pushd cmake-make %make_install popd -find %{buildroot}%{_datadir}/%{name}/scripts -type f -exec sed -i -e 's/\r$//g' {} \; +#find %{buildroot}%{_datadir}/%{name}/scripts -type f -exec sed -i -e 's/\r$//g' {} \; + +# Thumbnailer +install -p -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/thumbnailers/%{name}.thumbnailer # Mime support install -p -D -m 644 %{SOURCE5} %{buildroot}%{_datadir}/mime/packages/%{name}.xml @@ -263,7 +244,9 @@ install -p -m 644 -D %{SOURCE2} %{buildroot}%{_datadir}/metainfo/%{name}-fonts.m # Localization %find_lang %{name} -rm -fr %{buildroot}%{_datadir}/locale/languages + +# Avoid having locales listed twice +rm -fr %{buildroot}%{_datadir}/%{blender_api}/locale/languages %check appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml @@ -304,6 +287,7 @@ fi %{_datadir}/%{name}/ %{_datadir}/icons/hicolor/*/apps/%{name}*.* %{_datadir}/mime/packages/%{name}.xml +%{_datadir}/thumbnailers/%{name}.thumbnailer %{_mandir}/man1/%{name}.* #%%files -n %%{name}player @@ -322,6 +306,10 @@ fi %{_fontbasedir}/%{name}/ %changelog +* Sun Aug 18 2019 Simone Caronni - 1:2.80-5 +- Clean up patches/sources. +- Fix installation of locales, scripts, thumbnailer, etc. + * Thu Aug 15 2019 Luya Tshimbalanga - 1:2.80-4 - Restore broken international fonts support diff --git a/blender.thumbnailer b/blender.thumbnailer new file mode 100644 index 0000000..3de5dd5 --- /dev/null +++ b/blender.thumbnailer @@ -0,0 +1,4 @@ +[Thumbnailer Entry] +TryExec=blender-thumbnailer.py +Exec=blender-thumbnailer.py %i %o +MimeType=application/x-blender; diff --git a/sources b/sources index 686cd38..0094357 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ SHA512 (blender-2.80.tar.gz) = b70bbfc81b56ac9570e057e259681029416caf5c7279513d9b8d9f47507348c9ca90e2972b9dc77da85aa242afe07bb8dff2eee94ea4582cc5209dfdce38310e -SHA512 (blender-2.80-locale.patch) = 154c7f0e1a321801211d05dec716ef71417d9bf44aac62e06614e70a226795025e9443b15afba3036717970c2681f0c748f36fa6ddf8eae1bf9788c359f6c88d