From c739c0747bb647da03b59f713357aef1cea02e92 Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Tue, 25 Nov 2025 00:53:46 -0800 Subject: [PATCH 1/6] added support for openbsd-x64 --- .github/workflows/ci.yml | 36 +++++ libopus/config/openbsd/x64/config.h | 237 ++++++++++++++++++++++++++++ 2 files changed, 273 insertions(+) create mode 100644 libopus/config/openbsd/x64/config.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa298f4..3343521 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,6 +116,41 @@ jobs: name: prebuild-musl-node${{ matrix.node }} path: prebuilds-linux-musl-node${{ matrix.node }}.tar.gz + build_openbsd: + name: Build on OpenBSD x86-64 + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + submodules: true + + - name: Build on OpenBSD + uses: cross-platform-actions/action@v0.25.0 + with: + operating_system: openbsd + version: '7.6' + architecture: x86-64 + run: | + set -euo pipefail + sudo pkg_add node npm + npm install -g corepack + corepack enable + yarn set version berry + yarn install --immutable + yarn build-tsup + yarn prebuild + yarn test + + - name: Archive OpenBSD prebuilds + run: tar -czf prebuilds-openbsd-x64.tar.gz -C prebuilds . + + - name: Upload OpenBSD artifact + uses: actions/upload-artifact@v4 + with: + name: prebuild-openbsd-x64 + path: prebuilds-openbsd-x64.tar.gz + check-version: name: Check version runs-on: ubuntu-22.04 @@ -170,6 +205,7 @@ jobs: needs: - build - build_musl + - build_openbsd - check-version if: needs.check-version.result == 'success' && needs.check-version.outputs.publish == 'true' steps: diff --git a/libopus/config/openbsd/x64/config.h b/libopus/config/openbsd/x64/config.h new file mode 100644 index 0000000..7ca5d83 --- /dev/null +++ b/libopus/config/openbsd/x64/config.h @@ -0,0 +1,237 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Get CPU Info by asm method */ +#define CPU_INFO_BY_ASM 1 + +/* Get CPU Info by c method */ +/* #undef CPU_INFO_BY_C */ + +/* Custom modes */ +/* #undef CUSTOM_MODES */ + +/* Disable DNN debug float */ +#define DISABLE_DEBUG_FLOAT 1 + +/* Disable dot product instructions */ +/* #undef DISABLE_DOT_PROD */ + +/* Do not build the float API */ +/* #undef DISABLE_FLOAT_API */ + +/* Disable bitstream fixes from RFC 8251 */ +/* #undef DISABLE_UPDATE_DRAFT */ + +/* Assertions */ +/* #undef ENABLE_ASSERTIONS */ + +/* Deep PLC */ +/* #define ENABLE_DEEP_PLC 1 */ + +/* DRED */ +/* #define ENABLE_DRED 1 */ + +/* Hardening */ +#define ENABLE_HARDENING 1 + +/* LOSSGEN */ +/* #undef ENABLE_LOSSGEN */ + +/* Enable Opus Speech Coding Enhancement */ +/* #define ENABLE_OSCE 1 */ + +/* Enable dumping of OSCE training data */ +/* #undef ENABLE_OSCE_TRAINING_DATA */ + +/* Debug fixed-point implementation */ +/* #undef FIXED_DEBUG */ + +/* Compile as fixed-point (for machines without a fast enough FPU) */ +/* #undef FIXED_POINT */ + +/* Float approximations */ +#define FLOAT_APPROX 1 + +/* Fuzzing */ +/* #undef FUZZING */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* NE10 library is installed on host. Make sure it is on target! */ +/* #undef HAVE_ARM_NE10 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `lrint' function. */ +#define HAVE_LRINT 1 + +/* Define to 1 if you have the `lrintf' function. */ +#define HAVE_LRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `__malloc_hook' function. */ +/* #undef HAVE___MALLOC_HOOK */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Make use of ARM asm optimization */ +/* #undef OPUS_ARM_ASM */ + +/* Use generic ARMv4 inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_ASM */ + +/* Use ARMv5E inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_EDSP */ + +/* Use ARMv6 inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_MEDIA */ + +/* Use ARM NEON inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_NEON */ + +/* Compiler supports Aarch64 DOTPROD Intrinsics */ +/* #undef OPUS_ARM_MAY_HAVE_DOTPROD */ + +/* Define if assembler supports EDSP instructions */ +/* #undef OPUS_ARM_MAY_HAVE_EDSP */ + +/* Define if assembler supports ARMv6 media instructions */ +/* #undef OPUS_ARM_MAY_HAVE_MEDIA */ + +/* Define if compiler supports NEON instructions */ +/* #undef OPUS_ARM_MAY_HAVE_NEON */ + +/* Compiler supports ARMv7/Aarch64 Neon Intrinsics */ +/* #undef OPUS_ARM_MAY_HAVE_NEON_INTR */ + +/* Define if binary requires Aarch64 Neon Intrinsics */ +/* #undef OPUS_ARM_PRESUME_AARCH64_NEON_INTR */ + +/* Define if binary requires Aarch64 dotprod Intrinsics */ +/* #undef OPUS_ARM_PRESUME_DOTPROD */ + +/* Define if binary requires EDSP instruction support */ +/* #undef OPUS_ARM_PRESUME_EDSP */ + +/* Define if binary requires ARMv6 media instruction support */ +/* #undef OPUS_ARM_PRESUME_MEDIA */ + +/* Define if binary requires NEON instruction support */ +/* #undef OPUS_ARM_PRESUME_NEON */ + +/* Define if binary requires NEON intrinsics support */ +/* #undef OPUS_ARM_PRESUME_NEON_INTR */ + +/* This is a build of OPUS */ +#define OPUS_BUILD /**/ + +/* Run bit-exactness checks between optimized and c implementations */ +/* #undef OPUS_CHECK_ASM */ + +/* Use run-time CPU capabilities detection */ +/* #define OPUS_HAVE_RTCD 1 */ + +/* Compiler supports X86 AVX2 Intrinsics */ +#define OPUS_X86_MAY_HAVE_AVX2 1 + +/* Compiler supports X86 SSE Intrinsics */ +#define OPUS_X86_MAY_HAVE_SSE 1 + +/* Compiler supports X86 SSE2 Intrinsics */ +#define OPUS_X86_MAY_HAVE_SSE2 1 + +/* Compiler supports X86 SSE4.1 Intrinsics */ +#define OPUS_X86_MAY_HAVE_SSE4_1 1 + +/* Define if binary requires AVX2 intrinsics support */ +/* #undef OPUS_X86_PRESUME_AVX2 */ + +/* Define if binary requires SSE intrinsics support */ +/* #define OPUS_X86_PRESUME_SSE 1 */ + +/* Define if binary requires SSE2 intrinsics support */ +/* #define OPUS_X86_PRESUME_SSE2 1 */ + +/* Define if binary requires SSE4.1 intrinsics support */ +/* #undef OPUS_X86_PRESUME_SSE4_1 */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opus@xiph.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "opus" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "opus 1.5.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "opus" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.5.2" + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define STDC_HEADERS 1 + +/* Make use of alloca */ +/* #undef USE_ALLOCA */ + +/* Use C99 variable-size arrays */ +#define VAR_ARRAYS 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#define restrict __restrict__ +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +#define _Restrict +#define __restrict__ +#endif From 87ce90c4b1a3107eaeb0d1f64f1ca9f076c9be3a Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Tue, 25 Nov 2025 00:56:25 -0800 Subject: [PATCH 2/6] small version bump --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3343521..dfd8a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,10 +126,10 @@ jobs: submodules: true - name: Build on OpenBSD - uses: cross-platform-actions/action@v0.25.0 + uses: cross-platform-actions/action@v0.30.0 with: operating_system: openbsd - version: '7.6' + version: "7.8" architecture: x86-64 run: | set -euo pipefail From 71a99c00ed26b16134c1e778e6cabc76568235a4 Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Tue, 25 Nov 2025 01:26:17 -0800 Subject: [PATCH 3/6] more updates --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfd8a0e..5ca16a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,7 +134,7 @@ jobs: run: | set -euo pipefail sudo pkg_add node npm - npm install -g corepack + sudo npm install -g corepack corepack enable yarn set version berry yarn install --immutable From d56ab82ecc6c598523a8ace097b0ea1020ccb1e6 Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Tue, 25 Nov 2025 01:32:10 -0800 Subject: [PATCH 4/6] fixed electron install --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ca16a0..42f879b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - "**" + - main pull_request: branches: - "**" @@ -127,6 +127,8 @@ jobs: - name: Build on OpenBSD uses: cross-platform-actions/action@v0.30.0 + env: + ELECTRON_SKIP_BINARY_DOWNLOAD: "1" with: operating_system: openbsd version: "7.8" From e202a42350a00963e2d597f75c36e91418e63ba6 Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Tue, 25 Nov 2025 01:40:14 -0800 Subject: [PATCH 5/6] more env work --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42f879b..dab8cdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,13 +133,15 @@ jobs: operating_system: openbsd version: "7.8" architecture: x86-64 + environment_variables: ELECTRON_SKIP_BINARY_DOWNLOAD run: | set -euo pipefail + export ELECTRON_SKIP_BINARY_DOWNLOAD=1 sudo pkg_add node npm sudo npm install -g corepack corepack enable yarn set version berry - yarn install --immutable + yarn install --immutable --ignore-optional yarn build-tsup yarn prebuild yarn test From b629a04dfffddb06b34accf96c45fcb4d6ba0090 Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Tue, 25 Nov 2025 01:45:51 -0800 Subject: [PATCH 6/6] small update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dab8cdd..a6dae3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,7 +141,7 @@ jobs: sudo npm install -g corepack corepack enable yarn set version berry - yarn install --immutable --ignore-optional + yarn install --immutable yarn build-tsup yarn prebuild yarn test