From c5ef9d2c63654ae7409402693a735927f4ea0c78 Mon Sep 17 00:00:00 2001 From: yuv420p10le <139547685+yuv420p10le@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:54:22 +0300 Subject: [PATCH] Added instructions to build with Alpine to the README. --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 940a1f9..8decb25 100644 --- a/README.md +++ b/README.md @@ -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