Skip to content

Commit 26e4593

Browse files
author
DBChoco
committed
downgraded java version & changed pom.xml (for flatpak)
1 parent c153bf1 commit 26e4593

File tree

5 files changed

+126
-18
lines changed

5 files changed

+126
-18
lines changed

Salawat.desktop

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Categories=Utility;Eduction;
3+
Exec=salawat
4+
GenericName=Prayer times (adhan) app
5+
Icon=io.github.dbchoco.Salawat
6+
Keywords=athan;azan;adhan;islam;prayer;
7+
Name=Salawat
8+
StartupNotify=true
9+
StartupWMClass=salawat
10+
Terminal=false
11+
Type=Application

dependency-reduced-pom.xml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>io.github.dbchoco</groupId>
55
<artifactId>Salawat</artifactId>
66
<name>Salawat</name>
7-
<version>1.0</version>
7+
<version>1.0.0</version>
88
<description>Prayer times (Adhan) app that is higly customizable and light weight.
99
Available for Windows and GNU/Linux.</description>
1010
<organization>
@@ -17,8 +17,8 @@
1717
<artifactId>maven-compiler-plugin</artifactId>
1818
<version>3.9.0</version>
1919
<configuration>
20-
<source>18</source>
21-
<target>18</target>
20+
<source>17</source>
21+
<target>17</target>
2222
</configuration>
2323
</plugin>
2424
<plugin>
@@ -71,13 +71,14 @@
7171
</goals>
7272
<configuration>
7373
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
74-
<bundleJre>false</bundleJre>
75-
<copyDependencies>false</copyDependencies>
74+
<bundleJre>true</bundleJre>
75+
<copyDependencies>true</copyDependencies>
7676
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
7777
<generateInstaller>true</generateInstaller>
7878
<administratorRequired>false</administratorRequired>
7979
<createTarball>true</createTarball>
8080
<platform>auto</platform>
81+
<additionalResources>Salawat.desktop</additionalResources>
8182
<linuxConfig>
8283
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
8384
</linuxConfig>
@@ -107,6 +108,40 @@
107108
</plugin>
108109
</plugins>
109110
</build>
111+
<profiles>
112+
<profile>
113+
<id>flatpak</id>
114+
<build>
115+
<plugins>
116+
<plugin>
117+
<groupId>io.github.fvarrui</groupId>
118+
<artifactId>javapackager</artifactId>
119+
<version>1.6.6</version>
120+
<executions>
121+
<execution>
122+
<configuration>
123+
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
124+
<bundleJre>true</bundleJre>
125+
<copyDependencies>true</copyDependencies>
126+
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
127+
<generateInstaller>true</generateInstaller>
128+
<administratorRequired>false</administratorRequired>
129+
<createTarball>true</createTarball>
130+
<platform>auto</platform>
131+
<additionalResources>Salawat.desktop</additionalResources>
132+
<linuxConfig>
133+
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
134+
<generateDeb>false</generateDeb>
135+
<generateRpm>false</generateRpm>
136+
</linuxConfig>
137+
</configuration>
138+
</execution>
139+
</executions>
140+
</plugin>
141+
</plugins>
142+
</build>
143+
</profile>
144+
</profiles>
110145
<dependencies>
111146
<dependency>
112147
<groupId>org.junit.jupiter</groupId>

flathub/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.flatpak-builder
2+
dist

flathub/io.github.dbchoco.Salawat.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,55 @@ app-id: io.github.dbchoco.Salawat
22
runtime: org.freedesktop.Platform
33
runtime-version: '21.08'
44
sdk: org.freedesktop.Sdk
5+
sdk-extensions:
6+
- org.freedesktop.Sdk.Extension.openjdk17
57
command: salawat
68
separate-locales: false
79
finish-args:
810
- --share=ipc
911
- --socket=x11
1012
- --socket=pulseaudio
1113
- --share=network
14+
- --env=PATH=/app/jre/bin:/app/bin:/usr/bin
15+
- --env=JAVA_HOME=/app/jre
1216

1317
modules:
1418
- name: salawat
1519
buildsystem: simple
20+
build-options:
21+
env:
22+
PATH: /app/bin:/usr/bin:/usr/lib/sdk/openjdk17/bin
23+
MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
24+
JAVA_HOME: /usr/lib/sdk/openjdk17/jvm/openjdk-17
1625
build-commands:
1726
- install --directory --mode=0755 /app/salawat
18-
- install -Dm644 --target-directory=/app/salawat/ Salawat/*
27+
- cp -r Salawat/* /app/salawat/
1928
- install -Dm755 salawat.sh /app/bin/salawat
20-
- ls Salawat/
21-
- install -Dm644 Salawat/icon.png /app/share/icons/hicolor/128x128/apps/$FLATPAK_ID.png
29+
- install -Dm644 Salawat/icon.png /app/share/icons/hicolor/512x512/apps/$FLATPAK_ID.png
2230
- install -Dm644 Salawat/Salawat.desktop /app/share/applications/${FLATPAK_ID}.desktop
23-
- install -Dm644 io.github.dbchoco.Salawat.metainfo.xml /app/share/metainfo/$FLATPAK_ID.appdata.xml
31+
- install -Dm644 io.github.dbchoco.Salawat.metainfo.xml /app/share/metainfo/$FLATPAK_ID.metainfo.xml
32+
33+
- mvn clean package -DpackagingPhase=none
34+
- install -Dm755 -t "${FLATPAK_DEST}/bin" "es.estoes.wallpaperDownloader.sh"
35+
- install -Dm644 -t "${FLATPAK_DEST}/share/es.estoes.wallpaperDownloader" "target/wallpaperdownloader.jar"
36+
- install -Dm644 "deb/wallpaperdownloader.desktop" "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
37+
- install -Dm644 "deb/wallpaperdownloader.svg" "${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/es.estoes.wallpaperDownloader.svg"
38+
- install -Dm644 -t "${FLATPAK_DEST}/share/metainfo" "es.estoes.wallpaperDownloader.metainfo.xml"
39+
- desktop-file-edit --remove-key=Version "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
40+
- desktop-file-edit --set-key=Exec --set-value="${FLATPAK_DEST}/bin/es.estoes.wallpaperDownloader.sh" "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
41+
- desktop-file-edit --set-icon=es.estoes.wallpaperDownloader "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
2442
sources:
2543
- type: archive
26-
url: https://github.com/DBChoco/Salawat/releases/download/v1.0.0/Salawat-1.0-linux.tar.gz
27-
sha256: 59820046b3f3acd6aaefb6080c7c7e078fc8777d508022d6004d66cb2ac975fb
44+
url: https://github.com/DBChoco/Salawat/releases/download/v1.0.0/Salawat-1.0.0-linux.tar.gz
45+
sha256: 1fcc9201e9456e55a5cb40d53cad7aca4dd52784334ac1e912a75193ee9f09c9
2846
dest: Salawat
2947
- type: file
3048
path: io.github.dbchoco.Salawat.metainfo.xml
3149
- type: file
3250
path: salawat.sh
33-
51+
- maven-dependencies.yaml
52+
modules:
53+
- name: openjdk
54+
buildsystem: simple
55+
build-commands:
56+
- /usr/lib/sdk/openjdk17/install.sh

pom.xml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.dbchoco</groupId>
88
<artifactId>Salawat</artifactId>
9-
<version>1.0</version>
9+
<version>1.0.0</version>
1010
<name>Salawat</name>
1111
<description>Prayer times (Adhan) app that is higly customizable and light weight.
1212
Available for Windows and GNU/Linux.</description>
@@ -79,8 +79,8 @@
7979
<artifactId>maven-compiler-plugin</artifactId>
8080
<version>3.9.0</version>
8181
<configuration>
82-
<source>18</source>
83-
<target>18</target>
82+
<source>17</source>
83+
<target>17</target>
8484
</configuration>
8585
</plugin>
8686
<plugin>
@@ -140,13 +140,14 @@
140140
<!-- mandatory -->
141141
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
142142
<!-- optional -->
143-
<bundleJre>false</bundleJre>
144-
<copyDependencies>false</copyDependencies>
143+
<bundleJre>true</bundleJre>
144+
<copyDependencies>true</copyDependencies>
145145
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
146146
<generateInstaller>true</generateInstaller>
147147
<administratorRequired>false</administratorRequired>
148148
<createTarball>true</createTarball>
149149
<platform>auto</platform>
150+
<additionalResources>Salawat.desktop</additionalResources>
150151

151152
<linuxConfig>
152153
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
@@ -184,7 +185,43 @@
184185
</execution>
185186
</executions>
186187
</plugin>
187-
188188
</plugins>
189189
</build>
190+
<profiles>
191+
<profile>
192+
<id>flatpak</id>
193+
<build>
194+
<plugins>
195+
<plugin>
196+
<groupId>io.github.fvarrui</groupId>
197+
<artifactId>javapackager</artifactId>
198+
<version>1.6.6</version>
199+
<executions>
200+
<execution>
201+
<configuration>
202+
<!-- mandatory -->
203+
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
204+
<!-- optional -->
205+
<bundleJre>true</bundleJre>
206+
<copyDependencies>true</copyDependencies>
207+
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
208+
<generateInstaller>true</generateInstaller>
209+
<administratorRequired>false</administratorRequired>
210+
<createTarball>false</createTarball>
211+
<platform>auto</platform>
212+
<additionalResources>Salawat.desktop</additionalResources>
213+
<linuxConfig>
214+
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
215+
<generateDeb>false</generateDeb>
216+
<generateRpm>false</generateRpm>
217+
</linuxConfig>
218+
</configuration>
219+
</execution>
220+
</executions>
221+
</plugin>
222+
</plugins>
223+
</build>
224+
<!-- https://github.com/fvarrui/JavaPackager -->
225+
</profile>
226+
</profiles>
190227
</project>

0 commit comments

Comments
 (0)