====== Pkgsrc Guide ======
**Stale page** This guide refers to an unofficial pkgsrc mirror on github which appears to have fallen out of date. The official git.minix3.org repositories should be used instead. The instructions need to be updated.
===== About ===== MINIX uses [[http://pkgsrc.org/|pkgsrc]] to [[http://en.wikipedia.org/wiki/Porting|port]] and maintain packages of third-party software. This guide will introduce you to the basics. ===== Getting started ===== 1. [[.:trackingcurrent|Update]] MINIX periodically 2. [[:usersguide:installingsourcepackages|Learn]] about pkgsrc ===== Going online ===== 1. [[https://github.com/|Create an account]] and [[http://help.github.com/set-up-git-redirect|add SSH keys at GitHub]] 2. [[http://help.github.com/fork-a-repo/|Fork]] the MINIX 3 [[https://github.com/minix3/pkgsrc/|pkgsrc repository]] on GitHub You should clone the official repository from git.minix3.org instead. Please update these instructions. This makes your repositories similar, so that updates will be quick. ===== Setting up ===== 1. Download your pkgsrc repository First, download the official pkgsrc. cd /usr make pkgsrc Then, add your remote repository. cd /usr/pkgsrc git remote add me git@github.com:you/pkgsrc.git 2. Create your minix-master branch git fetch me git branch my-minix-master me/minix-master 3. Check-out your minix-master branch locally git checkout my-minix-master ===== Starting to port a package ===== Found something in pkgsrc that you want to port to MINIX? - Create a new branch from it to host your work git checkout -b my-package - Install package tools # cd /usr/pkgsrc/pkgtools/pkgdiff # bmake install This installs several tools we'll be using. ===== Making changes ===== - Get the package ready for editing cd /usr/pkgsrc/[category]/[package] bmake patch This applies patches, but doesn't build. Build results aren't usable for patches. - Go to the package's work directory cd /usr/pkgsrc/work/[category]/[package]/work/[package name] - Edit files pkgvi somefile.c Use //EDITOR=nano pkgvi// to use GNU nano instead of nvi. - Go to the package directory cd /usr/pkgsrc/[category]/[package] - Make patches mkpatches rm patches/*.orig - Make checksums bmake makepatchsum - Test your changes bmake clean bmake - Save your work cd /usr/pkgsrc/[category]/[package] git add distinfo patches git commit The commit message should provide a summary of the change. The first line of the commit message should be in the form "[category]/[package]: summary of change." Example: "print/ghostscript: add missing bsd.prefs.mk include". If it's a complex change, the commit message should provide additional explanation. ===== Putting it online ===== Push this branch to your remote repository. git push me my-package This will let others test your changes and later include them in pkgsrc. ===== Telling people about it ===== When your branch is ready, let people know by posting to the Google Group. Here's an example: Subject: [package] Ported Hi, I've ported [package], and my branch "my-package" is ready for testing at: https://github.com/[me]/pkgsrc.git Thanks When the MINIX team agrees that the package changes in your GitHub repository, they will copy the changes into MINIX's pkgsrc repository. ===== Updating your changes ===== As changes in MINIX's pkgsrc repository become available, updating your repository allows your changes to merge cleanly in the future. 1. Update the official branch git checkout minix-master cd /usr make pkgsrc-update 2. Make your minix-master branch identical to the official one cd /usr/pkgsrc git checkout my-minix-master git rebase minix-master 3. Merge changes from either the official into your own git checkout my-package-port git merge my-minix-master 4. Push your local branch up to your repository git push me my-package ===== Problems? ===== ==== Stuck or confused? ==== Please do your best to let people know what's happening. If you're having trouble or have an idea, then please tell someone. The IRC channel and the Google Group are the best places for talking with the rest of the community. ==== Need to use https:// instead of git://? ==== If you use HTTPS and have an SSL-related problem when you fetch, then please use the following steps to install SSL certificates. cd /usr/pkgsrc/security/mozilla-rootcerts bmake install cd /usr/pkg/etc/openssl/certs mozilla-rootcerts extract mozilla-rootcerts rehash ===== Resources ===== If you'd like to learn more about pkgsrc or need help, there are good places to go [[:resources|on this page]].