how to make a portfile for a github project?

Mojca Miklavec mojca at macports.org
Fri Mar 2 23:43:59 UTC 2018


Hi,

On 3 March 2018 at 00:16,  <macports at parvis.nl> wrote:
> from https://github.com/rodneyrehm/CFPropertyList i would like to create a
> local port.
>
> my Portfile:
> ----------------------------------------------------------------------
> # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil;
> c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
>
> # 20180302 pdv created
> # - version initially taken from
> https://github.com/rodneyrehm/CFPropertyList/releases
>
> PortSystem          1.0
> PortGroup           github 1.0
> github.setup        rodneyrehm CFPropertyList 2.0.1

You are missing "v" at the end.

> github.tarball_from releases

Remove.

> name                CFPropertyList

Remove, already default (from github.setup).

> categories          php
> platforms           darwin
> license             MIT
> maintainers         nomaintainer
>
> description         PHP implementation of Apple's PropertyList
> long_description    ${description}
>
> master_sites
> https://codeload.github.com/${github.author}/${github.project}/tar.gz/${version}

Remove, set by default

> checksums           rmd160  a579aac7b18578f1b1a3c651037a0b79fb130db9 \
>                     sha256
> e64756a876f196c7acf2c91a9f55c8219fb5b7607a406a980a1907c8b92c4ffb

First time you may remove those line and simply run
    sudo port -v extract
and the checksums will be printed out for you. Of course you need to
verify separately that you downloaded the correct file.

> use_configure       no
> build               {}
> destroot {
>     file mkdir ${destroot}${prefix}/lib/php/github
>     copy ${worksrcpath}
> ${destroot}${prefix}/lib/php/github/${github.project}
> }

I didn't test that.

> livecheck.type      regex
> livecheck.url
> https://github.com/${github.author}/${github.project}/releases
> livecheck.regex     archive/(\[^"\]+)${extract.suffix}

Remove, it should work by default.


So basically you need just

PortSystem          1.0
PortGroup           github 1.0
github.setup        rodneyrehm CFPropertyList 2.0.1 v

categories          php
platforms           darwin
license             MIT
maintainers         nomaintainer

description         PHP implementation of Apple's PropertyList
long_description    ${description}

checksums           rmd160  2b37ec78b604b66ac47d4925d2c450319cbf1d9e \
                    sha256
d01d8a26dd174479f72dce339a3d51b893f4efde5fd878858f639e6e34d80749

(plus of course the modeline + configure/build/destroot as required by
the build system, I didn't test that)

Mojca


More information about the macports-users mailing list