Re: Making a portfile from a cmake based project

2016-02-29 Thread Mojca Miklavec
On 28 February 2016 at 10:05, Manu N wrote:
>
> Portfile submitted as https://trac.macports.org/ticket/50732

Committed, thanks.

Mojca
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: Making a portfile from a cmake based project

2016-02-28 Thread Manu N
Thanks all that provided guidance.
I eventually disabled the tests build as they require downloading several
megs of audio files to be run, and check compliance to the r128 standard
rather than correct build of the library.
Portfile submitted as https://trac.macports.org/ticket/50732
audionuma

2016-02-27 21:26 GMT+01:00 Ryan Schmidt :

> On Feb 27, 2016, at 11:13, Mojca Miklavec  wrote:
>
> >> 425cc98f9140885966ce17c1d1
> >> depends_libport:speex-devel
> >
> > I was unable to use that because I already had "speex" installed. I
> > removed -devel and it seemed to work.
>
> If both work, a path: dependency should be used to allow either.
>
>
> >> OK.
> >> Added a github.tarball_from releases command as there is a release on
> >> github.
> >
> > I'm not sure when this is needed.
>
> If the project's developers provide a release download, it should be used.
> This project's developers don't, so it cannot be used here.
>
>
> >> variant with_tests description {Build tests suite} {
> >>  configure.args-append -DENABLE_TESTS=ON
> >> }
>
> Variant names should not begin with words like "with" or "without" or "no".
>
> Does building the test suite really need to be a variant? How long does it
> take?
>
>
> > As far as the tests are concerned: MacPorts offers some functionality
> > to run the tests (like "sudo port test libebur128"), but I would have
> > to check how to properly implement that.
>
>
> test.run yes
>
> And change test.target if necessary.
>
>
>
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: Making a portfile from a cmake based project

2016-02-27 Thread Ryan Schmidt
On Feb 27, 2016, at 11:13, Mojca Miklavec  wrote:

>> 425cc98f9140885966ce17c1d1
>> depends_libport:speex-devel
> 
> I was unable to use that because I already had "speex" installed. I
> removed -devel and it seemed to work.

If both work, a path: dependency should be used to allow either. 


>> OK.
>> Added a github.tarball_from releases command as there is a release on
>> github.
> 
> I'm not sure when this is needed.

If the project's developers provide a release download, it should be used. This 
project's developers don't, so it cannot be used here. 


>> variant with_tests description {Build tests suite} {
>>  configure.args-append -DENABLE_TESTS=ON
>> }

Variant names should not begin with words like "with" or "without" or "no". 

Does building the test suite really need to be a variant? How long does it take?


> As far as the tests are concerned: MacPorts offers some functionality
> to run the tests (like "sudo port test libebur128"), but I would have
> to check how to properly implement that.


test.run yes

And change test.target if necessary. 


___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: Making a portfile from a cmake based project

2016-02-27 Thread Mojca Miklavec
On 27 February 2016 at 17:52, Manu N wrote:
> Hello again,
> here's my current Portfile, located in a local portfile repository
> ~/ports/audio/libebur128
>
> # $Id$
> PortSystem  1.0
> PortGroup   github 1.0
> github.setupjiixyj libebur128 1.1.0 v
> github.tarball_from releases

I'm not sure if this is needed. I left it out in the experiment (and
as a consequence had to change the shasums).

> PortGroup   cmake 1.0
> cmake.out_of_source yes
> namelibebur128
> version 1.1.0

No need to repeat name and version. They are set by github.setup already.

> categories  audio
> platforms   darwin
> maintainers audionuma \
> gmail.com:audionuma

The maintainer audionuma would be a synonym for
audion...@macports.org. Since you probably don't have an account /
commit rights yet, you only need the second address and potentially
openmaintainer as well.

> description loudness measure according to EBU R128
> long_descriptionloudness measure according to EBU R128

In this case you can use
long_description ${description}

> homepagehttps://github.com/jiixyj/libebur128
> master_siteshttps://github.com/jiixyj/libebur128

No need. Both are set by github.setup already.

> checksums   rmd160  2eb66acfd34557f66961e34b21fefa126fabb889 \
> sha256
> c60e78f4bfda387a0895c64a4fc9850445e3a4425cc98f9140885966ce17c1d1
> depends_libport:speex-devel

I was unable to use that because I already had "speex" installed. I
removed -devel and it seemed to work.

> OK.
> Added a github.tarball_from releases command as there is a release on
> github.

I'm not sure when this is needed.

> Nevertheless, I had to manually add the  libebur128-1.1.0.tar.gz file into
> the /opt/local/var/macports/distfiles/libebur128 directory to have the
> installation work, otherwise `port` was searching for the archive in it's
> usual online repositories. Is that the expected behavior ?

The port certainly has to be fetched from somewhere.

I removed github.tarball_from and this is what I get:

> sudo port -v destroot libebur128
--->  Computing dependencies for libebur128.
--->  Fetching distfiles for libebur128
--->  libebur128-1.1.0.tar.gz doesn't seem to exist in
/opt/local/var/macports/distfiles/libebur128
--->  Attempting to fetch libebur128-1.1.0.tar.gz from
http://distfiles.macports.org/libebur128
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:--  0:00:01 --:--:-- 0
--->  Attempting to fetch libebur128-1.1.0.tar.gz from
http://lil.fr.distfiles.macports.org/libebur128
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0
--->  Attempting to fetch libebur128-1.1.0.tar.gz from
http://fco.it.distfiles.macports.org/mirrors/macports-distfiles/libebur128
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0
--->  Attempting to fetch libebur128-1.1.0.tar.gz from
http://mse.uk.distfiles.macports.org/sites/distfiles.macports.org/libebur128
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0   2760 00 0  0  0 --:--:-- --:--:-- --:--:-- 0
--->  Attempting to fetch libebur128-1.1.0.tar.gz from
http://nue.de.distfiles.macports.org/macports/distfiles/libebur128
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0
--->  Attempting to fetch libebur128-1.1.0.tar.gz from
http://osl.no.distfiles.macports.org/libebur128
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0
--->  Attempting to fetch libebur128-1.1.0.tar.gz from
https://github.com/jiixyj/libebur128/tarball/v1.1.0
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
100 193330 193330 0   9094  0 --:--:--  0:00:02 --:--:-- 71339


