parlay

yet another gentoo overlay
git clone https://git.parazyd.org/parlay
Log | Files | Refs | README

meganz-sdk-9999.ebuild (2429B)


      1 # Copyright 1999-2022 Gentoo Authors
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=8
      5 
      6 inherit flag-o-matic qmake-utils autotools db-use
      7 if [[ -z ${PV%%*9999} ]]; then
      8 	inherit git-r3
      9 	EGIT_REPO_URI="https://github.com/${PN%-*}/${PN#*-}.git"
     10 else
     11 	SRC_URI="https://github.com/meganz/sdk/archive/v${PV}d.tar.gz -> ${P}.tar.gz"
     12 	S="${WORKDIR}/sdk-${PV}d"
     13 	RESTRICT="primaryuri"
     14 	KEYWORDS="~amd64 ~x86"
     15 fi
     16 DESCRIPTION="MEGA C++ SDK"
     17 HOMEPAGE="https://github.com/meganz/sdk"
     18 
     19 LICENSE="BSD-2"
     20 SLOT="0/30701"
     21 IUSE="examples ffmpeg freeimage fuse hardened inotify libuv mediainfo qt raw +sqlite test"
     22 REQUIRED_USE="
     23 	examples? ( sqlite )
     24 	fuse? ( examples )
     25 "
     26 # tests require a working mega.nz account and login details provided via $MEGA_EMAIL and $MEGA_PWD
     27 RESTRICT+=" test"
     28 
     29 RDEPEND="
     30 	dev-libs/crypto++
     31 	sys-libs/zlib
     32 	dev-libs/libpcre:3[cxx]
     33 	dev-libs/openssl:0
     34 	net-dns/c-ares
     35 	net-misc/curl
     36 	sqlite? ( dev-db/sqlite:3 )
     37 	!sqlite? ( sys-libs/db:*[cxx] )
     38 	examples? (
     39 		sys-libs/readline:0
     40 		fuse? ( sys-fs/fuse:0 )
     41 	)
     42 	freeimage? ( media-libs/freeimage )
     43 	libuv? ( dev-libs/libuv )
     44 	dev-libs/libsodium
     45 	mediainfo? ( media-libs/libmediainfo )
     46 	ffmpeg? ( media-video/ffmpeg )
     47 	raw? ( media-libs/libraw )
     48 "
     49 DEPEND="
     50 	${RDEPEND}
     51 	test? ( dev-cpp/gtest )
     52 "
     53 
     54 pkg_setup() {
     55 	use sqlite || append-cppflags "-I$(db_includedir)"
     56 }
     57 
     58 src_prepare() {
     59 	default
     60 	use qt && sed \
     61 		-e '/SOURCES += src\// s:+:-:' \
     62 		-e '/!exists.*config.h/ s:!::' \
     63 		-e 's:CONFIG(USE_MEGAAPI) {:&\nLIBS += -lmega:' \
     64 		-e '/^unix:!macx {/,/^}/d' \
     65 		-i bindings/qt/sdk.pri
     66 	use test && sed \
     67 		-e 's:\$(GTEST_DIR)/lib/lib\([^ ]\+\)\.la:-l\1:g' \
     68 		-e 's: tests/tool_purge_account::' \
     69 		-i tests/include.am
     70 	eautoreconf
     71 }
     72 
     73 src_configure() {
     74 	local myeconfargs=(
     75 		--enable-chat
     76 		$(use_enable inotify)
     77 		$(use_enable hardened gcc-hardening)
     78 		$(use_with libuv)
     79 		$(use_with !sqlite db)
     80 		$(use_with sqlite)
     81 		$(use_enable examples)
     82 		$(use_enable test tests)
     83 		$(use_with freeimage)
     84 		$(use_with fuse)
     85 		$(use_with mediainfo libmediainfo)
     86 		$(use_with ffmpeg)
     87 		$(use_with raw libraw)
     88 	)
     89 	use test && myeconfargs+=(
     90 		--with-gtest="${EPREFIX}/usr"
     91 	)
     92 	econf "${myeconfargs[@]}"
     93 }
     94 
     95 src_test() {
     96 	export MEGA_EMAIL MEGA_PWD MEGA_EMAIL_AUX="${MEGA_EMAIL}" MEGA_PWD_AUX="${MEGA_PWD}"
     97 	default
     98 }
     99 
    100 src_install() {
    101 	default
    102 	doheader -r include/mega
    103 
    104 	use qt || return
    105 	insinto /usr/share/${PN}/bindings/qt
    106 	doins bindings/qt/*.{h,cpp,pri}
    107 }