You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.3 KiB

  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit eutils multilib qmake-utils autotools git-r3 desktop cmake-multilib
  5. DESCRIPTION="A Qt program for syncing your MEGA account in your PC. This is the official app."
  6. HOMEPAGE="http://mega.co.nz"
  7. RTAG="_Linux"
  8. if [[ ${PV} == *9999* ]];then
  9. EGIT_REPO_URI="https://github.com/meganz/MEGAsync"
  10. KEYWORDS=""
  11. EGIT_SUBMODULES=( '*' )
  12. else
  13. EGIT_REPO_URI="https://github.com/meganz/MEGAsync"
  14. EGIT_COMMIT="v${PV}.0${RTAG}"
  15. EGIT_SUBMODULES=( '*' )
  16. KEYWORDS="~amd64 ~x86"
  17. fi
  18. LICENSE="EULA"
  19. LICENSE_URL="https://raw.githubusercontent.com/meganz/MEGAsync/master/LICENCE.md"
  20. SLOT="0"
  21. IUSE="dolphin nautilus thunar +cryptopp +sqlite +zlib +curl freeimage readline examples threads java php python gnome"
  22. DEPEND="
  23. dev-lang/swig
  24. app-doc/doxygen
  25. media-libs/libmediainfo
  26. media-libs/libraw
  27. dev-qt/qtcore:5
  28. dev-qt/linguist-tools
  29. dev-qt/qtwidgets:5
  30. dev-qt/qtgui:5
  31. dev-qt/qtconcurrent:5
  32. dev-qt/qtnetwork:5
  33. dev-qt/qtdbus:5
  34. dev-qt/qtimageformats:5
  35. dev-qt/qtsvg:5
  36. dev-qt/qtx11extras:5
  37. "
  38. RDEPEND="
  39. x11-themes/hicolor-icon-theme
  40. dev-libs/openssl
  41. dev-libs/libgcrypt
  42. media-libs/libpng
  43. net-dns/c-ares
  44. cryptopp? ( dev-libs/crypto++ )
  45. app-arch/xz-utils
  46. dev-libs/libuv
  47. sqlite? ( dev-db/sqlite:3 )
  48. dev-libs/libsodium
  49. zlib? ( sys-libs/zlib )
  50. curl? ( net-misc/curl[ssl,curl_ssl_openssl] )
  51. freeimage? ( media-libs/freeimage )
  52. readline? ( sys-libs/readline:0 )
  53. dolphin? ( kde-apps/dolphin )
  54. nautilus? ( >=gnome-base/nautilus-3 )
  55. thunar? ( xfce-base/thunar )
  56. "
  57. PATCHES=( )
  58. if [[ ${PV} != *9999* ]];then
  59. src_prepare(){
  60. if [ -e "${FILESDIR}/MEGAsync-${PV}.0_Linux.patch" ]; then
  61. EPATCH_OPTS="-p0" epatch "${FILESDIR}/MEGAsync-${PV}.0_Linux.patch"
  62. fi
  63. if [ ! -z ${PATCHES} ]; then
  64. epatch ${PATCHES}
  65. fi
  66. if use gnome; then
  67. if [ -e "${FILESDIR}${P}-gnome.patch" ]; then
  68. epatch "${FILESDIR}/${P}-gnome.patch"
  69. fi
  70. fi
  71. eapply_user
  72. cd src/MEGASync/mega
  73. eautoreconf
  74. }
  75. fi
  76. src_configure(){
  77. cd "${S}"/src/MEGASync/mega
  78. econf \
  79. "--disable-silent-rules" \
  80. "--disable-curl-checks" \
  81. "--disable-megaapi" \
  82. $(use_with zlib) \
  83. $(use_with sqlite) \
  84. $(use_with cryptopp) \
  85. "--with-cares" \
  86. $(use_with curl) \
  87. "--without-termcap" \
  88. $(use_enable threads posix-threads) \
  89. "--with-sodium" \
  90. $(use_with freeimage) \
  91. $(use_with readline) \
  92. $(use_enable examples) \
  93. $(use_enable java) \
  94. $(use_enable php) \
  95. $(use_enable python) \
  96. "--enable-chat" \
  97. "--enable-gcc-hardening"
  98. cd ../..
  99. local myeqmakeargs=(
  100. MEGA.pro
  101. CONFIG+="release"
  102. )
  103. grep --color=no -rl 'videoStream->s' | xargs sed -i 's/videoStream->s/\/\/videoStream->s/g'
  104. eqmake5 ${myeqmakeargs[@]}
  105. use dolphin && cmake-utils_src_configure
  106. $(qt5_get_bindir)/lrelease MEGASync/MEGASync.pro
  107. }
  108. src_compile(){
  109. emake -C src INSTALL_ROOT="${D}" || die
  110. use dolphin && cmake-utils_src_compile
  111. }
  112. src_install(){
  113. use dolphin && cmake-utils_src_install
  114. local DOCS=( CREDITS.md README.md )
  115. einstalldocs
  116. insinto usr/share/licenses/${PN}
  117. doins LICENCE.md installer/terms.txt
  118. cd src/MEGASync
  119. dobin ${PN}
  120. cd platform/linux/data
  121. insinto usr/share/applications
  122. doins ${PN}.desktop
  123. cd icons/hicolor
  124. for size in 16x16 32x32 48x48 128x128 256x256;do
  125. doicon -s $size $size/apps/mega.png
  126. done
  127. }