summaryrefslogtreecommitdiff
path: root/Ports/thesilversearcher
diff options
context:
space:
mode:
authorRaymond Lucke <ray@raylucke.com>2022-05-14 13:25:23 -0400
committerLinus Groh <mail@linusgroh.de>2022-05-14 19:38:07 +0200
commitf8984146bd7e98cefa28ea48f10275096a9ff663 (patch)
tree9011ab42cd594b3e26747003aba61ea74ae47ef9 /Ports/thesilversearcher
parentee721978f68ffd3b836fafaecf452f969bbee991 (diff)
downloadserenity-f8984146bd7e98cefa28ea48f10275096a9ff663.zip
Ports: Add thesilversearcher (ag)
Diffstat (limited to 'Ports/thesilversearcher')
-rwxr-xr-xPorts/thesilversearcher/package.sh17
-rw-r--r--Ports/thesilversearcher/patches/0001-pledge-thread.patch43
-rw-r--r--Ports/thesilversearcher/patches/ReadMe.md7
3 files changed, 67 insertions, 0 deletions
diff --git a/Ports/thesilversearcher/package.sh b/Ports/thesilversearcher/package.sh
new file mode 100755
index 0000000000..598e59122d
--- /dev/null
+++ b/Ports/thesilversearcher/package.sh
@@ -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
+}
diff --git a/Ports/thesilversearcher/patches/0001-pledge-thread.patch b/Ports/thesilversearcher/patches/0001-pledge-thread.patch
new file mode 100644
index 0000000000..e4c0ea52ba
--- /dev/null
+++ b/Ports/thesilversearcher/patches/0001-pledge-thread.patch
@@ -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
+
diff --git a/Ports/thesilversearcher/patches/ReadMe.md b/Ports/thesilversearcher/patches/ReadMe.md
new file mode 100644
index 0000000000..673114f6ce
--- /dev/null
+++ b/Ports/thesilversearcher/patches/ReadMe.md
@@ -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.