diff mbox series

[bug#52238] gnu: Add MEGA SDK

Message ID DM6PR19MB2460B452084109E9FD488E8999789@DM6PR19MB2460.namprd19.prod.outlook.com
State New
Headers show
Series [bug#52238] gnu: Add MEGA SDK | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Wamm K. D Dec. 17, 2021, 10:30 p.m. UTC
> On Monday, December 6, 2021, 01:53:09 PM CST, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote: 
>
>
>
>
>
> Am Donnerstag, den 02.12.2021, 06:32 +0000 schrieb Jaft:
> > * gnu/packages/mega.scm (mega-sdk):Add MEGA SDK
> Should be "New variable."

Which part should be "New variable"? "* gnu/packages/mega.scm (mega-sdk): New variable"? Or the whole line? "* New variable"?

> > The SDK is a dependency of MEGAsync so I thought to make a new file
> > since there's multiple packages that are MEGA related and then I
> > discovered that the megacmd package exists; is it better for this to
> > be placed in sync.scm, next to megacmd?
> Sync is good.  If existing Mega packages use the SDK, try to unbundle
> them.

Makes sense; megatools doesn't seem to rely on it but megacmd pulls from git recursively since the SDK repo.'s setup as a module for it so I've adjusted that definition to make use of the SDK, now.

> > ---
> I don't know if I told you that yet, but comments ought to go below
> this line.

Mmm, I think you did but I must've misunderstood as I thought you were saying the opposite; noted and I'll do it the other way, going forward.

> > +    (package
> > +      (name "mega-sdk")
> > +      (version version)
> There's no reason to let-bind version if you're just going to assign it
> here anyway.

It hadn't been clear to me that the macro functions in that fashion; I've removed the use of let.

> > +      (arguments `(#:tests? #f))
> Never leave #:tests? #f uncommented.

Makes sense; that's been revised.

> > +      (home-page "https://mega.nz/sdk")
> > +      (synopsis "SDK for the MEGA service, offered by MEGA Limited")
> Sponsored by RAID: Shadow Legends.

I don't understand what this is communicating.

> Given the megacli command, what's the relation to existing MEGA
> packages, particularly megacmd?
>
> Cheers

Noted above (and addressed in the new patch).

It seems like I'll likely have to make further changes but I've attached what I have for the patch, thus far, just to keep track of what changes have been made.

Comments

Liliana Marie Prikler Dec. 17, 2021, 11:22 p.m. UTC | #1
Hi,

Am Freitag, dem 17.12.2021 um 22:30 +0000 schrieb Jaft:
> 
> >  > +      (home-page "https://mega.nz/sdk")
> >  > +      (synopsis "SDK for the MEGA service, offered by MEGA
> > Limited")
> >  Sponsored by RAID: Shadow Legends.
> 
> I don't understand what this is communicating.
The joke is that you make it sound like and advertisement.

> +    (native-inputs `(("autoconf" ,autoconf)
> +                     ("automake" ,automake)
> +                     ("libtool" ,libtool)))
> +    (inputs `(("c-ares" ,c-ares)
> +              ("crypto++" ,crypto++)
> +              ("curl" ,curl)
> +              ("freeimage" ,freeimage)
> +              ("libsodium" ,libsodium)
> +              ("openssl" ,openssl)
> +              ("readline" ,readline)
> +              ("sqlite" ,sqlite)
> +              ("zlib" ,zlib)))
Since core-update's been merged now, try to use new-style inputs.

> +    ;; XXX: Disabling tests because they depend on libgtest.la from
> googletest,
> +    ;; which is not installed for unclear reasons.
> +    (arguments `(#:tests? #f))
Unclear reasons including googletest not being present in the inputs? 
You probably want to swap out the .la dependency for a .so dependency.

>  (define-public megacmd
>    (package
>      (name "megacmd")
> @@ -222,8 +262,7 @@ (define-public megacmd
>          (method git-fetch)
>          (uri (git-reference
>                (url "https://github.com/meganz/MEGAcmd")
> -              (commit (string-append version "_Linux"))
> -              (recursive? #t)))
> +              (commit (string-append version "_Linux"))))
>          (sha256
>           (base32
>            "004j8m3xs6slx03g2g6wzr97myl2v3zc09wxnfar5c62a625pd53"))
> @@ -242,6 +281,7 @@ (define-public megacmd
>         ("curl" ,curl)
>         ("freeimage" ,freeimage)
>         ("gtest" ,googletest)
> +       ("mega-sdk" ,mega-sdk)
>         ("openssl" ,openssl)
>         ("pcre" ,pcre)
>         ("readline" ,readline)
Pardon me if I was unclear, but this would be done in a separate
commit.  But thanks anyway for confirming that it'd be easily
swappable.

Cheers
>
Wamm K. D Dec. 18, 2021, 5:14 a.m. UTC | #2
> > +    ;; XXX: Disabling tests because they depend on libgtest.la from
> > googletest,
> > +    ;; which is not installed for unclear reasons.
> > +    (arguments `(#:tests? #f))
> Unclear reasons including googletest not being present in the inputs? 
> You probably want to swap out the .la dependency for a .so dependency.

Hmm; I thought it was for the same reasons that tests had been disabled for megacmd but, taking another look at it, it seems I'm misremembering from the last time I worked on this.

It says it's failing because the MEGA_EMAIL and MEGA_PWD environment variables aren't set; from what I can tell, it uses those to test whether it can interact with a MEGA account appropriately. As that'd require requests to the internet, I'd expect the tests to fail in the end, still; is that a reasonable reason to disable them or should I try some other course of action?

> >  (define-public megacmd
> >    (package
> >      (name "megacmd")
> > @@ -222,8 +262,7 @@ (define-public megacmd
> >          (method git-fetch)
> >          (uri (git-reference
> >                (url "https://github.com/meganz/MEGAcmd")
> > -              (commit (string-append version "_Linux"))
> > -              (recursive? #t)))
> > +              (commit (string-append version "_Linux"))))
> >          (sha256
> >          (base32
> >            "004j8m3xs6slx03g2g6wzr97myl2v3zc09wxnfar5c62a625pd53"))
> > @@ -242,6 +281,7 @@ (define-public megacmd
> >        ("curl" ,curl)
> >        ("freeimage" ,freeimage)
> >        ("gtest" ,googletest)
> > +      ("mega-sdk" ,mega-sdk)
> >        ("openssl" ,openssl)
> >        ("pcre" ,pcre)
> >        ("readline" ,readline)
> Pardon me if I was unclear, but this would be done in a separate
> commit.  But thanks anyway for confirming that it'd be easily
> swappable.

Gotcha; because I'm unsure, how should I do that? Should I just attach two separate patches? Or should I open a separate ticket for the megacmd update (with its own separate patch, of course)?
Liliana Marie Prikler Dec. 18, 2021, 7:47 a.m. UTC | #3
Hi Jaft,

Am Samstag, dem 18.12.2021 um 05:14 +0000 schrieb Jaft:
> >  > +    ;; XXX: Disabling tests because they depend on libgtest.la
> > from
> >  > googletest,
> >  > +    ;; which is not installed for unclear reasons.
> >  > +    (arguments `(#:tests? #f))
> >  Unclear reasons including googletest not being present in the
> > inputs? 
> >  You probably want to swap out the .la dependency for a .so
> > dependency.
> 
> Hmm; I thought it was for the same reasons that tests had been
> disabled for megacmd but, taking another look at it, it seems I'm
> misremembering from the last time I worked on this.
> 
> It says it's failing because the MEGA_EMAIL and MEGA_PWD environment
> variables aren't set; from what I can tell, it uses those to test
> whether it can interact with a MEGA account appropriately. As that'd
> require requests to the internet, I'd expect the tests to fail in the
> end, still; is that a reasonable reason to disable them or should I
> try some other course of action?
If the entire suite requires internet access, then yeah, that's a good
case for #:tests? #f.  If it's just certain test cases/groups, then
we'd rather go for disabling those.

> >  >  (define-public megacmd
> >  >    (package
> >  >      (name "megacmd")
> >  > @@ -222,8 +262,7 @@ (define-public megacmd
> >  >          (method git-fetch)
> >  >          (uri (git-reference
> >  >                (url "https://github.com/meganz/MEGAcmd")
> >  > -              (commit (string-append version "_Linux"))
> >  > -              (recursive? #t)))
> >  > +              (commit (string-append version "_Linux"))))
> >  >          (sha256
> >  >          (base32
> >  >           
> > "004j8m3xs6slx03g2g6wzr97myl2v3zc09wxnfar5c62a625pd53"))
> >  > @@ -242,6 +281,7 @@ (define-public megacmd
> >  >        ("curl" ,curl)
> >  >        ("freeimage" ,freeimage)
> >  >        ("gtest" ,googletest)
> >  > +      ("mega-sdk" ,mega-sdk)
> >  >        ("openssl" ,openssl)
> >  >        ("pcre" ,pcre)
> >  >        ("readline" ,readline)
> >  Pardon me if I was unclear, but this would be done in a separate
> >  commit.  But thanks anyway for confirming that it'd be easily
> >  swappable.
> 
> Gotcha; because I'm unsure, how should I do that? Should I just
> attach two separate patches? Or should I open a separate ticket for
> the megacmd update (with its own separate patch, of course)?
You can send two patches as attachments, that's completely fine with
me.  The typical Guix approach would however be to set up git send-
email and invoke it like 

  $ git send-email --to=BUGNUMBER@debugs.gnu.org [--cc=REVIEWER ...] \ 
                  [--in-reply-to=MSGID] [--reroll-count N] PATCH ...

That's probably a lot to take in at once, but once you get the hang out
of it, it's actually quite easy.  You can also use `git format-patch`
to prepare the emails with the arguments above and then send them by a
separate command.  In any case, they go to a singular BUGNUMBER, in
this case 52238.

Cheers
diff mbox series

Patch

* gnu/packages/sync.scm (mega-sdk): Add MEGA SDK
---
gnu/packages/sync.scm | 44 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/sync.scm b/gnu/packages/sync.scm
index ce815ed5c7..064e68c431 100644
--- a/gnu/packages/sync.scm
+++ b/gnu/packages/sync.scm
@@ -213,6 +213,46 @@  (define-public nextcloud-client
                    license:lgpl2.1+  ; qtokenizer
                    license:gpl2+))))
 
+(define-public mega-sdk
+  (package
+    (name "mega-sdk")
+    (version "3.9.10")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/meganz/sdk/")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256 (base32
+                       "08qw23rm4rrvlsbcixrncbi5x0qgqkpx74l5f1gq2rgll0ksx8ph"))
+              (modules '((guix build utils)))))
+    (build-system gnu-build-system)
+    (native-inputs `(("autoconf" ,autoconf)
+                     ("automake" ,automake)
+                     ("libtool" ,libtool)))
+    (inputs `(("c-ares" ,c-ares)
+              ("crypto++" ,crypto++)
+              ("curl" ,curl)
+              ("freeimage" ,freeimage)
+              ("libsodium" ,libsodium)
+              ("openssl" ,openssl)
+              ("readline" ,readline)
+              ("sqlite" ,sqlite)
+              ("zlib" ,zlib)))
+    ;; XXX: Disabling tests because they depend on libgtest.la from googletest,
+    ;; which is not installed for unclear reasons.
+    (arguments `(#:tests? #f))
+    (home-page "https://mega.nz/sdk")
+    (synopsis "SDK for the MEGA service, offered by MEGA Limited")
+    (description "A low-level SDK for the MEGA service which powers the
+file-sharing site.  This package provides two executables:
+@itemize
+@item megacli: a command-line tool that allows usage of all SDK features
+@item megasimplesync: a command line tool that allows usage of the
+synchronization engine
+@end itemize")
+    (license license:bsd-2)))
+
 (define-public megacmd
   (package
     (name "megacmd")
@@ -222,8 +262,7 @@  (define-public megacmd
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/meganz/MEGAcmd")
-              (commit (string-append version "_Linux"))
-              (recursive? #t)))
+              (commit (string-append version "_Linux"))))
         (sha256
          (base32
           "004j8m3xs6slx03g2g6wzr97myl2v3zc09wxnfar5c62a625pd53"))
@@ -242,6 +281,7 @@  (define-public megacmd
        ("curl" ,curl)
        ("freeimage" ,freeimage)
        ("gtest" ,googletest)
+       ("mega-sdk" ,mega-sdk)
        ("openssl" ,openssl)
        ("pcre" ,pcre)
        ("readline" ,readline)