mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
83 lines
1.9 KiB
Nix
83 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
melpaBuild,
|
|
nix-update-script,
|
|
stdenv,
|
|
zig_0_15,
|
|
emacs,
|
|
xcbuild,
|
|
}:
|
|
|
|
let
|
|
zig = zig_0_15;
|
|
|
|
pname = "ghostel";
|
|
|
|
version = "0.41.0-unstable-2026-07-05";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "dakra";
|
|
repo = "ghostel";
|
|
rev = "f77efee9172854abc08652637d23adc26faa25a2";
|
|
hash = "sha256-6ME+aStZ9X1pkTr0uwwhrJXEHu/uLStPHsKtbudXl9I=";
|
|
};
|
|
|
|
module = stdenv.mkDerivation (finalAttrs: {
|
|
inherit pname version src;
|
|
|
|
deps = zig.fetchDeps {
|
|
inherit (finalAttrs) src pname version;
|
|
fetchAll = true;
|
|
hash = "sha256-lFU0ywNyP1q2NL9MkIfWciH03VAA/Act5dGYAV4V7EY=";
|
|
};
|
|
|
|
nativeBuildInputs = [ zig ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
|
|
|
|
env.EMACS_INCLUDE_DIR = "${emacs}/include";
|
|
|
|
dontSetZigDefaultFlags = true;
|
|
|
|
doCheck = true;
|
|
|
|
zigCheckFlags = [
|
|
"-Dcpu=baseline"
|
|
# See https://github.com/ghostty-org/ghostty/blob/main/PACKAGING.md#build-options
|
|
"-Doptimize=ReleaseFast"
|
|
];
|
|
|
|
zigBuildFlags = finalAttrs.zigCheckFlags;
|
|
|
|
postConfigure = ''
|
|
cp -rLT ${finalAttrs.deps} "$ZIG_GLOBAL_CACHE_DIR/p"
|
|
chmod -R u+w "$ZIG_GLOBAL_CACHE_DIR/p"
|
|
'';
|
|
});
|
|
|
|
libExt = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
in
|
|
melpaBuild {
|
|
inherit pname version src;
|
|
|
|
files = ''
|
|
(:defaults "etc" "ghostel-module${libExt}" "ghostel-module.version")
|
|
'';
|
|
|
|
preBuild = ''
|
|
install ${module}/ghostel-module${libExt} ghostel-module${libExt}
|
|
install --mode=444 ${module}/ghostel-module.version ghostel-module.version
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script { extraArgs = [ "--version=branch=main" ]; };
|
|
|
|
inherit module;
|
|
};
|
|
|
|
meta = {
|
|
homepage = "https://github.com/dakra/ghostel";
|
|
description = "Terminal emulator powered by libghostty";
|
|
maintainers = with lib.maintainers; [ vonfry ];
|
|
license = lib.licenses.gpl3Plus;
|
|
};
|
|
}
|