Skip to content

Instantly share code, notes, and snippets.

@ronaldtse
ronaldtse / ohos-rust-porting-guide.md
Created July 27, 2026 23:19
Porting a Rust library/CLI to OHOS (OpenHarmony) — practical guide distilled from shipping enprot v0.4.2 for aarch64-unknown-linux-ohos

Porting a Rust library/CLI to OHOS (OpenHarmony) — practical guide

Distilled from shipping enprot v0.4.2 for aarch64-unknown-linux-ohos (HarmonyOS arm64). Covers the NDK setup, the two-triple problem, building C deps that don't use CMake, Cargo env vars, CI topology, and the 12-pitfall journey. Reference implementation: engyon/enprot (ci/setup-ohos-ndk.sh, ci/build-botan-ohos.sh, .github/workflows/ohos.yml).

Why OHOS needs special treatment

OHOS (OpenHarmony / Huawei HarmonyOS) is musl-based arm64. Naively reusing aarch64-linux-musl bytes does not work — even though the dynamic linker path matches (/lib/ld-musl-aarch64.so.1), the ABIs differ in subtle ways:

  • musl symbol versions (Alpine carries patches OHOS doesn't, and vice versa)
  • Default symbol visibility (-fvisibility=hidden defaults differ)
@ronaldtse
ronaldtse / ohos-cmake-porting-gist.md
Created July 26, 2026 16:04
Porting a CMake C library to OHOS (OpenHarmony) — cross-compile + CI verification with dockerharmony

Porting a CMake C library to OHOS (OpenHarmony) — cross-compile + CI

A practical guide for plain CMake-based C libraries targeting aarch64-linux-ohos (HarmonyOS PC). Distilled from porting jemalloc and adapting the libpng-ruby porting guide (which covers Ruby gems with C extensions).

Reference implementation: tamatebako/jemalloc#34

Why OHOS needs special treatment

@ronaldtse
ronaldtse / ohos-porting-guide.md
Created July 26, 2026 15:00
Porting C libraries and Ruby platform gems to OHOS (OpenHarmony) — practical guide distilled from shipping libpng-ruby 1.6.58.6 for aarch64-linux-ohos

Porting C libraries and Ruby platform gems to OHOS (OpenHarmony)

A practical guide distilled from shipping libpng-ruby 1.6.58.6 for aarch64-linux-ohos. Covers the NDK architecture, the workarounds the official docs leave out, and how to wire it all into a Ruby gem's CI.

Reference implementation: claricle/libpng-ruby#13

Why OHOS needs special treatment

OHOS (OpenHarmony / Huawei HarmonyOS) is musl-based arm64. Naively reusing aarch64-linux-musl bytes does not work — even though the dynamic linker path matches (/lib/ld-musl-aarch64.so.1), the ABIs differ in subtle ways:

@ronaldtse
ronaldtse / metanorma-fix-lucid-svgs.rb
Created June 26, 2025 03:08
Metanorma script that fixes Lucid / LucidChart SVG files that have `<use>` elements reference invalid IDs, see https://community.lucid.co/lucid-for-engineering-19/svg-export-results-in-invalid-idref-on-a-use-element-8050
#!/usr/bin/env ruby
# This script is developed for Metanorma users that need to fix Lucid-generated
# SVGs. Lucid-generated SVGs have `<use>` elements reference invalid IDs, which
# result in invalid SVG XML. Metanorma PDFs and Word outputs rely on valid SVG
# XML files otherwise the PDF output will omit broken SVGs, and the Word output
# will have EMF files that have areas of the figures appear in black.
#
# The issue is described at:
# https://community.lucid.co/lucid-for-engineering-19/svg-export-results-in-invalid-idref-on-a-use-element-8050
{
"symmetric": [
"aes": {
"key-length": [
{
/* anything less will score "unacceptable" */
"predicate": "min",
"levels": [
{
"level": 2,
term_def_boilerplate:
scope: مجال التطبيق
symbolsabbrev: الرموز والاختصارات
abbrev: الاختصارات
symbols: الرموز
table_of_contents: جدول المحتويات
introduction: مقدمة
foreword: تمهيد
abstract: ملخص
acknowledgements: شكر
@ronaldtse
ronaldtse / gist:48ece5dc835dd46f0839fc26d9c147eb
Last active January 26, 2021 19:51
isodoc-itu-i18n-zh.yaml
term_def_boilerplate:
scope: 范围
symbolsabbrev: 符号与缩写
abbrev: 缩写
symbols: 符号
table_of_contents: 目录
introduction: 引言
foreword: 前言
abstract: 摘要
acknowledgements: 致谢
termsdef: 定义
termsdefsymbolsabbrev: 定义
termsdefsymbols: 定义
termsdefabbrev: 定义
termnote: 注 %
normref: 规范性参考文献
symbolsabbrev: 缩略语与缩写
abbrev: 缩略语与缩写
symbols: 缩略语与缩写
conventions: 惯例
@ronaldtse
ronaldtse / installing-ea-on-mac.md
Created July 3, 2020 05:56 — forked from JaimeChavarriaga/installing-ea-on-mac.md
Installing Sparx Enterprise Architect on MacOS

Installing Sparx Enterprise Architect on MacOS

Installation

There is not a MacOS-native executable of Enterprise Architect on Mac. In order to run it, it is possible to use Wine, a software to run windows applications on Linux and Mac. Sparx has a webinar and a documentation page explaining how to install EA into Linux using Wine. However, these instructions do not provide a step-by-step guide for MacOS

The following are instructions to install EA on MacOs using Homebrew.

  1. install homebrew
@ronaldtse
ronaldtse / macos.yml
Last active January 3, 2020 14:35 — forked from maxwelleite/ttf-vista-fonts-installer.sh
Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
name: macos
on:
push:
branches:
- master
pull_request:
jobs:
build: