Skip to content

Commit

Permalink
Reduce number of dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut committed Jun 26, 2024
1 parent f6be6fe commit 0b5a322
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .github/static/DockerQt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ RUN bash -c "\
-D CMAKE_C_COMPILER=clang-18 \
-D CMAKE_INSTALL_PREFIX=\/usr \
-D QT_BUILD_SUBMODULES=\"qtbase;qt5compat;qtmultimedia;qtdeclarative\" \
-D QT_FEATURE_zstd=OFF \
-D QT_FEATURE_png=OFF \
-D QT_FEATURE_jpeg=OFF \
-D QT_FEATURE_ico=OFF \
-D QT_FEATURE_gif=OFF \
-D QT_FEATURE_harfbuzz=OFF \
-D QT_FEATURE_freetype=OFF \
-D BUILD_SHARED_LIBS=OFF \
-D INPUT_icu=no \
-D INPUT_pcre=system \
Expand Down
9 changes: 3 additions & 6 deletions .github/static/DockerUbuntu
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
ARG VERSION="20.04"
FROM yaraslaut/static_qt:$VERSION
#FROM yaraslaut/static_qt:$VERSION
FROM qt_static:$VERSION
ARG ARCH="x86_64"

RUN apt-get install -y git libutempter-dev make

RUN apt-get install -y xutils-dev pkg-config binutils gettext autoconf libtool

#meson
RUN apt-get install -y python3 python3-pip python3-setuptools python3-wheel ninja-build bison
RUN pip3 install meson #--break-system-package

WORKDIR /
COPY . /contour
RUN CC=clang CXX=clang++ sh /contour/scripts/install-static.sh
RUN LD_LIBRARY_PATH=/usr/local/lib CC=clang CXX=clang++ sh /contour/scripts/install-static.sh

WORKDIR /contour
RUN LD_LIBRARY_PATH=/usr/local/lib cmake -S . -B build -G Ninja \
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ option(CONTOUR_BUILD_STATIC "Link to static libraries [default: OFF]" OFF)
if(CONTOUR_BUILD_STATIC)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#set(CMAKE_LINK_SEARCH_START_STATIC ON)
set(CMAKE_LINK_SEARCH_END_STATIC ON)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
endif()

Expand Down
48 changes: 37 additions & 11 deletions scripts/install-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,26 @@ configure_install() {
saved_dir=$(pwd)
cd $1
shift 1
if [ -f "autogen.sh" ]; then
sh autogen.sh
fi
./configure $@
make -j
make install
cd $saved_dir
}

autogen_install() {
saved_dir=$(pwd)
cd $1
shift 1
if [ -f autogen.sh ]; then
./autogen.sh
fi
./configure $@
make -j
make install
cd $saved_dir
}


cmake_install(){
saved_dir=$(pwd)
cd $1
Expand All @@ -42,11 +52,24 @@ meson_install(){
cd $saved_dir
}

func_install_package(){
func_install=$1
url=$2
fetch $url
shift 2
$func_install $(basename $url .tar.gz) $@
}

configure_install_package() {
url=$1
shift 1
fetch $url
configure_install $(basename $url .tar.gz) $@
func_install_package configure_install $url $@ --enable-static --disable-shared
}

autogen_install_package() {
url=$1
shift 1
func_install_package autogen_install $url $@ --enable-static --disable-shared
}

cmake_install_package() {
Expand All @@ -64,13 +87,16 @@ meson_install_package() {
meson_install $(basename $url .tar.xz) $@
}


# install libpng
configure_install_package "http://ftp-osl.osuosl.org/pub/libpng/src/libpng16/libpng-1.6.34.tar.gz" --enable-maintainer-mode
# install libb2
configure_install_package "https://github.com/BLAKE2/libb2/releases/download/v0.98.1/libb2-0.98.1.tar.gz" --disable-dependency-tracking --enable-static --disable-shared
autogen_install_package "https://github.com/BLAKE2/libb2/releases/download/v0.98.1/libb2-0.98.1.tar.gz" --disable-dependency-tracking
# install pcre
autogen_install_package "https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz"
# install pcre2
configure_install_package "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.gz" --enable-pcre2-16 --enable-static --disable-shared
autogen_install_package "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.gz" --enable-pcre2-16
# install double-conversion
cmake_install_package "double-conversion-3.3.0" "https://github.com/google/double-conversion/archive/refs/tags/v3.3.0.tar.gz"
# install libgraphite2
cmake_install_package "graphite2-1.3.14" "https://github.com/silnrsi/graphite/releases/download/1.3.14/graphite2-1.3.14.tgz"
# install harfbuzz
cmake_install_package "harfbuzz-8.5.0" "https://github.com/harfbuzz/harfbuzz/releases/download/8.5.0/harfbuzz-8.5.0.tar.xz"
# install libX11
configure_install_package "https://www.x.org/releases/individual/lib/libX11-1.8.9.tar.gz"

0 comments on commit 0b5a322

Please sign in to comment.