From 54ad8cdafba9ac3e054bb12e26a025ae2fb088e8 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 21 Aug 2024 17:52:12 +0200 Subject: build(flake): Wrap the yt binary with the required dependencies --- package.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'package.nix') diff --git a/package.nix b/package.nix index ef218a3..54ee6c1 100644 --- a/package.nix +++ b/package.nix @@ -21,9 +21,15 @@ version = "0.1.0"; src = ./.; + + buildInputs = [ + (python3.withPackages (ps: [ps.yt-dlp])) + mpv-unwrapped.dev + ffmpeg + ]; in rustPlatform.buildRustPackage { - inherit version src; + inherit version src buildInputs; pname = "yt"; nativeBuildInputs = [ @@ -31,23 +37,18 @@ in sqlite ]; - buildInputs = [ - (python3.withPackages (ps: [ps.yt-dlp])) - mpv-unwrapped.dev - ]; - env = let clang_version = lib.versions.major llvmPackages_latest.clang-unwrapped.version; in { FFMPEG_LOCATION = "${lib.getExe ffmpeg}"; - LIBCLANG_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so"; - LIBCLANG_INCLUDE_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include"; - C_INCLUDE_PATH = "${glibc.dev}/include"; - PYO3_PYTHON = lib.getExe (python3.withPackages (ps: [ps.yt-dlp])); + + C_INCLUDE_PATH = "${glibc.dev}/include"; DATABASE_URL = "sqlite://target/database.sqlite"; + LIBCLANG_INCLUDE_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include"; + LIBCLANG_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so"; }; prePatch = '' @@ -66,6 +67,6 @@ in postInstall = '' wrapProgram $out/bin/yt \ - --prefix PATH : $out/bin/ + --prefix PATH : ${lib.makeBinPath buildInputs}:$out/bin ''; } -- cgit 1.4.1