0

Recently, I have been trying to install WordGrinder on Yosemite. First I tried getting the latest tar packages from the developers' website and using them, but I ran into some library linking errors with lua and ncursesw. I tried using MacPorts because I assumed that it would do all of that for me, but it turns out that the problems I encountered first were just confusion left over from some earlier dirty MacPorts installs - I ran port selfupdate and those went away. After yet more difficulty with MacPorts, I decided to reconsider building from source. But now, when I use make, I get the following series of errors:

Maat:wordgrinder-0.5.1 Matt$ make
CC .obj/release/src/c/arch/unix/cursesw/dpy.o
error: unable to open output file '.obj/release/src/c/arch/unix/cursesw/dpy.o': 'Error opening output file '.obj/release/src/c/arch/unix/cursesw/dpy.o': Permission denied'
1 error generated.
make: *** [.obj/release/src/c/arch/unix/cursesw/dpy.o] Error 1
Maat:wordgrinder-0.5.1 Matt$ sudo make
CC .obj/release/src/c/arch/unix/cursesw/dpy.o
src/c/arch/unix/cursesw/dpy.c:164:8: error: use of undeclared identifier 'KEY_EVENT'
                case KEY_EVENT: return "KEY_EVENT";
                     ^
1 error generated.
make: *** [.obj/release/src/c/arch/unix/cursesw/dpy.o] Error 1
Maat:wordgrinder-0.5.1 Matt$ 

First, I have to use sudo to get the compiler to access the output file (I don't think I am supposed to have to do that, but not the main issue), and then, when I do, I run into the other one, about the "use of undeclared identifier 'KEY_EVENT'". I went over the makefile and the README.Unix several times, but I can't make head nor tail of it. I read in another, unrelated issue with installing WordGrinder on OS X that "building on Mac is a pig," and now I can't help but agree. What is going wrong, and how can I get WordGrinder to install properly on OS X?

EDIT 3: In the end, I wiped my convoluted /usr/local and /opt folders and reorganized a large portion of my filesystem. I installed Homebrew on the clean slate I had created, then installed lua and Homebrew/dupes/ncurses using Homebrew as per the steps Alistair listed in his answer. I then downloaded wordgrinder-0.5.2.1 instead of wordgrinder-0.5.1, because 0.5.2.1 had added Homebrew installation support. No more issues with the backspace key. At this point, wordgrinder-static would run, but wordgrinder wouldn't (again, as Alistair reported). Installing luafilesystem allowed wordgrinder to run, as I predicted in an earlier revision of this answer. I used Homebrew to install luarocks in my Cellar (brew install luarocks) and then used luarocks to install luafileystem in my /usr/local/lib/luarocks/rocks directory. wordgrinder now runs perfectly well, with no issues.

Many thanks to Alistair for all the help. I did learn a lot more than I already did in the process of trying to get this to work, and may be able to take on the rest myself - as I said earlier, I will document my results here as I come up with them.

2 Answers 2

2

UPDATE: As pointed out by Matthew below, the recently released 0.5.2.1 has better support for OS X and brew now, so downloading, extracting wordgrinder-0.5.2.1.tar.bz2 from http://sourceforge.net/projects/wordgrinder/files/wordgrinder/ and running make should work. The only dependency you need to install through brew now seems to be lua, so brew install lua first if you don't already have lua installed.

ORIGINAL: Here's how I got it to work with the previous version...

  • Downloaded and extracted the wordgrinder-0.5.1.tar.bz2 file from http://sourceforge.net/projects/wordgrinder/files/wordgrinder/
  • Used brew to install lua: brew install lua
  • Used brew to install ncurses from homebrew-dupes: brew install homebrew/dupes/ncurses
  • Made the following modifications to the Makefile. You can download the modified file here.
    • added a definition of z_crc_t
    • modified LDFLAGS so it can find libraries installed through brew
    • modified CPPFLAGS and INCLUDES so it can find include files installed through brew
    • modified ldflags because it is looking for "lua5.2" but the library on OS X is called "lua.5.2"
  • Ran make which runs okay with these changes. bin/wordgrinder crashes right away but bin/wordgrinder-static seems to run okay.
  • 'sudo make install' fails, so I just copied wordgrinder-static to /usr/local/bin and it appears to work successfully there.
9
  • Can you tell us exactly what you are doing? You download the source (I'm assuming into your Downloads folder), extract it, cd into it, type make and get permission denied errors? Jan 28, 2015 at 15:19
  • That is exactly what I am doing. Sorry, but if you haven't already gathered, I am (relatively, not entirely) new to building and installing from source.
    – Matt
    Jan 28, 2015 at 15:23
  • Sorry, I'm more confused why make isn't working for you than anything else. Where are you putting the source files extracted from wordgrinder-0.5.1.tar.bz2? Jan 28, 2015 at 16:16
  • I have a folder on my desktop called temp. In that folder is my copy of wordgrinder-0.5.1.bz2 and a folder called wordgrinder-0.5.1. The last folder I mentioned is where the files extracted from the bz2 are stored and from which I am running make.
    – Matt
    Jan 28, 2015 at 17:04
  • If you go into that wordgrinder-0.5.1 folder in Terminal and type ls -al what do the permissions look like? All the folders should be drwxr-xr-x@ (for the ones that came from the download) or drwxr-xr-x (for the ones created by make) and all the files should be -rw-r--r--@. Jan 28, 2015 at 18:30
1

Based on the information Alistair and Matthew already provided, I was able to install wordgrinder under both Mavericks and Yosemite through a combination of the two methods he described. In fact, I was able to run wordgrinder, not just wordgrinder-static. Steps to reproduce:

brew install lua
brew install Homebrew/dupes/ncurses
brew install luarocks
brew install zlib
luarocks install luafilesystem

and then, in the extracted wordgrinder-0.5.2.1 folder.

make
sudo make install PREFIX=/usr

Alistair and Matthew provided more useful information here than I was able to locate in any number of forums and mailing lists.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .