aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/librttopo
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/librttopo
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/librttopo')
-rw-r--r--vcpkg/ports/librttopo/constant-nan.patch14
-rw-r--r--vcpkg/ports/librttopo/fix-makefiles.patch13
-rw-r--r--vcpkg/ports/librttopo/fix-pc-file.patch9
-rw-r--r--vcpkg/ports/librttopo/geos-config.patch25
-rw-r--r--vcpkg/ports/librttopo/portfile.cmake78
-rw-r--r--vcpkg/ports/librttopo/rttopo_config.h.in168
-rw-r--r--vcpkg/ports/librttopo/vcpkg.json11
7 files changed, 318 insertions, 0 deletions
diff --git a/vcpkg/ports/librttopo/constant-nan.patch b/vcpkg/ports/librttopo/constant-nan.patch
new file mode 100644
index 0000000..6302869
--- /dev/null
+++ b/vcpkg/ports/librttopo/constant-nan.patch
@@ -0,0 +1,14 @@
+diff --git a/src/rtout_wkb.c b/src/rtout_wkb.c
+index 7cfeda6..4f2ff38 100644
+--- a/src/rtout_wkb.c
++++ b/src/rtout_wkb.c
+@@ -22,8 +22,7 @@
+ *
+ **********************************************************************/
+
+-
+-
++#define _UCRT_NOISY_NAN
+ #include "rttopo_config.h"
+ #include <math.h>
+
diff --git a/vcpkg/ports/librttopo/fix-makefiles.patch b/vcpkg/ports/librttopo/fix-makefiles.patch
new file mode 100644
index 0000000..f86d35d
--- /dev/null
+++ b/vcpkg/ports/librttopo/fix-makefiles.patch
@@ -0,0 +1,13 @@
+diff --git a/makefile.vc b/makefile.vc
+index 1f790f0..f78d0c9 100644
+--- a/makefile.vc
++++ b/makefile.vc
+@@ -17,7 +17,7 @@ LIBOBJ = src\box2d.obj src\bytebuffer.obj src\g_box.obj \
+ src\rtout_kml.obj src\rtout_svg.obj src\rtout_twkb.obj src\rtout_wkb.obj \
+ src\rtout_wkt.obj src\rtout_x3d.obj src\rtpoint.obj src\rtpoly.obj src\rtprint.obj \
+ src\rtpsurface.obj src\rtspheroid.obj src\rtstroke.obj src\rttin.obj src\rttree.obj \
+- src\rttriangle.obj src\rtutil.obj src\stringbuffer.obj src\varint.obj
++ src\rttriangle.obj src\rtutil.obj src\stringbuffer.obj src\varint.obj src\rtt_tpsnap.obj
+
+ LIBRTTOPO_DLL = librttopo$(VERSION).dll
+
diff --git a/vcpkg/ports/librttopo/fix-pc-file.patch b/vcpkg/ports/librttopo/fix-pc-file.patch
new file mode 100644
index 0000000..1248378
--- /dev/null
+++ b/vcpkg/ports/librttopo/fix-pc-file.patch
@@ -0,0 +1,9 @@
+diff --git a/rttopo.pc.in b/rttopo.pc.in
+index 86c71dc..4064506 100644
+--- a/rttopo.pc.in
++++ b/rttopo.pc.in
+@@ -10,3 +10,4 @@ Description: the RT Topology library
+ Version: @VERSION@
+ Libs: -L${libdir} -lrttopo -lm
+ Cflags: -I${includedir}
++Requires.private: geos
diff --git a/vcpkg/ports/librttopo/geos-config.patch b/vcpkg/ports/librttopo/geos-config.patch
new file mode 100644
index 0000000..eb6b905
--- /dev/null
+++ b/vcpkg/ports/librttopo/geos-config.patch
@@ -0,0 +1,25 @@
+diff --git a/configure.ac b/configure.ac
+index a956106..739ee88 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -110,7 +110,7 @@ else
+ fi
+ fi
+ # Extract the linker and include flags
+-GEOS_LDFLAGS=`$GEOSCONFIG --ldflags`
++GEOS_LDFLAGS=`$GEOSCONFIG --clibs`
+ GEOS_CFLAGS=-I`$GEOSCONFIG --includes`
+ AC_SUBST([GEOS_LDFLAGS])
+ AC_SUBST([GEOS_CFLAGS])
+@@ -122,9 +122,9 @@ CPPFLAGS="$CPPFLAGS_SAVE"
+ # Ensure we can link against libgeos_c
+ LIBS_SAVE="$LIBS"
+ LIBS="$GEOS_LDFLAGS"
+-AC_SEARCH_LIBS(GEOSContext_setErrorMessageHandler_r,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.5.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig]))
++AC_SEARCH_LIBS(GEOSContext_setErrorMessageHandler_r,,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.5.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig]))
+ LIBS="$LIBS_SAVE"
+-LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c"
++LIBS="$LIBS $GEOS_LDFLAGS"
+ GEOS_MAJOR_VERSION=`$GEOSCONFIG --version | cut -d. -f1 | sed 's/[[^0-9]]//g'`
+ GEOS_MINOR_VERSION=`$GEOSCONFIG --version | cut -d. -f2 | sed 's/[[^0-9]]//g'`
+ RTGEOM_GEOS_VERSION="$GEOS_MAJOR_VERSION$GEOS_MINOR_VERSION"
diff --git a/vcpkg/ports/librttopo/portfile.cmake b/vcpkg/ports/librttopo/portfile.cmake
new file mode 100644
index 0000000..99bcd0f
--- /dev/null
+++ b/vcpkg/ports/librttopo/portfile.cmake
@@ -0,0 +1,78 @@
+# NOTE: update the version and checksum for new LIBRTTOPO release
+set(LIBRTTOPO_VERSION_STR "1.1.0")
+set(LIBRTTOPO_PACKAGE_SUM "d9c2f4db1261cc942152d348abb7f03e6053a63b6966e081c5381d40bbebd3c7ca1963224487355f384d7562a90287fb24d7af9e7eda4a1e230ee6441cef5de9")
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://download.osgeo.org/librttopo/src/librttopo-${LIBRTTOPO_VERSION_STR}.tar.gz"
+ FILENAME "librttopo-${LIBRTTOPO_VERSION_STR}.tar.gz"
+ SHA512 ${LIBRTTOPO_PACKAGE_SUM}
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ PATCHES
+ fix-makefiles.patch
+ geos-config.patch
+ fix-pc-file.patch
+ constant-nan.patch # https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907
+)
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+ file(REMOVE "${SOURCE_PATH}/src/rttopo_config.h")
+ configure_file("${CMAKE_CURRENT_LIST_DIR}/rttopo_config.h.in" "${SOURCE_PATH}/src/rttopo_config.h" @ONLY)
+
+ set(OPTFLAGS "/nologo /fp:precise /W4 /D_CRT_SECURE_NO_WARNINGS /DDLL_EXPORT")
+ vcpkg_build_nmake(
+ SOURCE_PATH "${SOURCE_PATH}"
+ TARGET librttopo.lib
+ CL_LANGUAGE C
+ OPTIONS
+ "OPTFLAGS=${OPTFLAGS}"
+ "CFLAGS=-I. -Iheaders ${OPTFLAGS}"
+ )
+
+ file(GLOB LIBRTTOPO_INCLUDE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/headers/*.h")
+ file(COPY ${LIBRTTOPO_INCLUDE} DESTINATION "${CURRENT_PACKAGES_DIR}/include")
+
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
+ file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/librttopo.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ endif()
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
+ file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/librttopo.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+ endif()
+
+ set(VERSION "${LIBRTTOPO_VERSION_STR}")
+ set(libdir [[${prefix}/lib]])
+ set(exec_prefix [[${prefix}]])
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ set(includedir [[${prefix}/include]])
+ set(outfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/rttopo.pc")
+ configure_file("${SOURCE_PATH}/rttopo.pc.in" "${outfile}" @ONLY)
+ vcpkg_replace_string("${outfile}" " -lrttopo -lm" " -llibrttopo")
+ endif()
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ set(includedir [[${prefix}/../include]])
+ set(outfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/rttopo.pc")
+ configure_file("${SOURCE_PATH}/rttopo.pc.in" "${outfile}" @ONLY)
+ vcpkg_replace_string("${outfile}" " -lrttopo -lm" " -llibrttopo")
+ endif()
+else()
+ vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ OPTIONS_DEBUG
+ "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/debug/bin/geos-config"
+ OPTIONS_RELEASE
+ "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/bin/geos-config"
+ )
+ vcpkg_install_make()
+endif()
+vcpkg_fixup_pkgconfig()
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/librttopo/rttopo_config.h.in b/vcpkg/ports/librttopo/rttopo_config.h.in
new file mode 100644
index 0000000..b4b1a39
--- /dev/null
+++ b/vcpkg/ports/librttopo/rttopo_config.h.in
@@ -0,0 +1,168 @@
+/* src/rttopo_config.h. Generated from rttopo_config.h.in by configure. */
+/* src/rttopo_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H 1
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the `fdatasync' function. */
+#define HAVE_FDATASYNC 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#define HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the <geos_c.h> header file. */
+#define HAVE_GEOS_C_H 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `localtime_r' function. */
+#define HAVE_LOCALTIME_R 1
+
+/* Define to 1 if `lstat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+/* #undef HAVE_LSTAT_EMPTY_STRING_BUG */
+
+/* Define to 1 if you have the <math.h> header file. */
+#define HAVE_MATH_H 1
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `sqrt' function. */
+/* #undef HAVE_SQRT */
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+/* #undef HAVE_STAT_EMPTY_STRING_BUG */
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the `strstr' function. */
+#define HAVE_STRSTR 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* rtgeom version */
+#define LIBRTGEOM_VERSION "1.1.0"
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Must be defined in order to disable debug mode. */
+#undef NDEBUG
+
+/* Name of package */
+#define PACKAGE "librttopo"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "strk@kbt.io"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "librttopo"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "librttopo 1.1.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "librttopo"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.1.0"
+
+/* RTGEOM Debug level */
+#define RTGEOM_DEBUG_LEVEL 0
+
+/* GEOS library version */
+#define RTGEOM_GEOS_VERSION 38
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Version number of package */
+#define VERSION "1.1.0"
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/vcpkg/ports/librttopo/vcpkg.json b/vcpkg/ports/librttopo/vcpkg.json
new file mode 100644
index 0000000..b875e63
--- /dev/null
+++ b/vcpkg/ports/librttopo/vcpkg.json
@@ -0,0 +1,11 @@
+{
+ "name": "librttopo",
+ "version": "1.1.0",
+ "port-version": 9,
+ "description": "The RT Topology Library exposes an API to create and manage standard (ISO 13249 aka SQL/MM) topologies using user-provided data stores.",
+ "homepage": "https://git.osgeo.org/gitea/rttopo/librttopo",
+ "license": "GPL-2.0-or-later",
+ "dependencies": [
+ "geos"
+ ]
+}