mirror of
https://github.com/janet-lang/janet
synced 2025-09-08 05:46:06 +00:00
Merge branch 'master' into struct-proto
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
@echo off
|
||||
@rem Wrapper around jpm
|
||||
|
||||
janet "%~dp0\jpm.janet" %*
|
Binary file not shown.
@@ -115,12 +115,6 @@
|
||||
</File>
|
||||
<RemoveFolder Id="RemoveBinDir" On="uninstall" />
|
||||
</Component>
|
||||
<Component Directory="BinDir">
|
||||
<File Source="jpm" Name="jpm.janet"/>
|
||||
</Component>
|
||||
<Component Directory="BinDir">
|
||||
<File Source="tools\jpm.bat"/>
|
||||
</Component>
|
||||
|
||||
<Component Directory="CDir">
|
||||
<File Source="dist\janet.h"/>
|
||||
|
@@ -1,33 +0,0 @@
|
||||
# Patch jpm to have the correct paths for the current install.
|
||||
# usage: janet patch-jpm.janet output --libdir=/usr/local/lib/x64-linux/ --binpath
|
||||
|
||||
(def- argpeg
|
||||
(peg/compile
|
||||
'(* "--" '(to "=") "=" '(any 1))))
|
||||
|
||||
(def- args (tuple/slice (dyn :args) 3))
|
||||
(def- len (length args))
|
||||
(var i :private 0)
|
||||
|
||||
(def install-paths @{})
|
||||
|
||||
# Get flags
|
||||
(each a args
|
||||
(if-let [m (peg/match argpeg a)]
|
||||
(let [[key value] m]
|
||||
(put install-paths (keyword key) value))))
|
||||
|
||||
(def- replace-peg
|
||||
(peg/compile
|
||||
~(% (* '(to "###START###")
|
||||
(constant ,(string/format "# Inserted by tools/patch-jpm.janet\n(defn- install-paths [] %j)" install-paths))
|
||||
(thru "###END###")
|
||||
'(any 1)))))
|
||||
|
||||
(def source (slurp ((dyn :args) 1)))
|
||||
(def newsource (0 (peg/match replace-peg source)))
|
||||
|
||||
(spit ((dyn :args) 2) newsource)
|
||||
|
||||
(unless (= :windows (os/which))
|
||||
(os/shell (string `chmod +x "` ((dyn :args) 2) `"`)))
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Calvin Rose
|
||||
* Copyright (c) 2021 Calvin Rose
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
Reference in New Issue
Block a user