Skip to content

Commit 84969f7

Browse files
committed
License rcedit
1 parent ec9b6ac commit 84969f7

7 files changed

Lines changed: 30 additions & 58 deletions

File tree

.github/workflows/windows.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,27 @@ jobs:
2525
rustup default 1.92.0
2626
rustup target add x86_64-pc-windows-gnu
2727
28+
- name: Download rcedit
29+
run: |
30+
curl -L https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe -o rcedit-x64.exe
31+
2832
- name: Compile Krokiet Release
2933
if: ${{ github.ref == 'refs/heads/master' }}
3034
run: |
3135
sed -i 's/#lto = /lto = /g' Cargo.toml
3236
sed -i 's/#codegen-units /codegen-units /g' Cargo.toml
33-
cargo build --release --target x86_64-pc-windows-gnu --bin krokiet --features "add_windows_icon"
37+
cargo build --release --target x86_64-pc-windows-gnu --bin krokiet
3438
mv target/x86_64-pc-windows-gnu/release/krokiet.exe windows_krokiet_on_linux.exe
39+
wine rcedit-x64.exe windows_krokiet_on_linux.exe --set-icon krokiet/icons/krokiet_logo_flag.ico
3540
3641
- name: Compile Krokiet Debug
3742
if: ${{ github.ref != 'refs/heads/master' }}
3843
run: |
3944
sed -i 's/^\(\[profile\.dev\.package.*\)/#\1/' Cargo.toml
4045
sed -i 's|^opt-level = 3 # OPT PACKAGES|#opt-level = 3 # OPT PACKAGES|' Cargo.toml
41-
cargo build --target x86_64-pc-windows-gnu --bin krokiet --features "add_windows_icon"
46+
cargo build --target x86_64-pc-windows-gnu --bin krokiet
4247
mv target/x86_64-pc-windows-gnu/debug/krokiet.exe windows_krokiet_on_linux.exe
48+
wine rcedit-x64.exe windows_krokiet_on_linux.exe --set-icon krokiet/icons/krokiet_logo_flag.ico
4349
4450
- name: Pack with 7z
4551
run: |
@@ -74,37 +80,39 @@ jobs:
7480
run: |
7581
rustup default 1.92.0
7682
83+
- name: Download rcedit
84+
run: |
85+
curl -L https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe -o rcedit-x64.exe
86+
7787
- name: Compile Krokiet Release
7888
if: ${{ github.ref == 'refs/heads/master' }}
7989
run: |
80-
# Replace '#lto = ' with 'lto = ' in Cargo.toml
8190
powershell -Command "(Get-Content Cargo.toml) -replace '#lto = ', 'lto = ' | Set-Content Cargo.toml"
82-
# Replace '#codegen-units ' with 'codegen-units ' in Cargo.toml
8391
powershell -Command "(Get-Content Cargo.toml) -replace '#codegen-units ', 'codegen-units ' | Set-Content Cargo.toml"
84-
cargo build --release --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software,add_windows_icon"
92+
cargo build --release --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
8593
mv target/release/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
86-
cargo build --release --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software,add_windows_icon"
94+
cargo build --release --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
8795
mv target/release/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
88-
cargo build --release --bin krokiet --no-default-features --features "femtovg_wgpu,add_windows_icon"
96+
cargo build --release --bin krokiet --no-default-features --features "femtovg_wgpu"
8997
mv target/release/krokiet.exe windows_krokiet_on_windows_femtovg_wgpu.exe
90-
cargo build --release --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu,add_windows_icon"
98+
cargo build --release --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu"
9199
mv target/release/krokiet.exe windows_krokiet_on_windows_all_backends.exe
100+
Get-ChildItem windows_krokiet_on_windows_*.exe | ForEach-Object { ./rcedit-x64.exe $_.Name --set-icon krokiet/icons/krokiet_logo_flag.ico }
92101
93102
- name: Compile Krokiet Debug
94103
if: ${{ github.ref != 'refs/heads/master' }}
95104
run: |
96-
# Comment out '[profile.dev.package.*' lines
97105
powershell -Command "(Get-Content Cargo.toml) -replace '^\[profile\.dev\.package.*', { '#' + \$_ } | Set-Content Cargo.toml"
98-
# Comment out 'opt-level = 3 # OPT PACKAGES'
99106
powershell -Command "(Get-Content Cargo.toml) -replace '^opt-level = 3 # OPT PACKAGES', '#opt-level = 3 # OPT PACKAGES' | Set-Content Cargo.toml"
100-
cargo build --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software,add_windows_icon"
107+
cargo build --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
101108
mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
102-
cargo build --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software,add_windows_icon"
109+
cargo build --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
103110
mv target/debug/krokiet.exe windows_krokiet_on_windows_skia_vulkan.exe
104-
cargo build --bin krokiet --no-default-features --features "femtovg_wgpu,add_windows_icon"
111+
cargo build --bin krokiet --no-default-features --features "femtovg_wgpu"
105112
mv target/debug/krokiet.exe windows_krokiet_on_windows_femtovg_wgpu.exe
106-
cargo build --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu,add_windows_icon"
113+
cargo build --bin krokiet --no-default-features --features "winit_femtovg,winit_skia_opengl,winit_skia_vulkan,winit_software,femtovg_wgpu"
107114
mv target/debug/krokiet.exe windows_krokiet_on_windows_all_backends.exe
115+
Get-ChildItem windows_krokiet_on_windows_*.exe | ForEach-Object { ./rcedit-x64.exe $_.Name --set-icon krokiet/icons/krokiet_logo_flag.ico }
108116
109117
- name: Upload artifacts
110118
uses: actions/upload-artifact@v4
@@ -145,25 +153,27 @@ jobs:
145153
rustup target add x86_64-pc-windows-gnu
146154
147155
mkdir -p package
148-
mkdir -p package_with_icon_tmp
156+
curl -L https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe -o rcedit-x64.exe
149157
150158
- name: Cross compile for Windows - Release
151159
if: ${{ github.ref == 'refs/heads/master' }}
152160
run: |
153161
source "$HOME/.cargo/env"
154162
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig:$MINGW_PREFIX/lib/pkgconfig/:/usr/x86_64-w64-mingw32/lib/pkgconfig/
155-
cargo build --target=x86_64-pc-windows-gnu --release --locked --features "add_windows_icon"
163+
cargo build --target=x86_64-pc-windows-gnu --release --locked
156164
cp target/x86_64-pc-windows-gnu/release/czkawka_gui.exe package/
157165
cp target/x86_64-pc-windows-gnu/release/czkawka_cli.exe package/
166+
wine rcedit-x64.exe package/czkawka_gui.exe --set-icon czkawka_gui/icons/icon.ico
158167
159168
- name: Cross compile for Windows - Debug
160169
if: ${{ github.ref != 'refs/heads/master' }}
161170
run: |
162171
source "$HOME/.cargo/env"
163172
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig:$MINGW_PREFIX/lib/pkgconfig/:/usr/x86_64-w64-mingw32/lib/pkgconfig/
164-
cargo build --target=x86_64-pc-windows-gnu --locked --profile fastci --features "add_windows_icon"
173+
cargo build --target=x86_64-pc-windows-gnu --locked --profile fastci
165174
cp target/x86_64-pc-windows-gnu/fastci/czkawka_gui.exe package/
166175
cp target/x86_64-pc-windows-gnu/fastci/czkawka_cli.exe package/
176+
wine rcedit-x64.exe package/czkawka_gui.exe --set-icon czkawka_gui/icons/icon.ico
167177
168178
- name: Package
169179
run: |

