@@ -29,6 +29,7 @@ final class RuntimeHelper {
29
29
private static boolean isLoaded = false ;
30
30
private static final String LD_CONFIG = "/etc/ld.so.conf.d/" ;
31
31
private static final String LIB_NAME_VERSION = "libappindicator3.so.1" ;
32
+ private static final String FLATPAK_LIB_NAME_VERSION = "libappindicator3.so" ;
32
33
private static List <String > allPath = new LinkedList <>();
33
34
private static final Logger LOG = LoggerFactory .getLogger (RuntimeHelper .class );
34
35
@@ -50,14 +51,20 @@ final class RuntimeHelper {
50
51
}
51
52
52
53
allPath .add ("/usr/lib" ); // for systems, that don't implement multiarch
54
+ allPath .add ("/app/lib" ); // for flatpak and libraries in the flatpak sandbox
53
55
for (String path : allPath ) {
54
56
try {
55
- System .load (path + File .separator + LIB_NAME_VERSION );
57
+ if (!path .equals ("/app/lib" )) {
58
+ System .load (path + File .separator + LIB_NAME_VERSION );
59
+ } else {
60
+ // flatpak has an own, self-compiled version
61
+ System .load (path + File .separator + FLATPAK_LIB_NAME_VERSION );
62
+ }
56
63
isLoaded = true ;
57
64
break ;
58
65
} catch (UnsatisfiedLinkError ignored ) { }
59
66
}
60
- LOG .info (isLoaded ? "Native code library " + LIB_NAME_VERSION + " successfully loaded" : "Native code library " + LIB_NAME_VERSION + " failed to load" );
67
+ LOG .info (isLoaded ? "Native code library libappindicator3 successfully loaded" : "Native code library libappindicator3 failed to load" );
61
68
SymbolLookup loaderLookup = SymbolLookup .loaderLookup ();
62
69
SYMBOL_LOOKUP = name -> loaderLookup .find (name ).or (() -> LINKER .defaultLookup ().find (name ));
63
70
}
0 commit comments