primecoin-qt-0.1.2-r1.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. DB_VER="4.8"
  5. LANGS="af_ZA ar bg bs ca_ES ca cs cy da de el_GR en eo es_CL es et eu_ES fa_IR fa fi fr_CA fr gu_IN he hi_IN hr hu it ja la lt lv_LV nb nl pl pt_BR pt_PT ro_RO ru sk sr sv th_TH tr uk zh_CN zh_TW"
  6. inherit db-use eutils fdo-mime gnome2-utils kde4-functions qt4-r2
  7. MyPV="${PV/_/-}"
  8. MyPN="primecoin"
  9. MyP="${MyPN}-${MyPV}"
  10. DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency"
  11. HOMEPAGE="http://primecoin.org/"
  12. SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
  13. LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
  14. SLOT="0"
  15. KEYWORDS="~amd64 ~x86"
  16. IUSE="dbus ipv6 kde +qrcode upnp"
  17. RDEPEND="
  18. dev-libs/boost[threads(+)]
  19. dev-libs/openssl:0[-bindist]
  20. qrcode? (
  21. media-gfx/qrencode
  22. )
  23. upnp? (
  24. net-libs/miniupnpc
  25. )
  26. sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
  27. <=dev-libs/leveldb-1.12.0[-snappy]
  28. dev-qt/qtgui:4
  29. dbus? (
  30. dev-qt/qtdbus:4
  31. )
  32. "
  33. DEPEND="${RDEPEND}
  34. >=app-shells/bash-4.1
  35. "
  36. DOCS="doc/README.md doc/release-notes.md"
  37. S="${WORKDIR}/${MyP}-linux/src"
  38. src_prepare() {
  39. epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
  40. rm -r src/leveldb
  41. cd src || die
  42. local filt= yeslang= nolang=
  43. for lan in $LANGS; do
  44. if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
  45. ewarn "Language '$lan' no longer supported. Ebuild needs update."
  46. fi
  47. done
  48. for ts in $(ls qt/locale/*.ts)
  49. do
  50. x="${ts/*bitcoin_/}"
  51. x="${x/.ts/}"
  52. if ! use "linguas_$x"; then
  53. nolang="$nolang $x"
  54. rm "$ts"
  55. filt="$filt\\|$x"
  56. else
  57. yeslang="$yeslang $x"
  58. fi
  59. done
  60. filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
  61. sed "/${filt}/d" -i 'qt/bitcoin.qrc'
  62. einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
  63. }
  64. src_configure() {
  65. OPTS=()
  66. use dbus && OPTS+=("USE_DBUS=1")
  67. if use upnp; then
  68. OPTS+=("USE_UPNP=1")
  69. else
  70. OPTS+=("USE_UPNP=-")
  71. fi
  72. use qrcode && OPTS+=("USE_QRCODE=1")
  73. use ipv6 || OPTS+=("USE_IPV6=-")
  74. OPTS+=("USE_SYSTEM_LEVELDB=1")
  75. OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
  76. OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
  77. if has_version '>=dev-libs/boost-1.52'; then
  78. OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX")
  79. fi
  80. #The primecoin codebase is mostly taken from bitcoin-qt
  81. eqmake4 bitcoin-qt.pro "${OPTS[@]}"
  82. }
  83. #Tests are broken
  84. #src_test() {
  85. # cd src || die
  86. # emake -f makefile.unix "${OPTS[@]}" test_primecoin
  87. # ./test_primecoin || die 'Tests failed'
  88. #}
  89. src_install() {
  90. qt4-r2_src_install
  91. dobin ${PN}
  92. insinto /usr/share/pixmaps
  93. newins "share/pixmaps/primecoin.ico" "${PN}.ico"
  94. make_desktop_entry "${PN} %u" "Primecoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/primecoin;\nTerminal=false"
  95. newman contrib/debian/manpages/bitcoin-qt.1 ${PN}.1
  96. if use kde; then
  97. insinto /usr/share/kde4/services
  98. newins contrib/debian/bitcoin-qt.protocol ${PN}.protocol
  99. fi
  100. }
  101. update_caches() {
  102. gnome2_icon_cache_update
  103. fdo-mime_desktop_database_update
  104. buildsycoca
  105. }
  106. pkg_postinst() {
  107. update_caches
  108. }
  109. pkg_postrm() {
  110. update_caches
  111. }