From 0f9261e03d217dd874eac8e9c0ad4cc5fbd408e3 Mon Sep 17 00:00:00 2001 From: awwpotato Date: Mon, 7 Apr 2025 18:27:03 -0700 Subject: [PATCH] openct: unbreak, modernize --- pkgs/by-name/op/openct/package.nix | 39 +++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/op/openct/package.nix b/pkgs/by-name/op/openct/package.nix index 2b25bf2614c5..62c2f5ed9e40 100644 --- a/pkgs/by-name/op/openct/package.nix +++ b/pkgs/by-name/op/openct/package.nix @@ -3,28 +3,34 @@ stdenv, fetchFromGitHub, autoreconfHook, - pkg-config, - pcsclite, - libusb-compat-0_1, doxygen, libxslt, + pkg-config, + pcsclite, + libtool, + libusb-compat-0_1, }: -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; }; -} +})