nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 ant,
6 jdk,
7 jre,
8 makeWrapper,
9 stripJavaArchivesHook,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "freemind";
14 version = "1.0.1";
15
16 src = fetchurl {
17 url = "mirror://sourceforge/freemind/freemind-src-${finalAttrs.version}.tar.gz";
18 hash = "sha256-AYKFEmsn6uc5K4w7+1E/Jb1wuZB0QOXrggnyC0+9hhk=";
19 };
20
21 nativeBuildInputs = [
22 ant
23 jdk
24 makeWrapper
25 stripJavaArchivesHook
26 ];
27
28 postPatch = ''
29 # disable the <buildnumer> task because it would edit version.properties
30 # and add a "last edited" header to it, which is non-deterministic
31 sed -i '/<buildnumber/d' build.xml
32
33 # replace dependency on `which`
34 substituteInPlace freemind.sh \
35 --replace-fail "which" "type -p"
36 '';
37
38 preConfigure = ''
39 chmod +x *.sh
40 patchShebangs *.sh
41 '';
42
43 # Workaround for javac encoding errors
44 # Note: not sure if this is still needed
45 env.JAVA_TOOL_OPTIONS = "-Dfile.encoding=UTF8";
46
47 buildPhase = ''
48 runHook preBuild
49 ant build
50 runHook postBuild
51 '';
52
53 installPhase = ''
54 runHook preInstall
55 ant dist -Ddist=$out/share/freemind
56 runHook postInstall
57 '';
58
59 postFixup = ''
60 makeWrapper $out/share/freemind/freemind.sh $out/bin/freemind \
61 --set JAVA_HOME ${jre}
62 '';
63
64 meta = {
65 description = "Mind-mapping software";
66 homepage = "https://freemind.sourceforge.net/wiki/index.php/Main_Page";
67 mainProgram = "freemind";
68 maintainers = with lib.maintainers; [ tomasajt ];
69 license = lib.licenses.gpl2Plus;
70 platforms = lib.platforms.linux;
71 sourceProvenance = with lib.sourceTypes; [
72 fromSource
73 binaryBytecode # source bundles dependencies as jars
74 ];
75 };
76})