1
0
Fork 0
mirror of synced 2024-05-18 03:13:36 +12:00
This commit is contained in:
Petr Korolev 2024-03-24 13:12:40 +00:00 committed by GitHub
commit 01b48659c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 118 additions and 9 deletions

View file

@ -1,56 +1,72 @@
# Installation # Installation
This instruction is outdated and will be removed in one of next version, please look at README.md files in each module folder for more up to date instructions. This instruction is outdated and will be removed in one of next version, please look at README.md files in each module folder for more up to date instructions.
- [Czkawka GUI (GTK frontend)](../czkawka_gui/README.md)</br> - [Czkawka GUI (GTK frontend)](../czkawka_gui/README.md)</br>
- [Czkawka CLI](../czkawka_cli/README.md)</br> - [Czkawka CLI](../czkawka_cli/README.md)</br>
- [Czkawka Core](../czkawka_core/README.md)</br> - [Czkawka Core](../czkawka_core/README.md)</br>
- [Krokiet GUI (Slint frontend)](../krokiet/README.md)</br> - [Krokiet GUI (Slint frontend)](../krokiet/README.md)</br>
## Requirements ## Requirements
### Linux ### Linux
If you use Snap, Flatpak or Appimage, you need to only install ffmpeg if you want to use Similar Videos tool. If you use Snap, Flatpak or Appimage, you need to only install ffmpeg if you want to use Similar Videos tool.
For Czkawka GUI the lowest supported version of GTK is `3.24` which is the only required dependency(of course on Ubuntu, different distributions will probably require a little different set of dependences). For Czkawka GUI the lowest supported version of GTK is `3.24` which is the only required dependency(of course on Ubuntu, different distributions will probably require a little different set of dependences).
In app exists Similar Video tool which require `FFmpeg` to work, but is completely optional and without it, only warning would be printed when trying to use this tool without installed ffmpeg. In app exists Similar Video tool which require `FFmpeg` to work, but is completely optional and without it, only warning would be printed when trying to use this tool without installed ffmpeg.
Broken files finder by default don't check for music files, but it is possible to enable this feature and that require to have alsa lib installed(on Ubuntu this is `libasound2-dev` package) Broken files finder by default don't check for music files, but it is possible to enable this feature and that require to have alsa lib installed(on Ubuntu this is `libasound2-dev` package)
**Warning** **Warning**
Main Czkawka GUI dependency - GTK 4 is only available on newer systems like e.g. Ubuntu 22.04, so if you have problems with running app on older systems, you may like to use older Czkawka versions, upgrade OS or install flatpak package which use its own set of dependencies. Main Czkawka GUI dependency - GTK 4 is only available on newer systems like e.g. Ubuntu 22.04, so if you have problems with running app on older systems, you may like to use older Czkawka versions, upgrade OS or install flatpak package which use its own set of dependencies.
#### Ubuntu/Debian/Linux Mint #### Ubuntu/Debian/Linux Mint
``` ```
sudo apt install libgtk-4-dev ffmpeg sudo apt install libgtk-4-dev ffmpeg
``` ```
#### Fedora/Rocky Linux #### Fedora/Rocky Linux
``` ```
sudo yum install gtk4-devel glib2-devel sudo yum install gtk4-devel glib2-devel
sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf -y install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm sudo dnf -y install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf -y install ffmpeg sudo dnf -y install ffmpeg
``` ```
#### Void Linux (CLI only) #### Void Linux (CLI only)
``` ```
sudo xbps-install gcc pkg-config ffmpeg sudo xbps-install gcc pkg-config ffmpeg
``` ```
### macOS ### macOS
Currently, you need to manually install `GTK 4` libraries, `FFmpeg` and the Adwaita theme, because they are dynamically loaded from the OS.
One very straight-forward way to do this is by using [Homebrew](https://brew.sh/). Currently, you need to manually install `GTK 4` libraries, `FFmpeg` and the Adwaita theme, because they are dynamically loaded from the OS.
One very straight-forward way to do this is by using [Homebrew](https://brew.sh/).
Installation in the terminal: Installation in the terminal:
```shell ```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gtk4 adwaita-icon-theme ffmpeg librsvg libheif pkg-config brew install gtk4 adwaita-icon-theme ffmpeg librsvg libheif pkg-config
``` ```
After that, go to the location where you downloaded Czkawka and add the `executable` permission to this file. After that, go to the location where you downloaded Czkawka and add the `executable` permission to this file.
```shell ```shell
chmod +x mac_czkawka_gui chmod +x mac_czkawka_gui
``` ```
At the end execute it: At the end execute it:
```shell ```shell
./mac_czkawka_gui ./mac_czkawka_gui
``` ```
#### Compiling on Apple Silicon #### Compiling on Apple Silicon
Prebuilt binaries are available only for x86_64, so if you use ARM e.g. Mac M1/M2, you must compile the app manually.
Prebuilt binaries are available only for x86_64, so if you use ARM e.g. Mac M1/M2, you must compile the app manually.
**Compilation is simple, and takes less than 10 minutes on an M1/M2 mac.** **Compilation is simple, and takes less than 10 minutes on an M1/M2 mac.**
@ -60,32 +76,50 @@ brew install rustup
rustup-init rustup-init
brew install gtk4 adwaita-icon-theme librsvg libheif pkg-config brew install gtk4 adwaita-icon-theme librsvg libheif pkg-config
``` ```
``` ```
# Clone and Build # Clone and Build
git clone https://github.com/qarmin/czkawka.git git clone https://github.com/qarmin/czkawka.git
cd czkawka cd czkawka
cargo run --release --bin czkawka_gui cargo run --release --bin czkawka_gui
``` ```
Credit to User [@bauchdj](https://github.com/bauchdj) Credit to User [@bauchdj](https://github.com/bauchdj)
#### x86 on ARM #### x86 on ARM
There is also a way to use x86_64 binaries on ARM, but this requires to install special version of required libraries probably via: There is also a way to use x86_64 binaries on ARM, but this requires to install special version of required libraries probably via:
```shell ```shell
arch -x86_64 /usr/local/bin/brew install gtk4 adwaita-icon-theme ffmpeg librsvg libheif arch -x86_64 /usr/local/bin/brew install gtk4 adwaita-icon-theme ffmpeg librsvg libheif
``` ```
Sadly this doesn't work for all users, so feel free to update this part of documentation(look at https://github.com/qarmin/czkawka/issues/689 and https://github.com/qarmin/czkawka/issues/637 for more info)
Sadly this doesn't work for all users, so feel free to update this part of documentation(look at <https://github.com/qarmin/czkawka/issues/689> and <https://github.com/qarmin/czkawka/issues/637> for more info)
#### Generate App Bundle (macOS)
To generate an app bundle on macOS, you can use the provided script `./misc/create_app_bundle.sh`. This script will create an `.app` bundle with the necessary structure and copy the executable and icon files into the correct locations.
1. Install `librsvg` with Homebrew: `brew install librsvg`
2. Run the script: `./misc/create_app_bundle.sh`
3. The `.app` bundle will be in `./target/release`
4. Move the bundle to Applications: `mv ./target/release/Czkawka.app /Applications`
Now, you can launch Czkawka from your Applications folder or via Spotlight search.
### Windows ### Windows
By default, all needed libraries are bundled with the app except libheif library which allows to scan/use heif files, inside `windows_czkawka_gui.zip`, but if you compile the app or just move `czkawka_gui.exe`, then you will need to install the `GTK 4` By default, all needed libraries are bundled with the app except libheif library which allows to scan/use heif files, inside `windows_czkawka_gui.zip`, but if you compile the app or just move `czkawka_gui.exe`, then you will need to install the `GTK 4`
runtime from [**here**](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases). runtime from [**here**](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases).
FFmpeg to be able to use Similar Videos, you can download and install from this [**link**](https://ffmpeg.org/). FFmpeg to be able to use Similar Videos, you can download and install from this [**link**](https://ffmpeg.org/).
## Installation ## Installation
### Precompiled binaries ### Precompiled binaries
Ready-to-go executables for Linux, Windows and macOS are available [**here**](https://github.com/qarmin/czkawka/releases/).
If the app does not run when clicking the launcher, run it through a terminal. Ready-to-go executables for Linux, Windows and macOS are available [**here**](https://github.com/qarmin/czkawka/releases/).
If the app does not run when clicking the launcher, run it through a terminal.
You don't need to have any additional libraries for CLI Czkawka. You don't need to have any additional libraries for CLI Czkawka.
Install the GUI version on Linux: Install the GUI version on Linux:
@ -102,27 +136,35 @@ linux_czkawka_gui
>**Note** This requires that the `$PATH` environment variable contains `~/.local/bin/`. >**Note** This requires that the `$PATH` environment variable contains `~/.local/bin/`.
### Nightly Builds ### Nightly Builds
Artifacts from each commit can be downloaded [**here**](https://github.com/qarmin/czkawka/actions) Artifacts from each commit can be downloaded [**here**](https://github.com/qarmin/czkawka/actions)
### Appimage ### Appimage
Appimage files are available in release page - [**GitHub releases**](https://github.com/qarmin/czkawka/releases/)
Appimage files are available in release page - [**GitHub releases**](https://github.com/qarmin/czkawka/releases/)
Available are 2 versions of Appimage: Available are 2 versions of Appimage:
- default - which bundle gtk theme - default - which bundle gtk theme
- alternative - which don't include any gtk specific libraries - alternative - which don't include any gtk specific libraries
### Cargo ### Cargo
The easiest method to install Czkawka is using the `cargo` command. To compile it, you need to get all the The easiest method to install Czkawka is using the `cargo` command. To compile it, you need to get all the
requirements from the [compilation section](Compilation.md). requirements from the [compilation section](Compilation.md).
``` ```
cargo install czkawka_gui cargo install czkawka_gui
cargo install czkawka_cli cargo install czkawka_cli
``` ```
You can update the package with the same command. You can update the package with the same command.
### Snap ### Snap
``` ```
sudo snap install czkawka sudo snap install czkawka
``` ```
By default, Snap can only access the files in your home directory. You have to allow Czkawka access to all the drives: By default, Snap can only access the files in your home directory. You have to allow Czkawka access to all the drives:
``` ```
@ -134,17 +176,21 @@ The Snap store entry can be found [**here**](https://snapcraft.io/czkawka).
Fresh builds are available in edge branch, but they may be a little unstable. Fresh builds are available in edge branch, but they may be a little unstable.
### Flatpak ### Flatpak
``` ```
flatpak install flathub com.github.qarmin.czkawka flatpak install flathub com.github.qarmin.czkawka
``` ```
Flathub page with Czkawka can be found [**here**](https://flathub.org/apps/details/com.github.qarmin.czkawka) Flathub page with Czkawka can be found [**here**](https://flathub.org/apps/details/com.github.qarmin.czkawka)
# #
# #
**Unofficial packages, which may not always provide the latest version of Czkawka.** **Unofficial packages, which may not always provide the latest version of Czkawka.**
### PPA - Debian/Ubuntu (unofficial) ### PPA - Debian/Ubuntu (unofficial)
``` ```
sudo add-apt-repository ppa:xtradeb/apps sudo add-apt-repository ppa:xtradeb/apps
sudo apt update sudo apt update
@ -154,12 +200,16 @@ sudo apt-get install czkawka
alternatively you can use instruction from this [xtradeb site](https://xtradeb.net/wiki/how-to-install-applications-from-this-web-site/) alternatively you can use instruction from this [xtradeb site](https://xtradeb.net/wiki/how-to-install-applications-from-this-web-site/)
### AUR - Arch Linux Package (unofficial) ### AUR - Arch Linux Package (unofficial)
Czkawka is also available in Arch Linux's AUR from which it can be easily installed. Czkawka is also available in Arch Linux's AUR from which it can be easily installed.
``` ```
yay -Syu czkawka-gui yay -Syu czkawka-gui
yay -Syu czkawka-cli yay -Syu czkawka-cli
``` ```
or or
``` ```
yay -Syu czkawka-gui-bin yay -Syu czkawka-gui-bin
yay -Syu czkawka-cli-bin yay -Syu czkawka-cli-bin
@ -168,7 +218,9 @@ yay -Syu czkawka-cli-bin
[**Packages info**](https://aur.archlinux.org/packages/?O=0&SeB=nd&K=czkawka&outdated=&SB=n&SO=a&PP=50&do_Search=Go) [**Packages info**](https://aur.archlinux.org/packages/?O=0&SeB=nd&K=czkawka&outdated=&SB=n&SO=a&PP=50&do_Search=Go)
### Docker image (unofficial) ### Docker image (unofficial)
Czkawka docker image is available [**here**](https://github.com/jlesage/docker-czkawka) Czkawka docker image is available [**here**](https://github.com/jlesage/docker-czkawka)
### Chocolatey (unofficial) ### Chocolatey (unofficial)
Windows Chocolatey binaries are available [**here**](https://community.chocolatey.org/packages/czkawka) Windows Chocolatey binaries are available [**here**](https://community.chocolatey.org/packages/czkawka)

57
misc/create_app_bundle.sh Executable file
View file

@ -0,0 +1,57 @@
#!/bin/bash
# Define bundle ID and paths
BUNDLE_ID="com.github.qarmin.czkawka"
DIR="$(dirname "$0")"
PARENT_DIR="$(dirname "$DIR")"
BUNDLE_NAME="Czkawka.app"
BUNDLE_PATH="$PARENT_DIR/target/release/$BUNDLE_NAME"
BINARY_NAME="czkawka_gui"
VERSION=$(grep '^version = ' "$PARENT_DIR/$BINARY_NAME/Cargo.toml" | head -n 1 | cut -d '"' -f 2)
SVG_PATH="$PARENT_DIR/data/icons/${BUNDLE_ID}.svg"
ICONSET_DIR="${PARENT_DIR}/data/icons/${BUNDLE_ID}.iconset"
ICON_SIZES="16 32 64 128 256 512"
SRC_ICON="$SVG_PATH"
# Build the project
cargo build --release --manifest-path="$DIR/../Cargo.toml" --bin $BINARY_NAME
# Create the application bundle structure and copy the binary
mkdir -p "$BUNDLE_PATH/Contents/MacOS" "$BUNDLE_PATH/Contents/Resources"
cp "$PARENT_DIR/target/release/$BINARY_NAME" "$BUNDLE_PATH/Contents/MacOS/"
# Create iconset directory and generate icon sizes
mkdir -p "$ICONSET_DIR"
for SIZE in $ICON_SIZES; do
rsvg-convert -w $SIZE -h $SIZE $SRC_ICON -o "${ICONSET_DIR}/icon_${SIZE}x${SIZE}.png"
[ $SIZE -ne 512 ] && rsvg-convert -w $((SIZE*2)) -h $((SIZE*2)) $SRC_ICON -o "${ICONSET_DIR}/icon_${SIZE}x${SIZE}@2x.png"
done
# Convert the iconset to an icns file and clean up the iconset directory
iconutil -c icns "$ICONSET_DIR" -o "$BUNDLE_PATH/Contents/Resources/${BUNDLE_ID}.icns"
rm -rf "$ICONSET_DIR"
# Create the Info.plist file
cat <<EOF >"$BUNDLE_PATH/Contents/Info.plist"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>$BINARY_NAME</string>
<key>CFBundleIconFile</key>
<string>${BUNDLE_ID}.icns</string>
<key>CFBundleIdentifier</key>
<string>${BUNDLE_ID}</string>
<key>CFBundleName</key>
<string>Czkawka</string>
<key>CFBundleVersion</key>
<string>$VERSION</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
</dict>
</plist>
EOF
echo "Application bundle created at: $BUNDLE_PATH"