Skip to content

Commit 1158794

Browse files
committed
snapcraft.yaml.template
1 parent ab8bc96 commit 1158794

File tree

6 files changed

+80
-7
lines changed

6 files changed

+80
-7
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1+
# snapcraft specifics
2+
parts
3+
stage
4+
prime
15
*.snap
6+
.snapcraft
7+
__pycache__
8+
*.pyc
9+
10+
# generated
11+
snap/snapcraft.yaml

eclipse-packages.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# all sources should have &r=1 amended
2+
latest: 2024-12R
3+
2024-12R:
4+
eclipse-java:
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+
eclipse-pde:
9+
amd64:
10+
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
11+
checksum: "sha512/133dfeb699fe604c24d96ec521dfb201196505eaceaefd62f1d00e5d87953ee224839f113a1603c4c8dfec433155827c2d175a5ad838e6d32a7dd477a728c620"

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
yglu
2+
setuptools

set-eclipse-package.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
SOURCE=$(dirname -- ${BASH_SOURCE[0]})
3+
echo source-root: $SOURCE
4+
5+
export ECLIPSE_PACKAGE=${ECLIPSE_PACKAGE:='eclipse-java'}
6+
echo setting up for $ECLIPSE_PACKAGE
7+
export ECLIPSE_ARCH=${ECLIPSE_ARCH:=`dpkg --print-architecture`}
8+
echo target arch is $ECLIPSE_ARCH
9+
10+
SNAPCRAFT_YAML=$SOURCE/snap/snapcraft.yaml
11+
12+
YGLU_ENABLE_ENV=true pipx run --pip-args "-r requirements.txt" yglu snapcraft.yaml.template | tee $SNAPCRAFT_YAML
13+
14+
if [ $? -eq 0 ]; then
15+
echo written $SNAPCRAFT_YAML for $ECLIPSE_PACKAGE.
16+
else
17+
echo ERROR see above.
18+
return 1
19+
fi

snap/snapcraft.yaml renamed to snapcraft.yaml.template

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
name: eclipse
1+
ename: !- $env[ECLIPSE_PACKAGE]
2+
earch: !- $env[ECLIPSE_ARCH]
3+
epackages: !- $import('eclipse-packages.yaml')
4+
5+
name: !? .ename
26
base: core22
37

4-
version: 2024-12
8+
version: !? .epackages.latest
9+
510
summary: Extensible Tool Platform and Java IDE
611
website: https://eclipse.org/ide
712
description:
@@ -18,15 +23,15 @@ architectures:
1823
- build-on: arm64
1924

2025
apps:
21-
eclipse:
26+
!? .ename:
2227
command: bin/eclipse-wrapper
2328

2429
parts:
2530
eclipse:
2631
plugin: dump
27-
source:
28-
- on amd64: https://download.eclipse.org/technology/epp/downloads/release/${SNAPCRAFT_PROJECT_VERSION}/R/eclipse-java-${SNAPCRAFT_PROJECT_VERSION}-R-linux-gtk-x86_64.tar.gz
29-
- on arm64: https://download.eclipse.org/technology/epp/downloads/release/${SNAPCRAFT_PROJECT_VERSION}/R/eclipse-java-${SNAPCRAFT_PROJECT_VERSION}-R-linux-gtk-aarch64.tar.gz
32+
source-type: tar
33+
source: !? $_.epackages[$_.version][$_.name][$_.earch].source
34+
source-checksum: !? $_.epackages[$_.version][$_.name][$_.earch].checksum
3035
organize:
3136
'configuration': 'usr/lib/eclipse/configuration'
3237
'dropins': 'usr/lib/eclipse/dropins'
@@ -70,6 +75,6 @@ parts:
7075

7176
lint:
7277
ignore:
73-
- classic
78+
- classic # open sandbox paradoxon
7479
- library:
7580
- usr/lib/**/*.so*

try-build.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ -n $1 ]; then
5+
ECLIPSE_PACKAGE=$1
6+
fi
7+
8+
export ECLIPSE_PACKAGE=${ECLIPSE_PACKAGE:='eclipse-java'}
9+
export ECLIPSE_ARCH=${ECLIPSE_ARCH:=`dpkg --print-architecture`}
10+
11+
. ./set-eclipse-package.sh
12+
13+
CLEAN=${CLEAN:=false}
14+
15+
if $CLEAN; then
16+
sudo snap remove --purge $ECLIPSE_PACKAGE
17+
snapcraft clean
18+
fi
19+
20+
# sudo less /var/snap/lxd/common/lxd/logs/lxd.log
21+
snapcraft pack --debug
22+
23+
AUTORUN=${AUTORUN:=false}
24+
if $AUTORUN; then
25+
snap run $ECLIPSE_PACKAGE &
26+
fi

0 commit comments

Comments
 (0)