libqrcodegen: 1.6.0 -> 1.7.0

This commit is contained in:
Tim Biermann 2021-08-11 07:58:03 +02:00
parent 1ed0255b39
commit 4cf294fdc1
5 changed files with 190 additions and 154 deletions

View File

@ -1,6 +1,7 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF34oVLmMVhEGJ0hJ18rmI19LMSfWFk6Orr0FPau7uQi2mjzvD/hbVj91vxxo9Av3wOc3AfmW8k9KZdYECAAuGdAA=
SHA256 (Pkgfile) = b2995392daba6cac52b258030e717b28e72a0490b041d12419432d63172d6e6c
RWSagIOpLGJF34+Ke2C79VjpGqIxthxpbjLYFZiOKhjLPGTWUKCQGNWC0tIjOqGwqTv33BOQ88/ovaYTMJ9ZtzotaOpQYBYSgAs=
SHA256 (Pkgfile) = 9f25fe999ac31627091f41753767f0c005c6330154f4148423d80e3a24c60285
SHA256 (.footprint) = 49cab9bb05830f1b5c591af844fdfd1056365aacfcee52bf65e5f24355c9a9ca
SHA256 (libqrcodegen-1.6.0.tar.gz) = 8acee5a77325e075b910747ad4b1fdb1491b7e22d0b8f1b5a6ea15ea08ba33a8
SHA256 (qr-code-generator-build-fixes.patch) = 6ee12ffc7b0669f172eb79a37e4b394fd14877761b62bbaa7fa1011f9dd93e30
SHA256 (libqrcodegen-1.7.0.tar.gz) = a8138d84a2adbc9168bfadfb9db5272c89b69fb87f72a88ecd08ce7f402ee710
SHA256 (cpp-makefile.patch) = d243b287dc16df521d5a1bf4606bc024bef5e6a0a214592bb682ffc9215ce52c
SHA256 (c-makefile.patch) = 9f3e752f6bbe2f6a10e0905dd76665bfd6e33db9b24ab496d69addd4d658410f

View File

@ -1,20 +1,19 @@
# Description: QR code generator
# URL: https://github.com/nayuki/QR-Code-generator
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on:
name=libqrcodegen
version=1.6.0
version=1.7.0
release=1
source=(https://github.com/nayuki/QR-Code-generator/archive/v$version/$name-$version.tar.gz
qr-code-generator-build-fixes.patch)
cpp-makefile.patch c-makefile.patch)
build() {
# https://raw.githubusercontent.com/OpenMandrivaAssociation/qr-code-generator/master/qr-code-generator-build-fixes.patch
patch -Np1 -d QR-Code-generator-$version -i $SRC/qr-code-generator-build-fixes.patch
patch -Np1 -d QR-Code-generator-$version/c -i $SRC/c-makefile.patch
patch -Np1 -d QR-Code-generator-$version/cpp -i $SRC/cpp-makefile.patch
cp -R QR-Code-generator-$version{,-cpp}
cd QR-Code-generator-$version
make DESTDIR=$PKG -C c install
make DESTDIR=$PKG PREFIX=/usr -C c install
cd $SRC/QR-Code-generator-$version-cpp
make DESTDIR=$PKG -C cpp install
make DESTDIR=$PKG PREFIX=/usr -C cpp install
}

View File

