aboutsummaryrefslogtreecommitdiff
blob: 0e20e5c52de133b5687f185bffdd1740057cdae5 (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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

PYTHON_COMPAT=( python2_7 )

WX_GTK_VER=2.8

inherit multilib python-single-r1 versionator wxwidgets

MY_PV="$(replace_version_separator 2 -)"
MY_P="phenix-installer-${MY_PV}"

DESCRIPTION="Python-based Hierarchical ENvironment for Integrated Xtallography"
HOMEPAGE="http://phenix-online.org/"
SRC_URI="
	amd64? ( phenix-installer-${MY_PV}-intel-linux-2.6-x86_64-fc12.tar )
	x86? ( phenix-installer-${MY_PV}-intel-linux-2.6-centos5.tar )
"

SLOT="0"
LICENSE="phenix"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE=""

REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="${PYTHON_DEPS}
	app-arch/bzip2
	dev-db/sqlite:3
	dev-libs/atk
	dev-libs/boost
	dev-libs/expat
	dev-libs/glib:2
	dev-libs/openssl
	media-gfx/nvidia-cg-toolkit
	media-libs/fontconfig
	media-libs/freetype
	media-libs/libpng:1.2
	sys-libs/db:4.7
	sys-libs/gdbm
	|| (
		sys-libs/ncurses:0/5[tinfo]
		sys-libs/ncurses:5/5[tinfo]
	)
	sys-libs/readline
	virtual/glu
	x11-libs/cairo
	x11-libs/gdk-pixbuf:2
	x11-libs/gtk+:2
	x11-libs/pango
	x11-libs/pixman
	x11-libs/libSM
	x11-libs/libX11
	x11-libs/libXcursor
	x11-libs/libXext
	x11-libs/libXfixes
	x11-libs/libXft
	x11-libs/libXinerama
	x11-libs/libXi
	x11-libs/libXmu
	x11-libs/libXrandr
	x11-libs/libXrender
	x11-libs/libXxf86vm
	x11-libs/wxGTK:${WX_GTK_VER}[X]
	sys-libs/zlib
	virtual/jpeg:62"
DEPEND="${PYTHON_DEPS}"

RESTRICT="fetch"

QA_PREBUILT="opt/phenix-${MY_PV}/.*"

S="${WORKDIR}"/${MY_P}

pkg_nofetch() {
	elog "Please visit"
	elog "http://www.phenix-online.org/phenix_request/index.cgi"
	elog "and request a download password. With that done,"
	elog "visit http://www.phenix-online.org/download/phenix/release"
	elog "and download version \"Kernel 2.6 (64-bit; Fedora 12)\" (${A})"
	elog "into ${DISTDIR}"
}

src_prepare() {
	cat > "${S}/bin/machine_type" <<-EOF
	#!${EPREFIX}/bin/sh
	echo intel-linux-2.6-x86_64
	exit 0
	EOF
}

src_compile() {
	LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir)" ./install --prefix="${S}/foo" || die
}

src_install() {
	sed \
		-e "s:${S}/foo:${EPREFIX}/opt:g" \
		-i \
			build-binary/intel-linux-2.6-*/*/log/*.log \
			build-final/intel-linux-2.6-*/*/log/*.log \
			foo/phenix-${MY_PV}/build/intel-linux-2.6-*/*_env \
			foo/phenix-${MY_PV}/build/intel-linux-*/*sh \
			foo/phenix-${MY_PV}/build/intel-linux-*/bin/* \
			foo/phenix-${MY_PV}/build/intel-linux-2.6-*/base/etc/{gtk*,pango}/* \
			foo/phenix-${MY_PV}/phenix_env* \
			|| die

	dodir /opt
	mv "${S}/foo/phenix-${MY_PV}" "${ED}/opt/" || die

	cat >> phenix <<- EOF
	#!${EPREFIX}/bin/bash

	source "${EPREFIX}/opt/phenix-${MY_PV}/phenix_env.sh"
	export LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir)"
	exec phenix
	EOF
	dobin phenix

	python_fix_shebang "${ED}"/opt
	python_optimize "${ED}"/opt
}