Unverified Commit 3a375fcd authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #312909 from donovanglover/icoextract-cleanup

icoextract: use thumbnailer from upstream
parents eb0f74b8 0c5ebda7
Loading
Loading
Loading
Loading
+15 −17
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchPypi,
  pefile,
  pillow,
  pythonOlder,
  setuptools,
  python3Packages,
  fetchFromGitHub,
}:

buildPythonPackage rec {
python3Packages.buildPythonApplication rec {
  pname = "icoextract";
  version = "0.1.5";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchPypi {
    inherit pname version;
    extension = "tar.gz";
    hash = "sha256-/UxnWNyRNtwI4Rxx97i5QyjeMrUr5Sq+TfLTmU0xWyc=";
  src = fetchFromGitHub {
    owner = "jlu5";
    repo = "icoextract";
    rev = version;
    hash = "sha256-McVG8966NCEpzc9biawLvUgbQUtterkIud/9GwOeltI=";
  };

  build-system = [ setuptools ];
  build-system = with python3Packages; [ setuptools ];

  dependencies = [
  dependencies = with python3Packages; [
    pefile
    pillow
  ];
@@ -34,8 +29,10 @@ buildPythonPackage rec {
  pythonImportsCheck = [ "icoextract" ];

  postInstall = ''
    mkdir -p $out/share/thumbnailers
    substituteAll ${./exe-thumbnailer.thumbnailer} $out/share/thumbnailers/exe-thumbnailer.thumbnailer
    substituteInPlace exe-thumbnailer.thumbnailer \
      --replace Exec=exe-thumbnailer Exec=$out/bin/exe-thumbnailer

    install -Dm644 exe-thumbnailer.thumbnailer $out/share/thumbnailers
  '';

  meta = with lib; {
@@ -47,5 +44,6 @@ buildPythonPackage rec {
      bryanasdev000
      donovanglover
    ];
    mainProgram = "icoextract";
  };
}
+0 −3
Original line number Diff line number Diff line
[Thumbnailer Entry]
Exec=@out@/bin/exe-thumbnailer -v -s %s %i %o
MimeType=application/x-ms-dos-executable;application/x-dosexec;application/x-msdownload
+3 −1
Original line number Diff line number Diff line
@@ -5757,7 +5757,9 @@ self: super: with self; {
  idasen = callPackage ../development/python-modules/idasen { };
  icoextract = callPackage ../development/python-modules/icoextract { };
  icoextract = toPythonModule (pkgs.icoextract.override {
    python3Packages = self;
  });
  icontract = callPackage ../development/python-modules/icontract { };