### Install Packages using xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/getting_started.md Provides examples of installing packages using the xrepo command-line tool. This includes basic installation, specifying versions, targeting specific platforms and architectures, installing debug versions, dynamic libraries, and packages with specific configurations. ```console $ xrepo install zlib tbox ``` ```console $ xrepo install "zlib 1.2.x" $ xrepo install "zlib >=1.2.0" ``` ```console $ xrepo install -p iphoneos -a arm64 zlib $ xrepo install -p android [--ndk=/xxx] zlib $ xrepo install -p mingw [--mingw=/xxx] zlib $ xrepo install -p cross --sdk=/xxx/arm-linux-musleabi-cross zlib ``` ```console $ xrepo install -m debug zlib ``` ```console $ xrepo install -k shared zlib ``` ```console $ xrepo install -f "vs_runtime='MD'" zlib $ xrepo install -f "regex=true,thread=true" boost ``` ```console $ xrepo install brew::zlib $ xrepo install vcpkg::zlib $ xrepo install conan::zlib/1.2.11 ``` -------------------------------- ### Install Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Provides examples of installing packages using the `xrepo install` command. Covers basic installation, version-specific installation, platform-specific installation, debug builds, shared libraries, and custom build configurations. ```console xrepo install zlib tbox ``` ```console xrepo install "zlib 1.2.x" xrepo install "zlib >=1.2.0" ``` ```console xrepo install -p iphoneos -a arm64 zlib xrepo install -p android [--ndk=/xxx] zlib xrepo install -p mingw [--mingw=/xxx] zlib xrepo install -p cross --sdk=/xxx/arm-linux-musleabi-cross zlib ``` ```console xrepo install -m debug zlib ``` ```console xrepo install -k shared zlib ``` ```console xrepo install -f "vs_runtime='MD'" zlib xrepo install -f "regex=true,thread=true" boost ``` ```console xrepo install brew::zlib xrepo install vcpkg::zlib xrepo install conan::zlib/1.2.11 ``` -------------------------------- ### Install Package for Specific Platform with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Demonstrates how to install a package targeted for a specific platform and architecture. Includes examples for iOS, Android, MinGW, and cross-compilation toolchains. ```bash $ xrepo install -p iphoneos -a arm64 zlib $ xrepo install -p android [--ndk=/xxx] zlib $ xrepo install -p mingw [--mingw=/xxx] zlib $ xrepo install -p cross --sdk=/xxx/arm-linux-musleabi-cross zlib ``` -------------------------------- ### Install Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Basic command to install packages using xrepo. It fetches and installs specified packages and their dependencies. Supports installing multiple packages at once. ```bash $ xrepo install zlib tbox ``` -------------------------------- ### Install Package with Shared Library using xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Installs a package and ensures that dynamic (shared) libraries are preferred or installed. The `-k shared` flag indicates the desire for shared libraries. ```bash $ xrepo install -k shared zlib ``` -------------------------------- ### Install Specific Package Version with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Shows how to install a package with a specific version or a version range. This is useful for ensuring compatibility or using a particular release of a library. ```bash $ xrepo install "zlib 1.2.x" $ xrepo install "zlib >=1.2.0" ``` -------------------------------- ### Install Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Provides basic commands for installing packages using xrepo. It covers installing multiple packages, specifying version ranges, and installing packages for different platforms and build configurations. ```bash $ xrepo install zlib tbox $ xrepo install "zlib 1.2.x" $ xrepo install "zlib >=1.2.0" $ xrepo install -p iphoneos -a arm64 zlib $ xrepo install -p android [--ndk=/xxx] zlib $ xrepo install -p mingw [--mingw=/xxx] zlib $ xrepo install -p cross --sdk=/xxx/arm-linux-musleabi-cross zlib $ xrepo install -m debug zlib $ xrepo install -k shared zlib ``` -------------------------------- ### Install Package with Configuration Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Installs a specified package with configuration options. The `-f` flag allows specifying configuration parameters like version or build options. ```bash $ xrepo install -f "vs_runtime='MD'" zlib $ xrepo install -f "regex=true,thread=true" boost ``` -------------------------------- ### Install Debug Package with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Installs the debug version of a package. This is useful during development to include debugging symbols and enable debug builds. ```bash $ xrepo install -m debug zlib ``` -------------------------------- ### Show Package Information with xrepo info Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Displays detailed information about a specified package, including its description, version, download URLs, repository source, cache directory, installation path, build configurations, and supported platforms. ```shell $ xrepo info zlib ``` -------------------------------- ### Show Package Information with xrepo info Source: https://github.com/xmake-io/xrepo-docs/blob/master/getting_started.md Displays detailed information about a specified package, including its description, version, download URLs, repository, installation path, and platform compatibility. This command helps users understand package dependencies and configurations. ```console $ xrepo info zlib The package info of project: require(zlib): -> description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library -> version: 1.2.11 -> urls: -> http://zlib.net/zlib-1.2.11.tar.gz -> c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 -> https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz -> c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 -> repo: xmake-repo https://gitee.com/tboox/xmake-repo.git master -> cachedir: /Users/ruki/.xmake/cache/packages/2010/z/zlib/1.2.11 -> installdir: /Users/ruki/.xmake/packages/z/zlib/1.2.11/d639b7d6e3244216b403b39df5101abf -> searchdirs: -> searchnames: zlib-1.2.11.tar.gz -> fetchinfo: 1.2.11, system -> version: 1.2.11 -> links: z -> linkdirs: /usr/local/Cellar/zlib/1.2.11/lib -> includedirs: /usr/local/Cellar/zlib/1.2.11/include -> platforms: iphoneos, mingw@windows, macosx, mingw@linux, macosx, android@linux, macosx, windows, linux -> requires: -> plat: macosx -> arch: x86_64 -> configs: -> debug: false -> vs_runtime: MT -> shared: false -> configs: -> configs (builtin): -> debug: Enable debug symbols. (default: false) -> shared: Enable shared library. (default: false) -> cflags: Set the C compiler flags. -> cxflags: Set the C/C++ compiler flags. -> cxxflags: Set the C++ compiler flags. -> asflags: Set the assembler flags. -> vs_runtime: Set vs compiler runtime. (default: MT) -> values: {"MT","MD"} ``` -------------------------------- ### Install Package from Third-Party Managers Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Installs packages by referencing them from third-party package managers like brew, vcpkg, or conan. This allows seamless integration with external package ecosystems. ```bash $ xrepo install brew::zlib $ xrepo install vcpkg::zlib $ xrepo install conan::zlib/1.2.11 ``` -------------------------------- ### Fetch Package Library Information with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/getting_started.md Demonstrates how to use `xrepo fetch` to retrieve library linking information (include directories, library paths, defines, library names) for installed packages. This is crucial for integrating packages into build systems. ```console $ xrepo fetch pcre2 { { linkdirs = { "/usr/local/Cellar/pcre2/10.33/lib" }, links = { "pcre2-8" }, defines = { "PCRE2_CODE_UNIT_WIDTH=8" }, includedirs = "/usr/local/Cellar/pcre2/10.33/include" } } ``` ```console $ xrepo fetch --ldflags openssl -L/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/lib -lcrypto -lssl ``` ```console $ xrepo fetch --cflags openssl -I/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/include ``` ```console $ xrepo fetch -p [iphoneos|android] --cflags "zlib 1.2.x" -I/Users/ruki/.xmake/packages/z/zlib/1.2.11/df72d410e7e14391b1a4375d868a240c/include ``` ```console $ xrepo fetch --cflags --ldflags conan::zlib/1.2.11 -I/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/include -L/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/lib -lz ``` -------------------------------- ### Show Package Information with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Displays detailed information about a specified package, including its description, version, URLs, repository, cache directory, installation directory, and platform compatibility. Usage: `xrepo info `. ```console $ xrepo info zlib The package info of project: require(zlib): -> description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library -> version: 1.2.11 -> urls: -> http://zlib.net/zlib-1.2.11.tar.gz -> c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 -> https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz -> c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 -> repo: xmake-repo https://gitee.com/tboox/xmake-repo.git master -> cachedir: /Users/ruki/.xmake/cache/packages/2010/z/zlib/1.2.11 -> installdir: /Users/ruki/.xmake/packages/z/zlib/1.2.11/d639b7d6e3244216b403b39df5101abf -> searchdirs: -> searchnames: zlib-1.2.11.tar.gz -> fetchinfo: 1.2.11, system -> version: 1.2.11 -> links: z -> linkdirs: /usr/local/Cellar/zlib/1.2.11/lib -> includedirs: /usr/local/Cellar/zlib/1.2.11/include -> platforms: iphoneos, mingw@windows, macosx, mingw@linux,macosx, android@linux,macosx, windows, linux -> requires: -> plat: macosx -> arch: x86_64 -> configs: -> debug: false -> vs_runtime: MT -> shared: false -> configs: -> configs (builtin): -> debug: Enable debug symbols. (default: false) -> shared: Enable shared library. (default: false) -> cflags: Set the C compiler flags. -> cxflags: Set the C/C++ compiler flags. -> cxxflags: Set the C++ compiler flags. -> asflags: Set the assembler flags. -> vs_runtime: Set vs compiler runtime. (default: MT) -> values: {"MT","MD"} ``` -------------------------------- ### Fetch Package Library Information with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Demonstrates how to use `xrepo fetch` to retrieve library linking information (include directories, library directories, libraries, defines) for installed packages. Supports fetching specific flags like `--cflags` and `--ldflags`. ```console xrepo fetch pcre2 ``` ```console xrepo fetch --ldflags openssl ``` ```console xrepo fetch --cflags openssl ``` ```console xrepo fetch -p [iphoneos|android] --cflags "zlib 1.2.x" ``` ```console xrepo fetch --cflags --ldflags conan::zlib/1.2.11 ``` -------------------------------- ### Export Installed Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Exports installed packages along with their library and header files to a specified directory. Usage: `xrepo export -o `. ```console $ xrepo export -o /tmp/output zlib ``` -------------------------------- ### Import Installed Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Imports a previously exported installation package to another machine for package migration. Usage: `xrepo import -i `. ```console $ xrepo import -i /xxx/packagedir zlib ``` -------------------------------- ### Download Package Source Code with xrepo download Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Downloads the source code of a specified package without installing it. The download location can be customized using the '-o' flag. ```shell $ xrepo download zlib ``` ```shell $ xrepo download "zlib 2.x" ``` ```shell $ xrepo download -o /tmp zlib ``` -------------------------------- ### Show Package Environment Information Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Displays the environment variables associated with a specific package installation. This can include paths, library locations, and other relevant settings. ```bash $ xrepo env --show luajit ``` -------------------------------- ### Batch Uninstall Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Removes all installed packages or specific packages using pattern matching. The `--all` flag can be used to uninstall everything. ```shell xrepo remove --all ``` ```shell xrepo remove --all zlib pcr* ``` -------------------------------- ### Show Package Information with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Displays detailed information about a specified package, including its description, version, download URLs, repository, cache directory, installation directory, and platform compatibility. It also shows build configurations and requirements. ```shell xrepo info zlib ``` -------------------------------- ### Uninstall Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Uninstalls and deletes installed packages, supporting batch operations and pattern matching. Usage: `xrepo remove --all [...]`. ```bash $ xrepo remove --all ``` ```bash $ xrepo remove --all zlib pcr* ``` -------------------------------- ### Load Toolchain Environment in xmake.lua Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Configures and loads a specific toolchain environment within xmake.lua, such as the MSVC (Microsoft Visual C++) compiler. This example shows setting the toolchain for builds. ```lua set_toolchains("msvc") ``` -------------------------------- ### Quick Switching of Temporary Virtual Environments Source: https://github.com/xmake-io/xrepo-docs/blob/master/getting_started.md Enables quick switching to temporary virtual environments by specifying a list of packages directly on the command line without requiring configuration files. Includes commands to enter, run tools, and exit these temporary environments. ```console $ xrepo env -b "python 3.x,luajit,cmake" shell [python,luajit,cmake] $ python --version Python 3.10.6 [python,luajit,cmake] $ cmake --version cmake version 3.25.3 ``` ```console [python,luajit,cmake] $ xrepo env quit $ ``` -------------------------------- ### Search Supported Packages Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Searches for packages in the configured repositories. Supports wildcard matching for package names. ```bash $ xrepo search zlib "pcr*" zlib: -> zlib: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (in xmake-repo) pcr*: -> pcre2: A Perl Compatible Regular Expressions Library (in xmake-repo) -> pcre: A Perl Compatible Regular Expressions Library (in xmake-repo) ``` -------------------------------- ### Enter Package Virtual Environment Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Enters a virtual environment defined by packages specified in xmake.lua or on the command line. Allows executing commands within that environment. ```bash $ xrepo env shell > python --version > luajit --version set_toolchains("msvc") ``` -------------------------------- ### Manage Global Virtual Environments Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Registers, lists, and removes global virtual environment configurations. These can be quickly switched or bound to commands. ```bash $ xrepo env --add /tmp/base.lua $ xrepo env --list /Users/ruki/.xmake/envs: -base envs(1) found! $ xrepo env --remove base ``` -------------------------------- ### Switch and Bind Virtual Environments Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Switches to a registered global virtual environment or binds a temporary environment specified by a list of packages to execute commands. ```bash $ xrepo env -b base shell > python --version $ xrepo env -b base python --version $ xrepo env -b "python 3.x,luajit,cmake" shell [python,luajit,cmake] $ python --version Python 3.10.6 [python,luajit,cmake] $ cmake --version cmake version 3.25.3 [python,luajit,cmake] $ xrepo env quit $ ``` -------------------------------- ### Search Packages in xmake-repo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Searches for packages within the xmake-repo repository using wildcard patterns. Displays package names and brief descriptions. ```bash $ xrepo search zlib "pcr*" ``` -------------------------------- ### Fetch Package Library Information Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Retrieves detailed library information for a package, including link directories, libraries, defines, and include directories. Can fetch specific flags like --ldflags or --cflags. ```bash $ xrepo fetch pcre2 { { linkdirs = { "/usr/local/Cellar/pcre2/10.33/lib" }, links = { "pcre2-8" }, defines = { "PCRE2_CODE_UNIT_WIDTH=8" }, includedirs = "/usr/local/Cellar/pcre2/10.33/include" } } $ xrepo fetch --ldflags openssl -L/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/lib -lcrypto -lssl $ xrepo fetch --cflags openssl -I/Users/ruki/.xmake/packages/o/openssl/1.1.1/d639b7d6e3244216b403b39df5101abf/include $ xrepo fetch -p [iphoneos|android] --cflags "zlib 1.2.x" -I/Users/ruki/.xmake/packages/z/zlib/1.2.11/df72d410e7e14391b1a4375d868a240c/include $ xrepo fetch --cflags --ldflags conan::zlib/1.2.11 -I/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/include -L/Users/ruki/.conan/data/zlib/1.2.11/_/_/package/f74366f76f700cc6e991285892ad7a23c30e6d47/lib -lz ``` -------------------------------- ### Load Package Environment and Run Commands with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Loads the environment for a specified package and executes commands within that environment. Supports specifying target platforms and package versions. Usage: `xrepo env ` or `xrepo env -p -b "" `. ```console $ xrepo env luajit LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/ JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse > ``` ```console $ xrepo env -b "luajit 2.x" luajit ``` ```console $ xrepo env -p iphoneos -b "zlib,libpng,luajit 2.x" cmake .. ``` -------------------------------- ### Switch Global Virtual Environment with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/getting_started.md Allows switching between globally registered virtual environments. This can be done by binding an environment to the shell or directly executing commands within a specified environment. ```console $ xrepo env -b base shell > python --version ``` ```console $ xrepo env -b base python --version ``` -------------------------------- ### Fetch Library Information (JSON) Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Fetches detailed information about a package, including library directories, linked libraries, defines, and include directories. The output is typically in a JSON-like format. ```bash $ xrepo fetch pcre2 ``` -------------------------------- ### Fetch Flags from Third-Party Package Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Fetches compiler and linker flags for a package managed by a third-party package manager like conan. Demonstrates cross-platform and cross-manager compatibility. ```bash $ xrepo fetch --cflags --ldflags conan::zlib/1.2.11 ``` -------------------------------- ### Search Packages from Third-Party Managers Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Searches for packages available through third-party package managers like vcpkg and conan. Allows querying external package databases using familiar xrepo syntax. ```bash $ xrepo search vcpkg::pcre $ xrepo search conan::openssl ``` -------------------------------- ### Configure xrepo Docsify Options Source: https://github.com/xmake-io/xrepo-docs/blob/master/index.html Sets up various configurations for the Docsify documentation generator, including repository links, navigation, markdown rendering, aliases for multi-language support, search functionality, and plugin integrations. ```javascript window.$docsify = { name: 'xrepo', repo: 'https://github.com/xmake-io/xrepo', auto2top: true, executeScript: true, loadSidebar: true, loadNavbar: true, mergeNavbar: true, notFoundPage: true, maxLevel: 6, subMaxLevel: 4, onlyCover: false, coverpage: ['/', '/zh-cn/'], markdown: { renderer: { image: function(href, title) { return `` } } }, alias: { '/zh-cn/(^[^_].*$)': '/zh-cn/$1', '/(?!zh-cn).*\/_navbar.md': '/_navbar.md', '/(?!zh-cn).*\/_sidebar.md': '/_sidebar.md', '/zh-cn/.*\/_navbar.md': '/zh-cn/_navbar.md', '/zh-cn/.*\/_sidebar.md': '/zh-cn/_sidebar.md' }, search: { maxAge: 86400000, paths: '/packages', placeholder: { '/zh-cn/': '搜索包', '/': 'Type to search package' }, noData: { '/zh-cn/': '找不到结果', '/': 'No Results' }, depth: 6, namespace: 'xrepo.xmake.io', hideOtherSidebarContent: false, pathNamespaces: ['/zh-cn'] }, formatUpdated: '{MM}/{DD} {HH}:{mm}', plugins: [ function (hook, vm) { hook.beforeEach(function (html) { if (/githubusercontent\.com/.test(vm.route.file)) { url = vm.route.file.replace('raw.githubusercontent.com', 'github.com').replace(/\/master/, '/blob/master') } else { url = 'https://github.com/xmake-io/xrepo-docs/blob/master/' + vm.route.file } var editHtml = '[:memo: Edit Document](' + url + ')\n' var wwads = '' var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if (isMobile) { wwads += '\n\n----\n\n'; wwads += '
'; } else { wwads += '
'; } return editHtml + html + wwads + '\n\n----\n\n' + 'Copyright (c) 2015-present tboox.org' }); hook.doneEach(function () { var panel = document.getElementById('wwads-panel'); var cover = document.querySelector('.cover'); var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if (!isMobile && cover && !cover.checkVisibility()) { panel.style.bottom = '20px'; panel.style.right = '20px'; panel.style.width = '200px'; panel.style.height = '260px'; panel.style.position = 'fixed'; panel.style.background = '#fff'; panel.style.boxShadow = '0 0 5px rgba(0, 0, 0, 0)'; panel.innerHTML = '

