Skip to content

Commit

Permalink
Add our patches to libspatialite 5.1.0 overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
olsen232 committed Nov 8, 2023
1 parent 8cc6f6d commit a6cb28a
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/makefile_mod.vc b/makefile_mod.vc
index 4815377..dbdbede 100644
--- a/makefile_mod.vc
+++ b/makefile_mod.vc
@@ -93,7 +93,7 @@ LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \
MOD_SPATIALITE_DLL = mod_spatialite$(VERSION).dll

CFLAGS = /nologo -I.\src\headers -I.\src\topology \
- -I. -IC:\OSGeo4W\include $(OPTFLAGS)
+ -I. $(OPTFLAGS)

default: all

@@ -107,12 +107,9 @@ mod_spatialite.lib: $(LIBOBJ)
$(MOD_SPATIALITE_DLL): mod_spatialite_i.lib

mod_spatialite_i.lib: $(LIBOBJ)
- link /dll /out:$(MOD_SPATIALITE_DLL) \
+ link $(LINK_FLAGS) /dll /out:$(MOD_SPATIALITE_DLL) \
/implib:mod_spatialite_i.lib $(LIBOBJ) \
- C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \
- C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \
- C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \
- C:\OSGeo4W\lib\libxml2.lib C:\OSGeo4W\lib\librttopo.lib
+ $(LIBS_ALL)
if exist $(MOD_SPATIALITE_DLL).manifest mt -manifest \
$(MOD_SPATIALITE_DLL).manifest -outputresource:$(MOD_SPATIALITE_DLL);2

diff --git a/nmake_mod.opt b/nmake_mod.opt
index 7772853..df6ec25 100644
--- a/nmake_mod.opt
+++ b/nmake_mod.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 /W4 /MD /D_CRT_SECURE_NO_WARNINGS \
+OPTFLAGS= /nologo /fp:precise /W4 $(CL_FLAGS) /D_CRT_SECURE_NO_WARNINGS \
/DDLL_EXPORT /DLOADABLE_EXTENSION /DYY_NO_UNISTD_H
#OPTFLAGS= /nologo /Zi /MD /Fdmod_spatialite.pdb /DDLL_EXPORT

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/spatialite/spatialite.c b/src/spatialite/spatialite.c
index 9d6063d..f3dda37 100644
--- a/src/spatialite/spatialite.c
+++ b/src/spatialite/spatialite.c
@@ -53439,7 +53439,7 @@ init_spatialite_extension (sqlite3 * db, char **pzErrMsg,
/* setting a timeout handler */
sqlite3_busy_timeout (db, 5000);

- return 0;
+ return SQLITE_OK_LOAD_PERMANENTLY;
}
#endif

18 changes: 18 additions & 0 deletions vcpkg-vendor/vcpkg-overlay-ports/libspatialite/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ vcpkg_extract_source_archive(
ARCHIVE "${ARCHIVE}"
PATCHES
fix-makefiles.patch
fix-makefile-mod.patch
fix-linux-configure.patch
gaiaconfig-msvc.patch
fix-mingw.patch
fix-utf8-source.patch
ok-load-permanently.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS unused
Expand Down Expand Up @@ -95,6 +97,22 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
"LINK_FLAGS=/debug"
)

vcpkg_install_nmake(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_NAME makefile_mod.vc
PREFER_JOM
CL_LANGUAGE C
OPTIONS_RELEASE
"CL_FLAGS=${CL_FLAGS_RELEASE}"
"INST_DIR=${INST_DIR}"
"LIBS_ALL=${LIBS_ALL_RELEASE}"
OPTIONS_DEBUG
"CL_FLAGS=${CL_FLAGS_DEBUG}"
"INST_DIR=${INST_DIR}\\debug"
"LIBS_ALL=${LIBS_ALL_DEBUG}"
"LINK_FLAGS=/debug"
)

vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
Expand Down

0 comments on commit a6cb28a

Please sign in to comment.