Skip to content

Commit

Permalink
fix libarchive using external zstd
Browse files Browse the repository at this point in the history
  • Loading branch information
whrvt committed Oct 31, 2024
1 parent 3943e62 commit 618225f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/umu-static-bundler/third_party/cache
/umu-static-bundler/third_party
/umu-static-bundler/work
/umu-static-bundler/build
/garbage
Expand Down
2 changes: 1 addition & 1 deletion umu-static-bundler/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ build_docker_image() {
fi

_message "Building Docker image..."
docker build -t "${docker_image}" -f "${u_scriptdir}/lib/Dockerfile" "${docker_context}" || {
docker build --progress=plain -t "${docker_image}" -f "${u_scriptdir}/lib/Dockerfile" "${docker_context}" || {
local ret=$?
_error "Docker build failed"
rm -rf "${docker_context}"
Expand Down
8 changes: 5 additions & 3 deletions umu-static-bundler/lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ RUN CC=clang \
install -Dm644 libzstd.pc /usr/local/lib/pkgconfig/libzstd.pc && \
cd .. && \
install -Dm644 lib/libzstd.a /usr/local/lib/libzstd.a && \
find lib -name "zstd*.h" -exec install -Dm644 {} /usr/local/include/{} \; && \
install -Dm644 lib/zstd.h /usr/local/include/zstd.h && \
install -Dm644 lib/zdict.h /usr/local/include/zdict.h && \
install -Dm644 lib/zstd_errors.h /usr/local/include/zstd_errors.h && \
install -Dm755 programs/zstd /usr/local/bin/zstd && \
ln -sf /usr/local/bin/zstd /usr/local/bin/zstdmt && \
ln -sf /usr/local/bin/zstd /usr/local/bin/unzstd
Expand All @@ -44,7 +46,7 @@ WORKDIR /build/libarchive
COPY libarchive .
RUN CPPFLAGS="-I/usr/local/include" \
CFLAGS="-static -Oz -fPIC -ffunction-sections -fdata-sections" \
LDFLAGS="-static -Wl,--gc-sections,--strip-all -L/usr/local/lib" \
LDFLAGS="-static -Wl,--gc-sections,--strip-all -L/usr/local/lib -l:libzstd.a" \
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" \
autoreconf -fi && \
./configure \
Expand Down Expand Up @@ -121,4 +123,4 @@ COPY lib/messaging.sh /build/lib/
COPY umu-build.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/umu-build.sh

ENTRYPOINT ["/usr/local/bin/umu-build.sh"]
ENTRYPOINT ["/usr/local/bin/umu-build.sh"]
2 changes: 2 additions & 0 deletions umu-static-bundler/lib/umu-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ if ! clang -static \
-o "${WORK_DIR}/umu-run" "${WRAPPER_SRC}" \
-I/usr/local/include \
-L/usr/local/lib \
-Wl,--whole-archive \
-l:libarchive.a \
-Wl,--no-whole-archive \
-l:libzstd.a \
-pthread; then
_error "Failed to compile wrapper"
Expand Down

0 comments on commit 618225f

Please sign in to comment.