From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:60162) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixb5L-0002Rm-1O for guix-patches@gnu.org; Fri, 31 Jan 2020 13:32:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixb5H-0006eL-2r for guix-patches@gnu.org; Fri, 31 Jan 2020 13:32:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60349) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ixb5G-0006cn-Pc for guix-patches@gnu.org; Fri, 31 Jan 2020 13:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ixb5G-0001tO-LZ for guix-patches@gnu.org; Fri, 31 Jan 2020 13:32:02 -0500 Subject: [bug#39365] [PATCH 1/6] gnu: Add qrcodegen-cpp. Resent-Message-ID: Date: Fri, 31 Jan 2020 13:30:47 -0500 From: Leo Famulari Message-ID: <20200131183047.GA32156@jasmine.lan> References: <20200131030509.GA13436@jasmine.lan> <20200131085851.GE9517@E5400> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9" Content-Disposition: inline In-Reply-To: <20200131085851.GE9517@E5400> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Efraim Flashner Cc: 39365@debbugs.gnu.org --gj572EiMnwbLXET9 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Oops! Attached... On Fri, Jan 31, 2020 at 10:58:51AM +0200, Efraim Flashner wrote: > On Thu, Jan 30, 2020 at 10:06:22PM -0500, Leo Famulari wrote: > > * gnu/packages/aidc.scm (qrcodegen-cpp): New variable. > > --- > > gnu/packages/aidc.scm | 39 +++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 39 insertions(+) >=20 > You're missing the actual patch ;) >=20 > >=20 > > diff --git a/gnu/packages/aidc.scm b/gnu/packages/aidc.scm > > index 77db0ac9fc..b68f2137be 100644 > > --- a/gnu/packages/aidc.scm > > +++ b/gnu/packages/aidc.scm > > @@ -4,6 +4,7 @@ > > ;;; Copyright =C2=A9 2017 Hartmut Goebel > > ;;; Copyright =C2=A9 2018, 2019 Tobias Geerinckx-Rice > > ;;; Copyright =C2=A9 2019 Guillaume Le Vaillant > > +;;; Copyright =C2=A9 2020 Leo Famulari > > ;;; > > ;;; This file is part of GNU Guix. > > ;;; > > @@ -154,3 +155,41 @@ For application developers, language bindings are = included for C, C++ and > > Python as well as GUI widgets for GTK and Qt.") > > (home-page "https://github.com/mchehab/zbar") > > (license license:lgpl2.1+))) > > + > > +(define-public qrcodegen-cpp > > + ;; Currently this project's installation mechanism only exists as a = GitHub > > + ;; pull request, so we build from a recent commit that the proposed = patch > > + ;; applies to. > > + (let ((commit "6ea933f1596d818bd21e9a6b8d2e851fb8b4bcf1") > > + (revision "0")) > > + (package > > + (name "qrcodegen-cpp") > > + (version (git-version "1.5.0" revision commit)) > > + (source (origin > > + (method git-fetch) > > + (uri (git-reference > > + (url "https://github.com/nayuki/QR-Code-generat= or.git") > > + (commit commit))) > > + (file-name (git-file-name name version)) > > + (patches (search-patches "qrcodegen-cpp-make-install.p= atch")) > > + (sha256 > > + (base32 > > + "19fcwqmfk2n9p2n01dv2j4x2y2mqip0j1wbmfbxjp34rqkjwcwx= m")))) > > + (build-system gnu-build-system) > > + (arguments > > + `(#:tests? #f ; no test suite > > + #:make-flags > > + (list (string-append "PREFIX=3D" (assoc-ref %outputs "out"))) > > + #:phases > > + (modify-phases %standard-phases > > + (delete 'configure) ; No ./configure script > > + ;; Only build the C++ variant. > > + (add-after 'unpack 'chdir > > + (lambda _ > > + (chdir "cpp") > > + #t))))) > > + (synopsis "QR Code generator library") > > + (description "qrcodegen-cpp is a QR code generator library in C+= +. The > > +project also offers Java, Javascript, Python, C, and Rust implementati= ons.") >=20 > You can drop the comma after C if you want. >=20 > > + (home-page "https://www.nayuki.io/page/qr-code-generator-library= ") > > + (license license:expat)))) > > --=20 > > 2.25.0 > >=20 > >=20 > >=20 > >=20 >=20 > --=20 > Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7= =9D =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 > GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 > Confidentiality cannot be guaranteed on emails sent or received unencrypt= ed --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="0001-gnu-Add-qrcodegen-cpp.patch" Content-Transfer-Encoding: quoted-printable =46rom 128d0335f74bb90b82427a96ef32127f98e04f31 Mon Sep 17 00:00:00 2001 =46rom: Leo Famulari Date: Thu, 30 Jan 2020 14:52:29 -0500 Subject: [PATCH] gnu: Add qrcodegen-cpp. * gnu/packages/aidc.scm (qrcodegen-cpp): New variable. * gnu/packages/patches/qrcodegen-cpp-make-install.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/aidc.scm | 39 ++ .../patches/qrcodegen-cpp-make-install.patch | 448 ++++++++++++++++++ 3 files changed, 488 insertions(+) create mode 100644 gnu/packages/patches/qrcodegen-cpp-make-install.patch diff --git a/gnu/local.mk b/gnu/local.mk index aa8e6e0d0d..4e991f66f4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1338,6 +1338,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/qemu-CVE-2020-7039.patch \ %D%/packages/patches/qemu-CVE-2020-7211.patch \ %D%/packages/patches/qemu-fix-documentation-build-failure.patch \ + %D%/packages/patches/qrcodegen-cpp-make-install.patch \ %D%/packages/patches/qt4-ldflags.patch \ %D%/packages/patches/qtbase-use-TZDIR.patch \ %D%/packages/patches/qtscript-disable-tests.patch \ diff --git a/gnu/packages/aidc.scm b/gnu/packages/aidc.scm index 77db0ac9fc..b68f2137be 100644 --- a/gnu/packages/aidc.scm +++ b/gnu/packages/aidc.scm @@ -4,6 +4,7 @@ ;;; Copyright =A9 2017 Hartmut Goebel ;;; Copyright =A9 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright =A9 2019 Guillaume Le Vaillant +;;; Copyright =A9 2020 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -154,3 +155,41 @@ For application developers, language bindings are incl= uded for C, C++ and Python as well as GUI widgets for GTK and Qt.") (home-page "https://github.com/mchehab/zbar") (license license:lgpl2.1+))) + +(define-public qrcodegen-cpp + ;; Currently this project's installation mechanism only exists as a GitH= ub + ;; pull request, so we build from a recent commit that the proposed patch + ;; applies to. + (let ((commit "6ea933f1596d818bd21e9a6b8d2e851fb8b4bcf1") + (revision "0")) + (package + (name "qrcodegen-cpp") + (version (git-version "1.5.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nayuki/QR-Code-generator.g= it") + (commit commit))) + (file-name (git-file-name name version)) + (patches (search-patches "qrcodegen-cpp-make-install.patch= ")) + (sha256 + (base32 + "19fcwqmfk2n9p2n01dv2j4x2y2mqip0j1wbmfbxjp34rqkjwcwxm"))= )) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no test suite + #:make-flags + (list (string-append "PREFIX=3D" (assoc-ref %outputs "out"))) + #:phases + (modify-phases %standard-phases + (delete 'configure) ; No ./configure script + ;; Only build the C++ variant. + (add-after 'unpack 'chdir + (lambda _ + (chdir "cpp") + #t))))) + (synopsis "QR Code generator library") + (description "qrcodegen-cpp is a QR code generator library in C++. = The +project also offers Java, Javascript, Python, C, and Rust implementations.= ") + (home-page "https://www.nayuki.io/page/qr-code-generator-library") + (license license:expat)))) diff --git a/gnu/packages/patches/qrcodegen-cpp-make-install.patch b/gnu/pa= ckages/patches/qrcodegen-cpp-make-install.patch new file mode 100644 index 0000000000..4da619d3c8 --- /dev/null +++ b/gnu/packages/patches/qrcodegen-cpp-make-install.patch @@ -0,0 +1,448 @@ +Make the library installable. Patch copied from pull request: + +https://github.com/nayuki/QR-Code-generator/pull/72 + +From 1625fc1665e1f83eb73c0f5670dcfda96dc0b3e4 Mon Sep 17 00:00:00 2001 +From: =3D?UTF-8?q?Tom=3DC3=3DA1=3DC5=3DA1=3D20Chv=3DC3=3DA1tal?=3D +Date: Tue, 3 Dec 2019 11:57:24 +0100 +Subject: [PATCH 1/7] Do not append to C/XX/FLAGS but just set them if not + defined already + +--- + c/Makefile | 2 +- + cpp/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/c/Makefile b/c/Makefile +index fd0c367..b27449c 100644 +--- a/c/Makefile ++++ b/c/Makefile +@@ -29,7 +29,7 @@ + # - CFLAGS: Any extra user-specified compiler flags (can be blank). +=20 + # Recommended compiler flags: +-CFLAGS +=3D -std=3Dc99 -O ++CFLAGS ?=3D -std=3Dc99 -O +=20 + # Extra flags for diagnostics: + # CFLAGS +=3D -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion = -fsanitize=3Dundefined,address +diff --git a/cpp/Makefile b/cpp/Makefile +index f83c512..666f976 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -29,7 +29,7 @@ + # - CXXFLAGS: Any extra user-specified compiler flags (can be blank). +=20 + # Recommended compiler flags: +-CXXFLAGS +=3D -std=3Dc++11 -O ++CXXFLAGS ?=3D -std=3Dc++11 -O +=20 + # Extra flags for diagnostics: + # CXXFLAGS +=3D -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversio= n -fsanitize=3Dundefined,address + +From 2e496a0f59d5c6782c1e3e2a3ca36d0272b384f3 Mon Sep 17 00:00:00 2001 +From: =3D?UTF-8?q?Tom=3DC3=3DA1=3DC5=3DA1=3D20Chv=3DC3=3DA1tal?=3D +Date: Tue, 3 Dec 2019 11:59:59 +0100 +Subject: [PATCH 2/7] Make use of -fPIC parameter when building' + +--- + c/Makefile | 2 +- + cpp/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/c/Makefile b/c/Makefile +index b27449c..bf79462 100644 +--- a/c/Makefile ++++ b/c/Makefile +@@ -77,7 +77,7 @@ $(LIBFILE): $(LIBOBJ) +=20 + # Object files + %.o: %.c .deps/timestamp +- $(CC) $(CFLAGS) -c -o $@ -MMD -MF .deps/$*.d $< ++ $(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $< +=20 + # Have a place to store header dependencies automatically generated by co= mpiler + .deps/timestamp: +diff --git a/cpp/Makefile b/cpp/Makefile +index 666f976..f37cf66 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -73,7 +73,7 @@ $(LIBFILE): $(LIBOBJ) +=20 + # Object files + %.o: %.cpp .deps/timestamp +- $(CXX) $(CXXFLAGS) -c -o $@ -MMD -MF .deps/$*.d $< ++ $(CXX) $(CXXFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $< +=20 + # Have a place to store header dependencies automatically generated by co= mpiler + .deps/timestamp: + +From 29489faaa5a3b014c5c2d95ca34033df470de73c Mon Sep 17 00:00:00 2001 +From: =3D?UTF-8?q?Tom=3DC3=3DA1=3DC5=3DA1=3D20Chv=3DC3=3DA1tal?=3D +Date: Tue, 3 Dec 2019 12:07:19 +0100 +Subject: [PATCH 3/7] Generate both shared and static libraries + +--- + c/Makefile | 14 ++++++++++---- + cpp/Makefile | 14 ++++++++++---- + 2 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/c/Makefile b/c/Makefile +index bf79462..38eda2d 100644 +--- a/c/Makefile ++++ b/c/Makefile +@@ -51,16 +51,19 @@ CFLAGS ?=3D -std=3Dc99 -O + # ---- Targets to build ---- +=20 + LIB =3D qrcodegen +-LIBFILE =3D lib$(LIB).a ++ARFILE =3D lib$(LIB).a ++LIBFILE =3D lib$(LIB).so ++# Bump the soname number when the ABI changes and gets incompatible ++SO_NAME =3D $(LIBFILE).1 + LIBOBJ =3D qrcodegen.o + MAINS =3D qrcodegen-demo qrcodegen-test qrcodegen-worker +=20 + # Build all binaries +-all: $(LIBFILE) $(MAINS) ++all: $(LIBFILE) $(ARFILE) $(MAINS) +=20 + # Delete build output + clean: +- rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=3D.o) $(MAINS) ++ rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=3D.o) $(MAINS) + rm -rf .deps +=20 + # Executable files +@@ -72,9 +75,12 @@ qrcodegen-test: qrcodegen-test.c $(LIBOBJ:%.o=3D%.c) + $(CC) $(CFLAGS) -DQRCODEGEN_TEST -o $@ $^ +=20 + # The library +-$(LIBFILE): $(LIBOBJ) ++$(ARFILE): $(LIBOBJ) + $(AR) -crs $@ -- $^ +=20 ++$(LIBFILE): $(LIBOBJ) ++ $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^ ++ + # Object files + %.o: %.c .deps/timestamp + $(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $< +diff --git a/cpp/Makefile b/cpp/Makefile +index f37cf66..606cdad 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -51,16 +51,19 @@ CXXFLAGS ?=3D -std=3Dc++11 -O + # ---- Targets to build ---- +=20 + LIB =3D qrcodegen +-LIBFILE =3D lib$(LIB).a ++ARFILE =3D lib$(LIB).a ++LIBFILE =3D lib$(LIB).so ++# Bump the soname number when the ABI changes and gets incompatible ++SO_NAME =3D $(LIBFILE).1 + LIBOBJ =3D QrCode.o + MAINS =3D QrCodeGeneratorDemo QrCodeGeneratorWorker +=20 + # Build all binaries +-all: $(LIBFILE) $(MAINS) ++all: $(LIBFILE) $(ARFILE) $(MAINS) +=20 + # Delete build output + clean: +- rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=3D.o) $(MAINS) ++ rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=3D.o) $(MAINS) + rm -rf .deps +=20 + # Executable files +@@ -68,9 +71,12 @@ clean: + $(CXX) $(CXXFLAGS) -o $@ $< -L . -l $(LIB) +=20 + # The library +-$(LIBFILE): $(LIBOBJ) ++$(ARFILE): $(LIBOBJ) + $(AR) -crs $@ -- $^ +=20 ++$(LIBFILE): $(LIBOBJ) ++ $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^ ++ + # Object files + %.o: %.cpp .deps/timestamp + $(CXX) $(CXXFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $< + +From 064f38d6a8dc0a457728a47ee4ca1e927e46d5ec Mon Sep 17 00:00:00 2001 +From: =3D?UTF-8?q?Tom=3DC3=3DA1=3DC5=3DA1=3D20Chv=3DC3=3DA1tal?=3D +Date: Tue, 3 Dec 2019 12:45:34 +0100 +Subject: [PATCH 4/7] Create install targets for C and CPP + +--- + c/Makefile | 26 ++++++++++++++++++++++++++ + cpp/Makefile | 27 +++++++++++++++++++++++++++ + 2 files changed, 53 insertions(+) + +diff --git a/c/Makefile b/c/Makefile +index 38eda2d..7521944 100644 +--- a/c/Makefile ++++ b/c/Makefile +@@ -34,6 +34,8 @@ CFLAGS ?=3D -std=3Dc99 -O + # Extra flags for diagnostics: + # CFLAGS +=3D -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion = -fsanitize=3Dundefined,address +=20 ++# Version information ++VERSION =3D 1.5.0 +=20 + # ---- Controlling make ---- +=20 +@@ -55,9 +57,15 @@ ARFILE =3D lib$(LIB).a + LIBFILE =3D lib$(LIB).so + # Bump the soname number when the ABI changes and gets incompatible + SO_NAME =3D $(LIBFILE).1 ++REAL_NAME =3D $(LIBFILE).$(VERSION) ++HEADERS =3D qrcodegen.h + LIBOBJ =3D qrcodegen.o + MAINS =3D qrcodegen-demo qrcodegen-test qrcodegen-worker +=20 ++# define paths to install ++INCLUDEDIR ?=3D $(DESTDIR)/usr/include/qrcodegen ++LIBDIR ?=3D $(DESTDIR)/usr/lib ++ + # Build all binaries + all: $(LIBFILE) $(ARFILE) $(MAINS) +=20 +@@ -66,6 +74,24 @@ clean: + rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=3D.o) $(MAINS) + rm -rf .deps +=20 ++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) -o $@ $< -L . -l $(LIB) +diff --git a/cpp/Makefile b/cpp/Makefile +index 606cdad..3271bd8 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -34,6 +34,8 @@ CXXFLAGS ?=3D -std=3Dc++11 -O + # Extra flags for diagnostics: + # CXXFLAGS +=3D -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversio= n -fsanitize=3Dundefined,address +=20 ++# Version information ++VERSION =3D 1.5.0 +=20 + # ---- Controlling make ---- +=20 +@@ -55,9 +57,16 @@ ARFILE =3D lib$(LIB).a + LIBFILE =3D lib$(LIB).so + # Bump the soname number when the ABI changes and gets incompatible + SO_NAME =3D $(LIBFILE).1 ++REAL_NAME =3D $(LIBFILE).$(VERSION) ++HEADERS =3D QrCode.hpp + LIBOBJ =3D QrCode.o + MAINS =3D QrCodeGeneratorDemo QrCodeGeneratorWorker +=20 ++# define paths to install ++INCLUDEDIR ?=3D $(DESTDIR)/usr/include/qrcodegen ++LIBDIR ?=3D $(DESTDIR)/usr/lib ++ ++ + # Build all binaries + all: $(LIBFILE) $(ARFILE) $(MAINS) +=20 +@@ -66,6 +75,24 @@ clean: + rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=3D.o) $(MAINS) + rm -rf .deps +=20 ++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) -o $@ $< -L . -l $(LIB) + +From a635ff4654f94ab26b458c46a8841543e5bc8c67 Mon Sep 17 00:00:00 2001 +From: =3D?UTF-8?q?Tom=3DC3=3DA1=3DC5=3DA1=3D20Chv=3DC3=3DA1tal?=3D +Date: Tue, 3 Dec 2019 12:50:39 +0100 +Subject: [PATCH 5/7] Rename cpp library to qrcodegencpp to avoid conflict + +--- + cpp/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cpp/Makefile b/cpp/Makefile +index 3271bd8..42fa4ff 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -52,7 +52,7 @@ VERSION =3D 1.5.0 +=20 + # ---- Targets to build ---- +=20 +-LIB =3D qrcodegen ++LIB =3D qrcodegencpp + ARFILE =3D lib$(LIB).a + LIBFILE =3D lib$(LIB).so + # Bump the soname number when the ABI changes and gets incompatible + +From c073e7dfad6454dfd725a69c347f8272d29ea41c Mon Sep 17 00:00:00 2001 +From: =3D?UTF-8?q?Tom=3DC3=3DA1=3DC5=3DA1=3D20Chv=3DC3=3DA1tal?=3D +Date: Tue, 7 Jan 2020 09:18:59 +0100 +Subject: [PATCH 6/7] Add PREFIX variable and few minor fixes from code rev= iew + +--- + c/Makefile | 9 +++++---- + cpp/Makefile | 9 +++++---- + 2 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/c/Makefile b/c/Makefile +index 7521944..874933e 100644 +--- a/c/Makefile ++++ b/c/Makefile +@@ -29,7 +29,7 @@ + # - CFLAGS: Any extra user-specified compiler flags (can be blank). +=20 + # Recommended compiler flags: +-CFLAGS ?=3D -std=3Dc99 -O ++CFLAGS +=3D -std=3Dc99 +=20 + # Extra flags for diagnostics: + # CFLAGS +=3D -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion = -fsanitize=3Dundefined,address +@@ -63,8 +63,9 @@ LIBOBJ =3D qrcodegen.o + MAINS =3D qrcodegen-demo qrcodegen-test qrcodegen-worker +=20 + # define paths to install +-INCLUDEDIR ?=3D $(DESTDIR)/usr/include/qrcodegen +-LIBDIR ?=3D $(DESTDIR)/usr/lib ++PREFIX ?=3D /usr/local ++INCLUDEDIR ?=3D $(DESTDIR)$(PREFIX)/include/qrcodegen ++LIBDIR ?=3D $(DESTDIR)$(PREFIX)/lib +=20 + # Build all binaries + all: $(LIBFILE) $(ARFILE) $(MAINS) +@@ -105,7 +106,7 @@ $(ARFILE): $(LIBOBJ) + $(AR) -crs $@ -- $^ +=20 + $(LIBFILE): $(LIBOBJ) +- $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^ ++ $(CC) $(CFLAGS) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^ +=20 + # Object files + %.o: %.c .deps/timestamp +diff --git a/cpp/Makefile b/cpp/Makefile +index 42fa4ff..f8d9b7f 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -29,7 +29,7 @@ + # - CXXFLAGS: Any extra user-specified compiler flags (can be blank). +=20 + # Recommended compiler flags: +-CXXFLAGS ?=3D -std=3Dc++11 -O ++CXXFLAGS +=3D -std=3Dc++11 +=20 + # Extra flags for diagnostics: + # CXXFLAGS +=3D -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversio= n -fsanitize=3Dundefined,address +@@ -63,8 +63,9 @@ LIBOBJ =3D QrCode.o + MAINS =3D QrCodeGeneratorDemo QrCodeGeneratorWorker +=20 + # define paths to install +-INCLUDEDIR ?=3D $(DESTDIR)/usr/include/qrcodegen +-LIBDIR ?=3D $(DESTDIR)/usr/lib ++PREFIX ?=3D /usr/local ++INCLUDEDIR ?=3D $(DESTDIR)$(PREFIX)/include/qrcodegen ++LIBDIR ?=3D $(DESTDIR)$(PREFIX)/lib +=20 +=20 + # Build all binaries +@@ -102,7 +103,7 @@ $(ARFILE): $(LIBOBJ) + $(AR) -crs $@ -- $^ +=20 + $(LIBFILE): $(LIBOBJ) +- $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^ ++ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^ +=20 + # Object files + %.o: %.cpp .deps/timestamp + +From b43c1de5cc874535a7f549cef437f6849528e455 Mon Sep 17 00:00:00 2001 +From: =3D?UTF-8?q?Tom=3DC3=3DA1=3DC5=3DA1=3D20Chv=3DC3=3DA1tal?=3D +Date: Tue, 7 Jan 2020 13:12:32 +0100 +Subject: [PATCH 7/7] Install static and shared library as an executable + +--- + c/Makefile | 4 ++-- + cpp/Makefile | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/c/Makefile b/c/Makefile +index 874933e..631cc71 100644 +--- a/c/Makefile ++++ b/c/Makefile +@@ -77,7 +77,7 @@ clean: +=20 + install-shared: $(LIBFILE) + install -d $(LIBDIR) || true +- install -m 0644 $(LIBFILE) $(LIBDIR)/$(REAL_NAME) ++ install -m 0755 $(LIBFILE) $(LIBDIR)/$(REAL_NAME) + rm -f $(LIBDIR)/$(SO_NAME) + ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME) + rm -f $(LIBDIR)/$(LIBFILE) +@@ -85,7 +85,7 @@ install-shared: $(LIBFILE) +=20 + install-static: $(ARFILE) + install -d $(LIBDIR) || true +- install -m 0644 $(ARFILE) $(LIBDIR)/$(ARFILE) ++ install -m 0755 $(ARFILE) $(LIBDIR)/$(ARFILE) +=20 + install-header: $(HEADERS) + install -d $(INCLUDEDIR) || true +diff --git a/cpp/Makefile b/cpp/Makefile +index f8d9b7f..bbd861e 100644 +--- a/cpp/Makefile ++++ b/cpp/Makefile +@@ -78,7 +78,7 @@ clean: +=20 + install-shared: $(LIBFILE) + install -d $(LIBDIR) || true +- install -m 0644 $(LIBFILE) $(LIBDIR)/$(REAL_NAME) ++ install -m 0755 $(LIBFILE) $(LIBDIR)/$(REAL_NAME) + rm -f $(LIBDIR)/$(SO_NAME) + ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME) + rm -f $(LIBDIR)/$(LIBFILE) +@@ -86,7 +86,7 @@ install-shared: $(LIBFILE) +=20 + install-static: $(ARFILE) + install -d $(LIBDIR) || true +- install -m 0644 $(ARFILE) $(LIBDIR)/$(ARFILE) ++ install -m 0755 $(ARFILE) $(LIBDIR)/$(ARFILE) +=20 + install-header: $(HEADERS) + install -d $(INCLUDEDIR) || true --=20 2.25.0 --qDbXVdCdHGoSgWSk-- --gj572EiMnwbLXET9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAl40clQACgkQJkb6MLrK fwjWRxAA0IY05IJe8VzBcDuid3/n95Nh9K5/z7RnOAAgWuiNKBR42GbHQZoSY7O1 XnfmcS3yeKvO7FZ+PQ9SS/kKD6O7XPQUg/cAmEJkika1Rtyz4wFRsYvYn6jEKHPQ bGU7Yn2m/HZn7UiCko2Vz3SnYJ+tKnHwMQZzKVEh2/ymIF6ym428QEwg8Ej2CiCS gHPaUE7EnFK4Ia+9at59uw/RWnQmcWFvatpV0n9uXdW/a7rGC1eSEFRrxF1tsUvv 34g6eqwPl/4uUsB8VEDIEZqXVN64h24/Qi/EHDw1XvvkTm3hUCJ/WPdqsBe9yTff ziybKWWKvIgWuDYQUroxjeGYCvS+JFOAR0Osss63eYW1Eh/M1El9yvSKqNQLHLlK oNQsPA9eIcsM83Di6h5AlC6Tw6E5pLEepTXai544L4v8rLH8znuD4LieKv9sqcDx YeACwYAgIMZU8xxCcUsuAoaCGhs9UwILSxtxWabEgcLiaFEWPfoDOAPl4/lkE6Jo +mZX0SdiLskN4xELqQJGqQ8elTpIi1eIAKRqFthztODqADdgH8yktF66LA3JSl2r pMn/U6OVDou2FeGHCKgewEICuz+ir7dh86A3TqGwOVzOv7Aai3h7Mb6SGyGsjKb2 FHrgIm3bm2uzPTOgA0KhPS7p9B1lAmnW6j0LCewNl/Bs20MYA2o= =rBlh -----END PGP SIGNATURE----- --gj572EiMnwbLXET9--