<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 12, 2021, at 6:48 PM, Kevin Horton <<a href="mailto:kevin01@kilohotel.com" class="">kevin01@kilohotel.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 12, 2021, at 6:29 PM, Ryan Schmidt <<a href="mailto:ryandesign@macports.org" class="">ryandesign@macports.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On Jul 12, 2021, at 20:13, Kevin Horton wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">I'm trying to create a port for ConvertAll - <a href="http://convertall.bellz.org/" class="">http://convertall.bellz.org</a>. 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.<br class=""><br class="">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.<br class=""><br class="">Current draft Portfile:<br class=""># -*- 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<br class=""><br class="">PortSystem 1.0<br class="">PortGroup github 1.0<br class="">PortGroup python 1.0<br class="">PortGroup qt5 1.0<br class=""><br class="">github.setup doug-101 ConvertAll 0.8.0 v<br class="">github.tarball_from releases<br class=""><br class="">python.versions 34 35 36 37 38 39<br class="">python.default_version 38<br class=""><br class="">qt5.min_version 5.4<br class=""><br class="">name convertall<br class="">version 0.8.0<br class="">license GPL-2+<br class="">categories math, science<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Remove the comma here.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">platforms darwin<br class="">maintainers {@khorton <a href="http://kilohotel.com/" class="">kilohotel.com</a>:kevin01}<br class="">description Extremely flexible unit converter<br class="">long_description ConvertAll has a large database of units, and allows conversions \<br class=""> that use multiple units, e.g. convert from feet per decade to \<br class=""> nautical miles per fortnight.<span class="Apple-converted-space"> </span><br class="">homepage <a href="http://convertall.bellz.org/" class="">http://convertall.bellz.org</a><br class=""><br class="">checksums rmd160 89fcc2aa9bad7ecc1de7bee4edea68fdff39706a \<br class=""> sha256 624c8a792b0bc7ff3776499c2c743b32273569efd0567615e570a7e739e8d521 \<br class=""> size 281055<br class=""><br class="">depends_lib-append port:py${python.version}-pyqt5<br class=""><br class="">use_configure no<br class="">build.cmd ${python.bin} install.py<br class="">build.args -p ${prefix} \<br class=""> -b ${destroot}<span class="Apple-converted-space"> </span><br class=""><br class="">post-patch {<br class=""> reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/install.py<br class="">}<br class="">====================================<br class="">Extract of build log showing failure:<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">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.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">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.</span></div></blockquote><br class=""></div><div class=""><br class=""></div><div class="">Whoops</div><div class=""><br class=""></div><div class=""><div class="">:info:build Checking dependencies...</div><div class="">:info:build Python Version 3.8.11 -> OK</div><div class="">:info:build Qt Version 5.15.2 -> OK</div><div class="">:info:build PyQt Version 5.15.4 -> OK</div><div class="">:info:build Installing files...</div><div class="">:info:build Copying python files to /usr/local/share/convertall</div><div class="">:info:build Traceback (most recent call last):</div><div class="">:info:build File "install.py", line 308, in <module></div><div class="">:info:build main()</div><div class="">:info:build File "install.py", line 229, in main</div><div class="">:info:build copyDir('source', pythonBuildDir)</div><div class="">:info:build File "install.py", line 92, in copyDir</div><div class="">:info:build shutil.copy2(srcPath, os.path.join(dstDir, name))</div><div class="">:info:build File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 435, in copy2</div><div class="">:info:build copyfile(src, dst, follow_symlinks=follow_symlinks)</div><div class="">:info:build File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 264, in copyfile</div><div class="">:info:build with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:</div><div class="">:info:build PermissionError: [Errno 1] Operation not permitted: '/usr/local/share/convertall/unitedit.py'</div><div class="">:info:build Command failed: cd "/opt/local/var/macports/build/_Users_kwh_sw_projects_git_macports_kwh_math_convertall/convertall/work/ConvertAll-0.8.0" && /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 install.py build -j16 -p /opt/local -b /opt/local/var/macports/build/_Users_kwh_sw_projects_git_macports_kwh_math_convertall/convertall/work/destroot </div><div class="">:info:build Exit code: 1</div><div class="">:error:build Failed to build convertall: command execution failed</div><div class="">:debug:build Error code: CHILDSTATUS 26196 1</div><div class="">:debug:build Backtrace: command execution failed</div><div class="">:debug:build while executing</div><div class="">:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"</div><div class="">:debug:build invoked from within</div><div class="">:debug:build "command_exec -callback portprogress::target_progress_callback build"</div><div class="">:debug:build (procedure "portbuild::build_main" line 8)</div><div class="">:debug:build invoked from within</div><div class="">:debug:build "$procedure $targetname"</div><div class="">:error:build See /opt/local/var/macports/logs/_Users_kwh_sw_projects_git_macports_kwh_math_convertall/convertall/main.log for details.</div><div class=""><br class=""></div><div class="">Kevin</div><div class=""><br class=""></div></div><br class=""></div></div></blockquote><br class=""></div><div>Well, I don't understand why ConvertAll's build system was apparently ignoring its advertised -p and -b flags, but it looks like it was. I brute forced it by reinplacing the applicable lines in install.py using a post-patch script. Now it installs without error and appears to run correctly.</div><div><br class=""></div><div>Current draft Portfile:</div><div><br class=""></div><div><div># -*- 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</div><div><br class=""></div><div>PortSystem 1.0</div><div>PortGroup github 1.0</div><div>PortGroup python 1.0</div><div>PortGroup qt5 1.0</div><div><br class=""></div><div>github.setup doug-101 ConvertAll 0.8.0 v</div><div>github.tarball_from releases</div><div><br class=""></div><div>python.versions 34 35 36 37 38 39</div><div>python.default_version 38</div><div><br class=""></div><div>qt5.min_version 5.4</div><div><br class=""></div><div>name convertall</div><div>version 0.8.0</div><div>license GPL-2+</div><div>categories math science</div><div>platforms darwin</div><div>maintainers {@khorton <a href="http://kilohotel.com" class="">kilohotel.com</a>:kevin01}</div><div>description Extremely flexible unit converter</div><div>long_description ConvertAll has a large database of units, and allows conversions \</div><div> that use multiple units, e.g. convert from feet per decade to \</div><div> nautical miles per fortnight. </div><div>homepage <a href="http://convertall.bellz.org" class="">http://convertall.bellz.org</a></div><div><br class=""></div><div>checksums rmd160 89fcc2aa9bad7ecc1de7bee4edea68fdff39706a \</div><div> sha256 624c8a792b0bc7ff3776499c2c743b32273569efd0567615e570a7e739e8d521 \</div><div> size 281055</div><div><br class=""></div><div>depends_lib-append port:py${python.version}-pyqt5</div><div><br class=""></div><div>use_configure no</div><div>build.cmd ${python.bin} install.py</div><div>build.args -p ${prefix} \</div><div> -b ${destroot} </div><div><br class=""></div><div>destroot {}</div><div><br class=""></div><div>post-patch {</div><div> reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/install.py</div><div> reinplace "s|buildRoot = '/'|buildRoot = '${workpath}/destroot'|g" ${worksrcpath}/install.py</div><div>}</div><div><br class=""></div><div>======================</div><div><br class=""></div><div>I assume that I would submit this via Trac to see it possibly someday show up in MacPorts. 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.</div><div><br class=""></div><div>Thanks,</div><div><br class=""></div><div>Kevin</div></div><br class=""></body></html>