Re: New portfile writer looking for help with ConvertAll

2021-07-13 Thread Mojca Miklavec
On Tue, 13 Jul 2021 at 05:15, Kevin Horton wrote:
>
> I assume that I would submit this via Trac to see it possibly someday show up 
> in MacPorts.

While this is perfectly OK, a lot more people are watching pull requests:
https://github.com/macports/macports-ports/pulls
By submitting a pull request, it will be seen by multiple developers
multiple times which is not necessarily true for Trac (which is
perfectly suitable for bug reports, in particular when ports have
maintainers, but it gets attention from far less people).

> I dig into the docs a bit more first to see if there are any other Portfile 
> fields I should populate, or if I can find any best practices that I have 
> violated.

GitHub is also much better than Trac to get this kind of feedback.

Mojca


Re: New portfile writer looking for help with ConvertAll

2021-07-12 Thread Kevin Horton

> On Jul 12, 2021, at 6:48 PM, Kevin Horton  wrote:
> 
> 
>> On Jul 12, 2021, at 6:29 PM, Ryan Schmidt > > wrote:
>> 
>> 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.setupdoug-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
>>> 
>>> nameconvertall
>>> 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_descriptionConvertAll 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. 
>>> homepagehttp://convertall.bellz.org 
>>> 
>>> 
>>> checksums   rmd160  89fcc2aa9bad7ecc1de7bee4edea68fdff39706a \
>>>   sha256  
>>> 624c8a792b0bc7ff3776499c2c743b32273569efd0567615e570a7e739e8d521 \
>>>   size281055
>>> 
>>> 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.
> 
> 
> Whoops
> 
> :info:build Checking dependencies...
> :info:build   Python Version 3.8.11 -> OK
> :info:build   Qt Version 5.15.2 -> OK
> :info:build   PyQt Version 5.15.4 -> OK
> :info:build Installing files...
> :info:build   Copying python files to /usr/local/share/convertall
> :info:build Traceback (most recent call last):
> :info:build   File "install.py", line 308, in 
> :info:build main()
> :info:build   File "install.py", line 229, in main
> :info:build copyDir('source', pythonBuildDir)
> :info:build   File "install.py", line 92, in copyDir
> :info:build shutil.copy2(srcPath, os.path.join(dstDir, name))
> :info:build   File 
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py",
>  line 435, in copy2
> :info:build copyfile(src, dst, follow_symlinks=follow_symlinks)
> :info:build   File 
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py",
>  line 264, in copyfile
> :info:build with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
> :info:build PermissionError: [Errno 1] Operation not permitted: 
> '/usr/local/share/convertall/unitedit.py'
> :info:build Command failed:  cd 
> 

Re: New portfile writer looking for help with ConvertAll

2021-07-12 Thread Ryan Schmidt
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.setupdoug-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
> 
> nameconvertall
> 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_descriptionConvertAll 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. 
> homepagehttp://convertall.bellz.org
> 
> checksums   rmd160  89fcc2aa9bad7ecc1de7bee4edea68fdff39706a \
>sha256  
> 624c8a792b0bc7ff3776499c2c743b32273569efd0567615e570a7e739e8d521 \
>size281055
> 
> 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.