Skip to content

Commit 1782098

Browse files
committed
rockspec for version 0.0.1
1 parent 9a44b1a commit 1782098

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

rockspecs/auproc-0.0.1-1.rockspec

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package = "auproc"
2+
version = "0.0.1-1"
3+
local versionNumber = version:gsub("^(.*)-.-$", "%1")
4+
source = {
5+
url = "https://github.com/osch/lua-auproc/archive/v"..versionNumber..".zip",
6+
dir = "lua-auproc-"..versionNumber,
7+
}
8+
description = {
9+
summary = "Simple audio processor objects",
10+
homepage = "https://github.com/osch/lua-auproc",
11+
license = "MIT",
12+
detailed = [[
13+
Simple audio processor objects that can be used
14+
with ljack ( https://luarocks.org/modules/osch/ljack )
15+
or lrtaudio ( https://luarocks.org/modules/osch/lrtaudio )
16+
]],
17+
}
18+
dependencies = {
19+
"lua >= 5.1, <= 5.4",
20+
}
21+
build = {
22+
type = "builtin",
23+
modules = {
24+
auproc = {
25+
sources = {
26+
"src/main.c",
27+
"src/auproc_compat.c",
28+
29+
"src/midi_sender.c",
30+
"src/midi_receiver.c",
31+
"src/midi_mixer.c",
32+
33+
"src/audio_sender.c",
34+
"src/audio_receiver.c",
35+
"src/audio_mixer.c"
36+
},
37+
defines = { "AUPROC_VERSION="..versionNumber },
38+
},
39+
}
40+
}

rockspecs/setversion.lua

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/lua
2+
3+
os.setlocale("C")
4+
5+
local format = string.format
6+
local lfs = require("lfs")
7+
8+
local version = ...
9+
assert(version:match("^%d+%.%d+%.%d+$"), format("invalid version %q", version))
10+
11+
for fileName in lfs.dir(".") do
12+
local p1, v, p2 = fileName:match("^(auproc%-)(%d+%.%d+%.%d+)(%-%d+%.rockspec)$")
13+
if p1 then
14+
local newName = p1..version..p2
15+
print(format("%-30s -> %s", fileName, newName))
16+
local out = {}
17+
local matched = false
18+
local inFile = io.open(fileName, "r")
19+
for line in inFile:lines() do
20+
local l1, l2 = line:match("^(%s*version%s*%=%s*\")%d+%.%d+%.%d+(%-%d+\"%s*)$")
21+
if l1 then
22+
assert(not matched)
23+
matched = true
24+
out[#out+1] = l1..version..l2
25+
else
26+
out[#out+1] = line
27+
end
28+
end
29+
out[#out+1] = ""
30+
inFile:close()
31+
assert(matched)
32+
local newFile, err = io.open(newName, "w")
33+
assert(newFile, err)
34+
newFile:write(table.concat(out, "\n"))
35+
newFile:close()
36+
if fileName ~= newName then
37+
os.remove(fileName)
38+
end
39+
end
40+
end

0 commit comments

Comments
 (0)