mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-06 04:03:04 +00:00
![Artturin](/assets/img/avatar_default.png)
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
45 lines
1.9 KiB
Nix
45 lines
1.9 KiB
Nix
{ stdenv, lib, fetchurl, mkDerivation, pkg-config, qtbase, qmake, imagemagick
|
|
, libyubikey, yubikey-personalization }:
|
|
|
|
mkDerivation rec {
|
|
pname = "yubikey-personalization-gui";
|
|
version = "3.1.25";
|
|
|
|
src = fetchurl {
|
|
url = "https://developers.yubico.com/yubikey-personalization-gui/Releases/yubikey-personalization-gui-${version}.tar.gz";
|
|
sha256 = "1knyv5yss8lhzaff6jpfqv12fjf1b8b21mfxzx3qi0hw4nl8n2v8";
|
|
};
|
|
|
|
nativeBuildInputs = [ pkg-config qmake imagemagick ];
|
|
buildInputs = [ yubikey-personalization qtbase libyubikey ];
|
|
|
|
installPhase = ''
|
|
install -D -m0755 build/release/yubikey-personalization-gui "$out/bin/yubikey-personalization-gui"
|
|
install -D -m0644 resources/lin/yubikey-personalization-gui.1 "$out/share/man/man1/yubikey-personalization-gui.1"
|
|
|
|
# Desktop files
|
|
install -D -m0644 resources/lin/yubikey-personalization-gui.desktop "$out/share/applications/yubikey-personalization-gui.desktop"
|
|
|
|
# Icons
|
|
install -D -m0644 resources/lin/yubikey-personalization-gui.xpm "$out/share/pixmaps/yubikey-personalization-gui.xpm"
|
|
install -D -m0644 resources/lin/yubikey-personalization-gui.png "$out/share/icons/hicolor/128x128/apps/yubikey-personalization-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/lin/yubikey-personalization-gui.png \
|
|
yubikey-personalization-gui.png
|
|
|
|
install -D -m0644 yubikey-personalization-gui.png "$out/share/icons/hicolor/''${SIZE}x''${SIZE}/apps/yubikey-personalization-gui.png"
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
homepage = "https://developers.yubico.com/yubikey-personalization-gui";
|
|
description = "QT based cross-platform utility designed to facilitate reconfiguration of the Yubikey";
|
|
license = licenses.bsd2;
|
|
platforms = platforms.unix;
|
|
mainProgram = "yubikey-personalization-gui";
|
|
};
|
|
}
|