mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 17:25:11 +00:00
4a7f99d55d
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
43 lines
1.1 KiB
Nix
43 lines
1.1 KiB
Nix
{ lib, stdenv, fetchurl, jdk, jre, ant }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "freemind";
|
|
version = "1.0.1";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/freemind/freemind-src-${version}.tar.gz";
|
|
sha256 = "06c6pm7hpwh9hbmyah3lj2wp1g957x8znfwc5cwygsi7dc98b0h1";
|
|
};
|
|
|
|
buildInputs = [ jdk ant ];
|
|
|
|
preConfigure = ''
|
|
chmod +x check_for_duplicate_resources.sh
|
|
sed 's,/bin/bash,${stdenv.shell},' -i check_for_duplicate_resources.sh
|
|
|
|
## work around javac encoding errors
|
|
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
|
|
'';
|
|
|
|
buildPhase = "ant dist";
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/{bin,nix-support}
|
|
cp -r ../bin/dist $out/nix-support
|
|
sed -i 's/which/type -p/' $out/nix-support/dist/freemind.sh
|
|
|
|
cat >$out/bin/freemind <<EOF
|
|
#! ${stdenv.shell}
|
|
JAVA_HOME=${jre} $out/nix-support/dist/freemind.sh
|
|
EOF
|
|
chmod +x $out/{bin/freemind,nix-support/dist/freemind.sh}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Mind-mapping software";
|
|
homepage = "http://freemind.sourceforge.net/wiki/index.php/Main_Page";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|