Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-embedded/arduino: fix #610036 dead SRC_URI googlecode and new EAPI #4157

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-embedded/arduino/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST arduino-1.0.5-src.tar.gz 40526292 SHA256 2f222c944d317dcae40c2d9a1e8ca8c2092f1fff4e3d1814c609209ffc9afe17 SHA512 0401bf6051a48d343f9e4e822446a846b2c6446c68949efe5daf5f5445114312eecb9c99a4565ab2e2f80831aaa32122ecc21f81c8a97136704482cd0f1f1c00 WHIRLPOOL 9176557007b039dae097dd96fc6a56956117ec879f3689005493bb19f54909e6f502672c92e81cb8bdc24b3a661881ffd696e7179b4dfc4a68af38a8d05cee93
DIST arduino-icons.tar.bz2 58775 SHA256 9086ae27a13cc19e428ed7e6434366752b33a7d066b5620bfdd371709277390e SHA512 b750e79d6117f5df619f2b765dad6e64f0ba4aa3314b0b6e00801577e3ea1f15951ba15efe7a00f5317285a19ac29ac41c78b71342f45cd164c794a42bafcdd9 WHIRLPOOL b53ab3ff2981ca9f6d45311b9f885ca831700a7a49fef4a376cdc489f7cc3a6c39fbb93994b962b6854b0833d7342b951b5c6327422aafce762f92952b7a5876
DIST arduino-src-1.0.5.tar.gz 235284641 SHA256 2ef590bd71e94b32a827837d490d16f9037fa5f3d564045927eed919351f9b7f SHA512 0a40203b8a31c4d9288500962ada7f5083c280a84d8c56ab7da2d1326e1c02a908a96db589ab10bafc115abefe010bf23f6994c08e43c86a4ac10c2d4ab93ec2 WHIRLPOOL 4238648cc52342b0dd4cba452a6a54ee5a7271270c2948c9dfbe7689639b8433894dece50c83fa1e320c7a0f8e052432e2bc95c5375256d455c19274d6569b1f
102 changes: 102 additions & 0 deletions dev-embedded/arduino/arduino-1.0.5-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6
JAVA_PKG_IUSE="doc examples"

inherit eutils java-pkg-2 java-ant-2

DESCRIPTION="An open-source AVR electronics prototyping platform"
HOMEPAGE="http://arduino.cc/ https://github.com/arduino/"
SRC_URI="https://github.com/arduino/Arduino/archive/${PV}.tar.gz -> arduino-src-${PV}.tar.gz
mirror://gentoo/arduino-icons.tar.bz2"
LICENSE="GPL-2 GPL-2+ LGPL-2 CC-BY-SA-3.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RESTRICT="strip binchecks"
IUSE=""
S="${WORKDIR}/Arduino-${PV}"

COMMONDEP="
dev-java/jna:0
>dev-java/rxtx-2.1:2"

RDEPEND="${COMMONDEP}
dev-embedded/avrdude
dev-embedded/uisp
sys-devel/crossdev
>=virtual/jre-1.5"

DEPEND="${COMMONDEP}
>=virtual/jdk-1.5"

EANT_GENTOO_CLASSPATH="jna,rxtx-2"
EANT_EXTRA_ARGS="-Dversion=${PV}"
EANT_BUILD_TARGET="build"
JAVA_ANT_REWRITE_CLASSPATH="yes"

src_prepare() {
# Remove the libraries to ensure the system
# libraries are used
rm build/linux/dist/tools/avrdude*
rm build/linux/dist/lib/*
rm app/lib/*
rm -rf app/src/processing/app/macosx
# Patch build/build.xml - remove local jar files
# for rxtx and ecj (use system wide versions)
epatch "${FILESDIR}"/${PN}-1.0.1-build.xml.patch

# Patch launcher script to include rxtx class/ld paths
epatch "${FILESDIR}"/${PN}-1.0.3-script.patch
eapply_user
}

src_compile() {
eant -f core/build.xml
EANT_GENTOO_CLASSPATH_EXTRA="../core/core.jar"
eant -f app/build.xml
eant "${EANT_EXTRA_ARGS}" -f build/build.xml
}

src_install() {
cd "${S}"/build/linux/work
java-pkg_dojar lib/core.jar lib/pde.jar
java-pkg_dolauncher ${PN} --pwd /usr/share/${PN} --main processing.app.Base

if use examples; then
java-pkg_doexamples examples
docompress -x /usr/share/doc/${PF}/examples/
fi

if use doc; then
DOCS=( revisions.txt "${S}"/readme.txt )
HTML_DOCS=( reference )
einstalldocs
java-pkg_dojavadoc "${S}"/build/javadoc/everything
fi

insinto "/usr/share/${PN}/"
doins -r hardware libraries
fowners -R root:uucp "/usr/share/${PN}/hardware"

insinto "/usr/share/${PN}/lib"
doins -r lib/*.txt lib/theme lib/*.jpg

# use system avrdude
# patching class files is too hard
dosym /usr/bin/avrdude "/usr/share/${PN}/hardware/tools/avrdude"
dosym /etc/avrdude.conf "/usr/share/${PN}/hardware/tools/avrdude.conf"

# install menu and icons
domenu "${FILESDIR}/${PN}.desktop"
for sz in 16 24 32 48 128 256; do
newicon -s $sz \
"${WORKDIR}/${PN}-icons/debian_icons_${sz}x${sz}_apps_${PN}.png" \
"${PN}.png"
done
}

pkg_postinst() {
[ ! -x /usr/bin/avr-g++ ] && ewarn "Missing avr-g++; you need to crossdev -s4 avr"
}