forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpuid2cpuflags-1.ebuild
39 lines (30 loc) · 1.03 KB
/
cpuid2cpuflags-1.ebuild
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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
PYTHON_COMPAT=( python{2_7,3_4} pypy )
inherit python-r1
MY_PN=cpuinfo2cpuflags
MY_P=${MY_PN}-${PV}
DESCRIPTION="Script to guess CPU_FLAGS_X86 flags from /proc/cpuinfo"
HOMEPAGE="https://github.com/mgorny/cpuid2cpuflags"
SRC_URI="https://github.com/mgorny/cpuid2cpuflags/releases/download/v${PV}/${MY_P}.tar.gz"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
IUSE=""
RDEPEND=${PYTHON_DEPS}
REQUIRED_USE=${PYTHON_REQUIRED_USE}
S=${WORKDIR}/${MY_P}
src_install() {
python_foreach_impl python_newscript "${MY_PN}-x86"{.py,}
}
pkg_postinst() {
if has_version 'sys-apps/portage' \
&& ! has_version "sys-apps/portage[${PYTHON_USEDEP}]"
then
ewarn "Support for matching Python implementations should be enabled"
ewarn "on sys-apps/portage as well. Otherwise, cpuinfo2cpuflags won't"
ewarn "be able to figure out the correct repository location and will"
ewarn "require you to specify it explicitly."
fi
}