Skip to content

Commit f777f36

Browse files
committed
snapcraft.yaml.template
1 parent 50084a7 commit f777f36

File tree

9 files changed

+301
-85
lines changed

9 files changed

+301
-85
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Continous Integration
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- run: ./set-eclipse-package.sh
15+
env:
16+
ECLIPSE_PACKAGE: eclipse-java
17+
- uses: snapcore/action-build@v1

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Store Publishing
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
platform:
17+
- amd64
18+
- arm64
19+
steps:
20+
- uses: actions/checkout@v4
21+
- run: ./set-eclipse-package.sh
22+
env:
23+
ECLIPSE_PACKAGE: eclipse-java
24+
- uses: docker/setup-qemu-action@v3
25+
- uses: diddlesnaps/snapcraft-multiarch-action@v1
26+
id: snapcraft
27+
with:
28+
architecture: ${{ matrix.platform }}
29+
- uses: snapcore/action-publish@v1
30+
env:
31+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
32+
with:
33+
snap: ${{ steps.snapcraft.outputs.snap }}
34+
release: stable

eclipse-packages.yaml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
# all sources should have &r=1 amended
22
latest: 2024-12R
33
2024-12R:
4-
eclipse-pde:
5-
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-12/R/eclipse-committers-2024-12-R-linux-gtk-x86_64.tar.gz&r=1
6-
checksum: "sha512/133dfeb699fe604c24d96ec521dfb201196505eaceaefd62f1d00e5d87953ee224839f113a1603c4c8dfec433155827c2d175a5ad838e6d32a7dd477a728c620"
7-
2024-06R:
8-
eclipse-java:
9-
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-06/R/eclipse-jee-2024-06-R-linux-gtk-x86_64.tar.gz&r=1
10-
checksum: "sha512/02c1c43326e8e38dd2611268123c6cab2fd918b41d6707cef8bbf81f8f445249e6aae91817b9ff4446c937b3371caf9eb2647b32612997a4fb102cc8d76c4569"
11-
eclipse-pde:
12-
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-06/R/eclipse-committers-2024-06-R-linux-gtk-x86_64.tar.gz&r=1
13-
checksum: "sha512/85e351244bbbdd8fb4e62a6de96714d081f0ce6d8f926f0e8e72e2dc02b86151a0cd6851801987f850d52eae47189c38cd74423c669c48a8ec8af682416ed656"
14-
2024-03R:
154
eclipse-java:
16-
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-java-2024-03-R-linux-gtk-x86_64.tar.gz&r=1
17-
checksum: "sha512/973c94a0a029c29d717823a53c3a65f99fa53d51f605872c5dd854620e16cd4cb2c2ff8a5892cd550a70ab19e1a0a0d2e792661e936bd3d2bef4532bc533048b"
5+
amd64:
6+
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-12/R/eclipse-java-2024-12-R-linux-gtk-x86_64.tar.gz&r=1
7+
checksum: "sha512/dae3fdace259f237afaadad98ac3c16bf571eb7e2704200e5159de9a6bde594c4112e983dd0eac3c35c0fd5325f1cf9d798e2fd511a5059fc02ceca71391927c"
8+
arm64:
9+
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-12/R/eclipse-java-2024-12-R-linux-gtk-aarch64.tar.gz&r=1
10+
checksum: "sha512/03f0cd430c106995396acd4cb9a59037174bab75eee0089521b4872281b837c1ed5e6975d8e942ff96419ef4c87158fd4f0936f7dac2d6229197c4c79ef337f1"
1811
eclipse-pde:
19-
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-committers-2024-03-R-linux-gtk-x86_64.tar.gz&r=1
20-
checksum: "sha512/db836b79a79ac2f8981d9a7f3bd988368fa807bf06526c6e145c9c0835458283b5625a2aec7e7c84c3bb1b5bdcb121423e9eec1890bb431d1754829f8f060742"
21-
eclipse-cdt:
22-
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz&r=1
23-
checksum: "sha512/ebbde32b16fbd49716c3d5fef40fe6e510115f1698cf35f9fde23f11ba2be11a524d6e5179b15a1cf30af135b8f27a3efac301111b6160e6cdac9977a42082fd"
12+
amd64:
13+
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-12/R/eclipse-committers-2024-12-R-linux-gtk-x86_64.tar.gz&r=1
14+
checksum: "sha512/133dfeb699fe604c24d96ec521dfb201196505eaceaefd62f1d00e5d87953ee224839f113a1603c4c8dfec433155827c2d175a5ad838e6d32a7dd477a728c620"
15+
arm64:
16+
source: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-12/R/eclipse-committers-2024-12-R-linux-gtk-aarch64.tar.gz&r=1
17+
checksum: "sha512/a1bef6fc804d37e1d3638ffb5d3490b61606cd30977a2918a4f035853a8a241283a68de9cd15bc61e23e95557095f5543e31ca14b2ec2358bdc70d8b9d700dde"

set-eclipse-package.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ echo source-root: $SOURCE
44

