diff --git a/mingw-w64-redland/001-fix-build-with-mingw.patch b/mingw-w64-redland/001-fix-build-with-mingw.patch new file mode 100644 index 0000000000..7d7c7e083f --- /dev/null +++ b/mingw-w64-redland/001-fix-build-with-mingw.patch @@ -0,0 +1,244 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -126,7 +126,7 @@ + librdf_storage_mysql_la_SOURCES = rdf_storage_mysql.c + librdf_storage_mysql_la_CPPFLAGS = @MYSQL_CPPFLAGS@ + librdf_storage_mysql_la_LIBADD = @MYSQL_LIBS@ librdf.la +-librdf_storage_mysql_la_LDFLAGS = -module -avoid-version ++librdf_storage_mysql_la_LDFLAGS = -no-undefined -module -avoid-version + endif + + if STORAGE_SQLITE +@@ -137,7 +137,7 @@ + # automake-generated rule to ensure this. + librdf_storage_sqlite_la_CPPFLAGS = $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @SQLITE_CFLAGS@ + librdf_storage_sqlite_la_LIBADD = @SQLITE_LIBS@ librdf.la +-librdf_storage_sqlite_la_LDFLAGS = -module -avoid-version ++librdf_storage_sqlite_la_LDFLAGS = -no-undefined -module -avoid-version + endif + + if STORAGE_POSTGRESQL +@@ -145,7 +145,7 @@ + librdf_storage_postgresql_la_SOURCES = rdf_storage_postgresql.c + librdf_storage_postgresql_la_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ + librdf_storage_postgresql_la_LIBADD = @POSTGRESQL_LIBS@ librdf.la +-librdf_storage_postgresql_la_LDFLAGS = -module -avoid-version ++librdf_storage_postgresql_la_LDFLAGS = -no-undefined -module -avoid-version + endif + + if STORAGE_VIRTUOSO +@@ -195,7 +195,7 @@ + EXTRA_DIST=\ + redland.spec redland.spec.in + +-librdf_la_LDFLAGS = -version-info @LIBRDF_LIBTOOL_VERSION@ \ ++librdf_la_LDFLAGS = -no-undefined -version-info @LIBRDF_LIBTOOL_VERSION@ \ + @LIBRDF_LDFLAGS@ @LIBRDF_EXTERNAL_LIBS@ + + pkgdata_DATA= +--- a/src/rdf_hash_internal.h ++++ b/src/rdf_hash_internal.h +@@ -42,8 +42,8 @@ + typedef struct librdf_hash_datum_s librdf_hash_datum; + + /* constructor / destructor for above */ +-librdf_hash_datum* librdf_new_hash_datum(librdf_world *world, void *data, size_t size); +-void librdf_free_hash_datum(librdf_hash_datum *ptr); ++REDLAND_API librdf_hash_datum* librdf_new_hash_datum(librdf_world *world, void *data, size_t size); ++REDLAND_API void librdf_free_hash_datum(librdf_hash_datum *ptr); + + + +@@ -131,28 +131,28 @@ + /* methods */ + + /* open/create hash with identifier and options */ +-int librdf_hash_open(librdf_hash* hash, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options); ++REDLAND_API int librdf_hash_open(librdf_hash* hash, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options); + /* end hash association */ +-int librdf_hash_close(librdf_hash* hash); ++REDLAND_API int librdf_hash_close(librdf_hash* hash); + + /* how many values */ +-int librdf_hash_values_count(librdf_hash* hash); ++REDLAND_API int librdf_hash_values_count(librdf_hash* hash); + + /* retrieve one value for a given hash key as a hash datum */ +-librdf_hash_datum* librdf_hash_get_one(librdf_hash* hash, librdf_hash_datum *key); ++REDLAND_API librdf_hash_datum* librdf_hash_get_one(librdf_hash* hash, librdf_hash_datum *key); + + /* retrieve all values for a given hash key according to flags */ + librdf_iterator* librdf_hash_get_all(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); + + /* insert a key/value pair */ +-int librdf_hash_put(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); ++REDLAND_API int librdf_hash_put(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); + + /* returns true if key exists in hash, without returning value */ + int librdf_hash_exists(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); + + int librdf_hash_delete(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); +-int librdf_hash_delete_all(librdf_hash* hash, librdf_hash_datum *key); +-librdf_iterator* librdf_hash_keys(librdf_hash* hash, librdf_hash_datum *key); ++REDLAND_API int librdf_hash_delete_all(librdf_hash* hash, librdf_hash_datum *key); ++REDLAND_API librdf_iterator* librdf_hash_keys(librdf_hash* hash, librdf_hash_datum *key); + + /* flush any cached information to disk */ + int librdf_hash_sync(librdf_hash* hash); +@@ -160,7 +160,7 @@ + int librdf_hash_get_fd(librdf_hash* hash); + + /* init a hash from an array of strings */ +-int librdf_hash_from_array_of_strings(librdf_hash* hash, const char *array[]); ++REDLAND_API int librdf_hash_from_array_of_strings(librdf_hash* hash, const char *array[]); + + + /* cursor methods from rdf_hash_cursor.c */ +--- a/src/rdf_heuristics.h ++++ b/src/rdf_heuristics.h +@@ -30,10 +30,10 @@ + extern "C" { + #endif + +-char* librdf_heuristic_gen_name(const char *name); +-int librdf_heuristic_is_blank_node(const char *node); +-const char* librdf_heuristic_get_blank_node(const char *node); +-int librdf_heuristic_object_is_literal(const char *object); ++REDLAND_API char* librdf_heuristic_gen_name(const char *name); ++REDLAND_API int librdf_heuristic_is_blank_node(const char *node); ++REDLAND_API const char* librdf_heuristic_get_blank_node(const char *node); ++REDLAND_API int librdf_heuristic_object_is_literal(const char *object); + + #ifdef __cplusplus + } +--- a/src/rdf_init.h ++++ b/src/rdf_init.h +@@ -113,7 +113,7 @@ + void librdf_destroy_world(void); + + #ifdef LIBRDF_INTERNAL +-const char* librdf_basename(const char *name); ++REDLAND_API const char* librdf_basename(const char *name); + #endif + + #ifdef __cplusplus +--- a/src/rdf_init_internal.h ++++ b/src/rdf_init_internal.h +@@ -162,7 +162,7 @@ + librdf_uri* xsd_namespace_uri; + }; + +-unsigned char* librdf_world_get_genid(librdf_world* world); ++REDLAND_API unsigned char* librdf_world_get_genid(librdf_world* world); + + + #ifdef __cplusplus +--- a/src/rdf_log_internal.h ++++ b/src/rdf_log_internal.h +@@ -31,7 +31,7 @@ + #endif + + REDLAND_NORETURN +-void librdf_fatal(librdf_world* world, int facility, const char *file, int line, const char *function, const char *message); ++REDLAND_API void librdf_fatal(librdf_world* world, int facility, const char *file, int line, const char *function, const char *message); + + void librdf_test_error(librdf_world* world, const char *message); + void librdf_test_warning(librdf_world* world, const char *message); +--- a/src/rdf_query_internal.h ++++ b/src/rdf_query_internal.h +@@ -179,7 +179,7 @@ + void librdf_query_rasqal_destructor(librdf_world *world); + + void librdf_query_add_query_result(librdf_query *query, librdf_query_results* query_results); +-void librdf_query_remove_query_result(librdf_query *query, librdf_query_results* query_results); ++REDLAND_API void librdf_query_remove_query_result(librdf_query *query, librdf_query_results* query_results); + + /* rdf_query_rasqal.c */ + rasqal_literal* redland_node_to_rasqal_literal(librdf_world* world, librdf_node *node); +--- a/src/rdf_storage_internal.h ++++ b/src/rdf_storage_internal.h +@@ -86,7 +86,7 @@ + void librdf_finish_storage(librdf_world *world); + + /* class methods */ +-librdf_storage_factory* librdf_get_storage_factory(librdf_world* world, const char *name); ++REDLAND_API librdf_storage_factory* librdf_get_storage_factory(librdf_world* world, const char *name); + + + /* rdf_storage_sql.c */ +@@ -101,9 +101,9 @@ + char** values; + } librdf_sql_config; + +-librdf_sql_config* librdf_new_sql_config(librdf_world* world, const char *storage_name, const char* layout, const char* config_dir, const char** predicate_uri_strings); +-librdf_sql_config* librdf_new_sql_config_for_storage(librdf_storage* storage, const char* layout, const char* dir); +-void librdf_free_sql_config(librdf_sql_config* config); ++REDLAND_API librdf_sql_config* librdf_new_sql_config(librdf_world* world, const char *storage_name, const char* layout, const char* config_dir, const char** predicate_uri_strings); ++REDLAND_API librdf_sql_config* librdf_new_sql_config_for_storage(librdf_storage* storage, const char* layout, const char* dir); ++REDLAND_API void librdf_free_sql_config(librdf_sql_config* config); + + typedef enum { + DBCONFIG_CREATE_TABLE_STATEMENTS, +--- a/src/rdf_storage_mysql.c ++++ b/src/rdf_storage_mysql.c +@@ -31,7 +31,6 @@ + + #ifdef WIN32 + #include +-#include + #include + #include + #endif +@@ -308,7 +307,7 @@ + librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; + u64 hash; + byte* digest; +- uint i; ++ unsigned int i; + + /* (Re)initialize digest object */ + librdf_digest_init(context->digest); +--- a/src/rdf_uri_internal.h ++++ b/src/rdf_uri_internal.h +@@ -56,7 +56,7 @@ + void librdf_finish_uri(librdf_world *world); + + /* exported public in error but never usable */ +-librdf_digest* librdf_uri_get_digest (librdf_world *world, librdf_uri *uri); ++REDLAND_API librdf_digest* librdf_uri_get_digest (librdf_world *world, librdf_uri *uri); + + #ifdef __cplusplus + } +--- a/src/win32_rdf_config.h.in ++++ b/src/win32_rdf_config.h.in +@@ -67,10 +67,6 @@ + /* __func__ doesn't exist in Visual Studio 6 */ + #define __func__ "" + +-#undef REDLAND_INLINE +-#define REDLAND_INLINE __inline +- +- + /* + * Defines that come from rdf_config.h + */ +@@ -90,9 +86,6 @@ + /* BDB has fd method with 2 args */ + #define HAVE_BDB_FD_2_ARGS 1 + +-/* Have BDB hash support */ +-#define HAVE_BDB_HASH 1 +- + /* BDB has open method with 6 args */ + /* #undef HAVE_BDB_OPEN_6_ARGS */ + +@@ -274,9 +267,6 @@ + /* Version number of package */ + #define VERSION "@VERSION@" + +-/* Use POSIX threads */ +-#undef WITH_THREADS +- + /* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ + /* #undef WORDS_BIGENDIAN */ diff --git a/mingw-w64-redland/PKGBUILD b/mingw-w64-redland/PKGBUILD new file mode 100644 index 0000000000..60d45c7120 --- /dev/null +++ b/mingw-w64-redland/PKGBUILD @@ -0,0 +1,75 @@ +# Contributor: Mehdi Chinoune + +_realname=redland +pkgbase=mingw-w64-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=1.0.17 +pkgrel=1 +pkgdesc="Library that provides a high-level interface to RDF (Resource Description Framework) data. (mingw-w64)" +arch=('any') +mingw_arch=('ucrt64' 'clang64' 'clangarm64') +url="https://librdf.org" +msys2_repository_url="https://github.com/dajobe/librdf" +msys2_references=( + 'archlinux: redland' +) +license=('spdx:Apache-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later') +depends=("${MINGW_PACKAGE_PREFIX}-libltdl" + "${MINGW_PACKAGE_PREFIX}-raptor" + "${MINGW_PACKAGE_PREFIX}-rasqal") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-gtk-doc" + "${MINGW_PACKAGE_PREFIX}-libmariadbclient" + "${MINGW_PACKAGE_PREFIX}-postgresql" + "${MINGW_PACKAGE_PREFIX}-sqlite3") +optdepends=("${MINGW_PACKAGE_PREFIX}-libmariadbclient: MySQL/MariaDB storage support" + "${MINGW_PACKAGE_PREFIX}-postgresql: PostgreSQL storage support" + "${MINGW_PACKAGE_PREFIX}-sqlite3: SQLite storage support") +source=("http://download.librdf.org/source/redland-${pkgver}.tar.gz" + "001-fix-build-with-mingw.patch") +sha256sums=('de1847f7b59021c16bdc72abb4d8e2d9187cd6124d69156f3326dd34ee043681' + '7a311554b6838b153425a385baa48e7a1006d94848f9e4dd4a6134dd7eed53f3') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + patch -p1 -i ${srcdir}/001-fix-build-with-mingw.patch + + autoreconf -fiv +} + +build() { + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + declare -a _extra_config + if check_option "debug" "n"; then + _extra_config+=("--enable-release") + else + _extra_config+=("--enable-debug") + fi + + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --disable-static \ + --with-mysql=${MINGW_PREFIX}/bin/mariadb_config.exe \ + "${_extra_config[@]}" + + make +} + +check() { + cd "${srcdir}/build-${MSYSTEM}" + + make check || true +} + +package() { + cd "${srcdir}/build-${MSYSTEM}" + + DESTDIR="${pkgdir}" make install + + install -d "$pkgdir${MINGW_PREFIX}"/share/licenses/${_realname} + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING.LIB" -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE-2.0.txt" -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/" +}