parent
f55efdae6e
commit
53ae098458
2 changed files with 51 additions and 0 deletions
@ -0,0 +1,27 @@ |
||||
add_rules("mode.debug", "mode.release") |
||||
|
||||
add_requires("gperf") |
||||
add_packages("gperf") |
||||
|
||||
add_requires("libdom") |
||||
add_packages("libdom") |
||||
|
||||
target("svgtiny") |
||||
set_kind("$(kind)") |
||||
add_files("src/*.c") |
||||
add_includedirs("include") |
||||
add_headerfiles("include/(*.h)") |
||||
|
||||
if is_plat("windows") and is_kind("shared") then |
||||
add_rules("utils.symbols.export_all") |
||||
end |
||||
|
||||
before_build(function (target) |
||||
local gperf |
||||
if is_subhost("windows") then |
||||
gperf = path.join(target:pkg("gperf"):installdir(), "bin/gperf.exe") |
||||
else |
||||
gperf = "gperf" |
||||
end |
||||
os.vrunv(gperf, {"src/colors.gperf", "--output-file=src/autogenerated_colors.c"}) |
||||
end) |
@ -0,0 +1,24 @@ |
||||
package("libsvgtiny") |
||||
set_homepage("https://www.netsurf-browser.org/projects/libsvgtiny") |
||||
set_description("Libsvgtiny is a library for parsing SVG files for display.") |
||||
set_license("MIT") |
||||
|
||||
set_urls("https://source.netsurf-browser.org/libsvgtiny.git/snapshot/libsvgtiny-release/$(version).tar.bz2", |
||||
"git://git.netsurf-browser.org/libsvgtiny.git") |
||||
|
||||
add_versions("0.1.8", "e9e772d3b8e17f26dae26d53187b42e146be9b53632c81e601a60bf9a6ec92a6") |
||||
|
||||
add_deps("gperf") |
||||
add_deps("libdom") |
||||
|
||||
on_install(function (package) |
||||
os.cd(package:version_str()) |
||||
io.replace("src/svgtiny.c", "calloc(sizeof(*diagram), 1);", "calloc(1, sizeof(*diagram));", {plain = true}) |
||||
|
||||
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("svgtiny_create", {includes = {"stddef.h", "svgtiny.h"}})) |
||||
end) |
Loading…
Reference in new issue