Undo Linux updates.

master
Nicky 2021-03-09 10:40:01 +01:00
parent 9d820f140c
commit 493200bca5
72 changed files with 1458 additions and 2996 deletions

View File

@ -3,91 +3,7 @@
<map>
<key>installables</key>
<map>
<key>glib</key>
<map>
<key>copyright</key>
<string>Copyright (C) glib project</string>
<key>license</key>
<string>LGPL</string>
<key>license_file</key>
<string>LICENSES/glib.txt</string>
<key>name</key>
<string>glib</string>
<key>platforms</key>
<map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>9c93ba8b8af97fc8379f77de77e1540a</string>
<key>url</key>
<string>http://3p.firestormviewer.org/glib-2.48.0.202301938-linux64-202301938.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
</map>
<key>version</key>
<string>2.48.0</string>
</map>
<key>fltk</key>
<map>
<key>copyright</key>
<string>Copyright (C) fltk project</string>
<key>license</key>
<string>LGPL/fltk</string>
<key>license_file</key>
<string>LICENSES/fltk.txt</string>
<key>name</key>
<string>fltk</string>
<key>platforms</key>
<map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>81fe1e927e4fe3c5e5f15ce6219ca883</string>
<key>url</key>
<string>http://3p.firestormviewer.org/fltk-1.3.5.202282121-linux64-202282121.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
</map>
<key>version</key>
<string>1.3.5</string>
</map>
<key>gstreamer10</key>
<map>
<key>copyright</key>
<string>Copyright (C) 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt;</string>
<key>license</key>
<string>LGPL</string>
<key>license_file</key>
<string>LICENSES/gstreamer.txt</string>
<key>name</key>
<string>gstreamer10</string>
<key>platforms</key>
<map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>01f39ecf80dae64e30402ac384035b3e</string>
<key>url</key>
<string>http://downloads.phoenixviewer.com/gstreamer10-1.6.3.201605191852-linux-201605191852.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
</map>
<key>version</key>
<string>0.10.6.294903</string>
</map>
<key>jemalloc</key>
<key>jemalloc</key>
<map>
<key>copyright</key>
<string>Copyright (C) 2002-present Jason Evans jasone@canonware.com.</string>
@ -334,9 +250,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>1d4819f2944d572667b6a009bfadd8e0</string>
<string>64c1dff0e19792acec7fd32556bf4d7b</string>
<key>url</key>
<string>http://3p.firestormviewer.org/SDL-2.0.10-linux64-192791159.tar.bz2</string>
<string>http://3p.firestormviewer.org/SDL-1.2.15-linux64-181411635.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@ -2893,14 +2809,26 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<string>open-libndofdev</string>
<key>platforms</key>
<map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>246ed298944fd5200e4cac3703d6e075</string>
<key>url</key>
<string>http://3p.firestormviewer.org/open_libndofdev-0.9.183150124-linux-183150124.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>e52e1223fe1603485178ac65d6562a61</string>
<string>db8a7126178e7230fd6917a28cd67bd7</string>
<key>url</key>
<string>http://3p.firestormviewer.org/open_libndofdev-0.12.193591719-linux64-193591719.tar.bz2</string>
<string>http://3p.firestormviewer.org/open_libndofdev-0.9.183150121-linux64-183150121.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>

View File

@ -189,10 +189,6 @@ if (LINUX)
-pthread
)
if( FS_KEEP_FRAMEPOINTER )
add_compile_options(-fno-omit-frame-pointer)
endif()
# force this platform to accept TOS via external browser <FS:ND> No, do not.
# add_definitions(-DEXTERNAL_TOS)
@ -215,7 +211,6 @@ if (LINUX)
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-keep-memory -Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../lib' -Wl,--exclude-libs,ALL")
endif (NOT USESYSTEMLIBS)
set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory -Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../lib' -Wl,--exclude-libs,ALL")
set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
if( NOT (CMAKE_CXX_COMPILER MATCHES ".*clang") )
@ -288,6 +283,17 @@ if (USESYSTEMLIBS)
if (LINUX AND ADDRESS_SIZE EQUAL 32)
add_definitions(-march=pentiumpro)
endif (LINUX AND ADDRESS_SIZE EQUAL 32)
else (USESYSTEMLIBS)
set(${ARCH}_linux_INCLUDES
atk-1.0
cairo
freetype
glib-2.0
gstreamer-0.10
gtk-2.0
pango-1.0
)
endif (USESYSTEMLIBS)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@ -1,4 +1,4 @@
#include(BerkeleyDB)
include(BerkeleyDB)
include(Linking)
include(Prebuilt)

View File

@ -5,21 +5,17 @@ set(Boost_FIND_QUIETLY ON)
set(Boost_FIND_REQUIRED ON)
if (USESYSTEMLIBS)
SET(BOOST_INCLUDEDIR ${CMAKE_INCLUDE_PATH} )
SET(BOOST_LIBRARYDIR ${CMAKE_LIBRARY_PATH} )
include(FindBoost)
include_directories( ${BOOST_INCLUDEDIR} )
FIND_LIBRARY(BOOST_CONTEXT_LIBRARY boost_context-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_COROUTINE_LIBRARY boost_coroutine-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_REGEX_LIBRARY boost_regex-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_SIGNALS_LIBRARY boost_signals-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_SYSTEM_LIBRARY boost_system-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_THREAD_LIBRARY boost_thread-mt PATHS ${BOOST_LIBRARYDIR} )
FIND_LIBRARY(BOOST_WAVE_LIBRARY boost_wave-mt PATHS ${BOOST_LIBRARYDIR} )
set(BOOST_CONTEXT_LIBRARY boost_context-mt)
set(BOOST_FIBER_LIBRARY boost_fiber-mt)
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(BOOST_REGEX_LIBRARY boost_regex-mt)
set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
set(BOOST_THREAD_LIBRARY boost_thread-mt)
set(BOOST_WAVE_LIBRARY boost_wave-mt)
else (USESYSTEMLIBS)
use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)

View File

@ -3,8 +3,6 @@
include(Python)
include(FindAutobuild)
if( NOT USESYSTEMLIBS )
# packages-formatter.py runs autobuild install --versions, which needs to know
# the build_directory, which (on Windows) depends on AUTOBUILD_ADDRSIZE.
# Within an autobuild build, AUTOBUILD_ADDRSIZE is already set. But when
@ -20,5 +18,3 @@ add_custom_command(OUTPUT packages-info.txt
${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt
)
endif()

View File

@ -3,7 +3,7 @@ include(Linking)
include(Prebuilt)
if (USESYSTEMLIBS)
set(CEFPLUGIN ON CACHE BOOL
set(CEFPLUGIN OFF CACHE BOOL
"CEFPLUGIN support for the llplugin/llmedia test apps.")
else (USESYSTEMLIBS)
use_prebuilt_binary(dullahan)
@ -37,18 +37,9 @@ elseif (DARWIN)
)
elseif (LINUX)
if (USESYSTEMLIBS)
find_library( LIB_DULLAHAN "dullahan" )
find_library( LIB_CEF "cef" )
find_library( LIB_CEF_WRAPPER "cef_dll_wrapper" )
set(CEF_PLUGIN_LIBRARIES ${LIB_DULLAHAN} ${LIB_CEF} ${LIB_CEF_WRAPPER} )
else()
set(CEF_PLUGIN_LIBRARIES
dullahan
cef
cef_dll_wrapper.a
)
endif()
dullahan
cef
cef_dll_wrapper.a
)
endif (WINDOWS)

View File

@ -2,20 +2,11 @@
include (Prebuilt)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules( MINIZIP REQUIRED minizip )
pkg_check_modules( LIBXML2 REQUIRED libxml-2.0 )
pkg_check_modules( LIBPCRECPP REQUIRED libpcrecpp )
find_library( COLLADADOM_LIBRARY collada14dom )
find_path( COLLADADOM_INCLUDE_DIR colladadom/dae.h )
if( COLLADADOM_INCLUDE_DIR STREQUAL "COLLADADOM_INCLUDE_DIR-NOTFOUND" )
message( FATAL_ERROR "Cannot find colladadom include dir" )
endif()
set( COLLADA_INCLUDE_DIRS ${COLLADADOM_INCLUDE_DIR}/colladadom ${COLLADADOM_INCLUDE_DIR}/colladadom/1.4 )
find_path(COLLADA_INCLUDE_DIRS 1.4/dom/domConstants.h
PATH_SUFFIXES collada collada-dom2.4)
set(COLLADA_INCLUDE_DIRS
${COLLADA_INCLUDE_DIRS} ${COLLADA_INCLUDE_DIRS}/1.4
)
else (USESYSTEMLIBS)
set(COLLADA_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/collada

View File

@ -237,11 +237,14 @@ elseif(LINUX)
set(release_files
#libapr-1.so.0
#libaprutil-1.so.0
libatk-1.0.so
#libdb-5.1.so
${EXPAT_COPY}
#libfreetype.so.6.6.2
#libfreetype.so.6
#libGLOD.so
libgmodule-2.0.so
libgobject-2.0.so
libhunspell-1.3.so.0.0.0
libopenal.so
#libopenjpeg.so
@ -309,9 +312,10 @@ to_staging_dirs(
${release_files}
)
if(NOT USESYSTEMLIBS)
#<FS:TS> We need to do this regardless
#if(NOT USESYSTEMLIBS)
add_custom_target(
stage_third_party_libs ALL
DEPENDS ${third_party_targets}
)
endif(NOT USESYSTEMLIBS)
#endif(NOT USESYSTEMLIBS)

View File

@ -1,8 +1,6 @@
# -*- cmake -*-
include(Prebuilt)
include(GLIB)
if( GLIB_FOUND )
if (USESYSTEMLIBS)
include(FindPkgConfig)
@ -12,11 +10,14 @@ elseif (LINUX)
use_prebuilt_binary(dbus_glib)
set(DBUSGLIB_FOUND ON FORCE BOOL)
set(DBUSGLIB_INCLUDE_DIRS
${GLIB_INCLUDE_DIRS}
${LIBS_PREBUILT_DIR}/include/dbus
)
${LIBS_PREBUILT_DIR}/include/dbus
)
# We don't need to explicitly link against dbus-glib itself, because
# the viewer probes for the system's copy at runtime.
set(DBUSGLIB_LIBRARIES
gobject-2.0
glib-2.0
)
endif (USESYSTEMLIBS)
if (DBUSGLIB_FOUND)
@ -26,5 +27,3 @@ endif (DBUSGLIB_FOUND)
if (DBUSGLIB)
add_definitions(-DLL_DBUS_ENABLED=1)
endif (DBUSGLIB)
endif()

View File

@ -1,8 +1,94 @@
# -*- cmake -*-
include(FindPkgConfig)
pkg_check_modules( APR REQUIRED apr-1 )
set( APR_INCLUDE_DIR ${APR_INCLUDE_DIRS} )
# - Find Apache Portable Runtime
# Find the APR includes and libraries
# This module defines
# APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc.
# APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR.
# APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR.
# also defined, but not for general use are
# APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library.
pkg_check_modules( APRUTIL REQUIRED apr-util-1 )
set( APRUTIL_INCLUDE_DIR ${APRUTIL_INCLUDE_DIRS} )
# APR first.
FIND_PATH(APR_INCLUDE_DIR apr.h
/usr/local/include/apr-1
/usr/local/include/apr-1.0
/usr/include/apr-1
/usr/include/apr-1.0
)
SET(APR_NAMES ${APR_NAMES} apr-1)
FIND_LIBRARY(APR_LIBRARY
NAMES ${APR_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (APR_LIBRARY AND APR_INCLUDE_DIR)
SET(APR_LIBRARIES ${APR_LIBRARY})
SET(APR_FOUND "YES")
ELSE (APR_LIBRARY AND APR_INCLUDE_DIR)
SET(APR_FOUND "NO")
ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR)
IF (APR_FOUND)
IF (NOT APR_FIND_QUIETLY)
MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}")
ENDIF (NOT APR_FIND_QUIETLY)
ELSE (APR_FOUND)
IF (APR_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find APR library")
ENDIF (APR_FIND_REQUIRED)
ENDIF (APR_FOUND)
# Deprecated declarations.
SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH)
MARK_AS_ADVANCED(
APR_LIBRARY
APR_INCLUDE_DIR
)
# Next, APRUTIL.
FIND_PATH(APRUTIL_INCLUDE_DIR apu.h
/usr/local/include/apr-1
/usr/local/include/apr-1.0
/usr/include/apr-1
/usr/include/apr-1.0
)
SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1)
FIND_LIBRARY(APRUTIL_LIBRARY
NAMES ${APRUTIL_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY})
SET(APRUTIL_FOUND "YES")
ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
SET(APRUTIL_FOUND "NO")
ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
IF (APRUTIL_FOUND)
IF (NOT APRUTIL_FIND_QUIETLY)
MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}")
ENDIF (NOT APRUTIL_FIND_QUIETLY)
ELSE (APRUTIL_FOUND)
IF (APRUTIL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find APRUTIL library")
ENDIF (APRUTIL_FIND_REQUIRED)
ENDIF (APRUTIL_FOUND)
# Deprecated declarations.
SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH)
MARK_AS_ADVANCED(
APRUTIL_LIBRARY
APRUTIL_INCLUDE_DIR
)

View File

@ -9,10 +9,13 @@
# also defined, but not for general use are
# FMODSTUDIO_LIBRARY, where to find the FMODSTUDIO library.
FIND_PATH(FMODSTUDIO_INCLUDE_DIR fmod.h PATH_SUFFIXES fmodstudio)
FIND_PATH(FMODSTUDIO_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
SET(FMODSTUDIO_NAMES ${FMODSTUDIO_NAMES} fmod fmod_vc)
FIND_LIBRARY(FMODSTUDIO_LIBRARY NAMES ${FMODSTUDIO_NAMES} PATH_SUFFIXES fmod )
FIND_LIBRARY(FMODSTUDIO_LIBRARY
NAMES ${FMODSTUDIO_NAMES}
PATH_SUFFIXES fmod
)
IF (FMODSTUDIO_SDK_DIR OR WINDOWS)
if(WINDOWS)
@ -36,14 +39,12 @@ IF (FMODSTUDIO_SDK_DIR OR WINDOWS)
${FMODSTUDIO_SDK_DIR}/api
${FMODSTUDIO_SDK_DIR}
)
IF (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
SET(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY})
SET(FMODSTUDIO_FOUND "YES")
endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
ENDIF (FMODSTUDIO_SDK_DIR OR WINDOWS)
IF (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
SET(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY})
SET(FMODSTUDIO_FOUND "YES")
endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
IF (FMODSTUDIO_FOUND)
IF (NOT FMODSTUDIO_FIND_QUIETLY)
MESSAGE(STATUS "Found FMODSTUDIO: ${FMODSTUDIO_LIBRARIES}")

View File

@ -6,7 +6,9 @@
# GLH_INCLUDE_DIR, where to find glh/glh_linear.h.
# GLH_FOUND, If false, do not try to use GLH.
find_path(GLH_INCLUDE_DIR glh/glh_linear.h )
find_path(GLH_INCLUDE_DIR glh/glh_linear.h
NO_SYSTEM_ENVIRONMENT_PATH
)
if (GLH_INCLUDE_DIR)
set(GLH_FOUND "YES")

View File

@ -1,16 +1,36 @@
# -*- cmake -*-
find_library( GLOD_LIBRARY GLOD )
find_library( VDS_LIBRARY vds )
find_path( GLOD_INCLUDE_DIR glod/glod.h )
# - Find GLOD
# This module defines
# GLOD_INCLUDE_DIR, where to find glod.h, etc.
# GLOD_LIBRARIES, the library needed to use GLOD.
# GLOD_FOUND, If false, do not try to use GLOD.
if( GLOD_INCLUDE_DIR STREQUAL "GLOD_INCLUDE_DIR-NOTFOUND" )
message( FATAL_ERROR "Cannot find glod include dir" )
endif()
if( GLOD_LIBRARY STREQUAL "GLOD_LIBRARY-NOTFOUND" )
message( FATAL_ERROR "Cannot find library GLOD.a" )
endif()
if( VDS_LIBRARY STREQUAL "VDS_LIBRARY-NOTFOUND" )
message( FATAL_ERROR "Cannot find library vds.a" )
endif()
set(GLOD_LIBRARIES ${GLOD_LIBRARY} ${VDS_LIBRARY} )
# LL coded the #include with a glod path in llfloatermodelpreview.cpp
find_path(GLOD_INCLUDE_DIR glod/glod.h)
set(GLOD_NAMES ${GLOD_NAMES} glod)
find_library(GLOD_LIBRARIES
NAMES ${GLOD_NAMES}
)
if (GLOD_LIBRARIES AND GLOD_INCLUDE_DIR)
set(GLOD_FOUND "YES")
else (GLOD_LIBRARIES AND GLOD_INCLUDE_DIR)
set(GLOD_FOUND "NO")
endif (GLOD_LIBRARIES AND GLOD_INCLUDE_DIR)
if (GLOD_FOUND)
if (NOT GLOD_FIND_QUIETLY)
message(STATUS "Found GLOD: Library in '${GLOD_LIBRARY}' and header in '${GLOD_INCLUDE_DIR}' ")
endif (NOT GLOD_FIND_QUIETLY)
else (GLOD_FOUND)
if (GLOD_FIND_REQUIRED)
message(FATAL_ERROR " * * * * *\nCould not find GLOD library!\n* * * * *")
endif (GLOD_FIND_REQUIRED)
endif (GLOD_FOUND)
mark_as_advanced(
GLOD_LIBRARIES
GLOD_INCLUDE_DIR
)

View File

@ -9,15 +9,15 @@
# also defined, but not for general use are
# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library.
FIND_PATH(BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR breakpad/client/linux/handler/exception_handler.h)
# LL code uses "google_breakpad" path prefix, while google breakpad headers don't use a prefix. Find and add both paths to the correct variable.
FIND_PATH(BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR google_breakpad/exception_handler.h)
FIND_PATH(BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIRS exception_handler.h PATH_SUFFIXES google_breakpad)
SET(BREAKPAD_INCLUDE_DIRECTORIES ${BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR} ${BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIRS})
SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client)
FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY
NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES}
)
message ( ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY} )
include_directories( ${BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR}/google_breakpad/ )
IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR)
SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY})
@ -30,6 +30,7 @@ ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE
IF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
IF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
MESSAGE(STATUS "Found Google BreakPad: ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}")
MESSAGE(STATUS "Found Google BreakPad headers in: ${BREAKPAD_INCLUDE_DIRECTORIES}")
ENDIF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
ELSE (BREAKPAD_EXCEPTION_HANDLER_FOUND)
IF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)

View File

