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

Set non-native march for compiling #5

Merged
merged 2 commits into from
Mar 4, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as alpine-buildstage
# set version label
ARG UNRAR_VERSION=7.0.7

COPY data.rar /data.rar

RUN \
echo "**** install build dependencies ****" && \
apk add --no-cache --virtual=build-dependencies \
Expand All @@ -19,8 +21,12 @@ RUN \
/tmp/unrar --strip-components=1 && \
cd /tmp/unrar && \
sed -i 's|LDFLAGS=-pthread|LDFLAGS=-pthread -static|' makefile && \
sed -i 's|CXXFLAGS=-march=native|CXXFLAGS=-march=x86-64-v2|' makefile && \
make && \
install -v -m755 unrar /usr/bin && \
echo "**** test binary ****" && \
/usr/bin/unrar v /data.rar && \
/usr/bin/unrar t /data.rar && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
Expand All @@ -34,6 +40,8 @@ FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy as ubuntu-buildstage
# set version label
ARG UNRAR_VERSION=7.0.7

COPY data.rar /data.rar

RUN \
echo "**** install build dependencies ****" && \
apt-get update && \
Expand All @@ -50,8 +58,12 @@ RUN \
/tmp/unrar --strip-components=1 && \
cd /tmp/unrar && \
sed -i 's|LDFLAGS=-pthread|LDFLAGS=-pthread -static|' makefile && \
sed -i 's|CXXFLAGS=-march=native|CXXFLAGS=-march=x86-64-v2|' makefile && \
make && \
install -v -m755 unrar /usr/bin && \
echo "**** test binary ****" && \
/usr/bin/unrar v /data.rar && \
/usr/bin/unrar t /data.rar && \
echo "**** cleanup ****" && \
apt-get remove -y \
g++ \
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.19 as alpine-buildstage
# set version label
ARG UNRAR_VERSION=7.0.7

COPY data.rar /data.rar

RUN \
echo "**** install build dependencies ****" && \
apk add --no-cache --virtual=build-dependencies \
Expand All @@ -20,8 +22,12 @@ RUN \
/tmp/unrar --strip-components=1 && \
cd /tmp/unrar && \
sed -i 's|LDFLAGS=-pthread|LDFLAGS=-pthread -static|' makefile && \
sed -i 's|CXXFLAGS=-march=native|CXXFLAGS=-march=armv8-a|' makefile && \
make && \
install -v -m755 unrar /usr/bin && \
echo "**** test binary ****" && \
/usr/bin/unrar v /data.rar && \
/usr/bin/unrar t /data.rar && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
Expand All @@ -35,6 +41,8 @@ FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy as ubuntu-buildstage
# set version label
ARG UNRAR_VERSION=7.0.7

COPY data.rar /data.rar

RUN \
echo "**** install build dependencies ****" && \
apt-get update && \
Expand All @@ -51,8 +59,12 @@ RUN \
/tmp/unrar --strip-components=1 && \
cd /tmp/unrar && \
sed -i 's|LDFLAGS=-pthread|LDFLAGS=-pthread -static|' makefile && \
sed -i 's|CXXFLAGS=-march=native|CXXFLAGS=-march=armv8-a|' makefile && \
make && \
install -v -m755 unrar /usr/bin && \
echo "**** test binary ****" && \
/usr/bin/unrar v /data.rar && \
/usr/bin/unrar t /data.rar && \
echo "**** cleanup ****" && \
apt-get remove -y \
build-essential && \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ Find us at:
This image only contains the compiled unrar binaries for Alpine and Ubuntu, and is meant to be ingested by other images during build time. It is not for public consumption.

The currently included binaries are as follows:

* /usr/bin/unrar-alpine
* /usr/bin/unrar-ubuntu

## Versions

* **04.03.24:** - Build against generic CPUs to better support old processors.
* **29.02.24:** - Bump to 7.0.7.
* **07.01.24:** - Bump to 6.2.12.
* **11.08.23:** - Initial release.
Binary file added data.rar
Binary file not shown.