2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-05-20 23:08:51 +00:00
|
|
|
, mkDerivation
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
2022-08-12 12:06:08 +00:00
|
|
|
, imagemagick
|
2020-04-24 23:36:52 +00:00
|
|
|
, pcsclite
|
|
|
|
, pyotherside
|
|
|
|
, python3
|
|
|
|
, qmake
|
|
|
|
, qtbase
|
|
|
|
, qtgraphicaleffects
|
|
|
|
, qtquickcontrols2
|
|
|
|
, yubikey-manager
|
|
|
|
, yubikey-personalization
|
|
|
|
}:
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "yubikey-manager-qt";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.2.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-PxHc7IeRsO+CPrNTofGypLLW8fSHDkcBqr75NwdlUyc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
python3.pkgs.wrapPython
|
|
|
|
qmake
|
2022-08-12 12:06:08 +00:00
|
|
|
imagemagick
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [
|
|
|
|
pyotherside
|
|
|
|
python3
|
|
|
|
qtbase
|
|
|
|
qtgraphicaleffects
|
|
|
|
qtquickcontrols2
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
pythonPath = [
|
|
|
|
(yubikey-manager.override { python3Packages = python3.pkgs; })
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
# 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
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
qtWrapperArgs = [
|
|
|
|
"--prefix" "LD_LIBRARY_PATH" ":" (lib.makeLibraryPath [ pcsclite yubikey-personalization ])
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
preFixup = ''
|
|
|
|
buildPythonPath "$pythonPath"
|
|
|
|
qtWrapperArgs+=(--prefix PYTHONPATH : "$program_PYTHONPATH")
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "Cross-platform application for configuring any YubiKey over all USB interfaces";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://developers.yubico.com/yubikey-manager-qt/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = [ maintainers.cbley ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|