-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ollama: add new port for ollama #25274
Conversation
MacPorts is intended to build packages from source, we do not prefer/want to just install binaries. Can this be changed so the port is build from source? |
yea, definitely can. it's a little involved, but can give it another whirl - it didn't 'just work' when I tried and it takes quite a long time. I stole most of my Portfile from https://github.com/macports/macports-ports/blob/master/net/traefik/Portfile which appears to be a binary too so was hoping this was cool now! but all good, thanks for the push. i'll give it a crack. |
I would love to build ollama in MacPorts from source. It would be a big win. |
@pmetzger would be great! feel free to have at it. I agree it would be nice. I was going to upload my old version that didn't quite work to go off of for you but I did manage to get a version "working" in a few minutes of fiddling around with that, my results are here: 048f306 the drawbacks I noted on the commit. I can look into this more tomorrow hopefully. I can't decide the best approach, there seem to be many ways to cut it. the |
release tarballs also have version set to 0.0.0 - I've found the offending file https://github.com/ollama/ollama/blob/main/version/version.go - unclear, seems to be to bless their binaries but I will try to look into the brew script for this when I get a chance maybe they have the sauce |
net/ollama/Portfile
Outdated
sha256 08a6dff6d22b756273874298f8ce1bfcf5812805e28743b43310c701dc3d56a4 \ | ||
size 55334656 | ||
depends_build port:cmake \ | ||
port:gcc14 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need gcc to build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call. contrary to the developer docs, it doesn't.
updated with a working underway is making a startup script to run a daemon, getting there, not quite working. i find this package quite odd to use without this in place. |
net/ollama/Portfile
Outdated
PortSystem 1.0 | ||
PortGroup github 1.0 | ||
|
||
github.setup ollama ollama 0.3.6 v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add "github.tarball_from" and set it to appropriate value. If upstream provides them "releases", otherwise "archive". This change will require updating the "checksums" which are currently missing completely.
net/ollama/Portfile
Outdated
revision 0 | ||
|
||
categories net | ||
maintainers @rdallman \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typically also an obfuscated e-mail is provided.
net/ollama/Portfile
Outdated
|
||
depends_build port:cmake \ | ||
port:go | ||
fetch.type git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be needed I think; removing it will require you to add the "checksums" field.
net/ollama/Portfile
Outdated
reinplace "s/var Version string = \".*\"/var Version string = \"${version}\"/" version/version.go | ||
|
||
system -W ${worksrcpath} "go generate ./..." | ||
system -W ${worksrcpath} "go build ." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the port is downloading packages in the the build
phase, that's not what should happen - we have a fetch
phase for that. Perhaps you can use the golang
PortGroup and specify the packages. I don't have much experience with it, but perhaps @herbygillot can provide some additional guidance here?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, the golang group is probably the right thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea good eye thanks. I will play with the golang portgroup, I had no dice the last time due to the issues noted #25274 (comment) about using release zip but should be fine for dependencies.
thanks @reneeotten for your comments. I will try to illuminate the main issue(s) with the build process thus far and maybe there is an obvious solution sitting around that I'm missing - I am new to this land! TLDR I've had issues using the release tar / zips, and I attempted to install from the releases, the mac specific zip (a mac
I suppose I could inject something like a attempting
that led me to find https://guide.macports.org/#reference.portgroup.github.submodule - which put me on the path to use the git fetch mode and let me know if this sparks any ideas! |
same basic issue with using the |
Think I have a reasonable solution to the vendoring and submodules thing to do in the fetch phase. Working out kinks in the start up script and I’ll try to get checksums in too. |
I am waving the white flag on the start up script, have spent a few days of tinkering and I cannot get it working one way or another. the crux of the issue is that they want a $HOME directory, mostly for storing models in |
Okay, so who can help get this over the line? |
We could ask upstream to provide a release tarball (with all submodules) starting from the next version. Then the go portgroup could be used. |
I took a look at this. Updated to the latest version ( |
Also, this latest version (v0.5.4), does not look to be using Git submodules. So it's converted to a tarball download. |
@herbygillot thank you! I tested and it works well on my machine too. I am glad they switched from submodules. thanks for your expertise and updating everything. i suppose it is pretty easy to go in and hack up the plist file or move any existing models around to where they need to go for people that don't want to re-download all of the models, that is my only note. I guess just thinking in terms of notes for people moving from brew install, not sure where to leave such a note. the /var path I get, just thinking for migrating people. LGTM tho. appreciate it! it's done! |
I think if someone is moving over from Homebrew, paths not matching will almost usually be a given? |
Description
This Portfile will install the ollama binary from github releases.
It may be nice to add a start up service that runs the server in the background, which is what brew does too, however this is just the mvp to get something in macports.
Type(s)
Tested on
macOS 14.5 23F79 arm64
Command Line Tools 15.3.0.0.1.1708646388
Verification
Have you
followed our Commit Message Guidelines?
squashed and minimized your commits?
checked that there aren't other open pull requests for the same change?
checked your Portfile with
port lint --nitpick
?tried existing tests with
sudo port test
?tried a full install with
sudo port -vst install
?tested basic functionality of all binary files?
checked that the Portfile's most important variants haven't been broken?