Unverified Commit c9be2672 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

etcher: remove (#295853)

parent ae86a507
Loading
Loading
Loading
Loading
+0 −72
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchurl
, bash
, util-linux
, autoPatchelfHook
, dpkg
, makeWrapper
, udev
, electron
}:

stdenv.mkDerivation rec {
  pname = "etcher";
  version = "1.18.12";

  src = fetchurl {
    url = "https://github.com/balena-io/etcher/releases/download/v${version}/balena-etcher_${version}_amd64.deb";
    hash = "sha256-Ucs187xTpbRJ7P32hCl8cHPxO3HCs44ZneAas043FXk=";
  };

  # sudo-prompt has hardcoded binary paths on Linux and we patch them here
  # along with some other paths
  postPatch = ''
    substituteInPlace opt/balenaEtcher/resources/app/generated/gui.js \
      --replace '/usr/bin/pkexec' '/usr/bin/pkexec", "/run/wrappers/bin/pkexec' \
      --replace '/bin/bash' '${bash}/bin/bash' \
      --replace '"lsblk"' '"${util-linux}/bin/lsblk"'
  '';

  nativeBuildInputs = [
    autoPatchelfHook
    dpkg
    makeWrapper
  ];

  buildInputs = [
    stdenv.cc.cc.lib
    udev
  ];

  dontConfigure = true;

  dontBuild = true;

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin $out/share/${pname}

    cp -a usr/share/* $out/share
    cp -a opt/balenaEtcher/{locales,resources} $out/share/${pname}

    makeWrapper ${electron}/bin/electron $out/bin/${pname} \
      --add-flags $out/share/${pname}/resources/app

    substituteInPlace $out/share/applications/balena-etcher.desktop \
      --replace /opt/balenaEtcher/balena-etcher ${pname}

    runHook postInstall
  '';

  meta = with lib; {
    description = "Flash OS images to SD cards and USB drives, safely and easily";
    homepage = "https://etcher.io/";
    license = licenses.asl20;
    mainProgram = "etcher";
    maintainers = with maintainers; [ wegank ];
    platforms = [ "x86_64-linux" ];
    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
  };
}
+1 −0
Original line number Diff line number Diff line
@@ -286,6 +286,7 @@ mapAliases ({
  erlang_23 = throw "erlangR23 has been removed in favor of newer versions."; # added 2023-09-11
  erlangR23 = erlang_23;
  etcd_3_3 = throw "etcd_3_3 has been removed because upstream no longer maintains it"; # Added 2023-09-29
  etcher = throw "'etcher' has been removed because it depended on an insecure version of Electron"; # Added 2024-03-14
  eterm = throw "eterm was removed because it is still insecure: https://github.com/mej/Eterm/issues/7"; # Added 2023-09-10
  exa = throw "'exa' has been removed because it is unmaintained upstream. Consider using 'eza', a maintained fork"; # Added 2023-09-07
  exhibitor = throw "'exhibitor' has been removed because it is unmaintained upstream"; # Added 2023-06-20
+0 −4
Original line number Diff line number Diff line
@@ -7942,10 +7942,6 @@ with pkgs;
  esshader = callPackage ../tools/graphics/esshader { };
  etcher = callPackage ../tools/misc/etcher {
    electron = electron_19;
  };
  ethercalc = callPackage ../servers/web-apps/ethercalc { };
  ethtool = callPackage ../tools/misc/ethtool { };