diff options
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 44 | ||||
-rw-r--r-- | mingw.patch | 48 |
3 files changed, 114 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..028c96c26635 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = mingw-w64-x265 + pkgdesc = Open Source H265/HEVC video encoder (mingw-w64) + pkgver = 1.6 + pkgrel = 1 + url = https://bitbucket.org/multicoreware/x265 + arch = any + license = GPL + makedepends = mingw-w64-gcc + makedepends = yasm + makedepends = mingw-w64-cmake + makedepends = mingw-w64-pkg-config + depends = mingw-w64-crt + options = !strip + options = !buildflags + options = staticlibs + source = x265-1.6.tar.bz2::https://bitbucket.org/multicoreware/x265/get/1.6.tar.bz2 + source = mingw.patch + md5sums = d6fcde2d021899bc93f987cd6819a233 + md5sums = d1f6263ad2f345673a8b0ece73f68338 + +pkgname = mingw-w64-x265 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0702477086d8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Karl-Felix Glatzer <karl.glatzer@gmx.de> + +pkgname=mingw-w64-x265 +pkgver=1.6 +pkgrel=1 +pkgdesc='Open Source H265/HEVC video encoder (mingw-w64)' +arch=('any') +url='https://bitbucket.org/multicoreware/x265' +license=('GPL') +depends=('mingw-w64-crt') +options=(!strip !buildflags staticlibs) +makedepends=('mingw-w64-gcc' 'yasm' 'mingw-w64-cmake' 'mingw-w64-pkg-config') +#source=($url/get/$pkgver.tar.bz2 +source=(x265-$pkgver.tar.bz2::$url/get/$pkgver.tar.bz2 + mingw.patch) +md5sums=('d6fcde2d021899bc93f987cd6819a233' + 'd1f6263ad2f345673a8b0ece73f68338') +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +prepare() { + cd multicoreware-x265-*/ + patch -Np1 -i "${srcdir}/mingw.patch" +} + +build() { + for _arch in ${_architectures}; do + mkdir -p "${srcdir}"/build-${_arch} && cd "${srcdir}"/build-${_arch} + + unset LDFLAGS CPPFLAGS + ${_arch}-cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/${_arch} -DLIB_INSTALL_DIR="lib" "${srcdir}"/multicoreware-x265-*/source + make + done +} + +package() { + for _arch in ${_architectures}; do + cd "${srcdir}"/build-${_arch} + + make DESTDIR="$pkgdir" install + rm "${pkgdir}"/usr/${_arch}/bin/*.exe + ${_arch}-strip -x -g "${pkgdir}"/usr/${_arch}/bin/*.dll + ${_arch}-strip -g "${pkgdir}"/usr/${_arch}/lib/*.a + done +} diff --git a/mingw.patch b/mingw.patch new file mode 100644 index 000000000000..459220768efb --- /dev/null +++ b/mingw.patch @@ -0,0 +1,48 @@ +diff -ru multicoreware-x265-d6257335c537/source/CMakeLists.txt patched/source/CMakeLists.txt +--- multicoreware-x265-d6257335c537/source/CMakeLists.txt 2014-07-09 10:25:15.000000000 +0200 ++++ patched/source/CMakeLists.txt 2014-07-11 02:30:52.574683624 +0200 +@@ -283,6 +283,7 @@ + # 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 ++ RUNTIME DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) + endif() +diff -ru multicoreware-x265-d6257335c537/source/common/CMakeLists.txt patched/source/common/CMakeLists.txt +--- multicoreware-x265-d6257335c537/source/common/CMakeLists.txt 2014-07-09 10:25:15.000000000 +0200 ++++ patched/source/common/CMakeLists.txt 2014-07-11 02:32:59.046579781 +0200 +@@ -117,10 +117,16 @@ + source_group(Assembly FILES ${ASM_PRIMITIVES}) + endif(ENABLE_ASSEMBLY) + +-check_symbol_exists(strtok_r "string.h" HAVE_STRTOK_R) +-if(HAVE_STRTOK_R) +- set_source_files_properties(param.cpp PROPERTIES COMPILE_FLAGS -DHAVE_STRTOK_R=1) +-endif() ++if(MINGW) ++ set_source_files_properties(param.cpp PROPERTIES COMPILE_FLAGS -DHAVE_STRTOK_R="1") ++else(MINGW) ++ #FIXME Mingw-w64 defines strtok_r in pthread.h (this needs to be fixed in Mingw-w64) ++ #check_symbol_exists(strtok_r "string.h" HAVE_STRTOK_R) ++ check_symbol_exists(strtok_r "pthread.h" HAVE_STRTOK_R) ++ if(HAVE_STRTOK_R) ++ set_source_files_properties(param.cpp PROPERTIES COMPILE_FLAGS -DHAVE_STRTOK_R=1) ++ endif() ++endif(MINGW) + + if(GCC AND CC_HAS_NO_NARROWING) + set_source_files_properties(cpu.cpp PROPERTIES COMPILE_FLAGS -Wno-narrowing) +diff -ru multicoreware-x265-d6257335c537/source/common/param.cpp patched/source/common/param.cpp +--- multicoreware-x265-d6257335c537/source/common/param.cpp 2014-07-09 10:25:15.000000000 +0200 ++++ patched/source/common/param.cpp 2014-07-11 02:36:54.809974684 +0200 +@@ -28,6 +28,9 @@ + #include "x265.h" + #include "TLibCommon/TComSlice.h" + ++//FIXME For strtok_r in Mingw-w64 (see CMakeLists.txt) ++#include <pthread.h> ++ + #if _MSC_VER + #pragma warning(disable: 4996) // POSIX functions are just fine, thanks + #pragma warning(disable: 4706) // assignment within conditional |