add native libraries for aarch64

This commit is contained in:
Craig Raw 2022-05-06 17:34:23 +02:00
parent b5fa8f0ee0
commit bf078b2ea0
6 changed files with 21 additions and 5 deletions

View file

@ -11,6 +11,12 @@ def osName = os.getFamilyName()
if(os.macOsX) {
osName = "osx"
}
def targetName = osName
def osArch = "x64"
if(System.getProperty("os.arch") == "aarch64") {
osArch = "aarch64"
targetName = osName + "-" + osArch
}
group "com.sparrowwallet"
version "${sparrowVersion}"
@ -118,7 +124,7 @@ compileJava {
processResources {
doLast {
delete fileTree("$buildDir/resources/main/native").matching {
exclude "${osName}/**"
exclude "${osName}/${osArch}/**"
}
}
}
@ -550,7 +556,7 @@ extraJavaModuleInfo {
module('jcip-annotations-1.0.jar', 'net.jcip.annotations', '1.0') {
exports('net.jcip.annotations')
}
module("netlayer-jpms-${osName}-0.6.8.jar", 'netlayer.jpms', '0.6.8') {
module("netlayer-jpms-${targetName}-0.6.8.jar", 'netlayer.jpms', '0.6.8') {
exports('org.berndpruenster.netlayer.tor')
requires('com.github.ravn.jsocks')
requires('com.github.JesusMcCloud.jtorctl')

2
drongo

@ -1 +1 @@
Subproject commit 9cb95f2f8ca25c23021667f7be47ab9bd9846ce4
Subproject commit ba8692450335f2e5293ddd3951a394244315803f

View file

@ -294,7 +294,14 @@ public class Hwi {
//The check will still happen on first invocation, but will not thereafter
//See https://github.com/bitcoin-core/HWI/issues/327 for details
if(platform == Platform.OSX) {
InputStream inputStream = Hwi.class.getResourceAsStream("/native/osx/x64/" + HWI_VERSION_DIR + "-mac-amd64-signed.zip");
String osArch = System.getProperty("os.arch");
InputStream inputStream;
if(osArch.equals("aarch64")) {
inputStream = Hwi.class.getResourceAsStream("/native/osx/aarch64/" + HWI_VERSION_DIR + "-mac-aarch64-signed.zip");
} else {
inputStream = Hwi.class.getResourceAsStream("/native/osx/x64/" + HWI_VERSION_DIR + "-mac-amd64-signed.zip");
}
if(inputStream == null) {
throw new IllegalStateException("Cannot load " + HWI_VERSION_DIR + " from classpath");
}

View file

@ -41,7 +41,10 @@ public class Bwt {
if(!initialized) {
try {
org.controlsfx.tools.Platform platform = org.controlsfx.tools.Platform.getCurrent();
if(platform == org.controlsfx.tools.Platform.OSX) {
String osArch = System.getProperty("os.arch");
if(platform == org.controlsfx.tools.Platform.OSX && osArch.equals("aarch64")) {
NativeUtils.loadLibraryFromJar("/native/osx/aarch64/libbwt_jni.dylib");
} else if(platform == org.controlsfx.tools.Platform.OSX) {
NativeUtils.loadLibraryFromJar("/native/osx/x64/libbwt_jni.dylib");
} else if(platform == org.controlsfx.tools.Platform.WINDOWS) {
NativeUtils.loadLibraryFromJar("/native/windows/x64/bwt_jni.dll");

Binary file not shown.