On Jul 12, 2021, at 20:13, Kevin Horton wrote:
> 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
Remove the comma here.
> 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:
Looks like you just pasted the portfile again here. Can you show the failure
log? I'm specifically interested in determining whether the failure is
occurring in the build phase or in the destroot phase. If the latter, then
it'll be because you only set build.cmd and build.args and didn't set
destroot.cmd and destroot.args.
Looks like you've set build.cmd and build.args reasonably for this build
system, but MacPorts usually builds in the build phase and stages into the
destroot in the destroot phase. If there is a way to tell this build system to
do that, do so. In that case, you would probably need to set destroot.cmd and
destroot.args too. If it is quite difficult to tell the build system to do
that, then it is acceptable for the build phase to install the files into the
destroot already and to have the destroot phase do nothing. In that case, you
could disable the destroot phase by writing "destroot {}". Some ports do it the
other way around, where the build phase does nothing ("build {}") and the
destroot phase does the building and the destrooting.