Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsvgtiny: add package #5385

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/l/libsvgtiny/port/xmake.lua
Original file line number Diff line number Diff line change
@@ -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)
24 changes: 24 additions & 0 deletions packages/l/libsvgtiny/xmake.lua
Original file line number Diff line number Diff line change
@@ -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