summaryrefslogtreecommitdiffstats
path: root/external/lcms2
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--external/lcms2/ExternalPackage_lcms2.mk24
-rw-r--r--external/lcms2/ExternalProject_lcms2.mk46
-rw-r--r--external/lcms2/Makefile7
-rw-r--r--external/lcms2/Module_lcms2.mk18
-rw-r--r--external/lcms2/README5
-rw-r--r--external/lcms2/UnpackedTarball_lcms2.mk24
-rw-r--r--external/lcms2/c++17.patch.113
-rw-r--r--external/lcms2/lcms2-2.4-windows.patch30
-rw-r--r--external/lcms2/lcms2-windows_aarch64_outdir.patch.126
9 files changed, 193 insertions, 0 deletions
diff --git a/external/lcms2/ExternalPackage_lcms2.mk b/external/lcms2/ExternalPackage_lcms2.mk
new file mode 100644
index 0000000000..a2c051f6eb
--- /dev/null
+++ b/external/lcms2/ExternalPackage_lcms2.mk
@@ -0,0 +1,24 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,lcms2,lcms2))
+
+$(eval $(call gb_ExternalPackage_use_external_project,lcms2,lcms2))
+
+ifeq ($(DISABLE_DYNLOADING),)
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.2.dylib,src/.libs/liblcms2.2.dylib))
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/lcms2.dll,bin/lcms2.dll))
+else
+$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.15))
+endif
+endif # $(DISABLE_DYNLOADING)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/ExternalProject_lcms2.mk b/external/lcms2/ExternalProject_lcms2.mk
new file mode 100644
index 0000000000..47d9089dc7
--- /dev/null
+++ b/external/lcms2/ExternalProject_lcms2.mk
@@ -0,0 +1,46 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,lcms2))
+
+$(eval $(call gb_ExternalProject_register_targets,lcms2,\
+ build \
+))
+
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,lcms2,build):
+ $(call gb_Trace_StartRange,lcms2,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ MSBuild.exe lcms2_DLL.vcxproj \
+ $(gb_MSBUILD_CONFIG_AND_PLATFORM) /p:TargetName=lcms2 \
+ /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \
+ $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \
+ ,Projects/VC2019/lcms2_DLL)
+ $(call gb_Trace_EndRange,lcms2,EXTERNAL)
+else
+$(call gb_ExternalProject_get_state_target,lcms2,build):
+ $(call gb_Trace_StartRange,lcms2,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ $(gb_RUN_CONFIGURE) ./configure --without-jpeg --without-tiff --with-pic \
+ $(gb_CONFIGURE_PLATFORMS) \
+ $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \
+ CPPFLAGS=" $(SOLARINC)" \
+ CFLAGS='$(CFLAGS) $(call gb_ExternalProject_get_build_flags,lcms2)' \
+ $(if $(DISABLE_DYNLOADING), \
+ --enable-static --disable-shared \
+ , \
+ --enable-shared --disable-static \
+ ) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && cd src \
+ && $(MAKE) \
+ )
+ $(call gb_Trace_EndRange,lcms2,EXTERNAL)
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/Makefile b/external/lcms2/Makefile
new file mode 100644
index 0000000000..e4968cf85f
--- /dev/null
+++ b/external/lcms2/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/Module_lcms2.mk b/external/lcms2/Module_lcms2.mk
new file mode 100644
index 0000000000..807dbae438
--- /dev/null
+++ b/external/lcms2/Module_lcms2.mk
@@ -0,0 +1,18 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,lcms2))
+
+$(eval $(call gb_Module_add_targets,lcms2,\
+ UnpackedTarball_lcms2 \
+ ExternalPackage_lcms2 \
+ ExternalProject_lcms2 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/README b/external/lcms2/README
new file mode 100644
index 0000000000..2d5fea93a3
--- /dev/null
+++ b/external/lcms2/README
@@ -0,0 +1,5 @@
+lcms2 (Little CMS color engine)
+lcms2: Little CMS is a small, speed optimized color management engine.
+With the new libcdr, writerperfect depends on lcms2.
+
+From [https://www.littlecms.com/color-engine/].
diff --git a/external/lcms2/UnpackedTarball_lcms2.mk b/external/lcms2/UnpackedTarball_lcms2.mk
new file mode 100644
index 0000000000..28b30ef3ac
--- /dev/null
+++ b/external/lcms2/UnpackedTarball_lcms2.mk
@@ -0,0 +1,24 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,lcms2))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,lcms2,$(LCMS2_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,lcms2))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,lcms2,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,lcms2,\
+ external/lcms2/lcms2-2.4-windows.patch \
+ external/lcms2/lcms2-windows_aarch64_outdir.patch.1 \
+ external/lcms2/c++17.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/c++17.patch.1 b/external/lcms2/c++17.patch.1
new file mode 100644
index 0000000000..dc5b2ccde4
--- /dev/null
+++ b/external/lcms2/c++17.patch.1
@@ -0,0 +1,13 @@
+diff --git a/include/lcms2.h b/include/lcms2.h
+index cf52014..926e2a0 100644
+--- a/include/lcms2.h
++++ b/include/lcms2.h
+@@ -62,7 +62,7 @@
+ // #define CMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT
+
+ // Uncomment this to remove the "register" storage class
+-// #define CMS_NO_REGISTER_KEYWORD 1
++#define CMS_NO_REGISTER_KEYWORD 1
+
+ // ********** End of configuration toggles ******************************
+
diff --git a/external/lcms2/lcms2-2.4-windows.patch b/external/lcms2/lcms2-2.4-windows.patch
new file mode 100644
index 0000000000..1b5dfdffe8
--- /dev/null
+++ b/external/lcms2/lcms2-2.4-windows.patch
@@ -0,0 +1,30 @@
+This patch is necessary for Windows (32-bit) build.
+
+(In Jenkins' build message)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsGetColorSpace referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsChannelsOf referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsOpenProfileFromMem referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsCloseProfile referenced in function "public: void __thiscall fxcodec::`anonymous namespace'::CmsProfileDeleter::operator()(void *)" (??RCmsProfileDeleter@?A0xf5ac6891@fxcodec@@QAEXPAX@Z)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsCreate_sRGBProfile referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsCreateTransform referenced in function "public: static class std::unique_ptr<class fxcodec::IccTransform,struct std::default_delete<class fxcodec::IccTransform> > __cdecl fxcodec::IccTransform::CreateTransformSRGB(class pdfium::span<unsigned char const >)" (?CreateTransformSRGB@IccTransform@fxcodec@@SA?AV?$unique_ptr@VIccTransform@fxcodec@@U?$default_delete@VIccTransform@fxcodec@@@std@@@std@@V?$span@$$CBE@pdfium@@@Z)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsDeleteTransform referenced in function "public: __thiscall fxcodec::IccTransform::~IccTransform(void)" (??1IccTransform@fxcodec@@QAE@XZ)
+> icc_transform.o : error LNK2019: unresolved external symbol _cmsDoTransform referenced in function "public: void __thiscall fxcodec::IccTransform::Translate(class pdfium::span<float const >,class pdfium::span<float>)" (?Translate@IccTransform@fxcodec@@QAEXV?$span@$$CBM@pdfium@@V?$span@M@4@@Z)
+>
+> C:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\instdir\program\pdfiumlo.dll : fatal error LNK1120: 8 unresolved externals
+
+--- misc/lcms2/include/lcms2.h 2023-03-01 03:53:11.000000000 +0900
++++ misc/build/lcms2/include/lcms2.h 2023-11-29 15:47:08.535240600 +0900
+@@ -226,6 +226,13 @@ typedef int cmsBool;
+ #endif // CMS_USE_BIG_ENDIAN
+
+
++// LibreOffice always builds this as DLL and with the stdcall calling
++// convention, so make this usable from outside without having to
++// specify CMS_DLL manually whenever the library is used.
++#if !defined(CMS_DLL_BUILD) && !defined(CMS_DLL) && defined(_MSC_VER) && defined(_M_IX86)
++#define CMS_DLL
++#endif
++
+ // Calling convention -- this is hardly platform and compiler dependent
+ #if defined(CMS_IS_WINDOWS_) && !defined(__GNUC__)
+ # if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
diff --git a/external/lcms2/lcms2-windows_aarch64_outdir.patch.1 b/external/lcms2/lcms2-windows_aarch64_outdir.patch.1
new file mode 100644
index 0000000000..aa27b1b779
--- /dev/null
+++ b/external/lcms2/lcms2-windows_aarch64_outdir.patch.1
@@ -0,0 +1,26 @@
+diff -ur lcms2.org/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj lcms2/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj
+--- lcms2.org/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj 2023-12-08 18:49:59.819483000 +0100
++++ lcms2/Projects/VC2019/lcms2_DLL/lcms2_DLL.vcxproj 2023-12-08 18:50:59.460115500 +0100
+@@ -92,6 +92,7 @@
+ <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir>
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">..\..\..\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)_$(Platform)\</IntDir>
+@@ -100,6 +101,7 @@
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir>
++ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">..\..\..\bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(Configuration)_$(Platform)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)_$(Platform)\</IntDir>
+@@ -340,4 +342,4 @@
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+-</Project>
+\ No newline at end of file
++</Project>