Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ports/readosm/fix-makefiles.patch
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ diff --git a/nmake.opt b/nmake.opt
index 5e45c0e..61c44f9 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -1,8 +1,8 @@
# Directory tree where ReadOSM will be installed.
-INSTDIR=C:\OSGeo4W
+INSTDIR=$(INST_DIR)
@@ -2,7 +2,7 @@
INSTDIR=C:\OSGeo4W

# Uncomment the first for an optimized build, or the second for debug.
-OPTFLAGS= /nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \
Expand Down
12 changes: 12 additions & 0 deletions ports/readosm/pc-file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/readosm.pc.in b/readosm.pc.in
index c1a0961..2417433 100644
--- a/readosm.pc.in
+++ b/readosm.pc.in
@@ -8,5 +8,6 @@ includedir=@includedir@
Name: readosm
Description: a simple library parsing Open Street Map files
Version: @VERSION@
-Libs: -L${libdir} -lreadosm -lz -lexpat
+Requires.private: expat zlib
+Libs: -L${libdir} -lreadosm
Cflags: -I${includedir}
147 changes: 76 additions & 71 deletions ports/readosm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,89 +1,94 @@
set(READOSM_VERSION_STR "1.1.0a")
vcpkg_download_distfile(ARCHIVE
URLS "http://www.gaia-gis.it/gaia-sins/readosm-sources/readosm-${READOSM_VERSION_STR}.tar.gz"
URLS "https://www.gaia-gis.it/gaia-sins/readosm-sources/readosm-${READOSM_VERSION_STR}.tar.gz"
FILENAME "readosm-${READOSM_VERSION_STR}.tar.gz"
SHA512 ec8516cdd0b02027cef8674926653f8bc76e2082c778b02fb2ebcfa6d01e21757aaa4fd5d5104059e2f5ba97190183e60184f381bfd592a635805aa35cd7a682
)

if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
vcpkg_extract_source_archive(SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES
fix-makefiles.patch
)
pc-file.patch
)

set(PKGCONFIG_MODULES expat zlib)

if(VCPKG_CRT_LINKAGE STREQUAL dynamic)
set(CL_FLAGS_DBG "/MDd /Zi")
set(CL_FLAGS_REL "/MD /Ox")
set(EXPAT_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libexpat.lib")
set(EXPAT_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libexpatd.lib")
else()
set(CL_FLAGS_DBG "/MTd /Zi")
set(CL_FLAGS_REL "/MT /Ox")
set(EXPAT_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libexpatMD.lib")
set(EXPAT_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libexpatdMD.lib")
endif()
if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
x_vcpkg_pkgconfig_get_modules(
PREFIX PKGCONFIG
MODULES --msvc-syntax ${PKGCONFIG_MODULES}
LIBS
)

if(VCPKG_TARGET_IS_UWP)
set(UWP_LIBS windowsapp.lib)
set(UWP_LINK_FLAGS /APPCONTAINER)
endif()
if(VCPKG_TARGET_IS_UWP)
set(UWP_LIBS windowsapp.lib)
set(UWP_LINK_FLAGS /APPCONTAINER)
endif()

set(LIBS_ALL_DBG
"${CURRENT_INSTALLED_DIR}/debug/lib/zlibd.lib \
${UWP_LIBS} \
${EXPAT_LIBS_DBG}"
)
set(LIBS_ALL_REL
"${CURRENT_INSTALLED_DIR}/lib/zlib.lib \
${UWP_LIBS} \
${EXPAT_LIBS_REL}"
)
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR)

string(REPLACE "/" "\\\\" INST_DIR ${CURRENT_PACKAGES_DIR})
list(APPEND OPTIONS_RELEASE
"LINK_FLAGS=${UWP_LINK_FLAGS}" "INST_DIR=${INST_DIR}" "CL_FLAGS=${CL_FLAGS_REL}" "LIBS_ALL=${LIBS_ALL_REL}"
)
list(APPEND OPTIONS_DEBUG
"LINK_FLAGS=${UWP_LINK_FLAGS} /debug" "INST_DIR=${INST_DIR}\\debug" "CL_FLAGS=${CL_FLAGS_DBG}" "LIBS_ALL=${LIBS_ALL_DBG}"
)
vcpkg_install_nmake(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_RELEASE
"INSTDIR=${INST_DIR}"
"LINK_FLAGS=${UWP_LINK_FLAGS}"
"LIBS_ALL=${PKGCONFIG_LIBS_RELEASE} ${UWP_LIBS}"
OPTIONS_DEBUG
"INSTDIR=${INST_DIR}\\debug"
"LINK_FLAGS=${UWP_LINK_FLAGS} /debug"
"LIBS_ALL=${PKGCONFIG_LIBS_DEBUG} ${UWP_LIBS}"
)

vcpkg_install_nmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_RELEASE
${OPTIONS_RELEASE}
OPTIONS_DEBUG
${OPTIONS_DEBUG}
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/readosm_i.lib")
if(NOT DEFINED VCPKG_BUILD_TYPE)
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/readosm_i.lib")
endif()
else()
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/readosm.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/readosm_i.lib" "${CURRENT_PACKAGES_DIR}/lib/readosm.lib")
if(NOT DEFINED VCPKG_BUILD_TYPE)
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/readosm_i.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib")
endif()
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/readosm_i.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/readosm_i.lib)
else()
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/readosm.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/readosm_i.lib ${CURRENT_PACKAGES_DIR}/lib/readosm.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/readosm_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) # Build in UNIX
vcpkg_extract_source_archive_ex(
ARCHIVE ${ARCHIVE}
OUT_SOURCE_PATH SOURCE_PATH
)
set(infile "${SOURCE_PATH}/readosm.pc.in")
set(outfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/readosm.pc")
set(VERSION "${READOSM_VERSION_STR}")
set(exec_prefix [[${prefix}]])
set(libdir [[${prefix}/lib]])
set(includedir [[${prefix}/include]])
list(JOIN pkg_config_modules " " requires_private)
configure_file("${infile}" "${outfile}" @ONLY)
if(NOT DEFINED VCPKG_BUILD_TYPE)
set(outfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/readosm.pc")
set(includedir [[${prefix}/../include]])
configure_file("${infile}" "${outfile}" @ONLY)
endif()

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
AUTOCONFIG
OPTIONS
"LIBS=-lpthread -ldl -lstdc++ -lm"
)
else()
x_vcpkg_pkgconfig_get_modules(
PREFIX PKGCONFIG
MODULES ${PKGCONFIG_MODULES}
LIBS
)
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
OPTIONS_RELEASE
"LIBS=${PKGCONFIG_LIBS_RELEASE} \$LIBS"
OPTIONS_DEBUG
"LIBS=${PKGCONFIG_LIBS_DEBUG} \$LIBS"
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
vcpkg_install_make()
endif()

vcpkg_fixup_pkgconfig()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
6 changes: 5 additions & 1 deletion ports/readosm/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "readosm",
"version-string": "1.1.0a",
"port-version": 1,
"port-version": 2,
"description": "ReadOSM is an open source library to extract valid data from within an Open Street Map input file (.osm or .osm.pbf)",
"homepage": "https://www.gaia-gis.it/gaia-sins/readosm-sources",
"dependencies": [
"expat",
{
"name": "vcpkg-pkgconfig-get-modules",
"host": true
},
"zlib"
]
}
35 changes: 0 additions & 35 deletions ports/spatialite-tools/fix-linux-configure.patch

This file was deleted.

61 changes: 3 additions & 58 deletions ports/spatialite-tools/fix-makefiles.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ index 53ef75197..d48fb02db 100644
- 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)
+ cl shell.obj /Fe$(SPATIALITE_EXE) $(LIBS_ALL)
if exist $(SPATIALITE_EXE).manifest mt -manifest \
$(SPATIALITE_EXE).manifest -outputresource:$(SPATIALITE_EXE);1

