aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Dufour <benoit.dufour@mail.com>2023-10-31 16:12:59 -0400
committerBenoît Dufour <benoit.dufour@mail.com>2023-10-31 16:13:55 -0400
commitfa3a33cfcec26ec83b742c4bb4db6f5dcfdeae33 (patch)
treed256c3897f0af0e4f82c4c5d3e4a189797dcb5fd /dev-libs/qrcodegen
parentgui-apps/eww: take out rust-1.70.0 version (diff)
downloadguru-fa3a33cfcec26ec83b742c4bb4db6f5dcfdeae33.tar.gz
guru-fa3a33cfcec26ec83b742c4bb4db6f5dcfdeae33.tar.bz2
guru-fa3a33cfcec26ec83b742c4bb4db6f5dcfdeae33.zip
dev-libs/qrcodegen: new package, add 1.8.0
Signed-off-by: Benoît Dufour <benoit.dufour@mail.com>
Diffstat (limited to 'dev-libs/qrcodegen')
-rw-r--r--dev-libs/qrcodegen/Manifest1
-rw-r--r--dev-libs/qrcodegen/files/c_makefile_generate_libraries.patch73
-rw-r--r--dev-libs/qrcodegen/files/cpp_makefile_generate_libraries.patch70
-rw-r--r--dev-libs/qrcodegen/qrcodegen-1.8.0.ebuild46
4 files changed, 190 insertions, 0 deletions
diff --git a/dev-libs/qrcodegen/Manifest b/dev-libs/qrcodegen/Manifest
new file mode 100644
index 000000000..203ac5155
--- /dev/null
+++ b/dev-libs/qrcodegen/Manifest
@@ -0,0 +1 @@
+DIST qrcodegen-1.8.0.tar.gz 193288 BLAKE2B 2e511baf35fbfdb71ad5e2dc91c1400a113eb9bce51afa022c34b7ad7d3c9be4a862e2caaef89f517fbbf29879223fb078c88fdec27d6a876126c798ac6772c6 SHA512 0cdf0873e71aed124fc7357da86fb26f23fd26432f94c9752fa5a044085b26e5aece2115134d0e50213ff24be7c55818e7dec31205a68751065bc82ab0c2c6ac
diff --git a/dev-libs/qrcodegen/files/c_makefile_generate_libraries.patch b/dev-libs/qrcodegen/files/c_makefile_generate_libraries.patch
new file mode 100644
index 000000000..b21b820f8
--- /dev/null
+++ b/dev-libs/qrcodegen/files/c_makefile_generate_libraries.patch
@@ -0,0 +1,73 @@
+diff --git a/c/Makefile b/c/Makefile
+index 661b1f7..7a507b2 100644
+--- a/c/Makefile
++++ b/c/Makefile
+@@ -51,18 +51,47 @@ CFLAGS += -std=c99 -O
+ # ---- Targets to build ----
+
+ LIB = qrcodegen
+-LIBFILE = lib$(LIB).a
++LIBFILE = lib$(LIB).so
++LIBFILE = lib$(LIB).so
++ARFILE = lib$(LIB).a
++SO_NAME = $(LIBFILE).1
++REAL_NAME = $(LIBFILE).$(VERSION)
++HEADERS = qrcodegen.h
+ LIBOBJ = qrcodegen.o
+ MAINS = qrcodegen-demo qrcodegen-test
+
++MULTIARCH ?= $(shell $(CC) --print-multiarch)
++
++INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
++LIBDIR ?= $(DESTDIR)/usr/lib/$(MULTIARCH)
++
+ # 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 procedure
++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 $(LIBOBJ:%.o=%.c)
+ $(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:
diff --git a/dev-libs/qrcodegen/files/cpp_makefile_generate_libraries.patch b/dev-libs/qrcodegen/files/cpp_makefile_generate_libraries.patch
new file mode 100644
index 000000000..56cb4b23c
--- /dev/null
+++ b/dev-libs/qrcodegen/files/cpp_makefile_generate_libraries.patch
@@ -0,0 +1,70 @@
+diff --git a/cpp/Makefile b/cpp/Makefile
+index 57dc0bf..219f0b8 100644
+--- a/cpp/Makefile
++++ b/cpp/Makefile
+@@ -51,29 +51,60 @@ CXXFLAGS += -std=c++11 -O
+ # ---- Targets to build ----
+
+ LIB = qrcodegencpp
+-LIBFILE = lib$(LIB).a
++LIBFILE = lib$(LIB).so
++ARFILE = lib$(LIB).a
++SO_NAME = $(LIBFILE).1
++REAL_NAME = $(LIBFILE).$(VERSION)
++HEADERS = qrcodegen.hpp
+ LIBOBJ = qrcodegen.o
+ MAINS = QrCodeGeneratorDemo
+
++MULTIARCH ?= $(shell $(CC) --print-multiarch)
++
++INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
++LIBDIR ?= $(DESTDIR)/usr/lib/$(MULTIARCH)
++
+ # 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 procedure
++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)
++ $(CXX) -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:
diff --git a/dev-libs/qrcodegen/qrcodegen-1.8.0.ebuild b/dev-libs/qrcodegen/qrcodegen-1.8.0.ebuild
new file mode 100644
index 000000000..fd75a52bc
--- /dev/null
+++ b/dev-libs/qrcodegen/qrcodegen-1.8.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Forked from : https://github.com/gentoo-mirror/pg_overlay/blob/master/dev-libs/qrcodegen
+
+EAPI=8
+
+DESCRIPTION="High-quality QR Code generator library in Java, TypeScript/JavaScript, Python, C++, C, Rust."
+HOMEPAGE="https://www.nayuki.io/page/qr-code-generator-library"
+SRC_URI="https://github.com/nayuki/QR-Code-generator/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/QR-Code-generator-${PV}
+
+PATCHES=( "${FILESDIR}/c_makefile_generate_libraries.patch" )
+PATCHES+=( "${FILESDIR}/cpp_makefile_generate_libraries.patch" )
+
+src_compile() {
+ pushd c
+ emake
+ popd
+
+ pushd cpp
+ emake
+ popd
+}
+
+src_install() {
+ pushd c
+ emake DESTDIR=${D} install-header
+ emake DESTDIR=${D} LIBDIR=${D}/usr/$(get_libdir) install-shared
+ popd
+
+ pushd cpp
+ emake DESTDIR=${D} install-header
+ emake DESTDIR=${D} LIBDIR=${D}/usr/$(get_libdir) install-shared
+ popd
+}