From ec50c9c3ac2e14c7c3197151107878c7f778d6ae Mon Sep 17 00:00:00 2001 From: Dominik Mierzejewski Date: Thu, 4 Sep 2014 10:54:39 +0000 Subject: [PATCH] - initial import --- .gitignore | 1 + sources | 1 + x265-fix-soname.patch | 30 ++++++++++ x265-pc-path.patch | 12 ++++ x265-pic.patch | 16 ++++++ x265-test-shared.patch | 13 +++++ x265.spec | 123 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 196 insertions(+) create mode 100644 x265-fix-soname.patch create mode 100644 x265-pc-path.patch create mode 100644 x265-pic.patch create mode 100644 x265-test-shared.patch create mode 100644 x265.spec diff --git a/.gitignore b/.gitignore index e69de29..e33e033 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +1.2.tar.bz2 diff --git a/sources b/sources index e69de29..e02cd0d 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +57a4b8300918c5412ceaa26bb8e0a0bb 1.2.tar.bz2 diff --git a/x265-fix-soname.patch b/x265-fix-soname.patch new file mode 100644 index 0000000..c328e9d --- /dev/null +++ b/x265-fix-soname.patch @@ -0,0 +1,30 @@ +diff -up multicoreware-x265-d6257335c537/source/CMakeLists.txt.soname multicoreware-x265-d6257335c537/source/CMakeLists.txt +--- multicoreware-x265-d6257335c537/source/CMakeLists.txt.soname 2014-08-08 11:55:36.315572972 +0200 ++++ multicoreware-x265-d6257335c537/source/CMakeLists.txt 2014-08-08 11:55:36.316572975 +0200 +@@ -276,15 +276,22 @@ if(ENABLE_SHARED) + else() + set_target_properties(x265-shared PROPERTIES OUTPUT_NAME x265) + endif() +- if(UNIX AND NOT APPLE) +- set_target_properties(x265-shared PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic,-znoexecstack") ++ if(UNIX) ++ set_target_properties(x265-shared PROPERTIES VERSION ${X265_BUILD}) ++ if(NOT APPLE) ++ set_target_properties(x265-shared PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic,-znoexecstack") ++ endif() + endif() ++ set_target_properties(x265-shared PROPERTIES SOVERSION ${X265_BUILD}) + if(X265_LATEST_TAG) ++ if(WINDOWS) ++ set_target_properties(x265-shared PROPERTIES VERSION ${X265_LATEST_TAG}) ++ endif() + # shared library is not installed if a tag is not found +- set_target_properties(x265-shared PROPERTIES VERSION ${X265_LATEST_TAG} SOVERSION ${X265_BUILD}) + install(TARGETS x265-shared + LIBRARY DESTINATION ${LIB_INSTALL_DIR} +- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) ++ ARCHIVE DESTINATION ${LIB_INSTALL_DIR} ++ RUNTIME DESTINATION ${BIN_INSTALL_DIR}) + endif() + endif() + diff --git a/x265-pc-path.patch b/x265-pc-path.patch new file mode 100644 index 0000000..7f53e4b --- /dev/null +++ b/x265-pc-path.patch @@ -0,0 +1,12 @@ +diff -up multicoreware-x265-d6257335c537/source/CMakeLists.txt.r multicoreware-x265-d6257335c537/source/CMakeLists.txt +--- multicoreware-x265-d6257335c537/source/CMakeLists.txt.r 2014-07-09 10:25:15.000000000 +0200 ++++ multicoreware-x265-d6257335c537/source/CMakeLists.txt 2014-07-10 12:03:21.459088376 +0200 +@@ -308,7 +308,7 @@ if(X265_LATEST_TAG) + # Produce a pkg-config file + configure_file("x265.pc.in" "x265.pc" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/x265.pc" +- DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/pkgconfig") ++ DESTINATION "${LIB_INSTALL_DIR}/pkgconfig") + endif() + + if(NOT WIN32) diff --git a/x265-pic.patch b/x265-pic.patch new file mode 100644 index 0000000..6d9e4ef --- /dev/null +++ b/x265-pic.patch @@ -0,0 +1,16 @@ +diff -up multicoreware-x265-d6257335c537/source/CMakeLists.txt.pic multicoreware-x265-d6257335c537/source/CMakeLists.txt +--- multicoreware-x265-d6257335c537/source/CMakeLists.txt.pic 2014-07-17 09:37:41.176441279 +0200 ++++ multicoreware-x265-d6257335c537/source/CMakeLists.txt 2014-07-17 10:18:03.001014597 +0200 +@@ -122,10 +122,10 @@ if(GCC) + add_definitions(-fPIC) + endif(X64 AND NOT WIN32) + if(X86 AND NOT X64) +- add_definitions(-march=i686) ++ add_definitions(-march=i686 -fPIC) + endif() + if(ARM) +- add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp) ++ add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp -fPIC) + endif() + check_cxx_compiler_flag(-Wno-narrowing CC_HAS_NO_NARROWING) + check_cxx_compiler_flag(-ffast-math CC_HAS_FAST_MATH) diff --git a/x265-test-shared.patch b/x265-test-shared.patch new file mode 100644 index 0000000..b53b51f --- /dev/null +++ b/x265-test-shared.patch @@ -0,0 +1,13 @@ +diff -up multicoreware-x265-d6257335c537/source/test/CMakeLists.txt.r multicoreware-x265-d6257335c537/source/test/CMakeLists.txt +--- multicoreware-x265-d6257335c537/source/test/CMakeLists.txt.r 2014-07-09 10:25:15.000000000 +0200 ++++ multicoreware-x265-d6257335c537/source/test/CMakeLists.txt 2014-07-10 12:10:15.171798782 +0200 +@@ -17,7 +17,7 @@ add_executable(TestBench ${YASM_SRC} + mbdstharness.cpp mbdstharness.h + ipfilterharness.cpp ipfilterharness.h + intrapredharness.cpp intrapredharness.h) +-target_link_libraries(TestBench x265-static ${PLATFORM_LIBS}) ++target_link_libraries(TestBench x265-shared ${PLATFORM_LIBS}) + + add_executable(PoolTest testpool.cpp) +-target_link_libraries(PoolTest x265-static ${PLATFORM_LIBS}) ++target_link_libraries(PoolTest x265-shared ${PLATFORM_LIBS}) diff --git a/x265.spec b/x265.spec new file mode 100644 index 0000000..df687d9 --- /dev/null +++ b/x265.spec @@ -0,0 +1,123 @@ +%global commit d6257335c537 + +Summary: H.265/HEVC encoder +Name: x265 +Version: 1.2 +Release: 5%{?dist} +URL: http://x265.org/ +Source0: https://bitbucket.org/multicoreware/x265/get/%{version}.tar.bz2 +# fix pkgconfig file installation path +Patch0: x265-pc-path.patch +# link test binaries with shared library +Patch1: x265-test-shared.patch +# build with -fPIC on arm and i686, too +Patch2: x265-pic.patch +# don't create bogus soname (https://bitbucket.org/multicoreware/x265/issue/62/linux-incorrect-symbolic-links-to-shared) +Patch3: x265-fix-soname.patch +# source/Lib/TLibCommon - BSD +# source/Lib/TLibEncoder - BSD +# everything else - GPLv2+ +License: GPLv2+ and BSD +BuildRequires: cmake +BuildRequires: yasm + +%description +The primary objective of x265 is to become the best H.265/HEVC encoder +available anywhere, offering the highest compression efficiency and the +highest performance on a wide variety of hardware platforms. + +This package contains the command line encoder. + +%package libs +Summary: H.265/HEVC encoder library + +%description libs +The primary objective of x265 is to become the best H.265/HEVC encoder +available anywhere, offering the highest compression efficiency and the +highest performance on a wide variety of hardware platforms. + +This package contains the shared library. + +%package devel +Summary: H.265/HEVC encoder library development files +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +The primary objective of x265 is to become the best H.265/HEVC encoder +available anywhere, offering the highest compression efficiency and the +highest performance on a wide variety of hardware platforms. + +This package contains the shared library development files. + +%prep +%setup -q -n multicoreware-%{name}-%{commit} +%patch0 -p1 -b .p +# tests are crashing on x86 if linked against shared libx265 +%ifnarch i686 +%patch1 -p1 -b .ts +%endif +%patch2 -p1 -b .pic +%patch3 -p1 -b .soname +f=doc/uncrustify/drag-uncrustify.bat +tr -d '\r' < ${f} > ${f}.unix && \ +touch -r ${f} ${f}.unix && \ +mv ${f}.unix ${f} + +%build +%cmake -G "Unix Makefiles" \ + -DCMAKE_SKIP_RPATH:BOOL=YES \ + -DENABLE_TESTS:BOOL=ON \ + source +make %{?_smp_mflags} + +%install +make DESTDIR=%{buildroot} install +rm %{buildroot}%{_libdir}/libx265.a +install -Dpm644 COPYING %{buildroot}%{_pkgdocdir}/COPYING + +%check +LD_LIBRARY_PATH=$(pwd) test/PoolTest +LD_LIBRARY_PATH=$(pwd) test/TestBench + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%files +%{_bindir}/x265 + +%files libs +%dir %{_pkgdocdir} +%{_pkgdocdir}/COPYING +%{_libdir}/libx265.so.25 + +%files devel +%doc doc/* +%{_includedir}/x265.h +%{_includedir}/x265_config.h +%{_libdir}/libx265.so +%{_libdir}/pkgconfig/x265.pc + +%changelog +* Sun Aug 17 2014 Dominik Mierzejewski 1.2-5 +- don't include contributor agreement in doc +- make sure /usr/share/doc/x265 is owned +- add a comment noting which files are BSD-licenced + +* Fri Aug 08 2014 Dominik Mierzejewski 1.2-4 +- don't create bogus soname (patch by Xavier) + +* Thu Jul 17 2014 Dominik Mierzejewski 1.2-3 +- fix tr call to remove DOS EOL +- build the library with -fPIC on arm and i686, too + +* Sun Jul 13 2014 Dominik Mierzejewski 1.2-2 +- use version in source URL +- update License tag +- fix EOL in drag-uncrustify.bat +- don't link test binaries with shared binary on x86 (segfault) + +* Thu Jul 10 2014 Dominik Mierzejewski 1.2-1 +- initial build +- fix pkgconfig file install location +- link test binaries with shared library