File fix-install-dirs-2014.patch of Package essentia

Index: essentia-2.1.0+git20141119.ca2783d9/src/examples/wscript
===================================================================
--- essentia-2.1.0+git20141119.ca2783d9.orig/src/examples/wscript
+++ essentia-2.1.0+git20141119.ca2783d9/src/examples/wscript
@@ -2,6 +2,7 @@
 # -*- coding: utf-8 -*-
 
 import distutils.sysconfig
+from waflib import Utils
 import os
 import sys
 
@@ -122,10 +123,10 @@ def build(ctx):
                 includes.append("../..")
 
             ctx.program(source  = ctx.path.ant_glob(' '.join(files)),
-                        target  = prog_name,
+                        target  = 'essentia_' + prog_name,
                         includes = includes,
                         use      = 'essentia ' + ctx.env.USES,
-                        install_path = None)
+                        install_path = '${PREFIX}/bin')
 
         for e in example_sources + example_sources_with_gaia:
             if e[0] in ctx.env.EXAMPLE_LIST:
@@ -136,21 +137,18 @@ def build(ctx):
 
 
     if ctx.env.WITH_VAMP:
-        ctx.env.INCLUDES += [ '3rdparty/vamp-plugin-sdk-2.4' ]
-
-        vamp_sdk_files   = ctx.path.parent.ant_glob('3rdparty/vamp-plugin-sdk-2.4/src/vamp-sdk/*.cpp')
-        # remove this file, it is already included by FFT.cpp
-        vamp_sdk_files = [ f for f in vamp_sdk_files if os.path.basename(f.srcpath()) != 'FFTimpl.cpp' ]
-
         if sys.platform == 'darwin':
             install_path = os.environ['HOME'] + '/Library/Audio/Plug-Ins/Vamp'
+        elif sys.platform.startswith('linux'):
+            install_path = '${PREFIX}/lib%s/vamp' % Utils.lib64()
         else:
             install_path = None
 
         vamp = ctx.shlib(
-            source   = ctx.path.ant_glob('vamp*.cpp') + vamp_sdk_files,
+            source   = ctx.path.ant_glob('vamp*.cpp'),
             target   = 'vamp_essentia',
-            includes = [ '.', '..', '../3rdparty/vamp-plugin-sdk-2.4' ],
+            includes = [ '.', '..' ],
             use      = 'essentia ' + ctx.env.USES,
+            uselib   = 'vamp-sdk',
             install_path = install_path
         )
Index: essentia-2.1.0+git20141119.ca2783d9/src/python/wscript
===================================================================
--- essentia-2.1.0+git20141119.ca2783d9.orig/src/python/wscript
+++ essentia-2.1.0+git20141119.ca2783d9/src/python/wscript
@@ -38,10 +38,10 @@ def build(ctx):
         features = 'pyext',
         includes = NUMPY_INCPATH + [ '.', 'pytypes' ] + adjust(ctx.env.INCLUDES, '..'),
         cxxflags = [ '-w' ],
-        install_path = '${PYTHONDIR}/essentia',
+        install_path = '${PYTHONARCHDIR}/essentia',
         use      = 'essentia ' + ctx.env.USES
     )
 
     # FIXME: this doesn't install in the active virtualenv but in the system python...
-    ctx.install_files('${PYTHONDIR}', ctx.path.ant_glob('essentia/**/*.py'),
+    ctx.install_files('${PYTHONARCHDIR}', ctx.path.ant_glob('essentia/**/*.py'),
                       relative_trick=True)
Index: essentia-2.1.0+git20141119.ca2783d9/src/wscript
===================================================================
--- essentia-2.1.0+git20141119.ca2783d9.orig/src/wscript
+++ essentia-2.1.0+git20141119.ca2783d9/src/wscript
@@ -3,6 +3,7 @@
 
 import sys
 import os.path
+from waflib import Utils
 
 
 def options(ctx):
@@ -230,7 +231,7 @@ def build(ctx):
         source   = sources,
         target   = 'essentia',
         use      = ctx.env.USES,
-        install_path = '${PREFIX}/lib',
+        install_path = '${PREFIX}/lib%s' % Utils.lib64(),
         #includes = ctx.env.includes
     )
 
@@ -252,7 +253,7 @@ def build(ctx):
     # install pkgconfig file
     #pc = ctx.path.ant_glob('essentia/build/essentia.pc') #TODO remove
     #ctx.install_files('${PREFIX}/lib/pkgconfig', pc)     #TODO remove
