From 7448db99403fe902417f826e693dc13935e96781 Mon Sep 17 00:00:00 2001 From: Fabian Dellwing Date: Sat, 11 Mar 2023 14:47:14 +0100 Subject: [PATCH] Ports: Add lrzip port --- Ports/AvailablePorts.md | 1 + Ports/lrzip/package.sh | 16 ++++++++ .../0001-Remove-Linux-specific-code.patch | 38 +++++++++++++++++++ Ports/lrzip/patches/ReadMe.md | 7 ++++ 4 files changed, 62 insertions(+) create mode 100755 Ports/lrzip/package.sh create mode 100644 Ports/lrzip/patches/0001-Remove-Linux-specific-code.patch create mode 100644 Ports/lrzip/patches/ReadMe.md diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index a43f4e8f88..5bda3d4842 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -153,6 +153,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/ | +| [`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 | | [`luarocks`](luarocks/) | LuaRocks | 3.8.0 | https://luarocks.org/ | diff --git a/Ports/lrzip/package.sh b/Ports/lrzip/package.sh new file mode 100755 index 0000000000..e4a6a95bcf --- /dev/null +++ b/Ports/lrzip/package.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port='lrzip' +version='0.651' +useconfigure='true' +files="https://github.com/ckolivas/lrzip/archive/refs/tags/v${version}.tar.gz v${version}.tar.gz f4c84de778a059123040681fd47c17565fcc4fec0ccc68fcf32d97fad16cd892" +auth_type='sha256' +depends=( + 'bzip2' + 'lz4' + 'lzo' + 'zlib' +) + +configure() { + run ./autogen.sh --host="${SERENITY_ARCH}-pc-serenity" +} diff --git a/Ports/lrzip/patches/0001-Remove-Linux-specific-code.patch b/Ports/lrzip/patches/0001-Remove-Linux-specific-code.patch new file mode 100644 index 0000000000..78d674b190 --- /dev/null +++ b/Ports/lrzip/patches/0001-Remove-Linux-specific-code.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Fabian Dellwing +Date: Sat, 11 Mar 2023 16:18:09 +0100 +Subject: [PATCH] Remove Linux specific code + +--- + main.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/main.c b/main.c +index eb0985feb1f537533f9f6a983fa3c0e39de730bf..be172ee0758d7da6e8cefa2bf6e318e7b50b7ef5 100644 +--- a/main.c ++++ b/main.c +@@ -119,7 +119,9 @@ static void usage(bool compat) + } + if (!compat) + print_output(" -L, --level level set lzma/bzip2/gzip compression level (1-9, default 7)\n"); ++#ifndef __serenity__ + print_output(" -N, --nice-level value Set nice value to value (default %d)\n", compat ? 0 : 19); ++#endif + print_output(" -p, --threads value Set processor count to override number of threads\n"); + print_output(" -m, --maxram size Set maximum available ram in hundreds of MB\n"); + print_output(" overrides detected amount of available ram\n"); +@@ -449,12 +451,14 @@ int main(int argc, char *argv[]) + failure("Extra characters after ramsize: \'%s\'\n", endptr); + break; + case 'N': ++#ifndef __serenity__ + nice_set = true; + control->nice_val = strtol(optarg, &endptr, 10); + if (control->nice_val < PRIO_MIN || control->nice_val > PRIO_MAX) + failure("Invalid nice value (must be %d...%d)\n", PRIO_MIN, PRIO_MAX); + if (*endptr) + failure("Extra characters after nice level: \'%s\'\n", endptr); ++#endif + break; + case 'o': + if (control->outdir) diff --git a/Ports/lrzip/patches/ReadMe.md b/Ports/lrzip/patches/ReadMe.md new file mode 100644 index 0000000000..d17bee374e --- /dev/null +++ b/Ports/lrzip/patches/ReadMe.md @@ -0,0 +1,7 @@ +# Patches for lrzip on SerenityOS + +## `0001-Remove-Linux-specific-code.patch` + +Remove Linux `nice` specific code as SerenityOS does not support it. + +