Commit 922e463e authored by Sebastian Reuße's avatar Sebastian Reuße
Browse files

soulseekqt: don’t linger in a read-only directory after installing

It appears that the strip phase assumes that CWD is writable now (when using
mktemp) and will otherwise fail with:

    mktemp: failed to create file via template 'striperr.XXXXXX': No such file or directory

We now avoid this error by sticking to the build-directory and referencing files
from the AppImage by path.

References: #248569
parent 2501addf
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -28,24 +28,20 @@ mkDerivation rec {
  buildInputs = [ qtmultimedia stdenv.cc.cc ];

  installPhase = ''
      # directory in /nix/store so readonly
      cd $appextracted

      binary="$(readlink AppRun)"
      binary="$(realpath ${appextracted}/AppRun)"
      install -Dm755 $binary -t $out/bin

      # fixup and install desktop file
      desktop-file-install --dir $out/share/applications \
        --set-key Exec --set-value $binary \
        --set-key Comment --set-value "${meta.description}" \
        --set-key Categories --set-value Network default.desktop
        --set-key Categories --set-value Network ${appextracted}/default.desktop
      mv $out/share/applications/default.desktop $out/share/applications/SoulseekQt.desktop

      #TODO: write generic code to read icon path from $binary.desktop
      icon="$(readlink .DirIcon)"
      icon="$(realpath ${appextracted}/.DirIcon)"
      for size in 16 32 48 64 72 96 128 192 256 512 1024; do
        mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
        convert -resize "$size"x"$size" $icon $out/share/icons/hicolor/"$size"x"$size"/apps/$icon
        convert -resize "$size"x"$size" $icon $out/share/icons/hicolor/"$size"x"$size"/apps/$(basename $icon)
      done
    '';