Skip to content

Commit 99a07fe

Browse files
committed
Try to build walker and elephant in build.sh
1 parent 3d15591 commit 99a07fe

File tree

2 files changed

+90
-27
lines changed

2 files changed

+90
-27
lines changed

Containerfile

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,9 @@ 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-
268
# Base Image
279
FROM ${BASE_IMAGE}
2810

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-
3711
# Copy dot_files into the image at /usr/share/binaryos/config
3812
COPY dot_files /usr/share/binaryos/config
3913

build_files/build.sh

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

2323
# Application Launcher - Walker / Elephant
24-
# Built from source in separate container layers
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."
25114

26115
# On Screen Display
27116
dnf5 -y copr enable markupstart/SwayOSD

0 commit comments

Comments
 (0)