@ -1,6 +1,38 @@
# -*- cmake -*-
include(FindPkgConfig)
pkg_check_modules( HUNSPELL REQUIRED hunspell )
set( HUNSPELL_INCLUDE_DIR ${HUNSPELL_INCLUDE_DIRS} )
set( HUNSPELL_LIBRARY ${HUNSPELL_LIBRARIES} )
# - Find HUNSPELL
# This module defines
# HUNSPELL_INCLUDE_DIR, where to find libhunspell.h, etc.
# HUNSPELL_LIBRARY, the library needed to use HUNSPELL.
# HUNSPELL_FOUND, If false, do not try to use HUNSPELL.
find_path(HUNSPELL_INCLUDE_DIR hunspell.h
PATH_SUFFIXES hunspell
)
set(HUNSPELL_NAMES ${HUNSPELL_NAMES} hunspell-1.4 libhunspell-1.3 libhunspell)
find_library(HUNSPELL_LIBRARY
NAMES ${HUNSPELL_NAMES}
)
if (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR)
set(HUNSPELL_FOUND "YES")
else (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR)
set(HUNSPELL_FOUND "NO")
endif (HUNSPELL_LIBRARY AND HUNSPELL_INCLUDE_DIR)
if (HUNSPELL_FOUND)
if (NOT HUNSPELL_FIND_QUIETLY)
message(STATUS "Found Hunspell: Library in '${HUNSPELL_LIBRARY}' and header in '${HUNSPELL_INCLUDE_DIR}' ")
endif (NOT HUNSPELL_FIND_QUIETLY)
else (HUNSPELL_FOUND)
if (HUNSPELL_FIND_REQUIRED)
message(FATAL_ERROR " * * *\nCould not find HUNSPELL library! * * *")
endif (HUNSPELL_FIND_REQUIRED)
endif (HUNSPELL_FOUND)
mark_as_advanced(
HUNSPELL_LIBRARY
HUNSPELL_INCLUDE_DIR
)

View File

@ -1,6 +1,59 @@
# -*- cmake -*-
include(FindPkgConfig)
pkg_check_modules( JSONCPP REQUIRED jsoncpp )
set( JSONCPP_INCLUDE_DIR ${JSONCPP_INCLUDE_DIRS} )
# - Find JSONCpp
# Find the JSONCpp includes and library
# This module defines
# JSONCPP_INCLUDE_DIR, where to find json.h, etc.
# JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
# JSONCPP_FOUND, If false, do not try to use jsoncpp.
# also defined, but not for general use are
# JSONCPP_LIBRARY, where to find the jsoncpp library.
FIND_PATH(JSONCPP_INCLUDE_DIR NAMES jsoncpp/json.h jsoncpp/json/json.h
/usr/local/include
/usr/include
)
# Get the GCC compiler version
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE _gcc_COMPILER_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Try to find a library that was compiled with the same compiler version as we currently use.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
# On standalone, assume that the system installed library was compiled with the used compiler.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so libjsoncpp.so)
FIND_LIBRARY(JSONCPP_LIBRARY
NAMES ${JSONCPP_NAMES}
)
IF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
SET(JSONCPP_FOUND "YES")
ELSE (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
SET(JSONCPP_FOUND "NO")
ENDIF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
IF (JSONCPP_FOUND)
IF (NOT JSONCPP_FIND_QUIETLY)
MESSAGE(STATUS "Found JSONCpp: ${JSONCPP_LIBRARIES}")
ENDIF (NOT JSONCPP_FIND_QUIETLY)
ELSE (JSONCPP_FOUND)
IF (JSONCPP_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find JSONCpp library")
ENDIF (JSONCPP_FIND_REQUIRED)
ENDIF (JSONCPP_FOUND)
# Deprecated declarations.
SET (NATIVE_JSONCPP_INCLUDE_PATH ${JSONCPP_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_JSONCPP_LIB_PATH ${JSONCPP_LIBRARY} PATH)
MARK_AS_ADVANCED(
JSONCPP_LIBRARY
JSONCPP_INCLUDE_DIR
)

View File

@ -1,9 +1,40 @@
find_path( KDU_INCLUDE_DIR kdu/kdu_image.h )
find_library( KDU_LIBRARY kdu_x64 )
# -*- cmake -*-
if ( NOT KDU_LIBRARY OR NOT KDU_INCLUDE_DIR )
message(FATAL_ERROR "Cannot find KDU: Library '${KDU_LIBRARY}'; header '${KDU_INCLUDE_DIR}' ")
endif()
# - Find KDU
# This module defines
# KDU_INCLUDE_DIR, where to find kdu.h, etc.
# KDU_LIBRARIES, the library needed to use KDU.
# KDU_FOUND, If false, do not try to use KDU.
set( KDU_INCLUDE_DIR ${KDU_INCLUDE_DIR}/kdu )
set( LLKDU_LIBRARIES llkdu )
# LL coded the #include with a glod path in llfloatermodelpreview.cpp
find_path(KDU_INCLUDE_DIR kdu_image.h
PATH_SUFFIXES kdu
)
set(KDU_NAMES ${KDU_NAMES} kdu)
find_library(KDU_LIBRARIES
NAMES ${KDU_NAMES}
)
if (KDU_LIBRARIES AND KDU_INCLUDE_DIR)
set(KDU_FOUND "YES")
set(KDU_INCLUDE_DIRS ${KDU_INCLUDE_DIR})
set(KDU_LIBRARY ${KDU_LIBRARIES})
else (KDU_LIBRARIES AND KDU_INCLUDE_DIR)
set(KDU_FOUND "NO")
endif (KDU_LIBRARIES AND KDU_INCLUDE_DIR)
if (KDU_FOUND)
if (NOT KDU_FIND_QUIETLY)
message(STATUS "Found KDU: Library in '${KDU_LIBRARY}' and header in '${KDU_INCLUDE_DIR}' ")
endif (NOT KDU_FIND_QUIETLY)
else (KDU_FOUND)
if (KDU_FIND_REQUIRED)
message(FATAL_ERROR " * * * * *\nCould not find KDU library!\n* * * * *")
endif (KDU_FIND_REQUIRED)
endif (KDU_FOUND)
mark_as_advanced(
KDU_LIBRARIES
KDU_INCLUDE_DIR
)

View File

@ -1,5 +1,35 @@
# -*- cmake -*-
include(FindPkgConfig)
pkg_check_modules(NGHTTP2 REQUIRED libnghttp2)
# - Find NGHTTP2
# This module defines
# NGHTTP2_INCLUDE_DIR, where to find glod.h, etc.
# NGHTTP2_LIBRARIES, the library needed to use NGHTTP2.
# NGHTTP2_FOUND, If false, do not try to use NGHTTP2.
find_path(NGHTTP2_INCLUDE_DIR nghttp2/nghttp2.h)
set(NGHTTP2_NAMES ${NGHTTP2_NAMES} nghttp2)
find_library(NGHTTP2_LIBRARIES
NAMES ${NGHTTP2_NAMES}
)
if (NGHTTP2_LIBRARIES AND NGHTTP2_INCLUDE_DIR)
set(NGHTTP2_FOUND "YES")
else (NGHTTP2_LIBRARIES AND NGHTTP2_INCLUDE_DIR)
set(NGHTTP2_FOUND "NO")
endif (NGHTTP2_LIBRARIES AND NGHTTP2_INCLUDE_DIR)
if (NGHTTP2_FOUND)
if (NOT NGHTTP2_FIND_QUIETLY)
message(STATUS "Found NGHTTP2: Library in '${NGHTTP2_LIBRARY}' and header in '${NGHTTP2_INCLUDE_DIR}' ")
endif (NOT NGHTTP2_FIND_QUIETLY)
else (NGHTTP2_FOUND)
if (NGHTTP2_FIND_REQUIRED)
message(FATAL_ERROR " * * * * *\nCould not find NGHTTP2 library!\n* * * * *")
endif (NGHTTP2_FIND_REQUIRED)
endif (NGHTTP2_FOUND)
mark_as_advanced(
NGHTTP2_LIBRARIES
NGHTTP2_INCLUDE_DIR
)

View File

@ -1,7 +1,52 @@
# -*- cmake -*-
include(FindPkgConfig)
# - Find OpenJPEG
# Find the OpenJPEG includes and library
# This module defines
# OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc.
# OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG.
# OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
# also defined, but not for general use are
# OPENJPEG_LIBRARY, where to find the OpenJPEG library.
pkg_check_modules( OPENJPEG REQUIRED libopenjpeg1 )
FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h
/usr/local/include/openjpeg-2.1
/usr/local/include/openjpeg
/usr/local/include
/usr/include/openjpeg-2.1
/usr/include/openjpeg
/usr/include
)
set(OPENJPEG_INCLUDE_DIR ${OPENJPEG_INCLUDE_DIRS})
SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg openjp2)
FIND_LIBRARY(OPENJPEG_LIBRARY
NAMES ${OPENJPEG_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
SET(OPENJPEG_FOUND "YES")
ELSE (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
SET(OPENJPEG_FOUND "NO")
ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
IF (OPENJPEG_FOUND)
IF (NOT OPENJPEG_FIND_QUIETLY)
MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}")
ENDIF (NOT OPENJPEG_FIND_QUIETLY)
ELSE (OPENJPEG_FOUND)
IF (OPENJPEG_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find OpenJPEG library")
ENDIF (OPENJPEG_FIND_REQUIRED)
ENDIF (OPENJPEG_FOUND)
# Deprecated declarations.
SET (NATIVE_OPENJPEG_INCLUDE_PATH ${OPENJPEG_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_OPENJPEG_LIB_PATH ${OPENJPEG_LIBRARY} PATH)
MARK_AS_ADVANCED(
OPENJPEG_LIBRARY
OPENJPEG_INCLUDE_DIR
)

View File

@ -1,5 +1,44 @@
# -*- cmake -*-
include(FindPkgConfig)
pkg_check_modules( URIPARSER REQUIRED liburiparser )
set( URIPARSER_INCLUDE_DIR ${URIPARSER_INCLUDE_DIRS} )
# - Find uriparser
# Find the URIPARSER includes and library
# This module defines
# URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc.
# URIPARSER_LIBRARIES, the libraries needed to use uriparser.
# URIPARSER_FOUND, If false, do not try to use uriparser.
#
# This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x),
# because it doesn't look up the version of uriparser, resulting in a dramatic
# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
#
# Note: Since this file is only used for standalone, the windows
# specific parts were left out.
FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/Uri.h)
FIND_LIBRARY(URIPARSER_LIBRARY uriparser)
if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR})
SET(URIPARSER_LIBRARIES ${URIPARSER_LIBRARY})
SET(URIPARSER_FOUND "YES")
else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
SET(URIPARSER_FOUND "NO")
endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
if (URIPARSER_FOUND)
if (NOT URIPARSER_FIND_QUIETLY)
message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARIES}")
SET(URIPARSER_FIND_QUIETLY TRUE)
endif (NOT URIPARSER_FIND_QUIETLY)
else (URIPARSER_FOUND)
if (URIPARSER_FIND_REQUIRED)
message(FATAL_ERROR "Could not find URIPARSER library")
endif (URIPARSER_FIND_REQUIRED)
endif (URIPARSER_FOUND)
mark_as_advanced(
URIPARSER_LIBRARY
URIPARSER_INCLUDE_DIR
)

View File

@ -1,5 +1,46 @@
# -*- cmake -*-
include(FindPkgConfig)
pkg_check_modules( ZLIB REQUIRED zlib )
set( ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS} )
# - Find zlib
# Find the ZLIB includes and library
# This module defines
# ZLIB_INCLUDE_DIRS, where to find zlib.h, etc.
# ZLIB_LIBRARIES, the libraries needed to use zlib.
# ZLIB_FOUND, If false, do not try to use zlib.
#
# This FindZLIB is about 43 times as fast the one provided with cmake (2.8.x),
# because it doesn't look up the version of zlib, resulting in a dramatic
# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
#
# Note: Since this file is only used for standalone, the windows
# specific parts were left out.
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
NO_SYSTEM_ENVIRONMENT_PATH
)
FIND_LIBRARY(ZLIB_LIBRARY z)
if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
SET(ZLIB_FOUND "YES")
else (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
SET(ZLIB_FOUND "NO")
endif (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
if (ZLIB_FOUND)
if (NOT ZLIB_FIND_QUIETLY)
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}")
SET(ZLIB_FIND_QUIETLY TRUE)
endif (NOT ZLIB_FIND_QUIETLY)
else (ZLIB_FOUND)
if (ZLIB_FIND_REQUIRED)
message(FATAL_ERROR "Could not find ZLIB library")
endif (ZLIB_FIND_REQUIRED)
endif (ZLIB_FOUND)
mark_as_advanced(
ZLIB_LIBRARY
ZLIB_INCLUDE_DIR
)

View File

@ -1,11 +0,0 @@
include(Prebuilt)
if( LINUX )
use_prebuilt_binary(glib)
set(GLIB_FOUND ON CACHE BOOL "Build against glib 2")
set(GLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/glib-2.0 ${LIBS_PREBUILT_DIR}/lib/release/glib-2.0/include )
set(GLIB_LIBRARIES libgobject-2.0.a libglib-2.0.a libffi.a libpcre.a)
add_definitions(-DLL_GLIB=1)
endif()

View File

@ -1,8 +1,9 @@
# -*- cmake -*-
if (USESYSTEMLIBS)
include(FindGLOD)
else (USESYSTEMLIBS)
#if (USESYSTEMLIBS)
# set(GLOD_FIND_REQUIRED true)
# include(FindGLOD)
#else (USESYSTEMLIBS)
include(Prebuilt)
use_prebuilt_binary(glod)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
@ -11,4 +12,4 @@ if(LINUX)
else()
set(GLOD_LIBRARIES GLOD)
endif()
endif (USESYSTEMLIBS)
#endif (USESYSTEMLIBS)

View File

@ -1,6 +1,5 @@
# -*- cmake -*-
include(Prebuilt)
include(GLIB)
if (USESYSTEMLIBS)
include(FindPkgConfig)
@ -14,10 +13,10 @@ elseif (LINUX)
set(GSTREAMER010_FOUND ON FORCE BOOL)
set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL)
set(GSTREAMER010_INCLUDE_DIRS
${GLIB_INCLUDE_DIRS}
${LIBS_PREBUILT_DIR}/include/gstreamer-0.10
${LIBS_PREBUILT_DIR}/include/libxml2
)
${LIBS_PREBUILT_DIR}/include/gstreamer-0.10
${LIBS_PREBUILT_DIR}/include/glib-2.0
${LIBS_PREBUILT_DIR}/include/libxml2
)
# We don't need to explicitly link against gstreamer itself, because
# LLMediaImplGStreamer probes for the system's copy at runtime.
set(GSTREAMER010_LIBRARIES

View File

@ -1,32 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
include(GLIB)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(GSTREAMER10 REQUIRED gstreamer-1.0)
pkg_check_modules(GSTREAMER10_PLUGINS_BASE REQUIRED gstreamer-plugins-base-1.0)
elseif (LINUX OR WINDOWS)
use_prebuilt_binary(gstreamer10)
use_prebuilt_binary(libxml2)
set(GSTREAMER10_FOUND ON FORCE BOOL)
set(GSTREAMER10_PLUGINS_BASE_FOUND ON FORCE BOOL)
set(GSTREAMER10_INCLUDE_DIRS
${GLIB_INCLUDE_DIRS}
${LIBS_PREBUILT_DIR}/include/gstreamer-1.0
${LIBS_PREBUILT_DIR}/include/libxml2
)
# We don't need to explicitly link against gstreamer itself, because
# LLMediaImplGStreamer probes for the system's copy at runtime.
set(GSTREAMER10_LIBRARIES)
endif (USESYSTEMLIBS)
if (GSTREAMER10_FOUND AND GSTREAMER10_PLUGINS_BASE_FOUND)
set(GSTREAMER10 ON CACHE BOOL "Build with GStreamer-1.0 streaming media support.")
endif (GSTREAMER10_FOUND AND GSTREAMER10_PLUGINS_BASE_FOUND)
if (GSTREAMER10)
add_definitions(-DLL_GSTREAMER10_ENABLED=1)
endif (GSTREAMER10)

View File

@ -1,10 +1,10 @@
# -*- cmake -*-
include(Prebuilt)
if (USESYSTEMLIBS)
set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
include(FindGoogleBreakpad)
else (USESYSTEMLIBS)
#if (USESYSTEMLIBS)
# set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
# include(FindGoogleBreakpad)
#else (USESYSTEMLIBS)
use_prebuilt_binary(google_breakpad)
if (DARWIN)
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
@ -18,5 +18,5 @@ else (USESYSTEMLIBS)
# yes, this does look dumb, no, it's not incorrect
#
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad")
endif (USESYSTEMLIBS)
#endif (USESYSTEMLIBS)

View File

@ -2,44 +2,27 @@
include(Prebuilt)
include(Linking)
if( NOT USESYSTEMLIBS )
use_prebuilt_binary(googlemock)
use_prebuilt_binary(googlemock)
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include)
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include)
if (LINUX)
# VWR-24366: gmock is underlinked, it needs gtest.
set(GOOGLEMOCK_LIBRARIES
gmock -Wl,--no-as-needed
gtest -Wl,--as-needed)
elseif(WINDOWS)
set(GOOGLEMOCK_LIBRARIES
gmock)
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_DIR}/include/gmock
${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1)
elseif(DARWIN)
set(GOOGLEMOCK_LIBRARIES
gmock
gtest)
endif(LINUX)
else()
find_library( GOOGLETEST_LIBRARY gtest )
find_library( GOOGLEMOCK_LIBRARY gmock )
if (LINUX)
# VWR-24366: gmock is underlinked, it needs gtest.
set(GOOGLEMOCK_LIBRARIES
gmock -Wl,--no-as-needed
gtest -Wl,--as-needed)
elseif(WINDOWS)
set(GOOGLEMOCK_LIBRARIES
gmock)
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_DIR}/include/gmock
${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1)
elseif(DARWIN)
set(GOOGLEMOCK_LIBRARIES
gmock
gtest)
endif(LINUX)
if( GOOGLETEST_LIBRARY STREQUAL "GOOGLETEST_LIBRARY-NOTFOUND" )
message( FATAL_ERROR "Cannot find gtest library" )
endif()
if( GOOGLEMOCK_LIBRARY STREQUAL "GOOGLEMOCK_LIBRARY-NOTFOUND" )
message( FATAL_ERROR "Cannot find gmock library" )
endif()
set(GOOGLEMOCK_LIBRARIES ${GOOGLEMOCK_LIBRARY} ${GOOGLETEST_LIBRARY} )
endif()

View File

