diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
commit | 80d90d9b204f7c17912740f9f414fe5d59f293ba (patch) | |
tree | 5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune | |
parent | 3a31a84c7d3e589035ad08499206aac44a81f424 (diff) | |
parent | 83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff) |
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune')
8 files changed, 66 insertions, 74 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/default.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/default.nix index eec14f286ba7..f1f811066597 100644 --- a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/default.nix @@ -30,6 +30,15 @@ stdenv.mkDerivation rec { $out/bin/kak -ui json -E "kill 0" ''; + postInstall = '' + # make share/kak/autoload a directory, so we can use symlinkJoin with plugins + cd "$out/share/kak" + autoload_target=$(readlink autoload) + rm autoload + mkdir autoload + ln -s --relative "$autoload_target" autoload + ''; + meta = { homepage = "http://kakoune.org/"; description = "A vim inspired text editor"; diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/case.kak.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/case.kak.nix index 20df2872628f..6a2ef200e6e1 100644 --- a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/case.kak.nix +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/case.kak.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { ''; meta = with stdenv.lib; { - description = "Ease navigation between opened buffers in Kakoune"; + description = "Case convention conversion for Kakoune"; homepage = "https://gitlab.com/FlyingWombat/case.kak"; license = licenses.unlicense; maintainers = with maintainers; [ eraserhd ]; diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/default.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/default.nix index 3926973f7ead..168c1d06b31e 100644 --- a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/default.nix @@ -1,7 +1,7 @@ -{ pkgs, parinfer-rust }: +{ pkgs, parinfer-rust, rep }: { - inherit parinfer-rust; + inherit parinfer-rust rep; case-kak = pkgs.callPackage ./case.kak.nix { }; kak-ansi = pkgs.callPackage ./kak-ansi.nix { }; @@ -12,4 +12,5 @@ kak-powerline = pkgs.callPackage ./kak-powerline.nix { }; kak-prelude = pkgs.callPackage ./kak-prelude.nix { }; kak-vertical-selection = pkgs.callPackage ./kak-vertical-selection.nix { }; + openscad-kak = pkgs.callPackage ./openscad.kak.nix { }; } diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix index 512f1f09207b..4b67f7609769 100644 --- a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix @@ -1,12 +1,12 @@ { stdenv, fetchFromGitHub }: stdenv.mkDerivation { name = "kak-auto-pairs"; - version = "2019-07-27"; + version = "2020-07-14"; src = fetchFromGitHub { owner = "alexherbo2"; repo = "auto-pairs.kak"; - rev = "886449b1a04d43e5deb2f0ef4b1aead6084c7a5f"; - sha256 = "0knfhdvslzw1f1r1k16733yhkczrg3yijjz6n2qwira84iv3239j"; + rev = "5b4b3b723c34c8b7f40cee60868204974349bf9f"; + sha256 = "1wgrv03f1lkzflbbaz8n23glij5rvfxf8pcqysd668mbx1hcrk9i"; }; installPhase = '' diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix index ee9c125827c8..8fd5fba7d7ed 100644 --- a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { installPhase = '' mkdir -p $out/share/kak/autoload/plugins - cp -r rc $out/share/kak/autoload/plugins/auto-pairs + cp -r rc $out/share/kak/autoload/plugins/prelude ''; meta = with stdenv.lib; diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/openscad.kak.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/openscad.kak.nix new file mode 100644 index 000000000000..21c8b7a60cca --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/plugins/openscad.kak.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation { + pname = "openscad.kak"; + version = "unstable-2019-11-08"; + + src = fetchFromGitHub { + owner = "mayjs"; + repo = "openscad.kak"; + rev = "d9143d5e7834e3356b49720664d5647cab9db7cc"; + sha256 = "0j4dqhrn56z77hdalfdxagwz8h6nwr8s9i4w0bs2644k72lsm2ix"; + }; + + installPhase = '' + install -Dm644 rc/openscad.kak -t $out/share/kak/autoload/plugins/ + ''; + + meta = with stdenv.lib; { + description = "Syntax highlighting for OpenSCAD files"; + homepage = "https://github.com/mayjs/openscad.kak"; + license = licenses.unlicense; + maintainers = with maintainers; [ eraserhd ]; + platforms = platforms.all; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix index b4cc823880e7..7ac56d9cb1e0 100644 --- a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix @@ -1,44 +1,31 @@ -{ stdenv, bash }: -with stdenv.lib; - -kakoune: +{ symlinkJoin, makeWrapper, kakoune, plugins ? [], configure ? {} }: let - getPlugins = { plugins ? [] }: plugins; + # "plugins" is the preferred way, but some configurations may be + # using "configure.plugins", so accept both + requestedPlugins = plugins ++ (configure.plugins or []); - wrapper = { configure ? {} }: - stdenv.mkDerivation rec { - pname = "kakoune"; - version = getVersion kakoune; +in + symlinkJoin { + name = "kakoune-${kakoune.version}"; - src = ./.; - buildCommand = '' - mkdir -p $out/share/kak - for plugin in ${strings.escapeShellArgs (getPlugins configure)}; do - if [[ -d $plugin/share/kak/autoload ]]; then - find "$plugin/share/kak/autoload" -type f -name '*.kak'| while read rcfile; do - printf 'source "%s"\n' "$rcfile" - done - fi - done >>$out/share/kak/plugins.kak + buildInputs = [ makeWrapper ]; - mkdir -p $out/bin - substitute ${src}/wrapper.sh $out/bin/kak \ - --subst-var-by bash "${bash}" \ - --subst-var-by kakoune "${kakoune}" \ - --subst-var-by out "$out" - chmod +x $out/bin/kak - ''; + paths = [ kakoune ] ++ requestedPlugins; - preferLocalBuild = true; - buildInputs = [ bash kakoune ]; - passthru = { unwrapped = kakoune; }; + postBuild = '' + # location of kak binary is used to find ../share/kak/autoload, + # unless explicitly overriden with KAKOUNE_RUNTIME + rm "$out/bin/kak" + makeWrapper "${kakoune}/bin/kak" "$out/bin/kak" --set KAKOUNE_RUNTIME "$out/share/kak" - meta = kakoune.meta // { - # prefer wrapper over the package - priority = (kakoune.meta.priority or 0) - 1; - hydraPlatforms = []; - }; - }; -in - makeOverridable wrapper + # currently kakoune ignores doc files if they are symlinks, so workaround by + # copying doc files over, so they become regular files... + mkdir "$out/DELETE_ME" + mv "$out/share/kak/doc" "$out/DELETE_ME" + cp -r --dereference "$out/DELETE_ME/doc" "$out/share/kak" + rm -Rf "$out/DELETE_ME" + ''; + + meta = kakoune.meta // { priority = (kakoune.meta.priority or 0) - 1; }; + } diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/wrapper.sh b/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/wrapper.sh deleted file mode 100644 index 48a971a10c6e..000000000000 --- a/infra/libkookie/nixpkgs/pkgs/applications/editors/kakoune/wrapper.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!@bash@/bin/bash - -# We use the -E option to load plugins. This only makes sense when we are -# starting a new session, so we detect that. Also, Kakoune can only handle -# one -E option, so we prepend loading plugins to an existing one. -args=( "$@" ) -loadPlugins=true -EValueOffset=-1 -pluginScript='@out@/share/kak/plugins.kak' - -for (( i = 0; i < ${#args[@]}; i++ )); do - case "${args[i]}" in - -n|-c|-l|-p|-clear|-version) loadPlugins=false;; - -E) EValueOffset=$(( i + 1 ));; - --) break;; - esac - case "${args[i]}" in - -E|-c|-e|-s|-p|-f|-i|-ui|-debug) i=$(( i + 1 ));; - esac -done - -if [[ $loadPlugins = true ]]; then - if (( EValueOffset >= 0 )); then - args[EValueOffset]="source '$pluginScript'"$'\n'"${args[EValueOffset]}" - else - args=( "-E" "source '$pluginScript'" "${args[@]}" ) - fi -fi - -exec @kakoune@/bin/kak "${args[@]}" |