Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fee9459
unarr: add new package
luadebug Oct 9, 2025
7fad868
unarr: add linkage check for Windows target
luadebug Oct 17, 2025
405c5dd
unarr: update git-tree to match the latest commit
luadebug Oct 17, 2025
2c29b62
Try to debundle 7zip
luadebug Oct 18, 2025
418c4d5
vdb
luadebug Oct 18, 2025
3a5ff0c
Remove lzmasdk folder
luadebug Oct 18, 2025
69d3783
vdb
luadebug Oct 18, 2025
f25e1df
Debundle 7zip by removing lzmasdk references and linking to the 7zip …
luadebug Oct 18, 2025
14a5e86
Update git-tree reference for unarr to match the latest commit
luadebug Oct 18, 2025
bbb5e00
Debundle 7zip by removing lzmasdk references and linking to the 7zip …
luadebug Oct 18, 2025
644b684
Update git-tree reference for unarr to match the latest commit
luadebug Oct 18, 2025
9f551cf
Add Z7_PPMD_SUPPORT to target_compile_definitions for 7zip
luadebug Oct 18, 2025
1ac8661
Update 7zip port version to 1 in vcpkg.json and baseline.json; add gi…
luadebug Oct 18, 2025
674a889
Refactor CMakeLists.txt to remove lzmasdk references and link to the …
luadebug Oct 18, 2025
ae2f8a4
Update git-tree reference for unarr to match the latest commit
luadebug Oct 18, 2025
5985abc
Refactor CMakeLists.txt to remove lzmasdk references and link to the …
luadebug Oct 18, 2025
50579a6
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
25d897e
Refactor CMakeLists.txt to remove lzmasdk references and link to the …
luadebug Oct 18, 2025
632e57d
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
cd9609c
Refactor CMakeLists.txt to link 7zip as a public library and ensure h…
luadebug Oct 18, 2025
d561314
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
ed81d8a
Refactor CMakeLists.txt to remove lzmasdk references and link to 7zip…
luadebug Oct 18, 2025
132151e
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
530c9b2
Refactor CMakeLists.txt to remove lzmasdk references and add support …
luadebug Oct 18, 2025
6e311a7
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
317e3ee
Update ports/unarr/debundle-7zip.patch
luadebug Oct 18, 2025
c31ce8f
Update ports/unarr/debundle-7zip.patch
luadebug Oct 18, 2025
83c5e2c
Update ports/unarr/debundle-7zip.patch
luadebug Oct 18, 2025
b7aff7b
Refactor CMakeLists.txt to remove lzmasdk references and integrate 7z…
luadebug Oct 18, 2025
3037d97
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
e7f370a
Refactor CMakeLists.txt to remove lzmasdk references and update to us…
luadebug Oct 18, 2025
ba3ffd3
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
4f17244
Add conditional linkage check for Windows target in portfile.cmake
luadebug Oct 18, 2025
2ddae2a
Update git-tree reference for unarr to the latest commit
luadebug Oct 18, 2025
6fcc94f
Remove Windows-specific linkage check and update vcpkg.json to suppor…
luadebug Oct 19, 2025
c4e563b
Update git-tree reference for unarr to the latest commit
luadebug Oct 19, 2025
900a80c
Update vcpkg.json to modify Windows support condition for static linking
luadebug Oct 20, 2025
30294ec
Update git-tree reference for unarr to the latest commit
luadebug Oct 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/7zip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ endif()
# CPP/7zip/Bundles/Format7zF/makefile[_gcc].mak
# CPP/7zip/7zip[_gcc].mak

