diff mbox series

[bug#40677,04/18] gnu: Add libnatpmp.

Message ID 20200421161032.1847-4-tona_kosmicznego_smiecia@interia.pl
State Accepted
Headers show
Series [bug#40677,01/18] gnu: jami: Move Jami and its dependencies to jami.scm. | 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/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Jan Wielkiewicz April 21, 2020, 4:10 p.m. UTC
---
 gnu/packages/networking.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

Mathieu Othacehe April 22, 2020, 9:27 a.m. UTC | #1
> +         (delete 'configure)
> +         (delete 'check))

Please add a ;no tests comment.

I guess we are dealing with a raw Makefile here. This is bad news
because it means that cross-compilation is almost always broken.

You can run:

--8<---------------cut here---------------start------------->8---
guix build --target=aarch64-linux-gnu libnatpmp
--8<---------------cut here---------------end--------------->8---

to check it. Then, you probably need to do something similar as what is
done in package "iw" (set CC variable at least).


> +       #:make-flags
> +       (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
> +    (home-page "http://miniupnp.free.fr/libnatpmp.html")
> +    (synopsis "C library implementing NAT-PMP")
> +    (description
> +     "libnatpmp is a portable and asynchronous implementaiton of
           ^
       @code{libnatpmp}                                    ^
                                                          typo
Thanks,

Mathieu
Jan Wielkiewicz April 27, 2020, 10:55 p.m. UTC | #2
On Wed, 22 Apr 2020 11:27:37 +0200
Mathieu Othacehe <m.othacehe@gmail.com> wrote:

> > +         (delete 'configure)
> > +         (delete 'check))  
> 
> Please add a ;no tests comment.
Done.

> I guess we are dealing with a raw Makefile here. This is bad news
> because it means that cross-compilation is almost always broken.
> 
> You can run:
> 
> --8<---------------cut here---------------start------------->8---
> guix build --target=aarch64-linux-gnu libnatpmp
> --8<---------------cut here---------------end--------------->8---

It was built successfully, it works then I guess.


> to check it. Then, you probably need to do something similar as what
> is done in package "iw" (set CC variable at least).
Where can I read about this CC thing more? Is it needed when
cross-compilation works? 
> 
> > +       #:make-flags
> > +       (list (string-append "PREFIX=" (assoc-ref %outputs
> > "out")))))
> > +    (home-page "http://miniupnp.free.fr/libnatpmp.html")
> > +    (synopsis "C library implementing NAT-PMP")
> > +    (description
> > +     "libnatpmp is a portable and asynchronous implementaiton of  
>            ^
>        @code{libnatpmp}                                    ^
>                                                           typo
Fixed.

> Thanks,
> 
> Mathieu


Jan Wielkiewicz
Mathieu Othacehe April 28, 2020, 7:19 a.m. UTC | #3
Hello,

>> --8<---------------cut here---------------start------------->8---
>> guix build --target=aarch64-linux-gnu libnatpmp
>> --8<---------------cut here---------------end--------------->8---
>
> It was built successfully, it works then I guess.
>
>
>> to check it. Then, you probably need to do something similar as what
>> is done in package "iw" (set CC variable at least).
> Where can I read about this CC thing more? Is it needed when
> cross-compilation works? 

The build may succeed but if the native GCC compiler was picked, then
it's a native build and not a cross-build. You can run the following
command:

--8<---------------cut here---------------start------------->8---
file the-binary-or-library
--8<---------------cut here---------------end--------------->8---

and see what it reports. You can also have a look to maradns package
for an example of how to deal with CC variable.

Don't hesitate if you have further questions,

Mathieu
Jan Wielkiewicz April 29, 2020, 10:31 p.m. UTC | #4
On Tue, 28 Apr 2020 09:19:01 +0200
Mathieu Othacehe <m.othacehe@gmail.com> wrote:

> Hello,
> 
> >> --8<---------------cut here---------------start------------->8---
> >> guix build --target=aarch64-linux-gnu libnatpmp
> >> --8<---------------cut here---------------end--------------->8---  
> >
> > It was built successfully, it works then I guess.
> >
> >  
> >> to check it. Then, you probably need to do something similar as
> >> what is done in package "iw" (set CC variable at least).  
> > Where can I read about this CC thing more? Is it needed when
> > cross-compilation works?   
> 
> The build may succeed but if the native GCC compiler was picked, then
> it's a native build and not a cross-build. You can run the following
> command:
> 
> --8<---------------cut here---------------start------------->8---
> file the-binary-or-library
> --8<---------------cut here---------------end--------------->8---
> 
> and see what it reports. You can also have a look to maradns package
> for an example of how to deal with CC variable.
> 
> Don't hesitate if you have further questions,
> 
> Mathieu

I copied the code from the "iw" package, and the output of file is
now "ARM aarch64" instead of the previous "x86-64". That's success,
right?


Jan Wielkiewicz
Mathieu Othacehe April 30, 2020, 7:04 a.m. UTC | #5
> I copied the code from the "iw" package, and the output of file is
> now "ARM aarch64" instead of the previous "x86-64". That's success,
> right?

Yes it looks good!

Mathieu
diff mbox series

Patch

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index f754683bb9..02ba5e9601 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -374,6 +374,34 @@  between different versions of ØMQ.")
 files contain direct mappings of the abstractions provided by the ØMQ C API.")
     (license license:expat)))
 
+(define-public libnatpmp
+  (package
+    (name "libnatpmp")
+    (version "20150609")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://miniupnp.free.fr/files/"
+                    name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1c1n8n7mp0amsd6vkz32n8zj3vnsckv308bb7na0dg0r8969rap1"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check))
+       #:make-flags
+       (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
+    (home-page "http://miniupnp.free.fr/libnatpmp.html")
+    (synopsis "C library implementing NAT-PMP")
+    (description
+     "libnatpmp is a portable and asynchronous implementaiton of
+the Network Address Translation - Port Mapping Protocol (NAT-PMP)
+written in the C programming language.")
+    (license license:bsd-3)))
+
 (define-public librdkafka
   (package
     (name "librdkafka")