@calcium, well, check that you have permissions and ownership for the package directory.
Also try to edit PKGBUILD
, change this line:
chmod -R a=r,a+X,u+w .
to
chmod -R a=rw,a+X .
and see does something changed.
Git Clone URL: | https://aur.archlinux.org/7-zip-full.git (read-only, click to copy) |
---|---|
Package Base: | 7-zip-full |
Description: | File archiver with a high compression ratio (full package to replace p7zip) |
Upstream URL: | https://7-zip.org/ |
Keywords: | 7-zip 7z 7zip archiver compress p7zip zip |
Licenses: | BSD-3-Clause, LGPL-2.1-or-later, LicenseRef-UnRAR |
Conflicts: | 7-zip, p7zip |
Provides: | 7-zip, 7z.so, p7zip |
Submitter: | Hanabishi |
Maintainer: | Hanabishi |
Last Packager: | Hanabishi |
Votes: | 59 |
Popularity: | 1.72 |
First Submitted: | 2022-01-07 08:49 (UTC) |
Last Updated: | 2024-05-17 12:48 (UTC) |
@calcium, well, check that you have permissions and ownership for the package directory.
Also try to edit PKGBUILD
, change this line:
chmod -R a=r,a+X,u+w .
to
chmod -R a=rw,a+X .
and see does something changed.
The package doesn't build, I get this error:
make: g++: Permission denied
make: *** [../../7zip_gcc.mak:399: /home/yfoow/7-zip-full/src/build/StreamBinder.o] Error 127
make: Leaving directory '/home/yfoow/7-zip-full/src/CPP/7zip/Bundles/Alone'
==> ERROR: A failure occurred in build().
To build without ASM (uasm
), set NO_ASM
variable. For example:
NO_ASM=1 makepkg -si
@ZhangHua, I implemented your request, but in slightly different way.
Now the package can be built for all supported architectures and with clang.
Hello, I think this patch will allow this program to build under arm64 and x86 arch and with clang and gcc compiler, please consider merging it:
diff --git a/PKGBUILD b/PKGBUILD
index d382295..3bff388 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,26 +10,50 @@ provides=("${pkgname%-full}" 'p7zip')
conflicts=("${provides[@]}")
_archive="7z${pkgver//./}-src.tar.xz"
+_compiler=${CC:-gcc}
+[[ ${_compiler} == clang ]] && makedepends+=('clang' 'lld')
source=(
"${_archive}::${url}/a/${_archive}"
'prepare.patch'
)
-sha256sums=(
- '393098730c70042392af808917e765945dc2437dee7aae3cfcc4966eb920fbc5'
- 'fa1fd77e9d95f97d349f057c53b9ba4bacde64b2fae3a50d16b1d93e991d7866'
-)
+sha256sums=('393098730c70042392af808917e765945dc2437dee7aae3cfcc4966eb920fbc5'
+ '4e010de2dce2eebbe72d0e9f72fbf953eb2f8cba7bffbae53bda1544e3879101')
prepare() {
cd "${srcdir}"
chmod -R a=r,a+X,u+w .
patch -p0 --binary -i "${source[1]}"
+ for file in var_{clang,gcc}{,_{arm64,x64,x86}}.mak
+ do
+ sed -i '
+ s#O=b/c_$(PLATFORM)#O=$(BUILD_DIR)#;
+ s#O=b/g_$(PLATFORM)#O=$(BUILD_DIR)#;
+ s#O=b/c#O=$(BUILD_DIR)#;
+ s#O=b/g#O=$(BUILD_DIR)#
+ ' "${srcdir}/CPP/7zip/${file}"
+ done
+
}
build() {
+ case ${CARCH} in
+ x86_64)
+ _arch=_x64
+ ;;
+ aarch64)
+ _arch=_arm64
+ ;;
+ i686)
+ _arch=_x86
+ ;;
+ *)
+ _arch=
+ ;;
+ esac
local bundles="${srcdir}/CPP/7zip/Bundles"
- local mak="${srcdir}/CPP/7zip/cmpl_gcc_x64.mak"
+ local mak="${srcdir}/CPP/7zip/cmpl_${_compiler}${_arch}.mak"
local targets=("Alone" "Alone2" "Alone7z" "Format7zF")
(
export BUILD_DIR="${srcdir}/build"
diff --git a/prepare.patch b/prepare.patch
index f3db023..61feacd 100644
--- a/prepare.patch
+++ b/prepare.patch
@@ -15,9 +15,3 @@
@@ -182 +182 @@
-CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(CXXFLAGS_EXTRA) $(CC_SHARED) -o $@ $(CXX_WARN_FLAGS)
+CXXFLAGS += $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(CXXFLAGS_EXTRA) $(CC_SHARED) -o $@ $(CXX_WARN_FLAGS)
-
---- CPP/7zip/var_gcc_x64.mak
-+++ CPP/7zip/var_gcc_x64.mak
-@@ -2 +2 @@
--O=b/g_$(PLATFORM)
-+O=$(BUILD_DIR)
Checked with the custom flags and its seems ok. Here is an update with a respective patch.
@saltedcoffii, if you look at PKGBUILD
you can see it has nothing to do with CFLAGS
. They are baked in the source makefiles.
I can patch the source to respect custom CFLAGS
, but can't say is this a good idea or not. Backed flags are very specific and obviously have some intentions by the developer.
7-zip-full does not respect custom CFLAGS specified in /etc/makepkg.conf
. I have the following CFLAGS set:
CFLAGS="-march=x86-64-v2 -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -mpclmul"
The compiler invocation (the first one) is as follows:
gcc -O2 -c -Wall -Werror -Wextra -Waddress -Waddress-of-packed-member -Waggressive-loop-optimizations -Wattributes -Wbool-compare -Wbool-operation -Wcast-align -Wcast-align=strict -Wcomment -Wdangling-else -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wformat-contains-nul -Wimplicit-fallthrough=5 -Winit-self -Wint-in-bool-context -Wint-to-pointer-cast -Wunused -Wunused-macros -Wconversion -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -Wno-maybe-uninitialized -o /home/saltedcoffee/Projects/7-zip-full/src/build/7zStream.o ../../../../C/7zStream.c
If this is an issue with upstream, not with the PKGBUILD, let me know and I'm happy to report it.
@pipes80, report bugs to the upstream.
this software no work fine when extracting archive it's an infinite loop for extract
Pinned Comments
Hanabishi commented on 2022-01-07 08:53 (UTC) (edited on 2023-09-18 11:00 (UTC) by Hanabishi)
Not all apps are compatible with original
7-zip
binaries!In case of problems, try reverting to original
p7zip
.