Reputation: 16442
I'm editing and testing a package that I'd like to build via macports. Is there a way that I can force macports to fetch and build the package from my repository? I've edited my Portfile to point to a single repository but it seems to be ignoring it.
Upvotes: 1
Views: 1631
Reputation: 2998
MacPorts uses curl internally to download files, which gives you a couple of options to switch where stuff is downloaded from:
master_sites
property of the Portfile to point to a local directory. Note that the fetch runs as the macports
user, so make sure that user is allowed to read files from that directory.port distfiles $portname
to find the local path where a file may be cached.fetch.type git
, git.url
to whatever git clone
will accept to clone your repository (which can be local) and optionally git.branch
to a commitish you want to check out. See https://guide.macports.org/#reference.phases.fetch.git for details. Again, make sure that the macports
user can read the local files if you use a local git repository.Note that MacPorts caches file downloads by default (no caching is applied for version control systems at the moment), so if you did not modify the filename, you will have to run sudo port clean --dist $portname
to delete the cache.
When building modified versions of ports, you'll also have to look out for a number of other points:
-s
flag to port
to force building from source.Probably the easiest solution to work around these two potential pitfalls is running sudo port destroot $portname
instead of sudo port install
. This will run all steps up to (and including) make install
, but will not actually put the files into /opt/local
. If you can debug what you need to debug from the build directory at port work $portname
, this will simplify things.
Upvotes: 1