@ -23,8 +23,7 @@ if (HAVOK)
elseif (HAVOK_TPV)
use_prebuilt_binary(llphysicsextensions_tpv)
#set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensions_tpv)
set(LLPHYSICSEXTENSIONS_LIBRARIES libhacd.a libnd_hacdConvexDecomposition.a libnd_Pathing.a )
set(LLPHYSICSEXTENSIONS_LIBRARIES llphysicsextensions_tpv)
# <FS:ND> include paths for LLs version and ours are different.
set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)

View File

@ -4,75 +4,46 @@
include(Prebuilt)
include(Boost)
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml2)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
debug libcollada14dom23-sd
optimized libcollada14dom23-s
libxml2_a
debug pcrecppd
optimized pcrecpp
debug pcred
optimized pcre
${BOOST_SYSTEM_LIBRARIES}
)
elseif (DARWIN)
set(LLPRIMITIVE_LIBRARIES
llprimitive
debug collada14dom-d
optimized collada14dom
minizip
xml2
pcrecpp
pcre
iconv # Required by libxml2
)
elseif (LINUX)
set(LLPRIMITIVE_LIBRARIES
llprimitive
debug collada14dom-d
optimized collada14dom
minizip
xml2
pcrecpp
pcre
)
endif (WINDOWS)
if( NOT USESYSTEMLIBS )
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml2)
set( COLLADADOM_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILT_DIR}/include/collada/1.4 )
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
debug libcollada14dom23-sd
optimized libcollada14dom23-s
libxml2_a
debug pcrecppd
optimized pcrecpp
debug pcred
optimized pcre
${BOOST_SYSTEM_LIBRARIES}
)
elseif (DARWIN)
set(LLPRIMITIVE_LIBRARIES
llprimitive
debug collada14dom-d
optimized collada14dom
minizip
xml2
pcrecpp
pcre
iconv # Required by libxml2
)
elseif (LINUX)
set(LLPRIMITIVE_LIBRARIES
llprimitive
debug collada14dom-d
optimized collada14dom
minizip
xml2
pcrecpp
pcre
)
endif (WINDOWS)
else()
include(FindPkgConfig)
pkg_check_modules( MINIZIP REQUIRED minizip )
pkg_check_modules( LIBXML2 REQUIRED libxml-2.0 )
pkg_check_modules( LIBPCRECPP REQUIRED libpcrecpp )
find_library( COLLADADOM_LIBRARY collada14dom )
find_path( COLLADADOM_INCLUDE_DIR colladadom/dae.h )
if( COLLADADOM_INCLUDE_DIR STREQUAL "COLLADADOM_INCLUDE_DIR-NOTFOUND" )
message( FATAL_ERROR "Cannot find colladadom include dir" )
endif()
set( COLLADADOM_INCLUDE_DIRS ${COLLADADOM_INCLUDE_DIR}/colladadom ${COLLADADOM_INCLUDE_DIR}/colladadom/1.4 )
set(LLPRIMITIVE_LIBRARIES
llprimitive
${COLLADADOM_LIBRARY}
${MINIZIP_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBPRCECPP_LIBRARIES}
)
endif()

View File

@ -3,10 +3,9 @@
include(Variables)
include(GLEXT)
include(Prebuilt)
include(FindPkgConfig)
if (USESYSTEMLIBS)
pkg_check_modules(SDL2 REQUIRED sdl2)
include(FindSDL)
# This should be done by FindSDL. Sigh.
mark_as_advanced(
@ -18,7 +17,7 @@ else (USESYSTEMLIBS)
if (LINUX)
use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE)
set (SDL_LIBRARY SDL2 X11)
set (SDL_LIBRARY SDL directfb fusion direct X11)
endif (LINUX)
endif (USESYSTEMLIBS)

View File

@ -5,29 +5,23 @@ include(FreeType)
if (USESYSTEMLIBS)
include(FindPkgConfig)
if( NOT GTK_VERSION )
set( GTK_VERSION 2.0 )
endif()
if (LINUX)
set(PKGCONFIG_PACKAGES
atk
cairo
gdk-${GTK_VERSION}
gdk-2.0
gdk-pixbuf-2.0
glib-2.0
gmodule-2.0
gtk+-${GTK_VERSION}
gtk+-2.0
gthread-2.0
libpng
pango
pangoft2
sdl2
pangox
pangoxft
sdl
)
if( GTK_VERSION LESS "3.0" )
LIST( APPEND PKGCONFIG_PACKAGES pangoxft )
else()
add_definitions( -DGTK_DISABLE_DEPRECATED)
endif()
endif (LINUX)
foreach(pkg ${PKGCONFIG_PACKAGES})
@ -37,16 +31,29 @@ if (USESYSTEMLIBS)
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
list(APPEND UI_LIBRARIES X11)
else (USESYSTEMLIBS)
if (LINUX)
use_prebuilt_binary(fltk)
use_prebuilt_binary(gtk-atk-pango-glib)
endif (LINUX)
if (LINUX)
set(UI_LIB_NAMES
libfltk.a
freetype
atk-1.0
gdk-x11-2.0
gdk_pixbuf-2.0
glib-2.0
gmodule-2.0
gobject-2.0
gthread-2.0
gtk-x11-2.0
pango-1.0
pangoft2-1.0
pangox-1.0
#pangoxft-1.0
gio-2.0
pangocairo-1.0
ffi
)
foreach(libname ${UI_LIB_NAMES})
@ -73,5 +80,5 @@ else (USESYSTEMLIBS)
endif (USESYSTEMLIBS)
if (LINUX)
add_definitions(-DLL_X11=1 -DLL_FLTK=1)
add_definitions(-DLL_GTK=1 -DLL_X11=1)
endif (LINUX)

View File

@ -2,12 +2,12 @@
include(Prebuilt)
if (LINUX AND NOT SYSTEMLIBS )
set( USE_JEMALLOC ON CACHE BOOL "Ship prebuild jemalloc library with packaged viewer" )
set(USE_JEMALLOC ON)
endif ()
if( USE_JEMALLOC )
if (USESYSTEMLIBS)
message( WARNING "Search for jemalloc not implemented for standalone builds" )
message( WARNING "Not implemented" )
else (USESYSTEMLIBS)
use_prebuilt_binary(jemalloc)
endif (USESYSTEMLIBS)

View File

@ -59,9 +59,6 @@ add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES})
# llcommon uses `clock_gettime' which is provided by librt on linux.
set(LIBRT_LIBRARY rt)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
target_link_libraries(linux-crash-logger
${LLCRASHLOGGER_LIBRARIES}
@ -77,7 +74,6 @@ target_link_libraries(linux-crash-logger
${DB_LIBRARIES}
${FREETYPE_LIBRARIES}
${LIBRT_LIBRARY}
Threads::Threads
)
add_custom_target(linux-crash-logger-target ALL

View File

@ -343,9 +343,7 @@ if (DARWIN)
target_link_libraries(llcommon ${CARBON_LIBRARY})
endif (DARWIN)
if( NOT USESYSTEMLIBS )
add_dependencies(llcommon stage_third_party_libs)
endif()
if (LL_TESTS)
include(LLAddBuildTest)

View File

@ -39,11 +39,6 @@
static std::string getCurrentUserHome(char* fallback)
{
// snap-package:
// could use SNAP_USER_DATA (/home/nicky/snap/viewer-release/x1, whereas x1 is the release and thus will change, data is backed up/restored across snap refresh / snap revert)
// could use SNAP_USER_COMMON (/home/nicky/snap/viewer-release/common, data is NOT backed up/restored across snap refresh / snap revert)
// see https://docs.snapcraft.io/environment-variables/7983
const uid_t uid = getuid();
struct passwd *pw;
@ -176,10 +171,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
// traditionally on unixoids, MyApp gets ~/.myapp dir for data
mOSUserAppDir = mOSUserDir;
mOSUserAppDir += "/";
// When running as a snap package we canot use /home/<user>/.secondlife as strict-mode snaps do not get access to .dot files
// In that case we use /home/<user>/secondlife
if( nullptr == getenv( "SNAP_USER_DATA" ) )
mOSUserAppDir += ".";
mOSUserAppDir += ".";
std::string lower_app_name(app_name);
LLStringUtil::toLower(lower_app_name);
mOSUserAppDir += lower_app_name;

View File

@ -318,16 +318,7 @@ bool LLPluginSharedMemory::unlink(void)
bool LLPluginSharedMemory::create(size_t size)
{
char const *pSnapName = getenv( "SNAP_NAME" );
if( pSnapName )
{
mName = "snap.";
mName += pSnapName;
mName += ".LL";
}
else
mName = SHM_OPEN_SHARED_MEMORY_PREFIX_STRING;
mName = SHM_OPEN_SHARED_MEMORY_PREFIX_STRING;
mName += createName();
mSize = size;

View File

@ -91,10 +91,6 @@ if (DARWIN)
)
endif (DARWIN)
if( LINUX )
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
endif()
if (LL_TESTS)
ll_deploy_sharedlibs_command(SLPlugin)
endif (LL_TESTS)

View File

@ -273,7 +273,6 @@ void LLGLSLShader::readProfileQuery(U32 count, U32 mode)
glEndQueryARB(GL_TIME_ELAPSED);
glEndQueryARB(GL_SAMPLES_PASSED);
//<FS:TS> U64 and GLuint64 somehow turn out different on x86_64
//U64 time_elapsed = 0;
GLuint64 time_elapsed = 0;

View File

@ -190,12 +190,11 @@ endif (llwindow_HEADER_FILES)
${viewer_SOURCE_FILES}
)
if (SDL2_FOUND OR SDL_FOUND )
if (SDL_FOUND)
set_property(TARGET llwindow
PROPERTY COMPILE_DEFINITIONS LL_SDL=1
)
endif ()
endif (SDL_FOUND)
target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})
if (NOT USESYSTEMLIBS)
target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})
endif()

View File