Expand Down Expand Up @@ -119,71 +119,16 @@ index 53ef75197..d48fb02db 100644
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 4f4a9538e..d9efecf7b 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -1,8 +1,8 @@
# Directory tree where SpatiaLite will be installed.
-INSTDIR=C:\OSGeo4W
+INSTDIR=$(INST_DIR)
@@ -2,7 +2,7 @@
INSTDIR=C:\OSGeo4W

# 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

diff --git a/Makefile.am b/Makefile.am
index 75ac806..d680b74 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,7 @@ bin_PROGRAMS = spatialite \
spatialite_dem
endif

-AM_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ @LIBXML2_CFLAGS@
+AM_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ @LIBXML2_CFLAGS@ @RTTOPO_CFLAGS@
AM_CPPFLAGS += -I$(top_srcdir)

spatialite_SOURCES = shell.c
@@ -65,27 +65,27 @@ spatialite_osm_overpass_SOURCES = spatialite_osm_overpass.c
spatialite_dem_SOURCES = spatialite_dem.c

spatialite_osm_map_LDADD = @LIBSPATIALITE_LIBS@ \
- @LIBFREEXL_LIBS@ @LIBREADOSM_LIBS@
+ @LIBFREEXL_LIBS@ @LIBREADOSM_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
spatialite_osm_overpass_LDADD = @LIBSPATIALITE_LIBS@ \
- @LIBFREEXL_LIBS@ @LIBXML2_LIBS@
+ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
spatialite_osm_raw_LDADD = @LIBSPATIALITE_LIBS@ \
- @LIBFREEXL_LIBS@ @LIBREADOSM_LIBS@
+ @LIBFREEXL_LIBS@ @LIBREADOSM_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
spatialite_osm_net_LDADD = @LIBSPATIALITE_LIBS@ \
- @LIBFREEXL_LIBS@ @LIBREADOSM_LIBS@
+ @LIBFREEXL_LIBS@ @LIBREADOSM_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
spatialite_gml_LDADD = @LIBSPATIALITE_LIBS@ \
- @LIBFREEXL_LIBS@ \
+ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@ \
-lexpat
-spatialite_dem_LDADD = @LIBSPATIALITE_LIBS@
+spatialite_dem_LDADD = @LIBSPATIALITE_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
spatialite_LDADD = @LIBSPATIALITE_LIBS@ \
@LIBFREEXL_LIBS@ \
- @READLINE_LIBS@
+ @READLINE_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
spatialite_xml_validator_LDADD = @LIBXML2_LIBS@
-spatialite_xml_load_LDADD = @LIBSPATIALITE_LIBS@ \
+spatialite_xml_load_LDADD = @LIBSPATIALITE_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@\
-lexpat
-spatialite_xml_collapse_LDADD = @LIBSPATIALITE_LIBS@
-spatialite_xml_print_LADD = @LIBSPATIALIATE_LIBS@
+spatialite_xml_collapse_LDADD = @LIBSPATIALITE_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
+spatialite_xml_print_LADD = @LIBSPATIALITE_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@
LDADD = @LIBSPATIALITE_LIBS@ \
- @LIBFREEXL_LIBS@
+ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ @RTTOPO_LIBS@

EXTRA_DIST = makefile.vc nmake.opt makefile64.vc nmake64.opt \
config-msvc.h \
Loading