pcb-20140316-r1.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit autotools eutils fdo-mime gnome2-utils toolchain-funcs
  5. DESCRIPTION="GPL Electronic Design Automation: Printed Circuit Board editor"
  6. HOMEPAGE="http://www.gpleda.org/"
  7. SRC_URI="mirror://sourceforge/pcb/pcb/${P}/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ppc x86 ~x86-macos"
  11. IUSE="dbus debug doc gcode gif gtk jpeg m4lib-png motif nelma opengl png
  12. test tk toporouter xrender"
  13. # toporouter-output USE flag removed, there seems to be no result
  14. CDEPEND="dev-libs/glib:2
  15. gif? ( >=media-libs/gd-2.0.23 )
  16. gtk? ( x11-libs/gtk+:2 x11-libs/pango
  17. x11-libs/gtkglext
  18. dbus? ( sys-apps/dbus ) )
  19. jpeg? ( >=media-libs/gd-2.0.23[jpeg] )
  20. motif? ( !gtk? (
  21. >=x11-libs/motif-2.3:0
  22. dbus? ( sys-apps/dbus )
  23. xrender? ( >=x11-libs/libXrender-0.9 ) ) )
  24. nelma? ( >=media-libs/gd-2.0.23 )
  25. opengl? ( virtual/opengl )
  26. gcode? ( >=media-libs/gd-2.0.23 )
  27. virtual/libintl
  28. png? ( >=media-libs/gd-2.0.23[png] )
  29. m4lib-png? ( >=media-libs/gd-2.0.23[png] )
  30. tk? ( >=dev-lang/tk-8:0 )"
  31. #toporouter-output? ( x11-libs/cairo )
  32. DEPEND="${CDEPEND}
  33. test? (
  34. sci-electronics/gerbv
  35. virtual/imagemagick-tools
  36. )
  37. >=dev-util/intltool-0.35
  38. virtual/pkgconfig
  39. sys-devel/gettext"
  40. RDEPEND="${CDEPEND}
  41. sci-electronics/electronics-menu"
  42. DOCS="AUTHORS README NEWS ChangeLog"
  43. pkg_setup() {
  44. if use gtk && use motif; then
  45. elog "Can only build for GTK+ or Motif/Lesstif GUI. GTK+ has priority."
  46. fi
  47. if !(use gtk || use motif); then
  48. elog "Building without GUI, make sure you know what you are doing."
  49. fi
  50. if use dbus && !(use gtk || use motif); then
  51. elog "dbus needs GTK or Motif/Lesstif GUI. Try USE=-dbus or USE=gtk or USE=motif."
  52. fi
  53. if use opengl && !(use gtk); then
  54. elog "GL drawing needs GTK"
  55. fi
  56. if (use gtk || (! use gtk && ! use motif)) && (use xrender); then
  57. elog "The XRender extension is only usable with the Motif/Lesstif GUI."
  58. fi
  59. }
  60. src_prepare() {
  61. if use test; then
  62. # adapt the list of tests to run according to USE flag settings
  63. if ! use png; then
  64. sed -i '/^hid_png/d' tests/tests.list || die
  65. fi
  66. if ! use gcode; then
  67. sed -i '/^hid_gcode/d' tests/tests.list || die
  68. fi
  69. fi
  70. # Backport from upstream
  71. # http://git.geda-project.org/pcb/commit/?id=a34b40add60310a51780f359cc90d9c5ee75752c
  72. # (do not install static GTS library)
  73. sed -i -e 's/lib_LIBRARIES/noinst_LIBRARIES/' -e 's/include_HEADERS/noinst_HEADERS/' gts/Makefile.am || die
  74. # fix bad syntax in Makefile.am and configure.ac before running eautoreconf
  75. sed -i -e 's/:=/=/' Makefile.am || die
  76. epatch "${FILESDIR}"/${PN}-20110918-fix-config.diff
  77. eautoreconf
  78. }
  79. src_configure() {
  80. local myconf
  81. if use gtk ; then
  82. myconf="--with-gui=gtk $(use_enable dbus) $(use_enable opengl gl) --disable-xrender"
  83. elif use motif ; then
  84. myconf="--with-gui=lesstif $(use_enable dbus) $(use_enable xrender)"
  85. else
  86. myconf="--with-gui=batch --disable-xrender --disable-dbus"
  87. fi
  88. local exporters="bom gerber ps"
  89. if (use png || use jpeg || use gif) ; then
  90. exporters="${exporters} png"
  91. fi
  92. use nelma && exporters="${exporters} nelma"
  93. use gcode && exporters="${exporters} gcode"
  94. use tk || export WISH="${EPREFIX}/bin/true"
  95. econf \
  96. ${myconf} \
  97. $(use_enable doc) \
  98. $(use_enable gif) \
  99. $(use_enable jpeg) \
  100. $(use_enable png) \
  101. $(use_enable m4lib-png) \
  102. $(use_enable toporouter) \
  103. $(use_enable debug) \
  104. --enable-nls \
  105. --disable-toporouter-output \
  106. --with-exporters="${exporters}" \
  107. --disable-dependency-tracking \
  108. --disable-rpath \
  109. --disable-update-mime-database \
  110. --disable-update-desktop-database \
  111. --docdir="${EPREFIX}/usr/share/doc/${PF}"
  112. }
  113. # toporouter-output USE flag removed, there seems to be no result
  114. # $(use_enable toporouter-output) \
  115. src_compile() {
  116. emake AR="$(tc-getAR)"
  117. }
  118. pkg_preinst() {
  119. gnome2_icon_savelist
  120. }
  121. pkg_postinst() {
  122. fdo-mime_desktop_database_update
  123. fdo-mime_mime_database_update
  124. gnome2_icon_cache_update
  125. }
  126. pkg_postrm() {
  127. fdo-mime_desktop_database_update
  128. fdo-mime_mime_database_update
  129. gnome2_icon_cache_update
  130. }