summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorJohn Brehm <cooljohnny3@gmail.com>2021-06-04 00:21:33 -0700
committerGitHub <noreply@github.com>2021-06-04 08:21:33 +0100
commit2dfd95767ab77e4090d7cbb46eb96f1ba6e1b771 (patch)
treec1f746a8310c64bba5b4f54d0161623eaf6a8bda /Ports
parent6093236424cf72ba9ea999f7c30d35920f9778d9 (diff)
downloadserenity-2dfd95767ab77e4090d7cbb46eb96f1ba6e1b771.zip
Ports: Add p7zip
Diffstat (limited to 'Ports')
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/p7zip/package.sh30
-rw-r--r--Ports/p7zip/patches/fixes.patch39
3 files changed, 70 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index fd058441d7..43bde42d91 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -96,6 +96,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`opentyrian`](opentyrian/) | OpenTyrian | 84b820f | https://github.com/opentyrian/opentyrian |
| [`opentyrian-data`](opentyrian-data/) | OpenTyrian graphics and audio | 1.0.0 | http://camanis.net/tyrian/tyrian21.zip |
| [`oksh`](oksh/) | oksh | 6.8.1 | https://github.com/ibara/oksh |
+| [`p7zip`](p7zip/) | p7zip | 17.04 | https://github.com/jinfeihan57/p7zip |
| [`patch`](patch/) | patch (OpenBSD) | 6.6 | https://github.com/ibara/libpuffy |
| [`pcre`](pcre/) | Perl-compatible Regular Expressions (PCRE) | 8.44 | https://www.pcre.org/ |
| [`pcre2`](pcre2/) | Perl-compatible Regular Expressions (PCRE2) | 10.34 | https://www.pcre.org/ |
diff --git a/Ports/p7zip/package.sh b/Ports/p7zip/package.sh
new file mode 100755
index 0000000000..36dc0aa1cf
--- /dev/null
+++ b/Ports/p7zip/package.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+
+port="p7zip"
+version="17.04"
+useconfigure=true
+auth_type=sha256
+files="https://github.com/jinfeihan57/p7zip/archive/refs/tags/v${version}.tar.gz p7zip-${version}.tar.gz ea029a2e21d2d6ad0a156f6679bd66836204aa78148a4c5e498fe682e77127ef"
+configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_SOURCE_DIR}/Toolchain/CMake/CMakeToolchain.txt"
+workdir=$port-$version/CPP
+
+post_fetch() {
+ run_replace_in_file "s/\r//" 7zip/CMAKE/7za/CMakeLists.txt
+}
+
+configure() {
+ run cmake 7zip/CMAKE $configopts
+}
+
+build() {
+ run make $makeopts
+}
+
+install() {
+ run cp -r bin/Codecs $SERENITY_INSTALL_ROOT/usr/local/bin
+ run cp bin/7z_ $SERENITY_INSTALL_ROOT/usr/local/bin
+ run cp bin/7z.so $SERENITY_INSTALL_ROOT/usr/local/bin
+ run cp bin/7za $SERENITY_INSTALL_ROOT/usr/local/bin
+ run cp bin/7zCon.sfx $SERENITY_INSTALL_ROOT/usr/local/bin
+ run cp bin/7zr $SERENITY_INSTALL_ROOT/usr/local/bin
+}
diff --git a/Ports/p7zip/patches/fixes.patch b/Ports/p7zip/patches/fixes.patch
new file mode 100644
index 0000000000..b6f7a01bab
--- /dev/null
+++ b/Ports/p7zip/patches/fixes.patch
@@ -0,0 +1,39 @@
+diff --git a/7zip/Archive/Zip/ZipItem.cpp b/7zip/Archive/Zip/ZipItem.cpp
+index 353e895..ad0a3da 100644
+--- a/7zip/Archive/Zip/ZipItem.cpp
++++ b/7zip/Archive/Zip/ZipItem.cpp
+@@ -19,6 +19,7 @@
+ #include "../Common/ItemNameUtils.h"
+
+ #include "ZipItem.h"
++#include <strings.h>
+
+ namespace NArchive {
+ namespace NZip {
+diff --git a/7zip/CMAKE/7za/CMakeLists.txt b/7zip/CMAKE/7za/CMakeLists.txt
+index 469e325..32388ac 100644
+--- a/7zip/CMAKE/7za/CMakeLists.txt
++++ b/7zip/CMAKE/7za/CMakeLists.txt
+@@ -357,6 +357,9 @@ add_executable(7za
+ "../../../../myWindows/wine_date_and_time.cpp"
+ )
+
++IF(SERENITYOS)
++ TARGET_LINK_LIBRARIES(7za ${CMAKE_THREAD_LIBS_INIT} dl iconv)
++ENDIF(SERENITYOS)
+
+ IF(APPLE)
+ TARGET_LINK_LIBRARIES(7za ${COREFOUNDATION_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
+diff --git a/myWindows/config.h b/myWindows/config.h
+index 497d197..fa402c6 100644
+--- a/myWindows/config.h
++++ b/myWindows/config.h
+@@ -36,7 +36,7 @@
+ #define ENV_HAVE_TOWUPPER
+ #endif
+
+-
++ #undef ENV_HAVE_WCTYPE_H
+
+ #if !defined(ENV_BEOS) && !defined(ANDROID_NDK)
+