From 7f878a7141f08f6c9a9bc0f2f1d838096d9d439b Mon Sep 17 00:00:00 2001 From: Psionik K <73710933+psionic-k@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:16:48 +0900 Subject: [PATCH] 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. --- flake.nix | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/flake.nix b/flake.nix index 8a3987932..2c864d4d7 100644 --- a/flake.nix +++ b/flake.nix @@ -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";