Tutorial: Add a port to the kmpkg open-source registry
This tutorial guides you on how to package a library for kmpkg using a custom overlay. We recommended that you read the Packaging a library tutorial before proceeding.
Prerequisites
- A terminal
- Git
1 - Fork the kmpkg Repository
- Navigate to the kmpkg GitHub repository.
- Click the "Fork" button at the top right corner of the page.
- Choose your GitHub account as the destination for the fork.
2 - Add your fork as a remote
Navigate to the directory where you've cloned the original kmpkg repository, then add your fork as a remote. Replace <Your-GitHub-Username> with your GitHub username:
git remote add myfork https://github.com/<Your-GitHub-Username>/kmpkg.git
You can check that the remote was added correctly by running:
git remote -v
You should see myfork listed among the remotes.
3 - Create a topic branch
Before making changes, it's usually good to create a new branch:
git checkout -b <topic-branch-name>
4 - Copy the overlay port to the ports directory
Add the kmpkg-sample-library port that was created in the packaging a library tutorial to the kmpkg\ports directory:
- bash
- cmd
- powershell
cp -R <path/to/kmpkg-sample-library> <ports/kmpkg-sample-library>
xcopy <path/to/kmpkg-sample-library> <ports/kmpkg-sample-library> /E
Copy-Item -Path <path/to/kmpkg-sample-library> -Destination <ports/kmpkg-sample-library> -Recurse
5 - Commit and push changes
-
Commit the changes:
git add ports/<library-name>
git commit -m "Add kmpkg-sample-library to kmpkg" -
Run
kmpkg x-add-version:kmpkg x-add-version kmpkg-sample-library -
Commit version changes
git commit -m "version database" -
Push the changes to your fork:
git push myfork <topic-branch-name>
6 - Create a pull request
- Navigate to your forked repository on GitHub.
- Click on "Compare & pull request" button.
- Verify the changes
- Add a descriptive title and comments
- Fill out the pr review checklist
- Click "Create pull request."
That's it! You've successfully added a port to kmpkg's curated registry.
Next steps
For more information, see: