From a91c7c1df5f039a3611bf0aa320b15f70305e8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 30 Mar 2022 18:58:56 +0200 Subject: [PATCH] Change libdvdcss detection to search the default system directory for libraries. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This resolves issue TDE/tde-packaging#113. Signed-off-by: Slávek Banko --- CMakeLists.txt | 12 ++++++++++++ config.h.cmake | 3 +++ kaffeine/src/instwizard.cpp | 27 +++++++++++++++------------ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36f4c14..dc0744d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,18 @@ set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) include( TDEMacros ) +##### get the system's default path for libraries + +tde_save_and_set( CMAKE_INSTALL_PREFIX "/usr" ) +include( GNUInstallDirs OPTIONAL ) +if( CMAKE_INSTALL_LIBDIR ) + set( SYSTEM_LIBDIR "${CMAKE_INSTALL_LIBDIR}" ) +else( ) + set( SYSTEM_LIBDIR "lib${LIB_SUFFIX}" ) +endif( ) +tde_restore( CMAKE_INSTALL_PREFIX ) + + ##### setup install paths include( TDESetupPaths ) diff --git a/config.h.cmake b/config.h.cmake index 9e8ebf2..20fc03c 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -7,6 +7,9 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ #cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ +/* System's default path for libraries */ +#define SYSTEM_LIBDIR "@SYSTEM_LIBDIR@" + /* Defined if you have xinerama */ #cmakedefine HAVE_XINERAMA 1 diff --git a/kaffeine/src/instwizard.cpp b/kaffeine/src/instwizard.cpp index cc880d1..7733efb 100644 --- a/kaffeine/src/instwizard.cpp +++ b/kaffeine/src/instwizard.cpp @@ -116,25 +116,28 @@ void InstWizard::internalWizard() info << "" << i18n("No WIN32 codecs found in /usr/lib/win32. You're not able to play Windows Media 9 files, newer Real Media files and some less common formats. Download the codecs here:") << " http://www1.mplayerhq.hu/design7/dload.html#binary_codecs."; */ + //LIBDVDCSS info << "

" << "libdvdcss" << "...
"; bool dvdcss = false; - TQDir d("/usr/lib"); - TQStringList entries = d.entryList("libdvdcss.so*"); - if (entries.count()) - dvdcss = true; - else + TQStringList libDirs; + TQStringList entries; + TQDir d; + libDirs + << "/" SYSTEM_LIBDIR + << "/usr/" SYSTEM_LIBDIR + << "/usr/local/" SYSTEM_LIBDIR + << "/lib" + << "/usr/lib" + << "/usr/local/lib"; + for (TQStringList::ConstIterator it = libDirs.begin(); it != libDirs.end(); ++it) { - d = TQDir("/usr/local/lib"); + d = TQDir(*it); entries = d.entryList("libdvdcss.so*"); if (entries.count()) - dvdcss = true; - else { - d = TQDir("/usr/lib64"); - entries = d.entryList("libdvdcss.so*"); - if (entries.count()) - dvdcss = true; + dvdcss = true; + break; } } if (!dvdcss)