nixpkgs/pkgs/tools/misc/yubikey-manager-qt/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
2.3 KiB
Nix
Raw Normal View History

2021-01-27 05:44:43 +00:00
{ lib
, mkDerivation
2019-02-11 22:21:53 +00:00
, fetchurl
, imagemagick
, pcsclite
2019-02-11 22:21:53 +00:00
, pyotherside
, python3
, qmake
, qtbase
, qtgraphicaleffects
, qtquickcontrols2
, yubikey-manager4
2019-02-11 22:21:53 +00:00
, yubikey-personalization
}:
mkDerivation rec {
2019-02-11 22:21:53 +00:00
pname = "yubikey-manager-qt";
2023-05-07 12:38:12 +00:00
version = "1.2.5";
2019-02-11 22:21:53 +00:00
src = fetchurl {
url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
2023-05-07 12:38:12 +00:00
sha256 = "sha256-6bKeR3UX2DhXGcKJ1bxvT1aLTgCfc+aNo6ckE89NV+I=";
2019-02-11 22:21:53 +00:00
};
nativeBuildInputs = [
python3.pkgs.wrapPython
qmake
imagemagick
];
2019-02-11 22:21:53 +00:00
postPatch = ''
substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin"
'';
buildInputs = [
pyotherside
python3
qtbase
qtgraphicaleffects
qtquickcontrols2
];
2019-02-11 22:21:53 +00:00
pythonPath = [
(yubikey-manager4.override { python3Packages = python3.pkgs; })
];
2019-02-11 22:21:53 +00:00
postInstall = ''
# Desktop files
install -D -m0644 resources/ykman-gui.desktop "$out/share/applications/ykman-gui.desktop"
substituteInPlace "$out/share/applications/ykman-gui.desktop" \
--replace Exec=ykman-gui "Exec=$out/bin/ykman-gui"
# Icons
install -Dt $out/share/ykman-gui/icons resources/icons/*.{icns,ico}
install -D -m0644 resources/icons/ykman.png "$out/share/icons/hicolor/128x128/apps/ykman.png"
ln -s -- "$out/share/icons/hicolor/128x128/apps/ykman.png" "$out/share/icons/hicolor/128x128/apps/ykman-gui.png"
for SIZE in 16 24 32 48 64 96; do
# set modify/create for reproducible builds
convert -scale ''${SIZE} +set date:create +set date:modify \
resources/icons/ykman.png ykman.png
imageFolder="$out/share/icons/hicolor/''${SIZE}x''${SIZE}/apps"
install -D -m0644 ykman.png "$imageFolder/ykman.png"
ln -s -- "$imageFolder/ykman.png" "$imageFolder/ykman-gui.png"
done
unset SIZE imageFolder
'';
2019-02-11 22:21:53 +00:00
qtWrapperArgs = [
"--prefix" "LD_LIBRARY_PATH" ":" (lib.makeLibraryPath [ pcsclite yubikey-personalization ])
];
2019-02-11 22:21:53 +00:00
preFixup = ''
buildPythonPath "$pythonPath"
qtWrapperArgs+=(--prefix PYTHONPATH : "$program_PYTHONPATH")
2019-02-11 22:21:53 +00:00
'';
meta = with lib; {
description = "Cross-platform application for configuring any YubiKey over all USB interfaces";
homepage = "https://developers.yubico.com/yubikey-manager-qt/";
2019-02-11 22:21:53 +00:00
license = licenses.bsd2;
maintainers = [ maintainers.cbley ];
mainProgram = "ykman-gui";
2019-02-11 22:21:53 +00:00
platforms = platforms.linux;
};
}