diff --git a/jpm b/jpm index 1fc4af18..31ca46d2 100755 --- a/jpm +++ b/jpm @@ -29,7 +29,7 @@ (def i (last (string/find-all sep exe))) (slice exe 0 i))) -(def- install-paths +(defn- install-paths [] {:headerpath (os/realpath (string exe-dir "/../include/janet")) :libpath (os/realpath (string exe-dir "/../lib")) :binpath exe-dir}) @@ -38,16 +38,16 @@ # Default based on janet binary location (def JANET_HEADERPATH (or (os/getenv "JANET_HEADERPATH") - (get install-paths :headerpath))) + (get (install-paths) :headerpath))) (def JANET_LIBPATH (or (os/getenv "JANET_LIBPATH") - (get install-paths :libpath))) + (get (install-paths) :libpath))) # We want setting JANET_PATH to contain installed binaries. However, it is convenient # to have globally installed binaries got to the same place as jpm itself, which is on # the $PATH. (def JANET_BINPATH (or (os/getenv "JANET_BINPATH") (if-let [mp (os/getenv "JANET_MODPATH")] (string mp "/bin")) (if-let [mp (os/getenv "JANET_PATH")] (string mp "/bin")) - (get install-paths :binpath))) + (get (install-paths) :binpath))) # modpath should only be derived from the syspath being used or an environment variable. (def JANET_MODPATH (or (os/getenv "JANET_MODPATH") (dyn :syspath))) diff --git a/tools/patch-jpm.janet b/tools/patch-jpm.janet index 741280fd..b0f812f3 100644 --- a/tools/patch-jpm.janet +++ b/tools/patch-jpm.janet @@ -20,7 +20,7 @@ (def- replace-peg (peg/compile ~(% (* '(to "###START###") - (constant ,(string/format "# Inserted by tools/patch-jpm.janet\n(def install-paths %j)" install-paths)) + (constant ,(string/format "# Inserted by tools/patch-jpm.janet\n(defn- install-paths [] %j)" install-paths)) (thru "###END###") '(any 1)))))