diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 88e7a4e9a4..5867afb4c0 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -162,6 +162,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`links`](links/) | Links web browser | 2.26 | http://links.twibright.com/ | | [`lite-xl`](lite-xl/) | Lite-XL | 2.1.0 | https://lite-xl.com/ | | [`llvm`](llvm/) | LLVM | 15.0.3 | https://llvm.org/ | +| [`lowdown`](lowdown/) | lowdown | 1.0.2 | https://kristaps.bsd.lv/lowdown/ | | [`lrzip`](lrzip/) | lrzip | 0.651 | https://github.com/ckolivas/lrzip | | [`lua`](lua/) | Lua | 5.4.4 | https://www.lua.org/ | | [`luajit`](luajit/) | LuaJIT | 2.1.0-beta3 | https://luajit.org/luajit.html | diff --git a/Ports/lowdown/package.sh b/Ports/lowdown/package.sh new file mode 100755 index 0000000000..eabc12bb80 --- /dev/null +++ b/Ports/lowdown/package.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env -S bash ../.port_include.sh + +port='lowdown' +version='1.0.2' +workdir="lowdown-VERSION_${version//./_}" +files="https://github.com/kristapsdz/lowdown/archive/refs/tags/VERSION_${version//./_}.tar.gz lowdown-${version}.tar.gz 049b7883874f8a8e528dc7c4ed7b27cf7ceeb9ecf8fe71c3a8d51d574fddf84b" +useconfigure='true' +auth_type='sha256' + +configure() { + run ./configure +} diff --git a/Ports/lowdown/patches/0001-Exclude-arpa-nameser.h-as-it-does-not-exist-on-Seren.patch b/Ports/lowdown/patches/0001-Exclude-arpa-nameser.h-as-it-does-not-exist-on-Seren.patch new file mode 100644 index 0000000000..2a652b94db --- /dev/null +++ b/Ports/lowdown/patches/0001-Exclude-arpa-nameser.h-as-it-does-not-exist-on-Seren.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Emily Trau +Date: Tue, 6 Jun 2023 14:20:15 -0700 +Subject: [PATCH 1/2] Exclude arpa/nameser.h as it does not exist on Serenity + +--- + compats.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/compats.c b/compats.c +index 92d3b71..5d6f31a 100644 +--- a/compats.c ++++ b/compats.c +@@ -215,7 +215,6 @@ warnx(const char *fmt, ...) + #include + #include + #include +-#include + + #include + #include +-- +2.37.2 + diff --git a/Ports/lowdown/patches/0002-Don-t-use-getprogname.patch b/Ports/lowdown/patches/0002-Don-t-use-getprogname.patch new file mode 100644 index 0000000000..f369c90d8e --- /dev/null +++ b/Ports/lowdown/patches/0002-Don-t-use-getprogname.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Emily Trau +Date: Tue, 6 Jun 2023 14:21:50 -0700 +Subject: [PATCH 2/2] Don't use `getprogname()` + +--- + main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/main.c b/main.c +index 1d192be..6867fe4 100644 +--- a/main.c ++++ b/main.c +@@ -384,7 +384,9 @@ main(int argc, char *argv[]) + LOWDOWN_LATEX_NUMBERED | + LOWDOWN_SMARTY; + +- if (strcasecmp(getprogname(), "lowdown-diff") == 0) ++ char progname[BUFSIZ]; ++ get_process_name(progname, sizeof(progname)); ++ if (strcasecmp(progname, "lowdown-diff") == 0) + diff = 1; + + while ((c = getopt_long(argc, argv, +-- +2.37.2 + diff --git a/Ports/lowdown/patches/ReadMe.md b/Ports/lowdown/patches/ReadMe.md new file mode 100644 index 0000000000..ca17c40865 --- /dev/null +++ b/Ports/lowdown/patches/ReadMe.md @@ -0,0 +1,11 @@ +# Patches for llvm on SerenityOS + +## `0001-Exclude-arpa-nameser.h-as-it-does-not-exist-on-Seren.patch` + +Exclude arpa/nameser.h as it does not exist on Serenity + + +## `0002-Don-t-use-getprogname.patch` + +Don't use `getprogname()` as it is not currently supported in Serenity + diff --git a/Userland/Libraries/LibC/paths.h b/Userland/Libraries/LibC/paths.h index 658d40e780..636f564be5 100644 --- a/Userland/Libraries/LibC/paths.h +++ b/Userland/Libraries/LibC/paths.h @@ -11,3 +11,6 @@ // Deprecated definition for dosfstools port. #define _PATH_MOUNTED "/etc/mtab" + +// Default value used for lowdown port. +#define _PATH_TTY "/dev/tty"