Warning: THIS WIKI IS DEPRECATED. It is no longer being maintained, and contains outdated and incorrect information. Please refer to the Void Handbook, https://docs.voidlinux.org/, for the official documentation. If you can't find the information you're seeking, please raise an issue at https://github.com/void-linux/void-docs/issues

Difference between revisions of "Xbps-src"

From Void Linux Wiki
Jump to navigation Jump to search
(Created page with "This article is a practical guide for creating and build packages from their ''templates'' (build recipes) with <code>xbps-src</code>. The official documentation with more tec...")
 
m (Duncaen moved page Xbps-src - to Xbps-src without leaving a redirect)
 
(51 intermediate revisions by 9 users not shown)
Line 1: Line 1:
This article is a practical guide for creating and build packages from their ''templates'' (build recipes) with <code>xbps-src</code>. The official documentation with more technical details can be found [https://github.com/voidlinux/void-packages/blob/master/README.md here].
+
As this wiki is deprecated, and will soon disappear, please refer to [https://github.com/void-linux/void-packages/#quick-start the "Quick start" section of the void-packages README].
 
 
== Requirements ==
 
<code>xtools</code> is required for linting packages before submitting them and generating checksums:
 
  sudo xbps-install xtools
 
 
 
== Fork the Repository ==
 
 
 
This is only necessary, if you want to make changes to the official Void Linux packages repository. Otherwise skip to the ''Quick Start'' section below.
 
 
 
'''NOTE:''' Make sure, that the software you'll package is compliant to the [https://github.com/voidlinux/void-packages/blob/master/CONTRIBUTING.md#starting-a-pull-request Contributing] rules. We '''do not accept''' any packages containing non-release versions such as '''specific git- or svn-revisions'''.
 
 
 
* You'll need a [https://github.com/ GitHub] account
 
* [https://guides.github.com/activities/forking/ Fork] the [https://github.com/voidlinux/void-packages/ void-packages] repository
 
* [https://help.github.com/articles/fetching-a-remote/ Clone] your fork and add the upstream repository
 
  git clone git@github.com:yourusername/void-packages.git
 
  cd void-packages
 
  git remote add upstream https://github.com/voidlinux/void-packages.git
 
 
 
== Create a new branch ==
 
The steps above only need to be done once. Whenever you want to work on a new feature (for example adding a new package and its dependencies), fetch from upstream and create a new branch:
 
  git fetch upstream
 
  git checkout -b my-cool-new-package-branch upstream/master
 
 
 
== Quick Start ==
 
 
 
Clone the packages repository, if you haven't already:
 
  git clone https://github.com/voidlinux/void-packages
 
  cd void-packages
 
 
 
Create the bootstrap environment:
 
  ./xbps-src binary-bootstrap
 
 
 
Modify or create a template, depending on what you want to do. Take some time to read the [https://github.com/voidlinux/void-packages/blob/master/Manual.md packages manual] for more information about the templates format. Please follow the [https://github.com/voidlinux/void-packages/blob/master/Manual.md#package-naming-conventions package naming conventions].
 
 
 
Generate the sha256 checksums for new or changed distribution files:
 
  xgensum -f srcpkgs/my-cool-new-package/template
 
 
 
'''NOTE:''' You can also use the xgensum command to debug your <code>do_fetch()</code> function, as it shows more output than xbps-src. For example <code>git submodule</code> will fail, if perl is not listed in <code>hostmakedepends</code>.
 
 
 
Build your package:
 
  ./xbps-src pkg my-cool-new-package
 
 
 
This will most-likely fail on the first approach, so fix your package and run xbps-src again. You can run all [https://github.com/voidlinux/void-packages/blob/master/Manual.md#package-build-phases package build phases] independently. If you did not change the dependencies on the second run, use the <code>-I</code> flag to save some time by skipping the autoremoval and reinstall steps:
 
  ./xbps-src -I build my-cool-new-package
 
 
 
Once the package-step ran through successfully, you can install your package:
 
  sudo xbps-install --repository=hostdir/binpkgs/my-cool-new-package-branch my-cool-new-package
 
 
 
If you have modified a package and do not wish to put the change in the official packages repository, put it [https://groups.google.com/d/msg/voidlinux/NNXhE3HL-60/rU29BVJmHRIJ on hold mode]:
 
  xbps-pkgdb -m hold <pkgname>
 
 
 
== Push Changes ==
 
Run the program you have installed on your own computer and test if everything works as it should. Then lint your package and fix all issues before you continue:
 
  xlint srcpkgs/my-cool-new-package/template
 
 
 
Commit your changes with a message that follows the [https://github.com/voidlinux/void-packages/blob/master/CONTRIBUTING.md#committing-your-changes commit rules]:
 
  git add srcpkgs/my-cool-new-package
 
  git commit -m "New package: my-cool-new-package-1337"
 
 
 
'''NOTE:''' If you made a mistake, use <code>git commit --amend</code> now [https://stackoverflow.com/questions/179123/edit-an-incorrect-commit-message-in-git to fix it].
 
 
 
Push to your own repository:
 
  git push -u origin my-cool-new-package-branch
 
 
 
== Pull Request ==
 
[https://guides.github.com/activities/forking/#making-a-pull-request Make a pull request] and follow the instructions described in the [https://github.com/voidlinux/void-packages/blob/master/CONTRIBUTING.md#starting-a-pull-request Contributing] article.
 

Latest revision as of 14:26, 13 June 2020

As this wiki is deprecated, and will soon disappear, please refer to the "Quick start" section of the void-packages README.