Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
Hey folks 👋

I've been slowly working on my own package managers for Leopard and Tiger for about a year now, as a hobby project.
This is basically an alternative to MacPorts.

Pros (vs MacPorts):
  • Performance. I put a lot of thought into making it fast.
  • Pre-compiled binaries for every package, for every CPU type. No more waiting on compilation.
  • Available packages include both unix software as well as desktop apps.
  • If you understand Bash scripting, the learning curve for contributing is less steep than MacPorts.
Cons (vs MacPorts):
  • Vastly, vastly smaller offering of packages.
If you'd like to give it a shot, just download it, make it executable, and run it.

Code:
$ curl -O http://leopard.sh/leopard.sh
$ chmod +x leopard.sh
$ ./leopard.sh

or, for Tiger users:

Code:
$ curl -O http://leopard.sh/tiger.sh
$ chmod +x tiger.sh
$ ./tiger.sh

The first time it runs, it will copy itself into /usr/local/bin and perform some setup (you'll be prompted for your sudo password). If you'd like to audit exactly what it is doing during setup, have a look at the setup section:
To install and play Quake, for example:

Code:
$ leopard.sh quake.app-1.1
$ open "/Applications/GLQuake 1.1"


The current list of available packages:

Why did I make this?
  • For fun! In a former life I was a Linux sysadmin, so writing build scripts in Bash used to be my day job.
  • Tiger and Leopard are slowly becoming second-class citizens on MacPorts. I wanted to make something special / exclusive for Leopard/PPC & Tiger/PPC.
Let me know what you think!

Picture 2.png
 
Last edited:

f54da

macrumors 6502
Dec 22, 2021
337
124
If you were to install a modern version of openssl and then build curl against that, couldn't you use that to avoid needing to verify signatures out of band?

I really like how every package is basically a self-contained shell script that tells you how to build it! One thing I've always liked homebrew (and why I personally use it over macports even on older unsupported systems) is that it's very easy to read a "formula" and understand exactly how it will be built. By contrast I find macports "port files" really hard to parse, with too much magic happening due to portgroup inheritance. (On the flipside, one could argue that homebrew itself does magic in terms of "superenv" but I actually kind of like the approach since it gives you a uniform way to add extra libraries without having to muck around in the specific build-system).
 

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
If you were to install a modern version of openssl and then build curl against that, couldn't you use that to avoid needing to verify signatures out of band?

I really like how every package is basically a self-contained shell script that tells you how to build it! One thing I've always liked homebrew (and why I personally use it over macports even on older unsupported systems) is that it's very easy to read a "formula" and understand exactly how it will be built. By contrast I find macports "port files" really hard to parse, with too much magic happening due to portgroup inheritance. (On the flipside, one could argue that homebrew itself does magic in terms of "superenv" but I actually kind of like the approach since it gives you a uniform way to add extra libraries without having to muck around in the specific build-system).
Thanks! Yeah, I explicitly decided to make each shell script as standalone as possible, at the expense of having lots of duplication among shell scripts (I don't mind -- VS Code has an excellent "diff editing" mode, and I start from a template anyway).

So actually the script does use a rebuilt version of curl with SSL, see
However, in order to squeeze out every drop of performance, you can drop SSL completely via:

Code:
export TIGERSH_MIRROR=http://leopard.sh
export LEOPARDSH_MIRROR=http://leopard.sh

Without SSL, it is nice to have MD5's verified, just in case :).

The MD5 sum is actually verified in parallel as the file is downloaded (via a fifo), so the MD5 check essentially happens "for free".
 
  • Like
Reactions: Amethyst1

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
> couldn't you use that to avoid needing to verify signatures out of band?

Ohhh, I just realized you are maybe referring to having to verify the initial MD5 sums "by hand"?

There's kinda no way around that if I want folks to be able to perform the initial install using only the system-provided curl. I figure those who care will whip out their phone and verify it, and those who don't will just hit enter.
 

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
Added a few Scheme-related packages:
  • drracket.app-6.0.1 (full app) and racket-6.0.1 (just the CLI)
  • chicken-5.3.0
  • petite-chezscheme-7.4 (tiger) and petite-chezscheme-8.4 (leopard), as well as the versions with threading support (-7.4t and -8.4t)
drracket.png
 
Last edited:

barracuda156

macrumors 68000
Sep 3, 2021
1,563
1,166
If you were to install a modern version of openssl and then build curl against that, couldn't you use that to avoid needing to verify signatures out of band?

This is what we do in Macports: boostrap prefix for curl, rebuild main Macports against curl prefix. This works better than Xcode curl on a several newer systems.
 
  • Love
Reactions: Romain_H

barracuda156

macrumors 68000
Sep 3, 2021
1,563
1,166

It would be perhaps appreciated by many if a new GCC is featured – Macports currently does not have PPC build bots (though it may happen), and I can imagine what a pain is building gcc13 on a single-core G4.
Set up for Leopard is simple: you build gcc10 with Apple gcc-4.2, then build gcc13 with gcc10. Unsupported languages will be automatically disabled (Go and D). Rust and Modula2 build fine on PPC.

Minor tweaking is needed on 10A190 (due to some missing dylibs) and Rosetta (to convince build system to compile for ppc), but these are out the scope of your coverage at the moment anyway.
 
  • Like
Reactions: cellularmitosis

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
It would be perhaps appreciated by many if a new GCC is featured – Macports currently does not have PPC build bots (though it may happen), and I can imagine what a pain is building gcc13 on a single-core G4.
Set up for Leopard is simple: you build gcc10 with Apple gcc-4.2, then build gcc13 with gcc10. Unsupported languages will be automatically disabled (Go and D). Rust and Modula2 build fine on PPC.

Minor tweaking is needed on 10A190 (due to some missing dylibs) and Rosetta (to convince build system to compile for ppc), but these are out the scope of your coverage at the moment anyway.
Absolutely! I iterated on a gcc-10.3.0 build over the christmas break, I need to dust it back off. I think I left off with trying to get obj-c garbage collection working.

 
  • Like
Reactions: fra9000

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
A few updates over the past week:
  • Added a --help feature:
Code:
$ tiger.sh --help
tiger.sh: a packge manager for PowerPC Macs running OS X 10.4 "Tiger".
 * To list the available packages, just run 'tiger.sh'.
 * To install a package, run e.g. 'tiger.sh foo-1.0'.
 * To uninstall a package, 'tiger.sh --unlink foo-1.0 && rm -r /opt/foo-1.0'.

Command-line commands:
  --help: display this message.
  --describe: describe all available packages (or --descriptions).
  --describe foo-1.0: describe 'foo-1.0'.
  --tag: list the available tags (or --tags).
  --tag foo: list the packages tagged as 'foo'.
  --link foo-1.0: symlink bin, man, share/man from /opt/foo-1.0 into /usr/local.
  --unlink foo-1.0: remove the /usr/local symlinks for foo-1.0.
  --self-update: install the latest version of this script.

Unnecessary command-line commands:
  --list: list the available packages (redundant, just run 'tiger.sh').
  --install foo-1.0: install 'foo-1.0' (redundant, just run 'tiger.sh foo-1.0').
  --setup: perform initial setup (this is done automatically as needed).

Performance tweaks:
  --spotlight (on|off): turn Spotlight on or off.

Command-line options:
  --verbose: print every command being run (note: must be the first arg).

Obscure command-line commands (used internally by tiger.sh):
  --cpu: print the CPU type (g3, g4, g4e, or g5).
  --os.cpu: print OS and CPU type (e.g. tiger.g4e).
  --bits: print the bit-width of the CPU (32 or 64).
  -j: (for make) print the -j flag based on number of CPU's (e.g. '-j1').
  -m32: (for gcc) print '-m32', but only if a G5 chip is detected.
  -mcpu: (for gcc) print the CPU flag (e.g. '-mcpu=970').
  -O: (for gcc) print the optimization flag (e.g. '-O2').
  --arch-check foo-1.0: print the architecture of foo-1.0's binaries.
  --linker-check foo-1.0: print the linked libraries for foo-1.0.
  --url-exists http://...: fail if the url is a 404.
  --install-binpkg foo-1.0: download and unpack a binary tarball into /opt.
  --unpack-dist foo-1.0: download and unpack a source tarball into /tmp.
  --unpack-tarball-check-md5 http://... /dest/dir:
      download, unpack and verify a tarball into /dest/dir.

Influential environmental variables:
  TIGERSH_MIRROR: the root URL to fetch all files from.
      Default value: TIGERSH_MIRROR=https://leopard.sh
      Note: both 'https://...' and 'file:///...' are supported.
      Note: http is faster than https, try:
            'export TIGERSH_MIRROR=http://leopard.sh'
            (MD5 sums will still be verified when using http).
  TIGERSH_VERBOSE: same effect as using --verbose.
  TIGERSH_FORCE_BUILD_PKGSPEC: build the package from source.
    e.g.: TIGERSH_FORCE_BUILD_PKGSPEC=foo-1.0 tiger.sh foo-1.0
  TIGERSH_FORCE_BUILD_ALL: build the package and all dependencies from source.
  TIGERSH_RUN_TESTS: run 'make check' after building a package from source.
  TIGERSH_RUN_LONG_TESTS: run tests which are known to take a long time.
  TIGERSH_RUN_BROKEN_TESTS: run tests which are known to fail.

  • Added a --tag feature:
Code:
$ tiger.sh --tag
Available tags:
app
chat
common-lisp
compression
db
game
lang
lib
net
scheme
shell
video

Code:
$ tiger.sh --tag compression
Packages tagged as 'compression':
gzip-1.11
lhasa-0.3.1
lz4-1.9.4
lzo-2.10
lzop-1.04
stuffit-expander.app-13.0.3
xz-5.2.5

  • Added a --self-update feature:
Code:
$ tiger.sh --self-update
Fetching the latest tiger.sh (into /usr/local/bin).

  • A couple of system speed-ups: --spotlight (Tiger and Leopard) and --glass-dock (Leopard)
Code:
$ tiger.sh --spotlight off
$ leopard.sh --glass-dock off
  • sbcl-1.0.47
  • python-3.11.2 (everything works except tkinter)
  • tcl-8.6.12 (rebuilt with support for threads)
  • tk-8.6.12
  • openssl-1.1.1t
  • gdbm-1.23
  • perl-5.36.0 (minimal, just needed to run openssl's Configure script)
  • sqlite3-3.40.1
  • git-2.35.1
  • socat-1.7.4.4
  • adium.app-1.4.5
  • wget-1.21.3
  • guile-1.8.8
  • readline-8.3
  • chibi-scheme-20230208
  • scheme48-1.9.2
  • bash-5.1.16
  • pcre-8.45
  • neofetch-7.1.0
 
  • Like
Reactions: Dronecatcher

Yumiko Noua

macrumors regular
May 24, 2022
107
47
I'm having some trouble with the installation, i don't know but, when I follow the tutorial, it just didn't install, my iMac G3 say: "tiger.sh command not found".

how I can fix/reinstall better?
 
  • Like
Reactions: cellularmitosis

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
I'm having some trouble with the installation, i don't know but, when I follow the tutorial, it just didn't install, my iMac G3 say: "tiger.sh command not found".

how I can fix/reinstall better?
Sure, it might be a $PATH issue.

When you type in a command, your terminal has a list of known locations where it looks to find that command. That list lives in an environment variable called PATH.

You can inspect your path by running:

Code:
echo $PATH

This is what that looks like for me:

Code:
$ echo $PATH
/Users/macuser/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

The script is in /usr/local/bin, so if that directory isn't in your $PATH, your terminal won't be able to find it.

However, you can instead run it like this, which should definitely work:

Code:
/usr/local/bin/tiger.sh
 
  • Like
Reactions: Yumiko Noua

Yumiko Noua

macrumors regular
May 24, 2022
107
47
Sure, it might be a $PATH issue.

When you type in a command, your terminal has a list of known locations where it looks to find that command. That list lives in an environment variable called PATH.

You can inspect your path by running:

Code:
echo $PATH

This is what that looks like for me:

Code:
$ echo $PATH
/Users/macuser/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

The script is in /usr/local/bin, so if that directory isn't in your $PATH, your terminal won't be able to find it.

However, you can instead run it like this, which should definitely work:

Code:
/usr/local/bin/tiger.sh
thanks! I will try later :)
 
  • Like
Reactions: cellularmitosis

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
There is actually a chunk of code which tries to add /usr/local/bin to your PATH automatically, but maybe something went wrong.


Maybe I should just put it in /usr/bin instead 😅
 
  • Like
Reactions: Yumiko Noua

Yumiko Noua

macrumors regular
May 24, 2022
107
47

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
oh, I see the problem.

There are three files which your terminal (actually, your shell, bash) looks at when starting up to determine its configuration:
  • ~/.bashrc
  • ~/.bash_profile
  • ~/.profile
However, I just created a new user on Tiger and was surprised to find that none of those files exist by default!

So my code didn't actually do anything, because it checks if those files exist before it tries to modify them:

Screen Shot 2023-02-13 at 2.53.41 AM.png


You can run the following commands in a terminal, which should get you sorted:

Code:
touch ~/.profile
/usr/local/bin/tiger.sh

Then you should be able to just run 'tiger.sh'.
 
  • Like
Reactions: Yumiko Noua

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
@Yumiko Noua
>Nodejs/node 16.. and electron19?
Have people ported v8 to powerpc? The only forks I can find are several years out of date. I think the closest you might get is QuickJS.
I went a bit down this rabbit hole recently and found the same: several efforts which were years stale and never got merged upstream, or were for Linux/PPC64 and not Darwin, etc.

I did also find several projects which aimed to port Node.js to alternate JS engines, and your suggestion of QuickJS is a good one.

There’s a huge amount of JS software out there, it would be great to have npm available on PPC, even if it isn’t quite as fast as the multi-million $$$ V8 implementation.
 

cellularmitosis

macrumors regular
Original poster
Mar 6, 2010
143
238
thanks to you for this amazing project :)
A huge shout-out should go to barracuda156 and MacPorts user kencu -- they have put in a ton of effort into patching many many software projects to run on Darwin/PowerPC!

Here is an initial build of quickjs:

Screen Shot 2023-02-13 at 8.55.10 PM.png


 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.