3
0
Fork 0
forked from mirrors/nixpkgs

freeplane: 1.9.5 -> 1.9.14

Signed-off-by: Maximilian Huber <gh@maxhbr.de>
This commit is contained in:
Maximilian Huber 2022-03-25 17:38:32 +01:00
parent 974af50601
commit adf026421e

View file

@ -1,24 +1,31 @@
{ stdenv, lib, fetchpatch, fetchFromGitHub, makeWrapper, writeText, runtimeShell, jdk11, perl, gradle_5, which }:
{ stdenv, lib, fetchpatch, fetchFromGitHub, makeWrapper, writeText, runtimeShell, jdk11, perl, gradle_6, which }:
let
pname = "freeplane";
version = "1.9.5";
version = "1.9.14";
src_sha256 = "UiXtGJs+hibB63BaDDLXgjt3INBs+NfMsKcX2Q/kxKw=";
deps_outputHash = "tHhRaMIQK8ERuzm+qB9tRe2XSesL0bN3rComB9/qWgg=";
emoji_outputHash = "w96or4lpKCRK8A5HaB4Eakr7oVSiQALJ9tCJvKZaM34=";
jdk = jdk11;
gradle = gradle_6;
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "release-${version}";
sha256 = "qfhhmF3mePxcL4U8izkEmWaiaOLi4slsaymVnDoO3sY=";
sha256 = src_sha256;
};
deps = stdenv.mkDerivation {
name = "${pname}-deps";
inherit src;
nativeBuildInputs = [ jdk11 perl gradle_5 ];
nativeBuildInputs = [ jdk perl gradle ];
buildPhase = ''
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk11} --no-daemon jar
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk} --no-daemon jar
'';
# Mavenize dependency paths
@ -31,7 +38,7 @@ let
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "xphTzaSXTGpP7vI/t4oIiv1ZpbekG2dFRzyl3ub6qnA=";
outputHash = deps_outputHash;
};
# Point to our local deps repo
@ -60,16 +67,14 @@ let
}
'';
# downloaded from unicode.org and twemoji.maxcdn.com by code in freeplane/emoji.gradle
# the below hash is for versions of freeplane that use twemoji 12.1.4, and emoji 12.1
emoji = stdenv.mkDerivation rec {
name = "${pname}-emoji";
inherit src;
nativeBuildInputs = [ jdk11 gradle_5 ];
nativeBuildInputs = [ jdk gradle ];
buildPhase = ''
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk11} --no-daemon --offline --init-script ${gradleInit} emojiGraphicsClasses emojiListClasses
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk} --no-daemon --offline --init-script ${gradleInit} :freeplane:downloadEmoji
'';
installPhase = ''
@ -80,19 +85,19 @@ let
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "0zikbakbr2fhyv4h4h52ajhznjka0hg6hiqfy1528a39i6psipn3";
outputHash = emoji_outputHash;
};
in stdenv.mkDerivation rec {
inherit pname version src;
nativeBuildInputs = [ makeWrapper jdk11 gradle_5 ];
nativeBuildInputs = [ makeWrapper jdk gradle ];
buildPhase = ''
mkdir -p -- ./freeplane/build/emoji/{txt,resources/images}
cp ${emoji}/emoji/txt/emojilist.txt ./freeplane/build/emoji/txt/emojilist.txt
cp -r ${emoji}/resources/images/emoji ./freeplane/build/emoji/resources/images/emoji
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk11} --no-daemon --offline --init-script ${gradleInit} -x test -x :freeplane:downloadEmoji build
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk} --no-daemon --offline --init-script ${gradleInit} -x test -x :freeplane:downloadEmoji build
'';
installPhase = ''
@ -102,8 +107,8 @@ in stdenv.mkDerivation rec {
cp -a ./BIN/. $out/share/${pname}
makeWrapper $out/share/${pname}/${pname}.sh $out/bin/${pname} \
--set FREEPLANE_BASE_DIR $out/share/${pname} \
--set JAVA_HOME ${jdk11} \
--prefix PATH : ${lib.makeBinPath [ jdk11 which ]}
--set JAVA_HOME ${jdk} \
--prefix PATH : ${lib.makeBinPath [ jdk which ]}
runHook postInstall
'';