aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/readosm
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/readosm
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/readosm')
-rw-r--r--vcpkg/ports/readosm/fix-makefiles.patch48
-rw-r--r--vcpkg/ports/readosm/pc-file.patch12
-rw-r--r--vcpkg/ports/readosm/portfile.cmake94
-rw-r--r--vcpkg/ports/readosm/vcpkg.json16
4 files changed, 170 insertions, 0 deletions
diff --git a/vcpkg/ports/readosm/fix-makefiles.patch b/vcpkg/ports/readosm/fix-makefiles.patch
new file mode 100644
index 0000000..a955938
--- /dev/null
+++ b/vcpkg/ports/readosm/fix-makefiles.patch
@@ -0,0 +1,48 @@
+diff --git a/makefile.vc b/makefile.vc
+index 8edb536b9..33fd83e35 100644
+--- a/makefile.vc
++++ b/makefile.vc
+@@ -8,7 +8,7 @@ LIBOBJ = src\readosm.obj src\osmxml.obj \
+ src\protobuf.obj src\osm_objects.obj
+ READOSM_DLL = readosm$(VERSION).dll
+
+-CFLAGS = /nologo -I. -Iheaders -IC:\OSGeo4W\include $(OPTFLAGS)
++CFLAGS = /nologo -I. -Iheaders -I$(INSTALLED_ROOT)\include $(OPTFLAGS)
+
+ default: all
+
+@@ -21,9 +21,9 @@ readosm.lib: $(LIBOBJ)
+ $(READOSM_DLL): readosm_i.lib
+
+ readosm_i.lib: $(LIBOBJ)
+- link /dll /out:$(READOSM_DLL) \
++ link $(LINK_FLAGS) /dll /out:$(READOSM_DLL) \
+ /implib:readosm_i.lib $(LIBOBJ) \
+- C:\OSGeo4w\lib\libexpat.lib C:\OSGeo4w\lib\zlib.lib
++ $(LIBS_ALL)
+ if exist $(READOSM_DLL).manifest mt -manifest \
+ $(READOSM_DLL).manifest -outputresource:$(READOSM_DLL);2
+
+@@ -35,7 +35,7 @@ clean:
+ del *.exp
+ del *.manifest
+ del *.lib
+- del *.obj
++ del src\*.obj
+ del *.pdb
+
+ install: all
+
+diff --git a/nmake.opt b/nmake.opt
+index 5e45c0e..61c44f9 100644
+--- a/nmake.opt
++++ b/nmake.opt
+@@ -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 \
+ /DDLL_EXPORT
+ #OPTFLAGS= /nologo /Zi /MD /Fdreadosm.pdb /DDLL_EXPORT
+
diff --git a/vcpkg/ports/readosm/pc-file.patch b/vcpkg/ports/readosm/pc-file.patch
new file mode 100644
index 0000000..34ea868
--- /dev/null
+++ b/vcpkg/ports/readosm/pc-file.patch
@@ -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}
diff --git a/vcpkg/ports/readosm/portfile.cmake b/vcpkg/ports/readosm/portfile.cmake
new file mode 100644
index 0000000..6b84b3b
--- /dev/null
+++ b/vcpkg/ports/readosm/portfile.cmake
@@ -0,0 +1,94 @@
+set(READOSM_VERSION_STR "1.1.0a")
+vcpkg_download_distfile(ARCHIVE
+ 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
+)
+
+vcpkg_extract_source_archive(SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ PATCHES
+ fix-makefiles.patch
+ pc-file.patch
+)
+
+set(PKGCONFIG_MODULES expat zlib)
+
+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)
+ endif()
+
+ file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR)
+
+ vcpkg_install_nmake(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PREFER_JOM
+ CL_LANGUAGE C
+ OPTIONS_RELEASE
+ "INSTDIR=${INST_DIR}"
+ "LIBS_ALL=${PKGCONFIG_LIBS_RELEASE} ${UWP_LIBS}"
+ OPTIONS_DEBUG
+ "INSTDIR=${INST_DIR}\\debug"
+ "LINK_FLAGS=/debug"
+ "LIBS_ALL=${PKGCONFIG_LIBS_DEBUG} ${UWP_LIBS}"
+ )
+
+ 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")
+
+ 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()
+
+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()
+endif()
+
+vcpkg_fixup_pkgconfig()
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file
diff --git a/vcpkg/ports/readosm/vcpkg.json b/vcpkg/ports/readosm/vcpkg.json
new file mode 100644
index 0000000..0824b50
--- /dev/null
+++ b/vcpkg/ports/readosm/vcpkg.json
@@ -0,0 +1,16 @@
+{
+ "name": "readosm",
+ "version-string": "1.1.0a",
+ "port-version": 4,
+ "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",
+ "license": "MPL-1.1",
+ "dependencies": [
+ "expat",
+ {
+ "name": "vcpkg-pkgconfig-get-modules",
+ "host": true
+ },
+ "zlib"
+ ]
+}