@ -0,0 +1,84 @@
--- c/Makefile.orig 2021-08-08 17:21:08 UTC
+++ c/Makefile
@@ -29,11 +29,13 @@
# - CFLAGS: Any extra user-specified compiler flags (can be blank).
# Recommended compiler flags:
-CFLAGS += -std=c99 -O
+CFLAGS ?= -std=c99 -O
# Extra flags for diagnostics:
# CFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
+# Version information
+VERSION = 1.7.0
# ---- Controlling make ----
@@ -51,18 +53,45 @@ CFLAGS += -std=c99 -O
# ---- Targets to build ----
LIB = qrcodegen
-LIBFILE = lib$(LIB).a
+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)$(PREFIX)/include/qrcodegen
+LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
+
# Build all binaries
-all: $(LIBFILE) $(MAINS)
+all: $(LIBFILE) $(ARFILE) $(MAINS)
# Delete build output
clean:
- rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
+ 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)
@@ -72,12 +101,15 @@ qrcodegen-test: qrcodegen-test.c $(LIBOB
$(CC) $(CFLAGS) $(LDFLAGS) -DQRCODEGEN_TEST -o $@ $^
# The library
-$(LIBFILE): $(LIBOBJ)
+$(ARFILE): $(LIBOBJ)
$(AR) -crs $@ -- $^
+$(LIBFILE): $(LIBOBJ)
+ $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
+
# Object files
%.o: %.c .deps/timestamp
- $(CC) $(CFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
+ $(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
# Have a place to store header dependencies automatically generated by compiler
.deps/timestamp:

View File

@ -0,0 +1,95 @@
--- cpp/Makefile.orig 2021-08-08 17:21:08 UTC
+++ cpp/Makefile
@@ -29,11 +29,13 @@
# - CXXFLAGS: Any extra user-specified compiler flags (can be blank).
# Recommended compiler flags:
-CXXFLAGS += -std=c++11 -O
+CXXFLAGS ?= -std=c++11 -O
# Extra flags for diagnostics:
# CXXFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
+# Version information
+VERSION = 1.7.0
# ---- Controlling make ----
@@ -51,29 +53,59 @@ CXXFLAGS += -std=c++11 -O
# ---- Targets to build ----
LIB = qrcodegencpp
-LIBFILE = lib$(LIB).a
+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)$(PREFIX)/include/qrcodegen
+LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
+
# Build all binaries
-all: $(LIBFILE) $(MAINS)
+all: $(LIBFILE) $(ARFILE) $(MAINS)
# Delete build output
clean:
- rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
+ 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)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)
# The library
-$(LIBFILE): $(LIBOBJ)
+$(ARFILE): $(LIBOBJ)
$(AR) -crs $@ -- $^
+$(LIBFILE): $(LIBOBJ)
+ $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
+
# Object files
%.o: %.cpp .deps/timestamp
- $(CXX) $(CXXFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
+ $(CXX) $(CXXFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
# Have a place to store header dependencies automatically generated by compiler
.deps/timestamp:
[FILE:142:files/Makefile]
SUBDIRS= c cpp
TARGETS= all clean install
.PHONY: $(TARGETS) $(SUBDIRS)
$(TARGETS): $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)

View File

@ -1,143 +0,0 @@
diff -up QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile.1~ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile
--- QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile.1~ 2020-01-29 18:52:21.000000000 +0100
+++ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile 2020-03-02 05:14:45.909539003 +0100
@@ -29,11 +29,13 @@
# - CFLAGS: Any extra user-specified compiler flags (can be blank).
# Recommended compiler flags:
-CFLAGS += -std=c99 -O
+CFLAGS += -std=c99
# Extra flags for diagnostics:
# CFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
+# Version information
+VERSION = 1.5.0
# ---- Controlling make ----
@@ -51,10 +53,18 @@ CFLAGS += -std=c99 -O
# ---- Targets to build ----
LIB = qrcodegen
-LIBFILE = 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 qrcodegen-worker
+# define paths to install
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
+LIBDIR ?= $(DESTDIR)/usr/lib
+
# Build all binaries
all: $(LIBFILE) $(MAINS)
@@ -63,6 +73,18 @@ clean:
rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
rm -rf .deps
+install-shared: $(LIBFILE)
+ install -d $(LIBDIR) || true
+ install -m 0755 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
+
+install-header: $(HEADERS)
+ install -d $(INCLUDEDIR) || true
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
+
+install: install-shared install-header
+
# Executable files
%: %.o $(LIBFILE)
$(CC) $(CFLAGS) -o $@ $< -L . -l $(LIB)
@@ -73,11 +95,11 @@ qrcodegen-test: qrcodegen-test.c $(LIBOB
# The library
$(LIBFILE): $(LIBOBJ)
- $(AR) -crs $@ -- $^
+ $(CC) $(CXXFLAGS) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
# Object files
%.o: %.c .deps/timestamp
- $(CC) $(CFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
+ $(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
# Have a place to store header dependencies automatically generated by compiler
.deps/timestamp:
diff -up QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile.1~ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile
--- QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile.1~ 2020-01-29 18:52:21.000000000 +0100
+++ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile 2020-03-02 05:15:35.901541207 +0100
@@ -29,11 +29,13 @@
# - CXXFLAGS: Any extra user-specified compiler flags (can be blank).
# Recommended compiler flags:
-CXXFLAGS += -std=c++11 -O
+CXXFLAGS += -std=c++11
# Extra flags for diagnostics:
# CXXFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
+# Version information
+VERSION = 1.5.0
# ---- Controlling make ----
@@ -50,11 +52,19 @@ CXXFLAGS += -std=c++11 -O
# ---- Targets to build ----
-LIB = qrcodegen
-LIBFILE = lib$(LIB).a
+LIB = qrcodegencpp
+LIBFILE = lib$(LIB).so
+# Bump the soname number when the ABI changes and gets incompatible
+SO_NAME = $(LIBFILE).1
+REAL_NAME = $(LIBFILE).$(VERSION)
+HEADERS = QrCode.hpp
LIBOBJ = QrCode.o
MAINS = QrCodeGeneratorDemo QrCodeGeneratorWorker
+# define paths to install
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
+LIBDIR ?= $(DESTDIR)/usr/lib
+
# Build all binaries
all: $(LIBFILE) $(MAINS)
@@ -63,17 +73,29 @@ clean:
rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
rm -rf .deps
+install-shared: $(LIBFILE)
+ install -d $(LIBDIR) || true
+ install -m 0755 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
+
+install-header: $(HEADERS)
+ install -d $(INCLUDEDIR) || true
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
+
+install: install-shared install-header
+
# Executable files
%: %.o $(LIBFILE)
$(CXX) $(CXXFLAGS) -o $@ $< -L . -l $(LIB)
# The library
$(LIBFILE): $(LIBOBJ)
- $(AR) -crs $@ -- $^
+ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
# Object files
%.o: %.cpp .deps/timestamp
- $(CXX) $(CXXFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
+ $(CXX) $(CXXFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
# Have a place to store header dependencies automatically generated by compiler
.deps/timestamp: