commit eb23c2a63ade53c05422354c7b05cfed09c0d0bb Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:58:59 2019 -0400 Package init diff --git a/libvisual-0.4.0-better-altivec-detection.patch b/libvisual-0.4.0-better-altivec-detection.patch new file mode 100644 index 0000000..4004ad9 --- /dev/null +++ b/libvisual-0.4.0-better-altivec-detection.patch @@ -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 ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#else /* VISUAL_ARCH_POWERPC */ + #include + #endif ++#endif + + #if defined(VISUAL_OS_WIN32) + #include +@@ -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 */ diff --git a/libvisual-0.4.0-format-security.patch b/libvisual-0.4.0-format-security.patch new file mode 100644 index 0000000..ab1e4d6 --- /dev/null +++ b/libvisual-0.4.0-format-security.patch @@ -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)); + } + } + diff --git a/libvisual-0.4.0-inlinedefineconflict.patch b/libvisual-0.4.0-inlinedefineconflict.patch new file mode 100644 index 0000000..11ce334 --- /dev/null +++ b/libvisual-0.4.0-inlinedefineconflict.patch @@ -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; + diff --git a/libvisual-0.4.0.tar.gz b/libvisual-0.4.0.tar.gz new file mode 100644 index 0000000..eee8f33 Binary files /dev/null and b/libvisual-0.4.0.tar.gz differ diff --git a/libvisual.spec b/libvisual.spec new file mode 100644 index 0000000..4dbc154 --- /dev/null +++ b/libvisual.spec @@ -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 - 1:0.4.0-26 +- Package init