<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/88b33069e248e2a0d183ddf676a3826496063558">https://github.com/macports/macports-ports/commit/88b33069e248e2a0d183ddf676a3826496063558</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 88b33069e248e2a0d183ddf676a3826496063558
</span>Author: Jordan Ellis Coppard <jc+git@wz.ht>
AuthorDate: Mon Jun 13 22:43:52 2022 +1000
<span style='display:block; white-space:pre;color:#404040;'> add new port: jpm
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> * add tests for jpm
</span><span style='display:block; white-space:pre;color:#404040;'> * add installation note for jpm explaining the downsides of
</span><span style='display:block; white-space:pre;color:#404040;'> globally installed packages (similar to the npm port)
</span>---
devel/jpm/Portfile | 107 ++++++++++++++++++++++++++
devel/jpm/files/patch-macports-locations.diff | 17 ++++
2 files changed, 124 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/jpm/Portfile b/devel/jpm/Portfile
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..c02d7f677b5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/jpm/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,107 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -*- 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
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortSystem 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup github 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+github.setup janet-lang jpm 7f0af49ca2d18cd0657be37fd6d4d775613c99bb
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 20220615
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+categories devel
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+platforms darwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+license MIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+maintainers {@tsujp wz.ht:jc+macports} openmaintainer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+description Janet Project Manager
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+long_description JPM is the Janet Project Manager tool. It is for\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ automating builds and downloading dependencies of\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Janet projects.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+homepage https://janet-lang.org/docs/jpm.html
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums rmd160 bf5a950af1c07086bd352794981f08b4c65cc1b3 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 8f92642231c39483b91261504d40a664dee3236abf5f6d202a30fbca1acc03f6 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 37254
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# jpm is installed by executing `bootstrap.janet`, so we need Janet.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+depends_lib port:janet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+use_configure no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Replace config values we want to set with strings we will grep for.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles patch-macports-locations.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Actually set those values.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@@MACPORTS_PREFIX@@|${prefix}|g" ${worksrcpath}/configs/macos_config.janet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Nothing to build, jpm is built and installed via `bootstrap.janet`.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+build {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# jpm by default assumes it's installed "under" janet (in whatever
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# directory janet is installed in); we're going to put it into
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# it's own so we have to make that directory: jpm.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+pre-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d -m 0755 ${destroot}${prefix}/lib/jpm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# MacPorts puts DESTDIR at the end of the command so we have to do this. If
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# MacPorts put DESTDIR at the start this wouldn't be necessary.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+destroot.env-append DESTDIR=${destroot}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Intentionally empty to prevent default value `install`.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+destroot.target
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+destroot.cmd ${prefix}/bin/janet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+destroot.args bootstrap.janet configs/macos_config.janet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.run yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Intentionally empty to prevent default value `test`.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.target
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.env-append PREFIX=${prefix}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.cmd ${prefix}/bin/janet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.args test/installtest.janet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+notes "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+jpm is required to use MacPorts managed jpm packages (e.g.\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+janet-joy) even though you could install joy yourself using\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+jpm. This is because jpm builds those packages and is not\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+included with janet by default.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+If you want to globally install a package it is recommended\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+you install the MacPorts port instead which are all available\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+with the prefix 'janet-', so for 'uri' it would be janet-uri\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+and for 'joy', janet-joy.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e.g.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ \$ port install janet-joy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+You can locally install jpm packages to individual projects\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+by first changing to their directory and invoking jpm with\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+the --local flag. You must keep using --local for things\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+like listing your installed packages if you want them\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+specific to your project, in this case foo. See man 1 jpm\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+for more information regarding jpm's options.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ e.g.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ \$ cd ~/projects/foo && jpm install --local joy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ \$ cd ~/projects/foo && jpm list-installed --local
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This way you can have (or not) a globally installed janet-joy\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+and a specific version local to a project you're working on via\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+the above command. To delete installed packages simply delete\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+your project's jpm_tree folder which you can think of being\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+similar to node_modules in the npm ecosystem.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+If you elect to use only jpm to globally install packages they\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+will not be cleaned up by MacPorts if you uninstall jpm or\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+janet because MacPorts cannot track these files. The special\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+'janet-' prefixed ports are tracked hence 'janet-joy' etc.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Note: use of sudo in the above commands depends on whether your\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+MacPorts is installed to a directory owned by the root user.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+"
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/jpm/files/patch-macports-locations.diff b/devel/jpm/files/patch-macports-locations.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..0a3f2fcabad
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/jpm/files/patch-macports-locations.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,17 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- configs/macos_config.janet 2022-06-11 22:57:59.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ configs/macos_config.janet 2022-06-13 21:51:53.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,4 +1,4 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-(def prefix "/usr/local")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++(def prefix "@@MACPORTS_PREFIX@@")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (def config
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {:ar "ar"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -26,7 +26,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ :local false
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ :manpath (string prefix "/share/man/man1")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ :modext ".so"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- :modpath (string prefix "/lib/janet")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ :modpath (string prefix "/lib/jpm")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ :nocolor false
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ :optimize 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ :pkglist "https://github.com/janet-lang/pkgs.git"
</span></pre><pre style='margin:0'>
</pre>