Opened 15 years ago
Closed 15 years ago
#22716 closed enhancement (fixed)
Build and Use Macports on a Linux System
Reported by: | mmpestorich (Mike M Pestorich) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 1.9.0 |
Component: | base | Version: | 1.8.99 |
Keywords: | linux | Cc: | |
Port: |
Description
I recently got the trunk to compile on my Linux system and thought I would share the few things I had to do in order to get it to do so.
I created a patch that adds strlcpy() to pextlib1.0/tracelib.c and sysctlbyname() to macports1.0/sysctl.c. These C Library functions are available in BSDs but not in Linux. I pulled these implementations from OpenBSD.
After a successful make and make install, running the port command would segfault on unsetenv *
in port1.0/portutil.tcl on Line #394.
So I simply removed the line of code (probably not the best fix):
sed -i "s:unsetenv \*::" ${PREFIX}/share/macports/Tcl/port1.0/portutil.tcl
Seems to run with no problems.
Don't know if anyone would be interested in any of this and not sure that creating a ticket is the right place for this information, but it would be nice to see macports supported on the linux platform as it's a fantastic package management tool.
Attachments (1)
Change History (6)
Changed 15 years ago by mmpestorich (Mike M Pestorich)
Attachment: | macports.patch added |
---|
comment:1 Changed 15 years ago by jmroot (Joshua Root)
Priority: | Not set → Normal |
---|---|
Type: | request → enhancement |
comment:2 Changed 15 years ago by jmroot (Joshua Root)
comment:3 Changed 15 years ago by jmroot (Joshua Root)
Actually, I just realised that tracelib only works on Darwin, and I don't think the sysctls we use exist on non-Darwin either. So just not using this code on other platforms would probably be an easier fix.
comment:4 Changed 15 years ago by afb@…
MacPorts had "support" for Linux added in MacPorts 1.6.0, but it was gradually removed due to lack of interest and now gone. So the only other platform at the moment is FreeBSD, and even that is more or less only for base (and not for the ports)...
comment:5 Changed 15 years ago by jmroot (Joshua Root)
Milestone: | MacPorts Future → MacPorts 1.9.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
This all appears to be fixed in trunk now.
The big thing missing here is the copyright notices from the OpenBSD files these functions were taken from. We can't distribute the code without them. Also, it would probably be good to put these two functions in their own file to make it clear what the different copyright applies to.
Using autoconf to detect whether the host system has these functions and using our own versions only if it does not would be nice, too.