displaycal-3.1.6.0.ebuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit distutils-r1 fdo-mime eutils
  6. MY_PN="DisplayCAL"
  7. MY_P="${MY_PN}-${PV}"
  8. DESCRIPTION="Display calibration and characterization powered by Argyll CMS"
  9. HOMEPAGE="https://displaycal.net/"
  10. SRC_URI="mirror://sourceforge/dispcalgui/${MY_P}.tar.gz"
  11. LICENSE="GPL-3"
  12. SLOT="0"
  13. KEYWORDS="~amd64 ~x86"
  14. IUSE=""
  15. DEPEND=">=media-gfx/argyllcms-1.1.0
  16. dev-python/wxpython:2.8
  17. >=x11-libs/libX11-1.3.3
  18. >=x11-apps/xrandr-1.3.2
  19. >=x11-libs/libXxf86vm-1.1.0
  20. >=x11-proto/xineramaproto-1.2
  21. >=x11-libs/libXinerama-1.1"
  22. RDEPEND="${DEPEND}
  23. >=dev-python/numpy-1.2.1"
  24. # Just in case someone renames the ebuild
  25. S=${WORKDIR}/${MY_P}
  26. DOCS=(
  27. README.html
  28. )
  29. src_prepare() {
  30. # Prohibit setup from running xdg-* programs, resulting to sandbox violation
  31. cd "${S}/DisplayCAL" || die "Cannot cd to source directory."
  32. sed -e 's/if which(\"xdg-icon-resource\"):/if which(\"xdg-icon-resource-non-existant\"):/' \
  33. -e 's/if which(\"xdg-desktop-menu\"):/if which(\"xdg-desktop-menu-non-existant\"):/' \
  34. -i postinstall.py || die "sed'ing out the xdg-* setup functions failed"
  35. # Remove deprecated Encoding key from .desktop file
  36. cd "${S}" || die "Cannot cd to work directory."
  37. for offendingFile in $(grep -r -l "Encoding=UTF-8" .); do
  38. sed -e '/Encoding=UTF-8/d' -i "${offendingFile}" || \
  39. die "removing deprecated Encoding key from .desktop files failed"
  40. done
  41. # Remove x-world Media Type
  42. cd "${S}/misc" || die "Cannot cd to misc directory."
  43. sed -e 's/x\-world\/x\-vrml\;//g' -i "displaycal-vrml-to-x3d-converter.desktop" \
  44. || die "removing x-world media type failed"
  45. distutils-r1_src_prepare
  46. }
  47. src_install() {
  48. distutils-r1_src_install
  49. #remove udev files
  50. rm -rf "${D}"/etc/udev/rules.d
  51. }
  52. pkg_postinst() {
  53. # Run xdg-* programs the Gentoo way since we removed this
  54. # functionality from the original package
  55. fdo-mime_mime_database_update
  56. fdo-mime_desktop_database_update
  57. }
  58. pkg_postrm() {
  59. # Run xdg-* programs the Gentoo way since we removed this
  60. # functionality from the original package
  61. fdo-mime_mime_database_update
  62. fdo-mime_desktop_database_update
  63. }