Al final he conseguido compilar una versión funcional de 7-zip file manager para GNU/Linux, otras de las novedades (aparte de que funciona) es que lleva las librerias Wx integradas en el el binario
Testado bajo Linux Mint cinnamon 19.3 GLIBC 2.27, Kernel 5.4.0-81 y compilado con GCC 10.3.0
La versión compilada (adjunta) se ha probado bajo
-Debian 11, GLIBC 2.31, Kernel 5.10.0
-ArcoLinux, GLIBC 2.33 Kernel 5.14.2
-Void Linux. GLIBC, 2.32, Kernel 5.13.13
y también funciona perfectamente en esos :ouo:
NOTA: Si ejecutando ./7zFM os arranca y funciona bien podeis borrar los directorios de las librerias y el .sh
Adjunto versión con librerias y versión sin librerias (recomendado este último, por tema de tamaño) y las versiones estáticas de 7za, 7zr, lzma y para crear autoejecutables para GNU/Linux 7zCon.sfx, precompridos con UPX)
7za es un ejecutable independiente. 7za maneja menos formatos de archivo que 7z, pero no necesita otros.
7zr es un ejecutable independiente. 7zr maneja menos formatos de archivo que 7z, pero no necesita otros. 7zr es una "versión ligera" de 7za que solo maneja archivos 7z.
Script nuevo, principalmente se ha mejorado en la detección del compilador, tipo de máquina usada y cambiado el GTK2 por el GTK3, ahora puedes escoger el script para Debian y sus forks o para F-void , si la versión anterior ya te iba bien no hace falta cambiar.
NOTA: en el caso de que querais compilarlo para 32 bits teneis de eliminar los # donde están los comandos
Eejemplo:
# sed -i 's/-m64/-m32/g' makefile.machine
quedando
sed -i 's/-m64/-m32/g' makefile.machine
Script para Debian/ubuntu/Mint
#!/bin/bash
# Thanks to tmn505
# https://aur.archlinux.org/packages/p7zip-gui/
#
# (U) KAPITALSIN 2022
#
# p7zip 16.02 GUI compiler B23022022 for Linux mint 19.3 (Debian forks)
#
# Script tested and working under:
# ================================
# -Linux mint 19.3 x86_64 GLIBC 2.27
# -Linux mint 19.3 i686 GLIBC 2.27
#
#-CAMBIADO GTK2 POR GTK3
#
# WxWidgets are integrated in the binary files
#
#sudo xbps-install -S gcc yasm gtk+3-devel wget patch pkg-config xz git
#sudo apt-get install yasm linux-libc-dev libgtk-3-dev libwxgtk3.0-dev p7zip-full
#
clear
currentver="$(gcc -dumpversion)"
requiredver="9"
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo "GCC valid found"
else
echo "GCC version "$currentver" found, version ${requiredver} or greater is required to compile p7zipGUI, now we are going to install the required GCC"
notify-send "INSTALLING NEW GCC"
echo "INSTALLING NEW GCC"
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-9 g++-9 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --auto gcc
#sudo cp --archive /usr/include/asm-generic /usr/include/asm
fi
sudo apt-get install yasm linux-libc-dev libgtk-3-dev libwxgtk3.0-dev p7zip-full -y
MACHINE_TYPE=`uname -m`
glibc="$(ldd --version | awk '/ldd/{print $NF}')"
time_start=`date +%s`
wget -N https://fossies.org/linux/misc/p7zip_16.02_src_all.tar.xz
tar xvfa p7zip_16.02_src_all.tar.xz
cd p7zip_16.02
wget -N https://src.fedoraproject.org/rpms/p7zip/raw/rawhide/f/14-Fix-g++-warning.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2016-9296.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2017-17969.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2018-5996.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2018-10115.patch
wget -N https://src.fedoraproject.org/rpms/p7zip/raw/rawhide/f/gcc10-conversion.patch
patch -p1 -i 14-Fix-g++-warning.patch
patch -p1 -i CVE-2016-9296.patch
patch -p1 -i CVE-2017-17969.patch
patch -p1 -i CVE-2018-5996.patch
patch -p1 -i CVE-2018-10115.patch
patch -p1 -i gcc10-conversion.patch
cp makefile.linux_amd64_asm makefile.machine
sed -i 's/-O -s/-O3 -s/g' makefile.machine
# sed -i 's/-m64/-m32/g' makefile.machine
# sed -i 's/-Dx64/-Dx86/g' makefile.machine
# sed -i 's/x64/x86/g' makefile.machine
# sed -i 's/amd64/x86/g' makefile.machines
# sed -i 's/x86_64/x86/g' makefile.machine
sed -i 's/x86_64-linux-gnu//g' CPP/7zip/*/*/*.depend
rm GUI/kde4/p7zip_compress.desktop
PATH=$PWD/wx3:$PATH
wget -N https://github.com/johna23-lab/filezilla/raw/main/wx3.7z
7z -y x wx3.7z
cd wx3
./configure --prefix=$(pwd) --with-gtk=3 --enable-monolithic --disable-shared --enable-static --enable-unicode --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin
make -j$(nproc)
cd ..
cd Utils
sed -i 's/_do_not_use//g' generate.py
./generate.py
cd ..
make -j$(nproc) 7zFM 7zG
cd bin
strip 7zFM 7zG 7z.so
mkdir p7zip.16.02.gui
echo '#!/bin/sh' > p7zip.16.02.gui/7zf.sh
echo ' BIN=./7zFM' >> p7zip.16.02.gui/7zf.sh
echo 'export LD_LIBRARY_PATH=lib/x86_64-linux-gnu:/lib64:usr/lib/x86_64-linux-gnu/' >> p7zip.16.02.gui/7zf.sh
echo 'exec $BIN $@' >> p7zip.16.02.gui/7zf.sh
chmod a+x p7zip.16.02.gui/7zf.sh
for library in $(ldd "7zFM" "7zG" "7z.so" | cut -d '>' -f 2 | awk '{print $1}')
do
[ -f "${library}" ] && cp --verbose --parents "${library}" "p7zip.16.02.gui"
done
cp 7zFM 7zG 7z.so "p7zip.16.02.gui"
cp -r Codecs "p7zip.16.02.gui"
mv "p7zip.16.02.gui" "../../p7zip.16.02.gui_GLIBC_"$glibc"_GTK3_"$MACHINE_TYPE""
echo "p7zip.16.02.gui COMPILED AT p7zip.16.02.gui_GLIBC_"$glibc"_GTK3_"$MACHINE_TYPE""
time_end=`date +%s`
time_exec=`expr $(( $time_end - $time_start ))`
echo "EL PROCESO DE COMPILADO HA TARDADO UN TOTAL DE $(($time_exec / 60)) minutos y $(($time_exec % 60)) segundos."
Script para F-void o Void
#!/bin/bash
# Thanks to tmn505
# https://aur.archlinux.org/packages/p7zip-gui/
#
# (U) KAPITALSIN 2022
#
# p7zip 16.02 GUI compiler B23022022 for F-Void (Linux Void)
#
# Script tested and working under:
# ================================
# -F-Void 2102022 x86_64 GLIBC 2.32
# -Linux Void i686 MUSLC
#
#-CAMBIADO GTK2 POR GTK3
#
# WxWidgets are integrated in the binary files
#
#sudo xbps-install -S gcc yasm gtk+3-devel wget patch pkg-config xz git
#sudo apt-get install gcc g++ yasm libgtk-3-dev p7zip gcc-9-multilib g++-9-multilib linux-libc-dev
#
sudo xbps-install -S gcc yasm gtk+3-devel wget patch pkg-config xz git p7zip
MACHINE_TYPE=`uname -m`
glibc="$(ldd --version | awk '/ldd/{print $NF}')"
time_start=`date +%s`
wget -N https://fossies.org/linux/misc/p7zip_16.02_src_all.tar.xz
tar xvfa p7zip_16.02_src_all.tar.xz
cd p7zip_16.02
wget -N https://src.fedoraproject.org/rpms/p7zip/raw/rawhide/f/14-Fix-g++-warning.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2016-9296.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2017-17969.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2018-5996.patch
wget -N https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2018-10115.patch
wget -N https://src.fedoraproject.org/rpms/p7zip/raw/rawhide/f/gcc10-conversion.patch
patch -p1 -i 14-Fix-g++-warning.patch
patch -p1 -i CVE-2016-9296.patch
patch -p1 -i CVE-2017-17969.patch
patch -p1 -i CVE-2018-5996.patch
patch -p1 -i CVE-2018-10115.patch
patch -p1 -i gcc10-conversion.patch
cp makefile.linux_amd64_asm makefile.machine
sed -i 's/-O -s/-O3 -s/g' makefile.machine
# sed -i 's/-m64/-m32/g' makefile.machine
# sed -i 's/-Dx64/-Dx86/g' makefile.machine
# sed -i 's/x64/x86/g' makefile.machine
# sed -i 's/amd64/x86/g' makefile.machines
# sed -i 's/x86_64/x86/g' makefile.machine
sed -i 's/x86_64-linux-gnu//g' CPP/7zip/*/*/*.depend
rm GUI/kde4/p7zip_compress.desktop
PATH=$PWD/wx3:$PATH
wget -N https://github.com/johna23-lab/filezilla/raw/main/wx3.7z
7z -y x wx3.7z
cd wx3
./configure --prefix=$(pwd) --with-gtk=3 --enable-monolithic --disable-shared --enable-static --enable-unicode --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin
make -j$(nproc)
cd ..
cd Utils
sed -i 's/_do_not_use//g' generate.py
./generate.py
cd ..
make -j$(nproc) 7zFM 7zG
cd bin
strip 7zFM 7zG 7z.so
mkdir p7zip.16.02.gui
echo '#!/bin/sh' > p7zip.16.02.gui/7zf.sh
echo ' BIN=./7zFM' >> p7zip.16.02.gui/7zf.sh
echo 'export LD_LIBRARY_PATH=lib/x86_64-linux-gnu:/lib64:usr/lib/x86_64-linux-gnu/' >> p7zip.16.02.gui/7zf.sh
echo 'exec $BIN $@' >> p7zip.16.02.gui/7zf.sh
chmod a+x p7zip.16.02.gui/7zf.sh
for library in $(ldd "7zFM" "7zG" "7z.so" | cut -d '>' -f 2 | awk '{print $1}')
do
[ -f "${library}" ] && cp --verbose --parents "${library}" "p7zip.16.02.gui"
done
cp 7zFM 7zG 7z.so "p7zip.16.02.gui"
cp -r Codecs "p7zip.16.02.gui"
mv "p7zip.16.02.gui" "../../p7zip.16.02.gui_GLIBC_"$glibc"_GTK3_"$MACHINE_TYPE""
echo "p7zip.16.02.gui COMPILED AT p7zip.16.02.gui_GLIBC_"$glibc"_GTK3_"$MACHINE_TYPE""
time_end=`date +%s`
time_exec=`expr $(( $time_end - $time_start ))`
echo "EL PROCESO DE COMPILADO HA TARDADO UN TOTAL DE $(($time_exec / 60)) minutos y $(($time_exec % 60)) segundos."
Este es el script de compilación antiguo
# Thanks to tmn505
# https://aur.archlinux.org/packages/p7zip-gui/
#
# p7zip 16.02 GUI compiler B12092021 for Debian/*buntu/mint/and other forks
#
# Tested under Linux Mint cinnamon 19.3 GLIBC 2.27 and compiled with GCC 10.3.0
#
# KAPITALSIN 2021
#
# WxWidgets are integrated in the binary files
#
glibc="$(ldd --version | awk '/ldd/{print $NF}')"
sudo apt-get install gcc g++ yasm libgtk2.0-dev libwxgtk3.0-dev
time_start=`date +%s`
wget https://fossies.org/linux/misc/p7zip_16.02_src_all.tar.xz
tar xvfa p7zip_16.02_src_all.tar.xz
cd p7zip_16.02
wget https://src.fedoraproject.org/rpms/p7zip/raw/rawhide/f/14-Fix-g++-warning.patch
wget https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2016-9296.patch
wget https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2017-17969.patch
wget https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2018-5996.patch
wget https://raw.githubusercontent.com/archlinux/svntogit-packages/a82b67f5d36f374afd154e7648bb13ec38a3c497/trunk/CVE-2018-10115.patch
wget https://src.fedoraproject.org/rpms/p7zip/raw/rawhide/f/gcc10-conversion.patch
patch -p1 -i 14-Fix-g++-warning.patch
patch -p1 -i CVE-2016-9296.patch
patch -p1 -i CVE-2017-17969.patch
patch -p1 -i CVE-2018-5996.patch
patch -p1 -i CVE-2018-10115.patch
patch -p1 -i gcc10-conversion.patch
cp makefile.linux_amd64_asm makefile.machine
sed -i 's/-O -s/-O3 -s/g' makefile.machine
sed -i 's/x86_64-linux-gnu//g' CPP/7zip/*/*/*.depend
rm GUI/kde4/p7zip_compress.desktop
PATH=$PWD/wx3:$PATH
wget https://github.com/johna23-lab/filezilla/raw/main/wx3.7z
7z x wx3.7z
rm wx3.7z
cd wx3
cp -r -n /usr/include/wx-3.0/wx .
./configure --prefix=$(pwd) --enable-monolithic --disable-shared --enable-static --enable-unicode --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin
make -j$(nproc)
cd ..
cd Utils
sed -i 's/_do_not_use//g' generate.py
./generate.py
cd ..
make -j$(nproc) 7zFM 7zG
cd bin
strip 7zFM 7zG 7z.so
mkdir p7zip.16.02.gui
echo '#!/bin/sh' > p7zip.16.02.gui/7zf.sh
echo ' BIN=./7zFM' >> p7zip.16.02.gui/7zf.sh
echo 'export LD_LIBRARY_PATH=lib/x86_64-linux-gnu:/lib64:usr/lib/x86_64-linux-gnu/' >> p7zip.16.02.gui/7zf.sh
echo 'exec $BIN $@' >> p7zip.16.02.gui/7zf.sh
chmod a+x p7zip.16.02.gui/7zf.sh
for library in $(ldd "7zFM" "7zG" "7z.so" | cut -d '>' -f 2 | awk '{print $1}')
do
[ -f "${library}" ] && cp --verbose --parents "${library}" "p7zip.16.02.gui"
done
cp 7zFM 7zG 7z.so "p7zip.16.02.gui"
cp -r Codecs "p7zip.16.02.gui"
mv "p7zip.16.02.gui" "../../p7zip.16.02.gui_GLIBC_"$glibc""
echo "p7zip.16.02.gui COMPILED AT p7zip.16.02.gui_GLIBC_"$glibc""
time_end=`date +%s`
time_exec=`expr $(( $time_end - $time_start ))`
echo "EL PROCESO DE COMPILADO HA TARDADO UN TOTAL DE $(($time_exec / 60)) minutos y $(($time_exec % 60)) segundos."