Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 35 lines 1.0 kB view raw
1{ stdenv, lib, fetchFromGitHub, autoreconfHook, pam, qrencode }: 2 3stdenv.mkDerivation rec { 4 pname = "google-authenticator-libpam"; 5 version = "1.10"; 6 7 src = fetchFromGitHub { 8 owner = "google"; 9 repo = "google-authenticator-libpam"; 10 rev = version; 11 hash = "sha256-KEfwQeJIuRF+S3gPn+maDb8Fu0FRXLs2/Nlbjj2d3AE="; 12 }; 13 14 nativeBuildInputs = [ autoreconfHook ]; 15 buildInputs = [ pam ]; 16 17 preConfigure = '' 18 sed -i "s|libqrencode.so.4|${qrencode.out}/lib/libqrencode.so.4|" src/google-authenticator.c 19 ''; 20 21 installPhase = '' 22 mkdir -p $out/bin $out/lib/security 23 cp ./.libs/pam_google_authenticator.so $out/lib/security 24 cp google-authenticator $out/bin 25 ''; 26 27 meta = with lib; { 28 homepage = "https://github.com/google/google-authenticator-libpam"; 29 description = "Two-step verification, with pam module"; 30 mainProgram = "google-authenticator"; 31 license = licenses.asl20; 32 maintainers = with maintainers; [ aneeshusa ]; 33 platforms = platforms.linux; 34 }; 35}