On 2022/12/28 20:55:21 +0100, Volker Schlecht <openbsd-po...@schlecht.dev> 
wrote:
> With the update to age 1.1.x, and free time galore, I couldn't resist 
> playing with age-plugin-yubikey, which to my surprise worked smoothly
> with my Yubikey 5, once I re-enabled API access to the serial number.
> 
> I'm not sure if that was something I removed myself or whether my Yubi5 
> came with that setting, so I'm not sure if that's worth mentioning in 
> the port.
> 
> If ```ykman list --serials``` shows your key's serial number, everything 
> should just work, if not you may need to use ykpersonalize to set option 
> serial-api-visible first.

can't really tested, looked only for curiosity.

it fails to build if security/pcsc-lite is not installed:

  --- stderr
  thread 'main' panicked at 'Could not find a PCSC library.
  For the target OS `openbsd`, I tried to use pkg-config to find libpcsclite.
  Do you have pkg-config and libpcsclite configured for this target?: 
`"pkg-config" "--libs" "--cflags" "libpcsclite" "libpcsclite >= 1"` did not 
exit successfully: exit status: 1
  error: could not find system library 'libpcsclite' required by the 'pcsc-sys' 
crate

  --- stderr
  Package libpcsclite was not found in the pkg-config search path
  ', 
/home/_pobj/age-plugin-yubikey-0.3.0/age-plugin-yubikey-0.3.0/modcargo-crates/pcsc-sys-1.2.0/build.rs:30:22


you could use ${GH_DISTFILE} instead of ${DISTNAME}${EXTRACT_SUFX},
and HOMEPAGE is already defined by GH_*.

(take the following with a grain of salt because i don't hack on rust
ports usually.)

I'd move the ".include crates.inc" at the end, just above bsd.port.mk
and rearrange WANTLIB.  I guess it should use ${MODCARGO_WANTLIB}, c++
was marked as unused here, and add pcsclite

(could also reduce the indentation of the values, two tabs are enough
usually)

all together:  (plus changing the order as per Makefile.template)

--- Makefile.orig       Thu Dec 29 10:02:10 2022
+++ Makefile    Thu Dec 29 10:14:24 2022
@@ -4,27 +4,26 @@
 GH_PROJECT=                    age-plugin-yubikey
 GH_TAGNAME=                    v0.3.0
 
-HOMEPAGE=                      https://github.com/str4d/age-plugin-yubikey
+CATEGORIES=                    security
 
 MAINTAINER=                    Volker Schlecht <openbsd-po...@schlecht.dev>
 
-CATEGORIES=                    security
-
 # MIT or Apache 2.0
 PERMIT_PACKAGE=                Yes
 
-# as devel/cargo MODULES adds DISTFILES, GH_* didn't
-DISTFILES+=                    ${DISTNAME}${EXTRACT_SUFX}
-MODULES=                       devel/cargo
+WANTLIB += ${MODCARGO_WANTLIB} m pcsclite
 
-WANTLIB+=                      c c++ c++abi m pthread
+DISTFILES+=                    ${GH_DISTNAME}
 
-.include "crates.inc"
+MODULES=                       devel/cargo
 
+LIB_DEPENDS+=          security/pcsc-lite
+
 CONFIGURE_STYLE=       cargo
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/age-plugin-yubikey
        ${INSTALL_DATA} ${WRKSRC}/README.md 
${PREFIX}/share/doc/age-plugin-yubikey
 
+.include "crates.inc"
 .include <bsd.port.mk>

Reply via email to