aboutsummaryrefslogtreecommitdiff
path: root/manual/package_dependencies.md
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2019-06-22 10:49:32 +0800
committerruki <waruqi@gmail.com>2019-06-22 10:49:32 +0800
commit2809e37a97e58c4920b4631052f9903af7a5a74e (patch)
treeafab38aa14e308a951a78912e0d2ab12fc9ec67d /manual/package_dependencies.md
parent0f4577a0a110c73796fd1e65c343bb9199da65d7 (diff)
downloadxmake-docs-2809e37a97e58c4920b4631052f9903af7a5a74e.tar.gz
xmake-docs-2809e37a97e58c4920b4631052f9903af7a5a74e.zip
add manual
Diffstat (limited to 'manual/package_dependencies.md')
-rw-r--r--manual/package_dependencies.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/manual/package_dependencies.md b/manual/package_dependencies.md
new file mode 100644
index 00000000..e600ef31
--- /dev/null
+++ b/manual/package_dependencies.md
@@ -0,0 +1,41 @@
+
+The repository depends on the package definition description, the `package()` related interface definition, etc. There will be time to elaborate, so stay tuned. .
+
+Please refer to the existing package description in the official repository: [xmake-repo](https://github.com/xmake-io/xmake-repo)
+
+Here is a more representative example for reference:
+
+```lua
+package("libxml2")
+
+ set_homepage("http://xmlsoft.org/")
+ set_description("The XML C parser and toolkit of Gnome.")
+
+ set_urls("https://github.com/GNOME/libxml2/archive/$(version).zip", {excludes = {"*/result/*", "*/test/*"}})
+
+ add_versions("v2.9.8", "c87793e45e66a7aa19200f861873f75195065de786a21c1b469bdb7bfc1230fb")
+ add_versions("v2.9.7", "31dd4c0e10fa625b47e27fd6a5295d246c883f214da947b9a4a9e13733905ed9")
+
+ if is_plat("macosx", "linux") then
+ add_deps("autoconf", "automake", "libtool", "pkg-config")
+ end
+
+ on_load(function (package)
+ package:addvar("includedirs", "include/libxml2")
+ package:addvar("links", "xml2")
+ end)
+
+ if is_plat("windows") and winos.version():gt("winxp") then
+ on_install("windows", function (package)
+ os.cd("win32")
+ os.vrun("cscript configure.js iso8859x=yes iconv=no compiler=msvc cruntime=/MT debug=%s prefix=\"%s\"", package:debug() and "yes" or "no", Package:installdir())
+ os.vrun("nmake /f Makefile.msvc")
+ os.vrun("nmake /f Makefile.msvc install")
+ end)
+ end
+
+ on_install("macosx", "linux", function (package)
+ import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--without-python", "--without-lzma"})
+ end)
+```
+