- fix build on x32 arch
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 25 Dec 2014 12:38:15 +0000 (12:38 +0000)
committerJan Rękorajski <baggins@pld-linux.org>
Thu, 25 Dec 2014 12:38:15 +0000 (12:38 +0000)
flac.spec
x32.patch [new file with mode: 0644]

index f1f441c..cf2262e 100644 (file)
--- a/flac.spec
+++ b/flac.spec
@@ -13,6 +13,7 @@ Group:                Libraries
 Source0:       http://downloads.xiph.org/releases/flac/%{name}-%{version}.tar.xz
 # Source0-md5: b9922c9a0378c88d3e901b234f852698
 Patch0:                %{name}-opt.patch
+Patch1:                x32.patch
 URL:           http://xiph.org/flac/
 BuildRequires: autoconf >= 2.60
 BuildRequires: automake >= 1:1.11
@@ -116,6 +117,7 @@ Wtyczka dla XMMS umożliwiająca odtwarzanie plików w formacie FLAC.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %{__rm} m4/ogg.m4
 
@@ -144,10 +146,12 @@ rm -rf $RPM_BUILD_ROOT
 
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
 
+%if %{with xmms}
 %{__rm} $RPM_BUILD_ROOT%{xmms_input_plugindir}/*.la
 %if %{with static_libs}
 %{__rm} $RPM_BUILD_ROOT%{xmms_input_plugindir}/*.a
 %endif
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
diff --git a/x32.patch b/x32.patch
new file mode 100644 (file)
index 0000000..b4c05ba
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,36 @@
+--- flac-1.3.1/configure.ac~   2014-12-25 12:11:41.000000000 +0000
++++ flac-1.3.1/configure.ac    2014-12-25 12:28:28.561894846 +0000
+@@ -150,6 +150,7 @@
+       *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
+       *-*-darwin*) OBJ_FORMAT=macho ;;
+       *emx*) OBJ_FORMAT=aout ;;
++      *gnux32*) OBJ_FORMAT=elfx32 ;;
+       *) OBJ_FORMAT=elf ;;
+ esac
+ AC_SUBST(OBJ_FORMAT)
+@@ -370,6 +371,12 @@
+               CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
+               CFLAGS="$CFLAGS -fvisibility=hidden"
+               CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
++              fi
++
++      if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elfx32; then
++              CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
++              CFLAGS="$CFLAGS -fvisibility=hidden"
++              CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+               fi
+       if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = macho; then
+--- flac-1.3.1/src/libFLAC/ia32/nasm.h~        2014-11-27 01:19:47.000000000 +0000
++++ flac-1.3.1/src/libFLAC/ia32/nasm.h 2014-12-25 12:31:46.790820947 +0000
+@@ -50,6 +50,10 @@
+       %idefine code_section section .text align=16
+       %idefine data_section section .data align=32
+       %idefine bss_section  section .bss  align=32
++%elifdef OBJ_FORMAT_elfx32
++      %idefine code_section section .text align=16
++      %idefine data_section section .data align=32
++      %idefine bss_section  section .bss  align=32
+ %else
+       %error unsupported object format!
+ %endif
This page took 0.160034 seconds and 4 git commands to generate.