Ports: Add p7zip

This commit is contained in:
John Brehm 2021-06-04 00:21:33 -07:00 committed by GitHub
parent 6093236424
commit 2dfd95767a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 70 additions and 0 deletions

View file

@ -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/ |

30
Ports/p7zip/package.sh Executable file
View file

@ -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
}

View file

@ -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)