Skip to content

Instantly share code, notes, and snippets.

@hansemro
Last active December 6, 2023 10:22
Show Gist options
  • Save hansemro/0717aaf7e9c5b24de913ad663d188576 to your computer and use it in GitHub Desktop.
Save hansemro/0717aaf7e9c5b24de913ad663d188576 to your computer and use it in GitHub Desktop.
APKBUILD for scopehal-apps
From b1ed9c840cdb2a08d8239d6423141892a9f210cd Mon Sep 17 00:00:00 2001
From: Hansem Ro <hansemro@outlook.com>
Date: Tue, 5 Dec 2023 15:43:53 -0800
Subject: [PATCH] Define __THROW for musl libc
---
UART.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/UART.cpp b/UART.cpp
index 36d4124..f664595 100644
--- a/UART.cpp
+++ b/UART.cpp
@@ -45,6 +45,11 @@
#ifdef __linux__
#include <asm/termios.h>
+//define __THROW to avoid build issue when it's not available from the libc
+#ifndef __THROW
+# define __THROW
+#endif
+
//asm/termios.h seems to conflict with sys/ioctl.h and termios.h
//so just pull these by hand
extern "C" int tcflush (int __fd, int __queue_selector) __THROW;
--
2.40.1
# Maintainer: Hansem Ro <hansemro@outlook.com>
pkgname=scopehal-apps
pkgver=0.0_git
pkgrel=0
arch="all"
url="https://www.ngscopeclient.org"
pkgdesc="ngscopeclient"
license="BSD"
makedepends="
make
cmake
pkgconf
glm-dev
gtkmm3-dev
libsigc++-dev
yaml-dev
yaml-cpp-dev
glew-dev
catch2
vulkan-headers
vulkan-loader
vulkan-loader-dbg
vulkan-loader-dev
vulkan-tools
glslang
glslang-libs
spirv-headers
spirv-tools
spirv-tools-dbg
spirv-tools-dev
glfw-dev
shaderc-dev
shaderc
shaderc-static
glslang
glslang-dev
glslang-static
ffts
"
source="
./0001-Define-__THROW-for-musl-libc.patch
"
builddir="$srcdir/$pkgname"
options="!check" # No tests
prepare() {
git clone "https://github.com/ngscopeclient/$pkgname" "$srcdir/$pkgname" --recursive
cd "$srcdir/$pkgname/lib/xptools"
patch -Nup1 -i "$srcdir/0001-Define-__THROW-for-musl-libc.patch" || true
}
build() {
cmake -B build \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
305c89c933b94c7dd39121d7408442933f599a015dd09a13ff9ea61f99cb3c842f8232c8e84d2fb50be672967972f6c73c391e17de21ad93f7b35e4f79d40abf 0001-Define-__THROW-for-musl-libc.patch
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment