Skip to content

Commit

Permalink
Add support for libjavascriptcoregtk-6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz committed Dec 24, 2024
1 parent 8b2f739 commit 998786a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
compiler: clang
cxx-compiler: clang++
cmake-args: -G Ninja -D PROXYRES_CODE_COVERAGE=ON
packages: llvm-14 libjavascriptcoregtk-4.0-dev libgconf2-dev
packages: llvm-14 libjavascriptcoregtk-4.1-dev libgconf2-dev
gcov-exec: llvm-cov-14 gcov
codecov: ubuntu

Expand All @@ -34,7 +34,7 @@ jobs:
compiler: clang
cxx-compiler: clang++
cmake-args: -G Ninja -D PROXYRES_CODE_COVERAGE=ON
packages: llvm-15 libjavascriptcoregtk-4.1-dev gsettings-desktop-schemas
packages: llvm-15 libjavascriptcoregtk-6.0-dev gsettings-desktop-schemas
gcov-exec: llvm-cov-15 gcov
codecov: ubuntu

Expand All @@ -43,7 +43,7 @@ jobs:
compiler: clang
cxx-compiler: clang++
cmake-args: -G Ninja -D PROXYRES_CODE_COVERAGE=ON -D PROXYRES_CURL=ON
packages: llvm-15 libjavascriptcoregtk-4.1-dev gsettings-desktop-schemas
packages: llvm-15 libjavascriptcoregtk-6.0-dev gsettings-desktop-schemas
gcov-exec: llvm-cov-15 gcov
codecov: ubuntu_curl

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ elseif(UNIX)
target_compile_definitions(proxyres PRIVATE HAVE_GCONF)
endif()

pkg_search_module(JSCoreGTK REQUIRED javascriptcoregtk-4.1 javascriptcoregtk-4.0 javascriptcoregtk-3.0 javascriptcoregtk-1.0)
pkg_search_module(JSCoreGTK REQUIRED javascriptcoregtk-6.0 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
target_include_directories(proxyres PRIVATE ${JSCoreGTK_INCLUDE_DIRS})

Expand Down
11 changes: 8 additions & 3 deletions execute_jscore.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
# include <link.h>
#endif

#include <JavaScriptCore/JavaScript.h>
#if __has_include(<JavaScriptCore/JavaScript.h>)
# include <JavaScriptCore/JavaScript.h>
#elif __has_include(<jsc/jsc.h>)
# include <jsc/jsc.h>
#endif

#include "execute.h"
#include "execute_i.h"
Expand Down Expand Up @@ -379,8 +383,9 @@ bool proxy_execute_jscore_global_init(void) {
g_proxy_execute_jscore.module = dlopen(
"/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/JavaScriptCore", RTLD_LAZY | RTLD_LOCAL);
#else
const char *library_names[] = {"libjavascriptcoregtk-4.1.so.0", "libjavascriptcoregtk-4.0.so.18",
"libjavascriptcoregtk-3.0.so.0", "libjavascriptcoregtk-1.0.so.0"};
const char *library_names[] = {"libjavascriptcoregtk-6.0.so.1", "libjavascriptcoregtk-4.1.so.0",
"libjavascriptcoregtk-4.0.so.18", "libjavascriptcoregtk-3.0.so.0",
"libjavascriptcoregtk-1.0.so.0"};
const size_t library_names_size = sizeof(library_names) / sizeof(library_names[0]);

// Use existing JavaScriptCoreGTK if already loaded
Expand Down

0 comments on commit 998786a

Please sign in to comment.