?
This commit is contained in:
@@ -8,16 +8,24 @@
|
||||
system = "aarch64-darwin";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
# pkg-config is needed for CMake to "see" the library
|
||||
nativeBuildInputs = [pkgs.pkg-config];
|
||||
# This builds the 'PROCESSOR' library so other projects can find it
|
||||
packages.${system}.default = pkgs.stdenv.mkDerivation {
|
||||
name = "image_processor";
|
||||
src = ./.;
|
||||
nativeBuildInputs = [pkgs.cmake];
|
||||
buildInputs = [pkgs.libjpeg_turbo];
|
||||
# This ensures the .dylib and .h files are moved to the right place
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/include
|
||||
cp libPROCESSOR.dylib $out/lib/ || cp libPROCESSOR.a $out/lib/
|
||||
cp *.h $out/include/
|
||||
'';
|
||||
};
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = [pkgs.libjpeg_turbo];
|
||||
shellHook = ''
|
||||
export PKG_CONFIG_PATH="${pkgs.libjpeg_turbo.dev}/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export C_INCLUDE_PATH="${pkgs.libjpeg_turbo.dev}/include:$C_INCLUDE_PATH"
|
||||
export LIBRARY_PATH="${pkgs.libjpeg_turbo}/lib:$LIBRARY_PATH"
|
||||
echo "✅ Environment ready: libturbojpeg and pkg-config loaded."
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user