phc-intel-0.3.2.12.16.ebuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit linux-info linux-mod eutils
  5. DESCRIPTION="Processor Hardware Control for Intel CPUs"
  6. HOMEPAGE="http://www.linux-phc.org/
  7. http://www.linux-phc.org/forum/viewtopic.php?f=7&t=267"
  8. #no automatic filenames here, sorry
  9. SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=162 -> phc-intel-pack-rev16.tar.bz2"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE=""
  14. CONFIG_CHECK="~!X86_ACPI_CPUFREQ"
  15. ERROR_X86_ACPI_CPUFREQ="CONFIG_X86_ACPI_CPUFREQ has to be configured to Module to enable the replacement of acpi-cpufreq with phc-intel."
  16. MODULE_NAMES="phc-intel(misc:)"
  17. BUILD_PARAMS="KERNELSRC=\"${KERNEL_DIR}\" -j1"
  18. BUILD_TARGETS="all"
  19. S=${WORKDIR}/${A/.tar.bz2}
  20. pkg_setup() {
  21. if kernel_is lt 2 6 27 ; then
  22. eerror "Your kernel version is no longer supported by this version of ${PN}."
  23. eerror "Please use a previous version of ${PN} or a newer kernel."
  24. die
  25. fi
  26. if kernel_is gt 3 19 ; then
  27. eerror "Your kernel version is not yet tested with this version of ${PN}."
  28. eerror "It might not build or expose runtime problems."
  29. fi
  30. linux-mod_pkg_setup
  31. }
  32. src_prepare() {
  33. epatch \
  34. "${FILESDIR}"/phc-intel-0.3.2-rev12-trailing-space-misc.patch \
  35. "${FILESDIR}"/phc-intel-0.3.2-rev15-trailing-space-3.5.patch \
  36. "${FILESDIR}"/phc-intel-0.3.2-rev14-trailing-space-3.13.patch \
  37. "${FILESDIR}"/phc-intel-0.3.2-rev14-trailing-space-3.14.patch \
  38. "${FILESDIR}"/phc-intel-0.3.2-rev15-trailing-space-3.15.patch \
  39. "${FILESDIR}"/phc-intel-0.3.2-rev16-trailing-space-3.16.patch
  40. sed -e '/^all:/s:prepare::' \
  41. -i Makefile || die
  42. local my_sub=arch/x86/kernel/cpu
  43. if kernel_is gt 2 6 39 ; then
  44. my_sub=drivers
  45. fi
  46. cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/acpi-cpufreq.c . || die
  47. if kernel_is lt 3 12 ; then
  48. cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/mperf.h . || die
  49. fi
  50. if kernel_is lt 3 0 ; then
  51. epatch inc/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}/linux-phc-0.3.2.patch
  52. elif kernel_is lt 3 17 ; then
  53. epatch inc/${KV_MAJOR}.${KV_MINOR}/linux-phc-0.3.2.patch
  54. else
  55. epatch inc/3.16/linux-phc-0.3.2.patch
  56. fi
  57. mv acpi-cpufreq.c phc-intel.c || die
  58. }