Skip to content

Commit

Permalink
Merge bitcoin#29725: depends: build libqrencode with CMake
Browse files Browse the repository at this point in the history
007ea32 depends: switch to building libqrencode with CMake (fanquake)
884330c guix: make cmake-minimal a global requirement (fanquake)

Pull request description:

  Switch to building libqrencode with CMake. Note that upstream (https://github.com/fukuchi/libqrencode) hasn't seen any activity for ~4 years, so the odds of getting anything upstream seems low, but I've made two minor changes to the source here, which I will PR in any case.

  From an initial look I couldn't find any significant difference between the Autotools and CMake produced libs. As part of this change we move cmake-minimal in Guix into the global package set.

ACKs for top commit:
  TheCharlatan:
    ACK 007ea32

Tree-SHA512: c784f790ddea958082c8ae96d3744bdf99331a8799765f9d44f00861b8e2cfcab1a88a3d64af5b10e51a8d5938d55eb6a3d271790b565e50492a39d00dc0e30f
  • Loading branch information
fanquake authored and UdjinM6 committed Sep 29, 2024
1 parent 1522896 commit ae6e0ad
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
3 changes: 2 additions & 1 deletion contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ parse, modify and abstract ELF, PE and MachO formats.")
zlib
(list zlib "static")
;; Build tools
cmake-minimal
gnu-make
libtool-2.4.7
autoconf-2.71
Expand All @@ -615,5 +616,5 @@ parse, modify and abstract ELF, PE and MachO formats.")
((string-contains target "-linux-")
(list (make-bitcoin-cross-toolchain target)))
((string-contains target "darwin")
(list clang-toolchain-10 binutils cmake-minimal xorriso python-signapple))
(list clang-toolchain-10 binutils xorriso python-signapple))
(else '())))))
16 changes: 7 additions & 9 deletions depends/packages/qrencode.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ $(package)_version=4.1.1
$(package)_download_path=https://fukuchi.org/works/qrencode/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=e455d9732f8041cf5b9c388e345a641fd15707860f928e94507b1961256a6923
$(package)_patches=cmake_fixups.patch

define $(package)_set_vars
$(package)_config_opts=--disable-shared --without-tools --without-tests --without-png
$(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts := -DWITH_TOOLS=NO -DWITH_TESTS=NO -DGPROF=OFF -DCOVERAGE=OFF
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE -DWITHOUT_PNG=ON
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_ICONV=TRUE
$(package)_cflags += -Wno-int-conversion -Wno-implicit-function-declaration
endef

define $(package)_preprocess_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub use
patch -p1 < $($(package)_patch_dir)/cmake_fixups.patch
endef


define $(package)_config_cmds
$($(package)_autoconf)
$($(package)_cmake) -S . -B .
endef

define $(package)_build_cmds
Expand All @@ -26,7 +28,3 @@ endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
rm lib/*.la
endef
23 changes: 23 additions & 0 deletions depends/patches/qrencode/cmake_fixups.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake: set minimum version to 3.5

Correct some dev warning output.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 773e037..a558145 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1.0)
+cmake_minimum_required(VERSION 3.5)

project(QRencode VERSION 4.1.1 LANGUAGES C)

@@ -20,7 +20,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads)
find_package(PNG)
-find_package(Iconv)
+find_package(ICONV)

if(CMAKE_USE_PTHREADS_INIT)
add_definitions(-DHAVE_LIBPTHREAD=1)

0 comments on commit ae6e0ad

Please sign in to comment.