nixpkgs/pkgs/applications/networking/mailreaders/msgviewer/default.nix
Jörg Thalheim dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00

39 lines
1004 B
Nix

{ stdenv, fetchurl, makeWrapper, unzip, jre, runtimeShell }:
let
version = "1.9";
name = "msgviewer-${version}";
uname = "MSGViewer-${version}";
in stdenv.mkDerivation rec {
inherit name;
src = fetchurl {
url = "mirror://sourceforge/msgviewer/${uname}/${uname}.zip";
sha256 = "0igmr8c0757xsc94xlv2470zv2mz57zaj52dwr9wj8agmj23jbjz";
};
buildCommand = ''
dir=$out/lib/msgviewer
mkdir -p $out/bin $dir
unzip $src -d $dir
mv $dir/${uname}/* $dir
rmdir $dir/${uname}
cat <<_EOF > $out/bin/msgviewer
#!${runtimeShell} -eu
exec ${stdenv.lib.getBin jre}/bin/java -jar $dir/MSGViewer.jar "\$@"
_EOF
chmod 755 $out/bin/msgviewer
'';
nativeBuildInputs = [ makeWrapper unzip ];
meta = with stdenv.lib; {
description = "Viewer for .msg files (MS Outlook)";
homepage = https://www.washington.edu/alpine/;
license = licenses.asl20;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.all;
};
}