File tree Expand file tree Collapse file tree 6 files changed +39
-10
lines changed
src/nativeInterop/cinterop Expand file tree Collapse file tree 6 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ buildscript {
2323
2424allprojects {
2525 group = " fr.acinq.secp256k1"
26- version = " 0.17.1 "
26+ version = " 0.17.2-SNAPSHOT "
2727
2828 repositories {
2929 google()
@@ -59,6 +59,10 @@ kotlin {
5959 secp256k1CInterop(" host" )
6060 }
6161
62+ linuxArm64 {
63+ secp256k1CInterop(" linuxArm64" )
64+ }
65+
6266 macosX64 {
6367 secp256k1CInterop(" host" )
6468 }
@@ -91,9 +95,9 @@ allprojects {
9195 val currentOs = OperatingSystem .current()
9296 val targets = when {
9397 currentOs.isLinux -> listOf ()
94- currentOs.isMacOsX -> listOf (" linuxX64" )
95- currentOs.isWindows -> listOf (" linuxX64" )
96- else -> listOf (" linuxX64" )
98+ currentOs.isMacOsX -> listOf (" linuxX64" , " linuxArm64 " )
99+ currentOs.isWindows -> listOf (" linuxX64" , " linuxArm64 " )
100+ else -> listOf (" linuxX64" , " linuxArm64 " )
97101 }.mapNotNull { kotlin.targets.findByName(it) as ? KotlinNativeTarget }
98102
99103 configure(targets) {
Original file line number Diff line number Diff line change @@ -30,6 +30,21 @@ val buildSecp256k1Host by tasks.creating(Exec::class) {
3030 commandLine(bash, " -l" , " build.sh" )
3131}
3232
33+ // specific build task for linux arm64, which is cross-compiled on a linux x64 host
34+ val buildSecp256k1LinuxArm64 by tasks.creating(Exec ::class ) {
35+ group = " build"
36+ buildSecp256k1.dependsOn(this )
37+
38+ val target = " linuxArm64"
39+
40+ inputs.files(projectDir.resolve(" build.sh" ))
41+ outputs.dir(projectDir.resolve(" build/$target " ))
42+
43+ workingDir = projectDir
44+ environment(" TARGET" , target)
45+ commandLine(bash, " -l" , " build.sh" )
46+ }
47+
3348val buildSecp256k1Ios by tasks.creating(Exec ::class ) {
3449 group = " build"
3550 buildSecp256k1.dependsOn(this )
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ if [ "$TARGET" == "mingw" ]; then
1616 CONF_OPTS=" --host=x86_64-w64-mingw32"
1717elif [ " $TARGET " == " linux" ]; then
1818 CFLAGS=" -fPIC"
19+ elif [ " $TARGET " == " linuxArm64" ]; then
20+ CFLAGS=" -fPIC"
21+ CONF_OPTS=" --host=aarch64-linux-gnu"
1922elif [ " $TARGET " == " darwin" ]; then
2023 CFLAGS=" -arch arm64 -arch x86_64"
2124 LDFLAGS=" -arch arm64 -arch x86_64"
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ mvn deploy:deploy-file -DrepositoryId=ossrh -Durl=https://oss.sonatype.org/conte
2121 -Djavadoc=$ARTIFACT_ID_BASE -$VERSION -javadoc.jar
2222popd
2323pushd .
24- for i in iosarm64 iossimulatorarm64 iosx64 macosarm64 macosx64 jni-android jni-common jni-jvm-darwin jni-jvm-extract jni-jvm-linux jni-jvm-mingw jni-jvm jvm linuxx64; do
24+ for i in iosarm64 iossimulatorarm64 iosx64 macosarm64 macosx64 jni-android jni-common jni-jvm-darwin jni-jvm-extract jni-jvm-linux jni-jvm-mingw jni-jvm jvm linuxarm64 linuxx64; do
2525 cd fr/acinq/secp256k1/secp256k1-kmp-$i /$VERSION
2626
2727 case $i in
@@ -35,7 +35,7 @@ for i in iosarm64 iossimulatorarm64 iosx64 macosarm64 macosx64 jni-android jni-c
3535 -Dsources=$ARTIFACT_ID_BASE -$i -$VERSION -sources.jar \
3636 -Djavadoc=$ARTIFACT_ID_BASE -$i -$VERSION -javadoc.jar
3737 ;;
38- linuxx64)
38+ linuxx64 | linuxarm64 )
3939 mvn deploy:deploy-file -DrepositoryId=ossrh -Durl=https://oss.sonatype.org/content/repositories/snapshots/ \
4040 -DpomFile=$ARTIFACT_ID_BASE -$i -$VERSION .pom \
4141 -Dfile=$ARTIFACT_ID_BASE -$i -$VERSION .klib \
Original file line number Diff line number Diff line change @@ -28,7 +28,10 @@ for i in secp256k1-kmp \
2828 secp256k1-kmp-jni-jvm-linux \
2929 secp256k1-kmp-jni-jvm-mingw \
3030 secp256k1-kmp-jvm \
31- secp256k1-kmp-linuxx64
31+ secp256k1-kmp-linuxarm64 \
32+ secp256k1-kmp-linuxx64 \
33+ secp256k1-kmp-macosarm64 \
34+ secp256k1-kmp-macosx64
3235do
3336 pushd .
3437 cd release/fr/acinq/secp256k1/$i /$VERSION
Original file line number Diff line number Diff line change @@ -3,9 +3,13 @@ package = secp256k1
33headers = secp256k1.h secp256k1_ecdh.h secp256k1_recovery.h secp256k1_extrakeys.h secp256k1_schnorrsig.h secp256k1_musig.h
44headerFilter = secp256k1/** secp256k1_ecdh.h secp256k1_recovery.h secp256k1_extrakeys.h secp256k1_schnorrsig.h secp256k1_musig.h secp256k1.h
55
6- staticLibraries.linux = libsecp256k1.a
7- libraryPaths.linux = c/secp256k1/build/linux/ native/build/linux/ native/build/darwin/
8- linkerOpts.linux = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib
6+ staticLibraries.linux_x64 = libsecp256k1.a
7+ libraryPaths.linux_x64 = c/secp256k1/build/linux/ native/build/linux/
8+ linkerOpts.linux_x64 = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib
9+
10+ staticLibraries.linux_arm64 = libsecp256k1.a
11+ libraryPaths.linux_arm64 = c/secp256k1/build/linuxArm65/ native/build/linuxArm64/
12+ linkerOpts.linux_arm64 = -L/usr/aarch64-linux-gnu/lib
913
1014staticLibraries.macos_x64 = libsecp256k1.a
1115libraryPaths.macos_x64 = c/secp256k1/build/darwin/ native/build/darwin/
You can’t perform that action at this time.
0 commit comments