3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/yubikey-personalization/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

42 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libusb1, libyubikey, json_c }:
stdenv.mkDerivation rec {
pname = "yubikey-personalization";
version = "1.20.0";
src = fetchurl {
url = "https://developers.yubico.com/yubikey-personalization/Releases/ykpers-${version}.tar.gz";
sha256 = "14wvlwqnwj0gllkpvfqiy8ns938bwvjsz8x1hmymmx32m074vj0f";
};
patches = [
# remove after updating to next release
(fetchpatch {
name = "json-c-0.14-support.patch";
url = "https://github.com/Yubico/yubikey-personalization/commit/0aa2e2cae2e1777863993a10c809bb50f4cde7f8.patch";
sha256 = "1wnigf3hbq59i15kgxpq3pwrl1drpbj134x81mmv9xm1r44cjva8";
})
];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libusb1 libyubikey json_c ];
configureFlags = [
"--with-backend=libusb-1.0"
];
doCheck = true;
postInstall = ''
# Don't use 70-yubikey.rules because it depends on ConsoleKit
install -D -t $out/lib/udev/rules.d 69-yubikey.rules
'';
meta = with lib; {
homepage = "https://developers.yubico.com/yubikey-personalization";
description = "A library and command line tool to personalize YubiKeys";
license = licenses.bsd2;
platforms = platforms.unix;
};
}