about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorlassulus <github@lassul.us>2024-02-24 08:44:03 +0700
committerGitHub <noreply@github.com>2024-02-24 08:44:03 +0700
commita438c431ba249e81f2bdb3dedd6b79492d2b7238 (patch)
tree1e940baf0a7067e3f571d95b69bb18e492fade2a /pkgs/shells
parent84a19992c3dda55ab9491c59db7524a5ea7faca6 (diff)
parenta5ac6562de2b3edf5f031e11022921d897737414 (diff)
downloadnixlib-a438c431ba249e81f2bdb3dedd6b79492d2b7238.tar
nixlib-a438c431ba249e81f2bdb3dedd6b79492d2b7238.tar.gz
nixlib-a438c431ba249e81f2bdb3dedd6b79492d2b7238.tar.bz2
nixlib-a438c431ba249e81f2bdb3dedd6b79492d2b7238.tar.lz
nixlib-a438c431ba249e81f2bdb3dedd6b79492d2b7238.tar.xz
nixlib-a438c431ba249e81f2bdb3dedd6b79492d2b7238.tar.zst
nixlib-a438c431ba249e81f2bdb3dedd6b79492d2b7238.zip
Merge pull request #290612 from Vonfry/update/fzf-tab-1.0
zsh-fzf-tab: unstable-2024-02-01 -> 1.0
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/zsh/zsh-fzf-tab/default.nix67
1 files 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";