mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 06:59:07 +08:00
Merge pull request #1924 from alex85k/spatialite-tools
[spatialite-tools] initial port (spatialite.exe and other tools)
This commit is contained in:
commit
efb482b788
4
ports/spatialite-tools/CONTROL
Normal file
4
ports/spatialite-tools/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: spatialite-tools
|
||||
Version: 4.3.0
|
||||
Description: Contains spatialite.exe and other command line tools to work with SpatiaLite databases (import, export, SQL queries)
|
||||
Build-Depends: sqlite3, libspatialite, geos, readosm, proj4, zlib, libiconv, expat
|
128
ports/spatialite-tools/fix-makefiles.patch
Normal file
128
ports/spatialite-tools/fix-makefiles.patch
Normal file
@ -0,0 +1,128 @@
|
||||
diff --git a/makefile.vc b/makefile.vc
|
||||
index 33c85d2..c811e7d 100644
|
||||
--- a/makefile.vc
|
||||
+++ b/makefile.vc
|
||||
@@ -15,7 +15,7 @@ SPATIALITE_OSM_RAW_EXE = spatialite_osm_raw.exe
|
||||
SPATIALITE_OSM_FILTER_EXE = spatialite_osm_filter.exe
|
||||
SPATIALITE_GML_EXE = spatialite_gml.exe
|
||||
|
||||
-CFLAGS = /nologo -IC:\OSGeo4W\include $(OPTFLAGS)
|
||||
+CFLAGS = /nologo -I$(INSTALLED_ROOT)\include $(OPTFLAGS)
|
||||
|
||||
default: all
|
||||
|
||||
@@ -26,89 +26,58 @@ all: $(SPATIALITE_EXE) $(SHP_DOCTOR_EXE) $(SPATIALITE_TOOL_EXE) \
|
||||
$(SPATIALITE_OSM_FILTER_EXE)
|
||||
|
||||
$(SPATIALITE_EXE): shell.obj
|
||||
- cl shell.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib C:\OSGeo4W\lib\geos_c.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib \
|
||||
- /Fe$(SPATIALITE_EXE)
|
||||
+ cl shell.obj $(LIBS_ALL) /Fe$(SPATIALITE_EXE)
|
||||
if exist $(SPATIALITE_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_EXE).manifest -outputresource:$(SPATIALITE_EXE);1
|
||||
|
||||
$(EXIF_LOADER_EXE): exif_loader.obj
|
||||
- cl exif_loader.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib C:\OSGeo4W\lib\geos_c.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl exif_loader.obj $(LIBS_ALL)
|
||||
if exist $(EXIF_LOADER_EXE).manifest mt -manifest \
|
||||
$(EXIF_LOADER_EXE).manifest -outputresource:$(EXIF_LOADER_EXE);1
|
||||
|
||||
$(SHP_DOCTOR_EXE): shp_doctor.obj
|
||||
- cl shp_doctor.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib C:\OSGeo4W\lib\geos_c.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl shp_doctor.obj $(LIBS_ALL)
|
||||
if exist $(SHP_DOCTOR_EXE).manifest mt -manifest \
|
||||
$(SHP_DOCTOR_EXE).manifest -outputresource:$(SHP_DOCTOR_EXE);1
|
||||
|
||||
$(SPATIALITE_NETWORK_EXE): spatialite_network.obj
|
||||
- cl spatialite_network.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl spatialite_network.obj $(LIBS_ALL)
|
||||
if exist $(SPATIALITE_NETWORK_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_TOOL_EXE).manifest \
|
||||
-outputresource:$(SPATIALITE_TOOL_EXE);1
|
||||
|
||||
$(SPATIALITE_TOOL_EXE): spatialite_tool.obj
|
||||
- cl spatialite_tool.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib C:\OSGeo4W\lib\geos_c.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl spatialite_tool.obj $(LIBS_ALL)
|
||||
if exist $(SPATIALITE_TOOL_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_TOOL_EXE).manifest \
|
||||
-outputresource:$(SPATIALITE_TOOL_EXE);1
|
||||
|
||||
$(SPATIALITE_OSM_NET_EXE): spatialite_osm_net.obj
|
||||
- cl spatialite_osm_net.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib \
|
||||
- C:\OSGeo4W\lib\readosm_i.lib \
|
||||
- C:\OSGeo4W\lib\libexpat.lib \
|
||||
- C:\OSGeo4W\lib\zlib.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl spatialite_osm_net.obj $(LIBS_ALL)
|
||||
if exist $(SPATIALITE_OSM_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_OSM_EXE).manifest \
|
||||
-outputresource:$(SPATIALITE_OSM_NET_EXE);1
|
||||
|
||||
$(SPATIALITE_OSM_MAP_EXE): spatialite_osm_map.obj
|
||||
- cl spatialite_osm_map.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib \
|
||||
- C:\OSGeo4W\lib\readosm_i.lib \
|
||||
- C:\OSGeo4W\lib\libexpat.lib \
|
||||
- C:\OSGeo4W\lib\zlib.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl spatialite_osm_map.obj $(LIBS_ALL)
|
||||
if exist $(SPATIALITE_OSM_MAP_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_OSM_MAP_EXE).manifest \
|
||||
-outputresource:$(SPATIALITE_OSM_MAP_EXE);1
|
||||
|
||||
$(SPATIALITE_GML_EXE): spatialite_gml.obj
|
||||
- cl spatialite_gml.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib \
|
||||
- C:\OSGeo4W\lib\libexpat.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl spatialite_gml.obj $(LIBS_ALL)
|
||||
if exist $(SPATIALITE_GML_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_GML_EXE).manifest \
|
||||
-outputresource:$(SPATIALITE_GML_EXE);1
|
||||
|
||||
$(SPATIALITE_OSM_RAW_EXE): spatialite_osm_raw.obj
|
||||
- cl spatialite_osm_raw.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib \
|
||||
- C:\OSGeo4W\lib\readosm_i.lib \
|
||||
- C:\OSGeo4W\lib\libexpat.lib \
|
||||
- C:\OSGeo4W\lib\zlib.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl spatialite_osm_raw.obj $(LIBS_ALL)
|
||||
if exist $(SPATIALITE_OSM_RAW_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_OSM_RAW_EXE).manifest \
|
||||
-outputresource:$(SPATIALITE_OSM_RAW_EXE);1
|
||||
|
||||
$(SPATIALITE_OSM_FILTER_EXE): spatialite_osm_filter.obj
|
||||
- cl spatialite_osm_filter.obj C:\OSGeo4W\lib\proj_i.lib \
|
||||
- C:\OSGeo4W\lib\iconv.lib \
|
||||
- C:\OSGeo4W\lib\spatialite_i.lib C:\OSGeo4W\lib\sqlite3_i.lib
|
||||
+ cl spatialite_osm_filter.obj $(LIBS_ALL)
|
||||
if exist $(SPATIALITE_OSM_FILTER_EXE).manifest mt -manifest \
|
||||
$(SPATIALITE_OSM_FILTER_EXE).manifest \
|
||||
-outputresource:$(SPATIALITE_OSM_FILTER_EXE);1
|
||||
diff --git a/nmake.opt b/nmake.opt
|
||||
index 4f4a953..d9efecf 100644
|
||||
--- a/nmake.opt
|
||||
+++ b/nmake.opt
|
||||
@@ -1,8 +1,8 @@
|
||||
# Directory tree where SpatiaLite will be installed.
|
||||
-INSTDIR=C:\OSGeo4W
|
||||
+INSTDIR=$(INST_DIR)
|
||||
|
||||
# Uncomment the first for an optimized build, or the second for debug.
|
||||
-OPTFLAGS= /nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \
|
||||
+OPTFLAGS= /nologo /fp:precise /W3 $(CL_FLAGS) /D_CRT_SECURE_NO_WARNINGS \
|
||||
/D_LARGE_FILE=1 /D_FILE_OFFSET_BITS=64 /D_LARGEFILE_SOURCE=1
|
||||
#OPTFLAGS= /nologo /Zi /MD /Fdspatialite.pdb
|
||||
|
118
ports/spatialite-tools/portfile.cmake
Normal file
118
ports/spatialite-tools/portfile.cmake
Normal file
@ -0,0 +1,118 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
option(BUILD_DEBUG_TOOLS "Build debug version of tools" OFF)
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/spatialite-tools-4.3.0)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://www.gaia-gis.it/gaia-sins/spatialite-tools-4.3.0.tar.gz"
|
||||
FILENAME "spatialite-tools-4.3.0.tar.gz"
|
||||
SHA512 e1de27c1c65ff2ff0b08583113517bea74edf33fff59ad6e9c77492ea3ae87d9c0f17d7670ee6602b32eea73ad3678bb5410ef2c6fac6e213bf2e341a907db88
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
find_program(NMAKE nmake)
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-makefiles.patch
|
||||
)
|
||||
|
||||
set(LDIR "\"${CURRENT_INSTALLED_DIR}\"")
|
||||
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
||||
set(CL_FLAGS_DBG "/MDd /Zi")
|
||||
set(CL_FLAGS_REL "/MD /Ox")
|
||||
set(GEOS_LIBS_REL "${LDIR}/lib/geos_c.lib")
|
||||
set(GEOS_LIBS_DBG "${LDIR}/debug/lib/geos_c.lib")
|
||||
set(LIBXML2_LIBS_REL "${LDIR}/lib/libxml2.lib")
|
||||
set(LIBXML2_LIBS_DBG "${LDIR}/debug/lib/libxml2.lib")
|
||||
set(SPATIALITE_LIBS_REL "${LDIR}/lib/spatialite.lib")
|
||||
set(SPATIALITE_LIBS_DBG "${LDIR}/debug/lib/spatialite.lib")
|
||||
set(ICONV_LIBS_REL "${LDIR}/lib/libiconv.lib")
|
||||
set(ICONV_LIBS_DBG "${LDIR}/debug/lib/libiconv.lib")
|
||||
else()
|
||||
set(CL_FLAGS_DBG "/MTd /Zi")
|
||||
set(CL_FLAGS_REL "/MT /Ox")
|
||||
set(GEOS_LIBS_REL "${LDIR}/lib/libgeos_c.lib ${LDIR}/lib/libgeos.lib")
|
||||
set(GEOS_LIBS_DBG "${LDIR}/debug/lib/libgeos_c.lib ${LDIR}/debug/lib/libgeos.lib")
|
||||
set(LIBXML2_LIBS_REL "${LDIR}/lib/libxml2.lib ${LDIR}/lib/lzma.lib ws2_32.lib")
|
||||
set(LIBXML2_LIBS_DBG "${LDIR}/debug/lib/libxml2.lib ${LDIR}/debug/lib/lzma.lib ws2_32.lib")
|
||||
set(SPATIALITE_LIBS_REL "${LDIR}/lib/spatialite.lib ${LDIR}/lib/freexl.lib")
|
||||
set(SPATIALITE_LIBS_DBG "${LDIR}/debug/lib/spatialite.lib ${LDIR}/debug/lib/freexl.lib")
|
||||
set(ICONV_LIBS_REL "${LDIR}/lib/libiconv.lib ${LDIR}/lib/libcharset.lib")
|
||||
set(ICONV_LIBS_DBG "${LDIR}/debug/lib/libiconv.lib ${LDIR}/debug/lib/libcharset.lib ")
|
||||
endif()
|
||||
|
||||
set(LIBS_ALL_DBG
|
||||
"${ICONV_LIBS_DBG} \
|
||||
${LDIR}/debug/lib/sqlite3.lib \
|
||||
${SPATIALITE_LIBS_DBG} \
|
||||
${LIBXML2_LIBS_DBG} \
|
||||
${GEOS_LIBS_DBG} \
|
||||
${LDIR}/debug/lib/readosm.lib \
|
||||
${LDIR}/debug/lib/expat.lib \
|
||||
${LDIR}/debug/lib/zlibd.lib \
|
||||
${LDIR}/debug/lib/projd.lib"
|
||||
)
|
||||
set(LIBS_ALL_REL
|
||||
"${ICONV_LIBS_REL} \
|
||||
${LDIR}/lib/sqlite3.lib \
|
||||
${SPATIALITE_LIBS_REL} \
|
||||
${LIBXML2_LIBS_REL} \
|
||||
${GEOS_LIBS_REL} \
|
||||
${LDIR}/lib/readosm.lib \
|
||||
${LDIR}/lib/expat.lib \
|
||||
${LDIR}/lib/zlib.lib \
|
||||
${LDIR}/lib/proj.lib"
|
||||
)
|
||||
|
||||
if(BUILD_DEBUG_TOOLS)
|
||||
################
|
||||
# Debug build
|
||||
################
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-dgb")
|
||||
|
||||
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${NMAKE} -f makefile.vc clean install
|
||||
"INST_DIR=\"${INST_DIR_REL}\"" "INSTALLED_ROOT=${LDIR}" "CL_FLAGS=${CL_FLAGS_DBG}" "LIBS_ALL=${LIBS_ALL_DBG}"
|
||||
WORKING_DIRECTORY ${SOURCE_PATH}
|
||||
LOGNAME nmake-build-${TARGET_TRIPLET}-debug
|
||||
)
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
|
||||
set(EXE_FOLDER ${CURRENT_PACKAGES_DIR}/bin/)
|
||||
else()
|
||||
################
|
||||
# Release build
|
||||
################
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-rel")
|
||||
|
||||
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${NMAKE} -f makefile.vc clean install
|
||||
"INST_DIR=\"${INST_DIR_REL}\"" "INSTALLED_ROOT=${LDIR}" "CL_FLAGS=${CL_FLAGS_REL}" "LIBS_ALL=${LIBS_ALL_REL}"
|
||||
WORKING_DIRECTORY ${SOURCE_PATH}
|
||||
LOGNAME nmake-build-${TARGET_TRIPLET}-release
|
||||
)
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-rel done")
|
||||
set(EXE_FOLDER ${CURRENT_PACKAGES_DIR}/bin/)
|
||||
endif()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}/)
|
||||
file(GLOB EXES "${EXE_FOLDER}/*.exe")
|
||||
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
file(REMOVE ${EXES})
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include)
|
||||
|
||||
if(NOT BUILD_DEBUG_TOOLS AND VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
endif()
|
||||
|
||||
message(STATUS "Packaging ${TARGET_TRIPLET} done")
|
||||
|
||||
# Allow empty include directory
|
||||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
|
Loading…
Reference in New Issue
Block a user