Skip to content

Commit

Permalink
Ports: Add lrzip port
Browse files Browse the repository at this point in the history
  • Loading branch information
fdellwing authored and gmta committed Mar 13, 2023
1 parent 50cef47 commit 7448db9
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions Ports/AvailablePorts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://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/ |
Expand Down
16 changes: 16 additions & 0 deletions Ports/lrzip/package.sh
Original file line number Diff line number Diff line change
@@ -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"
}
38 changes: 38 additions & 0 deletions Ports/lrzip/patches/0001-Remove-Linux-specific-code.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fabian Dellwing <[email protected]>
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)
7 changes: 7 additions & 0 deletions Ports/lrzip/patches/ReadMe.md
Original file line number Diff line number Diff line change
@@ -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.


0 comments on commit 7448db9

Please sign in to comment.