Cargo.lock

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE_CC_BY_4_ICONS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Copyright (c) 2020 [jannuary](https://github.com/jannuary)
55
- data/icons/com.github.qarmin.czkawka.svg
66
- data/icons/com.github.qarmin.czkawka-symbolic.svg
77

8+
Copyright (c) 2020-2026 Rafał Mikrut
9+
- data/icons/io.github.qarmin.krokiet.svg
10+
811
License: CC-BY-4.0
912
Creative Commons Attribution 4.0 International Public License
1013
.

czkawka_gui/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ rand = "0.10.0"
4646
[target.'cfg(windows)'.dependencies]
4747
winapi = { version = "0.3.9", features = ["combaseapi", "objbase", "shobjidl_core", "windef", "winerror", "wtypesbase", "winuser"] }
4848

49-
[build-dependencies]
50-
winresource = "0.1"
51-
5249
[features]
5350
default = []
5451
heif = ["czkawka_core/heif"]
@@ -57,7 +54,6 @@ libavif = ["czkawka_core/libavif"]
5754
# Allows to use trash on Linux when using xdg-portal, needed by e.g. flatpak where normal trash access always fails
5855
# No-op on other OSes, it is slower and provides less helpful error messages
5956
xdg_portal_trash = ["czkawka_core/xdg_portal_trash"]
60-
add_windows_icon = []
6157

6258
[lints]
6359
workspace = true

czkawka_gui/build.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

krokiet/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,13 @@ rodio = { version = "0.22.0", default-features = false, features = ["playback",
5252
#slint-build = { path = "/home/rafal/test/slint/api/rs/build/"}
5353
#slint-build = { git = "https://github.com/slint-ui/slint.git" }
5454
slint-build = "1.15"
55-
winresource = "0.1"
5655

5756
[features]
5857
default = ["winit_femtovg", "winit_software"]
5958

6059
# Audio support
6160
audio = ["rodio"]
6261

63-
# Bundles windows icon into executable
64-
add_windows_icon = []
65-
6662
# Renderers
6763
skia_opengl = ["slint/renderer-skia-opengl"]
6864
skia_vulkan = ["slint/renderer-skia-vulkan"]

krokiet/build.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,4 @@ fn main() {
66
} else {
77
slint_build::compile("ui/main_window.slint").expect("Unable to compile slint file");
88
}
9-
10-
if env::var("CARGO_FEATURE_ADD_WINDOWS_ICON").is_ok()
11-
&& let Ok(target_os) = env::var("CARGO_CFG_TARGET_OS")
12-
&& target_os == "windows"
13-
{
14-
let mut res = winresource::WindowsResource::new();
15-
res.set_icon("icons/krokiet_logo_flag.ico");
16-
res.compile().expect("Unable to compile icon");
17-
}
189
}

0 commit comments

Comments
 (0)