Skip to content

Commit

Permalink
Update squashfuse and add support for Zstd
Browse files Browse the repository at this point in the history
This update allows us to remove all the patches and makes the configuration step a lot easier, too.
  • Loading branch information
TheAssassin committed Nov 24, 2024
1 parent 525bd25 commit 4acb54c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 994 deletions.
23 changes: 8 additions & 15 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ set(LDFLAGS ${DEPENDENCIES_LDFLAGS})
if (NOT LIBAPPIMAGE_SHARED_ONLY)
import_pkgconfig_target(TARGET_NAME liblzma PKGCONFIG_TARGET liblzma)

import_pkgconfig_target(TARGET_NAME libzstd PKGCONFIG_TARGET libzstd)


# as distros don't provide suitable squashfuse and squashfs-tools, those dependencies are bundled in, can, and should
# be used from this repository for AppImageKit
# for distro packaging, it can be linked to an existing package just fine
Expand All @@ -48,27 +51,16 @@ if (NOT LIBAPPIMAGE_SHARED_ONLY)
import_pkgconfig_target(TARGET_NAME libfuse PKGCONFIG_TARGET fuse)

# TODO: implement out-of-source builds for squashfuse, as for the other dependencies
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/patches/patch-squashfuse.sh.in
${CMAKE_CURRENT_BINARY_DIR}/patch-squashfuse.sh
@ONLY
)

ExternalProject_Add(
squashfuse-EXTERNAL
GIT_REPOSITORY https://github.com/vasi/squashfuse/
GIT_TAG 1f98030
# release 0.5.2
GIT_TAG 775b4cc72ab47641637897f11ce0da15d5c1f115
UPDATE_COMMAND "" # make sure CMake won't try to fetch updates unnecessarily and hence rebuild the dependency every time
PATCH_COMMAND bash -xe ${CMAKE_CURRENT_BINARY_DIR}/patch-squashfuse.sh
CONFIGURE_COMMAND ${LIBTOOLIZE} --force
COMMAND env ACLOCAL_FLAGS="-I /usr/share/aclocal" aclocal
COMMAND ${AUTOHEADER}
COMMAND ${AUTOMAKE} --force-missing --add-missing
COMMAND ${AUTORECONF} -fi || true
COMMAND ${SED} -i "/PKG_CHECK_MODULES.*/,/,:./d" configure # https://github.com/vasi/squashfuse/issues/12
CONFIGURE_COMMAND <SOURCE_DIR>/autogen.sh
COMMAND ${SED} -i "s/typedef off_t sqfs_off_t/typedef int64_t sqfs_off_t/g" common.h # off_t's size might differ, see https://stackoverflow.com/a/9073762
COMMAND CC=${CC} CXX=${CXX} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} <SOURCE_DIR>/configure --disable-demo --disable-high-level --without-lzo --without-lz4 --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib --with-xz=${xz_PREFIX} ${EXTRA_CONFIGURE_FLAGS}
COMMAND ${SED} -i "s|XZ_LIBS = -llzma |XZ_LIBS = -Bstatic ${xz_LIBRARIES}/|g" Makefile
COMMAND CC=${CC} CXX=${CXX} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} <SOURCE_DIR>/configure --disable-demo --disable-high-level --without-lzo --without-lz4 --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib ${EXTRA_CONFIGURE_FLAGS}
BUILD_COMMAND ${MAKE}
BUILD_IN_SOURCE ON
INSTALL_COMMAND ${MAKE} install
Expand All @@ -85,6 +77,7 @@ if (NOT LIBAPPIMAGE_SHARED_ONLY)
target_link_libraries(
libsquashfuse
INTERFACE liblzma
INTERFACE libzstd
INTERFACE libzlib
)
else()
Expand Down
8 changes: 0 additions & 8 deletions src/patches/patch-squashfuse.sh.in

This file was deleted.

57 changes: 0 additions & 57 deletions src/patches/squashfuse.patch

This file was deleted.

12 changes: 0 additions & 12 deletions src/patches/squashfuse_dlopen.c

This file was deleted.

262 changes: 0 additions & 262 deletions src/patches/squashfuse_dlopen.h

This file was deleted.

Loading

0 comments on commit 4acb54c

Please sign in to comment.