{"id":16867117,"url":"https://github.com/leleliu008/xcpkg","last_synced_at":"2025-03-17T05:32:46.943Z","repository":{"id":65552807,"uuid":"281736318","full_name":"leleliu008/xcpkg","owner":"leleliu008","description":"A package builder/manager for Xcode to build projects written in C, C++, Rust, Zig, Go, etc.","archived":false,"fork":false,"pushed_at":"2024-05-21T13:02:03.000Z","size":1138,"stargazers_count":20,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-22T11:25:50.944Z","etag":null,"topics":["c","cli","cxx","package-manager","rust","xcode"],"latest_commit_sha":null,"homepage":"http://blog.fpliu.com/project/xcpkg","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leleliu008.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-22T17:03:15.000Z","updated_at":"2024-06-06T08:40:17.688Z","dependencies_parsed_at":"2023-11-30T04:26:20.474Z","dependency_job_id":"812de6c9-7fcf-4524-a465-1d7f9781a7cd","html_url":"https://github.com/leleliu008/xcpkg","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leleliu008%2Fxcpkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leleliu008%2Fxcpkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leleliu008%2Fxcpkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leleliu008%2Fxcpkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leleliu008","download_url":"https://codeload.github.com/leleliu008/xcpkg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846978,"owners_count":20357297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cli","cxx","package-manager","rust","xcode"],"created_at":"2024-10-13T14:52:57.383Z","updated_at":"2025-03-17T05:32:46.936Z","avatar_url":"https://github.com/leleliu008.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xcpkg\n\nA package builder/manager for [Xcode](https://developer.apple.com/xcode) to build projects written in C, C++, Rust, Zig, Go, etc.\n\n## Caveats\n\n- This software is being actively developed. It's in beta stage and may not be stable. Some features are subject to change without notice.\n\n- Please do NOT place your own files under `~/.xcpkg` directory, as `xcpkg` will change files under `~/.xcpkg` directory without notice.\n\n- Please do NOT run `xcpkg` command in parallel so as not to generate dirty data.\n\n## Using xcpkg via GitHub Actions\n\nIn this way, you will be liberated from the rut of setting up the build environment.\n\nIn this way, all you need to do is just clicking the buttons and waiting for finishing. After finishing, a url refers to a zip archive will be provided to download.\n\nFor more details please refer to \u003chttps://github.com/leleliu008/xcpkg-package-manually-build\u003e\n\n## Install xcpkg via cURL\n\n```bash\ncurl -LO https://raw.githubusercontent.com/leleliu008/xcpkg/master/xcpkg\nchmod a+x xcpkg\n./xcpkg setup\n```\n\n## Install xcpkg via wget\n\n```bash\nwget https://cdn.jsdelivr.net/gh/leleliu008/xcpkg/xcpkg\nchmod a+x xcpkg\n./xcpkg setup\n```\n\n## Install xcpkg via git\n\n```bash\ngit clone --depth 1 https://github.com/leleliu008/xcpkg\nxcpkg/xcpkg setup\n```\n\n## ~/.xcpkg\n\nall relevant directories and files are located under `~/.xcpkg` directory.\n\n## xcpkg command usage\n\n- **show help of this command**\n\n    ```bash\n    xcpkg -h\n    xcpkg --help\n    ```\n\n- **show version of this command**\n\n    ```bash\n    xcpkg -V\n    xcpkg --version\n    ```\n\n- **show basic information about this software**\n\n    ```bash\n    xcpkg about\n    ```\n\n- **show basic information about your current running operation system**\n\n    ```bash\n    xcpkg sysinfo\n    ```\n\n- **show your current activated [Xcode](https://developer.apple.com/xcode) information**\n\n    ```bash\n    xcpkg xcinfo\n    ```\n\n- **show the given [Xcode](https://developer.apple.com/xcode) information**\n\n    ```bash\n    xcpkg xcinfo /Applications/Xcode12.app/Contents/Developer\n    ```\n\n- **generate url-transform sample**\n\n    ```bash\n    xcpkg gen-url-transform-sample\n    ```\n\n- **install essential tools**\n\n    ```bash\n    xcpkg setup\n    ```\n\n    This command is actually to do two things:\n\n  - install [uppm](https://github.com/leleliu008/uppm) to `~/.xcpkg/core`\n  - install other essential tools (listed below) that are used by this shell script via [uppm](https://github.com/leleliu008/uppm)\n\n    - [GNU Bash](https://www.gnu.org/software/bash/manual/bash.html)\n    - [GNU CoreUtils](https://www.gnu.org/software/coreutils/manual/coreutils.html)\n    - [GNU FindUtils](https://www.gnu.org/software/findutils/manual/html_mono/find.html)\n    - [GNU awk](https://www.gnu.org/software/gawk/manual/gawk.html)\n    - [GNU sed](https://www.gnu.org/software/sed/manual/sed.html)\n    - [GNU grep](https://www.gnu.org/software/grep/manual/grep.html)\n    - [BSD tar](https://man.archlinux.org/man/core/libarchive/bsdtar.1.en)\n    - [tree](https://linux.die.net/man/1/tree)\n    - [curl](https://curl.se/docs/manpage.html)\n    - [git](https://git-scm.com/docs/git)\n    - [jq](https://stedolan.github.io/jq/manual/)\n    - [yq](https://mikefarah.gitbook.io/yq/)\n    - [d2](https://github.com/terrastruct/d2)\n    - [dot](https://graphviz.org/doc/info/command.html)\n    - [fzf](https://github.com/junegunn/fzf)\n    - [bat](https://github.com/sharkdp/bat)\n\n- **integrate `zsh-completion` script**\n\n    ```bash\n    xcpkg integrate zsh\n    xcpkg integrate zsh --output-dir=/usr/local/share/zsh/site-functions\n    xcpkg integrate zsh -v\n    ```\n\n    This project provides a zsh-completion script for `xcpkg`. when you've typed `xcpkg` then type `TAB` key, the rest of the arguments will be automatically complete for you.\n\n    **Note**: to apply this feature, you may need to run the command `autoload -U compinit \u0026\u0026 compinit` in your terminal (your current running shell must be zsh).\n\n- **update all available formula repositories**\n\n    ```bash\n    xcpkg update\n    ```\n\n- **search all available packages whose name matches the given regular expression pattern**\n\n    ```bash\n    xcpkg search curl\n    xcpkg search curl -v\n    xcpkg search '^lib'\n    ```\n\n- **show information of the given available package**\n\n    ```bash\n    xcpkg info-available curl\n    xcpkg info-available curl --yaml\n    xcpkg info-available curl --json\n    xcpkg info-available curl version\n    xcpkg info-available curl license\n    xcpkg info-available curl summary\n    xcpkg info-available curl web-url\n    xcpkg info-available curl git-url\n    xcpkg info-available curl git-sha\n    xcpkg info-available curl git-ref\n    xcpkg info-available curl src-url\n    xcpkg info-available curl src-sha\n    ```\n\n- **show information of the given installed package**\n\n    ```bash\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl --prefix\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl --files\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl --yaml\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl --json\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl version\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl license\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl summary\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl web-url\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl git-url\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl git-sha\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl git-ref\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl src-url\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl src-sha\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl builtat\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl builtat-iso-8601\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl builtat-rfc-3339\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl builtat-iso-8601-utc\n    xcpkg info-installed iPhoneOS-12.0-arm64/curl builtat-rfc-3339-utc\n    ```\n\n- **show packages that are depended by the given package**\n\n    ```bash\n    xcpkg depends curl\n\n    xcpkg depends curl -t d2\n    xcpkg depends curl -t dot\n    xcpkg depends curl -t box\n    xcpkg depends curl -t png\n    xcpkg depends curl -t svg\n\n    xcpkg depends curl -t d2  -o dependencies/\n    xcpkg depends curl -t dot -o dependencies/\n    xcpkg depends curl -t box -o dependencies/\n    xcpkg depends curl -t png -o dependencies/\n    xcpkg depends curl -t svg -o dependencies/\n\n    xcpkg depends curl -o curl-dependencies.d2\n    xcpkg depends curl -o curl-dependencies.dot\n    xcpkg depends curl -o curl-dependencies.box\n    xcpkg depends curl -o curl-dependencies.png\n    xcpkg depends curl -o curl-dependencies.svg\n    ```\n\n- **download resources of the given package to the local cache**\n\n    ```bash\n    xcpkg fetch curl\n    xcpkg fetch curl -v\n    ```\n\n- **install packages**\n\n    ```bash\n    xcpkg install curl\n    xcpkg install curl -U\n    xcpkg install curl --target=iPhoneOS-12.0-arm64\n    xcpkg install curl --developer-dir=/Applications/Xcode12.app/Contents/Developer\n    xcpkg install iPhoneOS-12.0-arm64/curl\n    ```\n\n- **reinstall packages**\n\n    ```bash\n    xcpkg reinstall curl\n    xcpkg reinstall iPhoneOS-12.0-arm64/curl\n    ```\n\n- **uninstall packages**\n\n    ```bash\n    xcpkg uninstall curl\n    xcpkg uninstall iPhoneOS-12.0-arm64/curl\n    ```\n\n- **upgrade the outdated packages**\n\n    ```bash\n    xcpkg upgrade\n    xcpkg upgrade curl\n    xcpkg upgrade iPhoneOS-12.0-arm64/curl\n    ```\n\n- **upgrade this software**\n\n    ```bash\n    xcpkg upgrade-self\n    xcpkg upgrade-self -v\n    ```\n\n- **list all available formula repositories**\n\n    ```bash\n    xcpkg formula-repo-list\n    ```\n\n- **add a new formula repository**\n\n    ```bash\n    xcpkg formula-repo-add my_repo https://github.com/leleliu008/xcpkg-formula-repository-my_repo\n    xcpkg formula-repo-add my_repo https://github.com/leleliu008/xcpkg-formula-repository-my_repo master\n    xcpkg formula-repo-add my_repo https://github.com/leleliu008/xcpkg-formula-repository-my_repo main\n    ```\n\n- **delete a existing formula repository**\n\n    ```bash\n    xcpkg formula-repo-del my_repo\n    ```\n\n- **check if the given package is available**\n\n    ```bash\n    xcpkg is-available curl\n    ```\n\n- **check if the given package is installed**\n\n    ```bash\n    xcpkg is-installed curl\n    xcpkg is-installed iPhoneOS-12.0-arm64/curl\n    ```\n\n- **check if the given package is outdated**\n\n    ```bash\n    xcpkg is-outdated  curl\n    xcpkg is-outdated  iPhoneOS-12.0-arm64/curl\n    ```\n\n- **list all available packages**\n\n    ```bash\n    xcpkg ls-available\n    xcpkg ls-available -v\n    ```\n\n- **list all installed packages**\n\n    ```bash\n    xcpkg ls-installed\n    xcpkg ls-installed -v\n    ```\n\n- **list all outdated packages**\n\n    ```bash\n    xcpkg ls-outdated\n    xcpkg ls-outdated -v\n    ```\n\n- **list installed files of the given installed package in a tree-like format**\n\n    ```bash\n    xcpkg tree curl\n    xcpkg tree iPhoneOS-12.0-arm64/curl -L 3\n    ```\n\n- **show logs of the given installed package**\n\n    ```bash\n    xcpkg logs curl\n    xcpkg logs iPhoneOS-12.0-arm64/curl\n    ```\n\n- **bundle the given installed package into a single archive file**\n\n    ```bash\n    xcpkg bundle iPhoneOS-12.0-arm64/curl .tar.xz\n    xcpkg bundle iPhoneOS-12.0-arm64/curl .tar.gz\n    xcpkg bundle iPhoneOS-12.0-arm64/curl .tar.lz\n    xcpkg bundle iPhoneOS-12.0-arm64/curl .tar.bz2\n    xcpkg bundle iPhoneOS-12.0-arm64/curl .zip\n    xcpkg bundle iPhoneOS-12.0-arm64/curl a/.zip\n    xcpkg bundle iPhoneOS-12.0-arm64/curl a/x.zip\n    ```\n\n- **delete the unused cached files**\n\n    ```bash\n    xcpkg cleanup\n    ```\n\n## influential environment variables\n\n- **HOME**\n\n    This environment variable already have been set on macOS, if not set or set a empty string, you will receive an error message.\n\n- **PATH**\n\n    This environment variable already have been set on macOS, if not set or set a empty string, you will receive an error message.\n\n- **DEVELOPER_DIR**\n\n    If this environment variable is set, `xcpkg` will use it as the Xcode developer dir, otherwise, `xcpkg` will run command `xcode-select -p` to determine the Xcode developer dir.\n\n- **SSL_CERT_FILE**\n\n    ```bash\n    curl -LO https://curl.se/ca/cacert.pem\n    export SSL_CERT_FILE=\"$PWD/cacert.pem\"\n    ```\n\n    In general, you don't need to set this environment variable, but, if you encounter the reporting `the SSL certificate is invalid`, trying to run above commands in your terminal will do the trick.\n\n- **GOPROXY**\n\n    ```bash\n    export GOPROXY='https://goproxy.cn'\n    ```\n\n- **XCPKG_HOME**\n\n    If this environment variable is not set or set a empty string, `$HOME/.xcpkg` will be used as the default value.\n\n    ```bash\n    export XCPKG_HOME=$HOME/xcpkg-home\n    ```\n\n- **XCPKG_URL_TRANSFORM**\n\n    ```bash\n    export XCPKG_URL_TRANSFORM=/path/of/url-transform\n    ```\n\n    `/path/of/url-transform` command would be invoked as `/path/of/url-transform \u003cURL\u003e`\n\n    `/path/of/url-transform` command must output a `\u003cURL\u003e`\n\n    you can generate a url-transform sample via `xcpkg gen-url-transform-sample`\n\n    If you want to change the request url, you can set this environment variable. It is very useful for chinese users.\n\n- **XCPKG_XTRACE**\n\n    for debugging purposes.\n\n    enables `set -x`:\n\n    ```bash\n    export XCPKG_XTRACE=1\n    ```\n\n- **XCPKG_DEFAULT_TARGET**\n\n    Some ACTIONs of xcpkg are associated with an installed package which need `PACKAGE-SPEC` to be specified.\n\n    **PACKAGE-SPEC** : a formatted string that has form: `\u003cTARGET-PLATFORM\u003e/\u003cPACKAGE-NAME\u003e`, represents an installed package.\n\n    **PACKAGE-NAME** : should match the regular expression pattern `^[A-Za-z0-9+-_.@]{1,50}$`\n\n    **TARGET-PLATFORM** : a formatted string that has form: `\u003cTARGET-PLATFORM-NAME\u003e-\u003cTARGET-PLATFORM-VERSION\u003e-\u003cTARGET-PLATFORM-ARCH\u003e`\n\n    **TARGET-PLATFORM-ARCH** : indicates which cpu arch was built for. value might be any one of `x86_64` `arm64`, etc\n\n    **TARGET-PLATFORM-NAME** : indicates which platform name was built for. value shall be any one of `AppleTVOS` `AppleTVSimulator` `DriverKit` `MacOSX` `WatchOS` `WatchSimulator` `iPhoneOS` `iPhoneSimulator`\n\n    **TARGET-PLATFORM-VERSION** : indicates which platform version was built with.\n\n    To simplify the usage, you are allowed to omit `\u003cTARGET-PLATFORM\u003e/`. If `\u003cTARGET-PLATFORM\u003e/` is omitted, environment variable `XCPKG_DEFAULT_TARGET` would be checked, if this environment variable is not set, then your current running platform target will be used as the default.\n\n    **Example**:\n\n    ```bash\n    export XCPKG_DEFAULT_TARGET=MacOSX-10.15-x86_64\n    ```\n\n## environment variables unset by this software\n\n|ENV|used by|\n|-|-|\n|`SDKROOT`|`clang` `clang++`|\n|`MACOSX_DEPLOYMENT_TARGET`|`clang` `clang++`|\n|`WATCHOS_DEPLOYMENT_TARGET`|`clang` `clang++`|\n|`IPHONEOS_DEPLOYMENT_TARGET`|`clang` `clang++`|\n|`TARGET_ARCH`|`gmake`|\n\n## environment variables overridden by this software\n\n|ENV|used by|\n|-|-|\n|`CC`|`configure`|\n|`CXX`|`configure`|\n|`CPP`|`configure`|\n|`AS`|`configure`|\n|`AR`|`configure`|\n|`LD`|`configure`|\n|`CFLAGS`|`configure`|\n|`CXXFLAGS`|`configure`|\n|`CPPFLAGS`|`configure`|\n|`LDFLAGS`|`configure`|\n|`LIBS`|`configure`|\n|||\n|`CMAKE_GENERATOR`|`cmake`|\n|`CMAKE_BUILD_PARALLEL_LEVEL`|`cmake`|\n|`CMAKE_EXPORT_COMPILE_COMMANDS`|`cmake`|\n|||\n|`RUST_BACKTRACE`|`cargo`|\n|`RUSTFLAGS`|`cargo`|\n|`CARGO_BUILD_JOBS`|`cargo`|\n|`CARGO_BUILD_TARGET`|`cargo`|\n|`CARGO_BUILD_TARGET_DIR`|`cargo`|\n|||\n|`CGO_ENABLED`|`go`|\n|`CGO_CFLAGS`|`go`|\n|`CGO_CXXFLAGS`|`go`|\n|`CGO_CPPFLAGS`|`go`|\n|`CGO_LDFLAGS`|`go`|\n|`GO111MODULE`|`go`|\n|`GOOS`|`go`|\n|`GOARCH`|`go`|\n|||\n|`PKG_CONFIG_LIBDIR`|`pkg-config`|\n|`PKG_CONFIG_PATH`|`pkg-config`|\n|`PKG_CONFIG_DEBUG_SPEW`|`pkg-config`|\n|||\n|`ACLOCAL_PATH`|`aclocal`|\n|`XDG_DATA_DIRS`|`g-ir-scanner`|\n|`XML_CATALOG_FILES`|`xsltproc`|\n|`PERL_MM_USE_DEFAULT`|`cpan`|\n|`BAT_THEME`|`bat`|\n|`IFS`|`shell`|\n\n## xcpkg formula scheme\n\na xcpkg formula is a [YAML](https://yaml.org/spec/1.2.2/) format file which is used to config a xcpkg package's meta-information including one sentence description, package version, installation instructions, etc.\n\na xcpkg formula's filename suffix must be `.yml`\n\na xcpkg formula'a filename prefix would be treated as the package name.\n\na xcpkg formula'a filename prefix must match regular expression pattern `^[A-Za-z0-9+-._@]{1,50}$`\n\na xcpkg formula's file content only has one level mapping and shall has following KEY:\n\n|KEY|required?|overview|\n|-|-|-|\n|`pkgtype`|optional|indicates what type of this package. value shall be any one of `exe`, `lib`, `exe+lib`.\u003cbr\u003eIf this mapping is not present, `xcpkg` will determine the package type by package name, if a package name starts/ends with `lib`, it would be recognized as type `lib`, otherwise, it would be recognized as type `exe`|\n|`summary`|required|describe this package in one sentence.|\n|`license`|optional|a space-separated list of [SPDX license short identifiers](https://spdx.github.io/spdx-spec/v2.3/SPDX-license-list/#a1-licenses-with-short-identifiers)|\n|`version`|optional|the version of this package.\u003cbr\u003eIf this mapping is not present, it will be calculated from `src-url`, if `src-url` is also not present, it will be calculated from running time as format `date +%Y.%m.%d`|\n||||\n|`web-url`|optional|the home webpage of this package.\u003cbr\u003eIf this mapping is not present, `git-url` must be present.|\n||||\n|`git-url`|optional|the source code git repository.\u003cbr\u003eIf `src-url` is not present, this mapping must be present.|\n|`git-ref`|optional|reference: \u003chttps://git-scm.com/book/en/v2/Git-Internals-Git-References\u003e \u003cbr\u003eexample values: `HEAD` `refs/heads/master` `refs/heads/main` `refs/tags/v1`, default value is `HEAD`|\n|`git-sha`|optional|the full git commit id, 40-byte hexadecimal string, if `git-ref` and `git-sha` both are present, `git-sha` takes precedence over `git-ref`|\n|`git-nth`|optional|tell `xcpkg` that how many depth commits would you like to be fetched. default is `1`, this would save your time and storage. If you want to fetch all commits, set this to `0`|\n||||\n|`src-url`|optional|the source code download url of this package.\u003cbr\u003eIf value of this mapping ends with one of `.zip` `.tar.xz` `.tar.gz` `.tar.lz` `.tar.bz2` `.tgz` `.txz` `.tlz` `.tbz2` `.crate`, it will be uncompressed to `$PACKAGE_WORKING_DIR/src` when this package is installing, otherwise, it will be copied to `$PACKAGE_WORKING_DIR/src`\u003cbr\u003ealso support format like `dir://DIR`|\n|`src-uri`|optional|the mirror of `src-url`.|\n|`src-sha`|optional|the `sha256sum` of source code.\u003cbr\u003e`src-sha` and `src-url` must appear together.|\n||||\n|`fix-url`|optional|the patch file download url of this package.\u003cbr\u003eIf value of this mapping ends with one of `.zip` `.tar.xz` `.tar.gz` `.tar.lz` `.tar.bz2` `.tgz` `.txz` `.tlz` `.tbz2` `.crate`, it will be uncompressed to `$PACKAGE_WORKING_DIR/fix` when this package is installing, otherwise, it will be copied to `$PACKAGE_WORKING_DIR/fix`.|\n|`fix-uri`|optional|the mirror of `fix-url`.|\n|`fix-sha`|optional|the `sha256sum` of patch file.\u003cbr\u003e`fix-sha` and `fix-url` must appear together.|\n|`fix-opt`|optional|options to be passed to `patch` command. default value is `-p1`.|\n||||\n|`patches`|optional|multiple lines of `\u003cfix-sha\u003e\\|\u003cfix-url\u003e[\\|fix-uri][\\|fix-opt]`.|\n||||\n|`res-url`|optional|other resource download url of this package.\u003cbr\u003eIf value of this mapping ends with one of `.zip` `.tar.xz` `.tar.gz` `.tar.lz` `.tar.bz2` `.tgz` `.txz` `.tlz` `.tbz2` `.crate`, it will be uncompressed to `$PACKAGE_WORKING_DIR/res` when this package is installing, otherwise, it will be copied to `$PACKAGE_WORKING_DIR/res`.|\n|`res-uri`|optional|the mirror of `res-url`.|\n|`res-sha`|optional|the `sha256sum` of resource file.\u003cbr\u003e`res-sha` and `res-url` must appear together.|\n||||\n|`reslist`|optional|multiple lines of `\u003cres-sha\u003e\\|\u003cres-url\u003e[\\|res-uri][\\|unpack-dir][\\|N]`. `unpack-dir` is relative to `$PACKAGE_WORKING_DIR/res`, default value is empty. `N` is `--strip-components=N`|\n||||\n|`dep-pkg`|optional|a space-separated list of   `xcpkg packages` that are depended by this package when installing and/or runtime, which will be installed via [xcpkg](https://github.com/leleliu008/xcpkg).|\n|`dep-lib`|optional|a space-separated list of libraries that will be linked. library name starts with `-l` will be directly passed to the linker. otherwise, it will be recognized as a `pkg-config` package name and it will be calculated via `pkg-config --libs-only-l ` then passed to the linker.|\n|`dep-upp`|optional|a space-separated list of   `uppm packages` that are depended by this package when installing and/or runtime, which will be installed via [uppm](https://github.com/leleliu008/uppm).|\n|`dep-pym`|optional|a space-separated list of `python packages` that are depended by this package when installing and/or runtime, which will be installed via [pip3](https://github.com/pypa/pip).|\n|`dep-plm`|optional|a space-separated list of    `perl modules` that are depended by this package when installing and/or runtime, which will be installed via [cpan](https://metacpan.org/dist/CPAN/view/scripts/cpan).|\n||||\n|`ccflags`|optional|append to `CFLAGS`|\n|`xxflags`|optional|append to `CXXFLAGS`|\n|`ppflags`|optional|append to `CPPFLAGS`|\n|`ldflags`|optional|append to `LDFLAGS`|\n||||\n|`bsystem`|optional|build system name.\u003cbr\u003evalues can be one or a combination of `autogen` `autotools` `configure` `cmake` `cmake+gmake` `cmake+ninja` `meson` `xmake` `gmake` `ninja` `cargo` `go` `rake`|\n|`bscript`|optional|the directory where the build script is located in, relative to `PACKAGE_WORKING_DIR`. build script such as `configure`, `Makefile`, `CMakeLists.txt`, `meson.build`, `Cargo.toml`, etc.|\n|`binbstd`|optional|whether to build in the directory where the build script is located in, otherwise build in other directory.\u003cbr\u003evalue shall be `0` or `1`. default value is `0`.|\n|`symlink`|optional|whether to symlink installed files to `$XCPKG_HOME/symlinked/*`.\u003cbr\u003evalue shall be `0` or `1`. default value is `1`.|\n|`movable`|optional|whether can be moved/copied to other locations.\u003cbr\u003evalue shall be `0` or `1`. default value is `1`.|\n|`parallel`|optional|whether to allow build system running jobs in parallel.\u003cbr\u003evalue shall be `0` or `1`. default value is `1`.|\n||||\n|`onstart`|optional|POSIX shell code to be run when this package's formula is loaded.\u003cbr\u003e`PWD` is `$PACKAGE_WORKING_DIR`|\n|`onready`|optional|POSIX shell code to be run when this package's needed resources all are ready.\u003cbr\u003e`PWD` is `$PACKAGE_BSCRIPT_DIR`|\n|`onfinal`|optional|POSIX shell code to be run when this package is successfully installed.\u003cbr\u003e`PWD` is `$PACKAGE_INSTALL_DIR`|\n||||\n|`do12345`|optional|POSIX shell code to be run for native build.\u003cbr\u003eIt is running in a separated process.|\n|`dopatch`|optional|POSIX shell code to be run to apply patches manually.\u003cbr\u003e`PWD` is `$PACKAGE_BSCRIPT_DIR`|\n|`dosetup`|optional|POSIX shell code to be run to do some preparation before installation.\u003cbr\u003e`PWD` is `$PACKAGE_BSCRIPT_DIR`|\n|`install`|optional|POSIX shell code to be run when user run `xcpkg install \u003cPKG\u003e`. If this mapping is not present, `xcpkg` will run default install code according to `bsystem`.\u003cbr\u003e`PWD` is `$PACKAGE_BSCRIPT_DIR` if `binbstd` is `0`, otherwise it is `$PACKAGE_BCACHED_DIR`|\n|`dotweak`|optional|POSIX shell code to be run to do some tweaks immediately after installing.\u003cbr\u003e`PWD` is `$PACKAGE_INSTALL_DIR`|\n||||\n|`caveats`|optional|multiple lines of plain text to be displayed after installation.|\n\n|phases of a package's installation|\n|-|\n|![phases](phases.svg)|\n\n|build system name|build script file name|\n|-|-|\n|`meson`|`meson.build`|\n|`cmake`|`CMakeLists.txt`|\n|`gmake`|`GNUMakefile` or `Makefile`|\n|`ninja`|`build.ninja`|\n|`xmake`|`xmake.lua`|\n|`cargo`|`Cargo.toml`|\n|`go`|`go.mod`|\n|`rake`|`Rakefile`|\n|`autogen`|`autogen.sh`|\n|`autotools`|`configure.ac`|\n|`configure`|`configure`|\n\n**commands that can be used out of the box:**\n\n|command|usage-example|\n|-|-|\n|`bash`|[Reference](https://www.gnu.org/software/bash/manual/bash.html)|\n|`CoreUtils`|[Reference](https://www.gnu.org/software/coreutils/manual/coreutils.html)|\n|`xargs`|[Reference](https://www.gnu.org/software/findutils/manual/html_node/find_html/Invoking-xargs.html)|\n|`find`|[Reference](https://www.gnu.org/software/findutils/manual/html_mono/find.html)|\n|`gawk`|[Reference](https://www.gnu.org/software/gawk/manual/gawk.html)|\n|`gsed`|[Reference](https://www.gnu.org/software/sed/manual/sed.html)|\n|`grep`|[Reference](https://www.gnu.org/software/grep/manual/grep.html)|\n|`jq`|[Reference](https://stedolan.github.io/jq/manual/)|\n|`yq`|[Reference](https://mikefarah.gitbook.io/yq/)|\n|`d2`|[Reference](https://github.com/terrastruct/d2)|\n|`bat`|[Reference](https://github.com/sharkdp/bat)|\n|`git`|[Reference](https://git-scm.com/docs/git)|\n|`curl`|[Reference](https://curl.se/docs/manpage.html)|\n|`tree`|[Reference](https://linux.die.net/man/1/tree)|\n|`bsdtar`|[Reference](https://man.archlinux.org/man/core/libarchive/bsdtar.1.en)|\n|`pkg-config`|[Reference](https://people.freedesktop.org/~dbn/pkg-config-guide.html)|\n|||\n|`echo`|`echo 'your message.'`|\n|`info`|`info 'your information.'`|\n|`warn`|`warn \"no package manager found.\"`|\n|`error`|`error 'error message.'`|\n|`abort`|`abort 1 \"please specify a package name.\"`|\n|`success`|`success \"build success.\"`|\n|`isInteger`|`isInteger $x \\|\\| abort 1 \"should be an integer.\"`|\n|`isCrossBuild`|`isCrossBuild \u0026\u0026 abort 1 \"This package is not supposed to be cross built.\"`|\n|`wfetch`|`wfetch \u003cURL\u003e [--uri=\u003cURL-MIRROR\u003e] [--sha256=\u003cSHA256\u003e] [-o \u003cPATH\u003e [-q]`|\n|||\n|`configure`|`configure --enable-pic`|\n|`mesonw`|`mesonw -Dneon=disabled -Darm-simd=disabled`|\n|`cmakew`|`cmakew -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON`|\n|`gmakew`|`gmakew`|\n|`xmakew`|`xmakew`|\n|`cargow`|`cargow`|\n|`gow`|`gow`|\n\n**shell variables can be used directly:**\n\n|variable|overview|\n|-|-|\n|`TIMESTAMP_UNIX`|the unix timestamp of this action.|\n|||\n|`NATIVE_PLATFORM_KIND`|current running platform kind. value shall be `darwin`|\n|`NATIVE_PLATFORM_TYPE`|current running platform type. value shall be `macos`|\n|`NATIVE_PLATFORM_NAME`|current running platform name. value shall be `MacOSX`|\n|`NATIVE_PLATFORM_VERS`|current running platform version.|\n|`NATIVE_PLATFORM_ARCH`|current running platform arch. value might be any one of `x86_64`, `arm64`, etc|\n|`NATIVE_PLATFORM_NCPU`|current running platform's cpu core count.|\n|`NATIVE_PLATFORM_EUID`|current running platform's effective user ID.|\n|`NATIVE_PLATFORM_EGID`|current running platform's effective group ID.|\n|||\n|`TARGET_PLATFORM_NAME`|target platform name that is built for. value shall be any one of `AppleTVOS` `AppleTVSimulator` `DriverKit` `MacOSX` `WatchOS` `WatchSimulator` `iPhoneOS` `iPhoneSimulator`|\n|`TARGET_PLATFORM_VERS`|target platform version that is built with.|\n|`TARGET_PLATFORM_ARCH`|target platform arch that is built for. value might be any one of `x86_64`, `arm64`, etc|\n|||\n|`CROSS_COMPILING`|value shall be 0 or 1. indicates whether is cross-compiling.|\n|||\n|`XCPKG_ARG0`|the 1st arguments of `xcpkg` that you've supplied.|\n|`XCPKG_ARG1`|the 2nd arguments of `xcpkg` that you've supplied.|\n|`XCPKG_ARGV`|the all arguments of `xcpkg` that you've supplied.|\n|`XCPKG_PATH`|the full path of `xcpkg` that you're running.|\n|`XCPKG_HOME`|the home directory of `xcpkg` that you're running.|\n|`XCPKG_VERSION`|the version of `xcpkg` that you're running.|\n|||\n|`UPPM`|the executable filepath of [uppm](https://github.com/leleliu008/uppm)|\n|||\n|`CC_FOR_BUILD`|the C Compiler for native build.|\n|`CFLAGS_FOR_BUILD`|the flags of `CC_FOR_BUILD`.|\n|`CXX_FOR_BUILD`|the C++ Compiler for native build.|\n|`CXXFLAGS_FOR_BUILD`|the flags of `CXX_FOR_BUILD`.|\n|`CPP_FOR_BUILD`|the C/C++ PreProcessor for native build.|\n|`CPPFLAGS_FOR_BUILD`|the flags of `CPP_FOR_BUILD`.|\n|`AS_FOR_BUILD`|the assembler for native build.|\n|`AR_FOR_BUILD`|the archiver for native build.|\n|`RANLIB_FOR_BUILD`|the archiver extra tool for native build.|\n|`LD_FOR_BUILD`|the linker for native build.|\n|`LDFLAGS_FOR_BUILD`|the flags of `LD_FOR_BUILD`.|\n|`NM_FOR_BUILD`|a command line tool to list symbols from object files for native build.|\n|`STRIP_FOR_BUILD`|a command line tool to discard symbols and other data from object files for native build.|\n|||\n|`CC`|the C Compiler.|\n|`CFLAGS`|the flags of `CC`.|\n|`CXX`|the C++ Compiler.|\n|`CXXFLAGS`|the flags of `CXX`.|\n|`CPP`|the C/C++ PreProcessor.|\n|`CPPFLAGS`|the flags of `CPP`.|\n|`AS`|the assembler.|\n|`AR`|the archiver.|\n|`RANLIB`|the archiver extra tool.|\n|`LD`|the linker.|\n|`LDFLAGS`|the flags of `LD`.|\n|`NM`|a command line tool to list symbols from object files.|\n|`STRIP`|a command line tool to discard symbols and other data from object files.|\n|||\n|`PACKAGE_WORKING_DIR`|the working directory when installing.|\n|`PACKAGE_BSCRIPT_DIR`|the directory where the build script (e.g. `Makefile`, `configure`, `CMakeLists.txt`, `meson.build`, `Cargo.toml`, etc) is located in.|\n|`PACKAGE_BCACHED_DIR`|the directory where the temporary files are stored in when building.|\n|`PACKAGE_INSTALL_DIR`|the directory where the final files will be installed to.|\n|||\n|`x_INSTALL_DIR`|the installation directory of x package.|\n|`x_INCLUDE_DIR`|`$x_INSTALL_DIR/include`|\n|`x_LIBRARY_DIR`|`$x_INSTALL_DIR/lib`|\n\n## xcpkg formula repository\n\na typical hierarchical structure of a xcpkg formula repository looks like below:\n\n```\nXCPKGFormulaRepoName\n├── formula\n│   ├── packageA.yml\n│   └── packageB.yml\n├── LICENSE\n└── README.md\n```\n\n## xcpkg formula repository local location\n\n`${XCPKG_HOME}/repos.d/${XCPKGFormulaRepoName}`\n\n## xcpkg formula repository local config\n\na xcpkg formula repository's config file is located at `${XCPKG_HOME}/repos.d/${XCPKGFormulaRepoName}/.xcpkg-formula-repo.yml`\n\na typical xcpkg formula repository's config file content looks like below:\n\n```yaml\nurl: https://github.com/leleliu008/xcpkg-formula-repository-official-core\nbranch: master\npinned: 0\nenabled: 1\ncreated: 1673684639\nupdated: 1673684767\n```\n\nIf a xcpkg formula repository is `pinned`, which means it would not be updated.\n\nIf a xcpkg formula repository is `disabled`, which means xcpkg would not search formulas in this formula repository.\n\n## xcpkg formula repository management\n\nrun `xcpkg formula-repo-add ` command to create a new formula repository locally from an exsting remote git repository.\n\nrun `xcpkg formula-repo-init` command to create a new formula repository locally without taking any further action.\n\n## xcpkg official formula repository\n\nxcpkg official formula repository is hosted at \u003chttps://github.com/leleliu008/xcpkg-formula-repository-official-core\u003e\n\nIt would be automatically fetched to your local repository as name `official-core` when you run `xcpkg update` command.\n\n**Note:** If you find that a package is not in xcpkg official formula repository yet, PR is welcomed.\n\n## prebuild packages built by this software\n\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-10.15-x86_64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-11.0-x86_64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-12.0-x86_64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-13.0-x86_64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-14.0-x86_64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-11.0-arm64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-12.0-arm64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-13.0-arm64/releases\u003e\n- \u003chttps://github.com/leleliu008/uppm-package-repository-macos-14.0-arm64/releases\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleleliu008%2Fxcpkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleleliu008%2Fxcpkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleleliu008%2Fxcpkg/lists"}