Skip to content

Commit

Permalink
Combine Dev Shells & Fix Pure Build (#1761)
Browse files Browse the repository at this point in the history
* combined dev shells and fix for unlocated libffi.h

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.

* which is needed inside completely clean builds

Most systems already have this, but it's pretty cheap to make sure.  Not relying
on any incidental resources is the Nix way.
  • Loading branch information
psionic-k authored Jan 27, 2025
1 parent 7196d4c commit 453d0b9
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,40 +151,29 @@
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
which # this is available in the stdenv and most sane systems
];
# 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 453d0b9

Please sign in to comment.