[SCM] pd-hcs/master: Added patch for retrieving sys_searchpath independent of Pd-version
umlaeute at users.alioth.debian.org
umlaeute at users.alioth.debian.org
Thu Aug 24 08:53:14 UTC 2017
The following commit has been merged in the master branch:
commit 83cbacdcafc2a90168761010424e48f5b17b64c2
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date: Thu Aug 24 08:32:12 2017 +0200
Added patch for retrieving sys_searchpath independent of Pd-version
Closes: #872679
diff --git a/debian/extra/searchpath.h b/debian/extra/searchpath.h
new file mode 100644
index 0000000..0f75e31
--- /dev/null
+++ b/debian/extra/searchpath.h
@@ -0,0 +1,31 @@
+#ifndef _HCS_SEARCHPATH_H
+#define _HCS_SEARCHPATH_H
+#include <dlfcn.h>
+#if PD_MAJOR_VERSION==0 && PD_MINOR_VERSION<48
+struct _instancestuff
+{
+ t_namelist *st_externlist;
+ t_namelist *st_searchpath;
+ t_namelist *st_staticpath;
+ t_namelist *st_helppath;
+ /* ... */
+};
+typedef struct _pdinstance
+{
+ double pd_systime; /* SKIP */
+ t_clock *pd_clock_setlist; /* SKIP */
+ t_canvas *pd_canvaslist; /* SKIP */
+ int pd_instanceno; /* SKIP */
+ t_symbol **pd_symhash; /* SKIP */
+ void *pd_midi; /* SKIP */
+ void *pd_inter; /* SKIP */
+ void *pd_ugen; /* SKIP */
+ void *pd_gui; /* SKIP */
+ struct _instancestuff *pd_stuff; /* semi-private stuff in s_stuff.h */
+ /* ... */
+} t_hcs_pdinstance;
+# ifndef t_pdinstance
+# define t_pdinstance t_hcs_pdinstance;
+# endif
+#endif
+#endif /* _HCS_SEARCHPATH_H */
diff --git a/debian/patches/searchpath48.patch b/debian/patches/searchpath48.patch
new file mode 100644
index 0000000..3f64229
--- /dev/null
+++ b/debian/patches/searchpath48.patch
@@ -0,0 +1,99 @@
+Description: Pd-version independent access to sys_searchpath and similar
+Author: IOhannes m zmölnig
+Forwarded: no
+Last-Update: 2017-08-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- pd-hcs.orig/classpath.c
++++ pd-hcs/classpath.c
+@@ -23,8 +23,10 @@
+ /* */
+ /* --------------------------------------------------------------------------*/
+
++#define _GNU_SOURCE
+ #include "m_pd.h"
+ #include "s_stuff.h"
++#include "searchpath.h"
+
+ #include <string.h>
+
+@@ -38,6 +40,16 @@
+ #endif
+ */
+
++t_namelist *hcs_searchpath = 0;
++t_namelist*get_namelist() {
++ t_pdinstance* inst = dlsym(RTLD_DEFAULT, "pd_maininstance");
++ if(inst) {
++ return inst->pd_stuff->st_searchpath;
++ }
++ return dlsym(RTLD_DEFAULT, "sys_searchpath");
++}
++
++
+ static char *version = "$Revision: 1.3 $";
+
+ t_int classpath_instance_count;
+@@ -87,7 +99,7 @@
+ strncpy(buffer, sys_libdir->s_name, MAXPDSTRING - 6);
+ strcat(buffer, "/extra");
+ x->x_top = namelist_append(NULL, buffer, 0);
+- x->x_top->nl_next = sys_searchpath;
++ x->x_top->nl_next = hcs_searchpath;
+ x->x_current = x->x_top;
+ }
+
+@@ -144,5 +156,7 @@
+ gensym("rewind"), 0);
+ class_addmethod(classpath_class,(t_method) classpath_add,gensym("add"),
+ A_DEFSYMBOL, 0);
++
++ hcs_searchpath = get_namelist();
+ }
+
+--- pd-hcs.orig/helppath.c
++++ pd-hcs/helppath.c
+@@ -21,8 +21,10 @@
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#define _GNU_SOURCE
+ #include "m_pd.h"
+ #include "s_stuff.h"
++#include "searchpath.h"
+
+ #include <string.h>
+
+@@ -36,6 +38,15 @@
+ #endif
+ */
+
++t_namelist *hcs_searchpath = 0;
++t_namelist*get_namelist() {
++ t_pdinstance* inst = dlsym(RTLD_DEFAULT, "pd_maininstance");
++ if(inst) {
++ return inst->pd_stuff->st_helppath;
++ }
++ return dlsym(RTLD_DEFAULT, "sys_helppath");
++}
++
+ static char *version = "$Revision: 1.1 $";
+
+ #define DEBUG(x)
+@@ -81,7 +92,7 @@
+ {
+ DEBUG(post("helppath_reset"););
+
+- x->x_current = x->x_top = sys_helppath;
++ x->x_current = x->x_top = hcs_searchpath;
+ }
+
+
+@@ -132,5 +143,7 @@
+ post("\tcompiled on "__DATE__" at "__TIME__ " ");
+ post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION,
+ PD_MINOR_VERSION, PD_BUGFIX_VERSION);
++
++ hcs_searchpath = get_namelist();
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index f3ba049..9b3a9c9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
+searchpath48.patch
reproducible_builddate.patch
spelling.patch
--
pd-hcs packaging
More information about the pkg-multimedia-commits
mailing list