freemind: adopt, refactor and make deterministic
This commit is contained in:
parent
65d8de75bd
commit
d374996cac
|
@ -1,43 +1,76 @@
|
||||||
{ lib, stdenv, fetchurl, jdk, jre, ant }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
fetchurl,
|
||||||
|
ant,
|
||||||
|
jdk,
|
||||||
|
jre,
|
||||||
|
makeWrapper,
|
||||||
|
stripJavaArchivesHook,
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "freemind";
|
pname = "freemind";
|
||||||
version = "1.0.1";
|
version = "1.0.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/freemind/freemind-src-${version}.tar.gz";
|
url = "mirror://sourceforge/freemind/freemind-src-${finalAttrs.version}.tar.gz";
|
||||||
sha256 = "06c6pm7hpwh9hbmyah3lj2wp1g957x8znfwc5cwygsi7dc98b0h1";
|
hash = "sha256-AYKFEmsn6uc5K4w7+1E/Jb1wuZB0QOXrggnyC0+9hhk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ jdk ant ];
|
nativeBuildInputs = [
|
||||||
|
ant
|
||||||
|
jdk
|
||||||
|
makeWrapper
|
||||||
|
stripJavaArchivesHook
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
# disable the <buildnumer> task because it would edit version.properties
|
||||||
|
# and add a "last edited" header to it, which is non-deterministic
|
||||||
|
sed -i '/<buildnumber/d' build.xml
|
||||||
|
|
||||||
|
# replace dependency on `which`
|
||||||
|
substituteInPlace freemind.sh \
|
||||||
|
--replace-fail "which" "type -p"
|
||||||
|
'';
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
chmod +x check_for_duplicate_resources.sh
|
chmod +x *.sh
|
||||||
sed 's,/bin/bash,${stdenv.shell},' -i check_for_duplicate_resources.sh
|
patchShebangs *.sh
|
||||||
|
|
||||||
## work around javac encoding errors
|
|
||||||
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = "ant dist";
|
# Workaround for javac encoding errors
|
||||||
|
# Note: not sure if this is still needed
|
||||||
|
env.JAVA_TOOL_OPTIONS = "-Dfile.encoding=UTF8";
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
ant build
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/{bin,nix-support}
|
runHook preInstall
|
||||||
cp -r ../bin/dist $out/nix-support
|
ant dist -Ddist=$out/share/freemind
|
||||||
sed -i 's/which/type -p/' $out/nix-support/dist/freemind.sh
|
runHook postInstall
|
||||||
|
|
||||||
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; {
|
postFixup = ''
|
||||||
|
makeWrapper $out/share/freemind/freemind.sh $out/bin/freemind \
|
||||||
|
--set JAVA_HOME ${jre}
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
description = "Mind-mapping software";
|
description = "Mind-mapping software";
|
||||||
mainProgram = "freemind";
|
|
||||||
homepage = "https://freemind.sourceforge.net/wiki/index.php/Main_Page";
|
homepage = "https://freemind.sourceforge.net/wiki/index.php/Main_Page";
|
||||||
license = licenses.gpl2Plus;
|
mainProgram = "freemind";
|
||||||
platforms = platforms.linux;
|
maintainers = with lib.maintainers; [ tomasajt ];
|
||||||
|
license = lib.licenses.gpl2Plus;
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
sourceProvenance = with lib.sourceTypes; [
|
||||||
|
fromSource
|
||||||
|
binaryBytecode # source bundles dependencies as jars
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user