From 68186285bd3a3e0c9552d9bc2a6391bad8138abc Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Thu, 3 Jul 2025 12:36:12 -0700 Subject: [PATCH] only use 7zz on macos (#1012) --- .github/workflows/package-linux.yml | 2 +- Dockerfile-base | 8 ++++---- README.md | 2 +- kindlecomicconverter/comicarchive.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/package-linux.yml b/.github/workflows/package-linux.yml index 10e1306..fdc512c 100644 --- a/.github/workflows/package-linux.yml +++ b/.github/workflows/package-linux.yml @@ -34,7 +34,7 @@ jobs: - name: Install python dependencies run: | sudo apt-get update - sudo apt-get install -y libpng-dev libjpeg-dev 7zip python3-pip squashfs-tools libfuse2 libxcb-cursor0 + sudo apt-get install -y libpng-dev libjpeg-dev p7zip-full p7zip-rar python3-pip squashfs-tools libfuse2 libxcb-cursor0 python -m pip install --upgrade pip setuptools wheel certifi pyinstaller --no-binary pyinstaller python -m pip install -r requirements.txt - name: build binary diff --git a/Dockerfile-base b/Dockerfile-base index 9f2f6d9..a8418b4 100644 --- a/Dockerfile-base +++ b/Dockerfile-base @@ -8,7 +8,7 @@ RUN echo "I'm building for $TARGETOS/$TARGETARCH/$TARGETVARIANT" COPY requirements.txt /opt/kcc/ ENV PATH="/opt/venv/bin:$PATH" RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && apt-get -yq upgrade && \ - apt-get install -y libpng-dev libjpeg-dev 7zip unrar-free libgl1 && \ + apt-get install -y libpng-dev libjpeg-dev p7zip-full unrar-free libgl1 && \ python -m pip install --upgrade pip && \ python -m venv /opt/venv && \ python -m pip install -r /opt/kcc/requirements.txt @@ -55,7 +55,7 @@ RUN set -x && \ KEPT_PACKAGES+=(locales-all) && \ KEPT_PACKAGES+=(libfreetype6) && \ KEPT_PACKAGES+=(libfontconfig1) && \ - KEPT_PACKAGES+=(7zip) && \ + KEPT_PACKAGES+=(p7zip-full) && \ KEPT_PACKAGES+=(python3) && \ KEPT_PACKAGES+=(python3-pip) && \ KEPT_PACKAGES+=(unrar-free) && \ @@ -113,7 +113,7 @@ RUN set -x && \ KEPT_PACKAGES+=(locales-all) && \ KEPT_PACKAGES+=(libfreetype6) && \ KEPT_PACKAGES+=(libfontconfig1) && \ - KEPT_PACKAGES+=(7zip) && \ + KEPT_PACKAGES+=(p7zip-full) && \ KEPT_PACKAGES+=(python3) && \ KEPT_PACKAGES+=(python3-pip) && \ KEPT_PACKAGES+=(unrar-free) && \ @@ -158,7 +158,7 @@ LABEL org.opencontainers.image.title="Kindle Comic Converter" ENV PATH="/opt/venv/bin:$PATH" WORKDIR /app RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && apt-get -yq upgrade && \ - apt-get install -y 7zip unrar-free && \ + apt-get install -y p7zip-full unrar-free && \ ln -s /app/kindlegen /bin/kindlegen && \ echo docker-base-20241116 > /IMAGE_VERSION diff --git a/README.md b/README.md index 85984eb..920bae2 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,7 @@ Please check [our wiki](https://github.com/ciromattia/kcc/wiki/) for more detail CLI version of **KCC** is intended for power users. It allows using options that might not be compatible and decrease the quality of output. CLI version has reduced dependencies, on Debian based distributions this commands should install all needed dependencies: ``` -sudo apt-get install python3 7zip python3-pil python3-psutil python3-slugify +sudo apt-get install python3 p7zip-full python3-pil python3-psutil python3-slugify ``` ### Profiles: diff --git a/kindlecomicconverter/comicarchive.py b/kindlecomicconverter/comicarchive.py index ee08658..3772079 100644 --- a/kindlecomicconverter/comicarchive.py +++ b/kindlecomicconverter/comicarchive.py @@ -28,7 +28,7 @@ from xml.parsers.expat import ExpatError from .shared import subprocess_run EXTRACTION_ERROR = 'Failed to extract archive. Try extracting file outside of KCC.' -SEVENZIP = '7z' if os.name == 'nt' else '7zz' +SEVENZIP = '7zz' if platform.system() == 'Darwin' else '7z' class ComicArchive: