Lua version 5.1.4 - How to Download and Install on Mac OS X
Friday the 13th of November, 2009

    version 5.1.4

      View the most recent changes for the lua port at: lua.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for lua.
      The raw portfile for lua 5.1.4 is located here:
      http://lua.darwinports.com/dports/lang/lua/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/lua


      The lua Portfile 57375 2009-09-10 08:16:41Z ryandesign macports.org $

      PortSystem 1.0

      Name: lua
      Version: 5.1.4
      Category: lang
      Platform: darwin
      Maintainers: pmq openmaintainer

      Description: powerful, lightweight programming language
      Long Description: Lua is a powerful, light-weight programming language designed for extending applications. Lua is also frequently used as a general-purpose, standalone language.

      Homepage: http://www.lua.org
      Master Sites: ${homepage}/ftp/
      Checksums: sha1 2b11c8e60306efb7f0734b747588f57995493db7 rmd160 c867c8364295d3e4fb4e4d8ebb27fa2b2312cdef

      depends_lib port:readline
      build.target macosx

      test.run yes
      test.env DYLD_LIBRARY_PATH=./lib

      post-patch {
      reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
      reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/src/luaconf.h
      reinplace "s|/man/man1|/share/man/man1|g" ${worksrcpath}/Makefile

      # for the pkgconfig file
      reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/etc/lua.pc
      }

      configure {
      reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags}|" ${worksrcpath}/src/Makefile
      reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags}|" ${worksrcpath}/src/Makefile
      reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
      }

      use_parallel_build yes

      destroot.target install INSTALL_TOP=${destroot}${prefix}
      post-destroot {
      xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
      xinstall -m 0644 ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name}
      xinstall -m 0644 ${worksrcpath}/COPYRIGHT ${destroot}${prefix}/share/doc/${name}
      xinstall -m 0644 ${worksrcpath}/HISTORY ${destroot}${prefix}/share/doc/${name}
      xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/html
      foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] {
      xinstall -m 0644 ${html} ${destroot}${prefix}/share/doc/${name}/html
      }
      xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/test
      foreach test [glob ${worksrcpath}/test/README ${worksrcpath}/test/*.lua] {
      xinstall -m 0644 ${test} ${destroot}${prefix}/share/doc/${name}/test
      }
      xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
      xinstall -m 0644 ${worksrcpath}/etc/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua.pc
      }

      platform darwin 7 {
      depends_lib-delete port:readline
      patchfiles-append patch-readline_darwin7.diff
      }

      livecheck.type regex
      livecheck.url ${master_sites}
      livecheck.regex {lua-(\d+(?:\.\d+)*)}

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/lua
      % sudo port install lua
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching lua
      ---> Verifying checksum for lua
      ---> Extracting lua
      ---> Configuring lua
      ---> Building lua with target all
      ---> Staging lua into destroot
      ---> Installing lua
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using lua with these commands:
      %  man lua
      % apropos lua
      % which lua
      % locate lua

     Where to find more information:

    Darwin Ports



    Lightbox this page.