-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Replace libappimage submodule with FetchContent #1190
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "cmake/sanitizers-cmake"] | ||
path = cmake/sanitizers-cmake | ||
url = https://github.com/arsenm/sanitizers-cmake | ||
[submodule "lib/libappimage"] | ||
path = lib/libappimage | ||
url = https://github.com/AppImage/libappimage.git |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
# >= 3.2 required for ExternalProject_Add_StepDependencies | ||
cmake_minimum_required(VERSION 3.2) | ||
|
||
|
||
include(${PROJECT_SOURCE_DIR}/lib/libappimage/cmake/scripts.cmake) | ||
# FetchContent_MakeAvailable() is only available in CMake 3.14 or newer | ||
cmake_minimum_required(VERSION 3.14) | ||
|
||
include(FetchContent) | ||
|
||
# Need this patch until https://github.com/AppImage/libappimage/pull/160 is resolved | ||
FetchContent_Declare(libappimage_patch | ||
URL https://github.com/AppImage/libappimage/commit/ce0a186a5a3cd8f31f4afd216d5322410a0a8e26.patch | ||
DOWNLOAD_NO_EXTRACT TRUE | ||
) | ||
FetchContent_MakeAvailable(libappimage_patch) | ||
TheAssassin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
FetchContent_Declare(libappimage | ||
# We can not use a URL source with a github-generated source archive: libappimage's gtest submodule would be missing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eventually we may just want to use gtest from the system (generally provided externally), these submodules are more than annoying anyway. |
||
# If you update the GIT_TAG and the patch does not apply anymore you need to rebase libappimage_patch (see above) | ||
GIT_REPOSITORY https://github.com/AppImage/libappimage | ||
GIT_TAG aa7d9fb03d3d64415c37120f20faa05412458e94 # Eventually we may want to use master, once that works reliably. | ||
PATCH_COMMAND patch -p 1 --forward < ${libappimage_patch_SOURCE_DIR}/ce0a186a5a3cd8f31f4afd216d5322410a0a8e26.patch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. POSIX compliance is not really relevant for this repository, we use glibc by default. I also think this is no longer necessary, we can just use |
||
) | ||
FetchContent_MakeAvailable(libappimage) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${libappimage_SOURCE_DIR}/cmake) | ||
include(${libappimage_SOURCE_DIR}/cmake/scripts.cmake) | ||
include(${libappimage_SOURCE_DIR}/cmake/tools.cmake) | ||
|
||
|
||
# the names of the targets need to differ from the library filenames | ||
|
@@ -53,9 +71,10 @@ if(NOT USE_SYSTEM_MKSQUASHFS) | |
|
||
ExternalProject_Add(mksquashfs | ||
GIT_REPOSITORY https://github.com/plougher/squashfs-tools/ | ||
GIT_TAG 4.4 | ||
GIT_TAG 4.5.1 | ||
TheAssassin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
UPDATE_COMMAND "" # Make sure CMake won't try to fetch updates unnecessarily and hence rebuild the dependency every time | ||
CONFIGURE_COMMAND ${SED} -i "s|CFLAGS += -DXZ_SUPPORT|CFLAGS += ${mksquashfs_cflags}|g" <SOURCE_DIR>/squashfs-tools/Makefile | ||
COMMAND ${SED} -i "/INSTALL_MANPAGES_DIR/d" <SOURCE_DIR>/squashfs-tools/Makefile | ||
TheAssassin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
COMMAND ${SED} -i "s|LIBS += -llzma|LIBS += -Bstatic ${mksquashfs_ldflags}|g" <SOURCE_DIR>/squashfs-tools/Makefile | ||
COMMAND ${SED} -i "s|install: mksquashfs unsquashfs|install: mksquashfs|g" squashfs-tools/Makefile | ||
COMMAND ${SED} -i "/cp unsquashfs/d" squashfs-tools/Makefile | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,8 +45,6 @@ | |
#include <sys/stat.h> | ||
#include <sys/wait.h> | ||
|
||
#include "binreloc.h" | ||
|
||
#include <libgen.h> | ||
|
||
#include <unistd.h> | ||
|
@@ -56,7 +54,9 @@ | |
#include <gpgme.h> | ||
#include <assert.h> | ||
|
||
#include "appimage/appimage.h" | ||
#include <appimage/appimage_shared.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Depending on appimage.h would introduce a dependency on the generated config.h. However it seems that including appimage_shared.h is enough to fix the build and make the tests pass. Same for validate.c. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. |
||
|
||
#include "binreloc.h" | ||
#include "appimagetool_sign.h" | ||
|
||
#ifdef __linux__ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can use an older version of libappimage for now?