summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-10-31 05:59:33 (GMT)
committerTony Theodore <tonyt@logyst.com>2017-10-31 06:02:42 (GMT)
commita9982192ff679f20bfc8f0038eb252339d017f3a (patch)
treef2accee59e42a8b9cbe318a6171970504ebbf3ec
parent8ad7be0160d3f3d541d7901d6fbd7e1efa095f21 (diff)
downloadmxe-a9982192ff679f20bfc8f0038eb252339d017f3a.zip
mxe-a9982192ff679f20bfc8f0038eb252339d017f3a.tar.gz
mxe-a9982192ff679f20bfc8f0038eb252339d017f3a.tar.bz2
qrencode: rename to libqrencode, update, and switch to cmake
- autotools build didn't produce shared libs - libpng and sdl are only required for tools/tests - build test using supplied pkg-config file
-rw-r--r--src/libqrencode-1-fixes.patch26
-rw-r--r--src/libqrencode.mk25
-rw-r--r--src/qrencode.mk40
3 files changed, 51 insertions, 40 deletions
diff --git a/src/libqrencode-1-fixes.patch b/src/libqrencode-1-fixes.patch
new file mode 100644
index 0000000..1352760
--- /dev/null
+++ b/src/libqrencode-1-fixes.patch
@@ -0,0 +1,26 @@
+This file is part of MXE. See LICENSE.md for licensing information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tony Theodore <tonyt@logyst.com>
+Date: Tue, 31 Oct 2017 16:56:24 +1100
+Subject: [PATCH] install *.dll to bin
+
+taken from:
+https://github.com/fukuchi/libqrencode/issues/112
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1111111..2222222 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -120,7 +120,8 @@ configure_file(libqrencode.pc.in libqrencode.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qrencode.1 DESTINATION share/man/man1)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libqrencode.pc DESTINATION lib/pkgconfig)
+ install(FILES qrencode.h DESTINATION include)
+-install(TARGETS qrencode DESTINATION lib)
++install(TARGETS qrencode DESTINATION lib
++ RUNTIME DESTINATION bin)
+
+ ## Build utility tools
+ if(WITH_TOOLS AND TARGET PNG::PNG)
diff --git a/src/libqrencode.mk b/src/libqrencode.mk
new file mode 100644
index 0000000..0cf4632
--- /dev/null
+++ b/src/libqrencode.mk
@@ -0,0 +1,25 @@
+# This file is part of MXE. See LICENSE.md for licensing information.
+
+PKG := libqrencode
+$(PKG)_WEBSITE := https://fukuchi.org/works/qrencode/
+$(PKG)_DESCR := a fast and compact QR Code encoding library
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 4.0.0
+$(PKG)_CHECKSUM := c2c8a8110354463a3332cb48abf8581c8d94136af4dc1418f891cc9c7719e3c1
+$(PKG)_GH_CONF := fukuchi/libqrencode,v
+$(PKG)_DEPS := gcc pthreads
+
+define $(PKG)_BUILD
+ # build and install the library
+ cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)' \
+ -DWITH_TESTS=OFF \
+ -DWITH_TOOLS=OFF
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install
+
+ # compile test
+ '$(TARGET)-gcc' \
+ -W -Wall -pedantic \
+ '$(SOURCE_DIR)/tests/prof_qrencode.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
+endef
diff --git a/src/qrencode.mk b/src/qrencode.mk
deleted file mode 100644
index 2b9570c..0000000
--- a/src/qrencode.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# This file is part of MXE. See LICENSE.md for licensing information.
-
-PKG := qrencode
-$(PKG)_WEBSITE := https://fukuchi.org/works/qrencode/
-$(PKG)_DESCR := libqrencode
-$(PKG)_IGNORE :=
-$(PKG)_VERSION := 3.4.4
-$(PKG)_CHECKSUM := e794e26a96019013c0e3665cb06b18992668f352c5553d0a553f5d144f7f2a72
-$(PKG)_SUBDIR := qrencode-$($(PKG)_VERSION)
-$(PKG)_FILE := qrencode-$($(PKG)_VERSION).tar.gz
-$(PKG)_URL := https://fukuchi.org/works/qrencode/qrencode-$($(PKG)_VERSION).tar.gz
-$(PKG)_DEPS := gcc libpng pthreads sdl
-
-define $(PKG)_UPDATE
- $(WGET) -q -O- 'https://fukuchi.org/works/qrencode/index.html' | \
- grep 'qrencode-' | \
- $(SED) -n 's,.*qrencode-\([0-9][^>]*\)\.tar.*,\1,p' | \
- $(SORT) -Vr | \
- head -1
-endef
-
-define $(PKG)_BUILD
- cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
- CFLAGS='-pthread -lpng' \
- LDFLAGS='-L$(PREFIX)/$(TARGET)/lib' \
- --without-tools \
- --with-tests \
- $(MXE_CONFIGURE_OPTS) \
- CONFIG_SHELL=$(SHELL)
- $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
- $(MAKE) -C '$(BUILD_DIR)' -j 1 install
-
- # create pkg-config files
- $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
- (echo 'Name: $(PKG)'; \
- echo 'Version: $($(PKG)_VERSION)'; \
- echo 'Description: libqrencode'; \
- echo 'Libs: -lqrencode -lpng';) \
- > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'
-endef