Skip to content
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

SKETCH-2182: Fixing Ubuntu builds #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions .github/workflows/sketcher-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,46 @@ jobs:
library: rdkit
version: ${{ fromJson(env.VERSIONS_JSON).rdkit }}

- name: Install Qt's required packages
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build-output != 'wasm'}}
run: |
sudo apt-get install \
libfontconfig1-dev \
libfreetype-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-cursor-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-sync-dev \
libxcb-util-dev \
libxcb-xfixes0-dev \
libxcb-xinerama0-dev \
libxcb-xkb-dev \
libxcb1-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxrender-dev

- name: Fetch Qt
if: matrix.os == 'macos-latest'
if: matrix.build-output != 'wasm' && matrix.os != 'windows-latest'
id: fetch-qt
uses: ./.github/actions/build-external
with:
library: qt
version: ${{ fromJson(env.VERSIONS_JSON).qt }}

- name: Configure CMake
if: matrix.os == 'macos-latest'
if: matrix.build-output != 'wasm' && matrix.os != 'windows-latest'
env:
CMAKE_PREFIX_PATH: "${{ steps.fetch-fmt.outputs.path }};\
${{ steps.fetch-zlib.outputs.path }};\
Expand All @@ -123,16 +153,20 @@ jobs:
-DCMAKE_PREFIX_PATH="${{ env.CMAKE_PREFIX_PATH }}"

- name: Build
if: matrix.os == 'macos-latest'
if: matrix.build-output != 'wasm' && matrix.os != 'windows-latest'
run: cmake --build build --config ${{ env.BUILD_TYPE }}

- name: Test
if: matrix.os == 'macos-latest'
if: matrix.build-output != 'wasm' && matrix.os != 'windows-latest'
working-directory: build
run: ctest --build-config ${{ env.BUILD_TYPE }} --output-on-failure
# the first line of the command launches xvfb-run -a, but only for
# Ubuntu non-wasm builds
run: |
${{ matrix.os == 'ubuntu-latest' && matrix.build-output != 'wasm' && 'xvfb-run -a' || ''}} \
ctest --build-config ${{ env.BUILD_TYPE }} --output-on-failure

- name: Download sketcher executable
if: matrix.os == 'macos-latest'
if: matrix.build-output != 'wasm' && matrix.os != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: sketcher_${{ matrix.os}}_${{ matrix.build-output }}
Expand Down
19 changes: 17 additions & 2 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ function(set_cmake_arg VAR_NAME)
PARENT_SCOPE)
endfunction()

if(LINUX)
set(EXTRA_QT_CMAKE_ARGS
-DFEATURE_xlib=ON
-DFEATURE_xcb=ON
-DFEATURE_xcb_xlib=ON
-DFEATURE_xkbcommon=ON
)
else()
set(EXTRA_QT_CMAKE_ARGS "")
endif()

ExternalProject_Add(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
Expand Down Expand Up @@ -89,7 +100,8 @@ ExternalProject_Add(
-DBUILD_SHARED_LIBS=OFF
-DBOOST_INCLUDE_LIBRARIES=${BOOST_INCLUDE_LIBS}
-DBOOST_RUNTIME_LINK=static
-DBOOST_IOSTREAMS_ENABLE_BZIP2=OFF)
-DBOOST_IOSTREAMS_ENABLE_BZIP2=OFF
-DBOOST_IOSTREAMS_ENABLE_LZMA=OFF)

string(REPLACE "." "_" RDKIT_GIT_TAG ${RDKIT_VERSION})
set_cmake_arg(
Expand Down Expand Up @@ -133,10 +145,13 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/qt-${QT_VERSION}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_BINARY_DIR}/zlib-${ZLIB_VERSION}
-DCMAKE_POLICY_DEFAULT_CMP0177:STRING=NEW
-DCMAKE_POLICY_DEFAULT_CMP0174:STRING=NEW
-DBUILD_SHARED_LIBS=OFF
-DQT_BUILD_EXAMPLES=OFF
-DQT_BUILD_SUBMODULES=${QT_SUBMODULES}
-DQT_BUILD_TESTS=OFF
-DQT_FEATURE_brotli=OFF
-DQT_FEATURE_sql=OFF
-DINPUT_opengl=no)
-DINPUT_opengl=no
${EXTRA_QT_CMAKE_ARGS})
2 changes: 1 addition & 1 deletion external/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"boost": "1.83.0",
"emscripten": "3.1.51",
"fmt": "10.1.0",
"qt": "6.5.3",
"qt": "6.7.3",
"rdkit": "2024.09.3",
"sqlite": "3.42.0",
"zlib": "1.2.11",
Expand Down