about summary refs log tree commit diff
path: root/net-misc/megatools/megatools-9999.ebuild
blob: 8929e8859d0fc0a2a03a540c40138514ddbe8bcc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

if [[ ${PV} == *9999 ]]; then
	SCM="git-r3"
	EGIT_REPO_URI="https://megous.com/git/megatools"
fi

if [[ ${PV} != *9999 ]]; then
	BUILDSYS="autotools"
else
	BUILDSYS="meson"
fi

inherit ${BUILDSYS} ${SCM}

DESCRIPTION="Open-source command line tools for accessing Mega.co.nz cloud storage"
HOMEPAGE="https://megatools.megous.com"

if [[ ${PV} == *9999 ]]; then
	SRC_URI=""
	KEYWORDS=""
else
	SRC_URI="https://megatools.megous.com/builds/megatools-${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~x86"
fi

LICENSE="GPL-2"
SLOT="0"
IUSE="libressl symlinks"

DEPEND="
	!libressl? ( dev-libs/openssl:0= )
	libressl? ( dev-libs/libressl:0= )
	dev-libs/glib:2
	net-misc/curl
"
RDEPEND="${DEPEND}
	net-libs/glib-networking[ssl]
"
BDEPEND="
	app-text/asciidoc
	virtual/pkgconfig
"

src_prepare() {
	default

	if [[ ${PV} != *9999 ]]; then
		sed -e "/^AC_PROG_CC/ a AM_PROG_AR" -i configure.ac || die
		eautoreconf
	else
		sed -e '/^install_data/{N;N;d;}' -i meson.build || die
	fi
}

src_configure() {
	default

	if [[ ${PV} != *9999 ]]; then
		econf \
			--disable-maintainer-mode \
			--disable-warnings
	else
		local emesonargs=$(meson_use symlinks)
		meson_src_configure
	fi
}

Consider giving Nix/NixOS a try! <3