Skip to content

Commit b754772

Browse files
committed
✨ feat(repo/packages): add ffmpeg, libjpeg, libpng, lua, ncurses, openssl, pcre, readline, sdl2, sdl2_image, uhttpd
1 parent 1a43c4b commit b754772

39 files changed

Lines changed: 3450 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-11 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.so*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
34+
end
35+
end
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file export.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-23 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir)
26+
for _, filedir in ipairs(os.filedirs(path.join(installdir, "include") .. "/*")) do
27+
local inc = path.join(installdir, "include")
28+
local name = path.relative(filedir, inc)
29+
rt_utils.cp_with_symlink(path.join(inc, name), path.join(rootfs, "include", name),
30+
{rootdir = inc, symlink = true})
31+
end
32+
33+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.a")) do
34+
local filename = path.filename(filepath)
35+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
36+
end
37+
38+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.so*")) do
39+
local filename = path.filename(filepath)
40+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
41+
end
42+
end

repo/packages/f/ffmpeg/xmake.lua

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file xmake.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-06 xqyjlj initial version
22+
--
23+
package("ffmpeg")
24+
do
25+
set_homepage("https://www.ffmpeg.org")
26+
set_description(
27+
"A collection of libraries to process multimedia content such as audio, video, subtitles and related metadata.")
28+
29+
add_urls("https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2")
30+
31+
add_versions("5.1.2", "39a0bcc8d98549f16c570624678246a6ac736c066cebdb409f9502e915b22f2b")
32+
33+
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
34+
35+
on_install("cross@linux", function(package)
36+
import("rt.private.build.rtflags")
37+
local info = rtflags.get_package_info(package)
38+
local host = info.host
39+
local configs = {host = ""}
40+
local cc = info.cc
41+
local cxx = info.cxx
42+
local arch = info.arch
43+
local cpu = info.cpu
44+
local ldflags = {}
45+
local packagedeps = {}
46+
os.setenv("PATH", info.toolchainsdir .. ":" .. os.getenv("PATH"))
47+
48+
if host == "aarch64-linux-musleabi" then
49+
arch = "aarch64"
50+
cpu = "armv8-a"
51+
end
52+
53+
table.insert(configs, "--cross-prefix=" .. host .. "-")
54+
table.insert(configs, "--enable-cross-compile")
55+
table.insert(configs, "--target-os=none")
56+
table.insert(configs, "--cc=" .. cc)
57+
table.insert(configs, "--cxx=" .. cxx)
58+
table.insert(configs, "--arch=" .. arch)
59+
table.insert(configs, "--cpu=" .. cpu)
60+
if package:config("shared") then
61+
table.insert(configs, "--enable-shared")
62+
end
63+
64+
-- table.insert(configs, "$ADDITIONAL_CONFIGURE_FLAG")
65+
66+
local buildenvs = import("package.tools.autoconf").buildenvs(package,
67+
{ldflags = ldflags, packagedeps = packagedeps})
68+
import("package.tools.autoconf").configure(package, configs, {envs = buildenvs})
69+
import("package.tools.make").install(package, {}, {envs = buildenvs})
70+
for _, suffix in ipairs({".a", ".so"}) do
71+
if os.isfile(path.join(package:installdir("lib"), "libavdevice" .. suffix)) then
72+
package:add("links", "avdevice") -- avdevice first
73+
end
74+
if os.isfile(path.join(package:installdir("lib"), "libavfilter" .. suffix)) then
75+
package:add("links", "avfilter")
76+
end
77+
if os.isfile(path.join(package:installdir("lib"), "libavformat" .. suffix)) then
78+
package:add("links", "avformat")
79+
end
80+
if os.isfile(path.join(package:installdir("lib"), "libavcodec" .. suffix)) then
81+
package:add("links", "avcodec")
82+
end
83+
if os.isfile(path.join(package:installdir("lib"), "libswresample" .. suffix)) then
84+
package:add("links", "swresample")
85+
end
86+
if os.isfile(path.join(package:installdir("lib"), "libswscale" .. suffix)) then
87+
package:add("links", "swscale")
88+
end
89+
if os.isfile(path.join(package:installdir("lib"), "libavutil" .. suffix)) then
90+
package:add("links", "avutil")
91+
end
92+
end
93+
end)
94+
95+
on_test(function(package)
96+
assert(package:has_cfuncs("avformat_open_input", {includes = "libavformat/avformat.h"}))
97+
end)
98+
end
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-11 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.so*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
34+
end
35+
end
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file export.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-23 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir)
26+
for _, filedir in ipairs(os.filedirs(path.join(installdir, "include") .. "/*")) do
27+
local inc = path.join(installdir, "include")
28+
local name = path.relative(filedir, inc)
29+
rt_utils.cp_with_symlink(path.join(inc, name), path.join(rootfs, "include", name),
30+
{rootdir = inc, symlink = true})
31+
end
32+
33+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.a")) do
34+
local filename = path.filename(filepath)
35+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
36+
end
37+
38+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.so*")) do
39+
local filename = path.filename(filepath)
40+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
41+
end
42+
end

