Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabby-terminal: init at 1.0.207 #303924

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3582,6 +3582,12 @@
githubId = 1118859;
name = "Scott Worley";
};
ChocolateLoverRaj = {
github = "ChocolateLoverRaj";
githubId = 52586855;
matrix = "@chocolateloverraj:matrix.org";
name = "Rajas Paranjpe";
};
choochootrain = {
email = "[email protected]";
github = "choochootrain";
Expand Down
64 changes: 64 additions & 0 deletions pkgs/by-name/ta/tabby-terminal/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{ stdenv, fetchurl, pkgs, lib, alsa-lib }:
Copy link
Contributor

@eclairevoyant eclairevoyant Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ stdenv, fetchurl, pkgs, lib, alsa-lib }:
{ stdenv, fetchurl, lib, alsa-lib }:

Definitely don't pass pkgs in; pass in the dependencies individually.


stdenv.mkDerivation rec {
pname = "tabby-terminal";
version = "1.0.207";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nonblocking - but fyi, 1.0.208 is out

src = fetchurl {
url = "https://github.com/Eugeny/tabby/releases/download/v${version}/tabby-${version}-linux-x64.deb";
hash = "sha256-PTTkL3+mYb7KM8fDUmgCuAF2lU88fYOstGWp/O5WZas=";
};

nativeBuildInputs = with pkgs; [
dpkg
makeWrapper
];

buildInputs = with pkgs; [
glib
nss
nspr
atk
cups
dbus
libdrm
gtk3
pango
cairo
xorg.libX11
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXrandr
libxkbcommon
mesa
expat
xorg.libxcb
alsa-lib
libGL
libsecret
musl
ChocolateLoverRaj marked this conversation as resolved.
Show resolved Hide resolved
];

postInstall = ''
mkdir -p $out/{opt,bin}
cp -r opt $out
wrapProgram "$out/opt/Tabby/tabby" --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}} --no-sandbox" --set LD_LIBRARY_PATH=${lib.makeLibraryPath buildInputs}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wrapProgram "$out/opt/Tabby/tabby" --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}} --no-sandbox" --set LD_LIBRARY_PATH=${lib.makeLibraryPath buildInputs}
wrapProgram "$out/opt/Tabby/tabby" --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}} --no-sandbox"

Don't prioritize LD_LIBRARY_PATH. Try using autoPatchelfHook instead. See https://nixos.org/manual/nixpkgs/unstable/#setup-hook-autopatchelfhook (You have to look carefully how buildInputs works in this case, and use some runtimeDependencies if that doesn't work)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this:

{
  stdenv,
  fetchurl,
  pkgs,
  lib,
  alsa-lib,
}:

stdenv.mkDerivation rec {
  name = "tabby-terminal";
  version = "1.0.207";
  src = fetchurl {
    url = "https://github.com/Eugeny/tabby/releases/download/v${version}/tabby-${version}-linux-x64.deb";
    hash = "sha256-PTTkL3+mYb7KM8fDUmgCuAF2lU88fYOstGWp/O5WZas=";
  };

  nativeBuildInputs = with pkgs; [
    dpkg
    autoPatchelfHook
  ];

  buildInputs = with pkgs; [
    glib
    nss
    nspr
    atk
    cups
    dbus
    libdrm
    gtk3
    pango
    cairo
    xorg.libX11
    xorg.libXcomposite
    xorg.libXdamage
    xorg.libXext
    xorg.libXfixes
    xorg.libXrandr
    libxkbcommon
    mesa
    expat
    xorg.libxcb
    alsa-lib
    libGL
    libsecret
    musl
  ];

  runtimeDependencies = buildInputs;

  postInstall = ''
    mkdir -p $out/{opt,bin}
    cp -r opt $out
    # wrapProgram "$out/opt/Tabby/tabby" --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}} --no-sandbox"
    cp -r usr/* $out

    mv $out/opt/Tabby/tabby $out/bin/tabby

    substituteInPlace $out/share/applications/tabby.desktop \
      --replace "/opt/Tabby/tabby" tabby
  '';

  meta = with lib; {
    homepage = "https://tabby.sh";
    description = "A terminal for a more modern age";
    license = licenses.mit;
    maintainers = with maintainers; [ ChocolateLoverRaj ];
    mainProgram = "tabby";
    platforms = platforms.linux;
    downloadPage = "https://github.com/Eugeny/tabby/releases/latest";
  };
}

When I run it I get this error:

[rajas@nixos:~/Documents/nixpkgs]$ ./result/bin/tabby 
[0516/104608.334415:ERROR:icu_util.cc(240)] Invalid file descriptor to ICU data received.
Trace/breakpoint trap (core dumped)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ico is missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuperSandro2000 should I try adding xorg.ico?

cp -r usr/* $out

ln -s $out/opt/Tabby/tabby $out/bin/tabby
ChocolateLoverRaj marked this conversation as resolved.
Show resolved Hide resolved

substituteInPlace $out/share/applications/tabby.desktop \
--replace "/opt" $out/opt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful with absolute path in desktop entry. See #308324

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem to be fixed:

$ cat result/share/applications/tabby.desktop | grep Exec
Exec=/nix/store/5j7s1cl4y7f6v57iyd998rm1dg828hym-tabby-terminal-1.0.207/opt/Tabby/tabby --no-sandbox %U

'';

meta = with lib; {
homepage = "https://tabby.sh";
description = "A terminal for a more modern age";
license = licenses.mit;
maintainers = with maintainers; [ ChocolateLoverRaj ];
mainProgram = "tabby";
platforms = platforms.linux;
downloadPage = "https://github.com/Eugeny/tabby/releases/latest";
};
}