make dev/install to add a dev install

This commit is contained in:
Mitchell Hashimoto
2022-07-31 16:11:01 -07:00
parent 9779b565bf
commit d614da2435
3 changed files with 25 additions and 2 deletions

View File

@ -3,6 +3,14 @@ init:
git submodule update --init --recursive
.PHONY: init
# Slightly cursed way that we setup a dev version of this locally on NixOS.
dev/install:
zig build -Dcpu=baseline
patchelf --set-rpath "${LD_LIBRARY_PATH}" zig-out/bin/ghostty
mkdir -p ${HOME}/bin
cp zig-out/bin/ghostty ${HOME}/bin/devtty
.PHONY: dev/install
# glad updates the GLAD loader. To use this, place the generated glad.zip
# in this directory next to the Makefile, remove vendor/glad and run this target.
#

View File

@ -22,7 +22,18 @@
, libXi
, libXinerama
, libXrandr
}: mkShell rec {
}:
let
# See package.nix. Keep in sync.
rpathLibs = [
libGL
] ++ lib.optionals stdenv.isLinux [
libX11
libXcursor
libXi
libXrandr
];
in mkShell rec {
name = "ghostty";
nativeBuildInputs = [
@ -50,5 +61,7 @@
libXrandr
];
LD_LIBRARY_PATH = "${libX11}/lib:${libGL}/lib";
# This should be set onto the rpath of the ghostty binary if you want
# it to be "portable" across the system.
LD_LIBRARY_PATH = lib.makeLibraryPath rpathLibs;
}

View File

@ -1,3 +1,5 @@
# TODO(mitchellh): This currenly doesn't fully work. It generates a binary
# that smashes the stack on run. I'm not sure why.
{ stdenv
, lib
, libGL