-
-
Notifications
You must be signed in to change notification settings - Fork 565
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 2 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/b3398bb496e47947864b4b8bc2999c8427f86a9a.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. |
||
GIT_REPOSITORY https://github.com/AppImage/libappimage | ||
GIT_TAG aa7d9fb03d3d64415c37120f20faa05412458e94 # latest as of 2022-08-18 | ||
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 want to use |
||
# The patch command has || true to prevent the build from failing if the patch has already been applied | ||
PATCH_COMMAND patch -p 1 < ${libappimage_patch_SOURCE_DIR}/b3398bb496e47947864b4b8bc2999c8427f86a9a.patch || true | ||
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. This will let unrelated errors slip. How about the 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. Good point! I added --forward and it immediately failed ;P I guess that patch file doesn't actually apply cleanly to latest. It also doesn't work with the currently pinned version on master. It does work with https://github.com/AppImage/libappimage/commits/1d4d57622de2c7d39f7cc6c4980144c713cc59ca, which was the latest at the time of writing. I'm guessing that PR the patch is coming from needs to be rebased. |
||
) | ||
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?