eagle-7.4.0.ebuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils
  5. DESCRIPTION="CadSoft EAGLE schematic and printed circuit board (PCB) layout editor"
  6. HOMEPAGE="http://www.cadsoft.de"
  7. SRC_URI="
  8. x86? ( ftp://ftp.cadsoft.de/${PN}/program/${PV%\.[0-9]}/${PN}-lin32-${PV}.run )
  9. amd64? ( ftp://ftp.cadsoft.de/${PN}/program/${PV%\.[0-9]}/${PN}-lin64-${PV}.run )"
  10. LICENSE="cadsoft-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86 -*"
  13. IUSE="doc linguas_de linguas_zh"
  14. QA_PREBUILT="opt/eagle/bin/eagle"
  15. RESTRICT="mirror bindist"
  16. RDEPEND="
  17. sys-libs/glibc
  18. dev-libs/openssl:0
  19. >=sys-libs/zlib-1.2.8-r1
  20. >=media-libs/freetype-2.5.0.1
  21. >=media-libs/fontconfig-2.10.92
  22. x11-libs/libXext
  23. x11-libs/libX11
  24. >=x11-libs/libXrender-0.9.8
  25. >=x11-libs/libXrandr-1.4.2
  26. >=x11-libs/libXcursor-1.1.14
  27. >=x11-libs/libXi-1.7.2
  28. net-print/cups
  29. x11-libs/libxcb
  30. "
  31. # Append ${PV} since that's what upstream installs to
  32. case "${LINGUAS}" in
  33. *de*)
  34. MY_LANG="de";;
  35. *)
  36. MY_LANG="en";;
  37. esac
  38. src_unpack() {
  39. # Extract the built-in .tar.bz2 file starting at __DATA__
  40. sed -e '1,/^__DATA__$/d' "${DISTDIR}/${A}" | tar xj || die "unpacking failed"
  41. }
  42. src_install() {
  43. local installdir="/opt/eagle"
  44. # Set MY_LANG for this function only since UPDATE_zh and README_zh
  45. # don't exist
  46. [[ ${LINGUAS} == *zh* ]] && MY_INST_LANG="zh" || MY_INST_LANG="${MY_LANG}"
  47. # Install the documentation
  48. cd doc/
  49. local pattern="^((README|UPDATE)_${MY_LANG}|library_${MY_LANG}\.txt)$"
  50. for docs in README_* UPDATE_* library_*.txt; do
  51. if [[ $docs =~ $pattern ]]; then
  52. dodoc $docs
  53. fi
  54. rm -f $docs
  55. done
  56. doman eagle.1
  57. rm eagle.1
  58. # Install extra documentation if requested
  59. pattern="^((tutorial|manual|generate-3d-idf-data)_|(connect-device-split-symbol|make-symbol-device-package-bsdl-2011)-)${MY_LANG}.pdf$"
  60. if use doc; then
  61. cd ulp/
  62. for docs in generate-3d-idf-data_*.pdf connect-device-split-symbol-*.pdf make-symbol-device-package-bsdl-2011-*.pdf; do
  63. if [[ ! $docs =~ $pattern ]]; then
  64. rm $docs
  65. fi
  66. done
  67. cd ../
  68. for docs in manual_* tutorial_*; do
  69. if [[ ! $docs =~ $pattern ]]; then
  70. rm $docs
  71. fi
  72. done
  73. else
  74. rm {elektro-tutorial,manual_*,tutorial_*,layer-setup_designrules}.pdf
  75. rm -rf ulp/
  76. fi
  77. rm -f license*.txt eagle.dtd
  78. cd "${S}"
  79. insinto $installdir
  80. doins -r .
  81. fperms 0755 ${installdir}/bin/eagle
  82. # Install wrapper (suppressing leading tabs)
  83. # see bug #188368 or http://www.cadsoftusa.com/training/faq/#3
  84. exeinto /opt/bin
  85. newexe "${FILESDIR}/eagle_wrapper_script" eagle
  86. # Finally, append the path of the eagle binary respecting $installdir and any
  87. # arguments passed to the script (thanks Denilson)
  88. echo "${installdir}/bin/eagle" '"$@"' >> "${D}/opt/bin/eagle"
  89. echo -e "ROOTPATH=${installdir}/bin\nPRELINK_PATH_MASK=${installdir}" > "${S}/90eagle-${PV}"
  90. doenvd "${S}/90eagle-${PV}"
  91. # Create desktop entry
  92. newicon bin/${PN}icon50.png ${PF}-icon50.png
  93. make_desktop_entry "${ROOT}/opt/bin/eagle" "CadSoft EAGLE Layout Editor" ${PF}-icon50 "Graphics;Electronics"
  94. }
  95. pkg_postinst() {
  96. elog "Run \`env-update && source /etc/profile\` from within \${ROOT}"
  97. elog "now to set up the correct paths."
  98. elog "You must first run eagle as root to invoke product registration."
  99. echo
  100. ewarn "Due to some necessary changes in the data structure, once you edit"
  101. ewarn "a file with version 7.x you will no longer be able to edit it"
  102. ewarn "with versions prior to 7.0!"
  103. ewarn
  104. ewarn "Please read /usr/share/doc/${PF}/UPDATE_${MY_LANG} if you are upgrading from a version prior 7.x!"
  105. }