Skip to content

Commit

Permalink
Add Spiro port
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Oct 31, 2023
1 parent d234e2c commit 90f24e5
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/spiro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: spiro
on:
workflow_dispatch:
push:
paths:
- 'buildSrc/**'
- 'spiro/**'
- '.github/workflows/build.yml'
- '.github/workflows/spiro.yml'

jobs:
build:
name: spiro
uses: ./.github/workflows/build.yml
with:
package: spiro
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,11 @@ Figure out proper way to deliver per ABI headers.
[![Maven Central](https://img.shields.io/maven-central/v/com.viliussutkus89.ndk.thirdparty/openjpeg-ndk25-shared.svg?label=Maven%20Central%20openjpeg-ndk25-shared)](https://search.maven.org/search?q=g:com.viliussutkus89.ndk.thirdparty%20AND%20a:openjpeg-ndk25-shared)
[![Maven Central](https://img.shields.io/maven-central/v/com.viliussutkus89.ndk.thirdparty/openjpeg-ndk26-static.svg?label=Maven%20Central%20openjpeg-ndk26-static)](https://search.maven.org/search?q=g:com.viliussutkus89.ndk.thirdparty%20AND%20a:openjpeg-ndk26-static)
[![Maven Central](https://img.shields.io/maven-central/v/com.viliussutkus89.ndk.thirdparty/openjpeg-ndk26-shared.svg?label=Maven%20Central%20openjpeg-ndk26-shared)](https://search.maven.org/search?q=g:com.viliussutkus89.ndk.thirdparty%20AND%20a:openjpeg-ndk26-shared)

#### [Spiro](https://github.com/fontforge/libspiro)

[![spiro](https://github.com/ViliusSutkus89/ndkports/actions/workflows/spiro.yml/badge.svg)](https://github.com/ViliusSutkus89/ndkports/actions/workflows/spiro.yml)
[![Maven Central](https://img.shields.io/maven-central/v/com.viliussutkus89.ndk.thirdparty/spiro-ndk25-static.svg?label=Maven%20Central%20spiro-ndk25-static)](https://search.maven.org/search?q=g:com.viliussutkus89.ndk.thirdparty%20AND%20a:spiro-ndk25-static)
[![Maven Central](https://img.shields.io/maven-central/v/com.viliussutkus89.ndk.thirdparty/spiro-ndk25-shared.svg?label=Maven%20Central%20spiro-ndk25-shared)](https://search.maven.org/search?q=g:com.viliussutkus89.ndk.thirdparty%20AND%20a:spiro-ndk25-shared)
[![Maven Central](https://img.shields.io/maven-central/v/com.viliussutkus89.ndk.thirdparty/spiro-ndk26-static.svg?label=Maven%20Central%20spiro-ndk26-static)](https://search.maven.org/search?q=g:com.viliussutkus89.ndk.thirdparty%20AND%20a:spiro-ndk26-static)
[![Maven Central](https://img.shields.io/maven-central/v/com.viliussutkus89.ndk.thirdparty/spiro-ndk26-shared.svg?label=Maven%20Central%20spiro-ndk26-shared)](https://search.maven.org/search?q=g:com.viliussutkus89.ndk.thirdparty%20AND%20a:spiro-ndk26-shared)
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ include(":lcms2")
include(":openjpeg")
include(":fribidi")
include(":libtool")
include(":spiro")
144 changes: 144 additions & 0 deletions spiro/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import com.android.ndkports.AutoconfPortTask
import com.android.ndkports.CMakeCompatibleVersion
import com.android.ndkports.PrefabSysrootPlugin
import org.gradle.jvm.tasks.Jar

val portVersion = "20221101"

group = rootProject.group
version = "${portVersion}-beta-1"

plugins {
id("maven-publish")
id("signing")
id("com.android.ndkports.NdkPorts")
}

ndkPorts {
ndkPath.set(File(project.findProperty("ndkPath") as String))
minSdkVersion.set(rootProject.extra.get("minSdkSupportedByNdk").toString().toInt())
source.set(project.file("lib${name}-dist-${portVersion}.tar.gz"))
}

tasks.prefab {
generator.set(PrefabSysrootPlugin::class.java)
}

tasks.register<AutoconfPortTask>("buildPort") {
autoconf { }
}

fun File.replace(oldValue: String, newValue: String, ignoreCase: Boolean = false): File {
writeText(readText().replace(oldValue, newValue, ignoreCase))
return this
}

tasks.extractSrc {
doLast {
// No libthread.so on Android. Threads are available by default, no need to link against it
outDir.get().asFile.resolve("tests/Makefile.in").replace("@WANTPTHREADS_TRUE@am__append_1 = -lpthread", "")
}
}

tasks.prefabPackage {
version.set(CMakeCompatibleVersion.parse(portVersion))

licensePath.set("COPYING")

modules {
create("spiro") {
static.set(project.findProperty("libraryType") == "static")
}
}
}

val packageSources = tasks.register<Jar>("packageSources") {
archiveClassifier.set("sources")
from(projectDir.resolve("build.gradle.kts"))
from(ndkPorts.source)
}

publishing {
publications {
create<MavenPublication>("release") {
from(components["prefab"])
artifactId += rootProject.extra.get("ndkVersionSuffix")
artifactId += rootProject.extra.get("libraryTypeSuffix")
artifact(packageSources)
pom {
name.set("Spiro")
description.set("A library for curve design. Clothoid to bezier conversion. A mechanism for drawing smooth contours with constant curvature at the spline joins.")
url.set("https://github.com/fontforge/libspiro")
licenses {
license {
name.set("GPLv3")
url.set("https://raw.githubusercontent.com/fontforge/libspiro/20221101/COPYING")
distribution.set("repo")
}
}
developers {
// Developer list obtained from:
// https://raw.githubusercontent.com/fontforge/libspiro/20221101/AUTHORS
developer {
name.set("Raph Levien")
email.set("raph.levien@gmail.com")
}
developer {
name.set("George Williams")
email.set("gww@silcom.com")
}
developer {
name.set("Joe Da Silva")
}
developer {
name.set("Dave Crossland")
}
developer {
name.set("Shriramana Sharma")
}
developer {
name.set("Horváth Balázs")
}
developer {
name.set("Luigi Scarso")
}
developer {
name.set("Jeremy Tan")
}
developer {
name.set("Wiesław Šoltés")
}
developer {
name.set("Mingye Wang")
}
developer {
name.set("Frederic Cambus")
}
developer {
name.set("Fredrick Brennan")
}
developer {
name.set("C.W. Betts")
}
developer {
id.set("orbea")
}
}
scm {
url.set("https://github.com/ViliusSutkus89/ndkports")
connection.set("scm:git:https://github.com/ViliusSutkus89/ndkports.git")
}
}
}
}
}

afterEvaluate {
System.getenv("SIGNING_KEY")?.let { signingKey ->
signing {
isRequired = true
useInMemoryPgpKeys(signingKey, System.getenv("SIGNING_PASS"))
sign(publishing.publications.findByName("release"))
}
}
}
3 changes: 3 additions & 0 deletions spiro/libspiro-dist-20221101.tar.gz
Git LFS file not shown

0 comments on commit 90f24e5

Please sign in to comment.