-    ctx.install_files('${PREFIX}/lib/pkgconfig', '../essentia.pc')
+    ctx.install_files('${PREFIX}/lib%s/pkgconfig' % Utils.lib64(), '../essentia.pc')
 
 
     if ctx.env.EXAMPLE_LIST or ctx.env.WITH_VAMP:
Index: essentia-2.1.0+git20141119.ca2783d9/src/algorithms/rhythm/tempotapdegara.h
===================================================================
--- essentia-2.1.0+git20141119.ca2783d9.orig/src/algorithms/rhythm/tempotapdegara.h
+++ essentia-2.1.0+git20141119.ca2783d9/src/algorithms/rhythm/tempotapdegara.h
@@ -65,7 +65,7 @@ class TempoTapDegara : public Algorithm
   // Davies' beat periods estimation:
   int _smoothingWindowHalfSize;
   static const int _numberCombs = 4;
-  static const Real _frameDurationODF = 5.944308390022676;
+  static constexpr Real _frameDurationODF = 5.944308390022676;
   Real _sampleRateODF;
   int _hopSizeODF;
   Real _hopDurationODF;
@@ -92,8 +92,8 @@ class TempoTapDegara : public Algorithm
   void adaptiveThreshold(std::vector<Real>& array, int smoothingHalfSize);
 
   // Degara's beat tracking from periods:
-  static const Real _alpha = 0.5; // decoding weighting parameter
-  static const Real _sigma_ibi = 0.025; // std of the inter-beat interval pdf,
+  static constexpr Real _alpha = 0.5; // decoding weighting parameter
+  static constexpr Real _sigma_ibi = 0.025; // std of the inter-beat interval pdf,
                                        // models potential variations in the
                                        // inter-beat interval in secs.
   int _numberStates;    // number HMM states
Index: essentia-2.1.0+git20141119.ca2783d9/src/algorithms/rhythm/tempotapmaxagreement.h
===================================================================
--- essentia-2.1.0+git20141119.ca2783d9.orig/src/algorithms/rhythm/tempotapmaxagreement.h
+++ essentia-2.1.0+git20141119.ca2783d9/src/algorithms/rhythm/tempotapmaxagreement.h
@@ -53,7 +53,7 @@ class TempoTapMaxAgreement : public Algo
   static const char* description;
 
  private:
-  static const Real _minTickTime = 5.;  // ignore peaks before this time [s]
+  static constexpr Real _minTickTime = 5.;  // ignore peaks before this time [s]
   static const int _numberBins = 40; // number of histogram bins for information gain method
                                      // corresponds to Log2(40) = 5.32 maximum
                                      // confidence value
@@ -62,8 +62,8 @@ class TempoTapMaxAgreement : public Algo
   std::vector<Real> _binValues;
 
   // parameters for the continuity-based method
-  static const Real _phaseThreshold = 0.175; // size of tolerance window for beat phase
-  static const Real _periodThreshold = 0.175; // size of tolerance window for beat period
+  static constexpr Real _phaseThreshold = 0.175; // size of tolerance window for beat phase
+  static constexpr Real _periodThreshold = 0.175; // size of tolerance window for beat period
 
   Real computeBeatInfogain(std::vector<Real>& ticks1, std::vector<Real>& ticks2);
 
Index: essentia-2.1.0+git20141119.ca2783d9/wscript
===================================================================
--- essentia-2.1.0+git20141119.ca2783d9.orig/wscript
+++ essentia-2.1.0+git20141119.ca2783d9/wscript
@@ -159,10 +159,15 @@ def build(ctx):
     print('→ building from ' + ctx.path.abspath())
 
     # missing -lpthread flag on Ubuntu
-    if platform.dist()[0] == 'Ubuntu':
-        ext_paths = ['/usr/lib/i386-linux-gnu', '/usr/lib/x86_64-linux-gnu']
-        ctx.read_shlib('pthread', paths=ext_paths)
-        ctx.env.USES += ' pthread'
+    #if platform.dist()[0] == 'Ubuntu':
+    #    ext_paths = ['/usr/lib/i386-linux-gnu', '/usr/lib/x86_64-linux-gnu']
+    #    ctx.read_shlib('pthread', paths=ext_paths)
+    #    ctx.env.USES += ' pthread'
+    if sys.platform.startswith('linux'):
+        # include -pthread flag because not all versions of gcc provide it automatically
+        ctx.env.CXXFLAGS += ['-pthread']
+        ctx.env.LINKFLAGS += ['-pthread']
+
 
     ctx.recurse('src')
 
openSUSE Build Service is sponsored by