Skip to content

Commit

Permalink
feat: use rusty-chromaprint instead of native
Browse files Browse the repository at this point in the history
  • Loading branch information
aksiksi committed Sep 8, 2024
1 parent 1e6f92e commit 4a980bf
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 170 deletions.
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ sudo apt-get install \
cargo install --path .
```

This will **dynamically** link against FFmpeg and statically link `chromaprint`.
This will **dynamically** link against FFmpeg.

#### Dynamic

Expand Down Expand Up @@ -223,7 +223,7 @@ brew install cmake pkg-config ffmpeg
cargo install --path .
```

This will **dynamically** link against FFmpeg. `chromaprint` will be statically linked.
This will **dynamically** link against FFmpeg.

### Windows

Expand All @@ -242,15 +242,15 @@ cargo vcpkg build
3. Build:

```bash
# Statically link against both FFmpeg and chromaprint
# Statically link against FFmpeg.
cargo build --release --features static
```

#### Dynamic

1. Set the following environment variables:

a. To dynamically link **both** FFmpeg and `chromaprint`:
a. To dynamically link FFmpeg:

```powershell
# Powershell
Expand All @@ -264,18 +264,6 @@ cargo build --release --features static
export VCPKGRS_TRIPLET='x64-windows'
```
b. Just `chromaprint`:
```powershell
# Powershell
$env:CHROMAPRINT_SYS_DYNAMIC='1'
```
```bash
# Git bash
export CHROMAPRINT_SYS_DYNAMIC=1
```
2. Build deps:
```
Expand Down
4 changes: 1 addition & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
inherit pname;
inherit version;
src = ./needle;
cargoSha256 = "sha256-aUKzSbyniuk2+UZmrUZjMv+yhcjn+eilnZtCMxzJLZo=";
cargoSha256 = "sha256-CUcjt7BLvTSaiiYCuzVilEf0y1zN08Bo8YtvKFVTSiM=";
# nativeBuildInputs: used only in build phase
nativeBuildInputs = [
pkgs.cmake
Expand All @@ -30,7 +30,6 @@
# buildInputs: used only at runtime (i.e., linked against)
# https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-overview
buildInputs = [
pkgs.chromaprint
pkgs.ffmpeg-full
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.fftw
Expand Down Expand Up @@ -58,7 +57,6 @@
in {
default = pkgs.mkShell {
buildInputs = [
pkgs.chromaprint
pkgs.ffmpeg-full
pkgs.libiconv # required by rust-ffmpeg build script
pkgs.pkg-config
Expand Down
Loading

0 comments on commit 4a980bf

Please sign in to comment.