Skip to content

Commit

Permalink
media-libs/libaom: fix libdir in pkgconfig files
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.28, Repoman-2.3.9
  • Loading branch information
aballier committed Apr 10, 2018
1 parent 24b396e commit fdbc37d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
40 changes: 40 additions & 0 deletions media-libs/libaom/files/libdirpc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Index: libaom-9999/CMakeLists.txt
===================================================================
--- libaom-9999.orig/CMakeLists.txt
+++ libaom-9999/CMakeLists.txt
@@ -248,6 +248,7 @@ if (NOT MSVC)
-DCMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME}
-DCONFIG_MULTITHREAD=${CONFIG_MULTITHREAD}
-DHAVE_PTHREAD_H=${HAVE_PTHREAD_H}
+ -DLIB_SUFFIX=${LIB_SUFFIX}
-P "${AOM_ROOT}/build/cmake/pkg_config.cmake"
COMMENT "Writing aom.pc"
VERBATIM)
Index: libaom-9999/build/cmake/pkg_config.cmake
===================================================================
--- libaom-9999.orig/build/cmake/pkg_config.cmake
+++ libaom-9999/build/cmake/pkg_config.cmake
@@ -35,12 +35,13 @@ endif ()

# Write pkg-config info.
set(prefix "${CMAKE_INSTALL_PREFIX}")
+set(libdir "lib${LIB_SUFFIX}")
set(pkgconfig_file "${AOM_CONFIG_DIR}/aom.pc")
string(TOLOWER ${CMAKE_PROJECT_NAME} pkg_name)
file(WRITE "${pkgconfig_file}" "# libaom pkg-config.\n")
file(APPEND "${pkgconfig_file}" "prefix=${prefix}\n")
file(APPEND "${pkgconfig_file}" "exec_prefix=\${prefix}/bin\n")
-file(APPEND "${pkgconfig_file}" "libdir=\${prefix}/lib\n")
+file(APPEND "${pkgconfig_file}" "libdir=\${prefix}/${libdir}\n")
file(APPEND "${pkgconfig_file}" "includedir=\${prefix}/include\n\n")
file(APPEND "${pkgconfig_file}" "Name: ${pkg_name}\n")
file(APPEND "${pkgconfig_file}"
@@ -48,7 +49,7 @@ file(APPEND "${pkgconfig_file}"
file(APPEND "${pkgconfig_file}" "Version: ${package_version}\n")
file(APPEND "${pkgconfig_file}" "Requires:\n")
file(APPEND "${pkgconfig_file}" "Conflicts:\n")
-file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/lib -l${pkg_name} -lm\n")
+file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/${libdir} -l${pkg_name} -lm\n")
if (CONFIG_MULTITHREAD AND HAVE_PTHREAD_H)
file(APPEND "${pkgconfig_file}" "Libs.private: -lm -lpthread\n")
else ()
3 changes: 3 additions & 0 deletions media-libs/libaom/libaom-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ REQUIRED_USE="
cpu_flags_x86_ssse3? ( cpu_flags_x86_sse2 )
"

PATCHES=( "${FILESDIR}/libdirpc.patch" )

src_prepare() {
sed -e 's/lib"/lib${LIB_SUFFIX}"/' -i CMakeLists.txt || die
cmake-utils_src_prepare
Expand Down Expand Up @@ -63,6 +65,7 @@ multilib_src_configure() {
-DBUILD_SHARED_LIBS=ON
)
cmake-utils_src_configure
rm aom.pc # ensure it is rebuilt with proper libdir
}

multilib_src_install() {
Expand Down

0 comments on commit fdbc37d

Please sign in to comment.