2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
2024-10-09 16:51:18 +00:00
|
|
|
, flutter324
|
2022-12-17 10:02:37 +00:00
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pcre2
|
2023-08-22 20:05:09 +00:00
|
|
|
, libnotify
|
|
|
|
, libappindicator
|
|
|
|
, pkg-config
|
2024-07-27 06:49:29 +00:00
|
|
|
, gnome-screenshot
|
2023-01-11 07:51:40 +00:00
|
|
|
, makeWrapper
|
2023-02-02 18:25:31 +00:00
|
|
|
, removeReferencesTo
|
2022-12-17 10:02:37 +00:00
|
|
|
}:
|
2023-04-29 16:46:19 +00:00
|
|
|
|
2024-10-09 16:51:18 +00:00
|
|
|
flutter324.buildFlutterApplication rec {
|
2023-01-11 07:51:40 +00:00
|
|
|
pname = "yubioath-flutter";
|
2024-10-09 16:51:18 +00:00
|
|
|
version = "7.1.0";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Yubico";
|
|
|
|
repo = "yubioath-flutter";
|
|
|
|
rev = version;
|
2024-10-09 16:51:18 +00:00
|
|
|
hash = "sha256-sAs/tglLt1igovtfs07+7G5/xeMcQgfR9G4b7VzyDVY=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
passthru.helper = python3.pkgs.callPackage ./helper.nix { inherit src version meta; };
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
pubspecLock = lib.importJSON ./pubspec.lock.json;
|
2024-02-29 20:09:43 +00:00
|
|
|
gitHashes = {
|
|
|
|
window_manager = "sha256-mLX51nbWFccsAfcqLQIYDjYz69y9wAz4U1RZ8TIYSj0=";
|
|
|
|
};
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
rm -f pubspec.lock
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
substituteInPlace linux/CMakeLists.txt \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-fail "../build/linux/helper" "${passthru.helper}/libexec/helper"
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
# Make sure we have permission to delete things CMake has copied in to our build directory from elsewhere.
|
2023-01-11 07:51:40 +00:00
|
|
|
chmod -R +w build
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Swap the authenticator-helper symlink with the correct symlink.
|
2023-01-11 07:51:40 +00:00
|
|
|
ln -fs "${passthru.helper}/bin/authenticator-helper" "$out/app/helper/authenticator-helper"
|
|
|
|
|
|
|
|
# Move the icon.
|
|
|
|
mkdir $out/share/icons
|
|
|
|
mv $out/app/linux_support/com.yubico.yubioath.png $out/share/icons
|
|
|
|
|
|
|
|
# Cleanup.
|
|
|
|
rm -rf \
|
|
|
|
"$out/app/README.adoc" \
|
|
|
|
"$out/app/desktop_integration.sh" \
|
|
|
|
"$out/app/linux_support" \
|
|
|
|
$out/bin/* # We will repopulate this directory later.
|
|
|
|
|
|
|
|
# Symlink binary.
|
|
|
|
ln -sf "$out/app/authenticator" "$out/bin/yubioath-flutter"
|
|
|
|
|
|
|
|
# Set the correct path to the binary in desktop file.
|
|
|
|
substituteInPlace "$out/share/applications/com.yubico.authenticator.desktop" \
|
|
|
|
--replace "@EXEC_PATH/authenticator" "$out/bin/yubioath-flutter" \
|
|
|
|
--replace "@EXEC_PATH/linux_support/com.yubico.yubioath.png" "$out/share/icons/com.yubico.yubioath.png"
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
# Needed for QR scanning to work
|
|
|
|
extraWrapProgramArgs = ''
|
2024-07-27 06:49:29 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ gnome-screenshot ]}
|
2024-02-07 01:22:34 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2023-02-02 18:25:31 +00:00
|
|
|
removeReferencesTo
|
2023-08-22 20:05:09 +00:00
|
|
|
pkg-config
|
2023-01-11 07:51:40 +00:00
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
buildInputs = [
|
|
|
|
pcre2
|
2023-08-22 20:05:09 +00:00
|
|
|
libnotify
|
|
|
|
libappindicator
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Yubico Authenticator for Desktop";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "yubioath-flutter";
|
2023-01-11 07:51:40 +00:00
|
|
|
homepage = "https://github.com/Yubico/yubioath-flutter";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ lukegb ];
|
2023-04-29 16:46:19 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
2022-12-17 10:02:37 +00:00
|
|
|
}
|