forked from TypesettingTools/Aegisub
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bugfixes' into feature
- Loading branch information
Showing
5 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
---------------------------------------------------------------------------- | ||
-- Lua script to embed the rolling release version in luajit.h. | ||
---------------------------------------------------------------------------- | ||
-- Copyright (C) 2005-2023 Mike Pall. All rights reserved. | ||
-- Released under the MIT license. See Copyright Notice in luajit.h | ||
---------------------------------------------------------------------------- | ||
|
||
local args = {...} | ||
local FILE_ROLLING_H = args[1] or "luajit_rolling.h" | ||
local FILE_RELVER_TXT = args[2] or "luajit_relver.txt" | ||
local FILE_LUAJIT_H = args[3] or "luajit.h" | ||
|
||
local function file_read(file) | ||
local fp = assert(io.open(file, "rb"), "run from the wrong directory") | ||
local data = assert(fp:read("*a")) | ||
fp:close() | ||
return data | ||
end | ||
|
||
local function file_write_mod(file, data) | ||
local fp = io.open(file, "rb") | ||
if fp then | ||
local odata = assert(fp:read("*a")) | ||
fp:close() | ||
if odata == data then return end | ||
end | ||
fp = assert(io.open(file, "wb")) | ||
assert(fp:write(data)) | ||
assert(fp:close()) | ||
end | ||
|
||
local text = file_read(FILE_ROLLING_H) | ||
local relver = file_read(FILE_RELVER_TXT):match("(%d+)") | ||
|
||
if relver then | ||
text = text:gsub("ROLLING", relver) | ||
else | ||
io.stderr:write([[ | ||
**** WARNING Cannot determine rolling release version from git log. | ||
**** WARNING The 'git' command must be available during the build. | ||
]]) | ||
file_write_mod(FILE_RELVER_TXT, "ROLLING\n") -- Fallback for install target. | ||
end | ||
|
||
file_write_mod(FILE_LUAJIT_H, text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@VCS_CT@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters