mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-27 06:35:28 +00:00
Almost working... musikcube still resolves the wrong version of libssl
(but musikcubed is fine??)
This commit is contained in:
parent
36e825cc4b
commit
dff533d1a7
@ -1,17 +0,0 @@
|
||||
function(ensure_library_exists libname)
|
||||
get_property(ALL_LINK_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY LINK_DIRECTORIES)
|
||||
foreach(CURRENT_LINK_DIR ${ALL_LINK_DIRS})
|
||||
unset(__TEMP_ENSURE_LIBRARY CACHE)
|
||||
find_library(
|
||||
__TEMP_ENSURE_LIBRARY
|
||||
NAMES ${libname}
|
||||
PATHS ${CURRENT_LINK_DIR} ${VENDOR_LINK_DIRECTORIES})
|
||||
if(NOT __TEMP_ENSURE_LIBRARY)
|
||||
#message(STATUS "[check-dependencies] ${libname} not found")
|
||||
else()
|
||||
message(STATUS "[check-dependencies] ${libname} found at ${__TEMP_ENSURE_LIBRARY}")
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
message(FATAL_ERROR "\n\n[check-dependencies] ${libname} not found\n\n")
|
||||
endfunction(ensure_library_exists)
|
@ -14,7 +14,8 @@ if (${BUILD_STANDALONE} MATCHES "true")
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/lame-bin/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/libmicrohttpd-bin/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/zlib-bin/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/include")
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/ncurses-bin/include")
|
||||
|
||||
list(
|
||||
APPEND
|
||||
@ -23,7 +24,8 @@ if (${BUILD_STANDALONE} MATCHES "true")
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/lame-bin/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/libmicrohttpd-bin/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/zlib-bin/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/lib")
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/ncurses-bin/lib")
|
||||
else()
|
||||
message(STATUS "[standalone-build] *NOT* enabled!")
|
||||
endif()
|
@ -15,7 +15,6 @@ set (EXECUTABLE_OUTPUT_PATH ${musikcube_SOURCE_DIR}/bin)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.cmake)
|
||||
include(CMakeToolsHelpers OPTIONAL)
|
||||
include(CheckDependencies)
|
||||
include(CheckAtomic)
|
||||
include(ConfigureRpath)
|
||||
include(ConfigureStandalone)
|
||||
@ -45,7 +44,6 @@ message(STATUS "[boost] libs: " ${Boost_LIBRARIES})
|
||||
message(STATUS "[boost] includes: " ${Boost_INCLUDE_DIRS})
|
||||
|
||||
if (${BUILD_STANDALONE} MATCHES "true")
|
||||
target_include_directories(musikcube BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES})
|
||||
find_library(LIBCURL NAMES curl PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_library(LIBCURL NAMES curl)
|
||||
|
@ -9,9 +9,26 @@ if [[ "$PLATFORM" == 'Darwin' ]]; then
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/opt/homebrew/opt/openssl/lib/pkgconfig/"
|
||||
fi
|
||||
|
||||
NCURSES_TERMINFO=
|
||||
if [[ "$PLATFORM" == 'Linux' ]]; then
|
||||
NCURSES_TERMINFO="--with-terminfo-dirs=/etc/terminfo:/lib/terminfo:/usr/share/terminfo"
|
||||
fi
|
||||
|
||||
export CFLAGS="-fPIC"
|
||||
export CXXFLAGS="-fPIC"
|
||||
|
||||
#
|
||||
# ncurses
|
||||
#
|
||||
https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz
|
||||
tar xvfz ncurses-6.3.tar.gz
|
||||
cd ncurses-6.3
|
||||
./configure --enable-pc-files --enable-sigwinch --enable-symlinks --enable-widec --with-shared --with-cxx-shared --with-gpm=no --without-ada ${NCURSES_TERMINFO} --prefix=`pwd`/output
|
||||
make -j8 || exit $?
|
||||
make install
|
||||
mv output ../ncurses-bin
|
||||
cd ..
|
||||
|
||||
#
|
||||
# boost
|
||||
#
|
||||
|
@ -20,6 +20,8 @@ elif [[ "$PLATFORM" == 'Linux' ]]; then
|
||||
cp vendor/ffmpeg-bin/lib/libavutil-musikcube.so.57 ./bin/lib/
|
||||
cp vendor/ffmpeg-bin/lib/libswresample-musikcube.so.4 ./bin/lib/
|
||||
cp vendor/curl-bin/lib/libcurl.so.4 ./bin/lib/
|
||||
cp vendor/ncurses-bin/lib/libncursesw.so.6 ./bin/lib
|
||||
cp vendor/ncurses-bin/lib/libpanelw.so.6 ./bin/lib
|
||||
|
||||
cp /lib/x86_64-linux-gnu/libssl.so.1.1 ./bin/lib/
|
||||
cp /lib/x86_64-linux-gnu/libcrypto.so.1.1 ./bin/lib/
|
||||
@ -30,4 +32,6 @@ elif [[ "$PLATFORM" == 'Linux' ]]; then
|
||||
cp /lib/x86_64-linux-gnu/libvorbis.so.0 ./bin/lib
|
||||
cp /lib/x86_64-linux-gnu/libvorbisfile.so.3 ./bin/lib
|
||||
cp /lib/x86_64-linux-gnu/libogg.so.0 ./bin/lib
|
||||
|
||||
chmod -x ./bin/lib/*
|
||||
fi
|
||||
|
@ -5,7 +5,7 @@ if [ -z "$DIR" ]; then
|
||||
DIR=`pwd`
|
||||
fi
|
||||
echo "[strip] resolved directory: ${DIR}"
|
||||
strip "$DIR/bin/musikcube"
|
||||
strip "$DIR/bin/musikcubed"
|
||||
find "$DIR/bin/" -name "*.so" -exec strip "{}" \; 2> /dev/null
|
||||
strip "$DIR/bin/*" 2> /dev/null
|
||||
strip "$DIR/bin/lib/*" 2> /dev/null
|
||||
strip "$DIR/bin/plugin/*" 2> /dev/null
|
||||
echo "[strip] finished"
|
||||
|
@ -81,9 +81,14 @@ include_directories(
|
||||
|
||||
add_definitions(-DMCSDK_DEFINE_EXPORTS)
|
||||
add_library(musikcore SHARED ${CORE_SOURCES})
|
||||
|
||||
set_target_properties(musikcore PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${musikcube_SOURCE_DIR}/bin)
|
||||
target_link_libraries(musikcore ${musikcube_LINK_LIBS})
|
||||
|
||||
if (${BUILD_STANDALONE} MATCHES "true")
|
||||
target_include_directories(musikcore BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES})
|
||||
endif()
|
||||
|
||||
if (ENABLE_PCH MATCHES "true")
|
||||
message(STATUS "[musikcore] enabling precompiled headers")
|
||||
include(./pch.cmake)
|
||||
|
@ -79,46 +79,36 @@ configure_file("musikcube.in" "musikcube" @ONLY)
|
||||
add_executable(musikcube ${CUBE_SRCS})
|
||||
add_definitions(-DNCURSES_WIDECHAR)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
if (${BUILD_STANDALONE} MATCHES "true")
|
||||
find_library(
|
||||
NCURSESWLIB
|
||||
NAMES libncursesw.a ncursesw
|
||||
PATHS ${VENDOR_LINK_DIRECTORIES})
|
||||
|
||||
find_library(
|
||||
PANELWLIB
|
||||
NAMES libpanelw.a panelw
|
||||
PATHS ${VENDOR_LINK_DIRECTORIES})
|
||||
|
||||
message(STATUS "[musikcube] using libncursesw at " ${NCURSESWLIB})
|
||||
message(STATUS "[musikcube] using libpanelw at " ${PANELWLIB})
|
||||
|
||||
target_link_libraries(musikcube ${musikcube_LINK_LIBS} ${NCURSESWLIB} ${PANELWLIB} musikcore)
|
||||
else()
|
||||
target_link_libraries(musikcube ${musikcube_LINK_LIBS} ncursesw panelw musikcore)
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig)
|
||||
if (${NCURSES_DISABLE_LIB_SUFFIXES} MATCHES "true")
|
||||
# pkg_check_modules fails on some systems, including OpenBSD.
|
||||
# pkg_check_modules(NCURSES REQUIRED ncurses panel)
|
||||
ensure_library_exists(ncurses)
|
||||
ensure_library_exists(panel)
|
||||
set(NCURSES_LIBRARIES ncurses panel)
|
||||
message(STATUS "[ncurses] using library names without 'w' prefix")
|
||||
else()
|
||||
# pkg_check_modules fails on some systems, including OpenBSD.
|
||||
# pkg_check_modules(NCURSES REQUIRED ncursesw panelw)
|
||||
ensure_library_exists(ncursesw)
|
||||
ensure_library_exists(panelw)
|
||||
set(NCURSES_LIBRARIES ncursesw panelw)
|
||||
message(STATUS "[ncurses] using library names with 'w' prefix")
|
||||
endif()
|
||||
target_link_libraries(musikcube ${musikcube_LINK_LIBS} ${NCURSES_LIBRARIES} musikcore)
|
||||
if (${BUILD_STANDALONE} MATCHES "true")
|
||||
target_include_directories(musikcube BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES})
|
||||
endif()
|
||||
|
||||
# figure out if we have a "w" suffix or not...
|
||||
if (${NCURSES_DISABLE_LIB_SUFFIXES} MATCHES "true")
|
||||
message(STATUS "[ncurses] using library names *WITHOUT* 'w' prefix")
|
||||
set(CURSES_LIBRARY_NAME ncurses)
|
||||
set(PANEL_LIBRARY_NAME panel)
|
||||
else()
|
||||
message(STATUS "[ncurses] using library names with 'w' prefix")
|
||||
set(CURSES_LIBRARY_NAME ncursesw)
|
||||
set(PANEL_LIBRARY_NAME panelw)
|
||||
endif()
|
||||
|
||||
if (${BUILD_STANDALONE} MATCHES "true")
|
||||
find_library(LIBNCURSES NAMES ${CURSES_LIBRARY_NAME} PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH)
|
||||
find_library(LIBPANEL NAMES ${PANEL_LIBRARY_NAME} PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_library(LIBNCURSES NAMES ${CURSES_LIBRARY_NAME} PATHS ${VENDOR_LINK_DIRECTORIES})
|
||||
find_library(LIBPANEL NAMES ${PANEL_LIBRARY_NAME} PATHS ${VENDOR_LINK_DIRECTORIES})
|
||||
endif()
|
||||
|
||||
message(STATUS "[musikcube] using libncurses at: " ${LIBNCURSES})
|
||||
message(STATUS "[musikcube] using libpanel at: " ${LIBPANEL})
|
||||
message(STATUS "[musikcube] using libtinfo at: " ${LIBTINFO})
|
||||
target_link_libraries(musikcube ${musikcube_LINK_LIBS} ${LIBNCURSES} ${LIBPANEL} musikcore)
|
||||
|
||||
if (ENABLE_PCH MATCHES "true")
|
||||
message(STATUS "[musikcube] enabling precompiled headers")
|
||||
include(./pch.cmake)
|
||||
endif()
|
||||
|
||||
|
@ -2,8 +2,6 @@ set (DAEMON_SRCS
|
||||
./main.cpp
|
||||
)
|
||||
|
||||
ensure_library_exists(ev)
|
||||
|
||||
set(musikcube_INSTALL_DIR ${HOMEBREW_PREFIX})
|
||||
if (NOT DEFINED musikcube_INSTALL_DIR)
|
||||
set(musikcube_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
@ -13,8 +11,10 @@ configure_file("musikcubed.in" "musikcubed" @ONLY)
|
||||
add_executable(musikcubed ${DAEMON_SRCS})
|
||||
|
||||
if (${BUILD_STANDALONE} MATCHES "true")
|
||||
target_include_directories(musikcubed BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES})
|
||||
find_library(EVLIB NAMES libev.a ev)
|
||||
target_link_libraries(musikcubed ${musikcube_LINK_LIBS} ${EVLIB} musikcore)
|
||||
else()
|
||||
target_link_libraries(musikcubed ${musikcube_LINK_LIBS} musikcore ev)
|
||||
find_library(EVLIB NAMES ev)
|
||||
endif()
|
||||
|
||||
target_link_libraries(musikcubed ${musikcube_LINK_LIBS} ${EVLIB} musikcore)
|
@ -3,8 +3,8 @@ set (alsaout_SOURCES
|
||||
AlsaOut.cpp
|
||||
)
|
||||
|
||||
ensure_library_exists(asound)
|
||||
|
||||
add_library(alsaout SHARED ${alsaout_SOURCES})
|
||||
target_link_libraries(alsaout asound)
|
||||
|
||||
find_library(LIBASOUND asound)
|
||||
target_link_libraries(alsaout ${LIBASOUND})
|
||||
|
||||
|
@ -6,8 +6,6 @@ set (openmptdecoder_SOURCES
|
||||
Utility.cpp
|
||||
)
|
||||
|
||||
ensure_library_exists(openmpt)
|
||||
|
||||
add_library(openmptdecoder SHARED ${openmptdecoder_SOURCES})
|
||||
|
||||
find_library(OPENMPTLIB NAMES openmpt)
|
||||
|
@ -3,8 +3,6 @@ set (pipewireout_SOURCES
|
||||
PipeWireOut.cpp
|
||||
)
|
||||
|
||||
ensure_library_exists(pipewire-0.3)
|
||||
|
||||
message(STATUS "[pipewireout] plugin enabled")
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
@ -4,7 +4,7 @@ set (pulseout_SOURCES
|
||||
PulseOut.cpp
|
||||
)
|
||||
|
||||
ensure_library_exists(pulse)
|
||||
|
||||
add_library(pulseout SHARED ${pulseout_SOURCES})
|
||||
target_link_libraries(pulseout pulse)
|
||||
|
||||
find_library(LIBPULSE pulse)
|
||||
target_link_libraries(pulseout ${LIBPULSE})
|
||||
|
@ -3,7 +3,7 @@ set (sndioout_SOURCES
|
||||
SndioOut.cpp
|
||||
)
|
||||
|
||||
ensure_library_exists(sndio)
|
||||
|
||||
add_library(sndioout SHARED ${sndioout_SOURCES})
|
||||
target_link_libraries(sndioout sndio)
|
||||
|
||||
find_library(LIBSNDIO sndio)
|
||||
target_link_libraries(sndioout ${LIBSNDIO})
|
||||
|
@ -6,6 +6,8 @@ set (taglibreader_SOURCES
|
||||
add_library(taglibreader SHARED ${taglibreader_SOURCES})
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
|
||||
find_library(LIBZ z)
|
||||
|
||||
if (NOT ${ENABLE_BUNDLED_TAGLIB} MATCHES "false")
|
||||
message(STATUS "[taglibmetadatareader] using bundled taglib = true")
|
||||
|
||||
@ -21,10 +23,10 @@ if (NOT ${ENABLE_BUNDLED_TAGLIB} MATCHES "false")
|
||||
|
||||
include_directories("${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/include")
|
||||
add_dependencies(taglibreader taglib)
|
||||
target_link_libraries(taglibreader ${Boost_LIBRARIES} "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib/libtag.a" z)
|
||||
message(STATUS "[taglibmetadatareader] using ${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib/libtag.a")
|
||||
set(LIBTAG "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib/libtag.a")
|
||||
else()
|
||||
message(STATUS "[taglibmetadatareader] using bundled taglib = false")
|
||||
ensure_library_exists(tag)
|
||||
target_link_libraries(taglibreader ${Boost_LIBRARIES} tag z)
|
||||
find_library(LIBTAG tag)
|
||||
endif()
|
||||
|
||||
message(STATUS "[taglibmetadatareader] using ${LIBTAG}")
|
||||
target_link_libraries(taglibreader ${Boost_LIBRARIES} ${LIBTAG} ${LIBZ})
|
||||
|
Loading…
x
Reference in New Issue
Block a user