# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= p7zip VERSION= 16.02 REVISION= 1 KEYWORDS= archivers VARIANTS= standard SDESC[standard]= File archiver with high compression ratio HOMEPAGE= https://p7zip.sourceforge.net/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= SF/p7zip/p7zip/16.02 DISTFILE[1]= p7zip_16.02_src_all.tar.bz2:main DF_INDEX= 1 SPKGS[standard]= complete primary docs OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none USES= cpe c++:primary DISTNAME= p7zip_16.02 LICENSE= LGPL21+:primary CUSTOM1:primary LICENSE_TERMS= primary:{{WRKSRC}}/DOC/License.txt LICENSE_NAME= CUSTOM1:"unRAR Restriction" LICENSE_FILE= LGPL21+:{{WRKSRC}}/DOC/copying.txt CUSTOM1:{{WRKSRC}}/DOC/unRarLicense.txt LICENSE_SCHEME= multi CPE_VENDOR= 7-zip FPC_EQUIVALENT= archivers/p7zip BUILD_TARGET= all3 MAKEFILE= makefile MAKE_ARGS= OPTFLAGS="{{CXXFLAGS}}" SINGLE_JOB= yes post-patch: ${REINPLACE_CMD} -e 's|{DEST_SHARE_DOC}|${STD_DOCDIR}|' \ ${WRKSRC}/man1/* ${MV} ${WRKSRC}/README ${WRKSRC}/DOC/readme.unix do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/p7zip .for BINARY in 7z 7za 7zr 7zCon.sfx ${INSTALL_PROGRAM} ${WRKSRC}/bin/${BINARY} ${STAGEDIR}${PREFIX}/libexec/p7zip .endfor ${INSTALL_LIB} ${WRKSRC}/bin/7z.so ${STAGEDIR}${PREFIX}/libexec/p7zip ${INSTALL_SCRIPT} ${FILESDIR}/7z ${STAGEDIR}${PREFIX}/bin ${LN} -sf 7z ${STAGEDIR}${PREFIX}/bin/7za ${LN} -sf 7z ${STAGEDIR}${PREFIX}/bin/7zr (cd ${WRKSRC}/man1 && \ ${INSTALL_MAN} 7z*.1 ${STAGEDIR}${MAN1PREFIX}/man/man1) (cd ${WRKSRC}/DOC && \ ${COPYTREE_SHARE} . ${STAGEDIR}${STD_DOCDIR}) .for LIC in Licence.txt copying.txt unRarLicense.txt ${RM} ${STAGEDIR}${STD_DOCDIR}/${LIC} .endfor [FILE:727:descriptions/desc.primary] p7zip is a Unix port of 7-Zip, a file archiver with high compression ratio (www.7-zip.org) with lots of features: * 7-Zip is free software distributed under the GNU LGPL * High compression ratio in new 7z format with LZMA compression o Unicode file names o Variable dictionary size (up to 4 GB) o Compressing speed: about 1 MB/s on 2 GHz CPU o Decompressing speed: about 10-20 MB/s on 2 GHz CPU * Supported formats: o Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR o Unpacking only: RAR, CAB, ISO, ARJ, LZH, CHM, Z, CPIO, RPM, DEB and NSIS * For ZIP and GZIP formats 7-Zip provides compression ratio that is 2-10 % better than ratio provided by PKZip and WinZip * Self-extracting capability for 7z format [FILE:106:distinfo] 5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f 4239909 p7zip_16.02_src_all.tar.bz2 [FILE:126:manifests/plist.primary] bin/ 7z 7za 7zr libexec/p7zip/ 7z 7z.%%SHARED_OBJECT%% 7zCon.sfx 7za 7zr share/man/man1/ 7z.1.gz 7za.1.gz 7zr.1.gz [FILE:569:patches/patch-CPP_7zip_Archive_7z_7zIn.cpp] Fix for CVE-2016-9296. Obtained from: https://sourceforge.net/p/p7zip/bugs/185/ Security: 48e83187-b6e9-11e6-b6cf-5453ed2e2b49 --- CPP/7zip/Archive/7z/7zIn.cpp.orig 2016-11-30 09:35:06 UTC +++ CPP/7zip/Archive/7z/7zIn.cpp @@ -1091,7 +1091,8 @@ HRESULT CInArchive::ReadAndDecodePackedS if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i]) ThrowIncorrect(); } - HeadersSize += folders.PackPositions[folders.NumPackStreams]; + if (folders.PackPositions) + HeadersSize += folders.PackPositions[folders.NumPackStreams]; return S_OK; } [FILE:367:patches/patch-CPP_7zip_Archive_Wim_WimHandler.cpp] --- CPP/7zip/Archive/Wim/WimHandler.cpp.orig 2016-06-11 08:08:06 UTC +++ CPP/7zip/Archive/Wim/WimHandler.cpp @@ -298,7 +298,7 @@ STDMETHODIMP CHandler::GetArchivePropert AString res; - bool numMethods = 0; + unsigned numMethods = 0; for (unsigned i = 0; i < ARRAY_SIZE(k_Methods); i++) { if (methodMask & ((UInt32)1 << i)) [FILE:424:patches/patch-CPP_7zip_Common_StreamObjects.cpp] CVE-2021-3465.patch --- CPP/7zip/Common/StreamObjects.cpp.orig 2015-06-19 10:52:08 UTC +++ CPP/7zip/Common/StreamObjects.cpp @@ -157,6 +157,8 @@ STDMETHODIMP CDynBufSeqOutStream::Write( STDMETHODIMP CBufPtrSeqOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize) { + if(_buffer == nullptr || _size == _pos) + return E_FAIL; size_t rem = _size - _pos; if (rem > size) rem = (size_t)size; [FILE:783:patches/patch-CPP_Windows_ErrorMsg.cpp] --- CPP/Windows/ErrorMsg.cpp.orig 2015-01-18 18:20:28 UTC +++ CPP/Windows/ErrorMsg.cpp @@ -13,7 +13,7 @@ UString MyFormatMessage(DWORD errorCode) const char * txt = 0; AString msg; - switch(errorCode) { + switch(HRESULT(errorCode)) { case ERROR_NO_MORE_FILES : txt = "No more files"; break ; case E_NOTIMPL : txt = "E_NOTIMPL"; break ; case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; @@ -43,7 +43,7 @@ bool MyFormatMessage(DWORD messageID, CS const char * txt = 0; AString msg; - switch(messageID) { + switch(HRESULT(messageID)) { case ERROR_NO_MORE_FILES : txt = "No more files"; break ; case E_NOTIMPL : txt = "E_NOTIMPL"; break ; case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; [FILE:386:patches/patch-CPP_Windows_System.cpp] --- CPP/Windows/System.cpp.orig 2015-11-20 21:33:04 UTC +++ CPP/Windows/System.cpp @@ -44,7 +44,7 @@ namespace NWindows #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) UInt32 GetNumberOfProcessors() { int nbcpu = 1; - size_t value; + int value; size_t len = sizeof(value); if (sysctlbyname("hw.ncpu", &value, &len, NULL, 0) == 0) nbcpu = value; [FILE:330:patches/patch-makefile.machine] --- makefile.machine.orig 2016-07-14 09:29:31 UTC +++ makefile.machine @@ -5,13 +5,9 @@ OPTFLAGS=-O -s ALLFLAGS=${OPTFLAGS} -pipe \ - -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ -DNDEBUG -D_REENTRANT -DENV_UNIX \ - -D_7ZIP_LARGE_PAGES \ $(LOCAL_FLAGS) -CXX=g++ -CC=gcc CC_SHARED=-fPIC LINK_SHARED=-fPIC -shared [FILE:112:files/7z] #!/bin/sh PROGNAME=${0##*/} BINPATH=$(dirname $(realpath $0))/../libexec/p7zip exec "$BINPATH/$PROGNAME" "$@" [FILE:223:files/special.mk] # Strip -ldl from all platforms except linux .if "${OPSYS}" != "Linux" _USES_configure+= 452:remove_libdl .endif remove_libdl: @echo "BSD: Remove -ldl linkage" ${REINPLACE_CMD} -e 's| -ldl||' ${WRKSRC}/makefile.machine