[SCM] pd-creb/master: Fixed adding-creb-to-pdpath patch

umlaeute at users.alioth.debian.org umlaeute at users.alioth.debian.org
Wed Aug 23 11:16:56 UTC 2017


The following commit has been merged in the master branch:
commit 840afb72445457ac398887bd9148fe2f3faea039
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date:   Wed Aug 23 12:48:08 2017 +0200

    Fixed adding-creb-to-pdpath patch
    
    Closes: #872673

diff --git a/debian/patches/creb_object.patch b/debian/patches/creb_object.patch
index f5023e2..6e13af6 100644
--- a/debian/patches/creb_object.patch
+++ b/debian/patches/creb_object.patch
@@ -6,7 +6,7 @@ Last-Update: 2015-10-27
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- pd-creb.orig/modules/setup.c
 +++ pd-creb/modules/setup.c
-@@ -43,6 +43,53 @@
+@@ -43,6 +43,82 @@
  #define CREB_VERSION "externals cvs"
  #endif
  
@@ -14,6 +14,33 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 +#include <fcntl.h>
 +#include "s_stuff.h"
 +
++#if PD_MAJOR_VERSION>0 || PD_MINOR_VERSION>47
++/* gone from the headers, but still present for binary compat */
++extern t_namelist *sys_searchpath;
++#endif
++static int _add_search_path(const char*libpath){
++    int major, minor, bugfix;
++    sys_getversion(&major, &minor, &bugfix);
++    if((major==0 && minor < 48)) {
++        sys_searchpath = namelist_append(sys_searchpath, libpath, 0);
++    } else {
++        char encoded[MAXPDSTRING];
++        char *inptr = libpath, *outptr = encoded;
++        t_atom ap[2];
++        *outptr++='+';
++        while(inptr && ((outptr+2) < (encoded+MAXPDSTRING))) {
++            *outptr++ = *inptr++;
++            if ('+'==inptr[-1])
++                 *outptr++='+';
++        }
++        *outptr=0;
++        SETSYMBOL(ap+0, gensym(encoded));
++        SETFLOAT(ap+1, 0.f);
++        pd_typedmess(gensym("pd")->s_thing, gensym("add-to-path"), 2, ap);
++    }
++    return 1;
++}
++
 +static t_class *creb_class;
 +static void*creb_class_new(void)
 +{
@@ -48,8 +75,10 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 +  if ((fd=sys_open(buf, O_RDONLY))>=0){
 +    sys_close(fd);
 +    logpost(NULL, 3, "CREB: adding '%s' to your search-path", libpath);
-+    sys_searchpath = namelist_append(sys_searchpath, libpath, 0);
-+  } else {
++    if(!_add_search_path(libpath))
++      fd=-1;
++  }
++  if (fd<0) {
 +    // can't find this abstraction...giving up
 +    logpost(NULL, 1, "CREB: cannot find creb-abstractions");
 +    logpost(NULL, 3, "CREB: please add path to '%s' to your search-path!", absname);
@@ -60,7 +89,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  
  void creb_setup(void)
  {
-@@ -95,4 +142,5 @@
+@@ -95,4 +171,5 @@
    abs_tilde_setup();
  #endif
  

-- 
pd-creb packaging



More information about the pkg-multimedia-commits mailing list