summaryrefslogtreecommitdiff
blob: 5d181aa4e9d3be3a1d1150df6bccdf61bbc6fcd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-electronics/kicad/kicad-20130518.ebuild,v 1.1 2013/06/06 19:24:31 calchan Exp $

#TODO:
# - python and wxpython scripting

EAPI="5"

WX_GTK_VER="2.8"

inherit eutils unpacker cmake-utils wxwidgets fdo-mime gnome2-utils

DESCRIPTION="Electronic Schematic and PCB design tools."
HOMEPAGE="http://www.kicad-pcb.org"

RELEASE_DATE="2013-05-18"
BZR_REV="4017"
UBUNTU_VER="12.04"
BASE_SRC_URI="http://iut-tice.ujf-grenoble.fr/cao"
SRC_URI="${BASE_SRC_URI}/${PN}-sources-stable_${RELEASE_DATE}_BZR${BZR_REV}.zip
	${BASE_SRC_URI}/${PN}-${RELEASE_DATE}-BZR${BZR_REV}-stable-UBUNTU_${UBUNTU_VER}_full_with_components_doc.tgz"

LICENSE="GPL-2 kicad-doc"
SLOT="0"

KEYWORDS="~amd64 ~x86"

IUSE="debug"
LANGS="de en es fr hu it ja pl pt ru zh_CN"
for lang in ${LANGS} ; do
	IUSE="${IUSE} linguas_${lang}"
done

CDEPEND="x11-libs/wxGTK:${WX_GTK_VER}[gnome,opengl,X]
	dev-python/wxpython:${WX_GTK_VER}[opengl]"
DEPEND="${CDEPEND}
	>=dev-util/cmake-2.6.4
	>=dev-libs/boost-1.49[python]
	app-doc/doxygen"
RDEPEND="${CDEPEND}
	sys-libs/zlib
	sci-electronics/electronics-menu"

S="${WORKDIR}/stable_${RELEASE_DATE}_BZR${BZR_REV}"

src_prepare() {
	epatch "${FILESDIR}/${PN}-native-boost.patch"
	epatch "${FILESDIR}/${PN}-desktop-file.patch"
	epatch "${FILESDIR}/${PN}-scripts.patch"
	epatch "${FILESDIR}/${PN}-missing-doc.patch"
	rm -f resources/linux/mime/applications/eeschema.desktop
}

src_configure() {
	need-wxwidgets unicode

	mycmakeargs="${mycmakeargs}
		-DKICAD_STABLE_VERSION=ON
		-DKICAD_wxUSE_UNICODE=ON
		-DKICAD_DOCS=/usr/share/doc/${PN}
		-DKICAD_HELP=/usr/share/doc/${PN}"

#		-DKICAD_SCRIPTING=ON
#		-DKICAD_SCRIPTING_MODULES=ON
#		-DKICAD_SCRIPTING_WXPYTHON=ON

	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile all doxygen-docs
}

src_install() {
	cmake-utils_src_install

	insinto /usr/share/${PN}
	doins -r "${WORKDIR}/${PN}/share/library"
	doins -r "${WORKDIR}/${PN}/share/modules"

	insinto /usr/share/doc/${PN}
	doins -r "${WORKDIR}/${PN}/doc/contrib"

	insinto /usr/share/doc/${PN}/help
	for lang in $LANGS ; do
		if [[ -d "${WORKDIR}/${PN}/doc/help/${lang}" ]] ; then
			use linguas_$lang && doins -r "${WORKDIR}/${PN}/doc/help/${lang}"
		fi
	done

	insinto /usr/share/doc/${PN}/tutorials
	for lang in $LANGS ; do
		if [[ -d "${WORKDIR}/${PN}/doc/tutorials/${lang}" ]] ; then
			use linguas_$lang && doins -r "${WORKDIR}/${PN}/doc/tutorials/${lang}"
		fi
	done

	local dev_doc="/usr/share/doc/${PN}/development"
	insinto ${dev_doc}
	doins HOW_TO_CONTRIBUTE.txt notes_about_pcbnew_new_file_format.odt TODO.txt uncrustify.cfg
	doins "${WORKDIR}/${PN}/doc/help/file_formats/file_formats.pdf"
	cd Documentation
	doins -r *

	docompress -x \
		${dev_doc}/GUI_Translation_HOWTO.odt \
		${dev_doc}/notes_about_pcbnew_new_file_format.odt \
		${dev_doc}/uncrustify.cfg
		${dev_doc}/file_formats.pdf
}

pkg_preinst() {
	gnome2_icon_savelist
}

pkg_postinst() {
	fdo-mime_desktop_database_update
	fdo-mime_mime_database_update
	gnome2_icon_cache_update

	elog "You may want to emerge media-gfx/wings if you want to create 3D models of components."
}

pkg_postrm() {
	fdo-mime_desktop_database_update
	fdo-mime_mime_database_update
	gnome2_icon_cache_update
}