[MacPorts] #58550: lighttpd @1.4.54 does not build on PPC Tiger, Mac OS X 10.4.11, because of timespec type problems

MacPorts noreply at macports.org
Tue Jun 11 08:49:05 UTC 2019


#58550: lighttpd @1.4.54 does not build on PPC Tiger, Mac OS X 10.4.11, because of
timespec type problems
------------------------+------------------------
  Reporter:  ballapete  |      Owner:  ryandesign
      Type:  defect     |     Status:  assigned
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.5.4
Resolution:             |   Keywords:  tiger
      Port:  lighttpd   |
------------------------+------------------------

Comment (by gstrauss):

 The lighttpd maintainers (myself included) are unable to make small
 portability changes if nobody reports issues to us.

 Please report lighttpd issues on the lighttpd forums
 (https://redmine.lighttpd.net/projects/lighttpd/boards) or #lighttpd on
 freenode.

 The following should handle the missing timespec definition.  It's not
 required in OS X 10.14 Mojave.

 {{{
 diff --git a/src/base.h b/src/base.h
 index f21973bf..5d58514d 100644
 --- a/src/base.h
 +++ b/src/base.h
 @@ -6,6 +6,9 @@

  #include <sys/types.h>
  #include <sys/time.h>
 +#if defined(__APPLE__) && defined(__MACH__)
 +#include <time.h>
 +#endif

  #include "base_decls.h"
  #include "buffer.h"
 }}}

 For Mac OS X earlier than 10.5, you'll have to patch lighttpd mod_webdav
 not to use fcopyfile(), which is easy to do (patch below).  lighttpd
 mod_webdav will handle file copying internally if fcopyfile() is not
 available.

 {{{
 diff --git a/src/mod_webdav.c b/src/mod_webdav.c
 index 16f74170..5488db06 100644
 --- a/src/mod_webdav.c
 +++ b/src/mod_webdav.c
 @@ -2011,7 +2011,7 @@ webdav_prop_select_propnames (const plugin_config *
 const pconf,
  }


 -#if defined(__APPLE__) && defined(__MACH__)
 +#if defined(__APPLE__) && defined(__MACH__) && 0
  #include <copyfile.h>     /* fcopyfile() *//* OS X 10.5+ */
  #endif
  #ifdef HAVE_ELFTC_COPYFILE/* __FreeBSD__ */
 @@ -2044,7 +2044,7 @@ webdav_fcopyfile_sz (int ifd, int ofd, off_t isz)
      /*fcntl(ofd, F_SETFL, fcntl(ofd, F_GETFL, 0) & ~O_NONBLOCK);*/
    #endif

 -  #if defined(__APPLE__) && defined(__MACH__)
 +  #if defined(__APPLE__) && defined(__MACH__) && 0
      if (0 == fcopyfile(ifd, ofd, NULL, COPYFILE_ALL))
          return 0;

 }}}

 As for other missing functions, the POSIX 2008 (yes 2008, over 10 years
 ago) spec defines linkat() fstatat() unlinkat() fdopendir() and associated
 defines.  Most operating systems supported these functions many, many
 years before they became part of the POSIX 2008 standard.  OS X 10.5
 Leopard was released Oct 26, 2007.  OS X 10.6 Snow Leopard was released
 Aug 28, 2009, so perhaps lighttpd mod_webdav will now work only with OS X
 10.6 Snow Leopard or later.  These functions were created to avoid race
 conditions in filesystem manipulation.  It would take some work to provide
 crippled replacements for these functions for lighttpd mod_webdav.  An
 alternative for OS X 10.5 Leopard and earlier might be to simply remove
 mod_webdav from the build for OS X before OS X 10.6.

 {{{
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
 @@ -147,11 +147,11 @@ mod_evasive_la_SOURCES = mod_evasive.c
  mod_evasive_la_LDFLAGS = $(common_module_ldflags)
  mod_evasive_la_LIBADD = $(common_libadd)

 -lib_LTLIBRARIES += mod_webdav.la
 -mod_webdav_la_SOURCES = mod_webdav.c
 -mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS)
 -mod_webdav_la_LDFLAGS = $(common_module_ldflags)
 -mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS)
 $(UUID_LIBS) $(ELFTC_LIB)
 +#lib_LTLIBRARIES += mod_webdav.la
 +#mod_webdav_la_SOURCES = mod_webdav.c
 +#mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS)
 +#mod_webdav_la_LDFLAGS = $(common_module_ldflags)
 +#mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS)
 $(UUID_LIBS) $(ELFTC_LIB)

  if BUILD_WITH_LUA
  lib_LTLIBRARIES += mod_magnet.la
 }}}

 As an aside, please note that there is a bug in the new lighttpd
 mod_webdav, which will also be fixed in the upcoming lighttpd 1.4.55.  A
 patch is posted in https://redmine.lighttpd.net/issues/2958

-- 
Ticket URL: <https://trac.macports.org/ticket/58550#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list