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

Add build on ubuntu 24.04 support #2152

Merged
merged 1 commit into from
Sep 15, 2024
Merged
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
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