nixpkgs/pkgs/applications/misc/projectlibre/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

45 lines
1.5 KiB
Nix

{ lib, stdenv, fetchgit, ant, jdk, makeWrapper, jre, coreutils, which }:
stdenv.mkDerivation rec {
pname = "projectlibre";
version = "1.7.0";
src = fetchgit {
url = "https://git.code.sf.net/p/projectlibre/code";
rev = "0c939507cc63e9eaeb855437189cdec79e9386c2"; # version 1.7.0 was not tagged
sha256 = "0vy5vgbp45ai957gaby2dj1hvmbxfdlfnwcanwqm9f8q16qipdbq";
};
buildInputs = [ ant jdk makeWrapper ];
buildPhase = ''
export ANT_OPTS=-Dbuild.sysclasspath=ignore
${ant}/bin/ant -f openproj_build/build.xml
'';
resourcesPath = "openproj_build/resources";
desktopItem = "${resourcesPath}/projectlibre.desktop";
installPhase = ''
mkdir -p $out/share/{applications,projectlibre/samples,pixmaps,doc/projectlibre} $out/bin
substitute $resourcesPath/projectlibre $out/bin/projectlibre \
--replace "\"/usr/share/projectlibre\"" "\"$out/share/projectlibre\""
chmod +x $out/bin/projectlibre
wrapProgram $out/bin/projectlibre \
--prefix PATH : "${jre}/bin:${coreutils}/bin:${which}/bin"
cp -R openproj_build/dist/* $out/share/projectlibre
cp -R openproj_build/license $out/share/doc/projectlibre
cp $desktopItem $out/share/applications
cp $resourcesPath/projectlibre.png $out/share/pixmaps
cp -R $resourcesPath/samples/* $out/share/projectlibre/samples
'';
meta = with lib; {
homepage = "https://www.projectlibre.com/";
description = "Project-Management Software similar to MS-Project";
maintainers = [ maintainers.Mogria ];
license = licenses.cpal10;
};
}