'; } else { panel.style.display = 'none'; } }); }, DocsifyCarbon.create('CE7I52QU', 'xmakeio') ] } ``` -------------------------------- ### Load Package Environment and Execute Command Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Loads the environment for a specified package and then executes a command within that context. Useful for running tools or scripts that depend on the package's environment. ```bash $ xrepo env luajit $ xrepo env -b "luajit 2.x" luajit $ xrepo env -p iphoneos -b "zlib,libpng,luajit 2.x" cmake .. ``` -------------------------------- ### Enter Package Shell Environment with xmake.lua Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Enters a shell environment configured with specified packages defined in an xmake.lua file. Allows interactive testing and execution of commands with package dependencies. ```lua add_requires("zlib 1.2.11") add_requires("python 3.x", "luajit") ``` ```bash $ xrepo env shell > python --version > luajit --version ``` -------------------------------- ### Show Package Environment Information with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Displays the environment variables and paths associated with a specific package. Usage: `xrepo env --show `. ```console $ xrepo env --show luajit { OLDPWD = "/mnt/tbox", HOME = "/home/ruki", PATH = "/home/ruki/.xmake/packages/l/luajit/2.1.0-beta3/fbac76d823b844f0b91abf3df0a3bc61/bin:/tmp:/tmp/arm-linux-musleabi-cross/bin:~/.local/bin: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", TERM = "xterm", PWD = "/mnt/xmake", XMAKE_PROGRAM_DIR = "/mnt/xmake/xmake", HOSTNAME = "e6edd61ff1ab", LD_LIBRARY_PATH = "/home/ruki/.xmake/packages/l/luajit/2.1.0-beta3/fbac76d823b844f0b91abf3df0a3bc61/lib", SHLVL = "1", _ = "/mnt/xmake/scripts/xrepo.sh" } ``` -------------------------------- ### Search Supported Packages with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Searches for supported packages, including those from third-party package managers like vcpkg, conan, conda, and apt. Supports pattern matching. Usage: `xrepo search ` or `xrepo search ::`. ```console $ xrepo search zlib "pcr*" zlib: -> zlib: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (in xmake-repo) pcr*: -> pcre2: A Perl Compatible Regular Expressions Library (in xmake-repo) -> pcre: A Perl Compatible Regular Expressions Library (in xmake-repo) ``` ```console $ xrepo search vcpkg::pcre The package names: vcpkg::pcre: -> vcpkg::pcre-8.44#8: Perl Compatible Regular Expressions -> vcpkg::pcre2-10.35#2: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library ``` ```console $ xrepo search conan::openssl The package names: conan::openssl: -> conan::openssl/1.1.1g: -> conan::openssl/1.1.1h: ``` -------------------------------- ### Enter Package Shell Environment with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Enters a shell environment configured for specific packages, allowing execution of commands within that context. Customizations can be made via xmake.lua. Usage: `xrepo env shell`. ```lua add_requires("zlib 1.2.11") add_requires("python 3.x", "luajit") ``` ```console $ xrepo env shell > python --version > luajit --version ``` ```lua set_toolchains("msvc") ``` -------------------------------- ### Add Custom Repository with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Demonstrates how to add a custom repository to xrepo, allowing for the management of private or alternative package sources. This is useful for isolating package management within an internal network. ```bash $ xrepo add-repo myrepo https://github.com/mygroup/myrepo ``` -------------------------------- ### Add Custom Repository with xrepo Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Demonstrates how to add a custom repository to xrepo, allowing for the management of private or alternative package sources. This is useful for isolating packages within an internal network. ```console xrepo add-repo myrepo https://github.com/mygroup/myrepo ``` -------------------------------- ### Integrate xrepo Packages in xmake Source: https://github.com/xmake-io/xrepo-docs/blob/master/README.md Shows how to declare and use external C/C++ packages within an xmake project file using `add_requires` and `add_packages`. It supports version specifiers, aliases, optional dependencies, and integration with other package managers. ```lua add_requires("tbox >1.6.1", "libuv master", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8") add_requires("conan::openssl/1.1.1g", {alias = "openssl", optional = true, debug = true}) target("test") set_kind("binary") add_files("src/*.c") add_packages("tbox", "libuv", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8", "openssl") ``` -------------------------------- ### Define Package Requirements in xmake.lua Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/getting_started.html Specifies package dependencies within an xmake.lua file, enabling custom build environments. ```lua add_requires("zlib 1.2.11") add_requires("python 3.x", "luajit") ``` -------------------------------- ### Fetch Library Compiler Flags Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Retrieves the compiler flags (e.g., -I flags) needed to include package headers. Essential for ensuring the compiler can find package-specific header files. ```bash $ xrepo fetch --cflags openssl $ xrepo fetch -p [iphoneos|android] --cflags "zlib 1.2.x" ``` -------------------------------- ### Fetch Library Linker Flags Source: https://github.com/xmake-io/xrepo-docs/blob/master/mirror/index.html Retrieves the linker flags (e.g., -L and -l flags) required to link a package. This is useful for manual build configurations or when not using xmake's automatic linking. ```bash $ xrepo fetch --ldflags openssl ```