Package init

This commit is contained in:
overweight 2019-09-30 10:58:59 -04:00
commit eb23c2a63a
5 changed files with 213 additions and 0 deletions

View File

@ -0,0 +1,69 @@
--- libvisual-0.4.0/libvisual/lv_cpu.c.orig 2006-01-22 13:23:37.000000000 +0000
+++ libvisual-0.4.0/libvisual/lv_cpu.c 2008-03-11 16:00:56.000000000 +0000
@@ -50,8 +50,19 @@
#endif
#if defined(VISUAL_OS_LINUX)
+#if defined(VISUAL_ARCH_POWERPC)
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include <linux/auxvec.h>
+#include <asm/cputable.h>
+#else /* VISUAL_ARCH_POWERPC */
#include <signal.h>
#endif
+#endif
#if defined(VISUAL_OS_WIN32)
#include <windows.h>
@@ -154,6 +165,46 @@ static void check_os_altivec_support( vo
if (err == 0)
if (has_vu != 0)
__lv_cpu_caps.hasAltiVec = 1;
+#elif defined (VISUAL_OS_LINUX)
+ static int available = -1;
+ int new_avail = 0;
+ char fname[64];
+ unsigned long buf[64];
+ ssize_t count;
+ pid_t pid;
+ int fd, i;
+
+ if (available != -1)
+ return;
+
+ pid = getpid();
+ snprintf(fname, sizeof(fname)-1, "/proc/%d/auxv", pid);
+
+ fd = open(fname, O_RDONLY);
+ if (fd < 0)
+ goto out;
+more:
+ count = read(fd, buf, sizeof(buf));
+ if (count < 0)
+ goto out_close;
+
+ for (i=0; i < (count / sizeof(unsigned long)); i += 2) {
+ if (buf[i] == AT_HWCAP) {
+ new_avail = !!(buf[i+1] & PPC_FEATURE_HAS_ALTIVEC);
+ goto out_close;
+ } else if (buf[i] == AT_NULL) {
+ goto out_close;
+ }
+ }
+
+ if (count == sizeof(buf))
+ goto more;
+out_close:
+ close(fd);
+out:
+ available = new_avail;
+ if (available)
+ __lv_cpu_caps.hasAltiVec = 1;
#else /* !VISUAL_OS_DARWIN */
/* no Darwin, do it the brute-force way */
/* this is borrowed from the libmpeg2 library */

View File

@ -0,0 +1,17 @@
diff -up libvisual-0.4.0/libvisual/lv_plugin.c.format-security libvisual-0.4.0/libvisual/lv_plugin.c
--- libvisual-0.4.0/libvisual/lv_plugin.c.format-security 2014-06-11 15:38:36.786199952 -0400
+++ libvisual-0.4.0/libvisual/lv_plugin.c 2014-06-11 15:38:45.990132144 -0400
@@ -442,11 +442,11 @@ VisList *visual_plugin_registry_filter (
visual_list_add (list, ref);
} else if (ret != FALSE) {
- visual_log (VISUAL_LOG_WARNING, visual_error_to_string (ret));
+ visual_log (VISUAL_LOG_WARNING, "%s", visual_error_to_string (ret));
}
}
else if (ret != FALSE) { /* FIXME XXX TODO, patch frmo duilio check how this works */
- visual_log (VISUAL_LOG_WARNING, visual_error_to_string (ret));
+ visual_log (VISUAL_LOG_WARNING, "%s", visual_error_to_string (ret));
}
}

View File