@ -179,10 +179,12 @@ void LLKeyboard::resetKeys()
}
BOOL LLKeyboard::translateKey(const U32 os_key, KEY *out_key)
BOOL LLKeyboard::translateKey(const U16 os_key, KEY *out_key)
{
std::map<U16, KEY>::iterator iter;
// Only translate keys in the map, ignore all other keys for now
auto iter = mTranslateKeyMap.find(os_key);
iter = mTranslateKeyMap.find(os_key);
if (iter == mTranslateKeyMap.end())
{
//LL_WARNS() << "Unknown virtual key " << os_key << LL_ENDL;
@ -197,9 +199,10 @@ BOOL LLKeyboard::translateKey(const U32 os_key, KEY *out_key)
}
U32 LLKeyboard::inverseTranslateKey(const KEY translated_key)
U16 LLKeyboard::inverseTranslateKey(const KEY translated_key)
{
auto iter = mInvTranslateKeyMap.find(translated_key);
std::map<KEY, U16>::iterator iter;
iter = mInvTranslateKeyMap.find(translated_key);
if (iter == mInvTranslateKeyMap.end())
{
return 0;

View File

@ -75,19 +75,14 @@ public:
BOOL getKeyDown(const KEY key) { return mKeyLevel[key]; }
BOOL getKeyRepeated(const KEY key) { return mKeyRepeated[key]; }
BOOL translateKey(const U32 os_key, KEY *translated_key);
U32 inverseTranslateKey(const KEY translated_key);
BOOL translateKey(const U16 os_key, KEY *translated_key);
U16 inverseTranslateKey(const KEY translated_key);
BOOL handleTranslatedKeyUp(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes
BOOL handleTranslatedKeyDown(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes
#if LL_LINUX
virtual BOOL handleKeyUp(const U32 key, MASK mask) = 0;
virtual BOOL handleKeyDown(const U32 key, MASK mask) = 0;
#else
virtual BOOL handleKeyUp(const U16 key, MASK mask) = 0;
virtual BOOL handleKeyDown(const U16 key, MASK mask) = 0;
#endif
#ifdef LL_DARWIN
// We only actually use this for OS X.
@ -121,8 +116,8 @@ protected:
void addKeyName(KEY key, const std::string& name);
protected:
std::map<U32, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs
std::map<KEY, U32> mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys
std::map<U16, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs
std::map<KEY, U16> mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys
LLWindowCallbacks *mCallbacks;
LLTimer mKeyLevelTimer[KEY_COUNT]; // Time since level was set

View File

@ -35,21 +35,12 @@ void LLKeyboardHeadless::resetMaskKeys()
{ }
#ifdef LL_LINUX
BOOL LLKeyboardHeadless::handleKeyDown(const U32 key, const U32 mask)
{ return FALSE; }
BOOL LLKeyboardHeadless::handleKeyUp(const U32 key, const U32 mask)
{ return FALSE; }
#else
BOOL LLKeyboardHeadless::handleKeyUp(const U16 key, const U32 mask)
{ return FALSE; }
BOOL LLKeyboardHeadless::handleKeyDown(const U16 key, const U32 mask)
{ return FALSE; }
#endif
BOOL LLKeyboardHeadless::handleKeyUp(const U16 key, const U32 mask)
{ return FALSE; }
MASK LLKeyboardHeadless::currentMask(BOOL for_mouse_event)
{ return MASK_NONE; }

View File

@ -35,13 +35,8 @@ public:
LLKeyboardHeadless();
/*virtual*/ ~LLKeyboardHeadless() {};
#ifdef LL_LINUX
/*virtual*/ BOOL handleKeyUp(const U32 key, MASK mask);
/*virtual*/ BOOL handleKeyDown(const U32 key, MASK mask);
#else
/*virtual*/ BOOL handleKeyUp(const U16 key, MASK mask);
/*virtual*/ BOOL handleKeyDown(const U16 key, MASK mask);
#endif
/*virtual*/ void resetMaskKeys();
/*virtual*/ MASK currentMask(BOOL for_mouse_event);
/*virtual*/ void scanKeyboard();

View File

@ -29,8 +29,7 @@
#include "linden_common.h"
#include "llkeyboardsdl.h"
#include "llwindowcallbacks.h"
#include "SDL2/SDL.h"
#include "SDL2/SDL_keycode.h"
#include "SDL/SDL.h"
LLKeyboardSDL::LLKeyboardSDL()
{
@ -41,10 +40,6 @@ LLKeyboardSDL::LLKeyboardSDL()
// Virtual key mappings from SDL_keysym.h ...
// SDL maps the letter keys to the ASCII you'd expect, but it's lowercase...
// <FS:ND> Looks like we need to map those despite of SDL_TEXTINPUT handling most of this, but without
// the translation lower->upper here accelerators will not work.
U16 cur_char;
for (cur_char = 'A'; cur_char <= 'Z'; cur_char++)
{
@ -54,7 +49,7 @@ LLKeyboardSDL::LLKeyboardSDL()
{
mTranslateKeyMap[cur_char] = (cur_char - 'a') + 'A';
}
for (cur_char = '0'; cur_char <= '9'; cur_char++)
{
mTranslateKeyMap[cur_char] = cur_char;
@ -73,7 +68,7 @@ LLKeyboardSDL::LLKeyboardSDL()
//mTranslateKeyMap[SDLK_KP3] = KEY_PAGE_DOWN;
//mTranslateKeyMap[SDLK_KP0] = KEY_INSERT;
// mTranslateKeyMap[SDLK_SPACE] = ' '; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
mTranslateKeyMap[SDLK_SPACE] = ' ';
mTranslateKeyMap[SDLK_RETURN] = KEY_RETURN;
mTranslateKeyMap[SDLK_LEFT] = KEY_LEFT;
mTranslateKeyMap[SDLK_RIGHT] = KEY_RIGHT;
@ -116,39 +111,40 @@ LLKeyboardSDL::LLKeyboardSDL()
mTranslateKeyMap[SDLK_F10] = KEY_F10;
mTranslateKeyMap[SDLK_F11] = KEY_F11;
mTranslateKeyMap[SDLK_F12] = KEY_F12;
// mTranslateKeyMap[SDLK_PLUS] = '='; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_COMMA] = ','; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_MINUS] = '-'; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_PERIOD] = '.'; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_BACKQUOTE] = '`'; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_SLASH] = KEY_DIVIDE; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_SEMICOLON] = ';'; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_LEFTBRACKET] = '['; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_BACKSLASH] = '\\'; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_RIGHTBRACKET] = ']'; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
// mTranslateKeyMap[SDLK_QUOTE] = '\''; // <FS:ND/> Those are handled by SDL2 via text input, do not map them
mTranslateKeyMap[SDLK_PLUS] = '=';
mTranslateKeyMap[SDLK_COMMA] = ',';
mTranslateKeyMap[SDLK_MINUS] = '-';
mTranslateKeyMap[SDLK_PERIOD] = '.';
mTranslateKeyMap[SDLK_BACKQUOTE] = '`';
mTranslateKeyMap[SDLK_SLASH] = KEY_DIVIDE;
mTranslateKeyMap[SDLK_SEMICOLON] = ';';
mTranslateKeyMap[SDLK_LEFTBRACKET] = '[';
mTranslateKeyMap[SDLK_BACKSLASH] = '\\';
mTranslateKeyMap[SDLK_RIGHTBRACKET] = ']';
mTranslateKeyMap[SDLK_QUOTE] = '\'';
// Build inverse map
for (auto iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++)
std::map<U16, KEY>::iterator iter;
for (iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++)
{
mInvTranslateKeyMap[iter->second] = iter->first;
}
// numpad map
mTranslateNumpadMap[SDLK_KP_0] = KEY_PAD_INS;
mTranslateNumpadMap[SDLK_KP_1] = KEY_PAD_END;
mTranslateNumpadMap[SDLK_KP_2] = KEY_PAD_DOWN;
mTranslateNumpadMap[SDLK_KP_3] = KEY_PAD_PGDN;
mTranslateNumpadMap[SDLK_KP_4] = KEY_PAD_LEFT;
mTranslateNumpadMap[SDLK_KP_5] = KEY_PAD_CENTER;
mTranslateNumpadMap[SDLK_KP_6] = KEY_PAD_RIGHT;
mTranslateNumpadMap[SDLK_KP_7] = KEY_PAD_HOME;
mTranslateNumpadMap[SDLK_KP_8] = KEY_PAD_UP;
mTranslateNumpadMap[SDLK_KP_9] = KEY_PAD_PGUP;
mTranslateNumpadMap[SDLK_KP0] = KEY_PAD_INS;
mTranslateNumpadMap[SDLK_KP1] = KEY_PAD_END;
mTranslateNumpadMap[SDLK_KP2] = KEY_PAD_DOWN;
mTranslateNumpadMap[SDLK_KP3] = KEY_PAD_PGDN;
mTranslateNumpadMap[SDLK_KP4] = KEY_PAD_LEFT;
mTranslateNumpadMap[SDLK_KP5] = KEY_PAD_CENTER;
mTranslateNumpadMap[SDLK_KP6] = KEY_PAD_RIGHT;
mTranslateNumpadMap[SDLK_KP7] = KEY_PAD_HOME;
mTranslateNumpadMap[SDLK_KP8] = KEY_PAD_UP;
mTranslateNumpadMap[SDLK_KP9] = KEY_PAD_PGUP;
mTranslateNumpadMap[SDLK_KP_PERIOD] = KEY_PAD_DEL;
// build inverse numpad map
for (auto iter = mTranslateNumpadMap.begin();
for (iter = mTranslateNumpadMap.begin();
iter != mTranslateNumpadMap.end();
iter++)
{
@ -158,7 +154,7 @@ LLKeyboardSDL::LLKeyboardSDL()
void LLKeyboardSDL::resetMaskKeys()
{
SDL_Keymod mask = SDL_GetModState();
SDLMod mask = SDL_GetModState();
// MBW -- XXX -- This mirrors the operation of the Windows version of resetMaskKeys().
// It looks a bit suspicious, as it won't correct for keys that have been released.
@ -205,37 +201,37 @@ MASK LLKeyboardSDL::updateModifiers(const U32 mask)
}
static U32 adjustNativekeyFromUnhandledMask(const U32 key, const U32 mask)
static U16 adjustNativekeyFromUnhandledMask(const U16 key, const U32 mask)
{
// SDL doesn't automatically adjust the keysym according to
// whether NUMLOCK is engaged, so we massage the keysym manually.
U32 rtn = key;
U16 rtn = key;
if (!(mask & KMOD_NUM))
{
switch (key)
{
case SDLK_KP_PERIOD: rtn = SDLK_DELETE; break;
case SDLK_KP_0: rtn = SDLK_INSERT; break;
case SDLK_KP_1: rtn = SDLK_END; break;
case SDLK_KP_2: rtn = SDLK_DOWN; break;
case SDLK_KP_3: rtn = SDLK_PAGEDOWN; break;
case SDLK_KP_4: rtn = SDLK_LEFT; break;
case SDLK_KP_6: rtn = SDLK_RIGHT; break;
case SDLK_KP_7: rtn = SDLK_HOME; break;
case SDLK_KP_8: rtn = SDLK_UP; break;
case SDLK_KP_9: rtn = SDLK_PAGEUP; break;
case SDLK_KP_PERIOD: rtn = SDLK_DELETE; break;
case SDLK_KP0: rtn = SDLK_INSERT; break;
case SDLK_KP1: rtn = SDLK_END; break;
case SDLK_KP2: rtn = SDLK_DOWN; break;
case SDLK_KP3: rtn = SDLK_PAGEDOWN; break;
case SDLK_KP4: rtn = SDLK_LEFT; break;
case SDLK_KP6: rtn = SDLK_RIGHT; break;
case SDLK_KP7: rtn = SDLK_HOME; break;
case SDLK_KP8: rtn = SDLK_UP; break;
case SDLK_KP9: rtn = SDLK_PAGEUP; break;
}
}
return rtn;
}
BOOL LLKeyboardSDL::handleKeyDown(const U32 key, const U32 mask)
BOOL LLKeyboardSDL::handleKeyDown(const U16 key, const U32 mask)
{
U32 adjusted_nativekey;
U16 adjusted_nativekey;
KEY translated_key = 0;
U32 translated_mask = MASK_NONE;
BOOL handled = FALSE;
BOOL handled = FALSE;
adjusted_nativekey = adjustNativekeyFromUnhandledMask(key, mask);
@ -250,12 +246,12 @@ BOOL LLKeyboardSDL::handleKeyDown(const U32 key, const U32 mask)
}
BOOL LLKeyboardSDL::handleKeyUp(const U32 key, const U32 mask)
BOOL LLKeyboardSDL::handleKeyUp(const U16 key, const U32 mask)
{
U32 adjusted_nativekey;
U16 adjusted_nativekey;
KEY translated_key = 0;
U32 translated_mask = MASK_NONE;
BOOL handled = FALSE;
BOOL handled = FALSE;
adjusted_nativekey = adjustNativekeyFromUnhandledMask(key, mask);
@ -272,7 +268,7 @@ BOOL LLKeyboardSDL::handleKeyUp(const U32 key, const U32 mask)
MASK LLKeyboardSDL::currentMask(BOOL for_mouse_event)
{
MASK result = MASK_NONE;
SDL_Keymod mask = SDL_GetModState();
SDLMod mask = SDL_GetModState();
if (mask & KMOD_SHIFT) result |= MASK_SHIFT;
if (mask & KMOD_CTRL) result |= MASK_CONTROL;
@ -281,7 +277,7 @@ MASK LLKeyboardSDL::currentMask(BOOL for_mouse_event)
// For keyboard events, consider Meta keys equivalent to Control
if (!for_mouse_event)
{
if (mask & KMOD_GUI) result |= MASK_CONTROL;
if (mask & KMOD_META) result |= MASK_CONTROL;
}
return result;
@ -314,7 +310,7 @@ void LLKeyboardSDL::scanKeyboard()
}
BOOL LLKeyboardSDL::translateNumpadKey( const U32 os_key, KEY *translated_key)
BOOL LLKeyboardSDL::translateNumpadKey( const U16 os_key, KEY *translated_key)
{
return translateKey(os_key, translated_key);
}
@ -324,258 +320,5 @@ U16 LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key)
return inverseTranslateKey(translated_key);
}
enum class WindowsVK : U32
{
VK_UNKNOWN = 0,
VK_BACK = 0x08,
VK_TAB = 0x09,
VK_CLEAR = 0x0C,
VK_RETURN = 0x0D,
VK_SHIFT = 0x10,
VK_CONTROL = 0x11,
VK_MENU = 0x12,
VK_PAUSE = 0x13,
VK_CAPITAL = 0x14,
VK_KANA = 0x15,
VK_HANGUL = 0x15,
VK_JUNJA = 0x17,
VK_FINAL = 0x18,
VK_HANJA = 0x19,
VK_KANJI = 0x19,
VK_ESCAPE = 0x1B,
VK_CONVERT = 0x1C,
VK_NONCONVERT = 0x1D,
VK_ACCEPT = 0x1E,
VK_MODECHANGE = 0x1F,
VK_SPACE = 0x20,
VK_PRIOR = 0x21,
VK_NEXT = 0x22,
VK_END = 0x23,
VK_HOME = 0x24,
VK_LEFT = 0x25,
VK_UP = 0x26,
VK_RIGHT = 0x27,
VK_DOWN = 0x28,
VK_SELECT = 0x29,
VK_PRINT = 0x2A,
VK_EXECUTE = 0x2B,
VK_SNAPSHOT = 0x2C,
VK_INSERT = 0x2D,
VK_DELETE = 0x2E,
VK_HELP = 0x2F,
VK_0 = 0x30,
VK_1 = 0x31,
VK_2 = 0x32,
VK_3 = 0x33,
VK_4 = 0x34,
VK_5 = 0x35,
VK_6 = 0x36,
VK_7 = 0x37,
VK_8 = 0x38,
VK_9 = 0x39,
VK_A = 0x41,
VK_B = 0x42,
VK_C = 0x43,
VK_D = 0x44,
VK_E = 0x45,
VK_F = 0x46,
VK_G = 0x47,
VK_H = 0x48,
VK_I = 0x49,
VK_J = 0x4A,
VK_K = 0x4B,
VK_L = 0x4C,
VK_M = 0x4D,
VK_N = 0x4E,
VK_O = 0x4F,
VK_P = 0x50,
VK_Q = 0x51,
VK_R = 0x52,
VK_S = 0x53,
VK_T = 0x54,
VK_U = 0x55,
VK_V = 0x56,
VK_W = 0x57,
VK_X = 0x58,
VK_Y = 0x59,
VK_Z = 0x5A,
VK_LWIN = 0x5B,
VK_RWIN = 0x5C,
VK_APPS = 0x5D,
VK_SLEEP = 0x5F,
VK_NUMPAD0 = 0x60,
VK_NUMPAD1 = 0x61,
VK_NUMPAD2 = 0x62,
VK_NUMPAD3 = 0x63,
VK_NUMPAD4 = 0x64,
VK_NUMPAD5 = 0x65,
VK_NUMPAD6 = 0x66,
VK_NUMPAD7 = 0x67,
VK_NUMPAD8 = 0x68,
VK_NUMPAD9 = 0x69,
VK_MULTIPLY = 0x6A,
VK_ADD = 0x6B,
VK_SEPARATOR = 0x6C,
VK_SUBTRACT = 0x6D,
VK_DECIMAL = 0x6E,
VK_DIVIDE = 0x6F,
VK_F1 = 0x70,
VK_F2 = 0x71,
VK_F3 = 0x72,
VK_F4 = 0x73,
VK_F5 = 0x74,
VK_F6 = 0x75,
VK_F7 = 0x76,
VK_F8 = 0x77,
VK_F9 = 0x78,
VK_F10 = 0x79,
VK_F11 = 0x7A,
VK_F12 = 0x7B,
VK_F13 = 0x7C,
VK_F14 = 0x7D,
VK_F15 = 0x7E,
VK_F16 = 0x7F,
VK_F17 = 0x80,
VK_F18 = 0x81,
VK_F19 = 0x82,
VK_F20 = 0x83,
VK_F21 = 0x84,
VK_F22 = 0x85,
VK_F23 = 0x86,
VK_F24 = 0x87,
VK_NUMLOCK = 0x90,
VK_SCROLL = 0x91,
VK_LSHIFT = 0xA0,
VK_RSHIFT = 0xA1,
VK_LCONTROL = 0xA2,
VK_RCONTROL = 0xA3,
VK_LMENU = 0xA4,
VK_RMENU = 0xA5,
VK_BROWSER_BACK = 0xA6,
VK_BROWSER_FORWARD = 0xA7,
VK_BROWSER_REFRESH = 0xA8,
VK_BROWSER_STOP = 0xA9,
VK_BROWSER_SEARCH = 0xAA,
VK_BROWSER_FAVORITES = 0xAB,
VK_BROWSER_HOME = 0xAC,
VK_VOLUME_MUTE = 0xAD,
VK_VOLUME_DOWN = 0xAE,
VK_VOLUME_UP = 0xAF,
VK_MEDIA_NEXT_TRACK = 0xB0,
VK_MEDIA_PREV_TRACK = 0xB1,
VK_MEDIA_STOP = 0xB2,
VK_MEDIA_PLAY_PAUSE = 0xB3,
VK_MEDIA_LAUNCH_MAIL = 0xB4,
VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5,
VK_MEDIA_LAUNCH_APP1 = 0xB6,
VK_MEDIA_LAUNCH_APP2 = 0xB7,
VK_OEM_1 = 0xBA,
VK_OEM_PLUS = 0xBB,
VK_OEM_COMMA = 0xBC,
VK_OEM_MINUS = 0xBD,
VK_OEM_PERIOD = 0xBE,
VK_OEM_2 = 0xBF,
VK_OEM_3 = 0xC0,
VK_OEM_4 = 0xDB,
VK_OEM_5 = 0xDC,
VK_OEM_6 = 0xDD,
VK_OEM_7 = 0xDE,
VK_OEM_8 = 0xDF,
VK_OEM_102 = 0xE2,
VK_PROCESSKEY = 0xE5,
VK_PACKET = 0xE7,
VK_ATTN = 0xF6,
VK_CRSEL = 0xF7,
VK_EXSEL = 0xF8,
VK_EREOF = 0xF9,
VK_PLAY = 0xFA,
VK_ZOOM = 0xFB,
VK_NONAME = 0xFC,
VK_PA1 = 0xFD,
VK_OEM_CLEAR = 0xFE,
};
std::map< U32, U32 > mSDL2_to_Win;
std::set< U32 > mIgnoreSDL2Keys;
U32 LLKeyboardSDL::mapSDL2toWin( U32 aSymbol )
{
// <FS:ND> Map SDLK_ virtual keys to Windows VK_ virtual keys.
// Text is handled via unicode input (SDL_TEXTINPUT event) and does not need to be translated into VK_ values as those match already.
if( mSDL2_to_Win.empty() )
{
mSDL2_to_Win[ SDLK_UNKNOWN ] = (U32)WindowsVK::VK_UNKNOWN;
mSDL2_to_Win[ SDLK_BACKSPACE ] = (U32)WindowsVK::VK_BACK;
mSDL2_to_Win[ SDLK_TAB ] = (U32)WindowsVK::VK_TAB;
mSDL2_to_Win[ SDLK_CLEAR ] = (U32)WindowsVK::VK_CLEAR;
mSDL2_to_Win[ SDLK_RETURN ] = (U32)WindowsVK::VK_RETURN;
mSDL2_to_Win[ SDLK_PAUSE ] = (U32)WindowsVK::VK_PAUSE;
mSDL2_to_Win[ SDLK_ESCAPE ] = (U32)WindowsVK::VK_ESCAPE;
mSDL2_to_Win[ SDLK_DELETE ] = (U32)WindowsVK::VK_DELETE;
mSDL2_to_Win[ SDLK_KP_PERIOD ] = (U32)WindowsVK::VK_OEM_PERIOD;
mSDL2_to_Win[ SDLK_KP_DIVIDE ] = (U32)WindowsVK::VK_DIVIDE;
mSDL2_to_Win[ SDLK_KP_MULTIPLY] = (U32)WindowsVK::VK_MULTIPLY;
mSDL2_to_Win[ SDLK_KP_MINUS ] = (U32)WindowsVK::VK_OEM_MINUS;
mSDL2_to_Win[ SDLK_KP_PLUS ] = (U32)WindowsVK::VK_OEM_PLUS;
mSDL2_to_Win[ SDLK_KP_ENTER ] = (U32)WindowsVK::VK_RETURN;
// ?
//mSDL2_to_Win[ SDLK_KP_EQUALS ] = (U32)WindowsVK::VK_EQUALS;
mSDL2_to_Win[ SDLK_UP ] = (U32)WindowsVK::VK_UP;
mSDL2_to_Win[ SDLK_DOWN ] = (U32)WindowsVK::VK_DOWN;
mSDL2_to_Win[ SDLK_RIGHT ] = (U32)WindowsVK::VK_RIGHT;
mSDL2_to_Win[ SDLK_LEFT ] = (U32)WindowsVK::VK_LEFT;
mSDL2_to_Win[ SDLK_INSERT ] = (U32)WindowsVK::VK_INSERT;
mSDL2_to_Win[ SDLK_HOME ] = (U32)WindowsVK::VK_HOME;
mSDL2_to_Win[ SDLK_END ] = (U32)WindowsVK::VK_END;
mSDL2_to_Win[ SDLK_PAGEUP ] = (U32)WindowsVK::VK_PRIOR;
mSDL2_to_Win[ SDLK_PAGEDOWN ] = (U32)WindowsVK::VK_NEXT;
mSDL2_to_Win[ SDLK_F1 ] = (U32)WindowsVK::VK_F1;
mSDL2_to_Win[ SDLK_F2 ] = (U32)WindowsVK::VK_F2;
mSDL2_to_Win[ SDLK_F3 ] = (U32)WindowsVK::VK_F3;
mSDL2_to_Win[ SDLK_F4 ] = (U32)WindowsVK::VK_F4;
mSDL2_to_Win[ SDLK_F5 ] = (U32)WindowsVK::VK_F5;
mSDL2_to_Win[ SDLK_F6 ] = (U32)WindowsVK::VK_F6;
mSDL2_to_Win[ SDLK_F7 ] = (U32)WindowsVK::VK_F7;
mSDL2_to_Win[ SDLK_F8 ] = (U32)WindowsVK::VK_F8;
mSDL2_to_Win[ SDLK_F9 ] = (U32)WindowsVK::VK_F9;
mSDL2_to_Win[ SDLK_F10 ] = (U32)WindowsVK::VK_F10;
mSDL2_to_Win[ SDLK_F11 ] = (U32)WindowsVK::VK_F11;
mSDL2_to_Win[ SDLK_F12 ] = (U32)WindowsVK::VK_F12;
mSDL2_to_Win[ SDLK_F13 ] = (U32)WindowsVK::VK_F13;
mSDL2_to_Win[ SDLK_F14 ] = (U32)WindowsVK::VK_F14;
mSDL2_to_Win[ SDLK_F15 ] = (U32)WindowsVK::VK_F15;
mSDL2_to_Win[ SDLK_CAPSLOCK ] = (U32)WindowsVK::VK_CAPITAL;
mSDL2_to_Win[ SDLK_RSHIFT ] = (U32)WindowsVK::VK_SHIFT;
mSDL2_to_Win[ SDLK_LSHIFT ] = (U32)WindowsVK::VK_SHIFT;
mSDL2_to_Win[ SDLK_RCTRL ] = (U32)WindowsVK::VK_CONTROL;
mSDL2_to_Win[ SDLK_LCTRL ] = (U32)WindowsVK::VK_CONTROL;
mSDL2_to_Win[ SDLK_RALT ] = (U32)WindowsVK::VK_MENU;
mSDL2_to_Win[ SDLK_LALT ] = (U32)WindowsVK::VK_MENU;
// VK_MODECHANGE ?
// mSDL2_to_Win[ SDLK_MODE ] = (U32)WindowsVK::VK_MODE;
mSDL2_to_Win[ SDLK_HELP ] = (U32)WindowsVK::VK_HELP;
// ?
// mSDL2_to_Win[ SDLK_SYSREQ ] = (U32)WindowsVK::VK_SYSREQ;
mSDL2_to_Win[ SDLK_MENU ] = (U32)WindowsVK::VK_MENU;
// ?
// mSDL2_to_Win[ SDLK_POWER ] = (U32)WindowsVK::VK_POWER;
// ?
//mSDL2_to_Win[ SDLK_UNDO ] = (U32)WindowsVK::VK_UNDO;
}
auto itr = mSDL2_to_Win.find( aSymbol );
if( itr != mSDL2_to_Win.end() )
return itr->second;
return aSymbol;
}
#endif

View File

@ -28,7 +28,7 @@
#define LL_LLKEYBOARDSDL_H
#include "llkeyboard.h"
#include "SDL2/SDL.h"
#include "SDL/SDL.h"
class LLKeyboardSDL : public LLKeyboard
{
@ -36,8 +36,8 @@ public:
LLKeyboardSDL();
/*virtual*/ ~LLKeyboardSDL() {};
/*virtual*/ BOOL handleKeyUp(const U32 key, MASK mask);
/*virtual*/ BOOL handleKeyDown(const U32 key, MASK mask);
/*virtual*/ BOOL handleKeyUp(const U16 key, MASK mask);
/*virtual*/ BOOL handleKeyDown(const U16 key, MASK mask);
/*virtual*/ void resetMaskKeys();
/*virtual*/ MASK currentMask(BOOL for_mouse_event);
/*virtual*/ void scanKeyboard();
@ -45,14 +45,11 @@ public:
protected:
MASK updateModifiers(const U32 mask);
void setModifierKeyLevel( KEY key, BOOL new_state );
BOOL translateNumpadKey( const U32 os_key, KEY *translated_key );
BOOL translateNumpadKey( const U16 os_key, KEY *translated_key );
U16 inverseTranslateNumpadKey(const KEY translated_key);
private:
std::map<U32, KEY> mTranslateNumpadMap; // special map for translating OS keys to numpad keys
std::map<KEY, U32> mInvTranslateNumpadMap; // inverse of the above
public:
static U32 mapSDL2toWin( U32 );
std::map<U16, KEY> mTranslateNumpadMap; // special map for translating OS keys to numpad keys
std::map<KEY, U16> mInvTranslateNumpadMap; // inverse of the above
};
#endif

View File

@ -119,10 +119,8 @@ LLKeyboardWin32::LLKeyboardWin32()
mTranslateKeyMap[VK_APPS] = KEY_CONTEXT_MENU; // <FS:Ansariel> FIRE-19933: Open context menu on context menu key press
// Build inverse map
// <FS:ND> Change to U32 for SDL2
//std::map<U16, KEY>::iterator iter;
// for (iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++)
for (auto iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++)
std::map<U16, KEY>::iterator iter;
for (iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++)
{
mInvTranslateKeyMap[iter->second] = iter->first;
}
@ -144,9 +142,7 @@ LLKeyboardWin32::LLKeyboardWin32()
mTranslateNumpadMap[0x6E] = KEY_PAD_DEL; // keypad .
mTranslateNumpadMap[0x6F] = KEY_PAD_DIVIDE; // keypad /
// <FS:ND> Change to U32 for SDL2
// for (iter = mTranslateNumpadMap.begin(); iter != mTranslateNumpadMap.end(); iter++)
for (auto iter = mTranslateNumpadMap.begin(); iter != mTranslateNumpadMap.end(); iter++)
for (iter = mTranslateNumpadMap.begin(); iter != mTranslateNumpadMap.end(); iter++)
{
mInvTranslateNumpadMap[iter->second] = iter->first;
}

File diff suppressed because it is too large Load Diff

View File

@ -32,12 +32,12 @@
#include "llwindow.h"
#include "lltimer.h"
#include "SDL2/SDL.h"
#include "SDL2/SDL_endian.h"
#include "SDL/SDL.h"
#include "SDL/SDL_endian.h"
#if LL_X11
// get X11-specific headers for use in low-level stuff like copy-and-paste support
#include "SDL2/SDL_syswm.h"
#include "SDL/SDL_syswm.h"
#endif
// AssertMacros.h does bad things.
@ -182,7 +182,7 @@ protected:
void destroyContext();
void setupFailure(const std::string& text, const std::string& caption, U32 type);
void fixWindowSize(void);
U32 SDLCheckGrabbyKeys(U32 keysym, BOOL gain);
U32 SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain);
BOOL SDLReallyCaptureInput(BOOL capture);
//
@ -190,12 +190,7 @@ protected:
//
U32 mGrabbyKeyFlags;
int mReallyCapturedCount;
SDL_Window* mWindow;
SDL_Surface* mSurface;
SDL_GLContext mContext;
SDL_Cursor* mSDLCursors[UI_CURSOR_COUNT];
SDL_Surface * mWindow;
std::string mWindowTitle;
double mOriginalAspectRatio;
BOOL mNeedsResize; // Constructor figured out the window is too big, it needs a resize.
@ -206,6 +201,7 @@ protected:
int mSDLFlags;
SDL_Cursor* mSDLCursors[UI_CURSOR_COUNT];
int mHaveInputFocus; /* 0=no, 1=yes, else unknown */
int mIsMinimized; /* 0=no, 1=yes, else unknown */
@ -218,12 +214,12 @@ private:
LLTimer mFlashTimer;
#endif //LL_X11
U32 mKeyVirtualKey;
U32 mKeyModifiers;
U32 mKeyScanCode;
U32 mKeyVirtualKey;
SDLMod mKeyModifiers;
U32 mSDLSym; // <FS:ND/> Store the SDL Keysym too.
BOOL mUseLegacyCursors; // <FS:LO> Legacy cursor setting from main program
private:
void tryFindFullscreenSize( int &aWidth, int &aHeight );
};

View File

@ -1,18 +1,11 @@
# -*- cmake -*-
add_subdirectory(base)
if (LINUX)
include(GLIB)
#add_subdirectory(gstreamer010)
#add_subdirectory(example)
if( GLIB_FOUND )
add_subdirectory(gstreamer10)
else()
MESSAGE( "Building without gstreamer (missing GLIB)" )
endif()
#add_subdirectory(libvlc)
# add_subdirectory(gstreamer010)
add_subdirectory(cef)
add_subdirectory(libvlc)
#add_subdirectory(example)
endif (LINUX)
if (DARWIN)

View File

@ -897,20 +897,12 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_dat
// <FS:ND> Keyboard handling for Linux.
#if LL_LINUX
uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key_win"].asInteger());
uint32_t native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger());
if( native_virtual_key == '\n' )
native_virtual_key = '\r';
mCEFLib->nativeKeyboardEventSDL2(key_event, native_virtual_key, native_modifiers, false);
// <FS:ND> Slightly hacky :| To make CEF honor enter (eg to accept form input) we've to not only send KE_KEY_UP/KE_KEY_DOWN
// but also a KE_KEY_CHAR event.
// Note that we cannot blindly send a KE_CHAR for each KE_KEY_UP. Doing so will create bogus keyboard input (like % for cursor left).
// Adding this just in llwindowsdl does not seem to fire an appropriate unicodeInput event down below, thus repeat this check here again :(
if( dullahan::KE_KEY_UP == key_event && native_virtual_key == '\r' )
mCEFLib->nativeKeyboardEventSDL2(dullahan::KE_KEY_CHAR, native_virtual_key, native_modifiers, false);
uint32_t native_scan_code = (uint32_t)(native_key_data["sdl_sym"].asInteger());
uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger());
uint32_t native_modifiers = (uint32_t)(native_key_data["cef_modifiers"].asInteger());
if( native_scan_code == '\n' )
native_scan_code = '\r';
mCEFLib->nativeKeyboardEvent(key_event, native_scan_code, native_virtual_key, native_modifiers);
#endif
// </FS:ND>
};
@ -943,17 +935,6 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD
U64 lparam = ll_U32_from_sd(native_key_data["l_param"]);
mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam);
#endif
// <FS:ND> Keyboard handling for Linux.
#if LL_LINUX
uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key_win"].asInteger());
uint32_t native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger());
if( native_virtual_key == '\n' )
native_virtual_key = '\r';
mCEFLib->nativeKeyboardEventSDL2(dullahan::KE_KEY_CHAR, native_virtual_key, native_modifiers, false);
#endif
// </FS:ND>
};
////////////////////////////////////////////////////////////////////////////////

View File

@ -37,7 +37,7 @@ if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC -Wno-literal-suffix)
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT ADDRESS_SIZE EQUAL 32)
@ -69,7 +69,7 @@ target_link_libraries(media_plugin_gstreamer010
add_dependencies(media_plugin_gstreamer010
${LLPLUGIN_LIBRARIES}
${MEDIA_PLUGIN_BASE_LIBRARIES}
llcommon
${LLCOMMON_LIBRARIES}
)

View File

@ -853,6 +853,15 @@ MediaPluginGStreamer010::startup()
if (!mDoneInit)
{
#if ( !defined(GLIB_MAJOR_VERSION) && !defined(GLIB_MINOR_VERSION) ) || ( GLIB_MAJOR_VERSION < 2 ) || ( GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 32 )
g_thread_init(NULL);
#endif
// Init the glib type system - we need it.
#if ( !defined(GLIB_MAJOR_VERSION) && !defined(GLIB_MINOR_VERSION) ) || ( GLIB_MAJOR_VERSION < 2 ) || ( GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 35 )
g_type_init();
#endif
// Get symbols!
#if LL_DARWIN
if (! grab_gst_syms("libgstreamer-0.10.dylib",

View File

@ -1,78 +0,0 @@
# -*- cmake -*-
project(media_plugin_gstreamer10)
include(00-Common)
include(LLCommon)
include(LLImage)
include(LLPlugin)
include(LLMath)
include(LLRender)
include(LLWindow)
include(Linking)
include(PluginAPI)
include(MediaPluginBase)
include(OpenGL)
include(GLIB)
include(GStreamer10Plugin)
include_directories(
${LLPLUGIN_INCLUDE_DIRS}
${MEDIA_PLUGIN_BASE_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
${GSTREAMER10_INCLUDE_DIRS}
${GSTREAMER10_PLUGINS_BASE_INCLUDE_DIRS}
)
include_directories(SYSTEM
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
)
### media_plugin_gstreamer10
if(NOT WORD_SIZE EQUAL 32)
if(NOT WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif()
endif(NOT WORD_SIZE EQUAL 32)
set(media_plugin_gstreamer10_SOURCE_FILES
media_plugin_gstreamer10.cpp
llmediaimplgstreamer_syms.cpp
)
set(media_plugin_gstreamer10_HEADER_FILES
llmediaimplgstreamer_syms.h
llmediaimplgstreamertriviallogging.h
)
add_library(media_plugin_gstreamer10
SHARED
${media_plugin_gstreamer10_SOURCE_FILES}
)
target_link_libraries(media_plugin_gstreamer10
${LLPLUGIN_LIBRARIES}
${MEDIA_PLUGIN_BASE_LIBRARIES}
${LLCOMMON_LIBRARIES}
${PLUGIN_API_WINDOWS_LIBRARIES}
${GSTREAMER10_LIBRARIES}
)
#add_dependencies(media_plugin_gstreamer10
# ${LLPLUGIN_LIBRARIES}
# ${MEDIA_PLUGIN_BASE_LIBRARIES}
# ${LLCOMMON_LIBRARIES}
#)
if (WINDOWS)
set_target_properties(
media_plugin_gstreamer10
PROPERTIES
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT"
)
endif (WINDOWS)

View File

@ -1,53 +0,0 @@
/**
* @file llmediaimplgstreamer.h
* @author Tofu Linden
* @brief implementation that supports media playback via GStreamer.
*
* @cond
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
* @endcond
*/
// header guard
#ifndef llmediaimplgstreamer_h
#define llmediaimplgstreamer_h
#if LL_GSTREAMER010_ENABLED
extern "C" {
#include <stdio.h>
#include <gst/gst.h>
#include "apr_pools.h"
#include "apr_dso.h"
}
extern "C" {
gboolean llmediaimplgstreamer_bus_callback (GstBus *bus,
GstMessage *message,
gpointer data);
}
#endif // LL_GSTREAMER010_ENABLED
#endif // llmediaimplgstreamer_h

View File

@ -1,197 +0,0 @@
/**
* @file llmediaimplgstreamer_syms.cpp
* @brief dynamic GStreamer symbol-grabbing code
*
* @cond
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
* @endcond
*/
#include <string>
#include <iostream>
#include <vector>
#ifdef LL_WINDOWS
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0502
#include <Windows.h>
#endif
#include "linden_common.h"
extern "C" {
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
}
#include "apr_pools.h"
#include "apr_dso.h"
#ifdef LL_WINDOWS
#ifndef _M_AMD64
#define GSTREAMER_REG_KEY "Software\\GStreamer1.0\\x86"
#define GSTREAMER_DIR_SUFFIX "1.0\\x86\\bin\\"
#else
#define GSTREAMER_REG_KEY "Software\\GStreamer1.0\\x86_64"
#define GSTREAMER_DIR_SUFFIX "1.0\\x86_64\\bin\\"
#endif
bool openRegKey( HKEY &aKey )
{
// Try native (32 bit view/64 bit view) of registry first.
if( ERROR_SUCCESS == ::RegOpenKeyExA( HKEY_LOCAL_MACHINE, GSTREAMER_REG_KEY, 0, KEY_QUERY_VALUE, &aKey ) )
return true;
// If native view fails, use 32 bit view or registry.
if( ERROR_SUCCESS == ::RegOpenKeyExA( HKEY_LOCAL_MACHINE, GSTREAMER_REG_KEY, 0, KEY_QUERY_VALUE | KEY_WOW64_32KEY, &aKey ) )
return true;
return false;
}
std::string getGStreamerDir()
{
std::string ret;
HKEY hKey;
if( openRegKey( hKey ) )
{
DWORD dwLen(0);
::RegQueryValueExA( hKey, "InstallDir", nullptr, nullptr, nullptr, &dwLen );
if( dwLen > 0 )
{
std::vector< char > vctBuffer;
vctBuffer.resize( dwLen );
::RegQueryValueExA( hKey, "InstallDir", nullptr, nullptr, reinterpret_cast< LPBYTE>(&vctBuffer[ 0 ]), &dwLen );
ret = &vctBuffer[0];
if( ret[ dwLen-1 ] != '\\' )
ret += "\\";
ret += GSTREAMER_DIR_SUFFIX;
SetDllDirectoryA( ret.c_str() );
}
::RegCloseKey( hKey );
}
return ret;
}
#else
std::string getGStreamerDir() { return ""; }
#endif
#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) RTN (*ll##GSTSYM)(__VA_ARGS__) = NULL;
#include "llmediaimplgstreamer_syms_raw.inc"
#undef LL_GST_SYM
struct Symloader
{
bool mRequired;
char const *mName;
apr_dso_handle_sym_t *mPPFunc;
};
#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) { REQ, #GSTSYM , (apr_dso_handle_sym_t*)&ll##GSTSYM},
Symloader sSyms[] = {
#include "llmediaimplgstreamer_syms_raw.inc"
{ false, 0, 0 } };
#undef LL_GST_SYM
// a couple of stubs for disgusting reasons
GstDebugCategory*
ll_gst_debug_category_new(gchar *name, guint color, gchar *description)
{
static GstDebugCategory dummy;
return &dummy;
}
void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname)
{
}
static bool sSymsGrabbed = false;
static apr_pool_t *sSymGSTDSOMemoryPool = NULL;
std::vector< apr_dso_handle_t* > sLoadedLibraries;
bool grab_gst_syms( std::vector< std::string > const &aDSONames )
{
if (sSymsGrabbed)
return true;
//attempt to load the shared libraries
apr_pool_create(&sSymGSTDSOMemoryPool, NULL);
for( std::vector< std::string >::const_iterator itr = aDSONames.begin(); itr != aDSONames.end(); ++itr )
{
apr_dso_handle_t *pDSO(NULL);
std::string strDSO = getGStreamerDir() + *itr;
if( APR_SUCCESS == apr_dso_load( &pDSO, strDSO.c_str(), sSymGSTDSOMemoryPool ))
sLoadedLibraries.push_back( pDSO );
for( int i = 0; sSyms[ i ].mName; ++i )
{
if( !*sSyms[ i ].mPPFunc )
{
apr_dso_sym( sSyms[ i ].mPPFunc, pDSO, sSyms[ i ].mName );
}
}
}
std::stringstream strm;
bool sym_error = false;
for( int i = 0; sSyms[ i ].mName; ++i )
{
if( sSyms[ i ].mRequired && ! *sSyms[ i ].mPPFunc )
{
sym_error = true;
strm << sSyms[ i ].mName << std::endl;
}
}
sSymsGrabbed = !sym_error;
return sSymsGrabbed;
}
void ungrab_gst_syms()
{
// should be safe to call regardless of whether we've
// actually grabbed syms.
for( std::vector< apr_dso_handle_t* >::iterator itr = sLoadedLibraries.begin(); itr != sLoadedLibraries.end(); ++itr )
apr_dso_unload( *itr );
sLoadedLibraries.clear();
if ( sSymGSTDSOMemoryPool )
{
apr_pool_destroy(sSymGSTDSOMemoryPool);
sSymGSTDSOMemoryPool = NULL;
}
for( int i = 0; sSyms[ i ].mName; ++i )
*sSyms[ i ].mPPFunc = NULL;
sSymsGrabbed = false;
}

View File

@ -1,68 +0,0 @@
/**
* @file llmediaimplgstreamer_syms.h
* @brief dynamic GStreamer symbol-grabbing code
*
* @cond
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
* @endcond
*/
#include "linden_common.h"
#include <vector>
extern "C" {
#include <gst/gst.h>
}
bool grab_gst_syms( std::vector< std::string > const&);
void ungrab_gst_syms();
#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) extern RTN (*ll##GSTSYM)(__VA_ARGS__);
#include "llmediaimplgstreamer_syms_raw.inc"
#undef LL_GST_SYM
// regrettable hacks to give us better runtime compatibility with older systems
#define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0)
#define llg_return_val_if_fail(COND,V) do{if (!(COND)) return V;}while(0)
// regrettable hacks because GStreamer was not designed for runtime loading
#undef GST_TYPE_MESSAGE
#define GST_TYPE_MESSAGE (llgst_message_get_type())
#undef GST_TYPE_OBJECT
#define GST_TYPE_OBJECT (llgst_object_get_type())
#undef GST_TYPE_PIPELINE
#define GST_TYPE_PIPELINE (llgst_pipeline_get_type())
#undef GST_TYPE_ELEMENT
#define GST_TYPE_ELEMENT (llgst_element_get_type())
#undef GST_TYPE_VIDEO_SINK
#define GST_TYPE_VIDEO_SINK (llgst_video_sink_get_type())
// more regrettable hacks to stub-out these .h-exposed GStreamer internals
void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname);
#undef _gst_debug_register_funcptr
#define _gst_debug_register_funcptr ll_gst_debug_register_funcptr
GstDebugCategory* ll_gst_debug_category_new(gchar *name, guint color, gchar *description);
#undef _gst_debug_category_new
#define _gst_debug_category_new ll_gst_debug_category_new
#undef __gst_debug_enabled
#define __gst_debug_enabled (0)
// more hacks
#define LLGST_MESSAGE_TYPE_NAME(M) (llgst_message_type_get_name(GST_MESSAGE_TYPE(M)))

View File

@ -1,68 +0,0 @@
LL_GST_SYM(true, gst_buffer_new, GstBuffer*, void)
LL_GST_SYM(true, gst_structure_set_value, void, GstStructure *, const gchar *, const GValue*)
LL_GST_SYM(true, gst_init_check, gboolean, int *argc, char **argv[], GError ** err)
LL_GST_SYM(true, gst_message_get_type, GType, void)
LL_GST_SYM(true, gst_message_type_get_name, const gchar*, GstMessageType type)
LL_GST_SYM(true, gst_message_parse_error, void, GstMessage *message, GError **gerror, gchar **debug)
LL_GST_SYM(true, gst_message_parse_warning, void, GstMessage *message, GError **gerror, gchar **debug)
LL_GST_SYM(true, gst_message_parse_state_changed, void, GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending)
LL_GST_SYM(true, gst_element_set_state, GstStateChangeReturn, GstElement *element, GstState state)
LL_GST_SYM(true, gst_object_unref, void, gpointer object)
LL_GST_SYM(true, gst_object_get_type, GType, void)
LL_GST_SYM(true, gst_pipeline_get_type, GType, void)
LL_GST_SYM(true, gst_pipeline_get_bus, GstBus*, GstPipeline *pipeline)
LL_GST_SYM(true, gst_bus_add_watch, guint, GstBus * bus, GstBusFunc func, gpointer user_data)
LL_GST_SYM(true, gst_element_factory_make, GstElement*, const gchar *factoryname, const gchar *name)
LL_GST_SYM(true, gst_element_get_type, GType, void)
LL_GST_SYM(true, gst_static_pad_template_get, GstPadTemplate*, GstStaticPadTemplate *pad_template)
LL_GST_SYM(true, gst_element_class_add_pad_template, void, GstElementClass *klass, GstPadTemplate *temp)
LL_GST_SYM(true, gst_caps_from_string, GstCaps *, const gchar *string)
LL_GST_SYM(true, gst_caps_get_structure, GstStructure *, const GstCaps *caps, guint index)
LL_GST_SYM(true, gst_element_register, gboolean, GstPlugin *plugin, const gchar *name, guint rank, GType type)
LL_GST_SYM(true, gst_structure_get_int, gboolean, const GstStructure *structure, const gchar *fieldname, gint *value)
LL_GST_SYM(true, gst_structure_get_value, G_CONST_RETURN GValue *, const GstStructure *structure, const gchar *fieldname)
LL_GST_SYM(true, gst_value_get_fraction_numerator, gint, const GValue *value)
LL_GST_SYM(true, gst_value_get_fraction_denominator, gint, const GValue *value)
LL_GST_SYM(true, gst_structure_get_name, G_CONST_RETURN gchar *, const GstStructure *structure)
LL_GST_SYM(true, gst_element_seek, bool, GstElement *, gdouble, GstFormat, GstSeekFlags, GstSeekType, gint64, GstSeekType, gint64)
LL_GST_SYM(false, gst_registry_fork_set_enabled, void, gboolean enabled)
LL_GST_SYM(false, gst_segtrap_set_enabled, void, gboolean enabled)
LL_GST_SYM(false, gst_message_parse_buffering, void, GstMessage *message, gint *percent)
LL_GST_SYM(false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug)
LL_GST_SYM(false, gst_element_query_position, gboolean, GstElement *element, GstFormat *format, gint64 *cur)
LL_GST_SYM(false, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano)
LL_GST_SYM( true, gst_message_parse_tag, void, GstMessage *, GstTagList **)
LL_GST_SYM( true, gst_tag_list_foreach, void, const GstTagList *, GstTagForeachFunc, gpointer)
LL_GST_SYM( true, gst_tag_list_get_tag_size, guint, const GstTagList *, const gchar *)
LL_GST_SYM( true, gst_tag_list_get_value_index, const GValue *, const GstTagList *, const gchar *, guint)
LL_GST_SYM( true, gst_caps_new_simple, GstCaps*, const char *, const char*, ... )
LL_GST_SYM( true, gst_sample_get_caps, GstCaps*, GstSample* )
LL_GST_SYM( true, gst_sample_get_buffer, GstBuffer*, GstSample* )
LL_GST_SYM( true, gst_buffer_map, gboolean, GstBuffer*, GstMapInfo*, GstMapFlags )
LL_GST_SYM( true, gst_buffer_unmap, void, GstBuffer*, GstMapInfo* )
LL_GST_SYM( true, gst_app_sink_set_caps, void, GstAppSink*, GstCaps const* )
LL_GST_SYM( true, gst_app_sink_pull_sample, GstSample*, GstAppSink* )
LL_GST_SYM( true, g_free, void, gpointer )
LL_GST_SYM( true, g_error_free, void, GError* )
LL_GST_SYM( true, g_main_context_pending, gboolean, GMainContext* )
LL_GST_SYM( true, g_main_loop_get_context, GMainContext*, GMainLoop* )
LL_GST_SYM( true, g_main_context_iteration, gboolean, GMainContext*, gboolean )
LL_GST_SYM( true, g_main_loop_new, GMainLoop*, GMainContext*, gboolean )
LL_GST_SYM( true, g_main_loop_quit, void, GMainLoop* )
LL_GST_SYM( true, gst_mini_object_unref, void, GstMiniObject* )
LL_GST_SYM( true, g_object_set, void, gpointer, gchar const*, ... )
LL_GST_SYM( true, g_source_remove, gboolean, guint )
LL_GST_SYM( true, g_value_get_string, gchar const*, GValue const* )
LL_GST_SYM( true, gst_debug_set_active, void, gboolean )
LL_GST_SYM( true, gst_debug_add_log_function, void, GstLogFunction, gpointer, GDestroyNotify )
LL_GST_SYM( true, gst_debug_set_default_threshold, void, GstDebugLevel )
LL_GST_SYM( true, gst_debug_message_get , gchar const*, GstDebugMessage * )

View File

@ -1,980 +0,0 @@
/**
* @file media_plugin_gstreamer10.cpp
* @brief GStreamer-1.0 plugin for LLMedia API plugin system
*
* @cond
* $LicenseInfo:firstyear=2016&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2016, Linden Research, Inc. / Nicky Dasmijn
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
* @endcond
*/
#define FLIP_Y
#include "linden_common.h"
#include "llgl.h"
#include "llplugininstance.h"
#include "llpluginmessage.h"
#include "llpluginmessageclasses.h"
#include "media_plugin_base.h"
#define G_DISABLE_CAST_CHECKS
extern "C" {
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
}
#include "llmediaimplgstreamer.h"
#include "llmediaimplgstreamer_syms.h"
static inline void llgst_caps_unref( GstCaps * caps )
{
llgst_mini_object_unref( GST_MINI_OBJECT_CAST( caps ) );
}
static inline void llgst_sample_unref( GstSample *aSample )
{
llgst_mini_object_unref( GST_MINI_OBJECT_CAST( aSample ) );
}
//////////////////////////////////////////////////////////////////////////////
//
class MediaPluginGStreamer10 : public MediaPluginBase
{
public:
MediaPluginGStreamer10(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data);
~MediaPluginGStreamer10();
/* virtual */ void receiveMessage(const char *message_string);
static bool startup();
static bool closedown();
gboolean processGSTEvents(GstBus *bus, GstMessage *message);
private:
std::string getVersion();
bool navigateTo( const std::string urlIn );
bool seek( double time_sec );
bool setVolume( float volume );
// misc
bool pause();
bool stop();
bool play(double rate);
bool getTimePos(double &sec_out);
double MIN_LOOP_SEC = 1.0F;
U32 INTERNAL_TEXTURE_SIZE = 1024;
bool mIsLooping;
enum ECommand {
COMMAND_NONE,
COMMAND_STOP,
COMMAND_PLAY,
COMMAND_FAST_FORWARD,
COMMAND_FAST_REWIND,
COMMAND_PAUSE,
COMMAND_SEEK,
};
ECommand mCommand;
private:
bool unload();
bool load();
bool update(int milliseconds);
void mouseDown( int x, int y );
void mouseUp( int x, int y );
void mouseMove( int x, int y );
static bool mDoneInit;
guint mBusWatchID;
float mVolume;
int mDepth;
// padded texture size we need to write into
int mTextureWidth;
int mTextureHeight;
bool mSeekWanted;
double mSeekDestination;
// Very GStreamer-specific
GMainLoop *mPump; // event pump for this media
GstElement *mPlaybin;
GstAppSink *mAppSink;
};
//static
bool MediaPluginGStreamer10::mDoneInit = false;
MediaPluginGStreamer10::MediaPluginGStreamer10( LLPluginInstance::sendMessageFunction host_send_func,
void *host_user_data )
: MediaPluginBase(host_send_func, host_user_data)
, mBusWatchID ( 0 )
, mSeekWanted(false)
, mSeekDestination(0.0)
, mPump ( NULL )
, mPlaybin ( NULL )
, mAppSink ( NULL )
, mCommand ( COMMAND_NONE )
{
}
gboolean MediaPluginGStreamer10::processGSTEvents(GstBus *bus, GstMessage *message)
{
if (!message)
return TRUE; // shield against GStreamer bug
switch (GST_MESSAGE_TYPE (message))
{
case GST_MESSAGE_BUFFERING:
{
// NEEDS GST 0.10.11+
if (llgst_message_parse_buffering)
{
gint percent = 0;
llgst_message_parse_buffering(message, &percent);
}
break;
}
case GST_MESSAGE_STATE_CHANGED:
{
GstState old_state;
GstState new_state;
GstState pending_state;
llgst_message_parse_state_changed(message,
&old_state,
&new_state,
&pending_state);
switch (new_state)
{
case GST_STATE_VOID_PENDING:
break;
case GST_STATE_NULL:
break;
case GST_STATE_READY:
setStatus(STATUS_LOADED);
break;
case GST_STATE_PAUSED:
setStatus(STATUS_PAUSED);
break;
case GST_STATE_PLAYING:
setStatus(STATUS_PLAYING);
break;
}
break;
}
case GST_MESSAGE_ERROR:
{
GError *err = NULL;
gchar *debug = NULL;
llgst_message_parse_error (message, &err, &debug);
if (err)
llg_error_free (err);
llg_free (debug);
mCommand = COMMAND_STOP;
setStatus(STATUS_ERROR);
break;
}
case GST_MESSAGE_INFO:
{
if (llgst_message_parse_info)
{
GError *err = NULL;
gchar *debug = NULL;
llgst_message_parse_info (message, &err, &debug);
if (err)
llg_error_free (err);
llg_free (debug);
}
break;
}
case GST_MESSAGE_WARNING:
{
GError *err = NULL;
gchar *debug = NULL;
llgst_message_parse_warning (message, &err, &debug);
if (err)
llg_error_free (err);
llg_free (debug);
break;
}
case GST_MESSAGE_EOS:
/* end-of-stream */
if (mIsLooping)
{
double eos_pos_sec = 0.0F;
bool got_eos_position = getTimePos(eos_pos_sec);
if (got_eos_position && eos_pos_sec < MIN_LOOP_SEC)
{
// if we know that the movie is really short, don't
// loop it else it can easily become a time-hog
// because of GStreamer spin-up overhead
// inject a COMMAND_PAUSE
mCommand = COMMAND_PAUSE;
}
else
{
stop();
play(1.0);
}
}
else // not a looping media
{
// inject a COMMAND_STOP
mCommand = COMMAND_STOP;
}
break;
default:
/* unhandled message */
break;
}
/* we want to be notified again the next time there is a message
* on the bus, so return true (false means we want to stop watching
* for messages on the bus and our callback should not be called again)
*/
return TRUE;
}
extern "C" {
gboolean llmediaimplgstreamer_bus_callback (GstBus *bus,
GstMessage *message,
gpointer data)
{
MediaPluginGStreamer10 *impl = (MediaPluginGStreamer10*)data;
return impl->processGSTEvents(bus, message);
}
} // extern "C"
bool MediaPluginGStreamer10::navigateTo ( const std::string urlIn )
{
if (!mDoneInit)
return false; // error
setStatus(STATUS_LOADING);
mSeekWanted = false;
if (NULL == mPump || NULL == mPlaybin)
{
setStatus(STATUS_ERROR);
return false; // error
}
llg_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL);
// navigateTo implicitly plays, too.
play(1.0);
return true;
}
class GstSampleUnref
{
GstSample *mT;
public:
GstSampleUnref( GstSample *aT )
: mT( aT )
{ llassert_always( mT ); }
~GstSampleUnref( )
{ llgst_sample_unref( mT ); }
};
bool MediaPluginGStreamer10::update(int milliseconds)
{
if (!mDoneInit)
return false; // error
// DEBUGMSG("updating media...");
// sanity check
if (NULL == mPump || NULL == mPlaybin)
{
return false;
}
// see if there's an outstanding seek wanted
if (mSeekWanted &&
// bleh, GST has to be happy that the movie is really truly playing
// or it may quietly ignore the seek (with rtsp:// at least).
(GST_STATE(mPlaybin) == GST_STATE_PLAYING))
{
seek(mSeekDestination);
mSeekWanted = false;
}
// *TODO: time-limit - but there isn't a lot we can do here, most
// time is spent in gstreamer's own opaque worker-threads. maybe
// we can do something sneaky like only unlock the video object
// for 'milliseconds' and otherwise hold the lock.
while (llg_main_context_pending(llg_main_loop_get_context(mPump)))
{
llg_main_context_iteration(llg_main_loop_get_context(mPump), FALSE);
}
// check for availability of a new frame
if( !mAppSink )
return true;
if( GST_STATE(mPlaybin) != GST_STATE_PLAYING) // Do not try to pull a sample if not in playing state
return true;
GstSample *pSample = llgst_app_sink_pull_sample( mAppSink );
if(!pSample)
return false; // Done playing
GstSampleUnref oSampleUnref( pSample );
GstCaps *pCaps = llgst_sample_get_caps ( pSample );
if (!pCaps)
return false;
gint width, height;
GstStructure *pStruct = llgst_caps_get_structure ( pCaps, 0);
int res = llgst_structure_get_int ( pStruct, "width", &width);
res |= llgst_structure_get_int ( pStruct, "height", &height);
if( !mPixels )
return true;
GstBuffer *pBuffer = llgst_sample_get_buffer ( pSample );
GstMapInfo map;
llgst_buffer_map ( pBuffer, &map, GST_MAP_READ);
// Our render buffer is always 1kx1k
U32 rowSkip = INTERNAL_TEXTURE_SIZE / mTextureHeight;
U32 colSkip = INTERNAL_TEXTURE_SIZE / mTextureWidth;
for (int row = 0; row < mTextureHeight; ++row)
{
U8 const *pTexelIn = map.data + (row*rowSkip * width *3);
#ifndef FLIP_Y
U8 *pTexelOut = mPixels + (row * mTextureWidth * mDepth );
#else
U8 *pTexelOut = mPixels + ((mTextureHeight-row-1) * mTextureWidth * mDepth );
#endif
for( int col = 0; col < mTextureWidth; ++col )
{
pTexelOut[ 0 ] = pTexelIn[0];
pTexelOut[ 1 ] = pTexelIn[1];
pTexelOut[ 2 ] = pTexelIn[2];
pTexelOut += mDepth;
pTexelIn += colSkip*3;
}
}
llgst_buffer_unmap( pBuffer, &map );
setDirty(0,0,mTextureWidth,mTextureHeight);
return true;
}
void MediaPluginGStreamer10::mouseDown( int x, int y )
{
// do nothing
}
void MediaPluginGStreamer10::mouseUp( int x, int y )
{
// do nothing
}
void MediaPluginGStreamer10::mouseMove( int x, int y )
{
// do nothing
}
bool MediaPluginGStreamer10::pause()
{
// todo: error-check this?
if (mDoneInit && mPlaybin)
{
llgst_element_set_state(mPlaybin, GST_STATE_PAUSED);
return true;
}
return false;
}
bool MediaPluginGStreamer10::stop()
{
// todo: error-check this?
if (mDoneInit && mPlaybin)
{
llgst_element_set_state(mPlaybin, GST_STATE_READY);
return true;
}
return false;
}
bool MediaPluginGStreamer10::play(double rate)
{
// NOTE: we don't actually support non-natural rate.
// todo: error-check this?
if (mDoneInit && mPlaybin)
{
llgst_element_set_state(mPlaybin, GST_STATE_PLAYING);
return true;
}
return false;
}
bool MediaPluginGStreamer10::setVolume( float volume )
{
// we try to only update volume as conservatively as
// possible, as many gst-plugins-base versions up to at least
// November 2008 have critical race-conditions in setting volume - sigh
if (mVolume == volume)
return true; // nothing to do, everything's fine
mVolume = volume;
if (mDoneInit && mPlaybin)
{
llg_object_set(mPlaybin, "volume", mVolume, NULL);
return true;
}
return false;
}
bool MediaPluginGStreamer10::seek(double time_sec)
{
bool success = false;
if (mDoneInit && mPlaybin)
{
success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_FLUSH |
GST_SEEK_FLAG_KEY_UNIT),
GST_SEEK_TYPE_SET, gint64(time_sec*GST_SECOND),
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
}
return success;
}
bool MediaPluginGStreamer10::getTimePos(double &sec_out)
{
bool got_position = false;
if (mDoneInit && mPlaybin)
{
gint64 pos(0);
GstFormat timefmt = GST_FORMAT_TIME;
got_position =
llgst_element_query_position &&
llgst_element_query_position(mPlaybin,
&timefmt,
&pos);
got_position = got_position
&& (timefmt == GST_FORMAT_TIME);
// GStreamer may have other ideas, but we consider the current position
// undefined if not PLAYING or PAUSED
got_position = got_position &&
(GST_STATE(mPlaybin) == GST_STATE_PLAYING ||
GST_STATE(mPlaybin) == GST_STATE_PAUSED);
if (got_position && !GST_CLOCK_TIME_IS_VALID(pos))
{
if (GST_STATE(mPlaybin) == GST_STATE_PLAYING)
{
// if we're playing then we treat an invalid clock time
// as 0, for complicated reasons (insert reason here)
pos = 0;
}
else
{
got_position = false;
}
}
// If all the preconditions succeeded... we can trust the result.
if (got_position)
{
sec_out = double(pos) / double(GST_SECOND); // gst to sec
}
}
return got_position;
}
bool MediaPluginGStreamer10::load()
{
if (!mDoneInit)
return false; // error
setStatus(STATUS_LOADING);
mIsLooping = false;
mVolume = 0.1234567f; // minor hack to force an initial volume update
// Create a pumpable main-loop for this media
mPump = llg_main_loop_new (NULL, FALSE);
if (!mPump)
{
setStatus(STATUS_ERROR);
return false; // error
}
// instantiate a playbin element to do the hard work
mPlaybin = llgst_element_factory_make ("playbin", "");
if (!mPlaybin)
{
setStatus(STATUS_ERROR);
return false; // error
}
// get playbin's bus
GstBus *bus = llgst_pipeline_get_bus (GST_PIPELINE (mPlaybin));
if (!bus)
{
setStatus(STATUS_ERROR);
return false; // error
}
mBusWatchID = llgst_bus_add_watch (bus,
llmediaimplgstreamer_bus_callback,
this);
llgst_object_unref (bus);
mAppSink = (GstAppSink*)(llgst_element_factory_make ("appsink", ""));
GstCaps* pCaps = llgst_caps_new_simple( "video/x-raw",
"format", G_TYPE_STRING, "RGB",
"width", G_TYPE_INT, INTERNAL_TEXTURE_SIZE,
"height", G_TYPE_INT, INTERNAL_TEXTURE_SIZE,
NULL );
llgst_app_sink_set_caps( mAppSink, pCaps );
llgst_caps_unref( pCaps );
if (!mAppSink)
{
setStatus(STATUS_ERROR);
return false;
}
llg_object_set(mPlaybin, "video-sink", mAppSink, NULL);
return true;
}
bool MediaPluginGStreamer10::unload ()
{
if (!mDoneInit)
return false; // error
// stop getting callbacks for this bus
llg_source_remove(mBusWatchID);
mBusWatchID = 0;
if (mPlaybin)
{
llgst_element_set_state (mPlaybin, GST_STATE_NULL);
llgst_object_unref (GST_OBJECT (mPlaybin));
mPlaybin = NULL;
}
if (mPump)
{
llg_main_loop_quit(mPump);
mPump = NULL;
}
mAppSink = NULL;
setStatus(STATUS_NONE);
return true;
}
void LogFunction(GstDebugCategory *category, GstDebugLevel level, const gchar *file, const gchar *function, gint line, GObject *object, GstDebugMessage *message, gpointer user_data )
#ifndef LL_LINUX // Docu says we need G_GNUC_NO_INSTRUMENT, but GCC says 'error'
G_GNUC_NO_INSTRUMENT
#endif
{
#ifdef LL_LINUX
std::cerr << file << ":" << line << "(" << function << "): " << llgst_debug_message_get( message ) << std::endl;
#endif
}
//static
bool MediaPluginGStreamer10::startup()
{
// first - check if GStreamer is explicitly disabled
if (NULL != getenv("LL_DISABLE_GSTREAMER"))
return false;
// only do global GStreamer initialization once.
if (!mDoneInit)
{
ll_init_apr();
// Get symbols!
std::vector< std::string > vctDSONames;
#if LL_DARWIN
#elif LL_WINDOWS
vctDSONames.push_back( "libgstreamer-1.0-0.dll" );
vctDSONames.push_back( "libgstapp-1.0-0.dll" );
vctDSONames.push_back( "libglib-2.0-0.dll" );
vctDSONames.push_back( "libgobject-2.0-0.dll" );
#else // linux or other ELFy unixoid
vctDSONames.push_back( "libgstreamer-1.0.so.0" );
vctDSONames.push_back( "libgstapp-1.0.so.0" );
vctDSONames.push_back( "libglib-2.0.so.0" );
vctDSONames.push_back( "libgobject-2.0.so" );
#endif
if( !grab_gst_syms( vctDSONames ) )
{
return false;
}
if (llgst_segtrap_set_enabled)
{
llgst_segtrap_set_enabled(FALSE);
}
#if LL_LINUX
// Gstreamer tries a fork during init, waitpid-ing on it,
// which conflicts with any installed SIGCHLD handler...
struct sigaction tmpact, oldact;
if (llgst_registry_fork_set_enabled ) {
// if we can disable SIGCHLD-using forking behaviour,
// do it.
llgst_registry_fork_set_enabled(false);
}
else {
// else temporarily install default SIGCHLD handler
// while GStreamer initialises
tmpact.sa_handler = SIG_DFL;
sigemptyset( &tmpact.sa_mask );
tmpact.sa_flags = SA_SIGINFO;
sigaction(SIGCHLD, &tmpact, &oldact);
}
#endif // LL_LINUX
// Protect against GStreamer resetting the locale, yuck.
static std::string saved_locale;
saved_locale = setlocale(LC_ALL, NULL);
// _putenv_s( "GST_PLUGIN_PATH", "E:\\gstreamer\\1.0\\x86\\lib\\gstreamer-1.0" );
llgst_debug_set_default_threshold( GST_LEVEL_WARNING );
llgst_debug_add_log_function( LogFunction, NULL, NULL );
llgst_debug_set_active( false );
// finally, try to initialize GStreamer!
GError *err = NULL;
gboolean init_gst_success = llgst_init_check(NULL, NULL, &err);
// restore old locale
setlocale(LC_ALL, saved_locale.c_str() );
#if LL_LINUX
// restore old SIGCHLD handler
if (!llgst_registry_fork_set_enabled)
sigaction(SIGCHLD, &oldact, NULL);
#endif // LL_LINUX
if (!init_gst_success) // fail
{
if (err)
{
llg_error_free(err);
}
return false;
}
mDoneInit = true;
}
return true;
}
//static
bool MediaPluginGStreamer10::closedown()
{
if (!mDoneInit)
return false; // error
ungrab_gst_syms();
mDoneInit = false;
return true;
}
MediaPluginGStreamer10::~MediaPluginGStreamer10()
{
closedown();
}
std::string MediaPluginGStreamer10::getVersion()
{
std::string plugin_version = "GStreamer10 media plugin, GStreamer version ";
if (mDoneInit &&
llgst_version)
{
guint major, minor, micro, nano;
llgst_version(&major, &minor, &micro, &nano);
plugin_version += llformat("%u.%u.%u.%u (runtime), %u.%u.%u.%u (headers)", (unsigned int)major, (unsigned int)minor,
(unsigned int)micro, (unsigned int)nano, (unsigned int)GST_VERSION_MAJOR, (unsigned int)GST_VERSION_MINOR,
(unsigned int)GST_VERSION_MICRO, (unsigned int)GST_VERSION_NANO);
}
else
{
plugin_version += "(unknown)";
}
return plugin_version;
}
void MediaPluginGStreamer10::receiveMessage(const char *message_string)
{
LLPluginMessage message_in;
if(message_in.parse(message_string) >= 0)
{
std::string message_class = message_in.getClass();
std::string message_name = message_in.getName();
if(message_class == LLPLUGIN_MESSAGE_CLASS_BASE)
{
if(message_name == "init")
{
LLPluginMessage message("base", "init_response");
LLSD versions = LLSD::emptyMap();
versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;
versions[LLPLUGIN_MESSAGE_CLASS_MEDIA] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;
versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME] = LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME_VERSION;
message.setValueLLSD("versions", versions);
load();
message.setValue("plugin_version", getVersion());
sendMessage(message);
}
else if(message_name == "idle")
{
// no response is necessary here.
double time = message_in.getValueReal("time");
// Convert time to milliseconds for update()
update((int)(time * 1000.0f));
}
else if(message_name == "cleanup")
{
unload();
closedown();
}
else if(message_name == "shm_added")
{
SharedSegmentInfo info;
info.mAddress = message_in.getValuePointer("address");
info.mSize = (size_t)message_in.getValueS32("size");
std::string name = message_in.getValue("name");
mSharedSegments.insert(SharedSegmentMap::value_type(name, info));
}
else if(message_name == "shm_remove")
{
std::string name = message_in.getValue("name");
SharedSegmentMap::iterator iter = mSharedSegments.find(name);
if(iter != mSharedSegments.end())
{
if(mPixels == iter->second.mAddress)
{
// This is the currently active pixel buffer. Make sure we stop drawing to it.
mPixels = NULL;
mTextureSegmentName.clear();
}
mSharedSegments.erase(iter);
}
// Send the response so it can be cleaned up.
LLPluginMessage message("base", "shm_remove_response");
message.setValue("name", name);
sendMessage(message);
}
}
else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA)
{
if(message_name == "init")
{
// Plugin gets to decide the texture parameters to use.
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params");
// lame to have to decide this now, it depends on the movie. Oh well.
mDepth = 4;
mTextureWidth = 1;
mTextureHeight = 1;
message.setValueU32("format", GL_RGBA);
message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8_REV);
message.setValueS32("depth", mDepth);
message.setValueS32("default_width", INTERNAL_TEXTURE_SIZE );
message.setValueS32("default_height", INTERNAL_TEXTURE_SIZE );
message.setValueU32("internalformat", GL_RGBA8);
message.setValueBoolean("coords_opengl", true); // true == use OpenGL-style coordinates, false == (0,0) is upper left.
message.setValueBoolean("allow_downsample", true); // we respond with grace and performance if asked to downscale
sendMessage(message);
}
else if(message_name == "size_change")
{
std::string name = message_in.getValue("name");
S32 width = message_in.getValueS32("width");
S32 height = message_in.getValueS32("height");
S32 texture_width = message_in.getValueS32("texture_width");
S32 texture_height = message_in.getValueS32("texture_height");
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response");
message.setValue("name", name);
message.setValueS32("width", width);
message.setValueS32("height", height);
message.setValueS32("texture_width", texture_width);
message.setValueS32("texture_height", texture_height);
sendMessage(message);
if(!name.empty())
{
// Find the shared memory region with this name
SharedSegmentMap::iterator iter = mSharedSegments.find(name);
if(iter != mSharedSegments.end())
{
mPixels = (unsigned char*)iter->second.mAddress;
mTextureSegmentName = name;
mTextureWidth = texture_width;
mTextureHeight = texture_height;
memset( mPixels, 0, mTextureWidth*mTextureHeight*mDepth );
}
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_request");
message.setValue("name", mTextureSegmentName);
message.setValueS32("width", INTERNAL_TEXTURE_SIZE );
message.setValueS32("height", INTERNAL_TEXTURE_SIZE );
sendMessage(message);
}
}
else if(message_name == "load_uri")
{
std::string uri = message_in.getValue("uri");
navigateTo( uri );
sendStatus();
}
else if(message_name == "mouse_event")
{
std::string event = message_in.getValue("event");
S32 x = message_in.getValueS32("x");
S32 y = message_in.getValueS32("y");
if(event == "down")
{
mouseDown(x, y);
}
else if(event == "up")
{
mouseUp(x, y);
}
else if(event == "move")
{
mouseMove(x, y);
};
};
}
else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME)
{
if(message_name == "stop")
{
stop();
}
else if(message_name == "start")
{
double rate = 0.0;
if(message_in.hasValue("rate"))
{
rate = message_in.getValueReal("rate");
}
// NOTE: we don't actually support rate.
play(rate);
}
else if(message_name == "pause")
{
pause();
}
else if(message_name == "seek")
{
double time = message_in.getValueReal("time");
// defer the actual seek in case we haven't
// really truly started yet in which case there
// is nothing to seek upon
mSeekWanted = true;
mSeekDestination = time;
}
else if(message_name == "set_loop")
{
bool loop = message_in.getValueBoolean("loop");
mIsLooping = loop;
}
else if(message_name == "set_volume")
{
double volume = message_in.getValueReal("volume");
setVolume(volume);
}
}
}
}
int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data)
{
if( MediaPluginGStreamer10::startup() )
{
MediaPluginGStreamer10 *self = new MediaPluginGStreamer10(host_send_func, host_user_data);
*plugin_send_func = MediaPluginGStreamer10::staticReceiveMessage;
*plugin_user_data = (void*)self;
return 0; // okay
}
else
{
return -1; // failed to init
}
}

