Unverified Commit f44054eb authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

hexio: 1.0-RC1 -> 1.1, remove python2 (#389883)

parents 750fef2a 49a729cc
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchFromGitLab,
  pcsclite,
  pth,
  python2,
  python3Packages,
}:

stdenv.mkDerivation rec {
  pname = "hexio";
  version = "1.0-RC1";
  version = "1.1";

  src = fetchFromGitHub {
    sha256 = "08jxkdi0gjsi8s793f9kdlad0a58a0xpsaayrsnpn9bpmm5cgihq";
    rev = "version-${version}";
  src = fetchFromGitLab {
    owner = "vanrein";
    repo = "hexio";
    tag = "v${version}";
    hash = "sha256-jp7VHT08Rhw5nUtNpqkRHDHT0R51PCBy0cKb1sI6zkg=";
  };

  strictDeps = true;

  nativeBuildInputs = [ python3Packages.wrapPython ];

  buildInputs = [
    pcsclite
    pth
    python2
  ];

  patchPhase = ''
  postPatch = ''
    substituteInPlace Makefile \
      --replace '-I/usr/local/include/PCSC/' '-I${lib.getDev pcsclite}/include/PCSC/' \
      --replace '-L/usr/local/lib/pth' '-I${pth}/lib/'
      --replace-fail '-I/usr/local/include/PCSC/' '-I${lib.getDev pcsclite}/include/PCSC/' \
      --replace-fail '-L/usr/local/lib/pth' '-I${pth}/lib/'
  '';

  installPhase = ''
@@ -38,6 +38,10 @@ stdenv.mkDerivation rec {
    make DESTDIR=$out PREFIX=/ install
  '';

  postFixup = ''
    wrapPythonPrograms
  '';

  meta = with lib; {
    description = "Low-level I/O helpers for hexadecimal, tty/serial devices and so on";
    homepage = "https://github.com/vanrein/hexio";