Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
89def9d
build: start working on proper static mpv build
silenium-dev Oct 11, 2025
a5f3121
build: start working on replacing cmake with meson for native build
silenium-dev Oct 12, 2025
e1aef7d
chore: update dependencies
silenium-dev Oct 12, 2025
ee6435b
build: add fribidi, freetype and libdisplay-info as wraps
silenium-dev Oct 12, 2025
b48b7aa
build: update to java 17
silenium-dev Oct 12, 2025
c171a52
build: remove jvmToolchain() calls
silenium-dev Oct 12, 2025
a7c7148
build: use fixed ffmpeg build
silenium-dev Oct 12, 2025
bddfbcd
build: use fixed ffmpeg build (2)
silenium-dev Oct 12, 2025
8de2099
build: add fmt wrap
silenium-dev Oct 12, 2025
e89669c
build: add fmt wrap
silenium-dev Oct 12, 2025
e7ed9b2
fix: link with mpv
silenium-dev Oct 12, 2025
c7cfc66
build: try forcing static libs
silenium-dev Oct 12, 2025
6f4810d
build: try forcing static libs
silenium-dev Oct 12, 2025
dfa3e66
build: add uchardet wrap
silenium-dev Oct 12, 2025
0eb3876
build: try fixing freetype wrap
silenium-dev Oct 12, 2025
4fcba02
build: add fontconfig wrap
silenium-dev Oct 12, 2025
58662ef
build: try fixing fontconfig wrap
silenium-dev Oct 12, 2025
7c45186
build: try fixing fontconfig wrap
silenium-dev Oct 12, 2025
f87a8d4
build: try fixing fontconfig wrap
silenium-dev Oct 12, 2025
81e863b
build: try fixing fontconfig wrap
silenium-dev Oct 12, 2025
c05d8b9
build: disable vulkan support for mpv
silenium-dev Oct 12, 2025
6ed3900
build: static link against libgcc and libstdc++, set forcefallback
silenium-dev Oct 12, 2025
dc1a4aa
ci: update ci setup
silenium-dev Oct 12, 2025
c2a1869
ci: remove libfontconfig-dev and uninstall libz3-dev
silenium-dev Oct 12, 2025
c179bd2
ci: update java to 17
silenium-dev Oct 12, 2025
d24567e
ci: remove upgrade
silenium-dev Oct 12, 2025
6db879f
build: fix issue with gradle java and kotlin target versions
silenium-dev Oct 12, 2025
6a39082
ci: try fixing permissions issue
silenium-dev Oct 12, 2025
14ba497
feat: start working on rewrite against new compose-gl
silenium-dev Oct 13, 2025
6322485
ci: disable tests in linux-x86_64 build
silenium-dev Oct 13, 2025
b33ae8e
chore: update dependencies
silenium-dev Feb 23, 2026
be535b4
fix: disable static libstdc++ and use event loop thread to avoid mpv …
silenium-dev Feb 23, 2026
c0aa7ae
build: add nix flake for build environment
silenium-dev Feb 23, 2026
29d0e55
chore: remove obsolete files
silenium-dev Feb 24, 2026
d389a82
chore: remove debug logs
silenium-dev Feb 24, 2026
00c85a3
fix: make simple test actually simple
silenium-dev Feb 24, 2026
b9119c6
build: use fixed ffmpeg build
silenium-dev Feb 24, 2026
17cbed5
build: use nix shell from gradle to avoid having to run entire build …
silenium-dev Feb 24, 2026
c656eb7
ci: add missing checkout
silenium-dev Feb 24, 2026
73ec069
build: replace ci manual dependency install with nix
silenium-dev Feb 24, 2026
0a651e9
build: first working native build via gradle
silenium-dev Feb 26, 2026
48f30a0
fix: rethrow exception from downloadFile method
silenium-dev Feb 27, 2026
118d8e5
build: add meson clean task
silenium-dev Feb 27, 2026
ba98e7b
build: reduce minimum jvm version to 11
silenium-dev Feb 27, 2026
ad85faa
fix: platform file check and update
silenium-dev Feb 27, 2026
b787d47
fix: linux arm64 cross file
silenium-dev Feb 27, 2026
6a9351c
fix: use correct way to resolve libs for windows
silenium-dev Feb 27, 2026
06e75d0
build: set minimum meson version
silenium-dev Feb 27, 2026
677b424
build: add pkg-config for linux-arm64
silenium-dev Feb 27, 2026
440a4b0
build: use native platform from gradle property
silenium-dev Feb 27, 2026
7d8267a
build: start working on architecture specific downloads for linux ffmpeg
silenium-dev Feb 27, 2026
c0a920f
build: working cross-compile for linux-arm64/-x86_64 and windows-x86_…
silenium-dev Feb 27, 2026
e7e7119
fix: cleanup some obsolete stuff, add missing native functions
silenium-dev Feb 27, 2026
d50d0d8
chore: move shell definitions to subdir
silenium-dev Feb 27, 2026
449e4d2
ci: install nix
silenium-dev Feb 27, 2026
48fa72d
fix: correct native platform property name
silenium-dev Feb 27, 2026
83e6896
fix: remove duplicate output file registration
silenium-dev Feb 27, 2026
e07b047
build: add native library in resources processing
silenium-dev Feb 27, 2026
f25bf8e
build: add native library publication
silenium-dev Feb 27, 2026
24536f8
ci: try fixing branch trigger
silenium-dev Feb 27, 2026
e9b6e79
ci: build all currently supported natives
silenium-dev Feb 27, 2026
ecb9462
ci: publish to repoflow instead of reposilite
silenium-dev Mar 3, 2026
8927dbe
build: start working on nix build powered native build
silenium-dev Mar 3, 2026
208f752
build: working pure nix build for natives
silenium-dev Mar 5, 2026
7777516
build: update jni-utils flake
silenium-dev Mar 5, 2026
e5dcea4
build: update jni-utils flake and copy over binary dependencies (ffmp…
silenium-dev Mar 5, 2026
2a94591
build: integrate nix build with gradle
silenium-dev Mar 5, 2026
19f2060
chore: remove deprecated preview annotation
silenium-dev Mar 5, 2026
24b2b25
chore: remove deprecated context-receivers
silenium-dev Mar 5, 2026
e4339ff
chore: small cleanup
silenium-dev Mar 5, 2026
9631b5d
fix: demos
silenium-dev Mar 5, 2026
c2463aa
ci: remove dedicated native build step as all natives are build at on…
silenium-dev Mar 6, 2026
000bfe8
fix: use deploy.kotlin instead of deploy.native
silenium-dev Mar 6, 2026
4060758
chore: cleanup
silenium-dev Mar 6, 2026
5deef2d
ci: try fixing branch triggers
silenium-dev Mar 6, 2026
d8b3066
build: show nix build logs in ci
silenium-dev Mar 6, 2026
c482dcb
fix: add missing passthrough
silenium-dev Mar 6, 2026
5a2e8d9
ci: add snapshot and release builds
silenium-dev Mar 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: "Build and Test"
on:
push:
branches:
- '*'
tags-ignore:
- '*'
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
workflow_dispatch:
release:
Expand All @@ -16,33 +9,42 @@ permissions:
pull-requests: write
contents: write
jobs:
linux-x86_64:
build-publish:
runs-on: ubuntu-24.04
steps:
- shell: bash
name: "Install mpv"
run: |
sudo apt-get update -y
sudo apt-get install -y libmpv-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev libavfilter-dev libswresample-dev libpostproc-dev libpipewire-0.3-dev
- uses: silenium-dev/actions/jni-natives/ubuntu@main
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
snapshot-repo-url: "https://reposilite.silenium.dev/snapshots"
release-repo-url: "https://reposilite.silenium.dev/releases"
repo-username: ${{ secrets.REPOSILITE_USERNAME }}
repo-password: ${{ secrets.REPOSILITE_PASSWORD }}
tests: true
java-version: 11
platform: ${{ github.job }}
kotlin:
runs-on: ubuntu-24.04
steps:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v7
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-
# collect garbage until the Nix store size (in bytes) is at most this number
# before trying to save a new cache
# 1G = 1073741824
gc-max-store-size-linux: 4G
# do purge caches
purge: true
# purge all versions of the cache
purge-prefixes: nix-${{ runner.os }}-
# created more than this number of seconds ago
purge-created: 0
# or last accessed this duration (ISO 8601 duration format)
# before the start of the `Post Restore and save Nix store` phase
purge-last-accessed: P7D
# except any version with the key that is the same as the `primary-key`
purge-primary-key: never
- uses: silenium-dev/actions/kotlin@main
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
snapshot-repo-url: "https://reposilite.silenium.dev/snapshots"
release-repo-url: "https://reposilite.silenium.dev/releases"
repo-username: ${{ secrets.REPOSILITE_USERNAME }}
repo-password: ${{ secrets.REPOSILITE_PASSWORD }}
snapshot-repo-url: "https://repoflow.silenium.dev/api/maven/public/maven-snapshots"
release-repo-url: "https://repoflow.silenium.dev/api/maven/public/maven-releases"
repo-username: ${{ secrets.REPOFLOW_USERNAME }}
repo-password: ${{ secrets.REPOFLOW_PASSWORD }}
tests: false
java-version: 11
java-version: 17
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rgb.png
texture.png
va_surface.png
textures/

native/result

### IntelliJ IDEA ###
.idea/
Expand Down
21 changes: 0 additions & 21 deletions .run/desktop.run.xml

This file was deleted.

86 changes: 59 additions & 27 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
@@ -1,35 +1,18 @@
import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildFeatures.perfmon
import jetbrains.buildServer.configs.kotlin.buildFeatures.pullRequests
import jetbrains.buildServer.configs.kotlin.buildSteps.gradle
import jetbrains.buildServer.configs.kotlin.project
import jetbrains.buildServer.configs.kotlin.projectFeatures.githubConnection
import jetbrains.buildServer.configs.kotlin.triggers.VcsTrigger
import jetbrains.buildServer.configs.kotlin.triggers.vcs

/*
The settings script is an entry point for defining a TeamCity
project hierarchy. The script should contain a single call to the
project() function with a Project instance or an init function as
an argument.

VcsRoots, BuildTypes, Templates, and subprojects can be
registered inside the project using the vcsRoot(), buildType(),
template(), and subProject() methods respectively.

To debug settings scripts in command-line, run the

mvnDebug org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate

command and attach your debugger to the port 8000.

To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View
-> Tool Windows -> Maven Projects), find the generate task node
(Plugins -> teamcity-configs -> teamcity-configs:generate), the
'Debug' option is available in the context menu for the task.
*/
import jetbrains.buildServer.configs.kotlin.version

version = "2025.11"

project {

buildType(Build)
buildType(BuildSnapshot)
buildType(BuildRelease)

features {
githubConnection {
Expand All @@ -41,16 +24,65 @@ project {
}
}

object Build : BuildType({
name = "Build"
abstract class Build(
val publishRepository: String,
val publishUsername: String,
val publishPassword: String,
val publishVersion: String,
val trigger: VcsTrigger.() -> Unit,
) : BuildType({
name = "Build and Publish"

triggers {
vcs {
branchFilter = "+:refs/heads/*"
}
}

features {
perfmon {
}

pullRequests {
provider = github {
authType = vcsRoot()
ignoreDrafts = true
}
}
}

requirements {
exists("system.nix.store")
}

steps {
gradle {
tasks = "build publish"
gradleParams = "-Pdeploy.version=${publishVersion} -Pdeploy.kotlin=true"
incremental = true
param("env.MAVEN_REPO_URL", publishRepository)
param("env.MAVEN_REPO_USERNAME", publishUsername)
param("env.MAVEN_REPO_PASSWORD", publishPassword)
}
}
})

object BuildSnapshot : Build(
publishRepository = "https://repoflow.silenium.dev/api/maven/public/maven-snapshots",
publishUsername = "teamcitypublic",
publishPassword = "credentialsJSON:c8524851-3a17-4ea4-ac26-49a99c5c387c",
publishVersion = "%build.vcs.number%",
trigger = {
branchFilter = "+:refs/heads/*"
}
)

object BuildRelease : Build(
publishRepository = "https://repoflow.silenium.dev/api/maven/public/maven-releases",
publishUsername = "teamcitypublic",
publishPassword = "credentialsJSON:c8524851-3a17-4ea4-ac26-49a99c5c387c",
publishVersion = "%build.vcs.number%",
trigger = {
branchFilter = "+:refs/tags/*"
}
)
33 changes: 33 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
`kotlin-dsl`
`java-gradle-plugin`
}

repositories {
maven("https://reposilite.silenium.dev/releases") {
name = "silenium-releases"
}
google()
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
api(libs.bundles.gradle.plugins)
libs.bundles.kotlin.plugins.get().forEach {
api(variantOf(provider { it }) {
classifier("gradle813")
})
}
api(libs.jni.utils)
}

gradlePlugin {
plugins {
register("natives") {
id = "av-natives"
implementationClass = "dev.silenium.compose.av.build.NativesPlugin"
}
}
}
13 changes: 13 additions & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}

versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package dev.silenium.compose.av.build

import org.gradle.api.logging.Logger
import org.gradle.internal.logging.progress.ProgressLogger
import java.io.OutputStream
import java.net.URI
import kotlin.time.Clock
import kotlin.time.Duration.Companion.seconds
import kotlin.time.ExperimentalTime

@OptIn(ExperimentalTime::class)
fun downloadFile(progressLogger: ProgressLogger, logger: Logger, uri: URI, outputStream: OutputStream) {
try {
val conn = uri.toURL().openConnection()
conn.connect()
val size = conn.contentLengthLong
progressLogger.progress("${size.toMB()} MB")

var downloaded = 0L
var lastLog = Clock.System.now()
val buf = ByteArray(1024)
conn.inputStream.use { input ->
while (true) {
if (Thread.currentThread().isInterrupted) {
throw InterruptedException("Download interrupted")
}
val read = input.read(buf)
if (read == -1) break
outputStream.write(buf, 0, read)

downloaded += read
if (downloaded > 0) {
progressLogger.progress("${downloaded.toMB()} MB / ${size.toMB()} MB (${downloaded partOf size}%)")
} else {
progressLogger.progress("${size.toMB()} MB")
}
val now = Clock.System.now()
if (now - lastLog > 1.seconds) {
lastLog = now
logger.lifecycle("${progressLogger.description}: ${downloaded.toMB()} MB / ${size.toMB()} MB (${downloaded partOf size}%)")
}
}
}
progressLogger.completed()
logger.lifecycle("${progressLogger.description}: ${downloaded.toMB()} MB / ${size.toMB()} MB (${downloaded partOf size}%)")
} catch (e: Exception) {
progressLogger.completed(e.message ?: "Unknown error", true)
throw e
}
}

private fun Long.toMB() = this / 1024 / 1024
private infix fun Long.partOf(full: Long) = (this * 100) / full
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package dev.silenium.compose.av.build

import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property

interface NativesExtension {
val sourceFiles: ConfigurableFileCollection
val libName: Property<String>
val libVersion: Property<String>

val nixFlake: RegularFileProperty
val nixFlakeLock: RegularFileProperty
val showLogs: Property<Boolean>
}
Loading
Loading