Merge pull request #7457 from heitbaum/7-zip

[le11] system-tools: migrate from p7zip to 7-zip and addon (2)
This commit is contained in:
CvH 2023-02-04 12:52:22 +01:00 committed by GitHub
commit 7beffea08b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 153 additions and 12 deletions

90
licenses/7-Zip.txt Normal file
View File

@ -0,0 +1,90 @@
7-Zip source code
~~~~~~~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7-Zip Copyright (C) 1999-2020 Igor Pavlov.
The licenses for files are:
1) CPP/7zip/Compress/Rar* files: the "GNU LGPL" with "unRAR license restriction"
2) CPP/7zip/Compress/LzfseDecoder.cpp: the "BSD 3-clause License"
3) Some files are "public domain" files, if "public domain" status is stated in source file.
4) the "GNU LGPL" for all other files. If there is no license information in
some source file, that file is under the "GNU LGPL".
The "GNU LGPL" with "unRAR license restriction" means that you must follow both
"GNU LGPL" rules and "unRAR license restriction" rules.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
BSD 3-clause License
--------------------
The "BSD 3-clause License" is used for the code in LzfseDecoder.cpp that implements LZFSE data decompression.
That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
that also uses the "BSD 3-clause License":
----
Copyright (c) 2015-2016, Apple Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----
unRAR license restriction
-------------------------
The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.
The license for original unRAR code has the following restriction:
The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.
--
Igor Pavlov

View File

@ -3,7 +3,7 @@
PKG_NAME="system-tools"
PKG_VERSION="1.0"
PKG_REV="1"
PKG_REV="2"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"
@ -11,13 +11,14 @@ PKG_URL=""
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="virtual"
PKG_SHORTDESC="A bundle of system tools and programs"
PKG_LONGDESC="This bundle currently includes autossh, bottom, diffutils, dstat, dtach, efibootmgr, encfs, evtest, fdupes, file, getscancodes, hddtemp, hd-idle, hid_mapper, htop, i2c-tools, inotify-tools, jq, libgpiod, lm_sensors, lshw, mc, mmc-utils, mtpfs, nmon, p7zip, patch, pv, screen, smartmontools, stress-ng, unrar, usb-modeswitch and vim."
PKG_LONGDESC="This bundle currently includes 7-zip, autossh, bottom, diffutils, dstat, dtach, efibootmgr, encfs, evtest, fdupes, file, getscancodes, hddtemp, hd-idle, hid_mapper, htop, i2c-tools, inotify-tools, jq, libgpiod, lm_sensors, lshw, mc, mmc-utils, mtpfs, nmon, patch, pv, screen, smartmontools, stress-ng, unrar, usb-modeswitch and vim."
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="System Tools"
PKG_ADDON_TYPE="xbmc.python.script"
PKG_DEPENDS_TARGET="toolchain \
7-zip \
autossh \
bottom \
diffutils \
@ -42,7 +43,6 @@ PKG_DEPENDS_TARGET="toolchain \
mmc-utils \
mtpfs \
nmon \
p7zip \
patch \
pv \
screen \
@ -60,6 +60,9 @@ fi
addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/{bin,data,lib}
# 7-zip
cp -P $(get_install_dir 7-zip)/usr/bin/7zz ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
# autossh
cp -P $(get_install_dir autossh)/usr/bin/autossh ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
@ -148,11 +151,6 @@ addon() {
# nmon
cp -P $(get_install_dir nmon)/usr/bin/nmon ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/
# p7zip
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/p7zip
cp -P $(get_install_dir p7zip)/usr/bin/{7z,7za,7z.so} ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/p7zip
cp -PR $(get_install_dir p7zip)/usr/bin/Codecs ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/p7zip
# patch
cp -P $(get_install_dir patch)/usr/bin/patch ${ADDON_BUILD}/${PKG_ADDON_ID}/bin

View File

@ -1,4 +1,3 @@
#!/bin/sh
file=/storage/.kodi/addons/virtual.system-tools/lib/p7zip/7z
[ ! -x ${file} ] && chmod +x ${file}
file=/storage/.kodi/addons/virtual.system-tools/bin/7zz
exec ${file} "$@"

View File

@ -1,4 +1,3 @@
#!/bin/sh
file=/storage/.kodi/addons/virtual.system-tools/lib/p7zip/7za
[ ! -x ${file} ] && chmod +x ${file}
file=/storage/.kodi/addons/virtual.system-tools/bin/7zz
exec ${file} "$@"

View File

@ -0,0 +1,55 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2023-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="7-zip"
PKG_VERSION="22.01"
PKG_SHA256="393098730c70042392af808917e765945dc2437dee7aae3cfcc4966eb920fbc5"
PKG_LICENSE="7-Zip"
PKG_SITE="https://www.7-zip.org"
PKG_URL="https://www.7-zip.org/a/7z${PKG_VERSION/./}-src.tar.xz"
PKG_DEPENDS_HOST="ccache:host"
PKG_DEPENDS_TARGET="toolchain"
PKG_LONGDESC="7-Zip is a file archiver with a high compression ratio"
PKG_TAR_STRIP_COMPONENTS="--strip-components=0"
PKG_TOOLCHAIN="manual"
pre_build_host() {
rm -fr ${PKG_BUILD}/.${HOST_NAME}
mkdir -p ${PKG_BUILD}/.${HOST_NAME}
cp -RP ${PKG_BUILD}/* ${PKG_BUILD}/.${HOST_NAME}
}
make_host() {
# compile without 7-Zip's assembler code (not required in toolchain)
make CXX=${CXX} CC=${CC} -f makefile.gcc -C ${PKG_BUILD}/.${HOST_NAME}/CPP/7zip/Bundles/Alone
}
makeinstall_host() {
mkdir -p ${TOOLCHAIN}/bin
cp ${PKG_BUILD}/.${HOST_NAME}/CPP/7zip/Bundles/Alone/_o/7za ${TOOLCHAIN}/bin
}
pre_build_target() {
rm -fr ${PKG_BUILD}/.${TARGET_NAME}
mkdir -p ${PKG_BUILD}/.${TARGET_NAME}
cp -RP ${PKG_BUILD}/* ${PKG_BUILD}/.${TARGET_NAME}
}
make_target() {
# arm (arm32) does not have an assembler code option for 7-Zip
# dont use x86_64 ../../cmpl_gcc_x64.mak file to build 7-Zip's assembler code (as asmc is not available)
if [ "${TARGET_ARCH}" = "aarch64" ]; then
make CXX=${CXX} CC=${CC} -f ../../cmpl_gcc_arm64.mak -C ${PKG_BUILD}/.${TARGET_NAME}/CPP/7zip/Bundles/Alone2
else
make CXX=${CXX} CC=${CC} -f makefile.gcc -C ${PKG_BUILD}/.${TARGET_NAME}/CPP/7zip/Bundles/Alone2
fi
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
if [ "${TARGET_ARCH}" = "aarch64" ]; then
cp -p ${PKG_BUILD}/.${TARGET_NAME}/CPP/7zip/Bundles/Alone2/b/g_arm64/7zz ${INSTALL}/usr/bin
else
cp -p ${PKG_BUILD}/.${TARGET_NAME}/CPP/7zip/Bundles/Alone2/_o/7zz ${INSTALL}/usr/bin
fi
}