Using Macport on OSX 10.9 - macos

I installed macport following the guide.
http://afitnerd.com/2011/09/06/headless-browser-testing-on-mac/
However, when I try to run
sudo port upgrade
it has error message
Can't map the URL 'file://.' to a port description file ("Could not
find Portfile in /Users").
Please verify that the directory and portfile syntax are correct.
To use the current port, you must be in a port's directory.
How should I switch to the right directory?

sudo port upgrade tells MacPorts to upgrade the port defined by the Portfile in the current directory. It's usually a command only developers use while writing Portfiles. The guide likely meant sudo port upgrade outdated instead to upgrade all non-current ports. Since you don't have any ports installed if this is your first MacPorts installation, you can safely skip the command.
Note that firefox-x11 has meanwhile been removed from MacPorts because it was broken, outdated, and nobody stepped up to maintain it.

Related

Macport RPM macros settings

I installed Macport on my Mac for using RPM. After successful installation (I think), "rpmbuild" and "rpm" command is accessible. But rpmbuild always failed.
I checked "rpm --showrc" and noticed that there are a lot of macros are missing. For example, %__spec_prep_cmd, %__spec_prep_post, %__spec_prep_template. Therefore I have to define all these macros in /opt/local/lib/rpm/macros.
Can someone help me why is that? Do I miss some steps during Macport installation?
Here is my installation steps:
Download OS X 10.8 Mountain Lion version: MacPorts-2.3.1-10.8-MountainLion.pkg
sudo port -v selfupdate
port search rpm
port install rpm54
Edit the default macros file (likely in /opt/local/lib/rpm/macros)
to load (at least) macros.rpmbuild by uncommenting the line that
looks like:
...
#==============================================================================
# ---- rpmbuild macros.
#%%{load:%{_usrlibrpm}/macros.rpmbuild}
...
Remove the leading "#%"

How do I install ack on OS X (10.8.4)?

I am new to OS X and I am unable to figure out how to install ack. The instructions here didn't help, because the command "install" is failing. Please guide me proper commands.
So far, I have downloaded ack 2.04 and placed it in the /usr/bin folder and then ran perl Makefile.PL successfully. The next command install isn't working for me.
If you use Homebrew you can simply do:
$ brew install ack
If you are new to OSX I highly recommend this approach because it makes installation of stuff like this MUCH easier. It is a package manager for OSX.
Homebrew link: http://brew.sh/
You can also use the MacPorts installer for OSX:
sudo port install p5.<nn>-app-ack
where <nn> is the version of your Perl installation (Ack is written in Perl). If you don't know the version of Perl you have installed, just type:
perl --version
and you'll know what you need for the port command. The Ack installation page has the information you need for this. More information about MacPorts can be found here.
Searching the web, you'll find LOTS of opinions about Homebrew versus MacPorts. I've used both; they both work (and both fail occasionally - installation of this kind is complex). You'll need to pick one or the other and stick with it as Homebrew doesn't play nicely with MacPorts (or vice versa, depending on your POV). Overriding choice for me is MacPorts as it has many more packages than Homebrew and it puts its stuff in /opt/local to stay out of the way of other programs. YMMV

Installing Boost port in MacPorts

I just installed MacPorts and am trying to install the boost port. When I type:
sudo port install boost
however, I get an error that says
Unable to open port: invalid command name "compiler.blacklist"
How can I fix this issue? When I try to do the installation in Pallet instead, nothing happens after choosing install and pressing "start."
Thank you for any help you can provide
You're running an outdated version of MacPorts. Run sudo port selfupdate. If that fails, you can try to get more information on the type of failure using sudo port -d selfupdate. If that doesn't help either you can just use the most recent installer from the MacPorts website to update your installation.

fuse4x sshfs on macosx execution error

I'm using sshfs on macosx 10.7 in my every day job.
To install sshfs I have used macport: "port install fuse4x sshfs".
The todays error:
$ sshfs user#domain.com:/path myfolder
fuse4x client library version is incompatible with the kernel extension (kext='0.9.0', library='0.9.2').
Any tips welcomed. I don't understand, I have not updated the system.
Follow
$ brew info fuse4x-kext
instructions:
In order for FUSE-based filesystems to work, the fuse4x kernel
extension must be installed by the root user:
$ sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
$ sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
If upgrading from a previous version of Fuse4x, the old kernel
extension will need to be unloaded before performing the steps listed
above. First, check that no FUSE-based filesystems are running:
$ mount -t fuse4x
Unmount all FUSE filesystems and then unload the kernel extension:
$ sudo kextunload -b org.fuse4x.kext.fuse4x
tl;dr:
try to manually update fuse4x-kect after updating the ports' tree using sync verb
port sync
port upgrade fuse4x-kext
Longer read
The error you pasted means that somehow macports didn't update the kext port fuse4x-kext when it upgraded fuse4x, it should have. I doubt your issue is still actual, since you're likely to have updated since october 2012, you should perform regular ports' upgrades and check when a new macports version is out in order to run a selfupdate verb.
As future reference you can guess what the kext port for a port is by looking at its information
port info fuse4x
or list of dependencies:
port deps fuse4x
Ports offering kexts can be loaded and unloaded from kernel by using load and unload verb.

Sneaky patching source with Macports

For almost as long as I've been using vim and have known enough C, I've customised the installed vim to remove a 'feature' that annoys me.
When I switched to using a Mac with macports, I achieved this by uninstalling any previous vim port, fetching the source, manually editing the source and then having Macports continue the installation, using my freshly customised source.
sh> sudo port uninstall vim
sh> sudo port fetch vim
sh> sudo /usr/bin/vim /opt/local/wherever/port/put/the/source/file.c
sh> sudo port install vim
Now[1] when I try this, the port install command re-fetches the code from the server, completely ignoring my source edits, builds vim with the 'official' source and the annoying 'feature' is still there.
I have looked for checksums for the source, ways to edit the checksums and command line switches to ignore them but without luck.
I have tried port patch rather than port install before editing the code but that made no difference.
I have even found myself reading the port source but my tcl is way too rusty to get far.
Any ideas about how to achieve this?
Thank you.
[1] Macports 2.0.3. I do not know for which version this used to work.
I would advise to create a local portfile for vim and add your changes as a patch that is applied during the build process.
Create a local portfile repository: howto
Copy the vim portfile directory (a directory called "vim" containing the file "Portfile" and directory "files") into your local portfile repository
Create a patch with your changes of the vim source code and add it to the "files" directory.
Edit your local vim Portfile to include the line patchfiles yourpatch.diff
Run portindex again in your local portfile repository
Install vim with port install -s vim
I hope this can help.

Resources