From a5ac6562de2b3edf5f031e11022921d897737414 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Thu, 22 Feb 2024 17:38:28 +0800 Subject: [PATCH] zsh-fzf-tab: unstable-2024-02-01 -> 1.0 --- pkgs/shells/zsh/zsh-fzf-tab/default.nix | 67 ++++++++++++++++++------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/pkgs/shells/zsh/zsh-fzf-tab/default.nix b/pkgs/shells/zsh/zsh-fzf-tab/default.nix index 89e4fe783b93..97a6992ee672 100644 --- a/pkgs/shells/zsh/zsh-fzf-tab/default.nix +++ b/pkgs/shells/zsh/zsh-fzf-tab/default.nix @@ -1,16 +1,16 @@ -{ stdenv, lib, fetchFromGitHub, ncurses, nix-update-script }: +{ stdenv, lib, fetchFromGitHub, zsh, ncurses, nix-update-script }: let INSTALL_PATH="${placeholder "out"}/share/fzf-tab"; in stdenv.mkDerivation rec { pname = "zsh-fzf-tab"; - version = "unstable-2024-02-01"; + version = "1.0"; src = fetchFromGitHub { owner = "Aloxaf"; repo = "fzf-tab"; - rev = "b06e7574577cd729c629419a62029d31d0565a7a"; - hash = "sha256-ilUavAIWmLiMh2PumtErMCpOcR71ZMlQkKhVOTDdHZw="; + rev = "v${version}"; + hash = "sha256-o3R9dh9t8w/SVO3IUeJqP8kkQxwnRjNX8oZ4wSZxBYo="; }; strictDeps = true; @@ -24,31 +24,62 @@ in stdenv.mkDerivation rec { ]; }; - postConfigure = '' + # this script is modified according to fzf-tab/lib-ftb-build-module + configurePhase = '' + runHook preConfigure + pushd modules - ./configure --disable-gdbm --without-tcsetpgrp + + tar -xf ${zsh.src} + ln -s $(pwd)/src/fzftab.c zsh-${zsh.version}/Src/Modules/ + ln -s $(pwd)/src/fzftab.mdd zsh-${zsh.version}/Src/Modules/ + + pushd zsh-${zsh.version} + + + if [[ ! -f ./configure ]]; then + ./Util/preconfig + fi + if [[ ! -f ./Makefile ]]; then + ./configure --disable-gdbm --without-tcsetpgrp + fi + popd + popd + + runHook postConfigure ''; - postBuild = '' - pushd modules + buildPhase = '' + runHook preBuild + + pushd modules/zsh-${zsh.version} make -j$NIX_BUILD_CORES popd + + runHook postBuild ''; installPhase = '' - mkdir -p ${INSTALL_PATH} - cp -r lib ${INSTALL_PATH}/lib - install -D fzf-tab.zsh ${INSTALL_PATH}/fzf-tab.zsh - install -D fzf-tab.plugin.zsh ${INSTALL_PATH}/fzf-tab.plugin.zsh - install -D modules/Src/aloxaf/fzftab.so ${INSTALL_PATH}/modules/Src/aloxaf/fzftab.so + runHook preInstall + + mkdir -p ${INSTALL_PATH} + cp -r lib ${INSTALL_PATH}/lib + install -D fzf-tab.zsh ${INSTALL_PATH}/fzf-tab.zsh + install -D fzf-tab.plugin.zsh ${INSTALL_PATH}/fzf-tab.plugin.zsh + pushd modules/zsh-${zsh.version}/Src/Modules + if [[ -e "fzftab.so" ]]; then + install -D -t ${INSTALL_PATH}/modules/Src/aloxaf/ fzftab.so + fi + if [[ -e "fzftab.bundle" ]]; then + install -D -t ${INSTALL_PATH}/modules/Src/aloxaf/ fzftab.bundle + fi + popd + + runHook postInstall ''; - passthru = { - updateScript = nix-update-script { - extraArgs = [ "--version" "branch=master" ]; - }; - }; + passthru.updateScript = nix-update-script { }; meta = with lib; { homepage = "https://github.com/Aloxaf/fzf-tab";