Skip to content

Commit

Permalink
Merge branch 'lib64' into 'master'
Browse files Browse the repository at this point in the history
Respect arch specific lib dir

See merge request mer-core/libmce-glib!7
  • Loading branch information
monich committed May 25, 2020
2 parents fb4d97c + dcfa3ff commit be3d072
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 46 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ debian/libmce-glib
debian/libmce-glib-dev
debian/*.debhelper.log
debian/*.debhelper
debian/*.install
debian/*.substvars
debian/tmp
documentation.list
Expand Down
37 changes: 18 additions & 19 deletions Makefile
Expand Up @@ -63,25 +63,20 @@ RELEASE_BUILD_DIR = $(BUILD_DIR)/release
# Tools and flags
#

ifndef CC
CC = $(CROSS_COMPILE)gcc
endif

CC ?= $(CROSS_COMPILE)gcc
LD = $(CC)
DEFINES += -DGLIB_DISABLE_DEPRECATION_WARNINGS
WARNINGS = -Wall -Wno-unused-parameter -Wno-multichar
INCLUDES = -I$(INCLUDE_DIR) -I$(GEN_DIR)
BASE_FLAGS = -fPIC $(CFLAGS)
FULL_CFLAGS = $(BASE_FLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) -MMD -MP \
$(shell pkg-config --cflags $(PKGS))
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIB_SONAME)
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIB_SONAME) \
-Wl,--version-script=$(LIB_NAME).map
DEBUG_FLAGS = -g
RELEASE_FLAGS =

ifndef KEEP_SYMBOLS
KEEP_SYMBOLS = 0
endif

KEEP_SYMBOLS ?= 0
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
Expand Down Expand Up @@ -138,14 +133,13 @@ debug: $(DEBUG_LIB) $(DEBUG_LINK)

release: $(RELEASE_LIB) $(RELEASE_LINK)

pkgconfig: $(PKGCONFIG)

clean:
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~ rpm/*~
rm -fr $(BUILD_DIR) RPMS installroot
rm -fr debian/tmp debian/lib$(NAME) debian/lib$(NAME)-dev
rm -f documentation.list debian/files debian/*.substvars
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
rm -f debian/*.install

$(GEN_DIR):
mkdir -p $@
Expand Down Expand Up @@ -186,24 +180,29 @@ $(DEBUG_LINK):
$(RELEASE_LINK):
ln -sf $(LIB) $@

# This one could be substituted with arch specific dir
LIBDIR ?= /usr/lib
ABS_LIBDIR := $(shell echo /$(LIBDIR) | sed -r 's|/+|/|g')

pkgconfig: $(PKGCONFIG)

$(PKGCONFIG): $(LIB_NAME).pc.in Makefile
sed -e 's/\[version\]/'$(PCVERSION)/g $< > $@
sed -e 's|@version@|$(PCVERSION)|g' -e 's|@libdir@|$(ABS_LIBDIR)|g' $< > $@

debian/%.install: debian/%.install.in
sed 's|@LIBDIR@|$(LIBDIR)|g' $< > $@

#
# Install
#

INSTALL_PERM = 644

INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)
INSTALL_FILES = $(INSTALL) -m 644

INSTALL_LIB_DIR = $(DESTDIR)/usr/lib
INSTALL_LIB_DIR = $(DESTDIR)$(ABS_LIBDIR)
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/$(LIB_NAME)
INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig

INSTALL_ALIAS = $(INSTALL_LIB_DIR)/$(LIB_SHORTCUT)
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig

install: $(INSTALL_LIB_DIR)
$(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR)
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Expand Up @@ -2,13 +2,13 @@ Source: libmce-glib
Section: libs
Priority: optional
Maintainer: Slava Monich <slava.monich@jolla.com>
Build-Depends: debhelper (>= 7), libglib2.0-dev (>= 2.0), libglibutil-dev, mce-dev
Build-Depends: debhelper (>= 8.1.3), libglib2.0-dev (>= 2.0), libglibutil-dev, mce-dev
Standards-Version: 3.8.4

Package: libmce-glib
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: libglibutil (>= 1.0.5), ${shlibs:Depends}, ${misc:Depends}
Description: Client library for mce

Package: libmce-glib-dev
Expand Down
3 changes: 0 additions & 3 deletions debian/libmce-glib-dev.install

This file was deleted.

3 changes: 3 additions & 0 deletions debian/libmce-glib-dev.install.in
@@ -0,0 +1,3 @@
debian/tmp/@LIBDIR@/libmce-glib.so @LIBDIR@
debian/tmp/@LIBDIR@/pkgconfig/libmce-glib.pc @LIBDIR@/pkgconfig
debian/tmp/usr/include/* usr/include
1 change: 0 additions & 1 deletion debian/libmce-glib.install

This file was deleted.

1 change: 1 addition & 0 deletions debian/libmce-glib.install.in
@@ -0,0 +1 @@
debian/tmp/@LIBDIR@/libmce-glib.so.* @LIBDIR@
7 changes: 6 additions & 1 deletion debian/rules
Expand Up @@ -4,8 +4,13 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

override_dh_auto_build:
dh_auto_build -- LIBDIR=$(LIBDIR) release pkgconfig debian/libmce-glib.install debian/libmce-glib-dev.install

override_dh_auto_install:
dh_auto_install -- install-dev
dh_auto_install -- LIBDIR=$(LIBDIR) install-dev

%:
dh $@
6 changes: 6 additions & 0 deletions libmce-glib.map
@@ -0,0 +1,6 @@
{
global:
mce_*;
local:
*;
};
4 changes: 2 additions & 2 deletions libmce-glib.pc.in
@@ -1,9 +1,9 @@
libdir=/usr/lib
libdir=@libdir@
includedir=/usr/include

Name: libmce-glib
Description: MCE client library
Version: [version]
Version: @version@
Requires.private: libglibutil glib-2.0 gio-2.0
Libs: -lmce-glib
Cflags: -I${includedir}/libmce-glib
4 changes: 2 additions & 2 deletions rpm/libmce-glib.spec
Expand Up @@ -28,11 +28,11 @@ This package contains the development library for %{name}.
%setup -q

%build
make KEEP_SYMBOLS=1 release pkgconfig
make LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig

%install
rm -rf %{buildroot}
make install-dev DESTDIR=%{buildroot}
make LIBDIR=%{_libdir} DESTDIR=%{buildroot} install-dev

%post -p /sbin/ldconfig

Expand Down
11 changes: 6 additions & 5 deletions src/mce_proxy.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2016-2020 Jolla Ltd.
* Copyright (C) 2016-2020 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
Expand All @@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand Down Expand Up @@ -60,6 +60,7 @@ enum mce_proxy_signal {
static guint mce_proxy_signals[SIGNAL_COUNT] = { 0 };

typedef GObjectClass MceProxyClass;
GType mce_proxy_get_type() MCE_INTERNAL;
G_DEFINE_TYPE(MceProxy, mce_proxy, G_TYPE_OBJECT)
#define PARENT_CLASS mce_proxy_parent_class
#define MCE_PROXY_TYPE (mce_proxy_get_type())
Expand Down
27 changes: 16 additions & 11 deletions src/mce_proxy.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2016-2020 Jolla Ltd.
* Copyright (C) 2016-2020 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
Expand All @@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand All @@ -37,7 +37,7 @@
#ifndef MCE_PROXY_H
#define MCE_PROXY_H

#include "mce_types.h"
#include "mce_types_p.h"

typedef struct mce_proxy_priv MceProxyPriv;
struct _ComNokiaMceSignal;
Expand All @@ -58,26 +58,31 @@ typedef void

MceProxy*
mce_proxy_new(
void);
void)
MCE_INTERNAL;

MceProxy*
mce_proxy_ref(
MceProxy* proxy);
MceProxy* proxy)
MCE_INTERNAL;

void
mce_proxy_unref(
MceProxy* proxy);
MceProxy* proxy)
MCE_INTERNAL;

gulong
mce_proxy_add_valid_changed_handler(
MceProxy* proxy,
MceProxyFunc fn,
void* arg);
void* arg)
MCE_INTERNAL;

void
mce_proxy_remove_handler(
MceProxy* proxy,
gulong id);
gulong id)
MCE_INTERNAL;

#endif /* MCE_PROXY_H */

Expand Down
53 changes: 53 additions & 0 deletions src/mce_types_p.h
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2020 Jolla Ltd.
* Copyright (C) 2020 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* any official policies, either expressed or implied.
*/

#ifndef MCE_TYPES_PRIVATE_H
#define MCE_TYPES_PRIVATE_H

#include <mce_types.h>

/* Macros */
#define MCE_INTERNAL G_GNUC_INTERNAL

#endif /* MCE_TYPES_PRIVATE_H */

/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

0 comments on commit be3d072

Please sign in to comment.