target_compile_definitions(7zip PRIVATE Z7_EXTERNAL_CODECS)
target_compile_definitions(7zip PRIVATE Z7_EXTERNAL_CODECS Z7_PPMD_SUPPORT)
target_sources(7zip PRIVATE
CPP/7zip/Archive/ArchiveExports.cpp
CPP/7zip/Archive/DllExports2.cpp
Expand Down
1 change: 1 addition & 0 deletions ports/7zip/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "7zip",
"version": "25.1",
"port-version": 1,
"description": "Library for archiving file with a high compression ratio.",
"homepage": "https://www.7-zip.org",
"license": "LGPL-2.1-or-later",
Expand Down
165 changes: 165 additions & 0 deletions ports/unarr/debundle-7zip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f38b229..3d5c150 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,19 +52,6 @@ add_library(
# common/custalloc.c
common/stream.c
common/unarr.c
- lzmasdk/7zTypes.h
- lzmasdk/Compiler.h
- lzmasdk/CpuArch.h
- lzmasdk/Ppmd.h
- lzmasdk/Ppmd7.h
- lzmasdk/Ppmd8.h
- lzmasdk/Precomp.h
- lzmasdk/CpuArch.c
- lzmasdk/Ppmd7.c
- lzmasdk/Ppmd8.c
- lzmasdk/Ppmd7Dec.c
- lzmasdk/Ppmd7aDec.c
- lzmasdk/Ppmd8Dec.c
rar/lzss.h
rar/rar.h
rar/rarvm.h
@@ -102,6 +89,12 @@ target_include_directories(
if(BUILD_SHARED_LIBS)
target_compile_definitions(unarr PUBLIC UNARR_IS_SHARED_LIBRARY)
endif()
+# Debundle 7zip
+find_package(7zip CONFIG REQUIRED)
+target_link_libraries(unarr PRIVATE 7zip::7zip)
+# 7zip upstream does not supply a .pc file. Add it to Libs.private.
+set(PROJECT_LIBS_PRIVATE "${PROJECT_LIBS_PRIVATE} -l7zip")
+set(UNARR_DEPENDS_7zip "find_dependency(7zip CONFIG)")

if(USE_SYSTEM_BZ2)
find_package(BZip2)
@@ -115,7 +108,8 @@ if(BZIP2_FOUND)
endif()
target_compile_definitions(unarr PRIVATE -DHAVE_BZIP2)
# Bzip2 upstream does not supply a .pc file. Add it to Libs.private.
- set(PROJECT_LIBS_PRIVATE "-I${BZIP2_INCLUDE_DIRS} -l${BZIP2_LIBRARIES}")
+ set(PROJECT_CFLAGS "${PROJECT_CFLAGS} -I${BZIP2_INCLUDE_DIRS}")
+ set(PROJECT_LIBS_PRIVATE "${PROJECT_LIBS_PRIVATE} -l${BZIP2_LIBRARIES}")
set(UNARR_DEPENDS_BZip2 "find_dependency(BZip2)")
endif()

@@ -154,28 +148,6 @@ if(ZLIB_FOUND)
endif()

if(ENABLE_7Z)
- target_sources(
- unarr
- PRIVATE lzmasdk/7z.h
- lzmasdk/7zArcIn.c
- lzmasdk/7zBuf.h
- lzmasdk/7zBuf.c
- lzmasdk/7zDec.c
- lzmasdk/7zStream.c
- lzmasdk/7zWindows.h
- lzmasdk/Bcj2.h
- lzmasdk/Bcj2.c
- lzmasdk/Bra.c
- lzmasdk/Bra.h
- lzmasdk/Bra86.c
- lzmasdk/7zCrc.h
- lzmasdk/Delta.h
- lzmasdk/Delta.c
- lzmasdk/Lzma2Dec.h
- lzmasdk/Lzma2Dec.c)
- if(LIBLZMA_FOUND) # TODO: Replace 7z lzma with system lzma
- target_sources(unarr PRIVATE lzmasdk/LzmaDec.h lzmasdk/LzmaDec.c)
- endif()
target_compile_definitions(unarr PRIVATE -DHAVE_7Z -DZ7_PPMD_SUPPORT)
endif()

@@ -194,8 +166,7 @@ if(UNIX
-Werror-implicit-function-declaration
$<$<CONFIG:Release>:-fomit-frame-pointer>
$<$<C_COMPILER_ID:Clang,AppleClang>:
- -Wno-missing-field-initializers>
- -flto)
+ -Wno-missing-field-initializers>)
if(BUILD_FUZZER)
target_compile_options(unarr PUBLIC "${sanitize_opts}")
target_compile_definitions(
@@ -218,7 +189,7 @@ if(UNIX

# Clang linker needs -flto too when doing lto
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
- set(linker_opts "${linker_opts} -flto")
+ set(linker_opts "${linker_opts}")
endif()

set_target_properties(unarr PROPERTIES LINK_FLAGS "${linker_opts}")
diff --git a/_7z/_7z.h b/_7z/_7z.h
index 7f207e1..f488e42 100644
--- a/_7z/_7z.h
+++ b/_7z/_7z.h
@@ -6,9 +6,9 @@

#include "../common/unarr-imp.h"

-#include "../lzmasdk/7zTypes.h"
+#include <7zip/C/7zTypes.h>
#ifdef HAVE_7Z
-#include "../lzmasdk/7z.h"
+#include <7zip/C/7z.h>
#endif

typedef struct ar_archive_7z_s ar_archive_7z;
diff --git a/pkg-config.pc.cmake b/pkg-config.pc.cmake
index 9055aef..a8581e0 100644
--- a/pkg-config.pc.cmake
+++ b/pkg-config.pc.cmake
@@ -5,7 +5,7 @@ libdir=@PROJECT_INSTALL_LIBDIR@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
-Cflags: -I${includedir}
+Cflags: -I${includedir}@PROJECT_CFLAGS@
Requires.private: @PROJECT_REQUIRES_PRIVATE@
Libs: -L${libdir} -l@PROJECT_NAME@
Libs.private: @PROJECT_LIBS_PRIVATE@
diff --git a/rar/rar.h b/rar/rar.h
index a0a420a..b522a33 100644
--- a/rar/rar.h
+++ b/rar/rar.h
@@ -7,7 +7,7 @@
#include "../common/unarr-imp.h"

#include "lzss.h"
-#include "../lzmasdk/Ppmd7.h"
+#include <7zip/C/Ppmd7.h>
#include <limits.h>

static inline size_t smin(size_t a, size_t b) { return a < b ? a : b; }
diff --git a/unarr-config.cmake.in b/unarr-config.cmake.in
index 1c95f9b..4d82965 100644
--- a/unarr-config.cmake.in
+++ b/unarr-config.cmake.in
@@ -5,6 +5,7 @@ include(CMakeFindDependencyMacro)
@UNARR_DEPENDS_BZip2@
@UNARR_DEPENDS_LibLZMA@
@UNARR_DEPENDS_ZLIB@
+@UNARR_DEPENDS_7zip@

if (NOT TARGET unarr::unarr)
include("${CMAKE_CURRENT_LIST_DIR}/unarr-targets.cmake")
diff --git a/zip/zip.h b/zip/zip.h
index b2ba34c..23da8d8 100644
--- a/zip/zip.h
+++ b/zip/zip.h
@@ -16,9 +16,9 @@
#ifdef HAVE_LIBLZMA
#include <lzma.h>
#else
-#include "../lzmasdk/LzmaDec.h"
+#include <7zip/C/LzmaDec.h>
#endif
-#include "../lzmasdk/Ppmd8.h"
+#include <7zip/C/Ppmd8.h>

typedef struct ar_archive_zip_s ar_archive_zip;

33 changes: 33 additions & 0 deletions ports/unarr/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO selmf/unarr
REF "v${VERSION}"
SHA512 da170e0391fbe92e9b2474beb6be9a96c9f905e4e572235aa839cda3f6faf3cb99773eede34e1054138a4997bf68a18ee84f4df47add202355449634c0fd6d93
HEAD_REF master
PATCHES
debundle-7zip.patch
)

file(REMOVE_RECURSE "${SOURCE_PATH}/lzmasdk")

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DENABLE_7Z=ON
-DUSE_SYSTEM_BZ2=ON
-DUSE_SYSTEM_LZMA=ON
-DUSE_SYSTEM_ZLIB=ON
-DUSE_ZLIB_CRC=ON
-DBUILD_INTEGRATION_TESTS=OFF
-DBUILD_FUZZER=OFF
-DBUILD_UNIT_TESTS=OFF
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/unarr")
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
22 changes: 22 additions & 0 deletions ports/unarr/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "unarr",
"version": "1.1.1",
"description": "A decompression library for rar, tar, zip and 7z archives.",
"homepage": "https://github.com/selmf/unarr",
"license": "LGPL-3.0-only",
"supports": "!windows | static",
"dependencies": [
"7zip",
"bzip2",
"liblzma",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}
10 changes: 10 additions & 0 deletions scripts/test_ports/vcpkg-ci-unarr/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

vcpkg_find_acquire_program(PKGCONFIG)

vcpkg_cmake_configure(
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
OPTIONS
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
)
vcpkg_cmake_build()
13 changes: 13 additions & 0 deletions scripts/test_ports/vcpkg-ci-unarr/project/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.25.1)
project(unarr-test LANGUAGES C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)

find_package(unarr CONFIG REQUIRED)
add_executable(main main.c)
target_link_libraries(main PRIVATE unarr::unarr)

find_package(PkgConfig REQUIRED)
pkg_check_modules(libunarr REQUIRED IMPORTED_TARGET libunarr)
add_executable(main2 main.c)
target_link_libraries(main2 PRIVATE PkgConfig::libunarr)
8 changes: 8 additions & 0 deletions scripts/test_ports/vcpkg-ci-unarr/project/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <unarr.h>
int main()
{
ar_stream *stream;
ar_archive *ar = ar_open_rar_archive(stream);
ar_close_archive(ar);
return 0;
}
12 changes: 12 additions & 0 deletions scripts/test_ports/vcpkg-ci-unarr/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "vcpkg-ci-unarr",
"version-string": "ci",
"description": "Validates unarr",
"dependencies": [
"unarr",
{
"name": "vcpkg-cmake",
"host": true
}
]
}
5 changes: 5 additions & 0 deletions versions/7-/7zip.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "181bb1c243122a292eef7567aa94476888b18465",
"version": "25.1",
"port-version": 1
},
{
"git-tree": "a92e7bbff417f0728def797557491c0251d2602e",
"version": "25.1",
Expand Down
6 changes: 5 additions & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"7zip": {
"baseline": "25.1",
"port-version": 0
"port-version": 1
},
"ableton": {
"baseline": "3.0.6",
Expand Down Expand Up @@ -9932,6 +9932,10 @@
"baseline": "2022-01-21",
"port-version": 1
},
"unarr": {
"baseline": "1.1.1",
"port-version": 0
},
"uni-algo": {
"baseline": "1.2.0",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/u-/unarr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "00f1f2116e607b7a82c7869636372a98f93985c4",
"version": "1.1.1",
"port-version": 0
}
]
}
Loading