1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-30 01:27:34 +00:00

Ports: Add thesilversearcher (ag)

This commit is contained in:
Raymond Lucke 2022-05-14 13:25:23 -04:00 committed by Linus Groh
parent ee721978f6
commit f8984146bd
4 changed files with 291 additions and 223 deletions

View file

@ -0,0 +1,17 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=thesilversearcher
version=2.2.0
useconfigure="true"
files="https://github.com/ggreer/the_silver_searcher/archive/refs/tags/${version}.tar.gz the_silver_searcher-${version}.tar.xz 6a0a19ca5e73b2bef9481c29a508d2413ca1a0a9a5a6b1bd9bbd695a7626cbf9"
workdir="the_silver_searcher-${version}"
configopts=("--target=${SERENITY_ARCH}-pc-serenity" "--disable-utf8")
depends=("pcre" "xz")
auth_type="sha256"
pre_configure() {
export CFLAGS="-fcommon -D_GNU_SOURCE -lpthread"
run aclocal
run autoconf
run autoheader
run automake --add-missing
}

View file

@ -0,0 +1,43 @@
diff -u -r a/src/main.c b/src/main.c
--- a/src/main.c 2018-08-07 02:43:51.000000000 -0400
+++ b/src/main.c 2022-05-14 12:06:48.000000000 -0400
@@ -44,7 +44,7 @@
int num_cores;
#ifdef HAVE_PLEDGE
- if (pledge("stdio rpath proc exec", NULL) == -1) {
+ if (pledge("stdio rpath proc exec thread", NULL) == -1) {
die("pledge: %s", strerror(errno));
}
#endif
@@ -177,7 +177,7 @@
}
#ifdef HAVE_PLEDGE
- if (pledge("stdio rpath", NULL) == -1) {
+ if (pledge("stdio rpath thread", NULL) == -1) {
die("pledge: %s", strerror(errno));
}
#endif
diff -u -r a/src/options.c b/src/options.c
--- a/src/options.c 2018-08-07 02:43:51.000000000 -0400
+++ b/src/options.c 2022-05-14 12:09:45.000000000 -0400
@@ -642,7 +642,7 @@
#ifdef HAVE_PLEDGE
if (opts.skip_vcs_ignores) {
- if (pledge("stdio rpath proc", NULL) == -1) {
+ if (pledge("stdio rpath proc thread", NULL) == -1) {
die("pledge: %s", strerror(errno));
}
}
@@ -717,7 +717,7 @@
}
#ifdef HAVE_PLEDGE
- if (pledge("stdio rpath proc", NULL) == -1) {
+ if (pledge("stdio rpath proc thread", NULL) == -1) {
die("pledge: %s", strerror(errno));
}
#endif

View file

@ -0,0 +1,7 @@
# Patches for thesilversearcher on SerenityOS
## `0001-pledge-thread.patch`
src/main.c: Add thread option to pledges.
On OpenBSD, stdio typically grants thread,
but on Serenity it is its own option.