repo/packages/l/libjpeg/xmake.lua

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2022-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file xmake.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-03-06 xqyjlj adapt debug shared
22+
-- 2023-02-28 xqyjlj initial version
23+
--
24+
package("libjpeg")
25+
do
26+
set_homepage("http://ijg.org/")
27+
set_description("A widely used C library for reading and writing JPEG image files.")
28+
29+
add_urls("https://www.ijg.org/files/jpegsrc.$(version).tar.gz")
30+
31+
add_versions("v9b", "566241ad815df935390b341a5d3d15a73a4000e5aab40c58505324c2855cbbb8")
32+
add_versions("v9c", "682aee469c3ca857c4c38c37a6edadbfca4b04d42e56613b11590ec6aa4a278d")
33+
add_versions("v9d", "2303a6acfb6cc533e0e86e8a9d29f7e6079e118b9de3f96e07a71a11c082fa6a")
34+
add_versions("v9e", "4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d")
35+
36+
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
37+
38+
on_install("cross@linux", function(package)
39+
import("rt.private.build.rtflags")
40+
local info = rtflags.get_package_info(package)
41+
local host = info.host
42+
local configs = {host = host}
43+
local cc = info.cc
44+
local ldflags = {}
45+
os.setenv("PATH", path.directory(cc) .. ":" .. os.getenv("PATH"))
46+
47+
table.insert(configs, "--enable-static=yes")
48+
if package:config("shared") then
49+
table.insert(configs, "--enable-shared=yes")
50+
else
51+
table.insert(configs, "--enable-shared=no")
52+
end
53+
54+
local buildenvs = import("package.tools.autoconf").buildenvs(package, {ldflags = ldflags})
55+
import("package.tools.autoconf").configure(package, configs, {envs = buildenvs})
56+
import("package.tools.make").install(package, {}, {envs = buildenvs})
57+
end)
58+
59+
on_test(function(package)
60+
assert(package:has_cfuncs("jpeg_create_compress(0)", {includes = {"stdio.h", "jpeglib.h"}}))
61+
end)
62+
end
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-11 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.so*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
34+
end
35+
end
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file export.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-23 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir)
26+
for _, filedir in ipairs(os.filedirs(path.join(installdir, "include") .. "/*")) do
27+
local inc = path.join(installdir, "include")
28+
local name = path.relative(filedir, inc)
29+
rt_utils.cp_with_symlink(path.join(inc, name), path.join(rootfs, "include", name),
30+
{rootdir = inc, symlink = true})
31+
end
32+
33+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.a")) do
34+
local filename = path.filename(filepath)
35+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
36+
end
37+
38+
for _, filepath in ipairs(os.files(path.join(installdir, "lib") .. "/lib*.so*")) do
39+
local filename = path.filename(filepath)
40+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "lib", filename))
41+
end
42+
end

0 commit comments

Comments
 (0)