Skip to content

Commit c0a1b60

Browse files
author
Christophe Delord
committed
release
1 parent 3e24bed commit c0a1b60

File tree

7 files changed

+76
-220
lines changed

7 files changed

+76
-220
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
#max_line_length =
10+
tab_width = 4
11+
trim_trailing_whitespace = true

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.build
2+
build.ninja
23
img/*.meta

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ please consider donating via
5252
`panda` and `panda.lua` can also be installed anywhere. Nothing else is
5353
required (except from [Pandoc](http://pandoc.org/) obviously).
5454

55-
Note that panda can also be installed with
56-
[cdelord.fr/pub](http://cdelord.fr/pub). This repository contains panda
57-
as well as some other softwares more or less related to LuaX.
58-
5955
# Usage
6056

6157
`panda.lua` is a [Pandoc Lua filter](http://pandoc.org/lua-filters.html)

build-release.lua

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--[[
2+
This file is part of bang.
3+
4+
bang is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
bang is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with bang. If not, see <https://www.gnu.org/licenses/>.
16+
17+
For further information about bang you can visit
18+
https://github.com/cdsoft/bang
19+
]]
20+
21+
---------------------------------------------------------------------
22+
-- Release
23+
---------------------------------------------------------------------
24+
25+
section "Panda release"
26+
27+
local F = require "F"
28+
local sh = require "sh"
29+
30+
var "release" "$builddir/release"
31+
32+
rule "release-tar" {
33+
description = "tar $out",
34+
command = "GZIP_OPT=-6 tar -caf $out $in --transform='s#$prefix#$dest#'",
35+
}
36+
37+
return function(t)
38+
39+
assert(t.name, "missing name field")
40+
assert(t.sources, "missing sources field")
41+
42+
local version = sh "git describe --tags" : trim()
43+
44+
local function build_release()
45+
local name = F{ t.name, version } : flatten() : str "-"
46+
return build("$release"/version/name..".tar.gz") { "release-tar",
47+
F.flatten(t.sources) : map(function(src)
48+
return build.cp("$release/.build"/src:basename()) { src }
49+
end),
50+
prefix = "$release/.build",
51+
dest = name/"bin",
52+
}
53+
end
54+
55+
phony "release" {
56+
build_release()
57+
}
58+
59+
end

build.lua

+5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ local bins = {
5656
build.cp "$builddir/bin/panda" { "src/panda" },
5757
}
5858

59+
require "build-release" {
60+
name = "panda",
61+
sources = bins,
62+
}
63+
5964
---------------------------------------------------------------------
6065
section "Tests"
6166
---------------------------------------------------------------------

build.ninja

-213
This file was deleted.

doc/panda.md

-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ Installation
6565

6666
`panda` and `panda.lua` can also be installed anywhere. Nothing else is required (except from [Pandoc] obviously).
6767

68-
Note that panda can also be installed with [cdelord.fr/pub](http://cdelord.fr/pub).
69-
This repository contains panda as well as some other softwares more or less related to LuaX.
70-
7168
Usage
7269
=====
7370

0 commit comments

Comments
 (0)