Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/release-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ jobs:
ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.password: ${{ secrets.PROCESSING_APP_PASSWORD }}
ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.teamID: ${{ secrets.PROCESSING_TEAM_ID }}
ORG_GRADLE_PROJECT_snapname: ${{ vars.SNAP_NAME }}
ORG_GRADLE_PROJECT_snapconfinement: ${{ vars.SNAP_CONFINEMENT }}

- name: Sign files with Trusted Signing
if: runner.os == 'Windows'
Expand Down
92 changes: 38 additions & 54 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,17 @@ compose.desktop {
upgradeUuid = "89d8d7fe-5602-4b12-ba10-0fe78efbd602"
}
linux {
appCategory = "Programming"
debMaintainer = "[email protected]"
menuGroup = "Development;Programming;"
appCategory = "Programming"
iconFile = rootProject.file("build/linux/processing.png")
// Fix fonts on some Linux distributions
jvmArgs("-Dawt.useSystemAAFontSettings=on")

fileAssociation("pde", "Processing Source Code", "application/x-processing")
fileAssociation("pyde", "Processing Python Source Code", "application/x-processing")
fileAssociation("pdez", "Processing Sketch Bundle", "application/x-processing")
fileAssociation("pdex", "Processing Contribution Bundle", "application/x-processing")
fileAssociation("application/x-processing","pde", "Processing Source Code",rootProject.file("build/shared/lib/icons/pde-512.png"))
fileAssociation("application/x-processing","pyde", "Processing Python Source Code",rootProject.file("build/shared/lib/icons/pde-512.png"))
fileAssociation("application/x-processing","pdez", "Processing Sketch Bundle",rootProject.file("build/shared/lib/icons/pde-512.png"))
fileAssociation("application/x-processing","pdex", "Processing Contribution Bundle", rootProject.file("build/shared/lib/icons/pde-512.png"))
}
}
}
Expand Down Expand Up @@ -228,61 +229,44 @@ tasks.register<Exec>("packageCustomMsi"){


tasks.register("generateSnapConfiguration"){
val name = findProperty("snapname") ?: rootProject.name
onlyIf { OperatingSystem.current().isLinux }

val distributable = tasks.named<AbstractJPackageTask>("createDistributable").get()
dependsOn(distributable)

val name = findProperty("snapname") as String? ?: rootProject.name
val arch = when (System.getProperty("os.arch")) {
"amd64", "x86_64" -> "amd64"
"aarch64" -> "arm64"
else -> System.getProperty("os.arch")
}

onlyIf { OperatingSystem.current().isLinux }
val distributable = tasks.named<AbstractJPackageTask>("createDistributable").get()
dependsOn(distributable)

val confinement = findProperty("snapconfinement") as String? ?: "strict"
val dir = distributable.destinationDir.get()
val content = """
name: $name
version: $version
base: core22
summary: A creative coding editor
description: |
Processing is a flexible software sketchbook and a programming language designed for learning how to code.
confinement: strict

apps:
processing:
command: opt/processing/bin/Processing
desktop: opt/processing/lib/processing-Processing.desktop
environment:
LD_LIBRARY_PATH: ${'$'}SNAP/opt/processing/lib/runtime/lib:${'$'}LD_LIBRARY_PATH
LIBGL_DRIVERS_PATH: ${'$'}SNAP/usr/lib/${'$'}SNAPCRAFT_ARCH_TRIPLET/dri
plugs:
- desktop
- desktop-legacy
- wayland
- x11
- network
- opengl
- home
- removable-media
- audio-playback
- audio-record
- pulseaudio
- gpio

parts:
processing:
plugin: dump
source: deb/processing_$version-1_$arch.deb
source-type: deb
stage-packages:
- openjdk-17-jre
override-prime: |
snapcraftctl prime
rm -vf usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts
chmod -R +x opt/processing/lib/app/resources/jdk
""".trimIndent()
dir.file("../snapcraft.yaml").asFile.writeText(content)
val base = layout.projectDirectory.file("linux/snapcraft.base.yml")

doFirst {

var content = base
.asFile
.readText()
.replace("\$name", name)
.replace("\$arch", arch)
.replace("\$version", version as String)
.replace("\$confinement", confinement)
.let {
if (confinement != "classic") return@let it
// If confinement is not strict, remove the PLUGS section
val start = it.indexOf("# PLUGS START")
val end = it.indexOf("# PLUGS END")
if (start != -1 && end != -1) {
val before = it.substring(0, start)
val after = it.substring(end + "# PLUGS END".length)
return@let before + after
}
return@let it
}
dir.file("../snapcraft.yaml").asFile.writeText(content)
}
}

tasks.register<Exec>("packageSnap"){
Expand Down
38 changes: 38 additions & 0 deletions app/linux/org.processing.pde.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
id: org.processing.pde
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: Processing
finish-args:
- --socket=x11
- --share=ipc
- --device=all
- --filesystem=home
- --socket=pulseaudio
- --share=network

modules:
- name: Processing
buildsystem: simple
build-commands:
# Unpack Processing deb
- ar x processing.deb
- tar --zstd -xf data.tar.zst
- mv opt/processing/* /app/
- find /app/lib/app/resources/jdk/bin -type f -exec chmod +x {} +

# Install the desktop file and icon
- install -D /app/lib/processing-Processing.desktop /app/share/applications/org.processing.pde.desktop
- sed -i 's/^Icon=.*/Icon=org.processing.pde/' /app/share/applications/org.processing.pde.desktop
- sed -i 's/^Exec=.*/Exec=\/app\/bin\/Processing/' /app/share/applications/org.processing.pde.desktop

# Install the mimetype info
- install -D /app/lib/processing-Processing-MimeInfo.xml /app/share/mime/packages/org.processing.pde.xml

# - install -D /app/lib/Processing.png /app/share/icons/hicolor/512x512/apps/org.processing.pde.png
- install -D /app/lib/application-x-processing.png /app/share/icons/hicolor/512x512/mimetypes/org.processing.pde-text-x-processing.png

sources:
- type: file
path: ../build/compose/binaries/main/deb/processing_1.0.0-1_amd64.deb
dest-filename: processing.deb
42 changes: 42 additions & 0 deletions app/linux/snapcraft.base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: $name
version: $version
base: core22
summary: A creative coding editor
description: |
Processing is a flexible software sketchbook and a programming language designed for learning how to code.
confinement: $confinement

apps:
processing:
command: opt/processing/bin/Processing
desktop: opt/processing/lib/processing-Processing.desktop
environment:
LD_LIBRARY_PATH: $SNAP/opt/processing/lib/runtime/lib:$LD_LIBRARY_PATH
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
# PLUGS START
plugs:
- desktop
- desktop-legacy
- wayland
- x11
- network
- opengl
- home
- removable-media
- audio-playback
- audio-record
- pulseaudio
- gpio
# PLUGS END

parts:
processing:
plugin: dump
source: deb/processing_$version-1_$arch.deb
source-type: deb
stage-packages:
- openjdk-17-jre
override-prime: |
snapcraftctl prime
rm -vf usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts
chmod -R +x opt/processing/lib/app/resources/jdk
69 changes: 35 additions & 34 deletions build/linux/processing-pde.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,42 @@
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/x-processing">
<comment>Processing source code</comment>
<comment xml:lang="ara">شفرة مصدر Processing</comment>
<comment xml:lang="be@latin">Kryničny kod Processing</comment>
<comment xml:lang="bg">Изходен код на Processing</comment>
<comment xml:lang="ca">codi font en Processing</comment>
<comment xml:lang="da">Processingkildekode</comment>
<comment xml:lang="de">Processing-Quelltext</comment>
<comment xml:lang="el">πηγαίος κώδικας Processing</comment>
<comment xml:lang="en_GB">Processing source code</comment>
<comment xml:lang="eo">Processing-fontkodo</comment>
<comment xml:lang="es">código fuente en Processing</comment>
<comment xml:lang="eu">Processing iturburu-kodea</comment>
<comment xml:lang="fi">Processing-lähdekoodi</comment>
<comment xml:lang="fr">code source Processing</comment>
<comment xml:lang="ga">cód foinseach Processing</comment>
<comment xml:lang="hu">Processing-forráskód</comment>
<comment xml:lang="id">Kode program Processing</comment>
<comment xml:lang="it">Codice sorgente Processing</comment>
<comment xml:lang="ja">Processing ソースコード</comment>
<comment xml:lang="lt">Processing pradinis kodas</comment>
<comment xml:lang="lv">Processing pirmkods</comment>
<comment xml:lang="ms">Kod sumber Processing</comment>
<comment xml:lang="nb">Processing-kildekode</comment>
<comment xml:lang="nl">Processing-broncode</comment>
<comment xml:lang="nn">Processing-kjeldekode</comment>
<comment xml:lang="pl">Kod źródłowy Processing</comment>
<comment xml:lang="pt">código fonte Processing</comment>
<comment xml:lang="pt_BR">Código fonte Processing</comment>
<comment xml:lang="ru">исходный код Processing</comment>
<comment xml:lang="sq">Kod burues Processing</comment>
<comment xml:lang="sv">Processing-källkod</comment>
<comment xml:lang="uk">Вихідний код на мові Processing</comment>
<comment xml:lang="vi">Mã nguồn Processing</comment>
<comment xml:lang="zh_CN">Processing 源代码</comment>
<comment xml:lang="zh_TW">Processing 源代碼</comment>
<comment xml:lang="ara">شفرة مصدر Processing</comment>
<comment xml:lang="be@latin">Kryničny kod Processing</comment>
<comment xml:lang="bg">Изходен код на Processing</comment>
<comment xml:lang="ca">codi font en Processing</comment>
<comment xml:lang="da">Processingkildekode</comment>
<comment xml:lang="de">Processing-Quelltext</comment>
<comment xml:lang="el">πηγαίος κώδικας Processing</comment>
<comment xml:lang="en_GB">Processing source code</comment>
<comment xml:lang="eo">Processing-fontkodo</comment>
<comment xml:lang="es">código fuente en Processing</comment>
<comment xml:lang="eu">Processing iturburu-kodea</comment>
<comment xml:lang="fi">Processing-lähdekoodi</comment>
<comment xml:lang="fr">code source Processing</comment>
<comment xml:lang="ga">cód foinseach Processing</comment>
<comment xml:lang="hu">Processing-forráskód</comment>
<comment xml:lang="id">Kode program Processing</comment>
<comment xml:lang="it">Codice sorgente Processing</comment>
<comment xml:lang="ja">Processing ソースコード</comment>
<comment xml:lang="lt">Processing pradinis kodas</comment>
<comment xml:lang="lv">Processing pirmkods</comment>
<comment xml:lang="ms">Kod sumber Processing</comment>
<comment xml:lang="nb">Processing-kildekode</comment>
<comment xml:lang="nl">Processing-broncode</comment>
<comment xml:lang="nn">Processing-kjeldekode</comment>
<comment xml:lang="pl">Kod źródłowy Processing</comment>
<comment xml:lang="pt">código fonte Processing</comment>
<comment xml:lang="pt_BR">Código fonte Processing</comment>
<comment xml:lang="ru">исходный код Processing</comment>
<comment xml:lang="sq">Kod burues Processing</comment>
<comment xml:lang="sv">Processing-källkod</comment>
<comment xml:lang="uk">Вихідний код на мові Processing</comment>
<comment xml:lang="vi">Mã nguồn Processing</comment>
<comment xml:lang="zh_CN">Processing 源代码</comment>
<comment xml:lang="zh_TW">Processing 源代碼</comment>
<sub-class-of type="text/x-csrc"/>
<glob pattern="*.pde"/>
<icon name="org.processing.pde-text-x-processing" />
</mime-type>
</mime-info>
19 changes: 19 additions & 0 deletions build/shared/lib/icons/app-linux.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading