Skip to content

Commit 4d80ce1

Browse files
committed
Snap fixes
[skip ci]
1 parent 10d878e commit 4d80ce1

File tree

5 files changed

+64
-70
lines changed

5 files changed

+64
-70
lines changed

.github/workflows/release-gradle.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,4 @@ jobs:
173173

174174
- name: Upload pkg to App Store
175175
if: runner.os == 'macOS'
176-
run: |
177-
xcrun altool
178-
--upload-package app/build/compose/binaries/main/pkg/Processing-${{ needs.version.outputs.version }}.pkg
179-
--type macos
180-
--asc-public-id ${{ secrets.PROCESSING_STORE_PUBLIC_ID }}
181-
--apple-id ${{ secrets.PROCESSING_STORE_APP_ID }}
182-
--bundle-id ${{ vars.GRADLE_GROUP }}.app
183-
--bundle-short-version-string ${{ needs.version.outputs.version }}
184-
--bundle-version ${{ needs.version.outputs.version }}
185-
--username ${{ secrets.PROCESSING_APPLE_ID }}
186-
--password ${{ secrets.PROCESSING_APP_PASSWORD }}
176+
run: xcrun altool --upload-package app/build/compose/binaries/main/pkg/Processing-${{ needs.version.outputs.version }}.pkg --type macos --asc-public-id ${{ secrets.PROCESSING_STORE_PUBLIC_ID }} --apple-id ${{ secrets.PROCESSING_STORE_APP_ID }} --bundle-id ${{ vars.GRADLE_GROUP }}.app --bundle-short-version-string ${{ needs.version.outputs.version }} --bundle-version ${{ needs.version.outputs.version }} --username ${{ secrets.PROCESSING_APPLE_ID }} --password ${{ secrets.PROCESSING_APP_PASSWORD }}

app/build.gradle.kts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ compose.desktop {
5050

5151
nativeDistributions{
5252
modules("jdk.jdi", "java.compiler", "jdk.accessibility")
53-
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
53+
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb, TargetFormat.Pkg)
5454
packageName = "Processing"
5555

5656
macOS{
@@ -162,23 +162,23 @@ tasks.register<Exec>("packageCustomDmg"){
162162
app
163163
)
164164
}
165-
tasks.register<Exec>("packagePkg"){
166-
onlyIf { org.gradle.internal.os.OperatingSystem.current().isMacOsX }
167-
dependsOn("createDistributable")
168-
group = "compose desktop"
169-
val distributable = tasks.named<AbstractJPackageTask>("createDistributable").get()
170-
val app = distributable.destinationDir.get().file("${distributable.packageName.get()}.app").asFile
171-
val target = app.parentFile.parentFile.resolve("pkg/${distributable.packageName.get()}-$version.pkg")
172-
target.parentFile.mkdirs()
173-
174-
commandLine("pkgbuild",
175-
"--install-location", "/Applications",
176-
"--identifier", "${rootProject.group}.app",
177-
"--version", version,
178-
"--component", app,
179-
target
180-
)
181-
}
165+
//tasks.register<Exec>("packagePkg"){
166+
// onlyIf { org.gradle.internal.os.OperatingSystem.current().isMacOsX }
167+
// dependsOn("createDistributable")
168+
// group = "compose desktop"
169+
// val distributable = tasks.named<AbstractJPackageTask>("createDistributable").get()
170+
// val app = distributable.destinationDir.get().file("${distributable.packageName.get()}.app").asFile
171+
// val target = app.parentFile.parentFile.resolve("pkg/${distributable.packageName.get()}-$version.pkg")
172+
// target.parentFile.mkdirs()
173+
//
174+
// commandLine("pkgbuild",
175+
// "--install-location", "/Applications",
176+
// "--identifier", "${rootProject.group}.app",
177+
// "--version", version,
178+
// "--component", app,
179+
// target
180+
// )
181+
//}
182182

183183
tasks.register<Exec>("packageCustomMsi"){
184184
onlyIf { org.gradle.internal.os.OperatingSystem.current().isWindows }
@@ -223,21 +223,25 @@ tasks.register("generateSnapConfiguration"){
223223
command: opt/processing/bin/Processing
224224
desktop: opt/processing/lib/processing-Processing.desktop
225225
environment:
226-
LD_LIBRARY_PATH: ${'$'}SNAP/lib:${'$'}LD_LIBRARY_PATH
226+
LD_LIBRARY_PATH: ${'$'}SNAPopt/processing/lib/runtime/lib:${'$'}LD_LIBRARY_PATH
227227
plugs:
228228
- desktop
229229
- desktop-legacy
230230
- wayland
231231
- x11
232+
- network
232233
233234
parts:
234235
processing:
235236
plugin: dump
236237
source: deb/processing_$version-1_$snaparch.deb
237238
source-type: deb
239+
stage-packages:
240+
- openjdk-17-jdk
238241
override-prime: |
239242
snapcraftctl prime
240243
chmod -R +x opt/processing/lib/app/resources/jdk-*
244+
rm -vf usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts
241245
""".trimIndent()
242246
dir.file("../snapcraft.yaml").asFile.writeText(content)
243247
}

app/src/processing/app/Platform.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -578,17 +578,17 @@ static public boolean deleteFile(File file) throws IOException {
578578
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
579579

580580

581-
static public void setenv(String variable, String value) {
582-
inst.setenv(variable, value);
583-
}
584-
585-
586-
static public String getenv(String variable) {
587-
return inst.getenv(variable);
588-
}
589-
590-
591-
static public int unsetenv(String variable) {
592-
return inst.unsetenv(variable);
593-
}
581+
// static public void setenv(String variable, String value) {
582+
// inst.setenv(variable, value);
583+
// }
584+
//
585+
//
586+
// static public String getenv(String variable) {
587+
// return inst.getenv(variable);
588+
// }
589+
//
590+
//
591+
// static public int unsetenv(String variable) {
592+
// return inst.unsetenv(variable);
593+
// }
594594
}

app/src/processing/app/platform/DefaultPlatform.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -257,31 +257,31 @@ public void openFolder(File file) throws Exception {
257257
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
258258

259259

260-
public interface CLibrary extends Library {
261-
CLibrary INSTANCE = Native.load("c", CLibrary.class);
262-
int setenv(String name, String value, int overwrite);
263-
String getenv(String name);
264-
int unsetenv(String name);
265-
int putenv(String string);
266-
}
267-
268-
269-
public void setenv(String variable, String value) {
270-
CLibrary clib = CLibrary.INSTANCE;
271-
clib.setenv(variable, value, 1);
272-
}
273-
274-
275-
public String getenv(String variable) {
276-
CLibrary clib = CLibrary.INSTANCE;
277-
return clib.getenv(variable);
278-
}
279-
280-
281-
public int unsetenv(String variable) {
282-
CLibrary clib = CLibrary.INSTANCE;
283-
return clib.unsetenv(variable);
284-
}
260+
// public interface CLibrary extends Library {
261+
// CLibrary INSTANCE = Native.load("c", CLibrary.class);
262+
// int setenv(String name, String value, int overwrite);
263+
// String getenv(String name);
264+
// int unsetenv(String name);
265+
// int putenv(String string);
266+
// }
267+
//
268+
//
269+
// public void setenv(String variable, String value) {
270+
// CLibrary clib = CLibrary.INSTANCE;
271+
// clib.setenv(variable, value, 1);
272+
// }
273+
//
274+
//
275+
// public String getenv(String variable) {
276+
// CLibrary clib = CLibrary.INSTANCE;
277+
// return clib.getenv(variable);
278+
// }
279+
//
280+
//
281+
// public int unsetenv(String variable) {
282+
// CLibrary clib = CLibrary.INSTANCE;
283+
// return clib.unsetenv(variable);
284+
// }
285285

286286

287287
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

app/src/processing/app/platform/LinuxPlatform.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
public class LinuxPlatform extends DefaultPlatform {
36-
String homeDir;
36+
String homeDir = "~";
3737

3838

3939
public void initBase(Base base) {
@@ -98,7 +98,7 @@ public File getSettingsFolder() throws Exception {
9898
File configHome = null;
9999

100100
// Check to see if the user has set a different location for their config
101-
String configHomeEnv = getenv("XDG_CONFIG_HOME");
101+
String configHomeEnv = System.getenv("XDG_CONFIG_HOME");
102102
if (configHomeEnv != null && !configHomeEnv.isBlank()) {
103103
configHome = new File(configHomeEnv);
104104
if (!configHome.exists()) {

0 commit comments

Comments
 (0)