[packages/qrcodegen] Initial

arekm arekm at pld-linux.org
Sat Aug 22 22:53:13 CEST 2026


commit ebdba1aea9c5064b97c118f0a530554880a5012d
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Aug 22 22:53:00 2026 +0200

    Initial

 qrcodegen-shared.patch |  94 +++++++++++++++++++++++++++++++++++++++++++
 qrcodegen.spec         | 106 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 200 insertions(+)
---
diff --git a/qrcodegen.spec b/qrcodegen.spec
new file mode 100644
index 0000000..0ef61e6
--- /dev/null
+++ b/qrcodegen.spec
@@ -0,0 +1,106 @@
+#
+# Conditional build:
+%bcond_without	static_libs	# static library
+%bcond_without	tests		# test suite
+#
+Summary:	QR Code generator library
+Summary(pl.UTF-8):	Biblioteka generująca kody QR
+Name:		qrcodegen
+Version:	1.8.0
+Release:	1
+License:	MIT
+Group:		Libraries
+Source0:	https://github.com/nayuki/QR-Code-generator/archive/v%{version}/QR-Code-generator-%{version}.tar.gz
+# Source0-md5:	9fb957a2d5dd01a6f5c0176ec1d92cd0
+Patch0:		%{name}-shared.patch
+URL:		https://www.nayuki.io/page/qr-code-generator-library
+BuildRequires:	rpm-build >= 4.6
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Nayuki's QR Code generator library for C. It generates QR Code symbols
+from text or binary data, supports all 40 versions and all 4 error
+correction levels, and covers the numeric, alphanumeric, byte and ECI
+segment modes.
+
+%description -l pl.UTF-8
+Biblioteka Nayukiego do generowania kodów QR, napisana w C. Tworzy
+symbole kodu QR z tekstu lub danych binarnych, obsługuje wszystkie 40
+wersji oraz wszystkie 4 poziomy korekcji błędów, a także tryby
+segmentów: numeryczny, alfanumeryczny, bajtowy i ECI.
+
+%package devel
+Summary:	Header file for qrcodegen library
+Summary(pl.UTF-8):	Plik nagłówkowy biblioteki qrcodegen
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Header file for qrcodegen library.
+
+%description devel -l pl.UTF-8
+Plik nagłówkowy biblioteki qrcodegen.
+
+%package static
+Summary:	Static qrcodegen library
+Summary(pl.UTF-8):	Statyczna biblioteka qrcodegen
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static qrcodegen library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka qrcodegen.
+
+%prep
+%setup -q -n QR-Code-generator-%{version}
+%patch -P0 -p1
+
+%build
+%{__make} -C c \
+	CC="%{__cc}" \
+	CFLAGS="%{rpmcflags} %{rpmcppflags} -std=c99" \
+	LDFLAGS="%{rpmldflags}" \
+	LIBDIR=%{_libdir} \
+	VERSION=%{version}
+
+%if %{with tests}
+c/qrcodegen-test
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C c install \
+	DESTDIR=$RPM_BUILD_ROOT \
+	LIBDIR=%{_libdir} \
+	VERSION=%{version}
+
+%if %{without static_libs}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib%{name}.a
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc Readme.markdown
+%attr(755,root,root) %{_libdir}/lib%{name}.so.*.*.*
+%ghost %{_libdir}/lib%{name}.so.1
+
+%files devel
+%defattr(644,root,root,755)
+%{_libdir}/lib%{name}.so
+%{_includedir}/%{name}
+%{_pkgconfigdir}/%{name}.pc
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/lib%{name}.a
+%endif
diff --git a/qrcodegen-shared.patch b/qrcodegen-shared.patch
new file mode 100644
index 0000000..4f3657a
--- /dev/null
+++ b/qrcodegen-shared.patch
@@ -0,0 +1,94 @@
+--- QR-Code-generator-1.8.0.orig/c/Makefile	2022-04-17 06:14:51.000000000 +0200
++++ QR-Code-generator-1.8.0/c/Makefile	2026-08-22 21:58:14.909474530 +0200
+@@ -45,39 +45,68 @@
+ 
+ # Stuff concerning goals
+ .DEFAULT_GOAL = all
+-.PHONY: all clean
++.PHONY: all clean install
+ 
+ 
+ # ---- Targets to build ----
+ 
+ LIB = qrcodegen
+-LIBFILE = lib$(LIB).a
++ARFILE = lib$(LIB).a
++SOFILE = lib$(LIB).so
++SONAME = $(SOFILE).1
++SOREAL = $(SOFILE).$(VERSION)
++PCFILE = $(LIB).pc
+ LIBOBJ = qrcodegen.o
+ MAINS = qrcodegen-demo qrcodegen-test
+ 
++PREFIX ?= /usr
++LIBDIR ?= $(PREFIX)/lib
++INCLUDEDIR ?= $(PREFIX)/include/$(LIB)
++
+ # Build all binaries
+-all: $(LIBFILE) $(MAINS)
++all: $(SOFILE) $(ARFILE) $(PCFILE) $(MAINS)
+ 
+ # Delete build output
+ clean:
+-	rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
++	rm -f -- $(LIBOBJ) $(ARFILE) $(SOFILE) $(SONAME) $(SOREAL) $(PCFILE) $(MAINS:=.o) $(MAINS)
+ 	rm -rf .deps
+ 
++install: all
++	install -d $(DESTDIR)$(LIBDIR)/pkgconfig $(DESTDIR)$(INCLUDEDIR)
++	install -m 755 $(SOREAL) $(DESTDIR)$(LIBDIR)/
++	ln -sf $(SOREAL) $(DESTDIR)$(LIBDIR)/$(SONAME)
++	ln -sf $(SONAME) $(DESTDIR)$(LIBDIR)/$(SOFILE)
++	install -m 644 $(ARFILE) $(DESTDIR)$(LIBDIR)/
++	install -m 644 $(PCFILE) $(DESTDIR)$(LIBDIR)/pkgconfig/
++	install -m 644 qrcodegen.h $(DESTDIR)$(INCLUDEDIR)/
++
+ # Executable files
+-%: %.o $(LIBFILE)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)
++%: %.o $(SOFILE)
++	$(CC) $(CFLAGS) -o $@ $< -L . -l $(LIB) $(LDFLAGS)
+ 
+ # Special executable
+ qrcodegen-test: qrcodegen-test.c $(LIBOBJ:%.o=%.c)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -DQRCODEGEN_TEST -o $@ $^
++	$(CC) $(CFLAGS) -DQRCODEGEN_TEST -o $@ $^ $(LDFLAGS)
+ 
+-# The library
+-$(LIBFILE): $(LIBOBJ)
++# The shared library, with its development and runtime symlinks
++$(SOREAL): $(LIBOBJ)
++	$(CC) -shared -Wl,-soname,$(SONAME) $(CFLAGS) -o $@ $^ $(LDFLAGS)
++
++$(SOFILE): $(SOREAL)
++	ln -sf $(SOREAL) $(SONAME)
++	ln -sf $(SONAME) $@
++
++# The static library
++$(ARFILE): $(LIBOBJ)
+ 	$(AR) -crs $@ -- $^
+ 
++$(PCFILE): $(PCFILE).in
++	sed -e 's|@prefix@|$(PREFIX)|g' -e 's|@libdir@|$(LIBDIR)|g' \
++	    -e 's|@includedir@|$(INCLUDEDIR)|g' -e 's|@version@|$(VERSION)|g' $< >$@
++
+ # 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:
+--- QR-Code-generator-1.8.0.orig/c/qrcodegen.pc.in	1970-01-01 01:00:00.000000000 +0100
++++ QR-Code-generator-1.8.0/c/qrcodegen.pc.in	1970-01-01 01:00:00.000000000 +0100
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: qrcodegen
++Description: QR Code generator library (C version)
++Version: @version@
++URL: https://www.nayuki.io/page/qr-code-generator-library
++Libs: -L${libdir} -lqrcodegen
++Cflags: -I${includedir}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qrcodegen.git/commitdiff/ebdba1aea9c5064b97c118f0a530554880a5012d



More information about the pld-cvs-commit mailing list