Merge pull request #208279 from Kranzes/yubioath

yubioath-flutter: slight refactor and cleanup

authored by Luke Granger-Brown and committed by GitHub d77928b9 a6b1de79

+38 -21
+37 -20
pkgs/applications/misc/yubioath-flutter/default.nix
··· 5 , stdenv 6 , pcre2 7 }: 8 - 9 let 10 vendorHashes = { 11 x86_64-linux = "sha256-BwhWA8N0S55XkljDKPNkDhsj0QSpmJJ5MwEnrPjymS8="; 12 aarch64-linux = "sha256-T1aGz3+2Sls+rkUVDUo39Ky2igg+dxGSUaf3qpV7ovQ="; 13 }; 14 - 15 version = "6.0.2"; 16 src = fetchFromGitHub { 17 owner = "Yubico"; 18 repo = "yubioath-flutter"; 19 rev = version; 20 sha256 = "13nh5qpq02c6azfdh4cbzhlrq0hs9is45q5z5cnxg84hrx26hd4k"; 21 }; 22 - meta = with lib; { 23 - description = "Yubico Authenticator for Desktop"; 24 - homepage = "https://github.com/Yubico/yubioath-flutter"; 25 - license = licenses.asl20; 26 - maintainers = with maintainers; [ lukegb ]; 27 - platforms = builtins.attrNames vendorHashes; 28 - }; 29 30 - helper = python3.pkgs.callPackage ./helper.nix { inherit src version meta; }; 31 - in 32 - flutter.mkFlutterApp rec { 33 - pname = "yubioath-flutter"; 34 - inherit src version meta; 35 36 - passthru.helper = helper; 37 - 38 - vendorHash = vendorHashes."${stdenv.system}"; 39 40 postPatch = '' 41 substituteInPlace linux/CMakeLists.txt \ 42 - --replace "../build/linux/helper" "${helper}/libexec/helper" 43 ''; 44 45 preInstall = '' 46 # Make sure we have permission to delete things CMake has copied in to our build directory from elsewhere. 47 - chmod -R +w build/ 48 ''; 49 postInstall = '' 50 # Swap the authenticator-helper symlink with the correct symlink. 51 - ln -fs "${helper}/bin/authenticator-helper" "$out/app/helper/authenticator-helper" 52 ''; 53 54 buildInputs = [ 55 pcre2 56 ]; 57 }
··· 5 , stdenv 6 , pcre2 7 }: 8 let 9 vendorHashes = { 10 x86_64-linux = "sha256-BwhWA8N0S55XkljDKPNkDhsj0QSpmJJ5MwEnrPjymS8="; 11 aarch64-linux = "sha256-T1aGz3+2Sls+rkUVDUo39Ky2igg+dxGSUaf3qpV7ovQ="; 12 }; 13 + in 14 + flutter.mkFlutterApp rec { 15 + pname = "yubioath-flutter"; 16 version = "6.0.2"; 17 + 18 src = fetchFromGitHub { 19 owner = "Yubico"; 20 repo = "yubioath-flutter"; 21 rev = version; 22 sha256 = "13nh5qpq02c6azfdh4cbzhlrq0hs9is45q5z5cnxg84hrx26hd4k"; 23 }; 24 25 + passthru.helper = python3.pkgs.callPackage ./helper.nix { inherit src version meta; }; 26 27 + vendorHash = vendorHashes.${stdenv.system}; 28 29 postPatch = '' 30 substituteInPlace linux/CMakeLists.txt \ 31 + --replace "../build/linux/helper" "${passthru.helper}/libexec/helper" 32 ''; 33 34 preInstall = '' 35 # Make sure we have permission to delete things CMake has copied in to our build directory from elsewhere. 36 + chmod -R +w build 37 ''; 38 + 39 postInstall = '' 40 # Swap the authenticator-helper symlink with the correct symlink. 41 + ln -fs "${passthru.helper}/bin/authenticator-helper" "$out/app/helper/authenticator-helper" 42 + 43 + # Move the icon. 44 + mkdir $out/share/icons 45 + mv $out/app/linux_support/com.yubico.yubioath.png $out/share/icons 46 + 47 + # Cleanup. 48 + rm -rf \ 49 + "$out/app/README.adoc" \ 50 + "$out/app/desktop_integration.sh" \ 51 + "$out/app/linux_support" \ 52 + $out/bin/* # We will repopulate this directory later. 53 + 54 + # Symlink binary. 55 + ln -sf "$out/app/authenticator" "$out/bin/yubioath-flutter" 56 + 57 + # Set the correct path to the binary in desktop file. 58 + substituteInPlace "$out/share/applications/com.yubico.authenticator.desktop" \ 59 + --replace "@EXEC_PATH/authenticator" "$out/bin/yubioath-flutter" \ 60 + --replace "@EXEC_PATH/linux_support/com.yubico.yubioath.png" "$out/share/icons/com.yubico.yubioath.png" 61 ''; 62 63 buildInputs = [ 64 pcre2 65 ]; 66 + 67 + meta = with lib; { 68 + description = "Yubico Authenticator for Desktop"; 69 + homepage = "https://github.com/Yubico/yubioath-flutter"; 70 + license = licenses.asl20; 71 + maintainers = with maintainers; [ lukegb ]; 72 + platforms = builtins.attrNames vendorHashes; 73 + }; 74 }
+1 -1
pkgs/applications/misc/yubioath-flutter/helper.nix
··· 12 , meta 13 }: 14 15 - buildPythonApplication rec { 16 pname = "yubioath-flutter-helper"; 17 inherit src version meta; 18
··· 12 , meta 13 }: 14 15 + buildPythonApplication { 16 pname = "yubioath-flutter-helper"; 17 inherit src version meta; 18