Intro to porting with IRIXPorts

Unxmaal

Administrator
Feb 8, 2019
38
13
8
Intro to porting with IRIXPorts

Prerequisites

Porting Stuff

This is my workflow. there are many like it, but this one is mine.

  • Determine a thing you want to port with irixports. I recommend something you've already ported, or rooting around in @onre's garbage.
  • Get a link to that thing's source code in a tarball format. (You can use a git repo, but that's for grownups, not you.) Since I'm lazy, I just download the thing, then right-click, copy download link.
cd irixports

Make a new branch named for what you're porting

git checkout -b thing
mkdir thing


I use zlib as a basis for porting, as it's simple and works

cp zlib/package.sh thing/.

Now crack open and edit package.sh. It looks like this:

#!/opt/local/bin/mksh ../.port.sh
port=zlib
version=1.2.11
useconfigure=true
files="https://zlib.net/zlib-1.2.11.tar.gz zlib-1.2.11.tar.gz e6d119755acdf9104d7ba236b1242696940ed6dd"


Change the bits to reflect what you're porting:

#!/opt/local/bin/mksh ../.port.sh
port=thing
version=0.5.2
useconfigure=true
files="https://thing.net/thing-0.5.2.tar.gz thing-0.5.2.tar.gz e6d119755acdf9104d7ba236b1242696940ed6dd"


I leave the hash for now, as I don't know what the value will be.

Run package.sh. It'll fetch the tarball, then flip out over the hash. But hey, now you have the tarball!

Get the sha1 via

openssl sha1 thing-0.5.2.tar.gz

Add this number into package.sh.

Now run ./package.sh again. If you're amazingly lucky (or this app is really tiny and dumb) it'll just work! You'll be able to confirm this if irixports tells you it's added thing-0.5.2 to its database.

Add your changes to package.sh, commit and push it to your branch in your repo on Github.

git add package.sh
git commit -m "ported thing"
git push origin thing


On Github.com, create a new pull request.
Left side, base repository = larb0b/irixports base: master. Right side: yourname/irixports base: thing.


Back on your IRIX box:

git checkout master
git pull origin master


At some point you'll get an email that @lbdm has merged your request. At this point you should merge his upstream repo into the master branch of your repo.

On Github.com, create a new pull request.
Left side, base repository = yourname/irixports base: master. Right side: larb0b/irixports base: master.

--------------------
Divergence - or how to handle the normal state where something fails to magically port without you screwing around with it for a while.

Scenario 1: I already ported this sucker and it works.

Great! Follow all the above steps up to getting the sha1 hash and updating package.sh.

Copy the extracted source code directory to a backup dir:

cp -Ra thing-0.5.2/ thing-0.5.2.orig/

Make your needed changes in the non-orig directory, ie thing-0.5.2/ .

Create a patches directory.

mkdir patches

Generate a patchdiff, written straight into the patch dir.

diff -Naur thing-0.5.2.orig/ thing-0.5.2/ > patches/thing052-001

(You can keep this patch naming convention or not. irixports doesn't care. It does apply patches alphanumerically, and patches need to be applied in the order in which they were generated.)

Now clean up your thing-0.5.2 directory and see if irixports will build properly.

./package.sh clean
./package.sh fetch


The fetch stage downloads and applies all patches in patches/. If this worked, try ./package.sh again.

./package.sh clean
./package.sh


That worked. Great! Add your changes to your repo, commit, push, and perform PRs as per above.

git add package.sh
git add patches/thing052-001
git commit -m "ported thing"
git push origin thing
 
Last edited: