xmake-repo:官方C/C++包管理仓库,支持跨平台与工程模板

📦 An official xmake package repository

分支14Tags0
文件最后提交记录最后更新时间
Add packages.json manifest generator (draft for #9966) (#9967) * Add packages.json manifest generator (draft for #9966) Adds scripts/build_index.lua + a CI workflow that runs it on every push to master and publishes dist/packages.json to the gh-pages branch. The manifest is a flat, declarative view of the repository (name, version, description, license, homepage, repository_url, download_url per package), generated by reusing xmake's own package loader so no xmake.lua source parsing is involved. $(version) placeholders in URLs are resolved against the latest version, so all URLs in the output are concrete. Intended consumer: repology.org indexing, which is currently blocked on exactly this kind of structured source (see repology/repology-updater#1585 and the discussion in #9966). The schema is open for review — repository_url currently mirrors homepage, which works for the common case of a github.com URL but may need refinement. Sanity check on dev: generated dist/packages.json successfully for 1952 packages, 0 unresolved $(version) placeholders. Coverage gaps (~3% missing homepage, ~3% missing version, ~3% missing download_url) are real authoring gaps in individual packages, not bugs in the generator. * build_index: use semver-aware version sort String-sort on version keys ranks "1.10.0" before "1.2.0", so the "latest version" picked for ~122 packages was wrong (e.g. aws-c-common reported v0.9.3 instead of v0.12.6; aom 3.9.1 instead of 3.13.1). Switch to a semver-aware ascending sort using core.base.semver, matching the pattern already used in scripts/build_artifacts.lua. Falls back to string comparison for the small number of packages whose version strings are not valid semver (git refs, etc.). * build_index: derive repository_url from add_urls Mirror waruqi's suggestion in xmake-io/xmake-repo#9967 — instead of mirroring homepage (which is often a project site like https://abseil.io), walk add_urls and normalize the first forge-shaped entry to its bare <scheme>://<host>/<owner>/<repo> root. - /-/archive/ and trailing .git are unambiguous markers, accepted on any host (works for self-hosted GitLab and code.videolan.org). - /archive/, /releases/, /get/ are only stripped on known forge hosts to avoid false positives on tarball mirrors that happen to use those words as directory names (e.g. download.imagemagick.org/.../releases/). - Fall back to homepage only when the homepage itself is already a forge <owner>/<repo> URL. Result on current dev tip: 1689/1952 packages now have a repository_url (86.5%), of which 754 differ from homepage and now point at the actual repo (abseil → github.com/abseil/abseil-cpp, x264 → code.videolan.org/..., etc.). No emitted URL retains a .git suffix or an /archive/ path segment. The remaining 263 are packages whose add_urls points at a non-forge tarball mirror — fixing those requires either declaring an explicit repository field per package or adding a metadata-only field upstream. * build_index: rename output to repology_packages_index.json Per maintainer review on #9967 — since this index is Repology-specific, name the file accordingly. Publish target (gh-pages) is unchanged. * build_index: consolidate index workflow into sync.yml Per maintainer feedback on #9967 — drop the separate build-index.yml and append the build+publish step to sync.yml so a single CI cadence (hourly cron) covers both dev->master sync and the repology index update. Adds a sanity-check on the manifest count (>1000) so a broken generator run never publishes an empty or truncated index. Publishes via SSH (key already installed in sync.yml above), mirroring the deploy.yml pattern.13 天前
feat: add crashcatch library package (#10084) * feat: add crashcatch library package Add crashcatch package definition with xmake.lua configuration. This includes a cross-platform, lightweight, single-header crash-reporting library for modern C++ applications. - Set up package metadata including homepage, description and license - Add multiple version support (v1.0.0 to v1.4.0) - Configure platform-specific dependencies (pthread for linux, dbghelp/user32 for windows) - Implement install and test functions for the header-only library * fix(c/crashcatch): remove redundant 'v' prefix from version tags - Updated URL template to use 'v$(version)' instead of '$(version)' - Removed 'v' prefix from all version declarations to maintain consistency - This ensures proper tag matching with GitHub repository structure * feat(crashcatch): remove old version definitions and add platform restriction Removed deprecated version definitions for 1.0, 1.1.0, and 1.2 to clean up the package configuration. Added platform restriction "!macosx" to the on_install function to exclude macOS from the installation process. * fix(crashcatch): exclude android from install condition - Updated the on_install condition to exclude both android and macosx platforms - This prevents installation issues on android where dbghelp and user32 are not available * refactor(c/crashcatch): update test function to use check_cxxsnippets - Replace has_cxxtypes assertion with check_cxxsnippets - Add test snippet that includes CrashCatchDLL.hpp and calls crashcatch_enable() - Update language config to cxx1722 小时前
Fix repology_packages_index.json data correctness (#9966) (#10024) * Fix repology_packages_index.json data correctness (#9966) Addresses four issues raised by @AMDmi3 on #9966: 1. Strip alias prefix from version keys ("home:1.2.10" -> "1.2.10") 2. Apply add_urls(...) per-URL version filter when resolving $(version), so libthai, sqlite3, ace, tao_idl etc. produce working download URLs 3. Skip .git URLs for download_url; preserve them verbatim as repository_url with the .git suffix intact 4. Strip a leading "v" from emitted versions ("v0.1.30" -> "0.1.30") Also wraps per-package processing in try{}/catch{} so a broken filter or unparseable version in one xmake.lua can't abort the whole generator, and escapes % in the gsub replacement so URL templates returning URL-encoded payloads (e.g. ACE%2BTAO-...) don't trip the back-reference parser. Verified locally on dev tip: 1956 packages, 0 alias-prefixed versions, 0 .git in download_url, 0 unresolved \$(version), 0 v-prefixed versions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Detect "git://" scheme in _is_git_url Some GNU Savannah-hosted packages (autoconf) declare their git URL as git://host/path without a trailing ".git", so the previous check missed them. With this fix, autoconf gains the expected repository_url. Addresses gemini-code-assist review feedback on #10024. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>11 天前
add more templates (#9441) * add more templates * add raylib and sdl templates * improve linux driver2 个月前
add editorconfig file (#1947) 3 年前
Ignore the 'updated' file and change perms (#10082) Co-authored-by: qiumiaohan <qiumiaohan@baidu.com>2 天前
Update README and CONTRIBUTING (#8191) - correct links - fix a typo8 个月前
Ignore the 'updated' file and change perms (#10082) Co-authored-by: qiumiaohan <qiumiaohan@baidu.com>2 天前
Ignore the 'updated' file and change perms (#10082) Co-authored-by: qiumiaohan <qiumiaohan@baidu.com>2 天前
Ignore the 'updated' file and change perms (#10082) Co-authored-by: qiumiaohan <qiumiaohan@baidu.com>2 天前
Ignore the 'updated' file and change perms (#10082) Co-authored-by: qiumiaohan <qiumiaohan@baidu.com>2 天前

xmake-repo

一个官方的xmake包管理仓库

项目支持

通过成为赞助者来支持该项目。您的logo将显示在此处,并带有指向您网站的链接。🙏 [成为赞助商]

简介

xmake-repo是一个官方的xmake包管理仓库,收录了常用的c/c++开发包,提供跨平台支持。它同时也包含了官方的工程模板。

包依赖描述

包依赖管理

如果你想要了解更多,请参考:

Xrepo

xrepo 是一个基于 Xmake 的跨平台 C/C++ 包管理器。

它基于 xmake 提供的运行时,但却是一个完整独立的包管理程序,相比 vcpkg/homebrew 此类包管理器,xrepo 能够同时提供更多平台和架构的 C/C++ 包。

如果你想要了解更多,请参考:在线文档, Github 以及 Gitee

提交一个新包到仓库

packages/x/xxx/xmake.lua中写个关于新包的xmake.lua描述,然后提交一个pull-request到dev分支。

例如:packages/z/zlib/xmake.lua:

关于如何制作包的更详细描述,请参看文档:制作和提交到官方仓库

从 Github 创建一个包模板

我们需要先安装 gh cli 工具,然后执行下面的命令登入 github。

$ gh auth login

基于 github 的包地址创建一个包配置文件到此仓库。

$ xmake l scripts/new.lua github:glennrp/libpng
package("libpng")
    set_homepage("http://libpng.sf.net")
    set_description("LIBPNG: Portable Network Graphics support, official libpng repository")

    add_urls("https://github.com/glennrp/libpng/archive/refs/tags/$(version).tar.gz",
             "https://github.com/glennrp/libpng.git")
    add_versions("v1.6.35", "6d59d6a154ccbb772ec11772cb8f8beb0d382b61e7ccc62435bf7311c9f4b210")

    add_deps("cmake")

    on_install(function (package)
        local configs = {}
        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
        import("package.tools.cmake").install(package, configs)
    end)

    on_test(function (package)
        assert(package:has_cfuncs("foo", {includes = "foo.h"}))
    end)
packages/l/libpng/xmake.lua generated!

在本地测试一个包

$ xmake l scripts/test.lua --shallow -vD zlib
$ xmake l scripts/test.lua --shallow -vD -p iphoneos zlib
$ xmake l scripts/test.lua --shallow -vD -k shared -m debug zlib
$ xmake l scripts/test.lua --shallow -vD --runtimes=MD zlib

工程模板

此仓库也提供了 xmake create 的官方工程模板。

你可以使用这些模板快速创建新项目:

$ xmake create -l c++ -t console myproject

这些模板位于 templates 目录下。

项目介绍

📦 An official xmake package repository

定制我的领域

下载使用量

0

项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新

语言类型

Lua99.09%
Assembly0.25%
CMake0.23%
C++0.2%
C0.18%