diff options
Diffstat (limited to 'recipes/qrencode.recipe')
-rw-r--r-- | recipes/qrencode.recipe | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/recipes/qrencode.recipe b/recipes/qrencode.recipe new file mode 100644 index 00000000..b87c5b8e --- /dev/null +++ b/recipes/qrencode.recipe @@ -0,0 +1,59 @@ +# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
+from cerbero.tools.libtool import LibtoolLibrary
+
+
+class Recipe(recipe.Recipe):
+
+ name = 'qrencode'
+ version = '4.1.1'
+ licenses = [{License.LGPLv2_1Plus: ['COPYING']}]
+ stype = SourceType.TARBALL
+ btype = BuildType.CMAKE
+ library_type = LibraryType.STATIC
+ cmake_generator = 'ninja'
+ can_msvc = True
+ url = 'https://fukuchi.org/works/qrencode/%(name)s-%(version)s.tar.gz'
+ tarball_checksum = 'da448ed4f52aba6bcb0cd48cac0dd51b8692bccc4cd127431402fca6f8171e8e'
+
+ # WITH_TOOLS needs getopt
+ configure_options = ' -DWITH_TOOLS=OFF -DWITHOUT_PNG=ON '
+
+ files_libs = ['libqrencode']
+ files_devel = ['include/qrencode.h', '%(libdir)s/pkgconfig/libqrencode.pc']
+
+ async def configure(self):
+ if self.config.target_platform == Platform.WINDOWS:
+ system_name = 'Windows'
+ elif self.config.target_platform == Platform.LINUX:
+ system_name = 'Linux'
+ elif self.config.target_platform == Platform.DARWIN:
+ system_name = 'Darwin'
+ elif self.config.target_platform == Platform.IOS:
+ system_name = 'iOS'
+
+ # We always need a toolchain file because CMakeLists.txt requires these values to be set.
+ # The Android NDK provides one, so we use that as-is.
+ # This recipe uses these to decide which cpuinfo implementation to use:
+ # https://github.com/libjpeg-turbo/libjpeg-turbo/blob/3.0.3/CMakeLists.txt#L92
+ if self.config.target_platform == Platform.ANDROID:
+ arch = self.config.target_arch
+ if self.config.target_arch == Architecture.ARMv7:
+ arch = 'armeabi-v7a'
+ elif self.config.target_arch == Architecture.ARM64:
+ arch = 'arm64-v8a'
+ self.configure_options += f" -DCMAKE_TOOLCHAIN_FILE={self.config.env['ANDROID_NDK_HOME']}/build/cmake/android.toolchain.cmake -DANDROID_ABI={arch}"
+ else:
+ with open(f'{self.config_src_dir}/toolchain.cmake', 'w') as f:
+ f.write(f'set(CMAKE_SYSTEM_NAME {system_name})\n')
+ f.write(f'set(CMAKE_SYSTEM_PROCESSOR {self.config.target_arch})\n')
+ self.configure_options += f' -DCMAKE_TOOLCHAIN_FILE={self.config_src_dir}/toolchain.cmake'
+
+ await super().configure()
+
+ def post_install(self):
+ # Meson does not generate la files
+ libtool_la = LibtoolLibrary('libqrencode', None, None, None,
+ self.config.libdir, self.config.target_platform,
+ deps=[])
+ libtool_la.save()
+ super().post_install()
|