Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2021 11:22:11 +0000 (UTC)
From:      =?UTF-8?Q?Fernando_Apestegu=c3=ada?= <fernape@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r562196 - in head/devel/serd: . files
Message-ID:  <202101211122.10LBMB9G086962@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fernape
Date: Thu Jan 21 11:22:11 2021
New Revision: 562196
URL: https://svnweb.freebsd.org/changeset/ports/562196

Log:
  devel/serd: Patch for aligned_alloc removal
  
  The aligned_alloc is removed in the upstream in the c4c4ec51 commit. It creates
  problems for MacOS and FreeBSD, apparently. This patch is recreating that commit
  using makepatch, as latest version (0.30.8) and master diverged too much to
  apply just that commit (I tried, and failed with PATCHFILES).
  
  PR:	252859
  Submitted by:	meka@tilda.center (maintainer)

Added:
  head/devel/serd/files/
  head/devel/serd/files/patch-src_serd__config.h   (contents, props changed)
  head/devel/serd/files/patch-src_system.c   (contents, props changed)
  head/devel/serd/files/patch-wscript   (contents, props changed)
Modified:
  head/devel/serd/distinfo

Modified: head/devel/serd/distinfo
==============================================================================
--- head/devel/serd/distinfo	Thu Jan 21 11:06:07 2021	(r562195)
+++ head/devel/serd/distinfo	Thu Jan 21 11:22:11 2021	(r562196)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1610101696
+TIMESTAMP = 1611145297
 SHA256 (serd-0.30.8.tar.bz2) = 672ec48f55f6f5bf1b548f3d6a76f127e803dbae2550ddb730bb02d2fd28fa87
 SIZE (serd-0.30.8.tar.bz2) = 590817

Added: head/devel/serd/files/patch-src_serd__config.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/serd/files/patch-src_serd__config.h	Thu Jan 21 11:22:11 2021	(r562196)
@@ -0,0 +1,33 @@
+--- src/serd_config.h.orig	2021-01-20 12:23:24 UTC
++++ src/serd_config.h
+@@ -44,17 +44,6 @@
+ #    endif
+ #  endif
+ 
+-// C99 and C++11: aligned_alloc()
+-#  ifndef HAVE_ALIGNED_ALLOC
+-#    if !defined(__APPLE__) && !defined(_WIN32)
+-#      if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+-#        define HAVE_ALIGNED_ALLOC
+-#      elif defined(__cplusplus) && __cplusplus >= 201103L)
+-#        define HAVE_ALIGNED_ALLOC
+-#      endif
+-#    endif
+-#  endif
+-
+ // POSIX.1-2001: fileno()
+ #  ifndef HAVE_FILENO
+ #    if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
+@@ -87,12 +76,6 @@
+   and this header is always required by any code that checks for features, even
+   if the build system defines them all.
+ */
+-
+-#ifdef HAVE_ALIGNED_ALLOC
+-#  define USE_ALIGNED_ALLOC 1
+-#else
+-#  define USE_ALIGNED_ALLOC 0
+-#endif
+ 
+ #ifdef HAVE_FILENO
+ #  define USE_FILENO 1

Added: head/devel/serd/files/patch-src_system.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/serd/files/patch-src_system.c	Thu Jan 21 11:22:11 2021	(r562196)
@@ -0,0 +1,11 @@
+--- src/system.c.orig	2021-01-20 12:24:18 UTC
++++ src/system.c
+@@ -55,8 +55,6 @@ serd_malloc_aligned(const size_t alignment, const size
+ {
+ #if defined(_WIN32)
+   return _aligned_malloc(size, alignment);
+-#elif USE_ALIGNED_ALLOC
+-  return aligned_alloc(alignment, size);
+ #elif USE_POSIX_MEMALIGN
+   void*     ptr = NULL;
+   const int ret = posix_memalign(&ptr, alignment, size);

Added: head/devel/serd/files/patch-wscript
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/serd/files/patch-wscript	Thu Jan 21 11:22:11 2021	(r562196)
@@ -0,0 +1,16 @@
+--- wscript.orig	2021-01-20 12:26:07 UTC
++++ wscript
+@@ -123,13 +123,6 @@ def configure(conf):
+     if Options.options.largefile:
+         conf.env.append_unique('DEFINES', ['_FILE_OFFSET_BITS=64'])
+ 
+-    conf.check_function('c', 'aligned_alloc',
+-                        header_name = 'stdlib.h',
+-                        return_type = 'void*',
+-                        arg_types   = 'size_t,size_t',
+-                        define_name = 'HAVE_ALIGNED_ALLOC',
+-                        mandatory   = False)
+-
+     if not Options.options.no_posix:
+         funcs = {'posix_memalign': ('stdlib.h', 'int', 'void**,size_t,size_t'),
+                  'posix_fadvise':  ('fcntl.h', 'int', 'int,off_t,off_t,int'),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101211122.10LBMB9G086962>