Comments (5)
Here is my code snippet for doing this for iOS:
import subprocess
import distutils.dir_util
import os
def generate_fat_libs(root: str, archs: [str], output: str):
def get_lib_names(dir: str) -> [str]:
libs = []
for file in os.listdir(dir):
if file.endswith('.dylib') and not os.path.islink(dir + '/' + file):
libs.append(file)
if file.endswith('.a'):
libs.append(file)
return libs
def lipo(root: str, archs: [str], output: str, lib_name: str):
cmd = ['lipo', '-create']
for arch in archs:
cmd.append('{arch}/INSTALL/lib/{lib}'.format(arch=arch, lib=lib_name))
cmd.append('-output')
cmd.append('{output}/INSTALL/lib/{lib}'.format(output=output, lib=lib_name))
subprocess.run(cmd, cwd=root)
def copy_headers(root: str, arch: str, output: str):
source = '{root}/{arch}/INSTALL/include'.format(root=root, arch=arch)
destination = '{root}/{output}/INSTALL/include'.format(root=root, output=output)
distutils.dir_util.copy_tree(source, destination)
if len(archs) < 2:
return
subprocess.run(['mkdir', '-p', '{}/INSTALL/lib'.format(output)], cwd=root)
copy_headers(root, archs[0], output)
libs = get_lib_names('{}/{}/INSTALL/lib'.format(root, archs[0]))
for lib in libs:
lipo(root, archs, output, lib)
generate_fat_libs('/Users/chrisli/Developer/kiwix-build',
['BUILD_iOS_arm64', 'BUILD_iOS_armv7s', 'BUILD_iOS_x86_64'],
'BUILD_iOS_Shared')
from kiwix-build.
Not quite sure if this should be put in the kiwix-lib repo!?
from kiwix-build.
@automactic @mgautierfr status?
from kiwix-build.
not done. I still need to manually run the above script to generate a fat lib.
from kiwix-build.
@mgautierfr We definitly need to finish the ios/macos port of kiwixlib
from kiwix-build.
Related Issues (20)
- Update xapian version HOT 5
- Fix win32 cross-compilation when wine is installed on the system.
- Libzim releases include the full libicu data HOT 4
- Release native_static on macos fails to trigger workflow. HOT 5
- Last publication of kiwix-tools seems to not work on raspberryPi HOT 6
- Instruction to use kiwix-build seems wrong in the `README.md` HOT 1
- Build libzim & libkiwix for Android with debug symbol HOT 2
- Failed to build zim-tools on ubuntu22.04 (wsl) HOT 3
- Use libxapian 1.4.23 HOT 7
- Fix double publications of release archives
- Incorrect docker trigger on macOS HOT 2
- aarch64 bionic should not require GLIBCXX 3.4.26 and 3.4.29 HOT 8
- Update ICU to a more recent version. HOT 2
- Why compiling libkiwix for iOS/macOS does embeds the libzim? HOT 7
- Use latest/future version of aria2c HOT 2
- Fix cross_compilation environment setting.
- Last version of aria2 1.37.0 doesn't compile on bionic. HOT 2
- CoreKiwix.xcframework not usable with iOS Simulator HOT 5
- Wrap XCFramework into a swift package, for Apple (iOS, macOS) distribution HOT 3
- Explicit dependence names for macOS HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kiwix-build.