[smpeg2] initial commit

This commit is contained in:
codicodi 2016-12-20 15:17:24 +01:00 committed by GitHub
parent 3b7b380798
commit a5bb368f24
4 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,57 @@
cmake_minimum_required(VERSION 2.6)
project(SMPEG2)
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
find_library(SDL_LIBRARY SDL2)
include_directories(${SDL_INCLUDE_DIR})
include_directories(${SDL_INCLUDE_DIR}/SDL2)
include_directories(${CMAKE_SOURCE_DIR})
add_definitions(-DNOCONTROLS -DTHREADED_AUDIO)
# some c++ code just assumes memset is available
file(WRITE ${CMAKE_SOURCE_DIR}/declare_memset.h "#include <string.h>\n")
add_definitions(-FIdeclare_memset.h)
add_library(smpeg2
audio/bitwindow.cpp
audio/filter.cpp
audio/filter_2.cpp
audio/hufftable.cpp
audio/mpeglayer1.cpp
audio/mpeglayer2.cpp
audio/mpeglayer3.cpp
audio/mpegtable.cpp
audio/mpegtoraw.cpp
audio/MPEGaudio.cpp
video/decoders.cpp
video/floatdct.cpp
video/gdith.cpp
video/jrevdct.cpp
video/motionvec.cpp
video/parseblock.cpp
video/readfile.cpp
video/util.cpp
video/video.cpp
video/MPEGvideo.cpp
MPEG.cpp
MPEGlist.cpp
MPEGring.cpp
MPEGstream.cpp
MPEGsystem.cpp
smpeg.cpp)
target_link_libraries(smpeg2 ${SDL_LIBRARY})
install(TARGETS smpeg2
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
if(NOT DEFINED SMPEG_SKIP_HEADERS)
install(FILES smpeg.h MPEGframe.h DESTINATION include)
endif()
message(STATUS "Link-time dependencies:")
message(STATUS " " ${SDL_LIBRARY})

4
ports/smpeg2/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: smpeg2
Version: 2.0.0
Description: SDL MPEG Player Library
Build-Depends: sdl2

View File

@ -0,0 +1,17 @@
diff --git a/smpeg.h b/smpeg.h
index 6bc2dbd..d12c8f8 100644
--- a/smpeg.h
+++ b/smpeg.h
@@ -22,9 +22,9 @@
#ifndef _SMPEG_H_
#define _SMPEG_H_
-#include "SDL.h"
-#include "SDL_mutex.h"
-#include "SDL_audio.h"
+#include "SDL2/SDL.h"
+#include "SDL2/SDL_mutex.h"
+#include "SDL2/SDL_audio.h"
#include "MPEGframe.h"
#ifdef __cplusplus

View File

@ -0,0 +1,27 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/smpeg2-2.0.0)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.libsdl.org/projects/smpeg/release/smpeg2-2.0.0.tar.gz"
FILENAME "smpeg2-2.0.0.tar.gz"
SHA512 80a779d01e7aa76778ef6ceea8041537db9e4b354df413214c4413c875cb98551891cef98fa0f057cc6a3222e4983da9ae65b86bdad2f87f9e2a6751837e2baf)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/correct-sdl-headers-dir.patch)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
-DSMPEG_SKIP_HEADERS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/smpeg2)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/smpeg2/COPYING ${CURRENT_PACKAGES_DIR}/share/smpeg2/copyright)