Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 560768
Collapse All | Expand All

(-)a/sci-electronics/kicad/kicad-4.0.0_rc1.ebuild (-14 / +20 lines)
Lines 7-13 PYTHON_COMPAT=( python2_7 ) Link Here
7
7
8
WX_GTK_VER="3.0"
8
WX_GTK_VER="3.0"
9
9
10
inherit cmake-utils fdo-mime flag-o-matic gnome2-utils python-single-r1 python-utils-r1 vcs-snapshot wxwidgets versionator
10
inherit cmake-utils fdo-mime flag-o-matic gnome2-utils python-single-r1 vcs-snapshot wxwidgets versionator
11
11
12
DESCRIPTION="Electronic Schematic and PCB design tools."
12
DESCRIPTION="Electronic Schematic and PCB design tools."
13
HOMEPAGE="http://www.kicad-pcb.org"
13
HOMEPAGE="http://www.kicad-pcb.org"
Lines 53-59 DEPEND="${CDEPEND} Link Here
53
	app-arch/xz-utils
53
	app-arch/xz-utils
54
	doc? ( app-doc/doxygen )
54
	doc? ( app-doc/doxygen )
55
	i18n? ( >=sys-devel/gettext-0.18 )
55
	i18n? ( >=sys-devel/gettext-0.18 )
56
	python? ( dev-lang/swig:0 )"
56
	python? ( dev-lang/swig:0 )
57
	app-text/dos2unix"
57
RDEPEND="${CDEPEND}
58
RDEPEND="${CDEPEND}
58
	sci-electronics/electronics-menu"
59
	sci-electronics/electronics-menu"
