Skip to content

Commit

Permalink
Fix build issues on ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
jwharm committed Jul 16, 2023
1 parent 6179b03 commit d6b6184
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test {
useJUnitPlatform()
jvmArgs += "--enable-preview"
jvmArgs += "--enable-native-access=ALL-UNNAMED"
systemProperty 'java.library.path','/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib:/lib/x86_64-linux-gnu'
}

publishing {
Expand Down
11 changes: 10 additions & 1 deletion src/test/java/org/freedesktop/cairo/test/FTFontFaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import io.github.jwharm.javagi.interop.Platform;

import java.io.File;

class FTFontFaceTest {

private static String TTF_FILE;
Expand All @@ -22,7 +24,14 @@ class FTFontFaceTest {
static void setup() {
// These files are going to be in different locations depending on your system.
switch (Platform.getRuntimePlatform()) {
case "linux" -> TTF_FILE = "/usr/share/fonts/liberation-serif/LiberationSerif-Regular.ttf";
case "linux" -> {
// Fedora
TTF_FILE = "/usr/share/fonts/liberation-serif/LiberationSerif-Regular.ttf";
if (! new File(TTF_FILE).exists()) {
// Ubuntu
TTF_FILE = "/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf";
}
}
case "windows" -> TTF_FILE = "C:\\Windows\\Fonts\\arial.ttf";
case "macos" -> TTF_FILE = "/Library/Fonts/Arial Unicode.ttf";
}
Expand Down

0 comments on commit d6b6184

Please sign in to comment.