Skip to content

Commit

Permalink
Add build on ubuntu 24.04 support (axmolengine#2152)
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 authored and xfbird committed Sep 18, 2024
1 parent d630ad6 commit 76d5836
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
11 changes: 9 additions & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,17 @@ if(LINUX)
target_include_directories(${_AX_CORE_LIB} PUBLIC "${X11_X11_INCLUDE_PATH}")
# X11 gets linked by cmake/Modules/AXLinkHelpers.cmake

# including GTK3.0 and WebKit2Gtk4.0
# including GTK3.0 and WebKit2Gtk4.x
find_package(PkgConfig REQUIRED)
pkg_check_modules(GKT3 REQUIRED gtk+-3.0)
pkg_check_modules(WEBKIT2GTK webkit2gtk-4.0)

set(_webkit2gtk_vers "4.1;4.0")
foreach(_ver ${_webkit2gtk_vers})
pkg_check_modules(WEBKIT2GTK webkit2gtk-${_ver})
if (WEBKIT2GTK_LIBRARY_DIRS)
break()
endif()
endforeach()

target_include_directories(${_AX_CORE_LIB} PUBLIC ${GTK3_INCLUDE_DIRS} ${WEBKIT2GTK_INCLUDE_DIRS})
target_link_directories(${_AX_CORE_LIB} PRIVATE ${GTK3_LIBRARY_DIRS} ${WEBKIT2GTK_LIBRARY_DIRS})
Expand Down
14 changes: 12 additions & 2 deletions setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,16 @@ if ($IsLinux) {
if ($answer -like 'y*') {
if ($LinuxDistro -eq 'Debian') {
println "It will take few minutes"
$os_name = $PSVersionTable.OS
$os_ver = [Regex]::Match($os_name, '(\d+\.)+(\*|\d+)(\-[a-z0-9]+)?').Value
if (($os_name -match 'Ubuntu' -and [VersionEx]$os_ver -ge [VersionEx]'24.04') -or
($os_name -match 'Debian' -and [VersionEx]$os_ver -ge [VersionEx]'13')) {
$webkit2gtk_dev = 'libwebkit2gtk-4.1-dev'
}
else {
$webkit2gtk_dev = 'libwebkit2gtk-4.0-dev'
}
sudo apt update
# for vm, libxxf86vm-dev also required
Expand All @@ -298,7 +308,7 @@ if ($IsLinux) {
$DEPENDS += 'libxi-dev'
$DEPENDS += 'libfontconfig1-dev'
$DEPENDS += 'libgtk-3-dev'
$DEPENDS += 'libwebkit2gtk-4.0-dev'
$DEPENDS += $webkit2gtk_dev
$DEPENDS += 'binutils'
$DEPENDS += 'g++'
$DEPENDS += 'libasound2-dev'
Expand All @@ -307,7 +317,7 @@ if ($IsLinux) {
# if vlc encouter codec error, install
# sudo apt install ubuntu-restricted-extras
println "Install packages: $DEPENDS ..."
sudo apt install --allow-unauthenticated --yes $DEPENDS > /dev/null
}
elseif ($LinuxDistro -eq 'Arch') {
Expand Down

0 comments on commit 76d5836

Please sign in to comment.