Accepting request 1011059 from multimedia:libs
OBS-URL: https://build.opensuse.org/request/show/1011059 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sord?expand=0&rev=17
This commit is contained in:
commit
73fece5c11
158
67bcd63bda9d7b095489a09b9880aa730ddb5488.patch
Normal file
158
67bcd63bda9d7b095489a09b9880aa730ddb5488.patch
Normal file
@ -0,0 +1,158 @@
|
||||
From 67bcd63bda9d7b095489a09b9880aa730ddb5488 Mon Sep 17 00:00:00 2001
|
||||
From: David Robillard <d@drobilla.net>
|
||||
Date: Fri, 7 Oct 2022 12:07:51 -0400
|
||||
Subject: [PATCH] Port sord_validate to pcre2
|
||||
|
||||
---
|
||||
meson.build | 6 ++---
|
||||
src/sord_config.h | 14 +++++------
|
||||
src/sord_validate.c | 61 +++++++++++++++++++++++++++------------------
|
||||
4 files changed, 49 insertions(+), 35 deletions(-)
|
||||
|
||||
Index: sord-0.16.14/meson.build
|
||||
===================================================================
|
||||
--- sord-0.16.14.orig/meson.build
|
||||
+++ sord-0.16.14/meson.build
|
||||
@@ -116,14 +116,14 @@ if not get_option('tools').disabled()
|
||||
|
||||
meson.override_find_program('sordi', sordi)
|
||||
|
||||
- pcre_dep = dependency('libpcre', required: false)
|
||||
+ pcre2_dep = dependency('libpcre2-8', required: false)
|
||||
|
||||
- if pcre_dep.found()
|
||||
+ if pcre2_dep.found()
|
||||
sord_validate = executable('sord_validate',
|
||||
files('src/sord_validate.c'),
|
||||
c_args: c_suppressions,
|
||||
install: true,
|
||||
- dependencies: [sord_dep, pcre_dep])
|
||||
+ dependencies: [sord_dep, pcre2_dep])
|
||||
|
||||
meson.override_find_program('sord_validate', sord_validate)
|
||||
endif
|
||||
Index: sord-0.16.14/src/sord_config.h
|
||||
===================================================================
|
||||
--- sord-0.16.14.orig/src/sord_config.h
|
||||
+++ sord-0.16.14/src/sord_config.h
|
||||
@@ -20,11 +20,11 @@
|
||||
|
||||
#if !defined(SORD_NO_DEFAULT_CONFIG)
|
||||
|
||||
-// The validator uses PCRE for literal pattern matching
|
||||
-# ifndef HAVE_PCRE
|
||||
+// The validator uses PCRE2 for literal pattern matching
|
||||
+# ifndef HAVE_PCRE2
|
||||
# ifdef __has_include
|
||||
-# if __has_include(<pcre.h>)
|
||||
-# define HAVE_PCRE 1
|
||||
+# if __has_include(<pcre2.h>)
|
||||
+# define HAVE_PCRE2 1
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -39,10 +39,10 @@
|
||||
if the build system defines them all.
|
||||
*/
|
||||
|
||||
-#ifdef HAVE_PCRE
|
||||
-# define USE_PCRE 1
|
||||
+#ifdef HAVE_PCRE2
|
||||
+# define USE_PCRE2 1
|
||||
#else
|
||||
-# define USE_PCRE 0
|
||||
+# define USE_PCRE2 0
|
||||
#endif
|
||||
|
||||
#endif // SORD_CONFIG_H
|
||||
Index: sord-0.16.14/src/sord_validate.c
|
||||
===================================================================
|
||||
--- sord-0.16.14.orig/src/sord_validate.c
|
||||
+++ sord-0.16.14/src/sord_validate.c
|
||||
@@ -8,8 +8,9 @@
|
||||
#include "sord/sord.h"
|
||||
#include "sord_config.h"
|
||||
|
||||
-#if USE_PCRE
|
||||
-# include <pcre.h>
|
||||
+#if USE_PCRE2
|
||||
+# define PCRE2_CODE_UNIT_WIDTH 8
|
||||
+# include <pcre2.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -176,31 +177,43 @@ is_descendant_of(SordModel* model,
|
||||
}
|
||||
|
||||
static bool
|
||||
-regexp_match(const uint8_t* pat, const char* str)
|
||||
+regexp_match(const uint8_t* const pattern, const char* const str)
|
||||
{
|
||||
-#if USE_PCRE
|
||||
- // Append a $ to the pattern so we only match if the entire string matches
|
||||
- const size_t len = strlen((const char*)pat);
|
||||
- char* const regx = (char*)malloc(len + 2);
|
||||
- memcpy(regx, pat, len);
|
||||
- regx[len] = '$';
|
||||
- regx[len + 1] = '\0';
|
||||
-
|
||||
- const char* err;
|
||||
- int erroffset;
|
||||
- pcre* re = pcre_compile(regx, PCRE_ANCHORED, &err, &erroffset, NULL);
|
||||
- free(regx);
|
||||
+#if USE_PCRE2
|
||||
+ static const uint32_t options = PCRE2_ANCHORED | PCRE2_ENDANCHORED;
|
||||
+
|
||||
+ int err = 0;
|
||||
+ size_t erroffset = 0U;
|
||||
+
|
||||
+ pcre2_code* const re = pcre2_compile(
|
||||
+ pattern, PCRE2_ZERO_TERMINATED, options, &err, &erroffset, NULL);
|
||||
+
|
||||
if (!re) {
|
||||
- fprintf(
|
||||
- stderr, "Error in pattern `%s' at offset %d (%s)\n", pat, erroffset, err);
|
||||
+ fprintf(stderr,
|
||||
+ "Error in pattern `%s' at offset %lu (%d)\n",
|
||||
+ pattern,
|
||||
+ erroffset,
|
||||
+ err);
|
||||
return false;
|
||||
}
|
||||
|
||||
- const bool ret =
|
||||
- pcre_exec(re, NULL, str, (int)strlen(str), 0, 0, NULL, 0) >= 0;
|
||||
- pcre_free(re);
|
||||
- return ret;
|
||||
-#endif // USE_PCRE
|
||||
+ pcre2_match_data* const match_data =
|
||||
+ pcre2_match_data_create_from_pattern(re, NULL);
|
||||
+
|
||||
+ const int rc = pcre2_match(re,
|
||||
+ (const uint8_t*)str,
|
||||
+ PCRE2_ZERO_TERMINATED,
|
||||
+ 0,
|
||||
+ options,
|
||||
+ match_data,
|
||||
+ NULL);
|
||||
+
|
||||
+ pcre2_match_data_free(match_data);
|
||||
+
|
||||
+ pcre2_code_free(re);
|
||||
+ return rc > 0;
|
||||
+#endif // USE_PCRE2
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -776,8 +789,8 @@ main(int argc, char** argv)
|
||||
URI(xsd, pattern);
|
||||
URI(xsd, string);
|
||||
|
||||
-#if !USE_PCRE
|
||||
- fprintf(stderr, "warning: Built without PCRE, datatypes not checked.\n");
|
||||
+#if !USE_PCRE2
|
||||
+ fprintf(stderr, "warning: Built without PCRE2, datatypes not checked.\n");
|
||||
#endif
|
||||
|
||||
const int prop_st = check_properties(model, &uris);
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9c70b3fbbb0c5c7bf761ef66c3d5b939ab45ad063e055990f17f40f1f6f96572
|
||||
size 524630
|
Binary file not shown.
BIN
sord-0.16.14.tar.xz
(Stored with Git LFS)
Normal file
BIN
sord-0.16.14.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
sord-0.16.14.tar.xz.sig
Normal file
BIN
sord-0.16.14.tar.xz.sig
Normal file
Binary file not shown.
16
sord.changes
16
sord.changes
@ -1,3 +1,19 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 14 11:39:13 UTC 2022 - Stephan Kulow <coolo@suse.com>
|
||||
|
||||
- Adding 67bcd63bda9d7b095489a09b9880aa730ddb5488.patch from upstrea
|
||||
commit to suport pcre2 in favor of pcre1
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 14 11:26:43 UTC 2022 - Stephan Kulow <coolo@suse.com>
|
||||
|
||||
- update to 0.16.14:
|
||||
* Adopt REUSE machine-readable licensing standard
|
||||
* Allow programs to be used from subproject
|
||||
* Fix accidentally exposed internal zix symbols
|
||||
* Fix various warnings
|
||||
* Switch to meson build system
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 9 20:31:13 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
31
sord.spec
31
sord.spec
@ -18,19 +18,22 @@
|
||||
|
||||
%define sover 0
|
||||
Name: sord
|
||||
Version: 0.16.10
|
||||
Version: 0.16.14
|
||||
Release: 0
|
||||
Summary: Utilities to work with RDF data
|
||||
License: ISC
|
||||
Group: Productivity/File utilities
|
||||
URL: https://drobilla.net/software/sord.html
|
||||
Source0: https://download.drobilla.net/sord-%{version}.tar.bz2
|
||||
Source1: https://download.drobilla.net/sord-%{version}.tar.bz2.sig
|
||||
Source0: https://download.drobilla.net/sord-%{version}.tar.xz
|
||||
Source1: https://download.drobilla.net/sord-%{version}.tar.xz.sig
|
||||
Source2: sord.keyring
|
||||
Source3: baselibs.conf
|
||||
# https://github.com/drobilla/sord/commit/67bcd63bda9d7b095489a09b9880aa730ddb5488
|
||||
Patch0: 67bcd63bda9d7b095489a09b9880aa730ddb5488.patch
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: graphviz
|
||||
BuildRequires: pcre-devel
|
||||
BuildRequires: meson
|
||||
BuildRequires: pcre2-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: python3
|
||||
BuildRequires: pkgconfig(serd-0) >= 0.22.4
|
||||
@ -60,25 +63,18 @@ Sord is a lightweight C library for storing RDF data in memory.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
export CFLAGS='%{optflags}'
|
||||
export CXXFLAGS='%{optflags}'
|
||||
python3 ./waf configure \
|
||||
--prefix=%{_prefix} \
|
||||
--libdir=%{_libdir} \
|
||||
--docdir=%{_defaultdocdir} \
|
||||
--test \
|
||||
--docs
|
||||
# waf only understands -j, so do not use smp_mflags
|
||||
python3 ./waf build -v %{?_smp_mflags}
|
||||
%{meson} -Ddocs=enabled -Dtests=enabled
|
||||
%{meson_build}
|
||||
|
||||
%install
|
||||
python3 ./waf install --destdir=%{?buildroot}
|
||||
rm -rf %{buildroot}%{_docdir}/sord-0/html
|
||||
%{meson_install}
|
||||
rm -rf %{buildroot}%{_datadir}/doc/sord-0/html
|
||||
|
||||
%check
|
||||
python3 ./waf test
|
||||
%{meson_test}
|
||||
|
||||
%post -n libsord-0-%{sover} -p /sbin/ldconfig
|
||||
%postun -n libsord-0-%{sover} -p /sbin/ldconfig
|
||||
@ -95,7 +91,6 @@ python3 ./waf test
|
||||
%{_libdir}/libsord-0.so.%{sover}*
|
||||
|
||||
%files devel
|
||||
%{_mandir}/man3/sord.3%{?ext_man}
|
||||
%{_libdir}/libsord-0.so
|
||||
%{_includedir}/sord-0/
|
||||
%{_libdir}/pkgconfig/sord-0.pc
|
||||
|
Loading…
Reference in New Issue
Block a user