59
60
Lines 64-73 pkg_setup() { Link Here
64
}
65
}
65
66
66
src_prepare() {
67
src_prepare() {
67
	if use python; then
68
	# remove all the non unix file endings
68
		# dev-python/wxpython doesn't support python3
69
	find "${S}" -type f -name "*.desktop" | xargs -n1 dos2unix || die "dos2unix failed"
69
		sed '/set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)/d' -i CMakeModules/FindPythonLibs.cmake || die "sed failed"
70
	fi
71
70
72
	# Handle optional minimal install.
71
	# Handle optional minimal install.
73
	if use minimal; then
72
	if use minimal; then
Lines 78-84 src_prepare() { Link Here
78
		ln -s "${WORKDIR}/${P}-library" "${S}/${PN}-library" || die "ln failed"
77
		ln -s "${WORKDIR}/${P}-library" "${S}/${PN}-library" || die "ln failed"
79
		# add the libraries directory to cmake as a subproject to build
78
		# add the libraries directory to cmake as a subproject to build
80
		sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-library )" -i CMakeLists.txt || die "sed failed"
79
		sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-library )" -i CMakeLists.txt || die "sed failed"
81
		# add the libraries directory subproject also to uninstallation procedures
80
		# remove duplicate uninstall directions for the library module
82
		sed '/make uninstall/,/# /d' -i ${PN}-library/CMakeLists.txt || die "sed failed"
81
		sed '/make uninstall/,/# /d' -i ${PN}-library/CMakeLists.txt || die "sed failed"
83
	fi
82
	fi
84
83
Lines 89-95 src_prepare() { Link Here
89
		# Remove unused languages. Project generates only languages specified in the
88
		# Remove unused languages. Project generates only languages specified in the
90
		# file in LINGUAS in the subproject folder. By default all languages are added
89
		# file in LINGUAS in the subproject folder. By default all languages are added
91
		# so we sed out the unused ones based on the user linguas_* settings.
90
		# so we sed out the unused ones based on the user linguas_* settings.
92
		local lang=""
91
		local lang
93
		for lang in ${LANGS}; do
92
		for lang in ${LANGS}; do
94
			if ! use linguas_${lang}; then
93
			if ! use linguas_${lang}; then
95
				sed "/${lang}/d" -i ${PN}-i18n/LINGUAS || die "sed failed"
94
				sed "/${lang}/d" -i ${PN}-i18n/LINGUAS || die "sed failed"
Lines 101-114 src_prepare() { Link Here
101
		sed "s|\${CMAKE_SOURCE_DIR}/\${LANG}|\${CMAKE_SOURCE_DIR}/${PN}-i18n/\${LANG}|g" -i ${PN}-i18n/CMakeLists.txt || die "sed failed"
100
		sed "s|\${CMAKE_SOURCE_DIR}/\${LANG}|\${CMAKE_SOURCE_DIR}/${PN}-i18n/\${LANG}|g" -i ${PN}-i18n/CMakeLists.txt || die "sed failed"
102
		# add the translations directory to cmake as a subproject to build
101
		# add the translations directory to cmake as a subproject to build
103
		sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-i18n )" -i CMakeLists.txt || die "sed failed"
102
		sed "/add_subdirectory( bitmaps_png )/a add_subdirectory( ${PN}-i18n )" -i CMakeLists.txt || die "sed failed"
104
		# add the translations directory subproject also to uninstallation procedures
103
		# remove duplicate uninstall directions for the translation module
105
		sed '/make uninstall/,$d' -i ${PN}-i18n/CMakeLists.txt || die "sed failed"
104
		sed '/make uninstall/,$d' -i ${PN}-i18n/CMakeLists.txt || die "sed failed"
106
	fi
105
	fi
107
106
108
	# Install examples in the right place if requested
107
	# Install examples in the right place if requested
109
	if use examples; then
108
	if use examples; then
109
		# install demos into the examples folder too
110
		sed -e 's:${KICAD_DATA}/demos:${KICAD_DOCS}/examples:' -i CMakeLists.txt || die "sed failed"
110
		sed -e 's:${KICAD_DATA}/demos:${KICAD_DOCS}/examples:' -i CMakeLists.txt || die "sed failed"
111
	else
111
	else
112
		# remove additional demos/examples as its not strictly required to run the binaries 
112
		sed -e '/add_subdirectory( demos )/d' -i CMakeLists.txt || die "sed failed"
113
		sed -e '/add_subdirectory( demos )/d' -i CMakeLists.txt || die "sed failed"
113
	fi
114
	fi
114
115
Lines 120-125 src_configure() { Link Here
120
	need-wxwidgets unicode
121
	need-wxwidgets unicode
121
122
122
	local mycmakeargs=(
123
	local mycmakeargs=(
124
		-DPYTHON_DEST="$(python_get_sitedir)"
125
		-DPYTHON_EXECUTABLE="${PYTHON}"
126
		-DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
127
		-DPYTHON_LIBRARY="$(python_get_library_path)"
123
		-DKICAD_DOCS="/usr/share/doc/${PF}"
128
		-DKICAD_DOCS="/usr/share/doc/${PF}"
124
		-DKICAD_HELP="/usr/share/doc/${PF}/help"
129
		-DKICAD_HELP="/usr/share/doc/${PF}/help"
125
		-DwxUSE_UNICODE=ON
130
		-DwxUSE_UNICODE=ON
Lines 132-138 src_configure() { Link Here
132
		$(usex i18n "-DKICAD_I18N_UNIX_STRICT_PATH=1" "")
137
		$(usex i18n "-DKICAD_I18N_UNIX_STRICT_PATH=1" "")
133
	)
138
	)
134
	if use debug; then
139
	if use debug; then
135
		append-flags "-DDEBUG"
140
		append-cxxflags "-DDEBUG"
141
		append-cflags "-DDEBUG"
136
	fi
142
	fi
137
	cmake-utils_src_configure
143
	cmake-utils_src_configure
138
}
144
}
Lines 146-157 src_compile() { Link Here
146
152
147
src_install() {
153
src_install() {
148
	cmake-utils_src_install
154
	cmake-utils_src_install
149
	use python && python_optimize "${D}/usr/$(get_libdir)/${EPYTHON}/site-packages/pcbnew.py"
155
	use python && python_optimize
150
	if use doc ; then
156
	if use doc ; then
151
		insinto /usr/share/doc/${PF}
157
		insinto /usr/share/doc/${PF}
152
		doins uncrustify.cfg
158
		dodoc uncrustify.cfg
153
		cd Documentation || die "cd failed"
159
		cd Documentation || die "cd failed"
154
		doins -r GUI_Translation_HOWTO.pdf guidelines/UIpolicies.txt doxygen/*
160
		dodoc -r GUI_Translation_HOWTO.pdf guidelines/UIpolicies.txt doxygen/.
155
	fi
161
	fi
156
}
162
}
157
163
Lines 171-178 pkg_postinst() { Link Here
171
		ewarn "- Remove the libraries from the 'Libs and Dir' preferences."
177
		ewarn "- Remove the libraries from the 'Libs and Dir' preferences."
172
		ewarn "- Fix the libraries' locations in the 'Libs and Dir' preferences."
178
		ewarn "- Fix the libraries' locations in the 'Libs and Dir' preferences."
173
		ewarn "- Emerge ${PN} without the 'minimal' USE flag."
179
		ewarn "- Emerge ${PN} without the 'minimal' USE flag."
174
		ewarn ""
175
	fi
180
	fi
181
	elog ""
176
	elog "You may want to emerge media-gfx/wings if you want to create 3D models of components."
182
	elog "You may want to emerge media-gfx/wings if you want to create 3D models of components."
177
}
183
}
178
184

Return to bug 560768