View File

@ -2089,13 +2089,9 @@ set(viewer_APPSETTINGS_FILES
app_settings/viewerart.xml
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
#packages-info.txt
packages-info.txt
)
if( NOT USESYSTEMLIBS )
set( viewer_APPSETTINGS_FILES ${viewer_APPSETTINGS_FILE} packages-info.txt )
endif()
if (WINDOWS)
LIST(APPEND viewer_APPSETTINGS_FILES app_settings/growl_notifications.xml)
endif (WINDOWS)
@ -2180,11 +2176,11 @@ add_executable(${VIEWER_BINARY_NAME}
${viewer_SOURCE_FILES}
)
if (SDL_FOUND OR SDL2_FOUND)
if (SDL_FOUND)
set_property(TARGET ${VIEWER_BINARY_NAME}
PROPERTY COMPILE_DEFINITIONS LL_SDL=1
)
endif ()
endif (SDL_FOUND)
if (BUGSPLAT_DB)
set_property(TARGET ${VIEWER_BINARY_NAME}
@ -2491,7 +2487,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${BOOST_WAVE_LIBRARY} #FS specific
${BOOST_THREAD_LIBRARY} #FS specific
${BOOST_CONTEXT_LIBRARY}
${GLIB_LIBRARIES}
${DBUSGLIB_LIBRARIES}
${OPENGL_LIBRARIES}
${FMODWRAPPER_LIBRARY} # must come after LLAudio
${OPENAL_LIBRARIES}
@ -2542,10 +2538,10 @@ if (NOT ENABLE_MEDIA_PLUGINS)
set(COPY_INPUT_DEPENDENCIES
${VIEWER_BINARY_NAME}
linux-crash-logger
#SLPlugin
#media_plugin_cef
#media_plugin_gstreamer10
#media_plugin_libvlc
SLPlugin
media_plugin_cef
#media_plugin_gstreamer010
media_plugin_libvlc
llcommon
)
else (NOT ENABLE_MEDIA_PLUGINS)
@ -2554,8 +2550,7 @@ else (NOT ENABLE_MEDIA_PLUGINS)
linux-crash-logger
SLPlugin
media_plugin_cef
media_plugin_gstreamer10
#media_plugin_libvlc
#media_plugin_gstreamer010
llcommon
)
endif (NOT ENABLE_MEDIA_PLUGINS)

