@@ -1,62 +0,0 @@
|
||||
# Maintainer: Antoine Martin <totaam@xpra.org>
|
||||
|
||||
_realname=libyuv
|
||||
pkgbase="mingw-w64-${_realname}-git"
|
||||
pkgname=(${MINGW_PACKAGE_PREFIX}-${_realname}-git)
|
||||
provides=(${MINGW_PACKAGE_PREFIX}-${_realname})
|
||||
conflics=(${MINGW_PACKAGE_PREFIX}-${_realname})
|
||||
pkgver=1724.r7ce50764
|
||||
pkgrel=1
|
||||
pkgdesc="YUV conversion and scaling library"
|
||||
arch=(any)
|
||||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
|
||||
url="https://chromium.googlesource.com/libyuv/libyuv"
|
||||
license=('BSD')
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-cmake")
|
||||
#this is the real upstream, but git checkout timesout at the moment:
|
||||
#source=("${_realname}::git+https://chromium.googlesource.com/${_realname}/${_realname}"
|
||||
#so we use a github mirror instead:
|
||||
_commit="7ce50764c52055035bfa3f469555b353c0bcd045"
|
||||
source=("${_realname}::git+https://github.com/lemenkov/${_realname}#commit=${_commit}"
|
||||
"libyuv.pc"
|
||||
"libyuv-nojpeg.patch"
|
||||
"cmake-mingw.patch")
|
||||
options=('strip' 'staticlibs')
|
||||
sha256sums=('SKIP'
|
||||
'86b8cbaadaea129775ebfa2d69f7b5e7d277c39b48377966da276a46a5bb2aa8'
|
||||
'1fac09a44d5ef663478d951c4ed31bb335d5e97dc8345ffbd5ad4d07766d040c'
|
||||
'4f08ebd0647ea4873db70042334e2ef19734ddf9c7b8b1dca70b633b89e405ef')
|
||||
|
||||
pkgver() {
|
||||
cd "${srcdir}/${_realname}"
|
||||
VERSION=$(cat include/libyuv/version.h | grep "#define LIBYUV_VERSION" | awk '{print $3}')
|
||||
REVISION=$(git rev-parse --short "${_commit}")
|
||||
echo "${VERSION}.r${REVISION}"
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${_realname}"
|
||||
patch -p1 -i "$srcdir"/libyuv-nojpeg.patch
|
||||
patch -p1 -i "$srcdir"/cmake-mingw.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
[[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
|
||||
mkdir -p "${srcdir}/build-${MINGW_CHOST}" && cd ${srcdir}/build-${MINGW_CHOST}
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake -Wno-dev \
|
||||
-G"MSYS Makefiles" \
|
||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
||||
../${_realname}
|
||||
echo "cmake done"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd build-${MINGW_CHOST}
|
||||
make DESTDIR="${pkgdir}" install
|
||||
mkdir -p ${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/
|
||||
install -m644 ../libyuv.pc "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/"
|
||||
install -Dm644 ${srcdir}/${_realname}/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/CMakeLists.txt.new 2019-02-23 14:57:10.916277725 +0700
|
||||
+++ b/CMakeLists.txt 2019-02-23 14:58:39.583668715 +0700
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
|
||||
# install the conversion tool, .so, .a, and all the header files
|
||||
-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )
|
||||
+INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert.exe DESTINATION bin )
|
||||
INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib )
|
||||
INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
|
||||
INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
|
||||
@@ -1,36 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ed4948f0..228ac830 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -35,12 +35,12 @@ ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
|
||||
TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
|
||||
|
||||
|
||||
-INCLUDE ( FindJPEG )
|
||||
-if (JPEG_FOUND)
|
||||
- include_directories( ${JPEG_INCLUDE_DIR} )
|
||||
- target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
|
||||
- add_definitions( -DHAVE_JPEG )
|
||||
-endif()
|
||||
+#INCLUDE ( FindJPEG )
|
||||
+#if (JPEG_FOUND)
|
||||
+# include_directories( ${JPEG_INCLUDE_DIR} )
|
||||
+# target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
|
||||
+# add_definitions( -DHAVE_JPEG )
|
||||
+#endif()
|
||||
|
||||
if(TEST)
|
||||
find_library(GTEST_LIBRARY gtest)
|
||||
diff --git a/source/mjpeg_decoder.cc b/source/mjpeg_decoder.cc
|
||||
index eaf25301..21cde70a 100644
|
||||
--- a/source/mjpeg_decoder.cc
|
||||
+++ b/source/mjpeg_decoder.cc
|
||||
@@ -25,7 +25,7 @@
|
||||
#endif
|
||||
|
||||
#endif
|
||||
-struct FILE; // For jpeglib.h.
|
||||
+//struct FILE; // For jpeglib.h.
|
||||
|
||||
// C++ build requires extern C for jpeg internals.
|
||||
#ifdef __cplusplus
|
||||
@@ -1,8 +0,0 @@
|
||||
prefix=@PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
|
||||
Name: libyuv
|
||||
Description: YUV conversion and scaling library
|
||||
URL: https://chromium.googlesource.com/libyuv/libyuv
|
||||
Version: @VERSION@
|
||||
Libs: -lyuv
|
||||
76
mingw-w64-libyuv/PKGBUILD
Normal file
76
mingw-w64-libyuv/PKGBUILD
Normal file
@@ -0,0 +1,76 @@
|
||||
# Maintainer: Antoine Martin <totaam@xpra.org>
|
||||
|
||||
_realname=libyuv
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname=(${MINGW_PACKAGE_PREFIX}-${_realname})
|
||||
provides=(${MINGW_PACKAGE_PREFIX}-${_realname}-git)
|
||||
conflicts=(${MINGW_PACKAGE_PREFIX}-${_realname}-git)
|
||||
replaces=(${MINGW_PACKAGE_PREFIX}-${_realname}-git)
|
||||
pkgver=1787.r2266.eb6e7bb6
|
||||
pkgrel=1
|
||||
pkgdesc="YUV conversion and scaling library (mingw-w64)"
|
||||
arch=('any')
|
||||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
|
||||
url="https://chromium.googlesource.com/libyuv/libyuv"
|
||||
license=('BSD-3-Clause')
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
"${MINGW_PACKAGE_PREFIX}-ninja"
|
||||
'git')
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-libjpeg")
|
||||
_commit="eb6e7bb63738e29efd82ea3cf2a115238a89fa51"
|
||||
source=("${_realname}::git+https://chromium.googlesource.com/${_realname}/${_realname}#commit=${_commit}"
|
||||
"libyuv.pc.in"
|
||||
"libyuv-jpeg.patch"
|
||||
"cmake-mingw.patch"
|
||||
"pkgconfig-cmake.patch")
|
||||
options=('strip' 'staticlibs')
|
||||
sha256sums=('SKIP'
|
||||
'86aaa22252e033e62931e7c3fe3a6be4143a8ca532f95c1346b1e6b278c1947f'
|
||||
'7ad4df4a33ce7623bbea336ade74b4fbfb6a750973dba359e287b6bfcbfa7f09'
|
||||
'3897bfb1be028bacf065906a5032811bca0203527dd0348e8a7d264e43999957'
|
||||
'b7fc89b8a8da6b3dd2165b9be3408545b3e6ec6e7cae34a50843c5a24f8313c0')
|
||||
|
||||
pkgver() {
|
||||
cd "${srcdir}"/${_realname}
|
||||
local VERSION=$(cat include/libyuv/version.h | grep "#define LIBYUV_VERSION" | awk '{print $3}')
|
||||
|
||||
printf "%s.r%s.%s" "${VERSION}" "$(git rev-list --count $_commit)" "$(git rev-parse --short $_commit)"
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}"/${_realname}
|
||||
cp "${srcdir}"/libyuv.pc.in "${srcdir}"/${_realname}
|
||||
patch -p1 -i "${srcdir}"/libyuv-jpeg.patch
|
||||
patch -p1 -i "${srcdir}"/cmake-mingw.patch
|
||||
patch -p1 -i "${srcdir}"/pkgconfig-cmake.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
|
||||
mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}
|
||||
|
||||
declare -a extra_config
|
||||
if check_option "debug" "n"; then
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
|
||||
else
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
|
||||
fi
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake \
|
||||
-GNinja \
|
||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
||||
"${extra_config[@]}" \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
../${_realname}
|
||||
|
||||
${MINGW_PREFIX}/bin/cmake --build .
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}"/build-${CARCH}
|
||||
|
||||
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --build . --target install
|
||||
|
||||
install -Dm644 ${srcdir}/${_realname}/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
|
||||
}
|
||||
16
mingw-w64-libyuv/cmake-mingw.patch
Normal file
16
mingw-w64-libyuv/cmake-mingw.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 636531ee..c2a387a0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -76,9 +76,9 @@ endif()
|
||||
|
||||
|
||||
# install the conversion tool, .so, .a, and all the header files
|
||||
-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )
|
||||
+INSTALL ( TARGETS yuvconvert DESTINATION bin )
|
||||
INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib )
|
||||
-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
|
||||
+INSTALL ( TARGETS ${ly_lib_shared} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin )
|
||||
INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
|
||||
|
||||
# create the .deb and .rpm packages using cpack
|
||||
12
mingw-w64-libyuv/libyuv-jpeg.patch
Normal file
12
mingw-w64-libyuv/libyuv-jpeg.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 636531ee..c2a387a0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -39,6 +39,7 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
|
||||
if (JPEG_FOUND)
|
||||
include_directories( ${JPEG_INCLUDE_DIR} )
|
||||
target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
|
||||
+ target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} )
|
||||
add_definitions( -DHAVE_JPEG )
|
||||
endif()
|
||||
|
||||
12
mingw-w64-libyuv/libyuv.pc.in
Normal file
12
mingw-w64-libyuv/libyuv.pc.in
Normal file
@@ -0,0 +1,12 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: libyuv
|
||||
Description: YUV conversion and scaling library
|
||||
URL: https://chromium.googlesource.com/libyuv/libyuv
|
||||
Version: @YUV_VERSION@
|
||||
Requires.private: libjpeg
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lyuv
|
||||
14
mingw-w64-libyuv/pkgconfig-cmake.patch
Normal file
14
mingw-w64-libyuv/pkgconfig-cmake.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git a/CM_linux_packages.cmake b/CM_linux_packages.cmake
|
||||
index 5f676f89..8410ba20 100644
|
||||
--- a/CM_linux_packages.cmake
|
||||
+++ b/CM_linux_packages.cmake
|
||||
@@ -10,6 +10,9 @@ SET ( YUV_VER_PATCH ${YUV_VERSION_NUMBER} )
|
||||
SET ( YUV_VERSION ${YUV_VER_MAJOR}.${YUV_VER_MINOR}.${YUV_VER_PATCH} )
|
||||
MESSAGE ( "Building ver.: ${YUV_VERSION}" )
|
||||
|
||||
+configure_file(libyuv.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libyuv.pc @ONLY)
|
||||
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libyuv.pc DESTINATION lib/pkgconfig)
|
||||
+
|
||||
# is this a 32-bit or 64-bit build?
|
||||
IF ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
SET ( YUV_BIT_SIZE 64 )
|
||||
Reference in New Issue
Block a user