55
export ECLIPSE_PACKAGE=${ECLIPSE_PACKAGE:='eclipse-java'}
66
echo setting up for $ECLIPSE_PACKAGE
7+
export ECLIPSE_CONFINED=${ECLIPSE_CONFINED:=false}
8+
echo confinedment is enabled? $ECLIPSE_CONFINED
79

810
SNAPCRAFT_YAML=$SOURCE/snap/snapcraft.yaml
11+
if $ECLIPSE_CONFINED; then
12+
SNAPCRAFT_YAML_TEMPLATE=snapcraft.yaml.template_confined
13+
else
14+
SNAPCRAFT_YAML_TEMPLATE=snapcraft.yaml.template
15+
fi
916

10-
YGLU_ENABLE_ENV=true pipx run --pip-args "-r requirements.txt" yglu snapcraft.yaml.template | tee $SNAPCRAFT_YAML
17+
YGLU_ENABLE_ENV=true pipx run --pip-args "-r requirements.txt" yglu $SNAPCRAFT_YAML_TEMPLATE | tee $SNAPCRAFT_YAML
1118

1219
if [ $? -eq 0 ]; then
1320
echo written $SNAPCRAFT_YAML for $ECLIPSE_PACKAGE.

snap/gui/eclipse.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Version=1.0
33
Type=Application
44
Name=Eclipse
5-
Icon=${SNAP}/icon.xpm
5+
Icon=usr/lib/eclipse/icon.xpm
66
Exec=bin/eclipse-wrapper %f
77
Comment=Eclipse IDE
88
Categories=Development;IDE;

snap/local/wrappers/eclipse_confined

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# will update eclipse.home.location and eclipse.p2.data.area towards $SNAP_USER_DATA
4+
## will update on every execution to go along latest revision x1, x2, ...
5+
ECLIPSE_INI=$SNAP_USER_DATA/eclipse.ini
6+
7+
cp $SNAP/usr/lib/eclipse/eclipse.ini $ECLIPSE_INI
8+
chmod 666 $ECLIPSE_INI
9+
10+
mkdir -p $SNAP_USER_DATA/eclipse_home
11+
echo -Declipse.home.location=file:$SNAP_USER_DATA/eclipse_home | tee -a $ECLIPSE_INI
12+
mkdir -p $SNAP_USER_DATA/p2_data
13+
echo -Declipse.p2.data.area=te$SNAP_USER_DATA/p2_data | tee -a $ECLIPSE_INI
14+
15+
EXTRA_ARGS+=("--launcher.ini" "$ECLIPSE_INI")
16+
17+
# get .gitconfig mapped
18+
ln -sf $SNAP_REAL_HOME/.gitconfig ~/.gitconfig
19+
ln -sf $SNAP_REAL_HOME/.ssh ~/.ssh
20+
21+
22+
# see snap plug personal-workspace
23+
ECLIPSE_WORKSPACE=/home/$USER/eclipse-workspace
24+
echo Using workspace at $ECLIPSE_WORKSPACE.
25+
26+
exec "$SNAP/eclipse" -configuration "${SNAP_USER_DATA}/${SNAP_ARCH}/configuration" -data "$ECLIPSE_WORKSPACE" "${EXTRA_ARGS[@]}" "$@"

snapcraft.yaml.template

Lines changed: 62 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
ename: !- $env[ECLIPSE_PACKAGE]
2+
<<<<<<< HEAD
23
name: !? .ename
34
base: core24
45

56
epackages: !- $import('eclipse-packages.yaml')
67
version: !? .epackages.latest
78

89
summary: Extensible Tool Platform and Java IDE
10+
=======
11+
epackages: !- $import('eclipse-packages.yaml')
12+
13+
name: !? .ename
14+
base: core22
15+
16+
version: !? .epackages.latest
17+
18+
summary: Extensible Tool Platform and Java IDE
19+
website: https://eclipse.org/ide
20+
>>>>>>> a6f9f55 (snapcraft.yaml.template)
921
description:
1022
Eclipse provides IDEs and platforms for nearly every language and architecture.
1123
We are famous for our Java IDE, C/C++, JavaScript and PHP IDEs built on extensible
1224
platforms for creating desktop, Web and cloud IDEs. These platforms deliver the most
1325
extensive collection of add-on tools available for software developers.
1426

1527
grade: stable
28+
<<<<<<< HEAD
1629
confinement: strict
1730

1831
compression: lzo
@@ -24,63 +37,61 @@ platforms:
2437
lint:
2538
ignore:
2639
- library
40+
=======
41+
confinement: classic
42+
43+
architectures: # TODO use for loop here
44+
- build-on: amd64
45+
- build-on: arm64
46+
>>>>>>> a6f9f55 (snapcraft.yaml.template)
2747

