diff --git a/.devcontainer b/.devcontainer index 207df8e..65ad285 160000 --- a/.devcontainer +++ b/.devcontainer @@ -1 +1 @@ -Subproject commit 207df8e561667a2a29164293a367a108fb6c12fa +Subproject commit 65ad2858f2525afcc228039bf52acf919139806a diff --git a/.github/workflows/build.yml b/.github/workflows/xpbuild.yml similarity index 77% rename from .github/workflows/build.yml rename to .github/workflows/xpbuild.yml index 3b34b65..fb55758 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/xpbuild.yml @@ -7,19 +7,24 @@ on: workflow_dispatch: jobs: linux: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.04 + uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 with: cmake-workflow-preset: LinuxRelease runon: ubuntu-latest secrets: inherit linux-arm64: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.04 + uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 with: cmake-workflow-preset: LinuxRelease runon: ubuntu-24.04-arm secrets: inherit + macos: + uses: externpro/externpro/.github/workflows/build-macos.yml@25.05.1 + with: + cmake-workflow-preset: DarwinRelease + secrets: inherit windows: - uses: externpro/externpro/.github/workflows/build-windows.yml@25.04 + uses: externpro/externpro/.github/workflows/build-windows.yml@25.05.1 with: cmake-workflow-preset: WindowsRelease secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/xprelease.yml similarity index 83% rename from .github/workflows/release.yml rename to .github/workflows/xprelease.yml index 6fa033b..f868a82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/xprelease.yml @@ -9,8 +9,12 @@ on: jobs: # Upload build artifacts as release assets release-from-build: - uses: externpro/externpro/.github/workflows/release-from-build.yml@25.04 + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.05.1 with: workflow_run_url: ${{ github.event.inputs.workflow_run_url }} artifact_pattern: "*.tar.xz" + permissions: + contents: write + id-token: write + attestations: write secrets: inherit diff --git a/CMakeLists.txt b/CMakeLists.txt index 6300edd..497fa8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,21 @@ cmake_minimum_required(VERSION 3.31) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.devcontainer/cmake ${CMAKE_CURRENT_LIST_DIR}/cmake) -include(preproject) -project(spatialite-tools VERSION 5.1.0.4) -set(xVer) # letter after CMAKE_PROJECT_VERSION, for example 5.1.0a -include(flags) +set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) +project(spatialite-tools VERSION 5.1.0) +set(xVer a) # letter after CMAKE_PROJECT_VERSION, for example 5.1.0a +include(xpflags) include(GNUInstallDirs) -if(TRUE) +option(BUILD_AUTOMAKE "build with automake" OFF) +if(BUILD_AUTOMAKE) + include(ExternalProject) + set_property(DIRECTORY PROPERTY "EP_BASE" ${CMAKE_BINARY_DIR}/epbase) + ExternalProject_Add(${PROJECT_NAME} + DOWNLOAD_COMMAND sudo dnf -y install --setopt=tsflags=nodocs epel-release && sudo dnf -y install sqlite-devel libxml2-devel + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} BINARY_DIR ${CMAKE_CURRENT_LIST_DIR} + CONFIGURE_COMMAND export LIBXML2_CFLAGS=-I/usr/include/libxml2 && export LIBXML2_LIBS=-lxml2 && + PKG_CONFIG_PATH=/bpvol/workspace/libspatialite/_bld/epbase/Install/libspatialite/lib/pkgconfig/ && + /configure --prefix= --disable-readosm + ) +else() set(targetsFile ${CMAKE_PROJECT_NAME}-targets) if(DEFINED XP_NAMESPACE) set(nameSpace NAMESPACE ${XP_NAMESPACE}::) @@ -15,7 +25,7 @@ if(TRUE) endif() xpPackageDevel(TARGETS_FILE ${targetsFile}) xpFindPkg(PKGS libiconv libspatialite) - include(configure) + include(cmake/configure.cmake) set(spatialite_srcs shell.c) set(spatialite_deps xpro::libiconv) set(exes @@ -59,14 +69,4 @@ if(TRUE) install(TARGETS ${exe} EXPORT ${targetsFile} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Release) endforeach() install(EXPORT ${targetsFile} DESTINATION ${XP_INSTALL_CMAKEDIR} ${nameSpace}) -else() - include(ExternalProject) - set_property(DIRECTORY PROPERTY "EP_BASE" ${CMAKE_BINARY_DIR}/epbase) - ExternalProject_Add(${PROJECT_NAME} - DOWNLOAD_COMMAND sudo dnf -y install --setopt=tsflags=nodocs epel-release && sudo dnf -y install sqlite-devel libxml2-devel - SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} BINARY_DIR ${CMAKE_CURRENT_LIST_DIR} - CONFIGURE_COMMAND export LIBXML2_CFLAGS=-I/usr/include/libxml2 && export LIBXML2_LIBS=-lxml2 && - PKG_CONFIG_PATH=/bpvol/workspace/libspatialite/_bld/epbase/Install/libspatialite/lib/pkgconfig/ && - /configure --prefix= --disable-readosm - ) endif() diff --git a/CMakePresets.json b/CMakePresets.json index 5a06690..f82cfdd 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -2,6 +2,7 @@ "version": 8, "include": [ ".devcontainer/cmake/presets/xpLinuxNinja.json", + ".devcontainer/cmake/presets/xpDarwinNinja.json", ".devcontainer/cmake/presets/xpWindowsVs2022.json" ] } diff --git a/cmake/config.h.cmake.in b/cmake/config.h.cmake.in deleted file mode 100644 index a59143d..0000000 --- a/cmake/config.h.cmake.in +++ /dev/null @@ -1,232 +0,0 @@ -/* @CONFIG_H_COMMENT@ */ -/* ./cmake/config.h.cmake.in - copied, modified from config.h.in, manually maintained */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Should be defined in order to enable LIBXML2 support. */ -#@DEFINE_ENABLE_LIBXML2@ ENABLE_LIBXML2 - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_CONFIG_URI@ HAVE_DECL_SQLITE_CONFIG_URI - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_CACHE_HIT@ HAVE_DECL_SQLITE_DBSTATUS_CACHE_HIT - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_CACHE_MISS@ HAVE_DECL_SQLITE_DBSTATUS_CACHE_MISS - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_CACHE_USED@ HAVE_DECL_SQLITE_DBSTATUS_CACHE_USED - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_CACHE_WRITE@ HAVE_DECL_SQLITE_DBSTATUS_CACHE_WRITE - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_HIT@ HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_HIT - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL@ HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE@ HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_USED@ HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_USED - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_SCHEMA_USED@ HAVE_DECL_SQLITE_DBSTATUS_SCHEMA_USED - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_DBSTATUS_STMT_USED@ HAVE_DECL_SQLITE_DBSTATUS_STMT_USED - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_FCNTL_VFSNAME@ HAVE_DECL_SQLITE_FCNTL_VFSNAME - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_STMTSTATUS_AUTOINDEX@ HAVE_DECL_SQLITE_STMTSTATUS_AUTOINDEX - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_STMTSTATUS_FULLSCAN_STEP@ HAVE_DECL_SQLITE_STMTSTATUS_FULLSCAN_STEP - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_STMTSTATUS_SORT@ HAVE_DECL_SQLITE_STMTSTATUS_SORT - -/* depending on SQLite library version. */ -#@DEFINE_HAVE_DECL_SQLITE_TESTCTRL_EXPLAIN_STMT@ HAVE_DECL_SQLITE_TESTCTRL_EXPLAIN_STMT - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_DLFCN_H@ HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_EXPAT_H@ HAVE_EXPAT_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_FCNTL_H@ HAVE_FCNTL_H - -/* Define to 1 if you have the `fdatasync' function. */ -#@DEFINE_HAVE_FDATASYNC@ HAVE_FDATASYNC - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_FLOAT_H@ HAVE_FLOAT_H - -/* Define to 1 if you have the `ftruncate' function. */ -#@DEFINE_HAVE_FTRUNCATE@ HAVE_FTRUNCATE - -/* Define to 1 if you have the `getcwd' function. */ -#@DEFINE_HAVE_GETCWD@ HAVE_GETCWD - -/* Define to 1 if you have the `gettimeofday' function. */ -#@DEFINE_HAVE_GETTIMEOFDAY@ HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_INTTYPES_H@ HAVE_INTTYPES_H - -/* Define to 1 if you have the `expat' library (-lexpat). */ -#@DEFINE_HAVE_LIBEXPAT@ HAVE_LIBEXPAT - -/* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ -#@DEFINE_HAVE_LIBSQLITE3@ HAVE_LIBSQLITE3 - -/* Define to 1 if you have the `localtime_r' function. */ -#@DEFINE_HAVE_LOCALTIME_R@ HAVE_LOCALTIME_R - -/* Define to 1 if `lstat' has the bug that it succeeds when given the - zero-length file name argument. */ -#@DEFINE_HAVE_LSTAT_EMPTY_STRING_BUG@ HAVE_LSTAT_EMPTY_STRING_BUG - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_MATH_H@ HAVE_MATH_H - -/* Define to 1 if you have the `memmove' function. */ -#@DEFINE_HAVE_MEMMOVE@ HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_MEMORY_H@ HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#@DEFINE_HAVE_MEMSET@ HAVE_MEMSET - -/* Define to 1 if you have the `readline' function. */ -#@DEFINE_HAVE_READLINE@ HAVE_READLINE - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SQLITE3EXT_H@ HAVE_SQLITE3EXT_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SQLITE3_H@ HAVE_SQLITE3_H - -/* Define to 1 if you have the `sqrt' function. */ -#@DEFINE_HAVE_SQRT@ HAVE_SQRT - -/* Define to 1 if `stat' has the bug that it succeeds when given the - zero-length file name argument. */ -#@DEFINE_HAVE_STAT_EMPTY_STRING_BUG@ HAVE_STAT_EMPTY_STRING_BUG - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STDDEF_H@ HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STDINT_H@ HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STDIO_H@ HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STDLIB_H@ HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#@DEFINE_HAVE_STRCASECMP@ HAVE_STRCASECMP - -/* Define to 1 if you have the `strerror' function. */ -#@DEFINE_HAVE_STRERROR@ HAVE_STRERROR - -/* Define to 1 if you have the `strftime' function. */ -#@DEFINE_HAVE_STRFTIME@ HAVE_STRFTIME - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STRINGS_H@ HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_STRING_H@ HAVE_STRING_H - -/* Define to 1 if you have the `strncasecmp' function. */ -#@DEFINE_HAVE_STRNCASECMP@ HAVE_STRNCASECMP - -/* Define to 1 if you have the `strstr' function. */ -#@DEFINE_HAVE_STRSTR@ HAVE_STRSTR - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_STAT_H@ HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_TIME_H@ HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_SYS_TYPES_H@ HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#@DEFINE_HAVE_UNISTD_H@ HAVE_UNISTD_H - -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing - slash. */ -#@DEFINE_LSTAT_FOLLOWS_SLASHED_SYMLINK@ LSTAT_FOLLOWS_SLASHED_SYMLINK - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#cmakedefine LT_OBJDIR "@LT_OBJDIR@" - -/* Should be defined in order to disable ReadOSM support. */ -#@DEFINE_OMIT_READOSM@ OMIT_READOSM - -/* Name of package */ -#cmakedefine PACKAGE "@PACKAGE@" - -/* Define to the address where bug reports for this package should be sent. */ -#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" - -/* Define to the full name of this package. */ -#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@" - -/* Define to the full name and version of this package. */ -#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" - -/* Define to the one symbol short name of this package. */ -#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@" - -/* Define to the home page for this package. */ -#cmakedefine PACKAGE_URL "@PACKAGE_URL@" - -/* Define to the version of this package. */ -#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" - -/* must be defined when using libspatialite-amalgamation */ -#@DEFINE_SPATIALITE_AMALGAMATION@ SPATIALITE_AMALGAMATION - -/* Define to 1 if you have the ANSI C header files. */ -#@DEFINE_STDC_HEADERS@ STDC_HEADERS - -/* Define to 1 if your declares `struct tm'. */ -#@DEFINE_TM_IN_SYS_TIME@ TM_IN_SYS_TIME - -/* Version number of package */ -#cmakedefine VERSION "@VERSION@" - -/* Must be =64 in order to enable huge-file support. */ -#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@ - -/* Must be defined in order to enable huge-file support. */ -#cmakedefine _LARGEFILE_SOURCE @_LARGEFILE_SOURCE@ - -/* Must be defined in order to enable huge-file support. */ -#cmakedefine _LARGE_FILE @_LARGE_FILE@ - -/* Define to empty if `const' does not conform to ANSI C. */ -#cmakedefine const @const@ - -/* Define to `long int' if does not define. */ -#cmakedefine off_t @off_t@ - -/* Define to `unsigned int' if does not define. */ -#cmakedefine size_t @size_t@ - -/* Define to empty if the keyword `volatile' does not work. Warning: valid - code using `volatile' can become incorrect without. Disable with care. */ -#cmakedefine volatile @volatile@ diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 7c943f2..d987340 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -62,33 +62,33 @@ xpcfgLstatFollowsSlashedSymlink(LSTAT_FOLLOWS_SLASHED_SYMLINK) set(ENABLE_LIBXML2 FALSE) # TODO find package set(OMIT_READOSM TRUE) # --enable-readosm : enables ReadOSM inclusion set(SPATIALITE_AMALGAMATION FALSE) # TODO determine? -xpcfgSetDefineList(ENABLE_LIBXML2 OMIT_READOSM SPATIALITE_AMALGAMATION) xpcfgStdcHeaders(STDC_HEADERS) xpcfgTmInHdr(sys/time.h TM_IN_SYS_TIME) -# cmakedefine entries in config.h.cmake.in xpcfgLtObjdir(LT_OBJDIR) -set(PACKAGE ${CMAKE_PROJECT_NAME}) -set(PACKAGE_BUGREPORT a.furieri@lqt.it) -set(PACKAGE_NAME ${CMAKE_PROJECT_NAME}) -set(PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${CMAKE_PROJECT_VERSION}${xVer}") -set(PACKAGE_TARNAME ${CMAKE_PROJECT_NAME}) -set(PACKAGE_URL https://www.gaia-gis.it/fossil/libspatialite/home) -set(PACKAGE_VERSION ${CMAKE_PROJECT_VERSION}${xVer}) -set(VERSION ${CMAKE_PROJECT_VERSION}${xVer}) +set(PACKAGE "\"${CMAKE_PROJECT_NAME}\"") +set(PACKAGE_BUGREPORT "\"a.furieri@lqt.it\"") +set(PACKAGE_NAME "\"${CMAKE_PROJECT_NAME}\"") +set(PACKAGE_STRING "\"${CMAKE_PROJECT_NAME} ${CMAKE_PROJECT_VERSION}${xVer}\"") +set(PACKAGE_TARNAME "\"${CMAKE_PROJECT_NAME}\"") +set(PACKAGE_URL "\"https://www.gaia-gis.it/fossil/libspatialite/home\"") +set(PACKAGE_VERSION "\"${CMAKE_PROJECT_VERSION}${xVer}\"") +set(VERSION "\"${CMAKE_PROJECT_VERSION}${xVer}\"") xpcfgHugeFileSupport() -xpcfgConst() +xpcfgConst(const) xpcfgCheckTypeSize() if(NOT HAVE_SIZEOF_OFF_T) set(off_t "long int") # Define to `long int' if does not define. */ +else() + set(off_t 0) # cmakedefine endif() if(NOT HAVE_SIZEOF_SIZE_T) set(size_t "unsigned int") # Define to `unsigned int' if does not define. +else() + set(size_t 0) # cmakedefine endif() xpcfgVolatile(volatile) cmake_pop_check_state() if(WIN32) set(msvc -msvc) endif() -set(CONFIG_H_COMMENT "{CMAKE_BINARY_DIR}/cmake/config${msvc}.h. Generated from cmake/config.h.cmake.in by cmake/configure.cmake.") -configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h.cmake.in ${CMAKE_BINARY_DIR}/CMakeFiles/config.h.cmake) -configure_file(${CMAKE_BINARY_DIR}/CMakeFiles/config.h.cmake ${CMAKE_BINARY_DIR}/cmake/config${msvc}.h) +xpcfgDotinFile("config.h.in" "cmake/config${msvc}.h")