mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-01 01:33:20 +00:00
anki -> 2.1.51
Since the previous version of anki no longer works on nixos-unstable due to glibc changes the version was bumped to 2.1.51 which works. Also adds support for aarch64 on apple silicon Fixes #167765
This commit is contained in:
parent
e10da1c7f5
commit
c9f742f7bc
@ -1,24 +1,31 @@
|
|||||||
{ fetchurl, stdenv, lib, buildFHSUserEnv, appimageTools, writeShellScript, anki, undmg }:
|
{ fetchurl, stdenv, lib, buildFHSUserEnv, appimageTools, writeShellScript, anki, undmg, zstd }:
|
||||||
|
|
||||||
let
|
let
|
||||||
pname = "anki-bin";
|
pname = "anki-bin";
|
||||||
# Update hashes for both Linux and Darwin!
|
# Update hashes for both Linux and Darwin!
|
||||||
version = "2.1.49";
|
version = "2.1.51";
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
linux = fetchurl {
|
linux = fetchurl {
|
||||||
url = "https://github.com/ankitects/anki/releases/download/${version}/anki-${version}-linux.tar.bz2";
|
url = "https://github.com/ankitects/anki/releases/download/${version}/anki-${version}-linux-qt6.tar.zst";
|
||||||
sha256 = "sha256-uG39g9CXnquArFsxtFHWWoDaNwu8y2KKh+SqGt8aqi0=";
|
sha256 = "sha256-ZKVc+TvkNu5mGgibhRIuoLuIfvyoVDy+c4h+Apz9P+0=";
|
||||||
};
|
};
|
||||||
darwin = fetchurl {
|
|
||||||
url = "https://github.com/ankitects/anki/releases/download/${version}/anki-${version}-mac.dmg";
|
# For some reason anki distributes completely separate dmg-files for the aarch64 version and the x86_64 version
|
||||||
sha256 = "sha256-sEVWZQpICL7RYrOuPm1Y5XhzPxCwNk1WGP1rctTtE4Y=";
|
darwin-x86_64 = fetchurl {
|
||||||
|
url = "https://github.com/ankitects/anki/releases/download/${version}/anki-${version}-mac-intel-qt6.dmg";
|
||||||
|
sha256 = "sha256-wZMJEbcpezVAuBSKlwNTHlqjp0FfmyDB7XD6BBuJhyA=";
|
||||||
|
};
|
||||||
|
darwin-aarch64 = fetchurl {
|
||||||
|
url = "https://github.com/ankitects/anki/releases/download/${version}/anki-${version}-mac-apple-qt6.dmg";
|
||||||
|
sha256 = "sha256-6RDTYKoisX5DJ9VPWrP9VH9DCABabb9MB3nG4S8jtR0=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
unpacked = stdenv.mkDerivation {
|
unpacked = stdenv.mkDerivation {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ zstd ];
|
||||||
src = sources.linux;
|
src = sources.linux;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
@ -47,6 +54,9 @@ in
|
|||||||
if stdenv.isLinux then buildFHSUserEnv (appimageTools.defaultFhsEnvArgs // {
|
if stdenv.isLinux then buildFHSUserEnv (appimageTools.defaultFhsEnvArgs // {
|
||||||
name = "anki";
|
name = "anki";
|
||||||
|
|
||||||
|
# Dependencies of anki
|
||||||
|
targetPkgs = pkgs: (with pkgs; [ xorg.libxkbfile krb5 ]);
|
||||||
|
|
||||||
runScript = writeShellScript "anki-wrapper.sh" ''
|
runScript = writeShellScript "anki-wrapper.sh" ''
|
||||||
exec ${unpacked}/bin/anki
|
exec ${unpacked}/bin/anki
|
||||||
'';
|
'';
|
||||||
@ -63,7 +73,7 @@ if stdenv.isLinux then buildFHSUserEnv (appimageTools.defaultFhsEnvArgs // {
|
|||||||
}) else stdenv.mkDerivation {
|
}) else stdenv.mkDerivation {
|
||||||
inherit pname version passthru;
|
inherit pname version passthru;
|
||||||
|
|
||||||
src = sources.darwin;
|
src = if stdenv.isAarch64 then sources.darwin-aarch64 else sources.darwin-x86_64;
|
||||||
|
|
||||||
nativeBuildInputs = [ undmg ];
|
nativeBuildInputs = [ undmg ];
|
||||||
sourceRoot = ".";
|
sourceRoot = ".";
|
||||||
|
Loading…
Reference in New Issue
Block a user