{"id":14069121,"url":"https://github.com/r-lib/pkgbuild","last_synced_at":"2025-05-15T12:00:19.924Z","repository":{"id":13036972,"uuid":"73388573","full_name":"r-lib/pkgbuild","owner":"r-lib","description":"Find tools needed to build R packages","archived":false,"fork":false,"pushed_at":"2025-05-08T10:37:59.000Z","size":6446,"stargazers_count":71,"open_issues_count":5,"forks_count":35,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-08T11:39:25.545Z","etag":null,"topics":["r"],"latest_commit_sha":null,"homepage":"https://pkgbuild.r-lib.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2016-11-10T14:16:37.000Z","updated_at":"2025-05-08T10:35:08.000Z","dependencies_parsed_at":"2023-02-16T10:46:02.477Z","dependency_job_id":"c22c2694-1b35-4e9b-babe-845471cc0739","html_url":"https://github.com/r-lib/pkgbuild","commit_stats":{"total_commits":293,"total_committers":25,"mean_commits":11.72,"dds":0.6245733788395904,"last_synced_commit":"e72297244f391c3b742e14c9ed67fab3f792e1c4"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fpkgbuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fpkgbuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fpkgbuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fpkgbuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/pkgbuild/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076977,"owners_count":22010630,"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":["r"],"created_at":"2024-08-13T07:06:37.855Z","updated_at":"2025-05-15T12:00:19.908Z","avatar_url":"https://github.com/r-lib.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# pkgbuild\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/r-lib/pkgbuild/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/pkgbuild/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/pkgbuild/graph/badge.svg)](https://app.codecov.io/gh/r-lib/pkgbuild)\n\u003c!-- badges: end --\u003e\n\nThe goal of pkgbuild is to make it easy to build packages with compiled code. It provides tools to configure your R session, and check that everything is working ok. If you are using RStudio, it also helps you trigger automatic install of the build tools.\n\n## Installation\n\n Install the released version from CRAN\n\n```r\ninstall.packages(\"pkgbuild\")\n```\n\nOr install the development version from GitHub:\n\n```r\n# install.packages(\"pak\")\npak::pak(\"r-lib/pkgbuild\")\n```\n\n## Example\n\n``` r\n# Check that you have the build tools installed\npkgbuild::check_build_tools(debug = TRUE)\n\n# Build a package\npkgbuild::build(\"/path/to/my/package\")\n\n# Run your own code in an environment guaranteed to\n# have build tools available\npkgbuild::with_build_tools(my_code)\n```\n\n## Configuration\n\n### `DESCRIPTION` entries\n\n* `Config/build/clean-inst-doc` can be set to `FALSE` to avoid cleaning up\n  `inst/doc` when building a source package. Set it to `TRUE` to force a\n  cleanup. See the `clean_doc` argument of `build()` as well.\n\n* `Config/build/copy-method` can be used to avoid copying large directories\n  in `R CMD build`. It works by copying (or linking) the files of the\n  package to a temporary directory, leaving out the (possibly large) files\n  that are not part of the package. Possible values:\n\n  - `none`: pkgbuild does not copy the package tree. This is the default.\n  - `copy`: the package files are copied to a temporary directory before\n    ` R CMD build`.\n  - `link`: the package files are symbolic linked to a temporary directory\n    before `R CMD build`. Windows does not have symbolic links, so on Windows\n    this is equivalent to `copy`.\n\n  You can also use the `pkg.build_copy_method` option or the\n  `PKG_BUILD_COPY_METHOD` environment variable to set the copy method.\n  The option is consulted first, then the `DESCRIPTION` entry, then the\n  environment variable.\n\n* `Config/build/extra-sources` can be used to define extra source files for\n  pkgbuild to decide whether a package DLL needs to be recompiled in\n  `needs_compile()`. The syntax is a comma separated list of file names,\n  or globs. (See `?utils::glob2rx()`.) E.g. `src/rust/src/*.rs` or `configure*`.\n\n### Options\n\n* `pkg.build_copy_method`: use this option to avoid copying large directories\n  when building a package. See possible values above, at the\n  `Config/build/copy-method` `DESCRIPTION` entry.\n\n* `pkg.build_extra_flags`: set this to `FALSE` to to opt out from adding\n  debug compiler flags in `compile_dll()`. Takes precedence over the\n  `PKG_BUILD_EXTRA_FLAGS` environment variable. Possible values:\n\n  - `TRUE`: add extra flags,\n  - `FALSE`: do not add extra flags,\n  - `\"missing\"`: add extra flags if the user does not have a\n    `$HOME/.R/Makevars` file.\n\n* `pkg.build_stop_for_warnings`: if it is set to `TRUE`, then pkgbuild will stop\n  for `R CMD build` errors. It takes precedence over the\n  `PKG_BUILD_STOP_FOR_WARNINGS` environment variable.\n\n### Environment variables\n\n* `PKG_BUILD_COLOR_DIAGNOSTICS`: set it to `false` to opt out of colored\n  compiler diagnostics. Set it to `true` to force colored compiler\n  diagnostics.\n\n* `PKG_BUILD_COPY_METHOD`: use this environment variable to avoid copying\n  large directories when building a package. See possible values above,\n  at the `Config/build/copy-method` `DESCRIPTION` entry.\n\n* `PKG_BUILD_EXTRA_FLAGS`: set this to `false` to to opt out from adding\n  debug compiler flags in `compile_dll()`. The `pkg.build_extra_flags` option\n  takes precedence over this environment variable. Possible values:\n\n  - `\"true\"`: add extra flags,\n  - `\"false\"`: do not add extra flags,\n  - `\"missing\"`: add extra flags if the user does not have a\n    `$HOME/.R/Makevars` file.\n\n* `PKG_BUILD_STOP_FOR_WARNINGS`: if it is set to `true`, then pkgbuild will stop\n  for `R CMD build` errors. The `pkg.build_stop_for_warnings` option takes\n  precedence over this environment variable.\n\n## Code of Conduct\n\nPlease note that the pkgbuild project is released with a\n[Contributor Code of Conduct](https://pkgbuild.r-lib.org/CODE_OF_CONDUCT.html).\nBy contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fpkgbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fpkgbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fpkgbuild/lists"}