zsh-fzf-tab: unstable-2024-02-01 -> 1.0

This commit is contained in:
Vonfry 2024-02-22 17:38:28 +08:00
parent 1a14e86745
commit a5ac6562de
No known key found for this signature in database
GPG Key ID: F9D4E1576A3F8A60

View File

@ -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";