>> This is basically all you need. If you want to switch some features
>> on/off, you could do something like
>>
>> configure.args-append -DENABLE_TESTS=ON
>>
>
> Now, if I 

Re: Making a portfile from a cmake based project

2016-02-27 Thread Manu N
Hello again,
here's my current Portfile, located in a local portfile repository
~/ports/audio/libebur128

# $Id$
PortSystem  1.0
PortGroup   github 1.0
github.setupjiixyj libebur128 1.1.0 v
github.tarball_from releases
PortGroup   cmake 1.0
# optional, but we would be grateful if you tested and included this
cmake.out_of_source yes
namelibebur128
version 1.1.0
categories  audio
platforms   darwin
maintainers audionuma \
gmail.com:audionuma
description loudness measure according to EBU R128
long_descriptionloudness measure according to EBU R128
homepagehttps://github.com/jiixyj/libebur128
master_siteshttps://github.com/jiixyj/libebur128
checksums   rmd160  2eb66acfd34557f66961e34b21fefa126fabb889 \
sha256
c60e78f4bfda387a0895c64a4fc9850445e3a4425cc98f9140885966ce17c1d1
depends_libport:speex-devel



2016-02-27 13:59 GMT+01:00 Mojca Miklavec :

> On 27 February 2016 at 13:47, Manu N  wrote:
> > Hello,
> > I would like to make a portfile from a cmake based project (
> > https://github.com/jiixyj/libebur128 ).
> > Currently, I can build the library using MacPorts cmake and MacPorts
> > libspeexdsp, which is an optional dependancy.
> > I have been reading the https://guide.macports.org/#development pages,
> but
> > couldn't find how I would port such a project.
> > My main questions are :
> > how do I get from a github project to a tarball
>
> PortGroup   github 1.0
> github.setupjiixyj libebur128 1.1.0 v
>
> The first two arguments in github.setup are project name and
> repository name, the third one is the version and the last one is the
> prefix before the version (in the tag).
>
>

OK.
Added a github.tarball_from releases command as there is a release on
github.
Nevertheless, I had to manually add the  libebur128-1.1.0.tar.gz file into
the /opt/local/var/macports/distfiles/libebur128 directory to have the
installation work, otherwise `port` was searching for the archive in it's
usual online repositories. Is that the expected behavior ?

Then use "sudo port -v extract" to get the checksums (disclaimer:
> until someone starts complaining that this is not a "safe enough"
> approach because something could already be compromised).
>
>
OK


> > how do I use the cmake scripts to actually build the library inside a
> > portfile.
>
> PortGroup   cmake 1.0
> # optional, but we would be grateful if you tested and included this
> cmake.out_of_source yes
>
>
OK


> This is basically all you need. If you want to switch some features
> on/off, you could do something like
>
> configure.args-append -DENABLE_TESTS=ON
>
>
Now, if I add the following lines to the Portfile (at the end)

variant with_tests description {Build tests suite} {
  configure.args-append -DENABLE_TESTS=ON
}

and run

port variants libebur128

the result is :

libebur128 has the variants:
   debug: Enable debug binaries
   universal: Build for multiple architectures

So it seems that my with_tests variant is not found.
I have tried a portindex command in the ~/ports directory with no success.



> > I hope this beginner questions are not too obvious and that someone can
> > point me to the adequate documentation for these questions.
>
> You can take a look at cmake-1.0.tcl and github-1.0.tcl or grep for
> cmake/github in other ports.
>
> The rest is the same as for other ports.
>
> Mojca
>
Thanks.
audionuma
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


Re: Making a portfile from a cmake based project

2016-02-27 Thread Mojca Miklavec
On 27 February 2016 at 13:47, Manu N  wrote:
> Hello,
> I would like to make a portfile from a cmake based project (
> https://github.com/jiixyj/libebur128 ).
> Currently, I can build the library using MacPorts cmake and MacPorts
> libspeexdsp, which is an optional dependancy.
> I have been reading the https://guide.macports.org/#development pages, but
> couldn't find how I would port such a project.
> My main questions are :
> how do I get from a github project to a tarball

PortGroup   github 1.0
github.setupjiixyj libebur128 1.1.0 v

The first two arguments in github.setup are project name and
repository name, the third one is the version and the last one is the
prefix before the version (in the tag).

Then use "sudo port -v extract" to get the checksums (disclaimer:
until someone starts complaining that this is not a "safe enough"
approach because something could already be compromised).

> how do I use the cmake scripts to actually build the library inside a
> portfile.

PortGroup   cmake 1.0
# optional, but we would be grateful if you tested and included this
cmake.out_of_source yes

This is basically all you need. If you want to switch some features
on/off, you could do something like

configure.args-append -DENABLE_TESTS=ON

> I hope this beginner questions are not too obvious and that someone can
> point me to the adequate documentation for these questions.

You can take a look at cmake-1.0.tcl and github-1.0.tcl or grep for
cmake/github in other ports.

The rest is the same as for other ports.

Mojca
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev