Kaydet (Commit) 585d9806 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#114635: Add TWAINDSM.DLL to 64-bit Windows package

This patch allows us to use our own bundled TWAINDSM.dll (from
twain-dsm project, http://www.twain.org, https://github.com/twain/twain-dsm)
on 64-bit Windows systems that don't have their own TWAIN DLL,
and without requiring users to install it from some other source.
The DLL is put into INSTALLOCATION/program along soffice.bin.
Of course, TWAIN sources still need to be 64-bit themselves (i.e.,
true 64-bit TWAIN drivers required) to be usable by 64-bit program.

Also this drops external/twain/inc/twain/twain.h, which is an old
version copied from twain-dsm, and instead uses the tarball to get
the header (required by Library_scn on both 32- and 64-bit Windows).

Change-Id: I191027f3221ce46db17f50db91c9cb9315900810
Reviewed-on: https://gerrit.libreoffice.org/46992Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst a1c36eff
......@@ -210,6 +210,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,RHINO,SWING_TARBALL) \
$(call fetch_Optional,SERF,SERF_TARBALL) \
$(call fetch_Optional,STAROFFICE,STAROFFICE_TARBALL) \
$(if $(filter WNT,$(OS)),TWAIN_DSM_TARBALL) \
$(call fetch_Optional,UCPP,UCPP_TARBALL) \
$(call fetch_Optional,VISIO,VISIO_TARBALL) \
$(call fetch_Optional,WPD,WPD_TARBALL) \
......
......@@ -957,6 +957,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\
)) \
sfx2_classification \
$(if $(filter OPENCL,$(BUILD_TYPE)),sc_opencl_runtimetest) \
$(if $(and $(filter WNT,$(OS)), $(filter X86_64,$(CPUNAME))),twain_dsm) \
))
$(eval $(call gb_Helper_register_packages_for_install,ooo_fonts,\
......
......@@ -115,10 +115,16 @@ ifeq (SANE,$(filter SANE,$(BUILD_TYPE)))
define gb_LinkTarget__use_sane_headers
$(call gb_LinkTarget_set_include,$(1),\
-I$(SRCDIR)/external/$(if $(filter WNT,$(OS)),twain,sane)/inc \
$$(INCLUDE) \
$(if $(filter WNT,$(OS)), \
-I$(call gb_UnpackedTarball_get_dir,twain_dsm/pub/include), \
-I$(SRCDIR)/external/sane/inc) \
$$(INCLUDE) \
)
ifeq ($(OS),WNT)
$(call gb_LinkTarget_use_unpacked,$(1),twain_dsm)
endif
endef
else
......
......@@ -228,6 +228,8 @@ export STAROFFICE_VERSION_MICRO := 5
export STAROFFICE_TARBALL := libstaroffice-0.0.$(STAROFFICE_VERSION_MICRO).tar.xz
export SWING_SHA256SUM := 64585ac36a81291a58269ec5347e7e3e2e8596dbacb9221015c208191333c6e1
export SWING_TARBALL := 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
export TWAIN_DSM_SHA256SUM := 82c818be771f242388457aa8c807e4b52aa84dc22b21c6c56184a6b4cbb085e6
export TWAIN_DSM_TARBALL := twaindsm_2.4.1.orig.tar.gz
export UCPP_SHA256SUM := 983941d31ee8d366085cadf28db75eb1f5cb03ba1e5853b98f12f7f51c63b776
export UCPP_TARBALL := 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
export VISIO_SHA256SUM := fe1002d3671d53c09bc65e47ec948ec7b67e6fb112ed1cd10966e211a8bb50f9
......
......@@ -91,6 +91,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,RHINO,rhino) \
$(call gb_Helper_optional,SERF,serf) \
$(call gb_Helper_optional,STAROFFICE,libstaroffice) \
$(if $(filter WNT,$(OS)),twain_dsm) \
$(call gb_Helper_optional,UCPP,ucpp) \
$(call gb_Helper_optional,VISIO,libvisio) \
$(call gb_Helper_optional,WPD,libwpd) \
......
This diff is collapsed.
# -*- 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,twain_dsm,twain_dsm))
$(eval $(call gb_ExternalPackage_use_external_project,twain_dsm,twain_dsm))
ifeq ($(OS),WNT)
$(eval $(call gb_ExternalPackage_add_file,twain_dsm,$(LIBO_BIN_FOLDER)/TWAINDSM.dll,PCBuild/out/TWAINDSM.dll))
endif
# headers are not delivered, but used from unpacked dir pub/include/
# vim: set noet sw=4 ts=4:
# -*- 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,twain_dsm))
$(eval $(call gb_ExternalProject_use_unpacked,twain_dsm,twain_dsm))
$(eval $(call gb_ExternalProject_register_targets,twain_dsm,\
build \
))
ifeq ($(OS),WNT)
$(call gb_ExternalProject_get_state_target,twain_dsm,build) :
$(call gb_ExternalProject_run,build,\
MSBuild.exe visual_studio/TWAIN_DSM_VS2015.sln /t:Build \
/p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
/p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
/p:OutDir=../PCBuild/out/ /p:IntDir=../PCBuild/obj/ \
$(if $(filter 140,$(VCVER)),/p:PlatformToolset=v140 /p:VisualStudioVersion=14.0 /ToolsVersion:14.0) \
$(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
$(if $(filter 150-10,$(VCVER)-$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \
)
endif
# vim: set noet sw=4 ts=4:
# -*- 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,twain_dsm))
ifeq ($(OS),WNT)
$(eval $(call gb_Module_add_targets,twain_dsm,\
UnpackedTarball_twain_dsm \
$(if $(filter X86_64,$(CPUNAME)), \
ExternalProject_twain_dsm \
ExternalPackage_twain_dsm \
) \
))
endif
# vim: set noet sw=4 ts=4:
Windows scanner support.
\ No newline at end of file
diff --git a/visual_studio/TWAIN_DSM_VS2015.vcxproj.filters b/visual_studio/TWAIN_DSM_VS2015.vcxproj.filters
new file mode 100755
index 000000000000..a17a30d0097f
--- /dev/null
+++ b/visual_studio/TWAIN_DSM_VS2015.vcxproj.filters
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\src\apps.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\src\dsm.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\src\hook.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\src\log.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\src\dsm.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\src\resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\src\twain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\src\dsm.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
This diff is collapsed.
# -*- 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,twain_dsm))
$(eval $(call gb_UnpackedTarball_set_tarball,twain_dsm,$(TWAIN_DSM_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_patchlevel,twain_dsm,1))
$(eval $(call gb_UnpackedTarball_add_patches,twain_dsm, \
external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.patch \
external/twain_dsm/TWAIN_DSM_VS2015.vcxproj.filters.patch \
))
# vim: set noet sw=4 ts=4:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment