2023-03-15 16:39:30 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchzip
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeWrapper
|
|
|
|
, runCommand
|
|
|
|
, appimageTools
|
2023-07-15 17:15:38 +00:00
|
|
|
, icu
|
2023-03-15 16:39:30 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "jetbrains-toolbox";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.2.3.20090";
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://download.jetbrains.com/toolbox/jetbrains-toolbox-${version}.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-SqxQF5pG61CySsDzdZ1P2C9cCe/B145D0S+T4NByif8=";
|
2023-03-15 16:39:30 +00:00
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
appimageContents = runCommand "${pname}-extracted"
|
|
|
|
{
|
|
|
|
nativeBuildInputs = [ appimageTools.appimage-exec ];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
appimage-exec.sh -x $out ${src}/${pname}-${version}/${pname}
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
# JetBrains ship a broken desktop file. Despite registering a custom
|
|
|
|
# scheme handler for jetbrains:// URLs, they never mark the command as
|
|
|
|
# being suitable for passing URLs to. Ergo, the handler never receives
|
|
|
|
# its payload. This causes various things to break, including login.
|
|
|
|
# Reported upstream at: https://youtrack.jetbrains.com/issue/TBX-11478/
|
|
|
|
sed -Ei '/^Exec=/s/( %U)?$/ %U/' $out/jetbrains-toolbox.desktop
|
2023-03-15 16:39:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
appimage = appimageTools.wrapAppImage {
|
|
|
|
inherit pname version;
|
|
|
|
src = appimageContents;
|
|
|
|
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.targetPkgs pkgs);
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname version src appimage;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper copyDesktopItems ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm644 ${appimageContents}/.DirIcon $out/share/icons/hicolor/scalable/apps/jetbrains-toolbox.svg
|
2023-07-15 17:15:38 +00:00
|
|
|
makeWrapper ${appimage}/bin/${pname}-${version} $out/bin/${pname} \
|
|
|
|
--append-flags "--update-failed" \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [icu]}
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
desktopItems = [ "${appimageContents}/jetbrains-toolbox.desktop" ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
# Disabling the tests, this seems to be very difficult to test this app.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Jetbrains Toolbox";
|
|
|
|
homepage = "https://jetbrains.com/";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ AnatolyPopov ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "jetbrains-toolbox";
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
}
|