@ -0,0 +1,61 @@
diff -ru libvisual-0.4.0.orig/libvisual/lv_cache.c libvisual-0.4.0/libvisual/lv_cache.c
--- libvisual-0.4.0.orig/libvisual/lv_cache.c 2009-03-07 17:17:38.000000000 +0000
+++ libvisual-0.4.0/libvisual/lv_cache.c 2009-03-07 17:25:26.000000000 +0000
@@ -32,7 +32,7 @@
static int cache_dtor (VisObject *object);
static int cache_remove_list_entry (VisCache *cache, VisListEntry **le);
-static inline void handle_request_reset (VisCache *cache, VisListEntry *le);
+static lv_inline void handle_request_reset (VisCache *cache, VisListEntry *le);
static int cache_dtor (VisObject *object)
{
@@ -74,7 +74,7 @@
}
-static inline void handle_request_reset (VisCache *cache, VisListEntry *le)
+static lv_inline void handle_request_reset (VisCache *cache, VisListEntry *le)
{
VisCacheEntry *centry;
diff -ru libvisual-0.4.0.orig/libvisual/lv_defines.h libvisual-0.4.0/libvisual/lv_defines.h
--- libvisual-0.4.0.orig/libvisual/lv_defines.h 2009-03-07 17:17:38.000000000 +0000
+++ libvisual-0.4.0/libvisual/lv_defines.h 2009-03-07 17:24:17.000000000 +0000
@@ -63,13 +63,13 @@
/* Compiler specific optimalization macros */
#if __GNUC__ >= 3
-# define inline inline __attribute__ ((always_inline))
+# define lv_inline inline __attribute__ ((always_inline))
# define __malloc __attribute__ ((malloc))
# define __packed __attribute__ ((packed))
# define VIS_LIKELY(x) __builtin_expect (!!(x), 1)
# define VIS_UNLIKELY(x) __builtin_expect (!!(x), 0)
#else
-# define inline /* no inline */
+# define lv_inline /* no inline */
# define __malloc /* no malloc */
# define __packed /* no packed */
# define VIS_LIKELY(x) (x)
diff -ru libvisual-0.4.0.orig/libvisual/lv_time.h libvisual-0.4.0/libvisual/lv_time.h
--- libvisual-0.4.0.orig/libvisual/lv_time.h 2009-03-07 17:17:38.000000000 +0000
+++ libvisual-0.4.0/libvisual/lv_time.h 2009-03-07 17:25:15.000000000 +0000
@@ -101,7 +101,7 @@
*
* @return Nothing.
*/
-static inline void visual_timer_tsc_get (uint32_t *lo, uint32_t *hi)
+static lv_inline void visual_timer_tsc_get (uint32_t *lo, uint32_t *hi)
{
#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
__asm __volatile
@@ -115,7 +115,7 @@
}
/* FIXME use uint64_t here, make sure type exists */
-static inline unsigned long long visual_timer_tsc_get_returned ()
+static lv_inline unsigned long long visual_timer_tsc_get_returned ()
{
uint32_t lo, hi;

BIN
libvisual-0.4.0.tar.gz Normal file

Binary file not shown.

66
libvisual.spec Normal file
View File

@ -0,0 +1,66 @@
Name: libvisual
Version: 0.4.0
Release: 26
Epoch: 1
Summary: Audio Visualization Library
License: LGPLv2+
URL: http://libvisual.org/
Source0: http://dl.sf.net/libvisual/%{name}-%{version}.tar.gz
Patch0: libvisual-0.4.0-better-altivec-detection.patch
Patch1: libvisual-0.4.0-inlinedefineconflict.patch
Patch2: libvisual-0.4.0-format-security.patch
BuildRequires: libtool gettext gcc-c++ xorg-x11-proto-devel doxygen
%description
Libvisual is a library that acts as a middle layer between applications
that want audio visualization, and audio visualization plugins. It is
middleware aimed at providing a common interface between application
developers with a need for audio visualization and developers who write
visualizations.
%package devel
Summary: Development files for libvisual
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: pkgconfig
%description devel
Libvisual is a library that acts as a middle layer between applications
that want audio visualization, and audio visualization plugins.
This package provides the necessary development libraries and include
files to allow you to develop applications and plugins using the libvisual
libraries.
%prep
%autosetup -n %{name}-%{version} -p1
%build
%configure
make %{?_smp_mflags}
# doc file
#doxygen
%install
%make_install
%find_lang %{name}-0.4
%ldconfig_scriptlets
%files -f %{name}-0.4.lang
#%doc doc/html/*
%doc ABOUT-NLS AUTHORS ChangeLog INSTALL NEWS README TODO
%license COPYING
%{_libdir}/libvisual*.so.*
%files devel
%{_includedir}/%{name}-0.4
%{_libdir}/libvisual*.so
%exclude %{_libdir}/libvisual*.*a
%{_libdir}/pkgconfig/*.pc
%changelog
* Mon Aug 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 1:0.4.0-26
- Package init