Skip to content

Commit

Permalink
[libcommhistory] Use macros, not hardcoded paths. JB#50027
Browse files Browse the repository at this point in the history
Signed-off-by: Matti Kosola <matti.kosola@jolla.com>
  • Loading branch information
mkosola committed May 29, 2020
1 parent 8c2791a commit fa943bd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions common-installs-config.pri
Expand Up @@ -27,7 +27,7 @@
#-----------------------------------------------------------------------------
# setup the installation prefix
#-----------------------------------------------------------------------------
INSTALL_PREFIX = /usr # default installation prefix
INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] # default installation prefix

# default prefix can be overriden by defining PREFIX when running qmake
isEmpty( PREFIX ) {
Expand Down Expand Up @@ -56,7 +56,7 @@ contains( TEMPLATE, app ) {
#-----------------------------------------------------------------------------
contains( TEMPLATE, lib ) {

target.path = $${INSTALL_PREFIX}/lib
target.path = $$[QT_INSTALL_LIBS]
INSTALLS += target
message("====")
message("==== INSTALLS += target")
Expand Down
6 changes: 6 additions & 0 deletions common-vars.pri
Expand Up @@ -38,6 +38,12 @@ isEmpty(PROJECT_VERSION) {
message("PROJECT_VERSION is unset, assuming $$PROJECT_VERSION")
}

# This should be passed on qmake command line
isEmpty(PKGCONFIG_LIB) {
PKGCONFIG_LIB = lib
message("PKGCONFIG_LIB is unset, assuming $$PKGCONFIG_LIB")
}

#------------------------------------------------------------------------------
# Library version
#------------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions rpm/libcommhistory-qt5.spec
Expand Up @@ -2,7 +2,6 @@ Name: libcommhistory-qt5
Summary: Communications event history database API
Version: 1.9.44
Release: 1
Group: System/Libraries
License: LGPLv2
URL: https://git.sailfishos.org/mer-core/libcommhistory
Source0: %{name}-%{version}.tar.bz2
Expand Down Expand Up @@ -69,7 +68,7 @@ Documentation for libcommhistory

%build
unset LD_AS_NEEDED
%qtc_qmake5 "PROJECT_VERSION=$(sed 's/+.*//' <<<"%{version}")"
%qtc_qmake5 "PROJECT_VERSION=$(sed 's/+.*//' <<<"%{version}")" "PKGCONFIG_LIB=%{_lib}"
%qtc_make %{?_smp_mflags}

%install
Expand Down
2 changes: 1 addition & 1 deletion src/commhistory-qt5.pc.in
@@ -1,6 +1,6 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib/
libdir=${prefix}/$$PKGCONFIG_LIB/
includedir=${prefix}/include/commhistory-qt5/

Name: libcommhistory-qt5
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Expand Up @@ -91,7 +91,7 @@ headers.files = $$HEADERS \
# -----------------------------------------------------------------------------
QMAKE_SUBSTITUTES += $${TARGET}.pc.in
pkgconfig.files = $${TARGET}.pc
pkgconfig.path = $${INSTALL_PREFIX}/lib/pkgconfig
pkgconfig.path = $$[QT_INSTALL_LIBS]/pkgconfig
INSTALLS += pkgconfig

# -----------------------------------------------------------------------------
Expand Down

0 comments on commit fa943bd

Please sign in to comment.