-
-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pdfio: add package * remove main cpp * fix missing files * patch mingw
- Loading branch information
1 parent
199b79a
commit ffd373a
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
add_rules("mode.debug", "mode.release") | ||
|
||
add_requires("zlib") | ||
add_packages("zlib") | ||
|
||
target("pdfio") | ||
set_kind("$(kind)") | ||
add_files("pdfio-*.c", "ttf.c") | ||
add_headerfiles("pdfio.h") | ||
|
||
if is_plat("windows") and is_kind("shared") then | ||
add_rules("utils.symbols.export_all") | ||
end | ||
|
||
if is_plat("windows", "mingw") then | ||
add_syslinks("advapi32") | ||
elseif is_plat("linux", "bsd") then | ||
add_syslinks("m") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package("pdfio") | ||
set_homepage("https://www.msweet.org/pdfio") | ||
set_description("PDFio is a simple C library for reading and writing PDF files.") | ||
set_license("Apache-2.0") | ||
|
||
add_urls("https://github.com/michaelrsweet/pdfio/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/michaelrsweet/pdfio.git") | ||
|
||
add_versions("v1.3.0", "aae5b4850560869021f6af1700a0681f0d19299554f24abf890a1a78188ddf02") | ||
|
||
if is_plat("windows", "mingw") then | ||
add_syslinks("advapi32") | ||
elseif is_plat("linux", "bsd") then | ||
add_syslinks("m") | ||
end | ||
|
||
add_deps("zlib") | ||
|
||
if on_check then | ||
on_check("android", function (package) | ||
local ndk = package:toolchain("ndk") | ||
local ndk_sdkver = ndk:config("ndk_sdkver") | ||
assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(pdfio): need ndk api level > 21") | ||
end) | ||
end | ||
|
||
on_install(function (package) | ||
if package:is_plat("mingw") and package:is_arch("i386") then | ||
io.replace("ttf.c", "typedef __int64 ssize_t;", "", {plain = true}) | ||
io.replace("pdfio.h", "typedef __int64 ssize_t;", "", {plain = true}) | ||
end | ||
|
||
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("pdfioArrayCreate", {includes = "pdfio.h"})) | ||
end) |