2021-07-03 04:39:44 +12:00
# Compiling Czkawka from sources
2021-05-01 21:14:02 +12:00
## Requirements
2022-01-08 04:46:07 +13:00
2022-01-08 04:53:03 +13:00
If you only want the terminal version without a GUI, just skip all the packages with `gtk` in their names.
2022-05-19 04:46:34 +12:00
FFmpeg is not included here because it is not needed to build - it is dynamically loaded.
2022-01-08 04:53:03 +13:00
2022-06-09 07:42:51 +12:00
Support for heif images is optional and require to install libheif library.
2022-01-08 04:53:03 +13:00
2021-12-06 09:01:16 +13:00
| Program | Min | What for |
|---------|------|-------------------------------------------------------------------------------|
2022-05-17 04:23:07 +12:00
| Rust | 1.60 | Czkawka, aims to support the latest available version of Rust on Ubuntu 20.04 |
2021-12-06 09:01:16 +13:00
| GTK | 3.24 | Only for the `GTK` backend |
2021-05-01 21:14:02 +12:00
#### Debian / Ubuntu
```shell
2022-03-11 17:43:54 +13:00
sudo apt install -y curl git build-essential # Needed by Rust update tool
2021-05-01 21:14:02 +12:00
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Download the latest stable Rust
2022-05-22 20:59:09 +12:00
sudo apt install -y libgtk-4-dev
2021-05-01 21:14:02 +12:00
```
#### Fedora / CentOS / Rocky Linux
```shell
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Download the latest stable Rust
2022-01-01 10:34:24 +13:00
sudo yum install gtk3-devel glib2-devel
2021-05-01 21:14:02 +12:00
```
#### macOS
2022-06-09 07:42:51 +12:00
You need to install Rust via Homebrew, GTK Libraries and optionally heif library(to have support for heic files, which are quite popular on mac)
2021-05-01 21:14:02 +12:00
```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install rustup
rustup-init
2022-06-09 07:42:51 +12:00
brew install gtk+3 adwaita-icon-theme librsvg libheif
2021-05-01 21:14:02 +12:00
```
### Windows
*Will be available in the future*
For Linux-to-Windows cross-building instruction look at the CI.
<!-- First you need to install Visual C++ components from Visual Studio installer - https://visualstudio.microsoft.com/downloads/
Next install Rust from site https://rustup.rs/
2022-05-22 20:59:09 +12:00
After that the latest GTK 4 runtime must be installed from(not available yet for GTK 4) https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases
2021-05-01 21:14:02 +12:00
-->
2022-01-07 09:31:44 +13:00
### Docker
```shell
docker build ./misc/docker/ --tag cargo-gtk
```
2021-05-01 21:14:02 +12:00
## Compilation
2021-11-25 23:15:31 +13:00
Czkawka can be installed with Debug or Release build.
2022-05-19 04:46:34 +12:00
With Debug build additional checks, e.g., variables overflow, are available, but depending on the usage it works very slow, so it should be used only for development purposes.
Compilation with `--release` flag will optimize binaries, so they can be used with good performance (official binaries are built with this flag)
2021-11-25 23:15:31 +13:00
2021-05-01 21:14:02 +12:00
- Download the source
```
git clone https://github.com/qarmin/czkawka.git
cd czkawka
```
- Compile and run GTK GUI
```
cargo run --release --bin czkawka_gui
```
- Compile and run CLI (by default this will print help with examples)
```
cargo run --release --bin czkawka_cli
```
2022-01-07 09:31:44 +13:00
## Compilation with Docker
```shell
docker run -t --rm --volume $PWD:/app --workdir /app cargo-gtk cargo build --release --bin czkawka_gui
```
Run the binary:
```shell
target/release/czkawka_gui
```
2021-05-01 21:14:02 +12:00
## Additional features
2022-05-19 04:46:34 +12:00
For now, finding broken audio files is temporarily disabled by default, because app crashes when audio libraries are not found on the computer.
2021-05-01 21:14:02 +12:00
I'm waiting for ability to disable audio playback feature, so after that I will be able to re-enable by default this feature (https://github.com/RustAudio/rodio/issues/349)
To enable checking for broken audio files, just add ` --all-features`
```
cargo run --all-features --bin czkawka_cli -- broken -d /home/rafal/ -f "results.txt"
2022-01-07 09:31:44 +13:00
```