-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Linux/KDE support, nix flake, and distro packaging (v2.4.0) #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| [build] | ||
| # Static-link the C runtime so the Windows .exe ships with zero runtime | ||
| # dependencies (msvcrt). Scoped to Windows only — on Linux/macOS forcing | ||
| # crt-static pulls in static libc which most systems don't ship. | ||
| [target.'cfg(windows)'] | ||
| rustflags = ["-C", "target-feature=+crt-static"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [Desktop Entry] | ||
| Type=Application | ||
| Name=RustCat | ||
| Comment=CPU usage monitor with an animated tray cat | ||
| Exec=rust_cat | ||
| Icon=rustcat | ||
| Terminal=false | ||
| Categories=System;Monitor; | ||
| Keywords=CPU;monitor;tray;cat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Linux build script for RustCat | ||
| # This script handles all Linux-specific build tasks including: | ||
| # - Building the release binary | ||
| # - Bundling the binary with a .desktop entry and icon into a tarball | ||
| # | ||
| # The binary is dynamically linked against glibc. For a fully portable, | ||
| # reproducible build use the Nix flake (`nix build .#default`). | ||
|
|
||
| set -e | ||
|
|
||
| echo "🐧 Starting Linux build process..." | ||
|
|
||
| # Configuration | ||
| APP_NAME="RustCat" | ||
| BIN_NAME="rust_cat" | ||
| VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') | ||
| ARCH=$(uname -m) | ||
| PKG_DIR="${APP_NAME}-${VERSION}-linux-${ARCH}" | ||
|
|
||
| echo "📦 Building release binary..." | ||
| cargo build --release | ||
|
|
||
| # Verify the binary | ||
| echo "✅ Verifying binary..." | ||
| file target/release/${BIN_NAME} | ||
|
|
||
| # Assemble a redistributable package directory | ||
| echo "🎨 Assembling package..." | ||
| rm -rf "${PKG_DIR}" | ||
| mkdir -p "${PKG_DIR}/bin" "${PKG_DIR}/share/applications" "${PKG_DIR}/share/pixmaps" | ||
|
|
||
| cp target/release/${BIN_NAME} "${PKG_DIR}/bin/" | ||
| cp assets/rustcat.desktop "${PKG_DIR}/share/applications/" | ||
| cp assets/appIcon.ico "${PKG_DIR}/share/pixmaps/rustcat.ico" | ||
|
|
||
| # A small install/uninstall helper for users not on Nix | ||
| cat > "${PKG_DIR}/install.sh" <<'INSTALL_EOF' | ||
| #!/bin/bash | ||
| # Simple installer: copies the bundled files into ~/.local | ||
| set -e | ||
| PREFIX="${PREFIX:-${HOME}/.local}" | ||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
|
|
||
| install -Dm755 "${SCRIPT_DIR}/bin/rust_cat" "${PREFIX}/bin/rust_cat" | ||
| install -Dm644 "${SCRIPT_DIR}/share/applications/rustcat.desktop" "${PREFIX}/share/applications/rustcat.desktop" | ||
| install -Dm644 "${SCRIPT_DIR}/share/pixmaps/rustcat.ico" "${PREFIX}/share/pixmaps/rustcat.ico" | ||
|
|
||
| echo "Installed RustCat to ${PREFIX}. Run with: rust_cat" | ||
| INSTALL_EOF | ||
| chmod +x "${PKG_DIR}/install.sh" | ||
|
|
||
| # Archive it | ||
| echo "📦 Creating tarball..." | ||
| tar -czf "${PKG_DIR}.tar.gz" "${PKG_DIR}" | ||
|
|
||
| echo "✅ Done: ${PKG_DIR}.tar.gz" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
libcdependency for Linux to enable highly efficient local time querying without spawning external processes.