libsvgtiny: add package (#5385)

* libsvgtiny: add package

* fix test
pull/3693/merge
star9029 2 months ago committed by GitHub
parent f55efdae6e
commit 53ae098458
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 27
      packages/l/libsvgtiny/port/xmake.lua
  2. 24
      packages/l/libsvgtiny/xmake.lua

@ -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…
Cancel
Save