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

f54da

macrumors 6502a
Original poster
Dec 22, 2021
632
229
Just a heads up that yt-dlp no longer supports 10.9.

One option of course is installing a more recent python version using macports & pip installing it, but that brings with it a lot of macports baggage and is definitely not a "user friendly" solution. I remember @Wowfunhappy bootstrapped a standalone python3.10 release, do you happen to have a link to that somewhere? If the python binary can be run standalone without needing to entangle it into the system (esp. for people who already have too many copies of python around and don't want to break their existing setup), I think downloading the "platform independent zipimport" binary and then using that with self-contained python3.10 should work.

Of course python 3.10 itself is fairly old, and is probably going to be dropped by yt-dlp sometime next year I think... macports seems to have newer python working as far back as snow leopard, can those be extracted and used in a standalone fashion?
 
On https://mavericksforever.com/#media, both "Media Subscriptions" and "Download Video Service", which use yt-dlp under the hood, ship with a standalone embedded copy of Python 3.10. (I started using yt-dlp before they offered legacy macos builds, and once they did start offering legacy builds, I did not switch because I figured they would eventually drop Mavericks support.)

----------

Now the question is, how did I produce the embedded copy of Python 3? Unfortunately, I built this all the way back in 2021 and did not keep detailed notes, all I have written down is:

Code:
On a 10.6 VM with MacPorts installed:

./configure MACOSX_DEPLOYMENT_TARGET=10.6 --prefix=/Users/Jonathan/Desktop/python-build --with-openssl=/opt/local/libexec/openssl3/

dylibbundler --no-codesign -p '@executable_path/../lib' -d lib -b -x lib/python3.10/lib-dynload/_ssl.cpython-310-darwin.so

Which I think implies that Python 3 actually compiles into this type of portable configuration by default.

I then appear to have also manually zipped the lib/python3.10 folder, presumably to keep the number of files under control so the bundle won't take forever to copy places. I think I discovered that this was possible by chance, I can't find documentation on it anywhere. It doesn't quite work for all python packages—I still have a separate non-zipped python3.10 folder with a handful of site packages—but it still dramatically reduces the file count.

---

If you just want a copy of Python 3.10 that can be installed system-wide without MacPorts, that's also on Mavericks Forever, currently in the App Library → More Stuff → Command Line Software. (I may reorganize this in the future, I'm not happy with how buried it is currently.) Unlike the embedded copy, I have detailed build instructions for this one!

At some point I will have to figure out how to compile newer copies of Python but I'm hoping I don't have to deal with this for a while. I've consistently had issues enabling working SSL support.
 
Last edited:
Of course python 3.10 itself is fairly old, and is probably going to be dropped by yt-dlp sometime next year I think... macports seems to have newer python working as far back as snow leopard, can those be extracted and used in a standalone fashion?
On a Mavericks install, install MacPorts, then install the python version you want. Then, use
Code:
sudo port mpkg $python
where $python is the python version you want. You'll end up with a .mpkg file inside /opt/local/var/macports/build. It should be in the largest folder, and it should be the largest package file. I forget the exact naming scheme but it will include python in it.

With that, you can then copy and install that onto another machine. You do not need to have macports installed on that machine, the mpkg is self-contained and has all the necessary dependencies. Just ensure that your path is setup correctly to access the right python.

You could do this with the yt-dlp port as well, it should bundle the entire python as well, but then you'll need to do that for every new release as opposed to using pip.
 
That is neat! Thanks for the link, I'll use the self-contained version from there.

@Wowfunhappy do you also recall why you opted to rebuild python from scratch instead of "packaging" up macports python like mentioned above?
 
@Wowfunhappy do you also recall why you opted to rebuild python from scratch instead of "packaging" up macports python like mentioned above?

Because:
  • If you do have MacPorts installed the package could potentially interfere with that.
  • If you don’t have MacPorts installed, it’s messy to add an extra top-level folder (opt) to your startup disk just for Python.
  • The Preference Pane and Service are supposed to be fully self-contained, without depending on anything installed elsewhere.
The first and last only apply to the Service / PrefPane, but the second point is the reason I also recompile the copy of Python 3 which I install system-wide.

I really appreciate MacPorts but I basically never use the package functionality, if I was to repackage something from MacPorts I would use dylibbundler.
 
Last edited:
  • Like
Reactions: f54da
Looks like yt-dlp will soon need Deno JS runtime in order to download yt videos...
 
Edit: I originally wrote a bunch of stuff here. But the most important piece is that I have Deno working on Mavericks.

(MacPorts already has a Mavericks binary for Deno, but it's completely broken in practice. However, I added polyfills for the missing symbols to my compatibility library, and now Deno works.)

I can't promise I'll have a fix ready that soon because I'd really like to let things settle down on the yt-dlp side first, so if you're using my stuff you may be unable to download videos for a few days. However, 80% of my own media consumption is videos downloaded via yt-dlp, so I am personally invested in making this work and will definitely put something together!
 
Last edited:
Are you compiling deno from scratch with those additional headers, or injecting those into an already built binary? if the latter, I thought macports binaries assume that you have all their transitive dependencies installed (or are you bundling all those together and rewriting the dylib path)
 
injecting those into an already built binary
Injecting into the built binary.

if the latter, I thought macports binaries assume that you have all their transitive dependencies installed
Deno has no runtime dependencies! :)

Edit: It looks like MacPorts actually can't build Deno from source, so this is probably just the official binary, which explains why it was broken. The MacPorts package says darwin-13 but if it's not building anything it probably just copies the same binary into every release.

Edit2: Yes can confirm, I can also just run Deno 1.5.2 straight from github!
 
Last edited:
That is very cool! I remember you also invested some time in building node.js from scratch, if deno is supposed to be a drop in replacement for node, then could this be used instead for those purposes? (I am not very JS savvy so I don't know what the difference is, other than both JS runtimes based on V8).
 
That is very cool! I remember you also invested some time in building node.js from scratch, if deno is supposed to be a drop in replacement for node, then could this be used instead for those purposes? (I am not very JS savvy so I don't know what the difference is, other than both JS runtimes based on V8).

I didn’t realize Deno was a drop-in Node replacement!

Yes, one of the last things I did this summer was build NodeJS 24 for Mavericks. That has been working perfectly and I don’t see any particular reason to use Deno instead. I kind of doubt that every npm package works 100% perfectly with Deno?

Edit: Yeah, looking around it sounds like Deno's compatibility with Node packages is pretty spotty in practice, which isn't too surprising! I'm glad we have Deno but I'm also glad we have Node!
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.