2848
apps:
2949
!? .ename:
3050
command: bin/eclipse-wrapper
31-
extensions: [gnome]
32-
desktop: eclipse.desktop
33-
environment:
34-
## https://docs.gtk.org/glib/running.html#environment-variables
35-
G_MESSAGES_DEBUG: all
36-
## https://docs.mesa3d.org/envvars.html
37-
LIBGL_DEBUG: 1
38-
DRI_PRIME_DEBUG: 1
39-
MESA_DEBUG: 1
40-
MESA_VK_DEVICE_SELECT_DEBUG: 1
41-
# AMD_DEBUG: all
42-
## https://trac.webkit.org/wiki/EnvironmentVariables
43-
WEBKIT_DEBUG: all
44-
plugs:
45-
- personal-sourcedir
46-
- personal-workspace
47-
- personal-gitconfig
48-
- personal-sshid
49-
- personal-maven-cache
50-
- network
51-
52-
plugs:
53-
personal-sourcedir:
54-
interface: personal-files
55-
write:
56-
- $HOME/projs
57-
personal-workspace:
58-
interface: personal-files
59-
write:
60-
- $HOME/eclipse-workspace
61-
personal-gitconfig:
62-
interface: personal-files
63-
write:
64-
- $HOME/.gitconfig
65-
personal-sshid:
66-
interface: ssh-keys
67-
personal-maven-cache:
68-
interface: personal-files
69-
write:
70-
- $HOME/.m2
7151

7252
parts:
7353
eclipse:
7454
plugin: dump
7555
source-type: tar
76-
source: !? $_.epackages[$_.version][$_.name].source
77-
source-checksum: !? $_.epackages[$_.version][$_.name].checksum
56+
source: # TODO use for loop here
57+
- on amd64: !? .epackages[$_.version][$_.name].amd64.source
58+
- on arm64: !? .epackages[$_.version][$_.name].arm64.source
59+
# TODO use source-checksum once supported in multiarch setting
60+
organize:
61+
'configuration': 'usr/lib/eclipse/configuration'
62+
'dropins': 'usr/lib/eclipse/dropins'
63+
'features': 'usr/lib/eclipse/features'
64+
'p2': 'usr/lib/eclipse/p2'
65+
'plugins': 'usr/lib/eclipse/plugins'
66+
'readme': 'usr/lib/eclipse/readme'
67+
'.eclipseproduct': 'usr/lib/eclipse/.eclipseproduct'
68+
'artifacts.xml': 'usr/lib/eclipse/artifacts.xml'
69+
'eclipse': 'usr/lib/eclipse/eclipse'
70+
'eclipse.ini': 'usr/lib/eclipse/eclipse.ini'
71+
'icon.xpm': 'usr/lib/eclipse/icon.xpm'
7872
build-attributes:
7973
- no-patchelf
80-
permissions:
81-
- mode: "555"
82-
after:
83-
- eclipse_deps
74+
stage-packages:
75+
- libffi7
76+
- libfreetype6
77+
- libpng16-16
78+
- libgdk-pixbuf2.0-0
79+
- libsecret-1-0
80+
- libasound2
81+
- libxi6
82+
- libxrender1
83+
- libxtst6
84+
override-prime: |
85+
craftctl default
86+
find $SNAPCRAFT_PRIME/usr/lib/eclipse/ -type d -exec chmod 755 {} \;
87+
find $SNAPCRAFT_PRIME/usr/lib/eclipse/ -type f -exec chmod 644 {} \;
88+
find $SNAPCRAFT_PRIME/usr/lib/eclipse/ -type f -exec chmod +x {} \;
89+
rm -r $SNAPCRAFT_PRIME/usr/lib/eclipse/plugins/com.sun.jna_*v*/com/sun/jna/aix*/
90+
rm -r $SNAPCRAFT_PRIME/usr/lib/eclipse/plugins/com.sun.jna_*v*/com/sun/jna/darwin*/
91+
rm -r $SNAPCRAFT_PRIME/usr/lib/eclipse/plugins/com.sun.jna_*v*/com/sun/jna/freebsd*/
92+
rm -r $SNAPCRAFT_PRIME/usr/lib/eclipse/plugins/com.sun.jna_*v*/com/sun/jna/openbsd*/
93+
rm -r $SNAPCRAFT_PRIME/usr/lib/eclipse/plugins/com.sun.jna_*v*/com/sun/jna/sunos*/
94+
rm -r $SNAPCRAFT_PRIME/usr/lib/eclipse/plugins/com.sun.jna_*v*/com/sun/jna/win32*/
8495
wrappers:
8596
plugin: dump
8697
source: snap/local/wrappers
@@ -89,15 +100,9 @@ parts:
89100
eclipse_desktop:
90101
plugin: dump
91102
source: snap/gui
92-
eclipse_deps:
93-
plugin: nil
94-
stage-snaps:
95-
- git-confined
96103

97-
layout:
98-
/usr/local/bin:
99-
bind: $SNAP/usr/bin
100-
/usr/libexec/git-core:
101-
symlink: $SNAP/usr/libexec/git-core
102-
/usr/share/git-core:
103-
symlink: $SNAP/usr/share/git-core
104+
lint:
105+
ignore:
106+
- classic # confinement paradoxon
107+
- library:
108+
- usr/lib/**/*.so*

0 commit comments

Comments
 (0)