-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pure Wayland Support Version of OpenJDK with Nvidia Jetson OpenJDK wi…
…th gsettings utility fix Signed-off-by: Emrah Billur <emrah.billur@unikie.com> wayland java support back to jdk20 version for compile issues
- Loading branch information
1 parent
770d204
commit b6d1895
Showing
8 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
imports = [ | ||
./debug-tools.nix | ||
./usb-serial.nix | ||
./java.nix | ||
./nix.nix | ||
./ssh.nix | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: let | ||
cfg = config.ghaf.development.java; | ||
in | ||
with lib; { | ||
options.ghaf.development.java = { | ||
enable = mkEnableOption "Java Support"; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
programs.java = { enable = true; package = pkgs.jdk20; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
diff --git a/src/java.desktop/unix/native/libawt_wlawt/WLToolkit.c b/src/java.desktop/unix/native/libawt_wlawt/WLToolkit.c | ||
index 2f46d1354c5..d912f524942 100644 | ||
--- a/src/java.desktop/unix/native/libawt_wlawt/WLToolkit.c | ||
+++ b/src/java.desktop/unix/native/libawt_wlawt/WLToolkit.c | ||
@@ -794,28 +794,29 @@ initCursors() { | ||
int theme_size = 0; | ||
char buffer[256]; | ||
|
||
- char *size_str = getenv("XCURSOR_SIZE"); | ||
- if (!size_str) | ||
- size_str = readDesktopProperty("cursor-size", buffer, sizeof(buffer)); | ||
- if (size_str) | ||
- theme_size = atoi(size_str); | ||
- if (theme_size <= 0) | ||
+ // char *size_str = getenv("XCURSOR_SIZE"); | ||
+ // if (!size_str) | ||
+ // size_str = readDesktopProperty("cursor-size", buffer, sizeof(buffer)); | ||
+ // if (size_str) | ||
+ // theme_size = atoi(size_str); | ||
+ // if (theme_size <= 0) | ||
theme_size = 24; | ||
|
||
- theme_name = getenv("XCURSOR_THEME"); | ||
- if (!theme_name) { | ||
- theme_name = readDesktopProperty("cursor-theme", buffer, sizeof(buffer)); | ||
- if (theme_name) { | ||
- // drop surrounding quotes and trailing line break | ||
- int len = strlen(theme_name); | ||
- if (len > 2) { | ||
- theme_name[len - 2] = 0; | ||
- theme_name++; | ||
- } else { | ||
- theme_name = NULL; | ||
- } | ||
- } | ||
- } | ||
+ // theme_name = getenv("XCURSOR_THEME"); | ||
+ // if (!theme_name) { | ||
+ // theme_name = readDesktopProperty("cursor-theme", buffer, sizeof(buffer)); | ||
+ // if (theme_name) { | ||
+ // // drop surrounding quotes and trailing line break | ||
+ // int len = strlen(theme_name); | ||
+ // if (len > 2) { | ||
+ // theme_name[len - 2] = 0; | ||
+ // theme_name++; | ||
+ // } else { | ||
+ // theme_name = NULL; | ||
+ // } | ||
+ // } | ||
+ // } | ||
+ theme_name="YARU"; | ||
|
||
wl_cursor_theme = wl_cursor_theme_load(theme_name, theme_size, wl_shm); | ||
if (!wl_cursor_theme) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# (final: prev: | ||
# { | ||
# openjdk = prev.openjdk.overrideAttrs (old: rec{ | ||
|
||
# #src = builtins.fetchTarball { | ||
# # url = https://github.com/openjdk/wakefield/archive/pure_wl_toolkit.tar.gz; | ||
# # sha256 = "sha256:06wjfwrkqykjdkis2s1nh91cy8vwincnmc699cxvyk3fc12jf3vw"; | ||
# #}; | ||
# src = prev.fetchFromGitHub { | ||
# owner = "openjdk"; | ||
# repo = "wakefield"; | ||
# rev = "pure_wl_toolkit"; | ||
# #hash = "sha256-TNaRRFqdVevD6tVIz2tBRmKuyNeRc+DXonnKG9adlto="; | ||
# hash=""; | ||
# }; | ||
# patches = prev.patches ++ [./GTK_fix.patch]; | ||
# # To fix the direct call for gsettings bug. But there is still problem since there is no GTK schemas installed | ||
# postConfigure = '' | ||
# substituteInPlace src/java.desktop/unix/native/libawt_wlawt/WLToolkit.c --replace 'gsettings' '${prev.glib}/bin/gsettings' | ||
# ''; | ||
# }); | ||
# } | ||
# ) | ||
|
||
# { | ||
# final, | ||
# prev, | ||
# }: | ||
# # OpenJDK Pure Wayland version | ||
# prev.jdk21.overrideAttrs (_prevAttrs: { | ||
# src = final.pkgs.fetchFromGitHub { | ||
# owner = "openjdk"; | ||
# repo = "wakefield"; | ||
# rev = "pure_wl_toolkit_21"; | ||
# sha256 = "sha256-xmAqj0BLUhLl51AtWshJ8actpk35Gog4PnYqRCa/4RM="; | ||
# }; | ||
# #imports = [../../../packages/libwakefield]; | ||
# #buildInputs = [ libwakefield]; | ||
# #patches = [./GTK_fix.patch]; | ||
# # To fix the direct call for gsettings bug. But there is still problem since there is no GTK schemas installed | ||
# #postConfigure = '' | ||
# # substituteInPlace src/java.desktop/unix/native/libawt_wlawt/WLToolkit.c --replace 'gsettings' '${prev.glib}/bin/gsettings' | ||
# # ''; | ||
# }) | ||
|
||
{ | ||
final, | ||
prev, | ||
}: | ||
# OpenJDK Pure Wayland version | ||
prev.jdk20.overrideAttrs (_prevAttrs: { | ||
src = final.pkgs.fetchFromGitHub { | ||
owner = "openjdk"; | ||
repo = "wakefield"; | ||
rev = "pure_wl_toolkit"; | ||
hash = "sha256-TNaRRFqdVevD6tVIz2tBRmKuyNeRc+DXonnKG9adlto="; | ||
}; | ||
# imports = [../../../packages/libwakefield]; | ||
#buildInputs = [ libwakefield]; | ||
#patches = [./GTK_fix.patch]; | ||
#To fix the direct call for gsettings bug. But there is still problem since there is no GTK schemas installed | ||
postConfigure = '' | ||
substituteInPlace src/java.desktop/unix/native/libawt_wlawt/WLToolkit.c --replace 'gsettings' '${prev.glib}/bin/gsettings' | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
libX11, | ||
libXtst, | ||
libXScrnSaver, | ||
#libwakefield, | ||
nss, | ||
nspr, | ||
alsa-lib, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
fetchFromGitHub, | ||
lib, | ||
cmake, | ||
pkg-config, | ||
stdenv, | ||
gcc, | ||
pixman, | ||
weston | ||
}: | ||
stdenv.mkDerivation rec{ | ||
name = "libwakefield"; | ||
|
||
depsBuildBuild = [cmake weston pixman]; | ||
|
||
src = "${fetchFromGitHub { | ||
owner = "openjdk"; | ||
repo = "wakefield"; | ||
rev = "pure_wl_toolkit_21"; | ||
sha256 = "sha256-xmAqj0BLUhLl51AtWshJ8actpk35Gog4PnYqRCa/4RM="; | ||
}}/src/java.desktop/share/native/libwakefield"; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
gcc | ||
pkg-config | ||
]; | ||
|
||
|
||
buildInputs = [ | ||
weston | ||
]; | ||
|
||
#cmakeFlags = lib.optionals (!stdenv.hostPlatform.isStatic) [ | ||
# "-DBUILD_SHARED_LIBS=ON" | ||
#]; | ||
|
||
configurePhase = '' | ||
mkdir build && cd build | ||
cmake ../ | ||
''; | ||
|
||
buildPhase = '' | ||
make | ||
''; | ||
|
||
installPhase = '' | ||
make install | ||
''; | ||
|
||
CFLAGS = [ "-O3" "-funroll-loops" ]; | ||
CXXFLAGS = [ "-O3" ]; | ||
|
||
outputs = [ "bin" "dev" "out" ]; | ||
|
||
|
||
meta = with lib; { | ||
description = "libwakefield"; | ||
platforms = [ | ||
"aarch64-linux" | ||
]; | ||
}; | ||
} |