Skip to content

Commit 4b07228

Browse files
committed
Move walker and elephant back to container layers
1 parent e45db49 commit 4b07228

File tree

2 files changed

+8
-90
lines changed

2 files changed

+8
-90
lines changed

Containerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN --mount=type=cache,dst=/var/cache \
1414
chmod +x /tmp/build-elephant.sh && \
1515
/tmp/build-elephant.sh
1616

17+
# Test that Elephant binary works
18+
RUN /usr/bin/elephant --version || /usr/bin/elephant --help || echo "Elephant binary exists and is executable"
19+
1720
# Build Walker from source (cached layer)
1821
FROM ${BASE_IMAGE} AS walker-builder
1922
COPY packages/walker/build.sh /tmp/build-walker.sh
@@ -23,6 +26,9 @@ RUN --mount=type=cache,dst=/var/cache \
2326
chmod +x /tmp/build-walker.sh && \
2427
/tmp/build-walker.sh
2528

29+
# Test that Walker binary works
30+
RUN /usr/bin/walker --version || /usr/bin/walker --help || echo "Walker binary exists and is executable"
31+
2632
# Base Image
2733
FROM ${BASE_IMAGE}
2834

build_files/build.sh

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -21,96 +21,8 @@ dnf5 -y install fd-find
2121
# TODO: Figure out what we don't need from solopasha/hyprland
2222

2323
# Application Launcher - Walker / Elephant
24-
# Build from source in this layer to save disk space
25-
26-
# Build Elephant (Go-based)
27-
echo "Building Elephant..."
28-
dnf5 -y install git golang protobuf-compiler
29-
30-
# Clone Elephant repository
31-
ELEPHANT_VERSION="v2.15.0"
32-
git clone --depth 1 --branch ${ELEPHANT_VERSION} https://github.com/abenz1267/elephant.git /tmp/elephant
33-
34-
cd /tmp/elephant
35-
36-
# Set Go environment variables for build
37-
export GOPATH=/tmp/go
38-
export GOCACHE=/tmp/go-cache
39-
export GOTOOLCHAIN=auto
40-
export GOSUMDB=sum.golang.org
41-
42-
# Build Elephant
43-
cd cmd/elephant
44-
go build -o elephant elephant.go
45-
46-
# Install binary
47-
install -Dm755 elephant /usr/bin/elephant
48-
49-
# Create systemd user service directory
50-
mkdir -p /usr/lib/systemd/user
51-
52-
# Create systemd service file
53-
cat > /usr/lib/systemd/user/elephant.service << 'EOF'
54-
[Unit]
55-
Description=Elephant Data Provider Service
56-
After=graphical-session.target
57-
58-
[Service]
59-
Type=simple
60-
ExecStart=/usr/bin/elephant
61-
Restart=on-failure
62-
RestartSec=5
63-
64-
[Install]
65-
WantedBy=default.target
66-
EOF
67-
68-
# Clean up Elephant build
69-
cd /
70-
rm -rf /tmp/elephant /tmp/go /tmp/go-cache
71-
72-
echo "Elephant build complete."
73-
74-
# Build Walker (Rust-based with GTK4)
75-
echo "Building Walker..."
76-
dnf5 -y install rust cargo gtk4-devel gtk4-layer-shell-devel cairo-devel poppler-glib-devel
77-
78-
# Clone Walker repository
79-
WALKER_VERSION="v2.10.0"
80-
git clone --depth 1 --branch ${WALKER_VERSION} https://github.com/abenz1267/walker.git /tmp/walker
81-
82-
cd /tmp/walker
83-
84-
# Set Cargo environment variables for build
85-
export CARGO_HOME=/tmp/cargo
86-
export CARGO_TARGET_DIR=/tmp/cargo-target
87-
88-
# Build Walker with release optimizations
89-
cargo build --release
90-
91-
# Install binary
92-
install -Dm755 /tmp/cargo-target/release/walker /usr/bin/walker
93-
94-
# Install desktop file if it exists
95-
if [ -f resources/walker.desktop ]; then
96-
install -Dm644 resources/walker.desktop /usr/share/applications/walker.desktop
97-
fi
98-
99-
# Install default resources
100-
mkdir -p /usr/share/walker
101-
if [ -d resources ]; then
102-
cp -r resources/* /usr/share/walker/ || true
103-
fi
104-
105-
# Clean up Walker build
106-
cd /
107-
rm -rf /tmp/walker /tmp/cargo /tmp/cargo-target
108-
109-
# Remove build dependencies to keep layer small
110-
dnf5 -y remove golang rust cargo protobuf-compiler
111-
dnf5 -y clean all
112-
113-
echo "Walker build complete."
24+
# These are now built in separate cached layers in the Containerfile
25+
# and copied into the final image for better layer caching
11426

11527
# On Screen Display
11628
dnf5 -y copr enable markupstart/SwayOSD

0 commit comments

Comments
 (0)