2024-03-19 19:43:04 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchsvn,
|
|
|
|
ant,
|
|
|
|
jdk,
|
|
|
|
jre,
|
|
|
|
xmlstarlet,
|
|
|
|
makeWrapper,
|
|
|
|
stripJavaArchivesHook,
|
|
|
|
}:
|
2014-01-03 13:31:57 +00:00
|
|
|
|
2024-03-19 19:43:04 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "jedit";
|
2024-03-19 19:43:04 +00:00
|
|
|
version = "5.6.0-unstable-2023-11-19";
|
|
|
|
|
|
|
|
src = fetchsvn {
|
|
|
|
url = "https://svn.code.sf.net/p/jedit/svn/jEdit/trunk";
|
|
|
|
rev = "25703";
|
|
|
|
hash = "sha256-z1KTZqKl6Dlqayw/3h/JvHQK3kSfio02R8V6aCb4g4Q=";
|
2007-11-16 17:06:53 +00:00
|
|
|
};
|
|
|
|
|
2024-03-19 19:43:04 +00:00
|
|
|
ivyDeps = stdenv.mkDerivation {
|
|
|
|
name = "${finalAttrs.pname}-${finalAttrs.version}-ivy-deps";
|
|
|
|
inherit (finalAttrs) src;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
ant
|
|
|
|
jdk
|
|
|
|
xmlstarlet
|
|
|
|
];
|
2014-11-08 14:00:55 +00:00
|
|
|
|
2024-03-19 19:43:04 +00:00
|
|
|
# set defaultCacheDir to something that can exist
|
|
|
|
# this directory won't get copied, but needs to be set properly
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
2007-11-16 17:06:53 +00:00
|
|
|
|
2024-03-19 19:43:04 +00:00
|
|
|
xmlstarlet ed --subnode /ivysettings -t elem -n caches ivysettings.xml \
|
|
|
|
| xmlstarlet ed --insert /ivysettings/caches -t attr -n defaultCacheDir -v "$(pwd)/ivy-cache" \
|
|
|
|
> ivysettings.xml.tmp
|
|
|
|
mv ivysettings.xml.tmp ivysettings.xml
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
ant retrieve
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -r lib/* $out/lib
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputHashMode = "recursive";
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
outputHash = "sha256-J5i5IhXlXw84y/4K6Vt84au4eVXVLupmtfscO+y1Fi0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
# ignore a test failing because of the build environment
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace test/org/gjt/sp/jedit/MiscUtilitiesTest.java \
|
|
|
|
--replace-fail "public class MiscUtilitiesTest" "@org.junit.Ignore public class MiscUtilitiesTest"
|
2014-11-08 14:00:55 +00:00
|
|
|
'';
|
2014-01-03 13:31:57 +00:00
|
|
|
|
2024-03-19 19:43:04 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ant
|
|
|
|
jdk
|
|
|
|
makeWrapper
|
|
|
|
stripJavaArchivesHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
ln -s ${finalAttrs.ivyDeps}/lib ./lib
|
|
|
|
ant build -Divy.done=true
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
2012-01-17 22:40:05 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2024-03-19 19:43:04 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/share/jEdit
|
2024-03-19 19:43:04 +00:00
|
|
|
cp -r build/jedit.jar doc keymaps macros modes startup $out/share/jEdit
|
|
|
|
|
|
|
|
install -Dm644 icons/jedit-icon48.png $out/share/icons/hicolor/48x48/apps/jedit.png
|
|
|
|
install -Dm644 package-files/linux/deb/jedit.desktop -t $out/share/applications
|
|
|
|
|
|
|
|
sed -i $out/share/applications/jedit.desktop \
|
|
|
|
-e "s|Icon=.*|Icon=jedit|g" \
|
|
|
|
-e "s|Exec=.*|Exec=jedit|g"
|
|
|
|
|
|
|
|
install -Dm755 package-files/linux/jedit -t $out/bin
|
|
|
|
substituteInPlace $out/bin/jedit \
|
|
|
|
--replace-fail "/usr/share/jEdit/@jar.filename@" "$out/share/jEdit/jedit.jar"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/jedit --set JAVA_HOME ${jre}
|
|
|
|
|
|
|
|
runHook postInstall
|
2012-01-17 22:40:05 +00:00
|
|
|
'';
|
2007-11-16 17:06:53 +00:00
|
|
|
|
2024-03-19 19:43:04 +00:00
|
|
|
meta = {
|
|
|
|
description = "A programmer's text editor written in Java";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.jedit.org";
|
2024-03-19 19:43:04 +00:00
|
|
|
license = lib.licenses.gpl2Only;
|
|
|
|
mainProgram = "jedit";
|
|
|
|
maintainers = with lib.maintainers; [ tomasajt ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
sourceProvenance = with lib.sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # ivyDeps contains .jar dependencies
|
|
|
|
];
|
2007-11-16 17:06:53 +00:00
|
|
|
};
|
2024-03-19 19:43:04 +00:00
|
|
|
})
|