Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb49681' into 'master'
[aarch64] Use macros, not hardcoded paths. Contributes to JB#49681

See merge request mer-core/libwbxml2!5
  • Loading branch information
Matti Kosola committed Jun 24, 2020
2 parents 96bcf65 + edf1267 commit 0ec77d3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
33 changes: 33 additions & 0 deletions rpm/0001-Use-GNUInstallDirs.patch
@@ -0,0 +1,33 @@
From 7a04c83f373a40079c0ca2f16ffe96921e2b9608 Mon Sep 17 00:00:00 2001
From: Niels Breet <niels.breet@jolla.com>
Date: Wed, 27 May 2020 17:23:00 +0300
Subject: [PATCH] Use GNUInstallDirs

---
CMakeLists.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2ce786..0471903 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,12 +53,14 @@ ENDIF( WBXML_INSTALL_FULL_HEADERS )

CMAKE_MINIMUM_REQUIRED(VERSION 2.4)

+include(GNUInstallDirs)
+
# TODO: Move to external file/macro
SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )

SET( LIB_SUFFIX "" CACHE STRING "The library directory suffix. 32bit empty string, 64 for 64bit." )
-SET( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE INTERNAL "libary location" )
-SET( LIBDATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The library data directory" )
+SET( LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE INTERNAL "libary location" )
+SET( LIBDATA_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "The library data directory" )
SET( BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE INTERNAL "binary location" )
SET( SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share" CACHE INTERNAL "data location" )
SET( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE INTERNAL "headers location" )
--
1.9.1

11 changes: 4 additions & 7 deletions rpm/libwbxml2.spec
Expand Up @@ -2,10 +2,10 @@ Name: libwbxml2
Version: 0.11.6
Release: 1
Summary: Library to parse, encode and handle WBXML documents
Group: System/Libraries
License: LGPLv2+
URL: https://git.sailfishos.org/mer-core/libwbxml2
Source0: %{name}-%{version}.tar.gz
Patch0: 0001-Use-GNUInstallDirs.patch
BuildRequires: expat-devel
BuildRequires: cmake

Expand All @@ -17,36 +17,33 @@ bandwidth in mobile communications.

%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
%{summary}.

%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}

%description doc
%{summary}.

%package tools
Summary: Tools for %{name}
Group: Tools
Requires: %{name} = %{version}-%{release}

%description tools
%{summary}. Provides tools to Parse and Encode WBXML documents.

%prep
%setup -q -n %{name}-%{version}/upstream
%autosetup -p1 -n %{name}-%{version}/upstream

%build
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DWBXML_INSTALL_FULL_HEADERS=ON ..
make
%cmake -DWBXML_INSTALL_FULL_HEADERS=ON ..
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
Expand Down

0 comments on commit 0ec77d3

Please sign in to comment.