Unverified Commit deab3241 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

thedesk: 24.2.1 -> 25.2.2 (#441743)

parents a6d7d4fd 9e828427
Loading
Loading
Loading
Loading
+26 −24
Original line number Diff line number Diff line
@@ -5,65 +5,67 @@
  dpkg,
  autoPatchelfHook,
  makeWrapper,
  electron,
  alsa-lib,
  gtk3,
  libxshmfence,
  libgbm,
  libGL,
  musl,
  nss,
  systemd,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "thedesk";
  version = "24.2.1";
  version = "25.2.2";

  src = fetchurl {
    url = "https://github.com/cutls/TheDesk/releases/download/v${version}/${pname}_${version}_amd64.deb";
    sha256 = "sha256-AdjygNnQ3qQB03cGcQ5EB0cY3XXWLrzfCqw/U8tq1Yo=";
    url = "https://github.com/cutls/thedesk-next/releases/download/v${finalAttrs.version}/thedesk-next_${finalAttrs.version}_amd64.deb";
    hash = "sha256-9Xd0YHkFHPVY6BHy0V1X7p27m2iJFVHmSickzMJeOXs=";
  };

  nativeBuildInputs = [
    dpkg
    autoPatchelfHook
    dpkg
    makeWrapper
  ];

  buildInputs = [
    alsa-lib
    gtk3
    libxshmfence
    libgbm
    libGL
    libxshmfence
    musl
    nss
  ];

  dontBuild = true;
  dontConfigure = true;
  runtimeDependencies = [ systemd ];

  installPhase = ''
    runHook preInstall

    mv usr $out
    mv opt $out

    # binary is not used and probably vulnerable to CVE(s)
    rm $out/opt/TheDesk/thedesk

    substituteInPlace $out/share/applications/thedesk.desktop \
      --replace '/opt/TheDesk' $out/bin

    makeWrapper ${electron}/bin/electron $out/bin/thedesk \
      --add-flags $out/opt/TheDesk/resources/app.asar
    substituteInPlace usr/share/applications/thedesk-next.desktop \
      --replace-fail "/opt/TheDesk/thedesk-next" "thedesk"
    cp --recursive usr $out
    mkdir $out/libexec $out/bin
    cp --recursive opt/TheDesk $out/libexec/thedesk
    ln --symbolic $out/libexec/thedesk/thedesk-next $out/bin/thedesk

    runHook postInstall
  '';

  meta = with lib; {
  preFixup = ''
    patchelf --add-needed libGL.so.1 $out/libexec/thedesk/thedesk-next
  '';

  meta = {
    description = "Mastodon/Misskey Client for PC";
    homepage = "https://thedesk.top";
    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
    license = licenses.gpl3Only;
    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
    license = lib.licenses.gpl3Only;
    maintainers = [ ];
    platforms = [ "x86_64-linux" ];
    mainProgram = "thedesk";
  };
}
})