Skip to content

Commit 0b20011

Browse files
committed
Fetch zsync2 using FetchContent
1 parent a406be3 commit 0b20011

File tree

7 files changed

+39
-12
lines changed

7 files changed

+39
-12
lines changed

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "lib/zsync2"]
2-
path = lib/zsync2
3-
url = https://github.com/AppImage/zsync2
41
[submodule "lib/fltk"]
52
path = lib/fltk
63
url = https://github.com/TheAssassin/fltk-1.3.4

CMakeLists.txt

+12-5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ option(ENABLE_SANITIZERS "Enable builds using sanitizers" off)
3636
# install into proper dirs on Linux
3737
include(GNUInstallDirs)
3838

39+
include(FetchContent)
40+
3941
option(USE_SYSTEM_ZSYNC2 OFF "Use existing libzsync2 installed on system (or inside CMAKE_PREFIX_PATH)")
4042
if(USE_SYSTEM_ZSYNC2)
4143
set(USE_SYSTEM_CPR ON)
@@ -46,6 +48,16 @@ if(USE_SYSTEM_ZSYNC2)
4648

4749
# note: find_package calls must be made in the same or a parent scope
4850
find_package(zsync2 REQUIRED)
51+
else()
52+
function(import_zsync2)
53+
FetchContent_Declare(zsync2
54+
GIT_REPOSITORY https://github.com/AppImageCommunity/zsync2
55+
GIT_TAG 2.0.0-alpha-1-20230304
56+
)
57+
FetchContent_MakeAvailable(zsync2)
58+
endfunction()
59+
60+
import_zsync2()
4961
endif()
5062

5163
option(USE_SYSTEM_LIBAPPIMAGE OFF "Use existing libappimage installed on system (or inside CMAKE_PREFIX_PATH)")
@@ -54,8 +66,6 @@ if(USE_SYSTEM_LIBAPPIMAGE)
5466
find_package(libappimage REQUIRED)
5567
else()
5668
function(import_libappimage)
57-
include(FetchContent)
58-
5969
FetchContent_Declare(libappimage
6070
GIT_REPOSITORY https://github.com/AppImageCommunity/libappimage
6171
GIT_TAG 3467b20
@@ -77,9 +87,6 @@ if(NOT BUILD_LIBAPPIMAGEUPDATE_ONLY)
7787
endif()
7888
endif()
7989

80-
# include external libraries
81-
add_subdirectory(lib)
82-
8390
# core source directory, contains its own CMakeLists.txt
8491
add_subdirectory(src)
8592

ci/Dockerfile.i386

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ RUN apt-get update && \
1616
libglib2.0-dev libcairo2-dev librsvg2-dev libfuse-dev git libcurl4-openssl-dev argagg-dev libgcrypt20-dev libboost-dev && \
1717
wget -qO- https://artifacts.assassinate-you.net/prebuilt-cmake/cmake-v3.24.0-ubuntu_"$DIST"-"$ARCH".tar.gz | tar xzv -C/usr --strip-components=1
1818

19+
COPY ./install-gtest.sh /
20+
RUN bash /install-gtest.sh
21+
1922
COPY pkgconfig/*.pc /usr/lib/i386-linux-gnu/pkgconfig/
2023
RUN sed -i 's|x86_64|i386|g' /usr/lib/i386-linux-gnu/pkgconfig/*.pc
2124

ci/Dockerfile.x86_64

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ RUN apt-get update && \
1616
libglib2.0-dev libcairo2-dev librsvg2-dev libfuse-dev git libcurl4-openssl-dev argagg-dev libgcrypt20-dev libboost-dev && \
1717
wget -qO- https://artifacts.assassinate-you.net/prebuilt-cmake/cmake-v3.24.0-ubuntu_"$DIST"-"$ARCH".tar.gz | tar xzv -C/usr --strip-components=1
1818

19+
COPY ./install-gtest.sh /
20+
RUN bash /install-gtest.sh
21+
1922
COPY pkgconfig/*.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
2023

2124
COPY entrypoint.sh /

ci/install-gtest.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#! /bin/bash
2+
3+
set -euxo pipefail
4+
5+
tempdir="$(mktemp -d)"
6+
7+
_cleanup() {
8+
[[ -d "$tempdir" ]] && rm -r "$tempdir"
9+
}
10+
trap _cleanup EXIT
11+
12+
cd "$tempdir"
13+
14+
git clone https://github.com/google/googletest -b v1.13.0 .
15+
16+
mkdir build
17+
cd build
18+
19+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
20+
make -j6
21+
make install

lib/CMakeLists.txt

-3
This file was deleted.

lib/zsync2

-1
This file was deleted.

0 commit comments

Comments
 (0)