Hello,

On 2023/05/15 11:35:24 +0200, Robert Bagdan <kikadf...@gmail.com> wrote:
> I've attached the updated version of net/megacmd, which provides non
> UI access to
> MEGA services. It intends to offer all the functionality with your
> MEGA account via commands. It features synchronization,backup of local
> folders into your MEGA account.

I've taken a first stab at the port; I'm attaching a diff against your
makefile and a tarball since this thread is starting to become
old-ish.  (sorry for the delay, i wanted to take a look earlier...)

 - sorted the variables as per Makefile.template
 - renamed the sdk distname: v4.17.1d.tar.gz is a name too generic
 - set DISTFILES only once
 - add a RUN_DEPENDS on bash
 - add a TEST_DEPENDS on gtest
 - splitted CONFIGURE_ARGS (our usual style for lists) and sorted.
 - (nit) consistely used 'FOO = xyz' instead of 'FOO= xyz'.  both are
   fine, but I'd use just one stile in the same makefile
 - ran `make update-plist' to remove a double // in an entry

the patches seemed fine for me.  I'd wish we could avoid patching for
ereadline.  The libressl ones also seemed fine to me, libcrypto uses
opaque objects now, but can't comment on whether should be upstreamed
or not.

The only odd one is patches/patch-sdk_include_mega_http_h which
defines AI_V4MAPPED...

one of the tests fails, haven't looked into it.

few questions:

 - the bundled sdk installs also the headers, a static library and a
   pkgconfig file:

     1. we usually prefer dynamic linking
     2. would it make sense (maybe in the future) to split the sdk off
        this port?  There are other projects we may want that need
        this sdk too?  Maybe there's already something in ports that
        optionally looks for this and could statically link to
        libmega?

 - i'd probably install the bash completions in
   /usr/local/share/bash-completion and avoid to @sample, but I don't
   use bash and don't really know the difference (if there is) to
   install in /etc/bash_completion.d.

> I use on amd64 7.3, works fine for me.

ports development should really be done on -CURRENT.  changes to the
infrastructure are not backported and new ports needs to meet the
current standards.  In this specific case it just happens to work just
fine in 7.3 and -CURRENT, but it's not the rule.  Just reminding it to
avoid future issues :)


--- Makefile.orig       Wed Jun 14 11:58:47 2023
+++ Makefile    Wed Jun 14 13:02:06 2023
@@ -1,26 +1,29 @@
 COMMENT =              CLI and scriptable application to access MEGA
+
 GH_ACCOUNT =           meganz
 GH_PROJECT =           MEGAcmd
 GH_TAGNAME =           1.6.3_Linux
 PKGNAME =              ${DISTNAME:S/_Linux//:L}
+_SDKV =                        4.17.1d
+
 CATEGORIES =           net
-DISTFILES =            ${DISTNAME}${EXTRACT_SUFX}
 
 MAINTAINER =           kikadf <kikadf...@gmail.com>
 
-MASTER_SITES0 =                https://github.com/meganz/sdk/archive/refs/tags/
-_SDKV =                        4.17.1d
-DISTFILES +=           v${_SDKV}${EXTRACT_SUFX}:0
-
 # MEGAcmd: GPLv3, SDK: BSD 2-clause
 PERMIT_PACKAGE =       Yes
 
-COMPILER =             base-clang ports-gcc
-
 WANTLIB += ${COMPILER_LIBCXX} c cares crypto cryptopp curl curses
 WANTLIB += ereadline m nghttp2 nghttp3 ngtcp2 ngtcp2_crypto_openssl
 WANTLIB += pcre pcrecpp sodium sqlite3 ssl uv z
 
+MASTER_SITES0 =                https://github.com/meganz/sdk/archive/refs/tags/
+
+DISTFILES +=           ${DISTNAME}${EXTRACT_SUFX} \
+                       meganz-sdk-{}v${_SDKV}${EXTRACT_SUFX}:0
+
+COMPILER =             base-clang ports-gcc
+
 LIB_DEPENDS =          databases/sqlite3 \
                        devel/cryptopp \
                        devel/libuv \
@@ -30,22 +33,35 @@
                        net/libcares \
                        security/libsodium
 
+RUN_DEPENDS =          shells/bash
+
+TEST_DEPENDS =         devel/gtest
+
 CONFIGURE_STYLE =      autoreconf
-AUTORECONF =           autogen.sh
 AUTOCONF_VERSION =     2.69
 AUTOMAKE_VERSION =     1.16
 
-CONFIGURE_ARGS =       --disable-examples --disable-java --disable-php \
-                       --disable-python --disable-chat --without-freeimage \
-                       --without-termcap --without-ffmpeg --without-libraw \
-                       --without-libzen --without-libmediainfo \
-                       --enable-gcc-hardening --enable-static
+CONFIGURE_ARGS =       --disable-chat \
+                       --disable-examples \
+                       --disable-java \
+                       --disable-php \
+                       --disable-python \
+                       --without-ffmpeg \
+                       --without-freeimage \
+                       --without-libmediainfo \
+                       --without-libraw \
+                       --without-libzen \
+                       --without-termcap \
+                       --enable-gcc-hardening \
+                       --enable-static
 
-CONFIGURE_ENV +=       CPPFLAGS="-I${LOCALBASE}/include \
-                                 -I${LOCALBASE}/include/ereadline" \
+CPPFLAGS +=            -I${LOCALBASE}/include \
+                       -I${LOCALBASE}/include/ereadline
+
+CONFIGURE_ENV +=       CPPFLAGS="${CPPFLAGS}" \
                        LDFLAGS="-L${LOCALBASE}/lib"
 
-FAKE_FLAGS=            sysconfdir=${PREFIX}/share/examples/megacmd/
+FAKE_FLAGS =           sysconfdir=${PREFIX}/share/examples/megacmd/
 
 post-extract:
        rm -rf ${WRKSRC}/sdk

Attachment: megacmd.tar.gz
Description: GNU Zip compressed data

Reply via email to