nixpkgs/pkgs/development/tools/nailgun/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

40 lines
1.1 KiB
Nix

{ lib, stdenv, fetchMavenArtifact, fetchFromGitHub, jre, makeWrapper }:
let
version = "1.0.0";
nailgun-server = fetchMavenArtifact {
groupId = "com.facebook";
artifactId = "nailgun-server";
inherit version;
sha256 = "1mk8pv0g2xg9m0gsb96plbh6mc24xrlyrmnqac5mlbl4637l4q95";
};
in
stdenv.mkDerivation {
pname = "nailgun";
inherit version;
src = fetchFromGitHub {
owner = "facebook";
repo = "nailgun";
rev = "nailgun-all-v${version}";
sha256 = "1syyk4ss5vq1zf0ma00svn56lal53ffpikgqgzngzbwyksnfdlh6";
};
makeFlags = [ "PREFIX=$(out)" ];
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
makeWrapper ${jre}/bin/java $out/bin/ng-server \
--add-flags '-classpath ${nailgun-server.jar}:$CLASSPATH com.facebook.nailgun.NGServer'
'';
meta = with lib; {
description = "Client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead";
homepage = "http://www.martiansoftware.com/nailgun/";
license = licenses.asl20;
platforms = platforms.linux;
maintainers = with maintainers; [ volth ];
};
}