Skip to content

Commit 0ec21d6

Browse files
committed
build walker and elephant from source
1 parent 044ac0b commit 0ec21d6

File tree

4 files changed

+122
-3
lines changed

4 files changed

+122
-3
lines changed

Containerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,35 @@ ARG BASE_IMAGE=ghcr.io/ublue-os/bluefin-dx:stable-daily
55
FROM scratch AS ctx
66
COPY build_files /
77

8+
# Build Elephant from source (cached layer)
9+
FROM ${BASE_IMAGE} AS elephant-builder
10+
COPY packages/elephant/build.sh /tmp/build-elephant.sh
11+
RUN --mount=type=cache,dst=/var/cache \
12+
--mount=type=cache,dst=/var/log \
13+
--mount=type=tmpfs,dst=/tmp/build \
14+
chmod +x /tmp/build-elephant.sh && \
15+
/tmp/build-elephant.sh
16+
17+
# Build Walker from source (cached layer)
18+
FROM ${BASE_IMAGE} AS walker-builder
19+
COPY packages/walker/build.sh /tmp/build-walker.sh
20+
RUN --mount=type=cache,dst=/var/cache \
21+
--mount=type=cache,dst=/var/log \
22+
--mount=type=tmpfs,dst=/tmp/build \
23+
chmod +x /tmp/build-walker.sh && \
24+
/tmp/build-walker.sh
25+
826
# Base Image
927
FROM ${BASE_IMAGE}
1028

29+
# Copy Elephant binary and service from builder
30+
COPY --from=elephant-builder /usr/bin/elephant /usr/bin/elephant
31+
COPY --from=elephant-builder /usr/lib/systemd/user/elephant.service /usr/lib/systemd/user/elephant.service
32+
33+
# Copy Walker binary and resources from builder
34+
COPY --from=walker-builder /usr/bin/walker /usr/bin/walker
35+
COPY --from=walker-builder /usr/share/walker /usr/share/walker
36+
1137
# Copy dot_files into the image at /usr/share/binaryos/config
1238
COPY dot_files /usr/share/binaryos/config
1339

build_files/build.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ dnf5 -y install fd-find
2121
# TODO: Figure out what we don't need from solopasha/hyprland
2222

2323
# Application Launcher - Walker / Elephant
24-
dnf5 -y copr enable errornointernet/packages
25-
dnf5 -y install elephant walker
26-
elephant service enable
24+
# Built from source in separate container layers
2725

2826
# On Screen Display
2927
dnf5 -y copr enable markupstart/SwayOSD

packages/elephant/build.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
set -ouex pipefail
4+
5+
# Install build dependencies for Elephant (Go-based)
6+
dnf5 -y install git golang protobuf-compiler
7+
8+
# Clone Elephant repository
9+
ELEPHANT_VERSION="v2.15.0"
10+
git clone --depth 1 --branch ${ELEPHANT_VERSION} https://github.com/abenz1267/elephant.git /tmp/elephant
11+
12+
cd /tmp/elephant
13+
14+
# Set Go environment variables for build
15+
export GOPATH=/tmp/go
16+
export GOCACHE=/tmp/go-cache
17+
export GOTOOLCHAIN=auto
18+
export GOSUMDB=sum.golang.org
19+
20+
# Build Elephant
21+
cd cmd/elephant
22+
go build -o elephant elephant.go
23+
24+
# Install binary
25+
install -Dm755 elephant /usr/bin/elephant
26+
27+
# Create systemd user service directory
28+
mkdir -p /usr/lib/systemd/user
29+
30+
# Create systemd service file
31+
cat > /usr/lib/systemd/user/elephant.service << 'EOF'
32+
[Unit]
33+
Description=Elephant Data Provider Service
34+
After=graphical-session.target
35+
36+
[Service]
37+
Type=simple
38+
ExecStart=/usr/bin/elephant
39+
Restart=on-failure
40+
RestartSec=5
41+
42+
[Install]
43+
WantedBy=default.target
44+
EOF
45+
46+
# Clean up
47+
cd /
48+
rm -rf /tmp/elephant
49+
50+
# Remove build dependencies to keep layer small
51+
dnf5 -y remove golang protobuf-compiler
52+
dnf5 -y clean all
53+

packages/walker/build.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
set -ouex pipefail
4+
5+
# Install build dependencies for Walker (Rust-based with GTK4)
6+
dnf5 -y install git rust cargo gtk4-devel gtk4-layer-shell-devel protobuf-compiler cairo-devel poppler-glib-devel
7+
8+
# Clone Walker repository
9+
WALKER_VERSION="v2.10.0"
10+
git clone --depth 1 --branch ${WALKER_VERSION} https://github.com/abenz1267/walker.git /tmp/walker
11+
12+
cd /tmp/walker
13+
14+
# Set Cargo environment variables for build
15+
export CARGO_HOME=/tmp/cargo
16+
export CARGO_TARGET_DIR=/tmp/cargo-target
17+
18+
# Build Walker with release optimizations
19+
cargo build --release
20+
21+
# Install binary
22+
install -Dm755 /tmp/cargo-target/release/walker /usr/bin/walker
23+
24+
# Install desktop file if it exists
25+
if [ -f resources/walker.desktop ]; then
26+
install -Dm644 resources/walker.desktop /usr/share/applications/walker.desktop
27+
fi
28+
29+
# Install default resources
30+
mkdir -p /usr/share/walker
31+
if [ -d resources ]; then
32+
cp -r resources/* /usr/share/walker/ || true
33+
fi
34+
35+
# Clean up
36+
cd /
37+
rm -rf /tmp/walker /tmp/cargo /tmp/cargo-target
38+
39+
# Remove build dependencies to keep layer small
40+
dnf5 -y remove rust cargo protobuf-compiler
41+
dnf5 -y clean all
42+

0 commit comments

Comments
 (0)