Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows using rar other than in amd64 #64

Merged
merged 1 commit into from Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion Documentation/Build/Dockerfile
Expand Up @@ -79,9 +79,29 @@ RUN apt-get install -y libpng-dev
RUN apt-get install -y libzip-dev
RUN docker-php-ext-install gd zip
RUN apt-get install -y libreoffice-common default-jre libreoffice-java-common poppler-utils
RUN apt-get install -y clamav unoconv p7zip-full meshlab dia pandoc python3 zip unzip rar ffmpeg
RUN apt-get install -y clamav unoconv p7zip-full meshlab dia pandoc python3 zip unzip ffmpeg
RUN apt-get install -y xpdf mkisofs imagemagick meshlab tesseract-ocr tar

## arm64 rar install hack (rar CLI only available for x86/x64 from rar labs)

RUN DPKG_ARCH="$(dpkg --print-architecture)"; \
if [ "${DPKG_ARCH}" = "amd64" ]; then \
apt-get install -y rar \
else \
dpkg --add-architecture i386 && \
apt-get install qemu-user-static libc6-i386-cross libstdc++6-i386-cross wget -y && \
cp /usr/i686-linux-gnu/lib/libm.so.6 /lib && \
cp /usr/i686-linux-gnu/lib/libc.so.6 /lib && \
cp /usr/i686-linux-gnu/lib/libpthread.so.0 /lib && \
cp /usr/i686-linux-gnu/lib/ld-linux.so.2 /lib && \
cp /usr/i686-linux-gnu/lib/libstdc++.so.6 /lib && \
cp /usr/i686-linux-gnu/lib/libgcc_s.so.1 /lib && \
wget https://www.rarlab.com/rar/rarlinux-x32-700b3.tar.gz -O /tmp/rarlinux-x32-700b3.tar.gz && \
tar -zxvf /tmp/rarlinux-x32-700b3.tar.gz -C /tmp && \
cp HRConvert2/Documentation/Build/rar-arm64 /tmp/rar-arm64 && \
chmod +x /tmp/rar-arm64 && ln -s /tmp/rar-arm64 /usr/bin/rar; \
fi

# Copy required files.
RUN cp HRConvert2/Documentation/Build/php.ini /usr/local/etc/php.ini
RUN cp HRConvert2/index.html /var/www/html/index.html
Expand Down
3 changes: 3 additions & 0 deletions Documentation/Build/rar-arm64
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

qemu-i386-static /tmp/rar/rar $*