Commit 7a1de489 authored by Atemu's avatar Atemu
Browse files

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

parent 7398d5fc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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

+5 −10
Original line number Diff line number Diff line
@@ -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;