View File

@ -38,25 +38,8 @@
#include <dlfcn.h>
#ifdef LL_GLIB
#include <glib.h>
#else
// ND: If we cannot use glib headers just stub out what'ns needed to compile.
// In theory that is enough to have a (leaky, see g_free) implementation. But to play it safe tryLoadLibnotify won't try to load any DSO, thus effectivly
// disabling the usage of libnotify.
typedef int gint;
typedef gint gboolean;
typedef char gchar;
struct GError;
void g_free( void* )
{
}
#endif
typedef enum
{
@ -82,6 +65,7 @@ typedef void (*pND_notify_notification_set_urgency) ( NotifyNotification *notifi
// the unused one is always pushed first and qualifies just as dead weight.
typedef NotifyNotification* (*pND_notify_notification_new) (const char *summary, const char *body, const char *icon, void*);
void* tryLoadLibnotify()
{
char const* aNames[] = {
@ -97,7 +81,6 @@ void* tryLoadLibnotify()
void *pLibHandle(0);
#ifdef LL_GLIB
for( int i = 0; !pLibHandle && aNames[i]; ++i )
{
pLibHandle = dlopen( aNames[i], RTLD_NOW );
@ -106,8 +89,7 @@ void* tryLoadLibnotify()
else
LL_INFOS( "DesktopNotifierLinux" ) << "Loaded " << aNames[i] << LL_ENDL;
}
#endif
return pLibHandle;
};
@ -316,12 +298,10 @@ void DesktopNotifierLinux::showNotification( const std::string& notification_tit
{
LL_INFOS( "DesktopNotifierLinux" ) << "Linux desktop notification type " << notification_type << " sent." << LL_ENDL;
}
#if LL_GLIB
else
{
LL_WARNS( "DesktopNotifierLinux" ) << "Linux desktop notification type " << notification_type << " FAILED to send, error was " << error->message << LL_ENDL;
}
#endif
}
bool DesktopNotifierLinux::isUsable()

View File

@ -31,7 +31,12 @@
#include "llsdutil.h"
#include "llflickrconnect.h"
// third-party
#if LL_USESYSTEMLIBS
#include "jsoncpp/reader.h" // JSON
#else
#include "json/reader.h" // JSON
#endif
#include <openssl/hmac.h>
#include <openssl/evp.h>

View File

@ -158,17 +158,6 @@ for ARG in "$@"; do
fi
done
#<FS:ND> Hack, otherwise eg sscanf inside flatpak fails.
# This happens if the locale is set (for example) to de_DE which uses , as a decimal separator.
# There is code in the viewer which should handle this but when run from "flatpak run" it will not work.
# Needs some more investigation; but at least this hack will allow the viewer to run.
if [ ! -z "${FLATPAK_ID}" ]
then
echo "Setting LC_NUMERIC to en_US.utf8 due to running inside flatpak"
export LC_NUMERIC=en_US.utf8
fi
#</FS:ND>
# Run the program.
# Don't quote $LL_WRAPPER because, if empty, it should simply vanish from the
# command line. But DO quote "${ARGS[@]}": preserve separate args as

View File

@ -143,21 +143,10 @@
#include "stringize.h"
#include "llcoros.h"
#include "llexception.h"
#if !LL_LINUX
#include "cef/dullahan.h"
#include "cef/dullahan_version.h"
#include "vlc/libvlc_version.h"
#else
#if LL_USESYSTEMLIBS
#include "dullahan.h"
#include "dullahan_version.h"
#else
#include "cef/dullahan.h"
#include "cef/dullahan_version.h"
#endif
#endif
//#if !LL_LINUX
#include "cef/dullahan_version.h"
#include "vlc/libvlc_version.h"
//#endif // LL_LINUX
// Third party library includes
#include <boost/bind.hpp>
@ -3910,7 +3899,7 @@ LLSD LLAppViewer::getViewerInfo() const
// info["LIBCEF_VERSION"] = "Undefined";
//#endif
#if !LL_LINUX
//#if !LL_LINUX
std::ostringstream vlc_ver_codec;
vlc_ver_codec << LIBVLC_VERSION_MAJOR;
vlc_ver_codec << ".";
@ -3918,9 +3907,9 @@ LLSD LLAppViewer::getViewerInfo() const
vlc_ver_codec << ".";
vlc_ver_codec << LIBVLC_VERSION_REVISION;
info["LIBVLC_VERSION"] = vlc_ver_codec.str();
#else
info["LIBVLC_VERSION"] = "Using gstreamer 10";
#endif
//#else
// info["LIBVLC_VERSION"] = "Undefined";
//#endif
S32 packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN);
if (packets_in > 0)

View File

@ -2,7 +2,7 @@
* @file llappviewerlinux.cpp
* @brief The LLAppViewerLinux class definitions
*
1 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
@ -194,6 +194,15 @@ LLAppViewerLinux::~LLAppViewerLinux()
bool LLAppViewerLinux::init()
{
// g_thread_init() must be called before *any* use of glib, *and*
// before any mutexes are held, *and* some of our third-party
// libraries likes to use glib functions; in short, do this here
// really early in app startup!
#if ( !defined(GLIB_MAJOR_VERSION) && !defined(GLIB_MINOR_VERSION) ) || ( GLIB_MAJOR_VERSION < 2 ) || ( GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 32 )
if (!g_thread_supported ()) g_thread_init (NULL);
#endif
bool success = LLAppViewer::init();
#if LL_SEND_CRASH_REPORTS
@ -341,6 +350,10 @@ bool LLAppViewerLinux::initSLURLHandler()
return false; // failed
}
#if ( !defined(GLIB_MAJOR_VERSION) && !defined(GLIB_MINOR_VERSION) ) || ( GLIB_MAJOR_VERSION < 2 ) || ( GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 35 )
g_type_init();
#endif
//ViewerAppAPI *api_server = (ViewerAppAPI*)
g_object_new(viewerappapi_get_type(), NULL);
@ -359,6 +372,10 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url)
DBusGConnection *bus;
GError *error = NULL;
#if ( !defined(GLIB_MAJOR_VERSION) && !defined(GLIB_MINOR_VERSION) ) || ( GLIB_MAJOR_VERSION < 2 ) || ( GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 35 )
g_type_init();
#endif
bus = lldbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (bus)
{

View File

@ -27,17 +27,15 @@
#ifndef LL_LLAPPVIEWERLINUX_H
#define LL_LLAPPVIEWERLINUX_H
#ifdef LL_GLIB
extern "C" {
# include <glib.h>
#if LL_DBUS_ENABLED
# include <glib-object.h>
# include <dbus/dbus-glib.h>
#endif
}
#if LL_DBUS_ENABLED
extern "C" {
# include <glib-object.h>
# include <dbus/dbus-glib.h>
}
#endif
#ifndef LL_LLAPPVIEWER_H
@ -72,7 +70,7 @@ protected:
virtual bool sendURLToOtherInstance(const std::string& url);
};
#if LL_DBUS_ENABLED && LL_GLIB
#if LL_DBUS_ENABLED
typedef struct
{
GObject parent;

View File

@ -41,11 +41,6 @@
# include "llfilepicker.h"
#endif
#ifdef LL_FLTK
#include "FL/Fl.H"
#include "FL/Fl_Native_File_Chooser.H"
#endif
//
// Globals
//
@ -198,41 +193,32 @@ LLDirPicker::LLDirPicker() :
mFileName(NULL),
mLocked(false)
{
#ifndef LL_FLTK
mFilePicker = new LLFilePicker();
#endif
reset();
}
LLDirPicker::~LLDirPicker()
{
#ifndef LL_FLTK
delete mFilePicker;
#endif
}
void LLDirPicker::reset()
{
#ifndef LL_FLTK
if (mFilePicker)
mFilePicker->reset();
#else
mDir = "";
#endif
mFilePicker->reset();
}
BOOL LLDirPicker::getDir(std::string* filename, bool blocking)
{
reset();
// if local file browsing is turned off, return without opening dialog
if ( check_local_file_access_enabled() == false )
{
return FALSE;
}
#ifndef LL_FLTK
#if !LL_MESA_HEADLESS
if (mFilePicker)
@ -251,38 +237,15 @@ BOOL LLDirPicker::getDir(std::string* filename, bool blocking)
#endif // !LL_MESA_HEADLESS
return FALSE;
#else
Fl_Native_File_Chooser flDlg;
flDlg.title("Pick a dir");
flDlg.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY );
int res = flDlg.show();
if( res == 0 )
{
char const *pDir = flDlg.filename(0);
if( pDir )
mDir = pDir;
}
else if( res == -1 )
{
LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL;
}
return !mDir.empty();
#endif
}
std::string LLDirPicker::getDirName()
{
#ifndef LL_FLTK
if (mFilePicker)
{
return mFilePicker->getFirstFile();
}
return "";
#else
return mDir;
#endif
}
#else // not implemented

View File

@ -80,7 +80,7 @@ private:
#if LL_LINUX || LL_SOLARIS || LL_DARWIN
// On Linux we just implement LLDirPicker on top of LLFilePicker
// LLFilePicker *mFilePicker;
LLFilePicker *mFilePicker;
#endif

View File

@ -36,18 +36,10 @@
#include "llviewercontrol.h"
#include "llwindow.h" // beforeDialog()
#undef LL_GTK
#if LL_SDL
// #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers
// #include <gdk/gdkx.h>
#include "llwindowsdl.h" // for some X/GTK utils to help with filepickers
#endif // LL_SDL
#ifdef LL_FLTK
#include "FL/Fl.H"
#include "FL/Fl_Native_File_Chooser.H"
#endif
#if LL_LINUX || LL_SOLARIS
#include "llhttpconstants.h" // file picker uses some of thes constants on Linux
#endif
@ -1143,14 +1135,17 @@ GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, std::stri
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER :
GTK_FILE_CHOOSER_ACTION_OPEN);
gchar const *acceptText = is_folder ? "_Apply" :(is_save ? "_Save" : "_Open");
win = gtk_file_chooser_dialog_new(NULL, NULL,
pickertype,
"_Cancel",
GTK_RESPONSE_CANCEL,
acceptText,
GTK_RESPONSE_ACCEPT,
(gchar *)NULL);
pickertype,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
is_folder ?
GTK_STOCK_APPLY :
(is_save ?
GTK_STOCK_SAVE :
GTK_STOCK_OPEN),
GTK_RESPONSE_ACCEPT,
(gchar *)NULL);
mCurContextName = context;
// get the default path for this usage context if it's been
@ -1191,8 +1186,9 @@ GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, std::stri
if (None != XWindowID)
{
gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
GdkWindow *gdkwin = gdk_x11_window_foreign_new_for_display (gdk_display_get_default(),XWindowID);
gdk_window_set_transient_for(gtk_widget_get_window(GTK_WIDGET(win)), gdkwin);
GdkWindow *gdkwin = gdk_window_foreign_new(XWindowID);
gdk_window_set_transient_for(GTK_WIDGET(win)->window,
gdkwin);
}
else
{
@ -1570,79 +1566,12 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
return rtn;
}
#elif LL_FLTK
BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking )
{
return openFileDialog( filter, blocking, eSaveFile );
}
BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
{
return openFileDialog( filter, blocking, eOpenFile );
}
BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
{
return openFileDialog( filter, blocking, eOpenMultiple );
}
void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ESaveFilter filter )
{
}
void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ELoadFilter filter )
{
}
bool LLFilePicker::openFileDialog( int32_t filter, bool blocking, EType aType )
{
if ( check_local_file_access_enabled() == false )
return false;
reset();
Fl_Native_File_Chooser::Type flType = Fl_Native_File_Chooser::BROWSE_FILE;
if( aType == eOpenMultiple )
flType = Fl_Native_File_Chooser::BROWSE_MULTI_FILE;
else if( aType == eSaveFile )
flType = Fl_Native_File_Chooser::BROWSE_SAVE_FILE;
Fl_Native_File_Chooser flDlg;
flDlg.title("Pick a file");
flDlg.type( flType );
if( aType == eSaveFile )
setupFilter( flDlg, (ESaveFilter) filter );
else
setupFilter( flDlg, (ELoadFilter) filter );
int res = flDlg.show();
if( res == 0 )
{
int32_t count = flDlg.count();
if( count < 0 )
count = 0;
for( int32_t i = 0; i < count; ++i )
{
char const *pFile = flDlg.filename(i);
if( pFile && strlen(pFile) > 0 )
mFiles.push_back( pFile );
}
}
else if( res == -1 )
{
LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL;
}
return mFiles.empty()?FALSE:TRUE;
}
# else // LL_GTK
// Hacky stubs designed to facilitate fake getSaveFile and getOpenFile with
// static results, when we don't have a real filepicker.
BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking )
BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename )
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
@ -1705,7 +1634,7 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
#else // not implemented
BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blockin )
BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename )
{
reset();
return FALSE;

View File

@ -33,12 +33,6 @@
#ifndef LL_LLFILEPICKER_H
#define LL_LLFILEPICKER_H
#if LL_FLTK
#if LL_GTK
#undef LL_GTK
#endif
#endif
#include "stdtypes.h"
#if LL_DARWIN
@ -69,7 +63,7 @@ extern "C" {
class LLFilePicker
{
#if LL_GTK
#ifdef LL_GTK
friend class LLDirPicker;
friend void chooser_responder(GtkWidget *, gint, gpointer);
#endif // LL_GTK
@ -193,14 +187,7 @@ private:
// we also remember the extension of the last added file.
std::string mCurrentExtension;
#endif
#if LL_FLTK
enum EType
{
eSaveFile, eOpenFile, eOpenMultiple
};
bool openFileDialog( int32_t filter, bool blocking, EType aType );
#endif
std::vector<std::string> mFiles;
S32 mCurrentFile;
bool mLocked;

View File

@ -79,15 +79,6 @@
#pragma warning (disable:4702)
#endif
// ND: Disable some warnings on newer GCC versions.
#if LL_LINUX
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ ) >= 40800
#pragma GCC diagnostic ignored "-Wuninitialized"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#endif
// </FS:ND>
#include <boost/lexical_cast.hpp>
#if LL_MSVC

View File

@ -130,7 +130,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</scheme>
<mimetype name="blank">
@ -163,7 +163,7 @@
audio
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="video/*">
@ -174,7 +174,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="image/*">
@ -196,7 +196,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="application/javascript">
@ -218,7 +218,7 @@
audio
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="application/pdf">
@ -295,7 +295,7 @@
audio
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="audio/mpeg">
@ -306,7 +306,7 @@
audio
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="audio/x-aiff">
@ -317,7 +317,7 @@
audio
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="audio/x-wav">
@ -328,7 +328,7 @@
audio
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype menu="1" name="image/bmp">
@ -438,7 +438,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="video/mp4">
@ -449,7 +449,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype menu="1" name="video/quicktime">
@ -460,7 +460,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="video/x-ms-asf">
@ -471,7 +471,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="video/x-ms-wmv">
@ -482,7 +482,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
<mimetype menu="1" name="video/x-msvideo">
@ -493,7 +493,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_libvlc
</impl>
</mimetype>
</mimetypes>

View File

@ -1861,56 +1861,35 @@ class LinuxManifest(ViewerManifest):
# plugins
with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins'), dst="bin/llplugin"):
#self.path("gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
#self.path2basename("libvlc", "libmedia_plugin_libvlc.so")
self.path2basename("libvlc", "libmedia_plugin_libvlc.so")
self.path("cef/libmedia_plugin_cef.so", "libmedia_plugin_cef.so" )
#with self.prefix(src=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"):
# self.path( "plugins.dat" )
# self.path( "*/*.so" )
with self.prefix(src=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"):
self.path( "plugins.dat" )
self.path( "*/*.so" )
#with self.prefix(src=os.path.join(pkgdir, 'lib' ), dst="lib"):
# self.path( "libvlc*.so*" )
with self.prefix(src=os.path.join(pkgdir, 'lib' ), dst="lib"):
self.path( "libvlc*.so*" )
#with self.prefix(src=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"):
# self.path( "plugins.dat" )
# self.path( "*/*.so" )
with self.prefix(src=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"):
self.path( "plugins.dat" )
self.path( "*/*.so" )
#with self.prefix(src=os.path.join(pkgdir, 'lib' ), dst="lib"):
# self.path( "libvlc*.so*" )
with self.prefix(src=os.path.join(pkgdir, 'lib' ), dst="lib"):
self.path( "libvlc*.so*" )
snapStage = os.environ.get( "SNAPCRAFT_STAGE" )
if snapStage != None:
print( "Building snap package" )
else:
snapStage = os.environ.get( "FLATPAK_DEST" )
if snapStage != None:
print( "Building flatpak package" )
if snapStage == None:
data = open( "/proc/1/cgroup", "r" ).readlines()[0]
if "docker" in data:
snapStage = "/usr"
pkgBase = os.path.join( pkgdir, 'lib', 'release')
if snapStage != None:
pkgBase = os.path.join( snapStage, "lib" )
# CEF files
with self.prefix(src=pkgBase, dst="lib"):
with self.prefix(src=os.path.join(pkgdir, 'lib', 'release'), dst="lib"):
self.path( "libcef.so" )
self.fs_try_path( "libminigbm.so" )
pkgBase = os.path.join( pkgBase, "swiftshader" )
with self.prefix(src=pkgBase, dst=os.path.join("bin", "swiftshader") ):
with self.prefix(src=os.path.join(pkgdir, 'lib', 'release', 'swiftshader'), dst=os.path.join("bin", "swiftshader") ):
self.path( "*.so" )
with self.prefix(src=os.path.join(pkgdir, 'lib', 'release', 'swiftshader'), dst=os.path.join("lib", "swiftshader") ):
self.path( "*.so" )
pkgBase = os.path.join(pkgdir, 'bin', 'release')
if snapStage != None:
pkgBase = os.path.join( snapStage, "lib" )
with self.prefix(pkgBase, dst="bin"):
with self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="bin"):
self.path( "chrome-sandbox" )
self.path( "dullahan_host" )
self.fs_try_path( "natives_blob.bin" )
@ -1921,11 +1900,7 @@ class LinuxManifest(ViewerManifest):
self.path( "snapshot_blob.bin" )
self.path( "v8_context_snapshot.bin" )
pkgBase = os.path.join(pkgdir, 'resources')
if snapStage != None:
pkgBase = os.path.join( snapStage, "resources" )
with self.prefix(src=pkgBase, dst="bin"):
with self.prefix(src=os.path.join(pkgdir, 'resources'), dst="bin"):
self.path( "cef.pak" )
self.path( "cef_extensions.pak" )
self.path( "cef_100_percent.pak" )
@ -1940,9 +1915,7 @@ class LinuxManifest(ViewerManifest):
self.path( "devtools_resources.pak" )
self.path( "icudtl.dat" )
pkgBase = os.path.join( pkgBase, "locales" )
with self.prefix(src=pkgBase, dst=os.path.join('bin', 'locales')):
with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst=os.path.join('bin', 'locales')):
self.path("am.pak")
self.path("ar.pak")
self.path("bg.pak")
@ -2028,10 +2001,10 @@ class LinuxManifest(ViewerManifest):
#self.path("libGLOD.so")
#self.fs_path("libminizip.so")
self.path("libuuid.so*")
self.path("libSDL*")
#self.path("libdirectfb*.so*")
#self.path("libfusion*.so*")
#self.path("libdirect*.so*")
self.path("libSDL-1.2.so*")
self.path("libdirectfb*.so*")
self.path("libfusion*.so*")
self.path("libdirect*.so*")
self.fs_try_path("libopenjpeg.so*")
self.path("libhunspell-1.3.so*")
self.path("libalut.so*")
@ -2041,7 +2014,7 @@ class LinuxManifest(ViewerManifest):
self.path("libopenal.so", "libopenal.so.1") # Install as versioned file in case it's missing from the 3p- and won't get copied below
self.path("libopenal.so*")
#self.path("libnotify.so.1.1.2", "libnotify.so.1") # LO - uncomment when testing libnotify(growl) on linux
self.fs_try_path("libpangox-1.0.so*")
self.path("libpangox-1.0.so*")
# KLUDGE: As of 2012-04-11, the 'fontconfig' package installs
# libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1
# and libfontconfig.so. Before we added support for library-file
@ -2084,15 +2057,9 @@ class LinuxManifest(ViewerManifest):
installer_name = "_".join(installer_name_components)
#installer_name = self.installer_base_name()
createTar = True
if os.environ.get( "FS_CREATE_NO_TAR" ):
createTar = False
if createTar:
self.fs_delete_linux_symbols() # <FS:ND/> Delete old syms
self.strip_binaries()
self.fs_save_linux_symbols() # <FS:ND/> Package symbols, add debug link
self.fs_delete_linux_symbols() # <FS:ND/> Delete old syms
self.strip_binaries()
self.fs_save_linux_symbols() # <FS:ND/> Package symbols, add debug link
# Fix access permissions
self.run_command(['find', self.get_dst_prefix(),
@ -2101,39 +2068,30 @@ class LinuxManifest(ViewerManifest):
self.run_command(['find', self.get_dst_prefix(),
'-type', 'f', '-perm', old,
'-exec', 'chmod', new, '{}', ';'])
if os.environ.get( "SNAPCRAFT_STAGE" ) or os.environ.get( "FLATPAK_DEST" ):
print( "Building snap package, not calling tar to bundle" )
self.package_file = "<none>"
return
self.package_file = installer_name + '.tar.xz'
if createTar:
# temporarily move directory tree so that it has the right
# name in the tarfile
realname = self.get_dst_prefix()
tempname = self.build_path_of(installer_name)
self.run_command(["mv", realname, tempname])
try:
# only create tarball if it's a release build.
if self.args['buildtype'].lower() == 'release':
# --numeric-owner hides the username of the builder for
# security etc.
self.run_command(['tar', '-C', self.get_build_prefix(),
'--numeric-owner', self.fs_linux_tar_excludes(), '-caf',
tempname + '.tar.xz', installer_name])
else:
print( "Skipping %s.tar.xz for non-Release build (%s)" ) % \
(installer_name, self.args['buildtype'])
finally:
self.run_command(["mv", tempname, realname])
# temporarily move directory tree so that it has the right
# name in the tarfile
realname = self.get_dst_prefix()
tempname = self.build_path_of(installer_name)
self.run_command(["mv", realname, tempname])
try:
# only create tarball if it's a release build.
if self.args['buildtype'].lower() == 'release':
# --numeric-owner hides the username of the builder for
# security etc.
self.run_command(['tar', '-C', self.get_build_prefix(),
'--numeric-owner', self.fs_linux_tar_excludes(), '-caf',
tempname + '.tar.xz', installer_name])
else:
print ("Skipping %s.tar.xz for non-Release build (%s)" % \
(installer_name, self.args['buildtype']))
finally:
self.run_command(["mv", tempname, realname])
def strip_binaries(self):
if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
print ("* Going strip-crazy on the packaged binaries, since this is a RELEASE build")
if not os.path.isdir( os.path.join( self.get_dst_prefix(), "lib") ):
os.mkdir( os.path.join( self.get_dst_prefix(), "lib") )
# makes some small assumptions about our packaged dir structure
self.run_command(
["find"] +
@ -2165,7 +2123,7 @@ class Linux_i686_Manifest(LinuxManifest):
self.path("libexpat.so.*")
self.path("libGLOD.so")
self.path("libuuid.so*")
self.path("libSDL*")
self.path("libSDL-1.2.so.*")
self.path("libdirectfb-1.*.so.*")
self.path("libfusion-1.*.so.*")
self.path("libdirect-1.*.so.*")
@ -2244,7 +2202,7 @@ class Linux_x86_64_Manifest(LinuxManifest):
if self.is_packaging_viewer():
with self.prefix(src=os.path.join(pkgdir, 'lib', 'release'), dst="lib"):
self.fs_try_path("libffi*.so*")
self.path("libffi*.so*")
# vivox 32-bit hack.
# one has to extract libopenal.so from the 32-bit openal package, or official LL viewer, and rename it to libopenal32.so
# and place it in the prebuilt lib/release directory
@ -2263,7 +2221,6 @@ class Linux_x86_64_Manifest(LinuxManifest):
with self.prefix(dst="bin"):
self.path2basename("../llplugin/slplugin", "SLPlugin")
self.path("secondlife-i686.supp")