New portfile writer looking for help with ConvertAll

Kevin Horton kevin01 at kilohotel.com
Tue Jul 13 01:13:45 UTC 2021


I'm trying to create a port for ConvertAll - http://convertall.bellz.org.  I've been using MacPorts for several years, but have never created a portfile before.  I used Fink for many years before switching to MacPorts, and I was a maintainer for a handful of packages.  I'm an enthusiastic amateur, not a coder.

My attempts to get a ConvertAll portfile working are running into problems when MacPorts detects that the build process is trying to install files in /opt/local/share/convertall, and it fails with a permissions error.  I'm baffled as to what is going on here.

Current draft 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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           python 1.0
PortGroup           qt5 1.0

github.setup        doug-101 ConvertAll 0.8.0 v
github.tarball_from releases

python.versions     34 35 36 37 38 39
python.default_version     38

qt5.min_version     5.4

name                convertall
version             0.8.0
license             GPL-2+
categories          math, science
platforms           darwin
maintainers         {@khorton kilohotel.com:kevin01}
description         Extremely flexible unit converter
long_description    ConvertAll has a large database of units, and allows conversions \
                    that use multiple units, e.g. convert from feet per decade to \
                    nautical miles per fortnight. 
homepage            http://convertall.bellz.org

checksums           rmd160  89fcc2aa9bad7ecc1de7bee4edea68fdff39706a \
                    sha256  624c8a792b0bc7ff3776499c2c743b32273569efd0567615e570a7e739e8d521 \
                    size    281055

depends_lib-append  port:py${python.version}-pyqt5

use_configure       no
build.cmd           ${python.bin} install.py
build.args          -p ${prefix} \
                    -b ${destroot} 

post-patch {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/install.py
}
====================================
Extract of build log showing failure:

# -*- 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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           python 1.0
PortGroup           qt5 1.0

github.setup        doug-101 ConvertAll 0.8.0 v
github.tarball_from releases

python.versions     34 35 36 37 38 39
python.default_version     38

qt5.min_version     5.4

name                convertall
version             0.8.0
license             GPL-2+
categories          math, science
platforms           darwin
maintainers         {@khorton kilohotel.com:kevin01}
description         Extremely flexible unit converter
long_description    ConvertAll has a large database of units, and allows conversions \
                    that use multiple units, e.g. convert from feet per decade to \
                    nautical miles per fortnight. 
homepage            http://convertall.bellz.org

checksums           rmd160  89fcc2aa9bad7ecc1de7bee4edea68fdff39706a \
                    sha256  624c8a792b0bc7ff3776499c2c743b32273569efd0567615e570a7e739e8d521 \
                    size    281055

depends_lib-append  port:py${python.version}-pyqt5

use_configure       no
build.cmd           ${python.bin} install.py
build.args          -p ${prefix} \
                    -b ${destroot} 

post-patch {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/install.py
}

====================================
Help info for ConvertAll's install.py:

% python install.py -h
Usage:
    python install.py [-h] [-p dir] [-d dir] [-i dir] [-b dir] [-s] [-x]
where:
    -h         display this help message
    -p dir     install prefix [default: /usr/local]
    -d dir     documentaion dir [default: <prefix>/share/doc/convertall]
    -i dir     icon dir [default: <prefix>/share/icons/convertall]
    -b dir     temporary build root for packagers [default: /]
    -s         skip language translation files
    -x         skip all dependency checks (risky)

====================================

Any assistance or advice would be greatly appreciated.

Thanks,

Kevin Horton











More information about the macports-users mailing list