* add libyuv

* * add checksum for patch
* remove unused build arguments
* generate a pkgconfig file

* oops: fix missing prefix for pkgconfig file

* make this package git sourced

* move pkgconfig file to a source file
* update patches for latest git version
* switch to a github mirror as googlesource.com times out
This commit is contained in:
Antoine Martin
2019-02-25 13:20:04 +07:00
committed by Алексей
parent 9fb1f4cdde
commit c1a5c0d2e4
4 changed files with 115 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
# 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")
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:
source=("${_realname}::git+https://github.com/lemenkov/${_realname}"
"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 HEAD)
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"
}

View File

@@ -0,0 +1,11 @@
--- 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 )

View File

@@ -0,0 +1,36 @@
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

View File

@@ -0,0 +1,8 @@
prefix=@PREFIX@
exec_prefix=${prefix}
Name: libyuv
Description: YUV conversion and scaling library
URL: https://chromium.googlesource.com/libyuv/libyuv
Version: @VERSION@
Libs: -lyuv