Skip to content

Commit

Permalink
add PKGBUILD for msys2 wang-bin#533
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed May 19, 2017
1 parent 6faf867 commit 417b47a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)


option(BUILD_EXAMPLES "Build examples" ON)
option(BUILD_PLAYERS "Build players" ON)
option(BUILD_TESTS "Build tests" ON)
option(BUILD_QT5OPENGL "Build with Qt5 OpenGL module" ON)

Expand Down Expand Up @@ -119,7 +120,7 @@ if(Qt5Qml_FOUND AND Qt5Quick_FOUND)
add_subdirectory(qml)
endif()

if(BUILD_EXAMPLES)
if(BUILD_EXAMPLES OR BUILD_PLAYERS)
add_subdirectory(examples)
endif()

Expand Down
17 changes: 10 additions & 7 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ if(Qt5Widgets_FOUND)
add_executable(Player ${EXE_TYPE} ${PLAYER_SRC} ${PLAYER_HEADERS} ${PLAYER_RES} ${RC_FILE})
target_link_libraries(Player QtAVWidgets common)

if(BUILD_EXAMPLES)
SET(FILTERS_QRC filters/res.qrc)
SOURCE_GROUP("Resources" FILES ${FILTERS_QRC})
qt5_add_resources(FILTERS_RES ${FILTERS_QRC})
Expand Down Expand Up @@ -155,15 +156,17 @@ if(Qt5Widgets_FOUND)

add_executable(simpletranscode simpletranscode/main.cpp)
target_link_libraries(simpletranscode QtAV)
endif()
endif()

add_executable(audiopipeline audiopipeline/main.cpp)
target_link_libraries(audiopipeline QtAV)

add_executable(framereader framereader/main.cpp)
target_link_libraries(framereader QtAV)
if(BUILD_EXAMPLES)
add_executable(audiopipeline audiopipeline/main.cpp)
target_link_libraries(audiopipeline QtAV)

add_executable(window window/main.cpp)
target_link_libraries(window QtAV)
add_executable(framereader framereader/main.cpp)
target_link_libraries(framereader QtAV)

add_executable(window window/main.cpp)
target_link_libraries(window QtAV)
endif()

49 changes: 49 additions & 0 deletions msys2/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
realname=qtav
pkgname="${MINGW_PACKAGE_PREFIX}-${realname}"
pkgver=r3368.39e6eafe
pkgrel=1
pkgdesc="Multimedia framework based on Qt and FFmpeg (mingw-w64)"
arch=('any')
license=('LGPL')
depends=("${MINGW_PACKAGE_PREFIX}-uchardet"
"${MINGW_PACKAGE_PREFIX}-ffmpeg"
"${MINGW_PACKAGE_PREFIX}-openal"
"${MINGW_PACKAGE_PREFIX}-qt5")
makedepends=('git')
source=("${realname}::git://github.com/wang-bin/QtAV.git")
md5sums=('SKIP')

pkgver() {
cd "${srcdir}/${realname}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
cd "${srcdir}/${realname}"
git submodule update --init
}

build() {
cd "${srcdir}/${realname}"

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
cmake \
-G"MSYS Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PLAYERS=ON \
-DBUILD_TESTS=OFF \
../${realname}

make
}

package() {
cd "${srcdir}/${realname}"

make DESTDIR="${pkgdir}" install

mkdir -p "${pkgdir}${MINGW_PREFIX}/share/licenses/${realname}"
cp lgpl-2.1.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${realname}/LICENSE"
}

0 comments on commit 417b47a

Please sign in to comment.