1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +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

@ -3,7 +3,7 @@
Please make sure to keep this list up to date when adding and updating ports. :^) Please make sure to keep this list up to date when adding and updating ports. :^)
| Port | Name | Version | Website | | Port | Name | Version | Website |
|----------------------------------------|-----------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------| |-----------------------------------------------------|-----------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------|
| [`Another-World`](Another-World/) | Another World Bytecode Interpreter | | https://github.com/fabiensanglard/Another-World-Bytecode-Interpreter | | [`Another-World`](Another-World/) | Another World Bytecode Interpreter | | https://github.com/fabiensanglard/Another-World-Bytecode-Interpreter |
| [`angband`](angband/) | Angband | 4.2.4 | https://rephial.org | | [`angband`](angband/) | Angband | 4.2.4 | https://rephial.org |
| [`bash`](bash/) | GNU Bash | 5.1.16 | https://www.gnu.org/software/bash/ | | [`bash`](bash/) | GNU Bash | 5.1.16 | https://www.gnu.org/software/bash/ |
@ -210,6 +210,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`tuxracer`](tuxracer/) | Tux Racer | 0.61 | http://tuxracer.sourceforge.net/ | | [`tuxracer`](tuxracer/) | Tux Racer | 0.61 | http://tuxracer.sourceforge.net/ |
| [`tcl`](tcl/) | Tcl | 8.6.12 | https://www.tcl-lang.org/ | | [`tcl`](tcl/) | Tcl | 8.6.12 | https://www.tcl-lang.org/ |
| [`termcap`](termcap/) | GNU termcap | 1.3.1 | https://www.gnu.org/software/termutils/ | | [`termcap`](termcap/) | GNU termcap | 1.3.1 | https://www.gnu.org/software/termutils/ |
| [`thesilversearcher`](thesilversearcher/) | The Silver Searcher: A fast code-searching tool | 2.2.0 | https://github.com/ggreer/the_silver_searcher |
| [`tig`](tig/) | Tig: text-mode interface for Git | 2.5.5 | https://jonas.github.io/tig/ | | [`tig`](tig/) | Tig: text-mode interface for Git | 2.5.5 | https://jonas.github.io/tig/ |
| [`tinycc`](tinycc/) | Tiny C Compiler (TinyCC) | dev | https://github.com/TinyCC/tinycc | | [`tinycc`](tinycc/) | Tiny C Compiler (TinyCC) | dev | https://github.com/TinyCC/tinycc |
| [`tinyscheme`](tinyscheme/) | TinyScheme Interpreter | 1.42 | https://sourceforge.net/projects/tinyscheme/ | | [`tinyscheme`](tinyscheme/) | TinyScheme Interpreter | 1.42 | https://sourceforge.net/projects/tinyscheme/ |

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.