anki-bin: use pname + version instead of hacky override

This commit is contained in:
Atemu 2023-04-09 19:50:23 +02:00
parent 7398d5fc79
commit 7a1de48994
2 changed files with 6 additions and 12 deletions

View file

@ -89,8 +89,7 @@ let
'';
# Compose /etc for the chroot environment
etcPkg = runCommandLocal "${name}-chrootenv-etc" {
} ''
etcPkg = runCommandLocal "${name}-chrootenv-etc" { } ''
mkdir -p $out/etc
cd $out/etc

View file

@ -51,7 +51,8 @@ let
passthru = { inherit sources; };
fhsUserEnvAnki = buildFHSUserEnv (appimageTools.defaultFhsEnvArgs // {
name = "anki";
inherit pname version;
name = null; # Appimage sets it to "appimage-env"
# Dependencies of anki
targetPkgs = pkgs: (with pkgs; [ xorg.libxkbfile krb5 ]);
@ -61,6 +62,8 @@ let
'';
extraInstallCommands = ''
ln -s ${pname} $out/bin/anki
mkdir -p $out/share
cp -R ${unpacked}/share/applications \
${unpacked}/share/man \
@ -70,17 +73,9 @@ let
inherit meta passthru;
});
fhsUserEnvAnkiWithVersion = fhsUserEnvAnki.overrideAttrs (oldAttrs: {
# buildFHSUserEnv doesn't have an easy way to set the version of the
# resulting derivation, so we manually override it here. This makes
# it clear to end users the version of anki-bin. Without this, users
# might assume anki-bin is an old version of Anki.
name = "${pname}-${version}";
});
in
if stdenv.isLinux then fhsUserEnvAnkiWithVersion
if stdenv.isLinux then fhsUserEnvAnki
else stdenv.mkDerivation {
inherit pname version passthru;