mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-24 13:53:24 +00:00
Merge pull request #275479 from maxhbr/freeplane-1_11_8
freeplane: 1.9.14 -> 1.11.8
This commit is contained in:
commit
fa265d7bf3
@ -1,31 +1,46 @@
|
||||
{ stdenv, lib, fetchpatch, fetchFromGitHub, makeWrapper, writeText, runtimeShell, jdk11, perl, gradle_6, which }:
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchpatch
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, makeDesktopItem
|
||||
, writeText
|
||||
, runtimeShell
|
||||
, jdk17
|
||||
, perl
|
||||
, gradle_7
|
||||
, which
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "freeplane";
|
||||
version = "1.9.14";
|
||||
version = "1.11.8";
|
||||
|
||||
src_sha256 = "UiXtGJs+hibB63BaDDLXgjt3INBs+NfMsKcX2Q/kxKw=";
|
||||
deps_outputHash = "tHhRaMIQK8ERuzm+qB9tRe2XSesL0bN3rComB9/qWgg=";
|
||||
emoji_outputHash = "w96or4lpKCRK8A5HaB4Eakr7oVSiQALJ9tCJvKZaM34=";
|
||||
src_hash = "sha256-Qh2V265FvQpqGKmPsiswnC5yECwIcNwMI3/Ka9sBqXE=";
|
||||
deps_outputHash = "sha256-2Zaw4FW12dThdr082dEB1EYkGwNiayz501wIPGXUfBw=";
|
||||
|
||||
jdk = jdk11;
|
||||
gradle = gradle_6;
|
||||
jdk = jdk17;
|
||||
gradle = gradle_7;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = "release-${version}";
|
||||
sha256 = src_sha256;
|
||||
hash = src_hash;
|
||||
};
|
||||
|
||||
deps = stdenv.mkDerivation {
|
||||
name = "${pname}-deps";
|
||||
inherit src;
|
||||
pname = "${pname}-deps";
|
||||
inherit src version;
|
||||
|
||||
nativeBuildInputs = [ jdk perl gradle ];
|
||||
nativeBuildInputs = [
|
||||
jdk
|
||||
perl
|
||||
gradle
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk} --no-daemon jar
|
||||
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk} --no-daemon build
|
||||
'';
|
||||
|
||||
# Mavenize dependency paths
|
||||
@ -34,7 +49,15 @@ let
|
||||
find ./caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
|
||||
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
|
||||
| sh
|
||||
# com/squareup/okio/okio/2.10.0/okio-jvm-2.10.0.jar expected to exist under name okio-2.10.0.jar
|
||||
while IFS="" read -r -d "" path; do
|
||||
dir=''${path%/*}; file=''${path##*/}; dest=''${file//-jvm-/-}
|
||||
[[ -e $dir/$dest ]] && continue
|
||||
ln -s "$dir/$file" "$dir/$dest"
|
||||
done < <(find "$out" -type f -name 'okio-jvm-*.jar' -print0)
|
||||
'';
|
||||
# otherwise the package with a namespace starting with info/... gets moved to share/info/...
|
||||
forceShare = [ "dummy" ];
|
||||
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
@ -43,72 +66,78 @@ let
|
||||
|
||||
# Point to our local deps repo
|
||||
gradleInit = writeText "init.gradle" ''
|
||||
logger.lifecycle 'Replacing Maven repositories with ${deps}...'
|
||||
gradle.projectsLoaded {
|
||||
rootProject.allprojects {
|
||||
buildscript {
|
||||
repositories {
|
||||
clear()
|
||||
maven { url '${deps}' }
|
||||
}
|
||||
}
|
||||
settingsEvaluated { settings ->
|
||||
settings.pluginManagement {
|
||||
repositories {
|
||||
clear()
|
||||
maven { url '${deps}' }
|
||||
}
|
||||
}
|
||||
}
|
||||
settingsEvaluated { settings ->
|
||||
settings.pluginManagement {
|
||||
gradle.projectsLoaded {
|
||||
rootProject.allprojects {
|
||||
repositories {
|
||||
clear()
|
||||
maven { url '${deps}' }
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
emoji = stdenv.mkDerivation rec {
|
||||
name = "${pname}-emoji";
|
||||
inherit src;
|
||||
|
||||
nativeBuildInputs = [ jdk gradle ];
|
||||
|
||||
buildPhase = ''
|
||||
GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk} --no-daemon --offline --init-script ${gradleInit} :freeplane:downloadEmoji
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/emoji/txt $out/resources/images
|
||||
cp freeplane/build/emoji/txt/emojilist.txt $out/emoji/txt
|
||||
cp -r freeplane/build/emoji/resources/images/emoji/. $out/resources/images/emoji
|
||||
'';
|
||||
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = emoji_outputHash;
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit pname version src;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper jdk gradle ];
|
||||
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=${jdk} --no-daemon --offline --init-script ${gradleInit} -x test -x :freeplane:downloadEmoji build
|
||||
mkdir -p freeplane/build
|
||||
|
||||
GRADLE_USER_HOME=$PWD \
|
||||
gradle -Dorg.gradle.java.home=${jdk} \
|
||||
--no-daemon --offline --init-script ${gradleInit} \
|
||||
-x test \
|
||||
build
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "freeplane";
|
||||
desktopName = "freeplane";
|
||||
genericName = "Mind-mapper";
|
||||
exec = "freeplane";
|
||||
icon = "freeplane";
|
||||
comment = meta.description;
|
||||
mimeTypes = [
|
||||
"application/x-freemind"
|
||||
"application/x-freeplane"
|
||||
"text/x-troff-mm"
|
||||
];
|
||||
categories = [
|
||||
"2DGraphics"
|
||||
"Chart"
|
||||
"Graphics"
|
||||
"Office"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin $out/share
|
||||
|
||||
cp -a ./BIN/. $out/share/${pname}
|
||||
makeWrapper $out/share/${pname}/${pname}.sh $out/bin/${pname} \
|
||||
--set FREEPLANE_BASE_DIR $out/share/${pname} \
|
||||
mkdir -p $out/bin $out/share
|
||||
cp -a ./BIN/. $out/share/freeplane
|
||||
|
||||
makeWrapper $out/share/freeplane/freeplane.sh $out/bin/freeplane \
|
||||
--set FREEPLANE_BASE_DIR $out/share/freeplane \
|
||||
--set JAVA_HOME ${jdk} \
|
||||
--prefix PATH : ${lib.makeBinPath [ jdk which ]}
|
||||
--prefix PATH : ${lib.makeBinPath [ jdk which ]} \
|
||||
--prefix _JAVA_AWT_WM_NONREPARENTING : 1 \
|
||||
--prefix _JAVA_OPTIONS : "-Dawt.useSystemAAFontSettings=on"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user