|
|
|
@ -20,27 +20,36 @@
|
|
|
|
|
# Set default package to helix-term release build
|
|
|
|
|
defaultOutputs = { app = "hx"; package = "helix"; };
|
|
|
|
|
overrides = {
|
|
|
|
|
crateOverrides = common: _: {
|
|
|
|
|
helix-term = prev: {
|
|
|
|
|
# link languages and theme toml files since helix-term expects them (for tests)
|
|
|
|
|
preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} ..";
|
|
|
|
|
buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
|
|
|
|
|
};
|
|
|
|
|
crateOverrides = common: _: rec {
|
|
|
|
|
# link languages and theme toml files since helix-view expects them
|
|
|
|
|
helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml} .."; };
|
|
|
|
|
helix-syntax = _prev: {
|
|
|
|
|
helix-view = _: { preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml,base16_theme.toml} .."; };
|
|
|
|
|
helix-syntax = prev: {
|
|
|
|
|
src =
|
|
|
|
|
let
|
|
|
|
|
pkgs = common.pkgs;
|
|
|
|
|
helix = pkgs.fetchgit {
|
|
|
|
|
url = "https://github.com/helix-editor/helix.git";
|
|
|
|
|
rev = "a8fd33ac012a79069ef1409503a2edcf3a585153";
|
|
|
|
|
fetchSubmodules = true;
|
|
|
|
|
sha256 = "sha256-5AtOC55ttWT+7RYMboaFxpGZML51ix93wAkYJTt+8JI=";
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
pkgs.runCommand prev.src.name { } ''
|
|
|
|
|
mkdir -p $out
|
|
|
|
|
ln -s ${prev.src}/* $out
|
|
|
|
|
ln -sf ${helix}/helix-syntax/languages $out
|
|
|
|
|
'';
|
|
|
|
|
preConfigure = "mkdir -p ../runtime/grammars";
|
|
|
|
|
postInstall = "cp -r ../runtime $out/runtime";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
mainBuild = common: prev:
|
|
|
|
|
helix-term = prev:
|
|
|
|
|
let
|
|
|
|
|
inherit (common) pkgs lib;
|
|
|
|
|
helixSyntax = lib.buildCrate {
|
|
|
|
|
root = self;
|
|
|
|
|
memberName = "helix-syntax";
|
|
|
|
|
defaultCrateOverrides = {
|
|
|
|
|
helix-syntax = common.crateOverrides.helix-syntax;
|
|
|
|
|
helix-syntax = helix-syntax;
|
|
|
|
|
};
|
|
|
|
|
release = false;
|
|
|
|
|
};
|
|
|
|
@ -50,7 +59,10 @@
|
|
|
|
|
ln -sf ${helixSyntax}/runtime/grammars $out
|
|
|
|
|
'';
|
|
|
|
|
in
|
|
|
|
|
lib.optionalAttrs (common.memberName == "helix-term") {
|
|
|
|
|
{
|
|
|
|
|
# link languages and theme toml files since helix-term expects them (for tests)
|
|
|
|
|
preConfigure = "ln -s ${common.root}/{languages.toml,theme.toml,base16_theme.toml} ..";
|
|
|
|
|
buildInputs = (prev.buildInputs or [ ]) ++ [ common.cCompiler.cc.lib ];
|
|
|
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
|
|
|
postFixup = ''
|
|
|
|
|
if [ -f "$out/bin/hx" ]; then
|
|
|
|
@ -58,6 +70,7 @@
|
|
|
|
|
fi
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
shell = common: prev: {
|
|
|
|
|
packages = prev.packages ++ (with common.pkgs; [ lld_13 lldb cargo-tarpaulin ]);
|
|
|
|
|
env = prev.env ++ [
|
|
|
|
|