1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 19:51:17 +00:00

Merge pull request #266102 from ambroisie/add-wifi-qr

wifi-qr: init at 2023-09-30
This commit is contained in:
Peder Bergebakken Sundt 2023-12-16 21:48:22 +01:00 committed by GitHub
commit 713c75ea93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,86 @@
{ lib
, fetchFromGitHub
, installShellFiles
, makeWrapper
, gnome
, ncurses
, networkmanager
, patsh
, procps
, qrencode
, stdenvNoCC
, xdg-utils
, zbar
}:
stdenvNoCC.mkDerivation {
pname = "wifi-qr";
version = "0.3-unstable-2023-09-30";
outputs = [ "out" "man" ];
src = fetchFromGitHub {
owner = "kokoye2007";
repo = "wifi-qr";
rev = "821892001f735dc250a549ea36329cdc767db9c9";
hash = "sha256-kv0qjO+wn4t//NmKkHB+tZB4eRNm+WRUa5rij+7Syuk=";
};
buildInputs = [
gnome.zenity
ncurses
networkmanager
procps
qrencode
xdg-utils
zbar
];
nativeBuildInputs = [
installShellFiles
makeWrapper
patsh
];
dontBuild = true;
dontConfigure = true;
postPatch = ''
substituteInPlace src/wifi-qr.desktop \
--replace "Icon=wifi-qr.svg" "Icon=wifi-qr"
substituteInPlace src/wifi-qr \
--replace "/usr/share/doc/wifi-qr/copyright" "$out/share/doc/wifi-qr/copyright"
'';
installPhase = ''
runHook preInstall
install -Dm755 src/wifi-qr $out/bin/wifi-qr
install -Dm644 src/wifi-qr.desktop $out/share/applications/wifi-qr.desktop
install -Dm644 src/wifi-qr.svg $out/share/icons/hicolor/scalable/apps/wifi-qr.svg
install -Dm644 src/LICENSE $out/share/doc/wifi-qr/copyright
installManPage src/wifi-qr.1
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
patchShebangs $out/bin/wifi-qr
patsh -f $out/bin/wifi-qr -s ${builtins.storeDir}
runHook postFixup
'';
meta = with lib; {
description = "WiFi password sharing via QR codes";
homepage = "https://github.com/kokoye2007/wifi-qr";
license = with licenses; [ gpl3Plus ];
maintainers = with maintainers; [ ambroisie ];
mainProgram = "wifi-qr";
platforms = platforms.linux;
};
}