Skip to content

Commit

Permalink
chore: build Nix Flake on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
aksiksi committed Jul 9, 2024
1 parent b218819 commit 3926686
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@
pkgs.ffmpeg-full
pkgs.llvmPackages.clang
pkgs.pkg-config
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.fftw ];
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.fftw
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Accelerate
pkgs.darwin.apple_sdk.frameworks.AVFoundation
];
# buildInputs: used only at runtime (i.e., linked against)
# https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-overview
buildInputs = [ pkgs.ffmpeg-full ] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.fftw ];
buildInputs = [
pkgs.ffmpeg-full
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.fftw
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Accelerate
pkgs.darwin.apple_sdk.frameworks.AVFoundation
];
# Required to allow build to "see" libclang (used by bindgen I think)
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
meta = {
Expand All @@ -51,18 +63,27 @@
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
buildInputs = [
pkgs.chromaprint
pkgs.ffmpeg-full
pkgs.libiconv # required by rust-ffmpeg build script
pkgs.pkg-config
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.fftw
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Accelerate
pkgs.darwin.apple_sdk.frameworks.AVFoundation
];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
packages = [
pkgs.cargo
pkgs.chromaprint
pkgs.cmake
pkgs.ffmpeg-full
pkgs.llvmPackages.clang
pkgs.pkg-config
pkgs.rustc
pkgs.rust-analyzer
pkgs.rustfmt
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.fftw ];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
];
};
}
);
Expand Down

0 comments on commit 3926686

Please sign in to comment.