Added instructions to build with Alpine to the README.

This commit is contained in:
yuv420p10le 2024-08-13 22:54:22 +03:00
parent d9ec635fbd
commit c5ef9d2c63

View File

@ -81,17 +81,42 @@ Build using Visual Studio 2022, C++20. You need [Zydis](https://github.com/zyant
#### Linux
[linuxserver/docker-plex](https://github.com/linuxserver/docker-plex)'s image uses GLIBC 2.35, and Debian stable (bookworm, as of now) is at 2.36. Use a host with an older version to build (e.g. Debian Bullseye).
[linuxserver/docker-plex](https://github.com/linuxserver/docker-plex)'s image uses GLIBC 2.35, and Debian stable (bookworm, as of now) is at 2.36. Use a host with an older version to build (e.g. Debian Bullseye.. or an Alpine container with older glibc such as 2.26).
`git` `cmake` `make` and a C++ compiler (tested with clang++) required.
```
```bash
git clone https://gitgud.io/yuv420p10le/plexmediaserver_crack.git && \
cd plexmediaserver_crack/linux && \
cmake . && \
make
```
Alpine:
```Dockerfile
FROM alpine:3.18
RUN apk --no-cache add wget ca-certificates libstdc++
ARG APK_GLIBC_VERSION=2.26-r0
ARG APK_GLIBC_FILE="glibc-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BIN_FILE="glibc-bin-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${APK_GLIBC_VERSION}"
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget "${APK_GLIBC_BASE_URL}/${APK_GLIBC_FILE}" \
&& apk --force-overwrite --no-cache add "${APK_GLIBC_FILE}" \
&& wget "${APK_GLIBC_BASE_URL}/${APK_GLIBC_BIN_FILE}" \
&& apk --no-cache add "${APK_GLIBC_BIN_FILE}" \
&& rm glibc-*
RUN apk add --no-cache cmake make gcc g++ bash
WORKDIR /src
```
```bash
docker build -t glibc .
docker run --rm -v plexmediaserver_crack/linux:/src:rw glibc bash -c "mkdir -p build && cd build && cmake .. && make && chmod -R 777 /src/build"
# Binary will be in plexmediaserver_crack/linux/build/plexmediaserver_crack.so
```
`plexmediaserver_crack.so` should now appear in the same directory. Refer to the `scripts/crack_native.sh` or `scripts/crack_docker.sh` scripts to see how it's installed.
### Troubleshooting