<div class="gmail_quote_attribution">Hey,</div><br><div class="gmail_quote_attribution">On Mar 29 2019, at 3:26 am, Mojca Miklavec <mojca@macports.org> wrote:</div><blockquote><div><div><div><div><div><br><img class="mailspring-open" alt="Sent from Mailspring" width="0" height="0" style="border:0; width:0; height:0;" src="https://link.getmailspring.com/open/6FA7376B-DDC8-4CDE-8409-B3A4EBD78086@getmailspring.com?recipient=bWFjcG9ydHMtZGV2QGxpc3RzLm1hY3BvcnRzLm9yZw%3D%3D"><div class="gmail_quote"><blockquote><div><div><div class="gmail_quote"><div><div>master_sites        git+<a href="https://github.com/request/request.git" title="https://github.com/request/request.git">https://github.com/request/request.git</a></div></div></div></div></div></blockquote><div><br></div><div>This line looks a bit suspicious. If the files live on github, we might want to use the github PortGroup anyway, but let's leave that detail for later ...</div><br></div></div></div></div></div></div></blockquote><br><div>yeah the link was wrong and I had my doubts, now its fixed in the updated script.(more on this below)</div><div> </div><blockquote><div><div><div><div><div><div class="gmail_quote"><blockquote><div><div class="gmail_quote"><div>I still have to add checksum and have a bit of doubt in it - to calculate checksum it will have to download distfiles from npm and calculate checksums for that right?</div></div></div></blockquote><div><br></div><div>Yes.</div><div><br></div><div>Support for checksums has been implemented recently:</div><div><div><div>    <a href="https://framagit.org/upt/upt/commit/3f634370bbb80904411ff298d2b79e35c7591d23" title="https://framagit.org/upt/upt/commit/3f634370bbb80904411ff298d2b79e35c7591d23">https://framagit.org/upt/upt/commit/3f634370bbb80904411ff298d2b79e35c7591d23</a></div></div></div><div><br></div><div>Yes, the file would be downloaded and the checksum would be calculated, but this would be done by upt (if some piece of functionality is missing, then upt needs to be improved).</div><div> </div><blockquote><div class="gmail_quote"><div>Another doubt that I have is how to test the Portfiles generated,because if I try to directly to install this files then it tries to get distfiles from the macport server I guess(I have never done this so have no clue on how to test it)</div></div></blockquote><div><br></div><div>If you try to install the port, MacPorts will first try to fetch the binary package from the server. Of course the binary package will not exist, so it will try to build it locally (which is what you want). While building locally, it will first check the macports mirrors for the source, which will again not be there, so it will (after three tries or so) turn to the original source. You can also run "sudo port -v fetch npm-request --no-mirror" to download directly. But the above URL (master_sites) seems wrong, so it won't work like that.</div><div><br></div><div>Here's a version that would fetch the correct file (you can run "sudo port -v extract npm-request" on it), but it won't install just yet.</div><div><br></div><div>Probably the easiest way is to do a full git clone of the macports-ports repository and then configure macports to look into it:</div><div><div>    <a href="https://guide.macports.org/chunked/development.local-repositories.html" title="https://guide.macports.org/chunked/development.local-repositories.html">https://guide.macports.org/chunked/development.local-repositories.html</a></div></div><div><br></div><div>Then just add a file, for example</div><div>    macports-ports/npm/npm-request/Portfile</div><div>with that contents, run "portindex" inside macports-ports and then keep playing with installation.</div><div><br></div><br></div></div></div></div></div></div></blockquote><div>Yeah previously I had created a local repository (without cloning) and it worked so far but now for perl branches I guess cloning will be needed.</div><div> </div><blockquote><div><div><div><div><div><div class="gmail_quote"><blockquote><div><div class="gmail_quote"><div>Also for every npm package multiple versions are available so should the script ask which version to use or by-default newest version.</div></div></div></blockquote><div><br></div><div>This is a million dollar question. We usually package just the latest version of everything (except for exceptions ... :)</div><div><br></div><div>We could package multiple versions, where you have two options:</div><div>- install all at the same time</div><div>- allow installing just one version at a time, others may not be installed</div><div><br></div><div>I suspect that the first approach won't work. The second one is often problematic.</div><div><br></div><div>With python or perl we ship multiple versions of python / perl, but for each of them either only a single version of any python package, or exceptionally multiple versions, but then they conflict with each other which is highly suboptimal.</div><div><br></div><div>In all honesty, if there are too many cases where the latest version of a package doesn't work (another package requires an older version), it's questionable whether we can achieve anything useful with npm at all.</div><div><br></div></div></div></div></div></div></div></blockquote><div>Ok so as of now I have kept it to latest version, we can work this out later I guess</div><blockquote><div><div><div><div><div><div class="gmail_quote"><blockquote><div><div class="gmail_quote"><div><div>After this I would move on to automating the test, but for that I need help first with manual testing for npm.</div></div></div></div></blockquote><div><br></div><div>Do you mean manually testing whether the port builds at all, or running the unit tests?</div><div> </div></div></div></div></div></div></div></blockquote><div>By manual testing I meant port builds.</div><br><div>So now macports backend for npm and perl is mostly completed, I might have missed a few things but that can be solved/added later on.</div><br><div>Updated npm Example:</div><code><pre style="background-color:rgba(0,0,0,0.05);padding:0.2em 1em">upt package -f npm -b macports request</pre></code><div>Output:</div><br><code><pre style="background-color:rgba(0,0,0,0.05);padding:0.2em 1em"># -*- 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>PortSystem          1.0<br><br><br>name                npm-request<br>version             2.88.0<br>categories          npm<br>maintainers         nomaintainer<br>description         Simplified HTTP request client.<br>long_description    ${description}<br><br>platforms           darwin<br>license             Apache-2.0<br>homepage            https://github.com/request/request#readme<br><br>distname            request-2.88.0<br>distfiles           request-2.88.0.tgz<br>master_sites        https://registry.npmjs.org/request/-/request-2.88.0.tgz<br><br>checksums           md5     d2f4658aa40c2abdca764aa40c6fca07 \<br>                    sha256  61af775fd5eb513dfac1569edb60518a65c10a47009abd8d5074ba6b434adaa4 \<br>                    rmd160  1d9313e896203695be177c82d63ed200bf0bf20f \<br>                    size    58023</pre></code><br><div>Example for perl:</div><code><pre style="background-color:rgba(0,0,0,0.05);padding:0.2em 1em">upt package -f cpan -b macports Amazon-S3</pre></code><br><br><div>Output<span data-emoji-typing="true">:</span></div><br><code><pre style="background-color:rgba(0,0,0,0.05);padding:0.2em 1em"># -*- 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>PortSystem          1.0<br>PortGroup           perl5 1.0<br><br>perl5.branches      5.26 5.28<br>perl5.setup         Amazon-S3 0.45<br><br>license             Artistic-1.0-Perl <br>maintainers         nomaintainer<br>description         A portable client library for working with and managing Amazon S3 buckets and keys.<br>long_description    ${description}<br><br>platforms           darwin<br>supported_archs     noarch<br><br>checksums           md5     a055ab8fd27d86ddc65a216145391793 \<br>                    sha256  77c313d9517026cdccd5ff4e19d302cd7aa2df1f3870e31f0e9f43f69628d908 \<br>                    rmd160  19e74c57191bed5ff7c3367b65f3b0961fdea05a \<br>                    size    16585<br><br>if {${perl5.major} != ""} {<br>    depends_lib-append \<br>                    port:p${perl5.major}-xml-simple \                    <br>                    port:p${perl5.major}-mime-base64 \                    <br>                    port:p${perl5.major}-http-date \                    <br>                    port:p${perl5.major}-class-accessor-fast \                    <br>                    port:p${perl5.major}-digest-md5-file \                    <br>                    port:p${perl5.major}-digest-hmac_sha1 \                    <br>                    port:p${perl5.major}-uri-escape \                    <br>                    port:p${perl5.major}-lwp-useragent-determined \                    <br>                    port:p${perl5.major}-io-file \                    <br>                    port:p${perl5.major}-test-more                     <br>}</pre></code><br><br><div>Note<span data-emoji-typing="true">:</span> perl5.branches is static and although the dependencies are dynamic the if statement is static.</div><br><div>I tried installing port using this Portfile and it worked perfectly.(perl only)</div><br><div>Now I guess this would be the things that should be worked on:</div><ul><li><div>For now upt gives output to terminal so it would be good if a Portfile is created at appropriate location</div></li><li><div>Automating port fetch and check test</div></li><li><div>POC for updating the perl files </div></li><li><div>Recurrsively generating packages</div></li></ul><br><div>I had to update a bit of upt-cpan as it was not parsing description properly.</div><br><div>Thanks,</div><div>Karan Sheth</div>
<br>
<div><img src="http://somaiya.edu/media/images/top-layer_footer.jpg" style="font-size:1.3em"></div><div><a href="https://www.somaiya.edu" style="font-size:1.3em" target="_blank"><img src="http://somaiya.edu/media/images/svv-logo-email-footer.jpg"></a><span style="font-size:1.3em">       </span><a href="http://www.somaiya-ayurvihar.org" style="font-size:1.3em" target="_blank"><img src="http://somaiya.edu/media/images/Medical-Logo-email-footer.jpg"></a><span style="font-size:1.3em"> </span><a href="http://nareshwadi.org" style="font-size:1.3em" target="_blank"><img src="http://somaiya.edu/media/images/Nareshwadi-Logo-email-footer.jpg"></a><span style="font-size:1.3em"> </span><a href="http://somaiya.com" style="font-size:1.3em" target="_blank"><img src="http://somaiya.edu/media/images/Somaiya-Trust-Logo-email-footer.jpg"></a><span style="font-size:1.3em"> </span><a href="http://www.helpachild.in" style="font-size:1.3em" target="_blank"><img src="http://somaiya.edu/media/images/HelpAChild-Logo-email-footer.jpg"></a><span style="font-size:1.3em"> </span><a href="http://nareshwadi.org" style="font-size:1.3em" target="_blank"><img src="http://somaiya.edu/media/images/PragatiMandal-Logo-email-footer-1.jpg"></a></div>