Unverified Commit aff39662 authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

openct: unbreak, modernize (#396964)

parents ccbe3c52 0f9261e0
Loading
Loading
Loading
Loading
+24 −13
Original line number Diff line number Diff line
@@ -3,28 +3,34 @@
  stdenv,
  fetchFromGitHub,
  autoreconfHook,
  doxygen,
  libxslt,
  pkg-config,
  pcsclite,
  libtool,
  libusb-compat-0_1,
  doxygen,
  libxslt,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "openct";
  version = "0.6.20";

  src = fetchFromGitHub {
    owner = "OpenSC";
    repo = "openct";
    rev = "${pname}-${version}";
    sha256 = "09wxq0jxdxhci3zr7jd3zcxjkl3j0r1v00k3q8gqrg9gighh8nk2";
    rev = "openct-${finalAttrs.version}";
    hash = "sha256-YloE4YsvvYwfwmMCsEMGctApO/ujyZP/iAz21iXAnSc=";
  };

  postPatch = ''
    sed -i 's,$(DESTDIR),$(out),g' etc/Makefile.am
    substituteInPlace etc/Makefile.am \
      --replace-fail "DESTDIR" "out"
  '';

  # unbreak build on GCC 14, remove when https://github.com/OpenSC/openct/pull/12
  # (or equivalent) is merged and released
  env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";

  configureFlags = [
    "--enable-api-doc"
    "--enable-usb"
@@ -35,24 +41,29 @@ stdenv.mkDerivation rec {

  nativeBuildInputs = [
    autoreconfHook
    doxygen
    libxslt # xsltproc
    pkg-config
  ];

  buildInputs = [
    pcsclite
    libtool # libltdl
    libusb-compat-0_1
    doxygen
    libxslt
  ];

  strictDeps = true;

  preInstall = ''
    mkdir -p $out/etc
  '';

  meta = with lib; {
    broken = stdenv.hostPlatform.isDarwin;
  meta = {
    homepage = "https://github.com/OpenSC/openct/";
    license = licenses.lgpl21;
    description = "Drivers for several smart card readers";
    platforms = platforms.all;
    license = lib.licenses.lgpl21;
    maintainers = [ ];
    platforms = lib.platforms.all;
    broken = stdenv.hostPlatform.isDarwin;
  };
}
})