mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 15:56:50 +01:00
dadc7eb329
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.
31 lines
1 KiB
Nix
31 lines
1 KiB
Nix
{ stdenv, fetchurl, jre, unzip, runtimeShell }:
|
|
stdenv.mkDerivation rec {
|
|
version = "0.9.0";
|
|
pname = "zgrviewer";
|
|
name="${pname}-${version}";
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/zvtm/${pname}/${version}/${name}.zip";
|
|
sha256 = "1yg2rck81sqqrgfi5kn6c1bz42dr7d0zqpcsdjhicssi1y159f23";
|
|
};
|
|
buildInputs = [jre unzip];
|
|
buildPhase = "";
|
|
installPhase = ''
|
|
mkdir -p "$out"/{bin,share/java/zvtm/plugins,share/doc/zvtm}
|
|
|
|
cp overview.html *.license.* "$out/share/doc/zvtm"
|
|
|
|
cp -r target/* "$out/share/java/zvtm/"
|
|
|
|
echo '#!${runtimeShell}' > "$out/bin/zgrviewer"
|
|
echo "${jre}/lib/openjdk/jre/bin/java -jar '$out/share/java/zvtm/zgrviewer-${version}.jar' \"\$@\"" >> "$out/bin/zgrviewer"
|
|
chmod a+x "$out/bin/zgrviewer"
|
|
'';
|
|
meta = {
|
|
# Quicker to unpack locally than load Hydra
|
|
hydraPlatforms = [];
|
|
maintainers = with stdenv.lib.maintainers; [raskin];
|
|
license = stdenv.lib.licenses.lgpl21Plus;
|
|
description = "GraphViz graph viewer/navigator";
|
|
platforms = with stdenv.lib.platforms; unix;
|
|
};
|
|
}
|