QR-Code-generator/0004-Create-install-targets-for-C-and-CPP.patch
Fridrich Strba a51c6f460b - Update to 1.8.0+git17.856ba8a
https://github.com/nayuki/QR-Code-generator/compare/v1.8.0...856ba8a
- switch build to cmake files from
  https://github.com/EasyCoding/qrcodegen-cmake.git
  - This build also adds the pkgconfig and cmake files for easier
    integration with other projects ( like the upcoming obs-studio
    31.0.0)
  - drop patches:
    0002-Make-use-of-fPIC-parameter-when-building.patch
    0003-Generate-both-shared-and-static-libraries.patch
    0004-Create-install-targets-for-C-and-CPP.patch
- use %ldconfig_scriptlets
- add BR for pkgconfig to ensure we get the pkgconfig provides

OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/QR-Code-generator?expand=0&rev=10
2024-10-09 10:59:20 +00:00

119 lines
3.5 KiB
Diff

From 498d2a0cf6d6f01a3ffb87e358f63c3a64afeb9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tchvatal@suse.com>
Date: Tue, 3 Dec 2019 12:45:34 +0100
Subject: [PATCH 4/5] Create install targets for C and CPP
---
c/Makefile | 26 ++++++++++++++++++++++++++
cpp/Makefile | 27 +++++++++++++++++++++++++++
2 files changed, 53 insertions(+)
Index: QR-Code-generator-1.8.0/c/Makefile
===================================================================
--- QR-Code-generator-1.8.0.orig/c/Makefile
+++ QR-Code-generator-1.8.0/c/Makefile
@@ -34,6 +34,8 @@ CFLAGS += -std=c99 -O
# Extra flags for diagnostics:
# CFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
+# Version information
+VERSION = 1.8.0
# ---- Controlling make ----
@@ -55,9 +57,15 @@ ARFILE = lib$(LIB).a
LIBFILE = lib$(LIB).so
# Bump the soname number when the ABI changes and gets incompatible
SO_NAME = $(LIBFILE).1
+REAL_NAME = $(LIBFILE).$(VERSION)
+HEADERS = qrcodegen.h
LIBOBJ = qrcodegen.o
MAINS = qrcodegen-demo qrcodegen-test
+# define paths to install
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
+LIBDIR ?= $(DESTDIR)/usr/lib
+
# Build all binaries
all: $(LIBFILE) $(ARFILE) $(MAINS)
@@ -66,6 +74,24 @@ clean:
rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=.o) $(MAINS)
rm -rf .deps
+install-shared: $(LIBFILE)
+ install -d $(LIBDIR) || true
+ install -m 0644 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
+ rm -f $(LIBDIR)/$(SO_NAME)
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
+ rm -f $(LIBDIR)/$(LIBFILE)
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
+
+install-static: $(ARFILE)
+ install -d $(LIBDIR) || true
+ install -m 0644 $(ARFILE) $(LIBDIR)/$(ARFILE)
+
+install-header: $(HEADERS)
+ install -d $(INCLUDEDIR) || true
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
+
+install: install-shared install-static install-header
+
# Executable files
%: %.o $(LIBFILE)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)
Index: QR-Code-generator-1.8.0/cpp/Makefile
===================================================================
--- QR-Code-generator-1.8.0.orig/cpp/Makefile
+++ QR-Code-generator-1.8.0/cpp/Makefile
@@ -34,6 +34,8 @@ CXXFLAGS += -std=c++11 -O
# Extra flags for diagnostics:
# CXXFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
+# Version information
+VERSION = 1.8.0
# ---- Controlling make ----
@@ -55,9 +57,15 @@ ARFILE = lib$(LIB).a
LIBFILE = lib$(LIB).so
# Bump the soname number when the ABI changes and gets incompatible
SO_NAME = $(LIBFILE).1
+REAL_NAME = $(LIBFILE).$(VERSION)
+HEADERS = qrcodegen.hpp
LIBOBJ = qrcodegen.o
MAINS = QrCodeGeneratorDemo
+# define paths to install
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
+LIBDIR ?= $(DESTDIR)/usr/lib
+
# Build all binaries
all: $(LIBFILE) $(LIBFILE) $(MAINS)
@@ -66,6 +74,24 @@ clean:
rm -f -- $(LIBOBJ) $(ARFILE) $(LIBFILE) $(MAINS:=.o) $(MAINS)
rm -rf .deps
+install-shared: $(LIBFILE)
+ install -d $(LIBDIR) || true
+ install -m 0644 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
+ rm -f $(LIBDIR)/$(SO_NAME)
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
+ rm -f $(LIBDIR)/$(LIBFILE)
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
+
+install-static: $(ARFILE)
+ install -d $(LIBDIR) || true
+ install -m 0644 $(ARFILE) $(LIBDIR)/$(ARFILE)
+
+install-header: $(HEADERS)
+ install -d $(INCLUDEDIR) || true
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
+
+install: install-shared install-static install-header
+
# Executable files
%: %.o $(LIBFILE)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)