Skip to content

Add macOS support #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ jobs:
fail-fast: false
matrix:
luaVersion: ["5.1.5", "5.2.4", "5.3.5", "5.4.0", "luajit-2.0.5", "luajit-2.1.0-beta3", "luajit-openresty", "5.1", "5.4"]
machineTag: ["ubuntu-latest", "macos-latest"]

runs-on: ubuntu-latest
runs-on: ${{ matrix.machineTag }}

steps:
- uses: actions/checkout@master
- uses: actions/checkout@main
- uses: leafo/gh-actions-lua@master
with:
luaVersion: ${{ matrix.luaVersion }}
Expand Down
25 changes: 16 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ async function install_luajit_openresty() {
cwd: installPath
})

await exec.exec("make -j", undefined, {
const macOSDeploymentTarget = process.platform === 'darwin' ? ' MACOSX_DEPLOYMENT_TARGET=10.15' : ''
await exec.exec("make -j" + macOSDeploymentTarget, undefined, {
cwd: path.join(installPath, "luajit2")
})

Expand All @@ -51,7 +52,8 @@ async function install_luajit(luajitVersion) {
await io.mkdirP(luaExtractPath)
await tc.extractTar(luaSourceTar, INSTALL_PREFIX)

await exec.exec("make -j", undefined, {
const macOSDeploymentTarget = process.platform === 'darwin' ? ' MACOSX_DEPLOYMENT_TARGET=10.15' : ''
await exec.exec("make -j" + macOSDeploymentTarget, undefined, {
cwd: luaExtractPath
})

Expand Down Expand Up @@ -91,16 +93,21 @@ async function main() {
await io.mkdirP(luaExtractPath)
await tc.extractTar(luaSourceTar, INSTALL_PREFIX)

await exec.exec("sudo apt-get install -q libreadline-dev libncurses-dev", undefined, {
env: {
DEBIAN_FRONTEND: "noninteractive",
TERM: "linux"
}
})
if (process.platform === 'darwin') {
await exec.exec("brew install readline ncurses")
} else {
await exec.exec("sudo apt-get install -q libreadline-dev libncurses-dev", undefined, {
env: {
DEBIAN_FRONTEND: "noninteractive",
TERM: "linux"
}
})
}

const makefilePlatform = process.platform === "darwin" ? "macosx" : "linux"
const compileFlagsArray = [
"-j",
"linux",
makefilePlatform,
]

if (luaCompileFlags) {
Expand Down