Skip to content

Commit

Permalink
combined dev shells and fix for unlocated libffi.h
Browse files Browse the repository at this point in the history
SDL2 is not very heavy to include for all users.  This way, no switching shells
is necessary to build Lem or LemSDL2

pkg-config is a requirement.

Including packages in the LD_LIBRARY_PATH list does not appear to run the
pkg-config hook, so anything where pkg-config is run needs to be in the package list.
  • Loading branch information
psionic-k committed Jan 27, 2025
1 parent 7196d4c commit 7f878a7
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,40 +151,28 @@
runHook postInstall
'';
};
lem-sdl2-shell = pkgs.mkShell {
packages = with pkgs; [
sbcl
sbcl.pkgs.qlot-cli
];
# Normally we would include pkg-config and list these dependencies
# in packages, but it does not appear that pkg-config is being used
# when available.
shellHook = with pkgs; ''
export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH}:${SDL2}/lib:${SDL2_ttf}/lib:${SDL2_image}/lib:${libffi}/lib:${openssl.out}/lib"
'';
};
lem-ncurses-shell = pkgs.mkShell {

devShell = pkgs.mkShell {
packages = with pkgs; [
autoconf
automake
libffi.dev
libtool
ncurses.dev
pkg-config
sbcl
sbcl.pkgs.qlot-cli
pkg-config
ncurses.dev
];
# Normally we would include pkg-config and list these dependencies
# in packages, but it does not appear that pkg-config is being used
# when available.
# in the packages attribute, but it does not appear that pkg-config
# is being used when available.
shellHook = with pkgs; ''
export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH}:${ncurses.out}/lib:${libffi}/lib:${openssl.out}/lib"
export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH}:${ncurses.out}/lib:${SDL2}/lib:${SDL2_ttf}/lib:${SDL2_image}/lib:${libffi}/lib:${openssl.out}/lib"
'';
};
in
{
devShells =
{
lem-ncurses = lem-ncurses-shell;
lem-sdl2 = lem-sdl2-shell;
default = lem-ncurses-shell;
};
devShells.default = devShell;
packages.lem-ncurses = lem.overrideLispAttrs (o: {
pname = "lem-ncurses";
meta.mainProgram = "lem";
Expand Down

0 comments on commit 7f878a7

Please sign in to comment.