public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: sci-biology/imagej/files/, sci-biology/imagej/
@ 2017-03-15 21:38 Martin Mokrejs
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Mokrejs @ 2017-03-15 21:38 UTC (permalink / raw
  To: gentoo-commits

commit:     395c7e7490baf0d7a6e6550fd47d966c285dc171
Author:     Martin Mokrejš <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
AuthorDate: Wed Mar 15 21:38:28 2017 +0000
Commit:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
CommitDate: Wed Mar 15 21:38:28 2017 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=395c7e74

sci-biology/imagej: new package

Ebuild taken over from https://bugs.gentoo.org/show_bug.cgi?id=112275

src_compile screams about:

>>> Compiling source in /scratch/var/tmp/portage/sci-biology/imagej-1.51k/work/source ...
!!! ERROR: Package jython was not found!

but it builds fine using Apache ant.

ImageJ2 is using maven as a build system ( https://imagej.net/ImageJ2 )

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../imagej/files/AutoThresholder.java.patch        |  10 ++
 sci-biology/imagej/imagej-1.51k.ebuild             | 132 +++++++++++++++++++++
 sci-biology/imagej/metadata.xml                    |  15 +++
 3 files changed, 157 insertions(+)

diff --git a/sci-biology/imagej/files/AutoThresholder.java.patch b/sci-biology/imagej/files/AutoThresholder.java.patch
new file mode 100644
index 000000000..97c893244
--- /dev/null
+++ b/sci-biology/imagej/files/AutoThresholder.java.patch
@@ -0,0 +1,10 @@
+--- imagej-1.51k/work/source/ij/process/AutoThresholder.java.ori	2017-03-15 22:33:45.843801175 +0100
++++ imagej-1.51k/work/source/ij/process/AutoThresholder.java	2017-03-15 22:33:55.104053480 +0100
+@@ -650,7 +650,6 @@
+ 		}
+ 		// The threshold is the minimum between the two peaks.
+ 		for (int i=1; i<255; i++) {
+-			//IJ.log(" "+i+"  "+iHisto[i]);
+ 			if (iHisto[i-1] > iHisto[i] && iHisto[i+1] >= iHisto[i]) {
+ 				threshold = i;
+ 				break;

diff --git a/sci-biology/imagej/imagej-1.51k.ebuild b/sci-biology/imagej/imagej-1.51k.ebuild
new file mode 100644
index 000000000..0467973e4
--- /dev/null
+++ b/sci-biology/imagej/imagej-1.51k.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=6
+
+inherit java-pkg-2 java-ant-2 eutils versionator
+
+MY_PN="ij"
+MY_PV=$(delete_all_version_separators)
+
+# NOTE:
+# as plugins are regularly lagging behind, we use the pack released for previous
+# version instead. Change to present version locally if you are sure proper
+# version has been released.
+# see https://bugs.gentoo.org/show_bug.cgi?id=112275
+IJ_PV=$(expr ${MY_PV::3} - 1)
+
+DESCRIPTION="Image Processing and Analysis in Java"
+HOMEPAGE="http://rsb.info.nih.gov/ij/"
+
+SRC_URI="http://imagej.nih.gov/ij/download/src/${MY_PN}${MY_PV}-src.zip
+	http://rsb.info.nih.gov/ij/images/ImageJ.png
+	plugins? ( http://wsr.imagej.net/distros/cross-platform/${MY_PN}${IJ_PV}.zip )"
+# plugins are under a different licenses and can be installed into user's $IJ_HOME/plugins
+#	plugins? ( http://rsb.info.nih.gov/ij/download/zips/${MY_PN}${IJ_PV}.zip )"
+
+RESTRICT=""
+LICENSE="public-domain"
+SLOT="0"
+
+KEYWORDS=""
+
+IUSE="doc plugins debug"
+
+RDEPEND=">=virtual/jre-1.6:*
+	dev-java/java-config
+	dev-java/jython"
+DEPEND=">=virtual/jdk-1.6:*
+	dev-java/ant-core
+	${RDEPEND}"
+
+S=${WORKDIR}/source
+IJ_S=${WORKDIR}/ImageJ
+
+src_prepare() {
+	cp "${DISTDIR}"/ImageJ.png "${WORKDIR}/${PN}.png" || die
+
+	if ! use debug ; then
+		sed -i 's: debug="on">: debug="off">:' "${S}"/build.xml || die
+	fi
+	epatch "${FILESDIR}"/AutoThresholder.java.patch
+	eapply_user
+}
+
+# in src_compile we get: !!! ERROR: Package jython was not found!
+# TODO: overwrite calls to jython ? See
+#   ij/plugin/frame/Editor.java
+#   plugin/PlugInInterpreter.java
+#   plugin/Macro_Runner.java
+
+src_compile() {
+	local antflags="build"
+	use doc && antflags="${antflags} javadocs"
+
+	ant ${antflags} || die  "ant build failed"
+
+	# Max memory usage depends on available memory and CPU type
+	MEM=$(grep MemTotal ${EPREFIX}/proc/meminfo | cut -d':' -f2 | grep -o [0-9]*)
+	IJ_MAX_MEM=$(expr ${MEM} / 1024)
+	if use x86 && $IJ_MAX_MEM -gt 2048 ; then
+		IJ_MAX_MEM=2048
+	fi
+	# build finished, generate startup wrapper
+	cat <<EOF > "${T}/${PN}"
+#!${EPREFIX}/bin/bash
+IJ_LIB=${EPREFIX}/usr/share/${PN}/lib
+if !([ "\${IJ_HOME}" ]) ; then
+	IJ_HOME=\${HOME}
+fi
+if [ -d \${IJ_HOME}/plugins ] ; then
+	IJ_PLG=\${IJ_HOME}
+else
+	IJ_PLG=${EPREFIX}/usr/share/${PN}/lib
+fi
+if !([ "\$IJ_MEM" ]) ; then
+	IJ_MEM=${IJ_MAX_MEM}
+fi
+if !([ "\$IJ_CP" ]) ; then
+	IJ_CP=\$(java-config -p imagej):\$(java-config -O)/lib/tools.jar
+else
+	IJ_CP=\$(java-config -p imagej):\$(java-config -O)/lib/tools.jar:\${IJ_CP}
+fi
+\$(java-config --java) \\
+	-Xmx\${IJ_MEM}m -Dswing.aatext=true \\
+	-Dawt.useSystemAAFontSettings=on\\
+	-cp \${IJ_CP} \\
+	-Duser.home=\${IJ_HOME} \\
+	-Dplugins.dir=\${IJ_PLG} \\
+	ij.ImageJ "\$@"
+EOF
+}
+
+src_install() {
+	java-pkg_dojar *.jar
+	dobin "${T}/${PN}"
+
+	if use plugins ; then
+		cp -R "${IJ_S}"/plugins "${ED}"/usr/share/"${PN}"/lib/
+		cp -R "${IJ_S}"/macros "${ED}"/usr/share/"${PN}"/lib/
+	fi
+
+	use doc && java-pkg_dohtml -r "${WORKDIR}"/api
+
+	insinto /usr/share/pixmaps
+	doins "${WORKDIR}/${PN}".png
+	make_desktop_entry "${PN}" ImageJ "${PN}".png Graphics
+}
+
+pkg_postinst() {
+	einfo ""
+	einfo "You can configure the path of a folder, which contains \"plugins\" directory and IJ_Prefs.txt,"
+	einfo "by setting the environmental variable, \$IJ_HOME."
+	einfo "Default setting is \$IJ_HOME=\${HOME}, i.e. \${HOME}/plugins and \${HOME}/IJ_Prefs.txt."
+	einfo ""
+	einfo "You can also configure the memory size by setting the environmental variable, \$IJ_MEM,"
+	einfo "and the class path by setting the environmental variable, \$IJ_CP."
+	einfo ""
+	einfo "If you want to use much more plugins, please see http://rsb.info.nih.gov/ij/plugins/index.html"
+	einfo "and add *.class files to \$IJ_HOME/plugins folder"
+	einfo ""
+}

diff --git a/sci-biology/imagej/metadata.xml b/sci-biology/imagej/metadata.xml
new file mode 100644
index 000000000..4f14b2e58
--- /dev/null
+++ b/sci-biology/imagej/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>mmokrejs@fold.natur.cuni.cz</email>
+    <name>Martin Mokrejs</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>sci-biology@gentoo.org</email>
+    <name>Gentoo Biology Project</name>
+  </maintainer>
+  <use>
+    <flag name="plugins">Install additional plugins</flag>
+  </use>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/sci:master commit in: sci-biology/imagej/files/, sci-biology/imagej/
@ 2021-01-26 15:02 Andrew Ammerlaan
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Ammerlaan @ 2021-01-26 15:02 UTC (permalink / raw
  To: gentoo-commits

commit:     2bb3e74a499bc39723588d1affa29204bf82a78f
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Tue Jan 26 15:00:08 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Tue Jan 26 15:00:08 2021 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=2bb3e74a

sci-biology/imagej: version bump, EAPI bump, add keywords

Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>

 .../imagej/files/AutoThresholder.java.patch        | 10 -----
 .../{imagej-1.51k.ebuild => imagej-1.53g.ebuild}   | 49 ++++++++--------------
 2 files changed, 18 insertions(+), 41 deletions(-)

diff --git a/sci-biology/imagej/files/AutoThresholder.java.patch b/sci-biology/imagej/files/AutoThresholder.java.patch
deleted file mode 100644
index 97c893244..000000000
--- a/sci-biology/imagej/files/AutoThresholder.java.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- imagej-1.51k/work/source/ij/process/AutoThresholder.java.ori	2017-03-15 22:33:45.843801175 +0100
-+++ imagej-1.51k/work/source/ij/process/AutoThresholder.java	2017-03-15 22:33:55.104053480 +0100
-@@ -650,7 +650,6 @@
- 		}
- 		// The threshold is the minimum between the two peaks.
- 		for (int i=1; i<255; i++) {
--			//IJ.log(" "+i+"  "+iHisto[i]);
- 			if (iHisto[i-1] > iHisto[i] && iHisto[i+1] >= iHisto[i]) {
- 				threshold = i;
- 				break;

diff --git a/sci-biology/imagej/imagej-1.51k.ebuild b/sci-biology/imagej/imagej-1.53g.ebuild
similarity index 71%
rename from sci-biology/imagej/imagej-1.51k.ebuild
rename to sci-biology/imagej/imagej-1.53g.ebuild
index 57b46c045..6c9fdf736 100644
--- a/sci-biology/imagej/imagej-1.51k.ebuild
+++ b/sci-biology/imagej/imagej-1.53g.ebuild
@@ -1,47 +1,41 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
-inherit java-pkg-2 java-ant-2 eutils versionator
+inherit java-pkg-2 java-ant-2 desktop
 
 MY_PN="ij"
-MY_PV=$(delete_all_version_separators)
-
-# NOTE:
-# as plugins are regularly lagging behind, we use the pack released for previous
-# version instead. Change to present version locally if you are sure proper
-# version has been released.
-# see https://bugs.gentoo.org/show_bug.cgi?id=112275
-# https://github.com/imagej/imagej1/issues/28
-IJ_PV=$((${MY_PV::3}-1))
+MY_PV=${PV//.}
+IJ_PV=${MY_PV::-1}
 
 DESCRIPTION="Image Processing and Analysis in Java"
-HOMEPAGE="http://rsb.info.nih.gov/ij/"
+HOMEPAGE="https://imagej.nih.gov/ij/"
 
-SRC_URI="http://imagej.nih.gov/ij/download/src/${MY_PN}${MY_PV}-src.zip
-	http://rsb.info.nih.gov/ij/images/ImageJ.png
-	plugins? ( http://wsr.imagej.net/distros/cross-platform/${MY_PN}${IJ_PV}.zip )"
+SRC_URI="https://imagej.nih.gov/ij/download/src/${MY_PN}${MY_PV}-src.zip
+	https://rsb.info.nih.gov/ij/images/ImageJ.png
+	plugins? ( https://wsr.imagej.net/distros/cross-platform/${MY_PN}${IJ_PV}.zip )"
 # plugins are under a different licenses and can be installed into user's $IJ_HOME/plugins
 #	plugins? ( http://rsb.info.nih.gov/ij/download/zips/${MY_PN}${IJ_PV}.zip )"
 
-RESTRICT=""
 LICENSE="public-domain" # http://imagej.net/disclaimer.html
 SLOT="0"
 
-KEYWORDS=""
+KEYWORDS="~amd64"
 
 IUSE="doc plugins debug"
 
-RDEPEND=">=virtual/jre-1.6:*
+RDEPEND="
+	>=virtual/jre-1.7:*
 	dev-java/java-config
-	dev-java/jython"
-DEPEND=">=virtual/jdk-1.6:*
+"
+DEPEND="${RDEPEND}
+	>=virtual/jdk-1.7:*
 	dev-java/ant-core
 	app-arch/unzip
-	${RDEPEND}"
+"
 
-S=${WORKDIR}/source
+S="${WORKDIR}/source"
 IJ_S=${WORKDIR}/ImageJ
 
 src_prepare() {
@@ -50,16 +44,9 @@ src_prepare() {
 	if ! use debug ; then
 		sed -i 's: debug="on">: debug="off">:' "${S}"/build.xml || die
 	fi
-	epatch "${FILESDIR}"/AutoThresholder.java.patch
-	eapply_user
+	default
 }
 
-# in src_compile we get: !!! ERROR: Package jython was not found!
-# TODO: overwrite calls to jython ? See
-#   ij/plugin/frame/Editor.java
-#   plugin/PlugInInterpreter.java
-#   plugin/Macro_Runner.java
-
 src_compile() {
 	local antflags="build"
 	use doc && antflags="${antflags} javadocs"
@@ -115,7 +102,7 @@ src_install() {
 
 	insinto /usr/share/pixmaps
 	doins "${WORKDIR}/${PN}".png
-	make_desktop_entry "${PN}" ImageJ "${PN}".png Graphics
+	make_desktop_entry "${PN}" ImageJ "${PN}" Graphics
 }
 
 pkg_postinst() {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-26 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-15 21:38 [gentoo-commits] proj/sci:master commit in: sci-biology/imagej/files/, sci-biology/imagej/ Martin Mokrejs
  -- strict thread matches above, loose matches on Subject: below --
2021-01-26 15:02 Andrew Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox