app-arch/unrar: add 7.2.1

Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
This commit is contained in:
Conrad Kostecki
2025-11-13 22:40:22 +01:00
parent 37e665dde0
commit 935b86ca6a
2 changed files with 80 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST unrar-7.1.10.tar.gz 268008 BLAKE2B 958dad50a84650e35a12d798b51519a2902cf6770bb6d65bdb11d07937d20190dc8e9a70073c0e3f999c071a5b749424faf6fcea3883957ecc5edab49cd724cd SHA512 37c524578211798c02ed460bb39cdde3fadb97d6d34e93a9eb380e61e5b852480a0b3b2a10dde9f9c67b92331ba7784f8ced0c3da6e834e132b7f87f16e9adea
DIST unrar-7.2.1.tar.gz 269805 BLAKE2B 43a382f8dbb325194098ebadb0d1055c8a686b3a7b9ca6cbc0bf18ab1715ce039430e0d75a60b9e2b28c575d1ebcfde881d9bebd35d73376cd572216b5999b9b SHA512 237c4e018e033c37b99ab7d91f6c4a9af21f5116cde3c2e182b4f351d6099db7b6be3a14bfdaefd1cb21f836805911edb9712dd0f0716508dad0b1ed930c5772

View File

@@ -0,0 +1,79 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib toolchain-funcs
MY_PN="${PN}src"
DESCRIPTION="Uncompress rar files"
HOMEPAGE="https://www.rarlab.com/rar_add.htm"
SRC_URI="https://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/unrar"
LICENSE="unRAR"
SLOT="0/7" # subslot = soname version
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
PATCHES=( "${FILESDIR}/${PN}-6.2.6-honor-flags.patch" )
src_prepare() {
default
local sed_args=( -e "/libunrar/s:.so:$(get_libname ${PV%.*.*}):" )
if [[ ${CHOST} == *-darwin* ]] ; then
sed_args+=( -e "s:-shared:-dynamiclib -install_name ${EPREFIX}/usr/$(get_libdir)/libunrar$(get_libname ${PV%.*.*}):" )
else
sed_args+=( -e "s:-shared:& -Wl,-soname -Wl,libunrar$(get_libname ${PV%.*.*}):" )
fi
sed -i "${sed_args[@]}" makefile || die
}
src_configure() {
mkdir -p build-{lib,bin} || die
printf 'VPATH = ..\ninclude ../makefile' > build-lib/Makefile || die
cp build-{lib,bin}/Makefile || die
}
src_compile() {
unrar_make() {
emake AR="$(tc-getAR)" CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" STRIP=true "$@"
}
unrar_make CXXFLAGS+=" -fPIC" -C build-lib lib
ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname) || die
ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname ${PV}) || die
unrar_make -C build-bin
}
src_install() {
dobin build-bin/unrar
dodoc readme.txt
dolib.so build-lib/libunrar*
# unrar doesn't officially install headers, but unofficially, software
# depends on it anyway. There is no standard for where to install them,
# but the most common location (shared by nearly all vendors) is "unrar".
# FreeBSD alone uses "libunrar". Gentoo formerly used "libunrar6" and
# had a compat symlink for FreeBSD, then passed the compat location in
# ./configure scripts e.g. for sys-fs/rar2fs. Software in the wild
# seems to expect either "unrar" or "libunrar".
# See: https://bugs.gentoo.org/916036
#
# We now use the "standard" (hah) location, and keep the compat symlink but
# change the destination. The version-suffixed location lacks utility, but
# we would keep it if we could, just in case -- unfortunately portage is
# buggy: https://bugs.gentoo.org/834600
#
# Hopefully, no one has ever actually used it and therefore this does not
# matter. The odds are on our side, since it periodically changed location
# arbitrarily.
insinto /usr/include/unrar
doins *.hpp
dosym unrar /usr/include/libunrar
find "${ED}" -type f -name "*.a" -delete || die
}