Skip to content

Commit

Permalink
Fixed libgconf2 not available on Ubuntu 24.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz committed Dec 20, 2024
1 parent f2cd314 commit 08bf312
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ jobs:
steps:
- name: Install clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
CODENAME=$(lsb_release --short --codename)
sudo add-apt-repository "deb https://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${CLANG_VERSION} main"
major_version=$(lsb_release -rs | cut -d'.' -f1)
if [ "$major_version" -lt "24" ]; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
CODENAME=$(lsb_release --short --codename)
sudo add-apt-repository "deb https://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${CLANG_VERSION} main"
fi
sudo apt update
sudo apt install -y clang-format-${CLANG_VERSION}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y ninja-build libgconf2-dev
sudo apt install -y ninja-build
major_version=$(lsb_release -rs | cut -d'.' -f1)
if [ "$major_version" -le "22" ]; then
sudo apt install -y libgconf2-dev
fi
if [ "$major_version" -ge "24" ]; then
sudo apt install -y llvm-15 libjavascriptcoregtk-4.1-dev
else
Expand Down
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,14 @@ elseif(APPLE)
wpad_dhcp_mac.h)
endif()
elseif(UNIX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GConf gconf-2.0)
if (GConf_FOUND)
list(APPEND PROXYRES_SRCS config_gnome2.c config_gnome2.h)
endif()
list(APPEND PROXYRES_SRCS
config_env.c
config_env.h
config_gnome2.c
config_gnome2.h
config_gnome3.c
config_gnome3.h
config_kde.c
Expand Down Expand Up @@ -282,14 +285,13 @@ elseif(APPLE)

set_target_properties(proxyres PROPERTIES LINK_FLAGS -Wl,-F/Library/Frameworks)
elseif(UNIX)
find_package(PkgConfig REQUIRED)

pkg_check_modules(deps REQUIRED IMPORTED_TARGET glib-2.0)
target_link_libraries(proxyres PkgConfig::deps)

pkg_check_modules(GConf REQUIRED gconf-2.0)
# Don't link libraries at compile time since we dynamically load them at runtime
target_include_directories(proxyres PRIVATE ${GConf_INCLUDE_DIRS})
if (GConf_FOUND)
# Don't link libraries at compile time since we dynamically load them at runtime
target_include_directories(proxyres PRIVATE ${GConf_INCLUDE_DIRS})
endif()

pkg_search_module(JSCoreGTK REQUIRED javascriptcoregtk-4.1 javascriptcoregtk-4.0 javascriptcoregtk-3.0 javascriptcoregtk-1.0)
# Don't link libraries at compile time since we dynamically load them at runtime
Expand Down
1 change: 0 additions & 1 deletion config_gnome3.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <dlfcn.h>
#include <glib.h>
#include <gio/gio.h>
#include <gconf/gconf.h>

#include "config.h"
#include "config_i.h"
Expand Down

0 comments on commit 08bf312

Please sign in to comment.