Project

General

Profile

Actions

Bug #4513

open

PKG information broken

Added by slocomptech almost 4 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/26/2020
Due date:
% Done:

0%

Spec Reference:

Description

Hi,
in RTL-SDR library PKG information is broken. I installed rtl-sdr from source on alpine linux.
I installed it via install instruction for cmake on https://osmocom.org/projects/rtl-sdr/wiki/Rtl-sdr.

I ran following:
git clone git://git.osmocom.org/rtl-sdr.git && \
cd rtl-sdr/ && \
mkdir build && \
cd build && \
cmake ../ -DINSTALL_UDEV_RULES=ON && \
make -Wno-dev && \
make install && \
ldconfig /etc/ld.so.conf && \
cp ../rtl-sdr.rules /etc/udev/rules.d/

From source librtlsdr.pc.in looks like
prefix=prefix
exec_prefix=exec_prefix
libdir=libdir
includedir=includedir

Name: RTL-SDR Library
Description: C Utility Library
Version: VERSION
Cflags: -I${includedir}/
Libs: -L${libdir} -lrtlsdr
Libs.private: -lusb-1.0 RTLSDR_PC_LIBS

But just before install librtlsdr.pc looks like:
prefix=
exec_prefix=
libdir=
includedir=

Name: RTL-SDR Library
Description: C Utility Library
Version: 0.6.0-25-gd794
Cflags: -I${includedir}/
Libs: -L${libdir} -lrtlsdr
Libs.private: -lusb-1.0

As you can see top variables are not set, but they should be. This breaks git clone https://github.com/viraptor/kalibrate-rtl.git package since
it can't detect LIBRTLSDR, because above variables are missing:
configure: error: Package requirements (librtlsdr) were not met:

Package 'librtlsdr', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBRTLSDR_CFLAGS
and LIBRTLSDR_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

So, after some research problem is in CMakeList.txt somewhere near:
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/librtlsdr.pc.in
${CMAKE_CURRENT_BINARY_DIR}/librtlsdr.pc
@ONLY)

Please also look at https://github.com/viraptor/kalibrate-rtl/issues/13.

Actions #1

Updated by slocomptech almost 4 years ago

Issue fixed if running like
cd /tmp && \
git clone git://git.osmocom.org/rtl-sdr.git && \
cd rtl-sdr/ && \
mkdir build && \
cd build && \
cmake ../ -DINSTALL_UDEV_RULES=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR:PATH=lib && \
sed -i 's/^prefix=.*/prefix=\/usr/g' librtlsdr.pc && \
sed -i 's/^exec_prefix=.*/exec_prefix=\$\{prefix\}/g' librtlsdr.pc && \
sed -i 's/^libdir=.*/libdir=\$\{exec_prefix\}\/lib/g' librtlsdr.pc && \
sed -i 's/^includedir=.*/includedir=\$\{prefix\}\/include/g' librtlsdr.pc && \
make -Wno-dev && \
make install && \
ldconfig /etc/ld.so.conf && \
cp ../rtl-sdr.rules /etc/udev/rules.d/

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)