![Profpatsch](/assets/img/avatar_default.png)
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
37 lines
995 B
Nix
37 lines
995 B
Nix
{lib, stdenv, fetchurl, makeWrapper, jre, gcc, valgrind}:
|
|
# gcc and valgrind are not strict dependencies, they could be made
|
|
# optional. They are here because plm can only help you learn C if you
|
|
# have them installed.
|
|
stdenv.mkDerivation rec {
|
|
major = "2";
|
|
minor = "5";
|
|
version = "${major}-${minor}";
|
|
pname = "plm";
|
|
|
|
src = fetchurl {
|
|
url = "http://webloria.loria.fr/~quinson/Teaching/PLM/plm-${major}_${minor}.jar";
|
|
sha256 = "0m17cxa3nxi2cbswqvlfzp0mlfi3wrkw8ry2xhkxy6aqzm2mlgcc";
|
|
name = "${pname}-${version}.jar";
|
|
};
|
|
|
|
buildInputs = [ makeWrapper jre gcc valgrind ];
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
installPhase = ''
|
|
mkdir -p "$prefix/bin"
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/plm \
|
|
--add-flags "-jar $src" \
|
|
--prefix PATH : "$PATH"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Free cross-platform programming exerciser";
|
|
license = licenses.gpl3;
|
|
maintainers = [ ];
|
|
platforms = stdenv.lib.platforms.all;
|
|
broken = true;
|
|
};
|
|
}
|