about summary refs log tree commit diff
path: root/net-misc/megatools/megatools-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--net-misc/megatools/megatools-9999.ebuild70
1 files changed, 70 insertions, 0 deletions
diff --git a/net-misc/megatools/megatools-9999.ebuild b/net-misc/megatools/megatools-9999.ebuild
new file mode 100644
index 0000000..8929e88
--- /dev/null
+++ b/net-misc/megatools/megatools-9999.ebuild
@@ -0,0 +1,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