Skip to content

Commit

Permalink
rockspec version 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
osch committed Jul 21, 2022
1 parent 7cb923e commit 0c8fdf0
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
46 changes: 46 additions & 0 deletions rockspecs/ljack-0.0.1-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package = "ljack"
version = "0.0.1-1"
local versionNumber = version:gsub("^(.*)-.-$", "%1")
source = {
url = "https://github.com/osch/lua-ljack/archive/v"..versionNumber..".zip",
dir = "lua-ljack-"..versionNumber,
}
description = {
summary = "Lua binding for the JACK Audio Connection Kit",
homepage = "https://github.com/osch/lua-ljack",
license = "MIT",
detailed = [[
Lua binding for the JACK Audio Connection Kit, see https://jackaudio.org/.
This binding enables Lua scripting code to registrate ports and to manage port
connections and Lua audio processor objects for the JACK Audio Connection Kit.
Realtime audio processing of the Lua processor objects has to be implemented in
native C code.
]],
}
dependencies = {
"lua >= 5.1, <= 5.4",
}
build = {
type = "builtin",
modules = {
ljack = {
libraries = {
"jack"
},
sources = {
"src/main.c",
"src/client.c",
"src/client_intern.c",
"src/port.c",
"src/procbuf.c",
"src/auproc_capi_impl.c",
"src/util.c",
"src/error.c",
"src/async_util.c",
"src/ljack_compat.c",
},
defines = { "LJACK_VERSION="..versionNumber },
},
}
}
3 changes: 2 additions & 1 deletion rockspecs/ljack-scm-0.rockspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package = "ljack"
version = "scm-0"
local versionNumber = version:gsub("^(.*)-.-$", "%1")
source = {
url = "https://github.com/osch/lua-ljack/archive/master.zip",
dir = "lua-ljack-master",
Expand Down Expand Up @@ -39,7 +40,7 @@ build = {
"src/async_util.c",
"src/ljack_compat.c",
},
defines = { "LJACK_VERSION="..version:gsub("^(.*)-.-$", "%1") },
defines = { "LJACK_VERSION="..versionNumber },
},
}
}
40 changes: 40 additions & 0 deletions rockspecs/setversion.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/lua

os.setlocale("C")

local format = string.format
local lfs = require("lfs")

local version = ...
assert(version:match("^%d+%.%d+%.%d+$"), format("invalid version %q", version))

for fileName in lfs.dir(".") do
local p1, v, p2 = fileName:match("^(ljack%-)(%d+%.%d+%.%d+)(%-%d+%.rockspec)$")
if p1 then
local newName = p1..version..p2
print(format("%-30s -> %s", fileName, newName))
local out = {}
local matched = false
local inFile = io.open(fileName, "r")
for line in inFile:lines() do
local l1, l2 = line:match("^(%s*version%s*%=%s*\")%d+%.%d+%.%d+(%-%d+\"%s*)$")
if l1 then
assert(not matched)
matched = true
out[#out+1] = l1..version..l2
else
out[#out+1] = line
end
end
out[#out+1] = ""
inFile:close()
assert(matched)
local newFile, err = io.open(newName, "w")
assert(newFile, err)
newFile:write(table.concat(out, "\n"))
newFile:close()
if fileName ~= newName then
os.remove(fileName)
end
end
end

0 comments on commit 0c8fdf0

Please sign in to comment.