Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
mingw-w64-clang-x86_64-gtk4
mingw-w64-clang-x86_64-gtksourceview5
mingw-w64-clang-x86_64-libadwaita
mingw-w64-clang-x86_64-imagemagick
mingw-w64-clang-x86_64-openssl
mingw-w64-clang-x86_64-pkg-config
mingw-w64-clang-x86_64-toolchain
Expand Down Expand Up @@ -117,18 +116,6 @@ jobs:
cp /clang64/ssl/certs/ca-bundle.crt "$bundle/ssl/certs/" 2>/dev/null || true
cp /clang64/etc/ssl/certs/ca-bundle.crt "$bundle/ssl/certs/" 2>/dev/null || true

cat > "$bundle/aetheris.bat" <<'EOF'
@echo off
set "AETHERIS_DIR=%~dp0"
set "PATH=%AETHERIS_DIR%bin;%PATH%"
set "XDG_DATA_DIRS=%AETHERIS_DIR%share"
set "GSETTINGS_SCHEMA_DIR=%AETHERIS_DIR%share\glib-2.0\schemas"
set "GDK_PIXBUF_MODULEDIR=%AETHERIS_DIR%lib\gdk-pixbuf-2.0\2.10.0\loaders"
set "GIO_MODULE_DIR=%AETHERIS_DIR%lib\gio\modules"
set "SSL_CERT_FILE=%AETHERIS_DIR%ssl\certs\ca-bundle.crt"
"%AETHERIS_DIR%bin\aetheris.exe" %*
EOF

(
cd target/windows
zip -r "../../dist/${{ steps.names.outputs.windows_name }}" aetheris
Expand All @@ -144,18 +131,9 @@ jobs:
shell: msys2 {0}
run: |
set -euo pipefail
mkdir -p target/windows
magick \
data/icons/hicolor/64x64/apps/org.luminusos.Aetheris.png \
data/icons/hicolor/128x128/apps/org.luminusos.Aetheris.png \
data/icons/hicolor/256x256/apps/org.luminusos.Aetheris.png \
data/icons/hicolor/512x512/apps/org.luminusos.Aetheris.png \
target/windows/aetheris.ico
cp target/windows/aetheris.ico target/windows/aetheris/aetheris.ico

source_dir="$(cygpath -w "$(pwd)/target/windows/aetheris")"
output_dir="$(cygpath -w "$(pwd)/dist")"
setup_icon_file="$(cygpath -w "$(pwd)/target/windows/aetheris.ico")"
setup_icon_file="$(cygpath -w "$(pwd)/data/icons/windows/aetheris.ico")"
inno_script="$(cygpath -w "$(pwd)/build-aux/inno/aetheris.iss")"

MSYS2_ARG_CONV_EXCL='*' iscc \
Expand Down
54 changes: 54 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions build-aux/inno/aetheris.iss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ AppSupportURL=https://github.com/luminusOS/aetheris/issues
AppUpdatesURL=https://github.com/luminusOS/aetheris/releases
DefaultDirName={localappdata}\Programs\Aetheris
DefaultGroupName=Aetheris
UninstallDisplayIcon={app}\aetheris.ico
UninstallDisplayIcon={app}\bin\aetheris.exe
OutputDir={#OutputDir}
OutputBaseFilename=aetheris-setup
Compression=lzma2/ultra64
Expand Down Expand Up @@ -66,9 +66,9 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\Aetheris"; Filename: "{app}\aetheris.bat"; IconFilename: "{app}\aetheris.ico"
Name: "{group}\Aetheris"; Filename: "{app}\bin\aetheris.exe"
Name: "{group}\Uninstall Aetheris"; Filename: "{uninstallexe}"
Name: "{autodesktop}\Aetheris"; Filename: "{app}\aetheris.bat"; IconFilename: "{app}\aetheris.ico"; Tasks: desktopicon
Name: "{autodesktop}\Aetheris"; Filename: "{app}\bin\aetheris.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\aetheris.bat"; Description: "Launch Aetheris"; Flags: nowait postinstall skipifnotsilent
Filename: "{app}\bin\aetheris.exe"; Description: "Launch Aetheris"; Flags: nowait postinstall skipifnotsilent
3 changes: 3 additions & 0 deletions crates/aetheris-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ vte4 = "0.10"

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
gettext-rs = { version = "0.7", features = ["gettext-system"] }

[target.'cfg(target_os = "windows")'.build-dependencies]
embed-resource = "3.0.11"
1 change: 1 addition & 0 deletions crates/aetheris-app/aetheris.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 ICON "../../data/icons/windows/aetheris.ico"
10 changes: 10 additions & 0 deletions crates/aetheris-app/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn main() {
#[cfg(target_os = "windows")]
{
println!("cargo:rerun-if-changed=aetheris.rc");
println!("cargo:rerun-if-changed=../../data/icons/windows/aetheris.ico");
embed_resource::compile("aetheris.rc", embed_resource::NONE)
.manifest_required()
.unwrap();
}
}
8 changes: 1 addition & 7 deletions crates/aetheris-app/src/app/ansi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ pub(super) fn setup_log_highlighting(buffer: &gtk::TextBuffer) {
ensure_text_tag(buffer, "ansi-fg-white", &[("foreground", &"#f6f5f4")]);
}

/// Appends `line` to `buffer`, translating ANSI SGR color/bold escape
/// codes (the ones frameworks like Logback/Spring Boot emit for console
/// output) into GTK text tags instead of leaving the raw escape bytes in
/// the log text.
pub(super) fn insert_ansi_line(buffer: &gtk::TextBuffer, line: &str) {
let mut iter = buffer.end_iter();
for (text, tags) in parse_ansi_line(line) {
Expand All @@ -33,8 +29,6 @@ pub(super) fn insert_ansi_line(buffer: &gtk::TextBuffer, line: &str) {
}
}

/// Splits `line` into (text, active-tag-names) segments, dropping the
/// escape sequences themselves from the text.
fn parse_ansi_line(line: &str) -> Vec<(String, Vec<&'static str>)> {
let mut segments = Vec::new();
let mut current_text = String::new();
Expand All @@ -46,7 +40,7 @@ fn parse_ansi_line(line: &str) -> Vec<(String, Vec<&'static str>)> {
current_text.push(ch);
continue;
}
chars.next(); // consume '['
chars.next();

let mut code = String::new();
let mut terminator = None;
Expand Down
45 changes: 45 additions & 0 deletions crates/aetheris-app/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,56 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

mod app;

use relm4::RelmApp;

pub const APP_ID: &str = "org.luminusos.Aetheris";
pub const GETTEXT_PACKAGE: &str = APP_ID;

#[cfg(windows)]
fn configure_bundled_runtime() {
let Ok(exe) = std::env::current_exe() else {
return;
};
let Some(root) = exe.parent().and_then(|bin| bin.parent()) else {
return;
};

let share = root.join("share");
let vars = [
("XDG_DATA_DIRS", share.clone()),
(
"GSETTINGS_SCHEMA_DIR",
share.join("glib-2.0").join("schemas"),
),
(
"GDK_PIXBUF_MODULEDIR",
root.join("lib")
.join("gdk-pixbuf-2.0")
.join("2.10.0")
.join("loaders"),
),
(
"GIO_MODULE_DIR",
root.join("lib").join("gio").join("modules"),
),
(
"SSL_CERT_FILE",
root.join("ssl").join("certs").join("ca-bundle.crt"),
),
];

for (key, value) in vars {
// SAFETY: called once, single-threaded, before GTK/GLib or any other
// thread reads the environment.
unsafe { std::env::set_var(key, value) };
}
}

fn main() {
#[cfg(windows)]
configure_bundled_runtime();

app::i18n::init();

tracing_subscriber::fmt()
Expand Down
Binary file added data/icons/windows/aetheris.ico
Binary file not shown.
Loading