Skip to content

Commit

Permalink
Merge pull request #56 from DeckerSU/static-dev
Browse files Browse the repository at this point in the history
Merge branch 'static-dev' into static
  • Loading branch information
DeckerSU authored Oct 29, 2023
2 parents fe3bcd8 + 330a359 commit 78e1db6
Show file tree
Hide file tree
Showing 62 changed files with 1,817 additions and 723 deletions.
37 changes: 37 additions & 0 deletions Dockerfile.focal.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:20.04
# Environment for build KomodoOcean

# Build container:
# docker build -f Dockerfile.focal.ci --build-arg BUILDER_NAME=$USER --build-arg BUILDER_UID=$(id -u) --build-arg BUILDER_GID=$(id -g) -t ocean_focal_builder .
# Run interactive session in build environment:
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root -it ocean_focal_builder
# Run build itself:
# delete ./built/x86_64-unknown-linux-gnu before build (!) other version of linux, then do:
# ./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)
#
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root ocean_focal_builder /bin/bash -c "./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)"

ARG DEBIAN_FRONTEND=noninteractive
ARG BUILDER_NAME=builder
ARG BUILDER_UID=1000
ARG BUILDER_GID=1000
ENV TZ=Europe/Amsterdam

RUN \
apt-get update && apt-get install --no-install-recommends -y apt-transport-https ca-certificates curl &&\
sed -i 's/archive\.ubuntu\.com/mirror\.nl\.leaseweb\.net/g' /etc/apt/sources.list &&\
sed -i 's/http:/https:/g' /etc/apt/sources.list &&\
apt-get update && apt-get install -y sudo &&\
groupadd --gid ${BUILDER_GID} --force ${BUILDER_NAME} &&\
adduser --disabled-password --gecos '' --no-create-home $BUILDER_NAME --uid ${BUILDER_UID} --gid ${BUILDER_GID} &&\
adduser $BUILDER_NAME sudo &&\
echo "$BUILDER_NAME ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/$BUILDER_NAME &&\
apt-get install --no-install-recommends -y build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python bison zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake &&\
apt-get install --no-install-recommends -y mingw-w64 &&\
echo 1 | update-alternatives --config x86_64-w64-mingw32-gcc &&\
echo 1 | update-alternatives --config x86_64-w64-mingw32-g++ &&\
apt-get install --no-install-recommends -y librsvg2-bin libtiff-tools cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools libtinfo5 xorriso &&\
chmod -R 777 /root
RUN \
apt-get clean && rm -rf /var/lib/apt/lists/*

33 changes: 33 additions & 0 deletions Dockerfile.xenial.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM ubuntu:16.04
# Environment for build KomodoOcean

# Build container:
# docker build -f Dockerfile.xenial.ci --build-arg BUILDER_NAME=$USER --build-arg BUILDER_UID=$(id -u) --build-arg BUILDER_GID=$(id -g) -t ocean_xenial_builder .
# Run interactive session in build environment:
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root -it ocean_xenial_builder
# Run build itself:
# delete ./built/x86_64-unknown-linux-gnu before build (!) other version of linux, then do:
# ./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)
#
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root ocean_xenial_builder /bin/bash -c "./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)"

ARG DEBIAN_FRONTEND=noninteractive
ARG BUILDER_NAME=builder
ARG BUILDER_UID=1000
ARG BUILDER_GID=1000
ENV TZ=Europe/Amsterdam

RUN \
apt-get update && apt-get install --no-install-recommends -y apt-transport-https ca-certificates curl &&\
sed -i 's/archive\.ubuntu\.com/mirror\.nl\.leaseweb\.net/g' /etc/apt/sources.list &&\
sed -i 's/http:/https:/g' /etc/apt/sources.list &&\
apt-get update && apt-get install -y sudo &&\
groupadd --gid ${BUILDER_GID} --force ${BUILDER_NAME} &&\
adduser --disabled-password --gecos '' --no-create-home $BUILDER_NAME --uid ${BUILDER_UID} --gid ${BUILDER_GID} &&\
adduser $BUILDER_NAME sudo &&\
echo "$BUILDER_NAME ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/$BUILDER_NAME &&\
apt-get install --no-install-recommends -y build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python bison zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake &&\
chmod -R 777 /root
RUN \
apt-get clean && rm -rf /var/lib/apt/lists/*

6 changes: 5 additions & 1 deletion README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,8 @@ make -C src/univalue clean
make -C src/cryptoconditions clean
rm src/qt/moc_*.cpp
```
after each different build.
after each different build.

### part 6

For some reason moving out `PKG_CONFIG_SYSROOT_DIR`, `PKG_CONFIG_LIBDIR`, `QT_MAC_SDK_NO_VERSION_CHECK` environment variables into $(package)_config_env as mentione here - https://github.com/bitcoin/bitcoin/commit/affbf58a1e52a8e60c830be6a9e0347e0ff4c28e doesn't work for Qt package build, so we define them in `$(package)_config_cmds` in `qt.mk`.
79 changes: 39 additions & 40 deletions build-aux/m4/bitcoin_qt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
dnl Helper for cases where a qt dependency is not met.
dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit.
AC_DEFUN([BITCOIN_QT_FAIL],[
if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then
if test "x$bitcoin_enable_qt" != xno; then
if test "$bitcoin_qt_want_version" = "auto" && test "$bitcoin_qt_force" != "yes"; then
if test "$bitcoin_enable_qt" != "no"; then
AC_MSG_WARN([$1; bitcoin-qt frontend will not be built])
fi
bitcoin_enable_qt=no
Expand All @@ -17,7 +17,7 @@ AC_DEFUN([BITCOIN_QT_FAIL],[
])

AC_DEFUN([BITCOIN_QT_CHECK],[
if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then
if test "$bitcoin_enable_qt" != "no" && test "$bitcoin_qt_want_version" != "no"; then
true
$1
else
Expand All @@ -35,12 +35,12 @@ dnl Inputs: $4: If "yes", don't fail if $2 is not found.
dnl Output: $1 is set to the path of $2 if found. $2 are searched in order.
AC_DEFUN([BITCOIN_QT_PATH_PROGS],[
BITCOIN_QT_CHECK([
if test "x$3" != x; then
if test "$3" != ""; then
AC_PATH_PROGS([$1], [$2], [], [$3])
else
AC_PATH_PROGS([$1], [$2])
fi
if test "x$$1" = x && test "x$4" != xyes; then
if test "$$1" = "" && test "$4" != "yes"; then
BITCOIN_QT_FAIL([$1 not found])
fi
])
Expand All @@ -57,20 +57,21 @@ AC_DEFUN([BITCOIN_QT_INIT],[
[build bitcoin-qt GUI (default=auto)])],
[
bitcoin_qt_want_version=$withval
if test "x$bitcoin_qt_want_version" = xyes; then
if test "$bitcoin_qt_want_version" = "yes"; then
bitcoin_qt_force=yes
bitcoin_qt_want_version=auto
fi
],
[bitcoin_qt_want_version=auto])
AS_IF([test "x$with_gui" = xqt5_debug],
AS_IF([test "$with_gui" = "qt5_debug"],
[AS_CASE([$host],
[*darwin*], [qt_lib_suffix=_debug],
[*mingw*], [qt_lib_suffix=d],
[qt_lib_suffix= ]); bitcoin_qt_want_version=qt5],
[qt_lib_suffix= ])
AS_CASE([$host], [*android*], [qt_lib_suffix=_$ANDROID_ARCH])
AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
Expand All @@ -86,7 +87,7 @@ AC_DEFUN([BITCOIN_QT_INIT],[
dnl Android doesn't support D-Bus and certainly doesn't use it for notifications
case $host in
*android*)
if test "x$use_dbus" != xyes; then
if test "$use_dbus" != "yes"; then
use_dbus=no
fi
;;
Expand Down Expand Up @@ -115,13 +116,13 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
BITCOIN_QT_CHECK([
TEMP_CPPFLAGS=$CPPFLAGS
TEMP_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
CXXFLAGS="$PIC_FLAGS $CORE_CXXFLAGS $CXXFLAGS"
_BITCOIN_QT_IS_STATIC
if test "x$bitcoin_cv_static_qt" = xyes; then
if test "$bitcoin_cv_static_qt" = "yes"; then
_BITCOIN_QT_CHECK_STATIC_LIBS
if test "x$qt_plugin_path" != x; then
if test "$qt_plugin_path" != ""; then
if test -d "$qt_plugin_path/platforms"; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
fi
Expand All @@ -137,50 +138,48 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
fi
AC_DEFINE([QT_STATICPLUGIN], [1], [Define this symbol if qt plugins are static])
if test "x$TARGET_OS" != xandroid; then
if test "$TARGET_OS" != "android"; then
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal])
AC_DEFINE([QT_QPA_PLATFORM_MINIMAL], [1], [Define this symbol if the minimal qt platform exists])
fi
if test "x$TARGET_OS" = xwindows; then
if test "$TARGET_OS" = "windows"; then
dnl Linking against wtsapi32 is required. See #17749 and
dnl https://bugreports.qt.io/browse/QTBUG-27097.
AX_CHECK_LINK_FLAG([-lwtsapi32], [QT_LIBS="$QT_LIBS -lwtsapi32"], [AC_MSG_ERROR([could not link against -lwtsapi32])])
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsIntegrationPlugin], [-lqwindows])
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsVistaStylePlugin], [-lqwindowsvistastyle])
AC_DEFINE([QT_QPA_PLATFORM_WINDOWS], [1], [Define this symbol if the qt platform is windows])
elif test "x$TARGET_OS" = xlinux; then
dnl workaround for https://bugreports.qt.io/browse/QTBUG-74874
AX_CHECK_LINK_FLAG([-lxcb-shm], [QT_LIBS="$QT_LIBS -lxcb-shm"], [AC_MSG_ERROR([could not link against -lxcb-shm])])
elif test "$TARGET_OS" = "linux"; then
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QXcbIntegrationPlugin], [-lqxcb])
AC_DEFINE([QT_QPA_PLATFORM_XCB], [1], [Define this symbol if the qt platform is xcb])
elif test "x$TARGET_OS" = xdarwin; then
elif test "$TARGET_OS" = "darwin"; then
AX_CHECK_LINK_FLAG([-framework Carbon], [QT_LIBS="$QT_LIBS -framework Carbon"], [AC_MSG_ERROR(could not link against Carbon framework)])
AX_CHECK_LINK_FLAG([-framework IOSurface], [QT_LIBS="$QT_LIBS -framework IOSurface"], [AC_MSG_ERROR(could not link against IOSurface framework)])
AX_CHECK_LINK_FLAG([-framework Metal], [QT_LIBS="$QT_LIBS -framework Metal"], [AC_MSG_ERROR(could not link against Metal framework)])
AX_CHECK_LINK_FLAG([-framework QuartzCore], [QT_LIBS="$QT_LIBS -framework QuartzCore"], [AC_MSG_ERROR(could not link against QuartzCore framework)])
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QCocoaIntegrationPlugin], [-lqcocoa])
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMacStylePlugin], [-lqmacstyle])
AC_DEFINE([QT_QPA_PLATFORM_COCOA], [1], [Define this symbol if the qt platform is cocoa])
elif test "x$TARGET_OS" = xandroid; then
QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lqtforandroid -ljnigraphics -landroid -lqtfreetype $QT_LIBS"
elif test "$TARGET_OS" = "android"; then
QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lplugins_platforms_qtforandroid${qt_lib_suffix} -ljnigraphics -landroid -lqtfreetype${qt_lib_suffix} $QT_LIBS"
AC_DEFINE([QT_QPA_PLATFORM_ANDROID], [1], [Define this symbol if the qt platform is android])
fi
fi
CPPFLAGS=$TEMP_CPPFLAGS
CXXFLAGS=$TEMP_CXXFLAGS
])
if test "x$qt_bin_path" = x; then
if test "$qt_bin_path" = ""; then
qt_bin_path="`$PKG_CONFIG --variable=host_bins ${qt_lib_prefix}Core 2>/dev/null`"
fi
if test "x$use_hardening" != xno; then
if test "$use_hardening" != "no"; then
BITCOIN_QT_CHECK([
AC_MSG_CHECKING([whether -fPIE can be used with this Qt config])
TEMP_CPPFLAGS=$CPPFLAGS
TEMP_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
CXXFLAGS="$PIE_FLAGS $CXXFLAGS"
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
CXXFLAGS="$PIE_FLAGS $CORE_CXXFLAGS $CXXFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
Expand All @@ -202,7 +201,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
BITCOIN_QT_CHECK([
AC_MSG_CHECKING([whether -fPIC is needed with this Qt config])
TEMP_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
Expand Down Expand Up @@ -249,26 +248,26 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
BITCOIN_QT_CHECK([
bitcoin_enable_qt=yes
bitcoin_enable_qt_test=yes
if test "x$have_qt_test" = xno; then
if test "$have_qt_test" = "no"; then
bitcoin_enable_qt_test=no
fi
bitcoin_enable_qt_dbus=no
if test "x$use_dbus" != xno && test "x$have_qt_dbus" = xyes; then
if test "$use_dbus" != "no" && test "$have_qt_dbus" = "yes"; then
bitcoin_enable_qt_dbus=yes
fi
if test "x$use_dbus" = xyes && test "x$have_qt_dbus" = xno; then
if test "$use_dbus" = "yes" && test "$have_qt_dbus" = "no"; then
AC_MSG_ERROR([libQtDBus not found. Install libQtDBus or remove --with-qtdbus.])
fi
if test "x$LUPDATE" = x; then
if test "$LUPDATE" = ""; then
AC_MSG_WARN([lupdate tool is required to update Qt translations.])
fi
if test "x$LCONVERT" = x; then
if test "$LCONVERT" = ""; then
AC_MSG_WARN([lconvert tool is required to update Qt translations.])
fi
],[
bitcoin_enable_qt=no
])
if test x$bitcoin_enable_qt = xyes; then
if test $bitcoin_enable_qt = "yes"; then
AC_MSG_RESULT([$bitcoin_enable_qt ($qt_lib_prefix)])
else
AC_MSG_RESULT([$bitcoin_enable_qt])
Expand All @@ -279,9 +278,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
AC_SUBST(QT_LIBS)
AC_SUBST(QT_LDFLAGS)
AC_SUBST(QT_DBUS_INCLUDES)
AC_SUBST(QT_DBUS_LIBS)
AC_SUBST(QT_TEST_INCLUDES)
AC_SUBST(QT_TEST_LIBS)
AC_SUBST(QT_SELECT, qt5)
AC_SUBST(MOC_DEFS)
])
Expand Down Expand Up @@ -349,18 +346,20 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_LIBS], [
PKG_CHECK_MODULES([QT_FB], [${qt_lib_prefix}FbSupport${qt_lib_suffix}], [QT_LIBS="$QT_FB_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_FONTDATABASE], [${qt_lib_prefix}FontDatabaseSupport${qt_lib_suffix}], [QT_LIBS="$QT_FONTDATABASE_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_THEME], [${qt_lib_prefix}ThemeSupport${qt_lib_suffix}], [QT_LIBS="$QT_THEME_LIBS $QT_LIBS"])
if test "x$TARGET_OS" = xlinux; then
if test "$TARGET_OS" = "linux"; then
PKG_CHECK_MODULES([QT_INPUT], [${qt_lib_prefix}InputSupport], [QT_LIBS="$QT_INPUT_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_XCBQPA], [${qt_lib_prefix}XcbQpa], [QT_LIBS="$QT_XCBQPA_LIBS $QT_LIBS"])
elif test "x$TARGET_OS" = xdarwin; then
PKG_CHECK_MODULES([QT_XKBCOMMON], [${qt_lib_prefix}XkbCommonSupport], [QT_LIBS="$QT_XKBCOMMON_LIBS $QT_LIBS"])
elif test "$TARGET_OS" = "darwin"; then
PKG_CHECK_MODULES([QT_CLIPBOARD], [${qt_lib_prefix}ClipboardSupport${qt_lib_suffix}], [QT_LIBS="$QT_CLIPBOARD_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_GRAPHICS], [${qt_lib_prefix}GraphicsSupport${qt_lib_suffix}], [QT_LIBS="$QT_GRAPHICS_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
elif test "x$TARGET_OS" = xwindows; then
elif test "$TARGET_OS" = "windows"; then
PKG_CHECK_MODULES([QT_WINDOWSUIAUTOMATION], [${qt_lib_prefix}WindowsUIAutomationSupport${qt_lib_suffix}], [QT_LIBS="$QT_WINDOWSUIAUTOMATION_LIBS $QT_LIBS"])
elif test "x$TARGET_OS" = xandroid; then
PKG_CHECK_MODULES([QT_EGL], [${qt_lib_prefix}EglSupport], [QT_LIBS="$QT_EGL_LIBS $QT_LIBS"])
elif test "$TARGET_OS" = "android"; then
PKG_CHECK_MODULES([QT_EGL], [${qt_lib_prefix}EglSupport${qt_lib_suffix}], [QT_LIBS="$QT_EGL_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
fi
])

Expand Down Expand Up @@ -391,7 +390,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
BITCOIN_QT_CHECK([
PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test${qt_lib_suffix} $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
if test "x$use_dbus" != xno; then
if test "$use_dbus" != "no"; then
PKG_CHECK_MODULES([QT_DBUS], [${qt_lib_prefix}DBus $qt_version], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
fi
])
Expand Down
Loading

0 comments on commit 78e1db6

Please sign in to comment.