diff options
author | Atemu <atemu.main@gmail.com> | 2020-12-11 09:08:55 +0100 |
---|---|---|
committer | Atemu <atemu.main@gmail.com> | 2020-12-24 07:02:24 +0100 |
commit | 18906f453e5f5f4190ed281d6262f50e8b8f8ca0 (patch) | |
tree | b1497865d0e86ffb79fdcd9beb7317dec9905672 /pkgs/games/anki | |
parent | 83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff) |
anki-bin: init at 2.1.36
Works around https://github.com/NixOS/nixpkgs/issues/78449
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Diffstat (limited to 'pkgs/games/anki')
-rw-r--r-- | pkgs/games/anki/bin.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/games/anki/bin.nix b/pkgs/games/anki/bin.nix new file mode 100644 index 000000000000..e0de57fdcab6 --- /dev/null +++ b/pkgs/games/anki/bin.nix @@ -0,0 +1,44 @@ +{ fetchurl, stdenv, lib, buildFHSUserEnv, appimageTools, writeShellScript, anki }: + +let + pname = "anki-bin"; + version = "2.1.36"; + + unpacked = stdenv.mkDerivation { + inherit pname version; + + src = fetchurl { + url = "https://github.com/ankitects/anki/releases/download/${version}/anki-${version}-linux.tar.bz2"; + sha256 = "01xcjnfs5pfh7v0nkffw2wpl19l6pj9k3kxrcawv3cm42asy0mfz"; + }; + + installPhase = '' + runHook preInstall + + xdg-mime () { + echo Stubbed! + } + export -f xdg-mime + + PREFIX=$out bash install.sh + + runHook postInstall + ''; + }; + + meta = with lib; { + inherit (anki.meta) license homepage description longDescription; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ atemu ]; + }; +in + +buildFHSUserEnv (appimageTools.defaultFhsEnvArgs // { + name = "anki"; + + runScript = writeShellScript "anki-wrapper.sh" '' + exec ${unpacked}/bin/anki + ''; + + inherit meta; +}) |