Commit d446a74c authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Merge remote-tracking branch 'origin/master' into voronwe/colorsmudge-v2-master

# Conflicts:
#	libs/global/krita_container_utils.h
#	libs/image/kis_transaction.h
#	libs/image/kis_transaction_data.cpp
#	libs/image/kis_transaction_data.h
#	libs/image/tests/kis_algebra_2d_test.cpp
#	libs/image/tests/kis_transaction_test.cpp
#	libs/pigment/tests/KoRgbU8ColorSpaceTester.cpp
#	libs/pigment/tests/KoRgbU8ColorSpaceTester.h
parents d4b34e3e 22e70a0b

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -33,3 +33,5 @@ BROWSE
build_dir
.flatpak-builder
.cache
cmake-build-debug/
......@@ -10,9 +10,10 @@ project (krita-and-all-its-deps)
iF(APPLE)
exec_program("sysctl -n hw.optional.arm64" OUTPUT_VARIABLE APPLE_ON_ARM)
if(${APPLE_ON_ARM} EQUAL 1)
cmake_minimum_required(VERSION 3.19.3)
execute_process(COMMAND sysctl -n hw.optional.arm64 OUTPUT_VARIABLE apple_has_arm64_optional)
if(apple_has_arm64_optional)
message(NOTICE "Building on macos arm")
cmake_minimum_required(VERSION 3.19.3)
else()
cmake_minimum_required(VERSION 3.7.2)
endif()
......
SET(PREFIX_ext_fftw3 "${EXTPREFIX}" )
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i?86.*|x86.*|x86_64.*|amd64.*|AMD64.*)")
set(SSE_OPTIMIZATIONS_STRING "-ENABLE_SSE=ON" "-ENABLE_SSE2=ON")
set(SSE_OPTIMIZATIONS_STRING "-DENABLE_SSE=ON" "-DENABLE_SSE2=ON")
else()
set(SSE_OPTIMIZATIONS_STRING "")
endif()
......
--- a/gettext-tools/libgettextpo/Makefile.am 2020-07-26 20:31:02.000000000 +0000
+++ b/gettext-tools/libgettextpo/Makefile.am 2020-07-26 20:31:02.000000000 +0000
@@ -107,7 +107,25 @@
# How to build libgettextpo.la.
# Don't make it depend on libgettextsrc.la or libgettextlib.la, since they
# define an uncontrolled amount of symbols.
-libgettextpo_la_LIBADD = libgnu.la $(WOE32_LIBADD) $(LTLIBUNISTRING)
+# Amyspark: Need @LTLIBTEXTSTYLE@ because in macOS the linker will complain:
+# Undefined symbols for architecture x86_64:
+# "_file_ostream_create", referenced from:
+# _msgdomain_list_print in write-catalog.o
+# "_ostream_free", referenced from:
+# _msgdomain_list_print in write-catalog.o
+# "_ostream_write_mem", referenced from:
+# _message_print_comment in write-po.o
+# _wrap in write-po.o
+# "_ostream_write_str", referenced from:
+# _message_print_comment in write-po.o
+# _message_print_comment_dot in write-po.o
+# _message_print_comment_filepos in write-po.o
+# _message_print_comment_flags in write-po.o
+# _msgdomain_list_print_po in write-po.o
+# _wrap in write-po.o
+# ld: symbol(s) not found for architecture x86_64
+# clang: error: linker command failed with exit code 1 (use -v to see invocation)
+libgettextpo_la_LIBADD = libgnu.la ../../libtextstyle/lib/libtextstyle.la $(WOE32_LIBADD) $(LTLIBUNISTRING)
libgettextpo_la_LDFLAGS = \
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
-rpath $(libdir) \
--- a/gettext-tools/libgettextpo/Makefile.in 2020-07-26 21:04:58.000000000 +0000
+++ b/gettext-tools/libgettextpo/Makefile.in 2020-07-26 21:04:58.000000000 +0000
@@ -557,7 +555,8 @@
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
@WOE32_TRUE@am__DEPENDENCIES_1 = libgettextpo.res.lo
am__DEPENDENCIES_2 =
-libgettextpo_la_DEPENDENCIES = libgnu.la $(am__DEPENDENCIES_1) \
+libgettextpo_la_DEPENDENCIES = libgnu.la \
+ ../../libtextstyle/lib/libtextstyle.la $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
am__libgettextpo_la_SOURCES_DIST = gettext-po.c ../src/str-list.c \
../src/dir-list.c ../src/message.c ../src/msgl-ascii.c \
@@ -2545,7 +2544,25 @@
# How to build libgettextpo.la.
# Don't make it depend on libgettextsrc.la or libgettextlib.la, since they
# define an uncontrolled amount of symbols.
-libgettextpo_la_LIBADD = libgnu.la $(WOE32_LIBADD) $(LTLIBUNISTRING)
+# Amyspark: Need @LTLIBTEXTSTYLE@ because in macOS the linker will complain:
+# Undefined symbols for architecture x86_64:
+# "_file_ostream_create", referenced from:
+# _msgdomain_list_print in write-catalog.o
+# "_ostream_free", referenced from:
+# _msgdomain_list_print in write-catalog.o
+# "_ostream_write_mem", referenced from:
+# _message_print_comment in write-po.o
+# _wrap in write-po.o
+# "_ostream_write_str", referenced from:
+# _message_print_comment in write-po.o
+# _message_print_comment_dot in write-po.o
+# _message_print_comment_filepos in write-po.o
+# _message_print_comment_flags in write-po.o
+# _msgdomain_list_print_po in write-po.o
+# _wrap in write-po.o
+# ld: symbol(s) not found for architecture x86_64
+# clang: error: linker command failed with exit code 1 (use -v to see invocation)
+libgettextpo_la_LIBADD = libgnu.la ../../libtextstyle/lib/libtextstyle.la $(WOE32_LIBADD) $(LTLIBUNISTRING)
libgettextpo_la_LDFLAGS = -version-info \
$(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) -rpath $(libdir) \
@LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined $(am__append_2) \
From 2cc77af610d89a97322f662aaead435c1597941c Mon Sep 17 00:00:00 2001
From: "L. E. Segovia" <amy@amyspark.me>
Date: Sat, 20 Feb 2021 20:03:28 +0000
Subject: [PATCH 1/5] Fix macro definitions
https://github.com/microsoft/vcpkg/tree/c84dfe7ddd6f3ba14ec9f4b1f2c577365175128b/ports/gettext
---
gettext-runtime/intl/xsize.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gettext-runtime/intl/xsize.h b/gettext-runtime/intl/xsize.h
index 9b9840f7..3007228a 100644
--- a/gettext-runtime/intl/xsize.h
+++ b/gettext-runtime/intl/xsize.h
@@ -29,6 +29,11 @@
/* Get ATTRIBUTE_PURE. */
#include "attribute.h"
+#if defined _WIN32
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+# define _GL_INLINE static inline
+#endif
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
--
2.30.0
From 769ef6c47efaf552e3c6ff35e12733cdb1d80f17 Mon Sep 17 00:00:00 2001
From: "L. E. Segovia" <amy@amyspark.me>
Date: Sat, 20 Feb 2021 20:04:21 +0000
Subject: [PATCH 2/5] Fix uwp build
---
gettext-runtime/intl/langprefs.c | 10 ++++++++--
gettext-runtime/intl/localcharset.c | 14 ++++++++++++--
gettext-runtime/intl/localename.c | 10 ++++++++--
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/gettext-runtime/intl/langprefs.c b/gettext-runtime/intl/langprefs.c
index f774ba2b..498933a7 100644
--- a/gettext-runtime/intl/langprefs.c
+++ b/gettext-runtime/intl/langprefs.c
@@ -36,8 +36,14 @@
extern void _nl_locale_name_canonicalize (char *name);
#endif
-#if defined _WIN32
-# define WIN32_NATIVE
+#if defined _WIN32 || defined __WIN32__
+# if !defined(WINAPI_FAMILY)
+# define WIN32_NATIVE
+# else
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+# define WIN32_NATIVE
+# endif
+# endif
#endif
#ifdef WIN32_NATIVE
diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c
index ec754276..3028bc28 100644
--- a/gettext-runtime/intl/localcharset.c
+++ b/gettext-runtime/intl/localcharset.c
@@ -36,6 +36,16 @@
# include <locale.h>
#endif
+#if defined _WIN32 || defined __WIN32__
+# if !defined(WINAPI_FAMILY)
+# define HAVE_ACP
+# else
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+# define HAVE_ACP
+# endif
+# endif
+#endif
+
#if defined __EMX__
/* Assume EMX program runs on OS/2, even if compiled under DOS. */
# ifndef OS2
@@ -830,7 +840,7 @@ STATIC
const char *
locale_charset (void)
{
- const char *codeset;
+ const char *codeset = NULL;
/* This function must be multithread-safe. To achieve this without using
thread-local storage, we use a simple strcpy or memcpy to fill this static
@@ -912,7 +922,7 @@ locale_charset (void)
/* The canonical name cannot be determined. */
codeset = "";
-# elif defined WINDOWS_NATIVE
+# elif defined WINDOWS_NATIVE && defined HAVE_ACP
char buf[2 + 10 + 1];
static char resultbuf[2 + 10 + 1];
diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c
index 6458f757..a3845a4f 100644
--- a/gettext-runtime/intl/localename.c
+++ b/gettext-runtime/intl/localename.c
@@ -72,8 +72,14 @@ extern char * getlocalename_l(int, locale_t);
# include <CoreFoundation/CFPreferences.h>
#endif
-#if defined _WIN32 && !defined __CYGWIN__
-# define WINDOWS_NATIVE
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if !defined(WINAPI_FAMILY)
+# define WINDOWS_NATIVE
+# else
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+# define WINDOWS_NATIVE
+# endif
+# endif
# if !defined IN_LIBINTL
# include "glthread/lock.h"
# endif
--
2.30.0
From 61cefcbb98613fff9a3864b81299611c4493adf5 Mon Sep 17 00:00:00 2001
From: "L. E. Segovia" <amy@amyspark.me>
Date: Sat, 20 Feb 2021 20:05:25 +0000
Subject: [PATCH 3/5] Fix win unicode paths
---
gettext-runtime/intl/loadmsgcat.c | 49 +++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c
index 016fe575..030b8619 100644
--- a/gettext-runtime/intl/loadmsgcat.c
+++ b/gettext-runtime/intl/loadmsgcat.c
@@ -388,6 +388,55 @@ char *alloca ();
# define munmap(addr, len) __munmap (addr, len)
#endif
+#ifdef _WIN32
+/* Provide wrapper of "open" for Windows that supports UTF-8 filenames. */
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# ifndef WIN32_EXTRA_LEAN
+# define WIN32_EXTRA_LEAN
+# endif
+# undef NOMINMAX
+# define NOMINMAX
+# include <windows.h> // For: MultiByteToWideChar
+# include <io.h>
+# include <wchar.h>
+
+int _open_utf8_windows_wrapper(
+ const char *filename,
+ int flags
+)
+{
+ int wstr_len = -1;
+ wchar_t* pUtf16FileName = NULL;
+ int fh = -1;
+
+ // on Windows, convert the filename from UTF-8 to UTF-16
+ wstr_len = MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
+ if (wstr_len <= 0)
+ {
+ // MultiByteToWideChar failed
+ errno = ENOENT;
+ return -1;
+ }
+ pUtf16FileName = malloc(wstr_len * sizeof(wchar_t));
+ if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, pUtf16FileName, wstr_len) == 0)
+ {
+ // MultiByteToWideChar failed
+ free(pUtf16FileName);
+ errno = ENOENT;
+ return -1;
+ }
+
+ // and call _wopen
+ fh = _wopen(pUtf16FileName, flags);
+
+ free(pUtf16FileName);
+ return fh;
+}
+# define open(name, flags) _open_utf8_windows_wrapper(name, flags)
+#endif // #ifdef _WIN32
+
/* For those losing systems which don't have `alloca' we have to add
some additional code emulating it. */
#ifdef HAVE_ALLOCA
--
2.30.0
This diff is collapsed.
......@@ -4,8 +4,8 @@ if (MINGW)
ExternalProject_Add(ext_gettext_bin
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext0.19.8.1-iconv1.15-static-64.zip
URL_MD5 3f8298041738b8ec1f7278d147b7cd3d
URL https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-static-64.zip
URL_HASH SHA256=721395c2e057eeed321f0c793311732e57cb4fa30d5708672a13902a69a77d43
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying gettext 64-bit dependencies
CONFIGURE_COMMAND ""
......@@ -17,10 +17,10 @@ if (MINGW)
ExternalProject_Add(ext_gettext_bin
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext0.19.8.1-iconv1.15-static-32.zip
URL_MD5 970afaea0d433a73a996d709d5c22f6d
URL https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-static-32.zip
URL_HASH SHA256=73a1b64a15fff9e6a5dc980d0a69cf3a24bde51bd47091a1b3fef68827ef23a8
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying gettext 64-bit dependencies
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying gettext 32-bit dependencies
CONFIGURE_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> ${PREFIX_ext_gettext}
......@@ -30,9 +30,13 @@ if (MINGW)
ExternalProject_Add (
ext_gettext_lib
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://ftp.gnu.org/gnu/gettext/gettext-0.18.tar.gz
URL_MD5 d52a3e061032a1ed13856d42fc86f0fd
PATCH_COMMAND ${PATCH_COMMAND} --binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gettext-0.18-20130319.diff
URL https://ftpmirror.gnu.org/gettext/gettext-0.21.tar.gz
URL_HASH SHA256=c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12
PATCH_COMMAND ${PATCH_COMMAND} --binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0001-Fix-macro-definitions.patch
COMMAND ${PATCH_COMMAND} --binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0002-Fix-uwp-build.patch
COMMAND ${PATCH_COMMAND} --binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0003-Fix-win-unicode-paths.patch
COMMAND ${PATCH_COMMAND} --binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0004-vcpkg-CMake-toolchain.patch
INSTALL_DIR ${PREFIX_ext_gettext}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_gettext} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
UPDATE_COMMAND ""
......@@ -43,9 +47,10 @@ if (MINGW)
else (MINGW)
ExternalProject_Add( ext_gettext
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext-0.19.8.tar.gz
URL_MD5 e4fffc004f21596becd1055cf36be31d
URL https://ftpmirror.gnu.org/gettext/gettext-0.21.tar.gz
URL_HASH SHA256=c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12
PATCH_COMMAND ${PATCH_COMMAND} -Z -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0001-Fix-libgettextpo-linking-on-macOS.patch
INSTALL_DIR ${PREFIX_ext_gettext}
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PREFIX_ext_gettext} --disable-java ${GLOBAL_AUTOMAKE_PROFILE} --disable-native-java
BUILD_COMMAND make
......
This diff is collapsed.
From 0ad48d528f7fa187b493efd03f100e39f9651025 Mon Sep 17 00:00:00 2001
From: "L. E. Segovia" <amy@amyspark.me>
Date: Mon, 22 Feb 2021 12:42:32 +0000
Subject: [PATCH 1/3] Silence nasm 2.15 warnings
https://bitbucket.org/multicoreware/x265_git/issues/559/warnings-when-assembling-with-nasm-215
---
source/cmake/CMakeASM_NASMInformation.cmake | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source/cmake/CMakeASM_NASMInformation.cmake b/source/cmake/CMakeASM_NASMInformation.cmake
index 45c0ad1..62767c2 100644
--- a/source/cmake/CMakeASM_NASMInformation.cmake
+++ b/source/cmake/CMakeASM_NASMInformation.cmake
@@ -40,6 +40,8 @@ else()
list(APPEND ASM_FLAGS -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -DX265_NS=${X265_NS})
endif()
+list(APPEND ASM_FLAGS -w-macro-params-legacy)
+
list(APPEND ASM_FLAGS "${CMAKE_ASM_NASM_FLAGS}")
if(CMAKE_BUILD_TYPE MATCHES Release)
--
2.30.1.windows.1
From 524bd821aa7314c7719901bc6145be54cbc4b785 Mon Sep 17 00:00:00 2001
From: "L. E. Segovia" <amy@amyspark.me>
Date: Mon, 22 Feb 2021 13:49:27 +0000
Subject: [PATCH 2/3] Fix rc versioning
---
x265Version.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x265Version.txt b/x265Version.txt
index 1b4efb4..dff6835 100644
--- a/x265Version.txt
+++ b/x265Version.txt
@@ -1,4 +1,4 @@
#Attribute: Values
repositorychangeset: 681c05e83
-releasetagdistance: dev
+releasetagdistance: 20210203
releasetag: 3.5
--
2.30.1.windows.1
From 92eb7b933de20a47d69ac99d22983a8ee8376f55 Mon Sep 17 00:00:00 2001
From: "L. E. Segovia" <amy@amyspark.me>
Date: Mon, 22 Feb 2021 13:59:19 +0000
Subject: [PATCH 3/3] Skip PDB in MinGW
---
source/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 95218f5..6de921d 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -599,7 +599,7 @@ if(SVTHEVC_FOUND)
endif()
install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include)
-if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED))
+if((WIN32 AND NOT MINGW AND ENABLE_CLI) OR (WIN32 AND NOT MINGW AND ENABLE_SHARED))
if(MSVC_IDE)
install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
--
2.30.1.windows.1
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index c019c2e07..c2e5ed92b 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -584,7 +584,7 @@ if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED))
install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
install(FILES "${PROJECT_BINARY_DIR}/Debug/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY)
install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY)
- else()
+ elseif(NOT MINGW)
install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY)
This diff is collapsed.
diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp
index 2db7a146b..4ed534d6b 100644
--- a/source/common/threadpool.cpp
+++ b/source/common/threadpool.cpp
@@ -115,12 +115,6 @@ void WorkerThread::threadMain()
{
THREAD_NAME("Worker", m_id);
-#if _WIN32
- SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
-#else
- __attribute__((unused)) int val = nice(10);
-#endif
-
m_pool.setCurrentThreadAffinity();
sleepbitmap_t idBit = (sleepbitmap_t)1 << m_id;
......@@ -18,8 +18,8 @@ if (WIN32)
ExternalProject_Add(
ext_nasm
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.nasm.us/pub/nasm/releasebuilds/2.14.03rc2/win64/nasm-2.14.03rc2-win64.zip
URL_MD5 f12d14ca46cf397a1d27ac0edde548fb
URL https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-win64.zip
URL_HASH SHA256=f5c93c146f52b4f1664fa3ce6579f961a910e869ab0dae431bd871bdd2584ef2
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying nasm 64-bit dependencies
CONFIGURE_COMMAND ""
......@@ -33,10 +33,10 @@ if (WIN32)
ExternalProject_Add(
ext_nasm
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.nasm.us/pub/nasm/releasebuilds/2.14.03rc2/win32/nasm-2.14.03rc2-win32.zip
URL_MD5 9ec22ac06a6b9d993ef503ea2fe074ab
URL https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win32/nasm-2.15.05-win32.zip
URL_HASH SHA256=258c7d1076e435511cf2fdf94e2281eadbdb9e3003fd57f356f446e2bce3119e
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying nasm 64-bit dependencies
BUILD_COMMAND ${CMAKE_COMMAND} -E echo Deploying nasm 32-bit dependencies
CONFIGURE_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/rdoff ${EXTPREFIX_heif}/bin/rdoff
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/nasm.exe ${EXTPREFIX_heif}/bin/nasm.exe
......@@ -49,8 +49,8 @@ else (WIN32)
ExternalProject_Add(
ext_nasm
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.nasm.us/pub/nasm/releasebuilds/2.14.03rc2/nasm-2.14.03rc2.tar.gz
URL_MD5 4cd1fe6788cd15d08c1a8f18b6d2428e
URL https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz
URL_HASH SHA256=9182a118244b058651c576baa9d0366ee05983c4d4ae1d9ddd3236a9f2304997
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${EXTPREFIX_heif} ${GLOBAL_AUTOMAKE_PROFILE}
BUILD_COMMAND make
......@@ -60,76 +60,143 @@ ExternalProject_Add(
)
endif(WIN32)
IF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)")
ExternalProject_Add(ext_libx265_10bit
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://ftp.videolan.org/pub/videolan/x265/x265_3.2.1.tar.gz
URL_MD5 94808045a34d88a857e5eaf3f68f4bca
SOURCE_SUBDIR source/
set(EXTRA_AVIF_DEPS "")
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_heif} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DHIGH_BIT_DEPTH=TRUE -DEXPORT_C_API=FALSE -DENABLE_CLI=FALSE -DENABLE_SHARED=FALSE
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy libx265.a ${EXTPREFIX_heif}/lib/libx265_main10.a
)
ExternalProject_Add(ext_libx265_12bit
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://ftp.videolan.org/pub/videolan/x265/x265_3.2.1.tar.gz
URL_MD5 94808045a34d88a857e5eaf3f68f4bca
find_program(MESON_BINARY_PATH meson)
find_program(NINJA_BINARY_PATH ninja)
find_program(RUSTC_BINARY_PATH rustc)
SOURCE_SUBDIR source/
if(MESON_BINARY_PATH AND NINJA_BINARY_PATH AND RUSTC_BINARY_PATH)
message(STATUS "Enabling AVIF support.")
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_heif} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
-DHIGH_BIT_DEPTH=TRUE -DMAIN12=TRUE -DEXPORT_C_API=FALSE -DENABLE_CLI=FALSE -DENABLE_SHARED=FALSE
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy libx265.a ${EXTPREFIX_heif}/lib/libx265_main12.a
)
ExternalProject_Add(
ext_libx265
ext_dav1d
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://ftp.videolan.org/pub/videolan/x265/x265_3.2.1.tar.gz
URL_MD5 94808045a34d88a857e5eaf3f68f4bca
URL https://downloads.videolan.org/pub/videolan/dav1d/0.8.2/dav1d-0.8.2.tar.xz
URL_HASH SHA256=3dd91d96b44e9d8ba7e82ad9e730d6c579ab5e19edca0db857a60f5ae6a0eb13
SOURCE_SUBDIR source/
CONFIGURE_COMMAND meson <SOURCE_DIR> --prefix=${EXTPREFIX_heif}
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/02-skip-pdb-in-mingw.diff
BUILD_COMMAND meson compile -j${SUBMAKE_JOBS}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_heif} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DENABLE_SHARED=TRUE -DENABLE_HDR10_PLUS=TRUE -DEXTRA_LIB:String=x265_main10.a$<SEMICOLON>x265_main12.a -DEXTRA_LINK_FLAGS:String=-L${EXTPREFIX_heif}/lib -DLINKED_10BIT=TRUE -DLINKED_12BIT=TRUE
INSTALL_COMMAND meson install
UPDATE_COMMAND ""
DEPENDS ext_nasm ext_libx265_10bit ext_libx265_12bit
DEPENDS ext_nasm
)
else ()
# x265 in 32-bit platforms cannot support 10-bit and 12-bit images
# because they either crash on malloc or require SSE4.1+ extensions
# Same for aarch64, support for 10-bit and 12-bit requires NEON extensions
# and these are broken as of 3.4
ExternalProject_Add(
ext_libx265
ext_rav1e
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://ftp.videolan.org/pub/videolan/x265/x265_3.2.1.tar.gz
URL_MD5 94808045a34d88a857e5eaf3f68f4bca
URL https://github.com/xiph/rav1e/archive/v0.5.0-alpha.tar.gz
URL_HASH SHA256=fd884fa387d01860eaf22a0a97353525221eb32bf6b9154bbfa21b6cce5988c8
SOURCE_SUBDIR source/
CONFIGURE_COMMAND ""
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/02-skip-pdb-in-mingw.diff
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0003-arm-asm-primitives.patch
BUILD_COMMAND cargo cbuild --release --prefix=${EXTPREFIX_heif} --library-type=cdylib -j${SUBMAKE_JOBS}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_heif} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DENABLE_SHARED=TRUE -DENABLE_CLI=FALSE
INSTALL_COMMAND cargo cinstall --release --library-type=cdylib --prefix=${EXTPREFIX_heif}
UPDATE_COMMAND ""
BUILD_IN_SOURCE 1
DEPENDS ext_nasm
)
endif ()
# External projects do not accept single commands.
ExternalProject_Add_Step(
ext_rav1e ext_cargo_c
COMMENT "Installing cargo-c 0.7.2 to ${EXTPREFIX_heif}"
COMMAND cargo install cargo-c --version 0.7.2 --root=${EXTPREFIX_heif} -j${SUBMAKE_JOBS}
DEPENDEES configure
DEPENDERS build