aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/ttyd/APKBUILD37
-rw-r--r--testing/ttyd/fix-cmake.patch20
2 files changed, 57 insertions, 0 deletions
diff --git a/testing/ttyd/APKBUILD b/testing/ttyd/APKBUILD
new file mode 100644
index 0000000000..0c2220daa7
--- /dev/null
+++ b/testing/ttyd/APKBUILD
@@ -0,0 +1,37 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=ttyd
+pkgver=1.2.2
+pkgrel=0
+pkgdesc="Share your terminal over the web"
+url="https://tsl0922.github.io/ttyd"
+arch="all"
+license="MIT"
+makedepends="cmake json-c-dev bsd-compat-headers libressl-dev libwebsockets-dev zlib-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/tsl0922/$pkgname/archive/$pkgver.tar.gz
+ fix-cmake.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ mkdir -p build && cd build
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=MinSizeRel \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_VERBOSE_MAKEFILE=TRUE \
+ || return 1
+ make
+}
+
+package() {
+ cd "$builddir"/build
+ make DESTDIR="$pkgdir" install
+}
+
+md5sums="94dd6ee2ebb4b7c1e131a39944abf8f4 ttyd-1.2.2.tar.gz
+388af4a04bdfa19ff83bb4e9326f04d4 fix-cmake.patch"
+sha256sums="6e85335c11df68e6401178269920a586bce7e66045bd0b225f6d2bc58356d105 ttyd-1.2.2.tar.gz
+b94aae5abba976b7c7565bfe9ef429491ea57c381efaacf2963ad236ea6a1bc4 fix-cmake.patch"
+sha512sums="2379c3f81e10f8fabf93af9c3b01aa7c7781095da52ef6c9b27686e3f42f2c686a1ca987952cd8961f42abb721ad9002a7978cfbcffc4f8a03f99a9b83528ae9 ttyd-1.2.2.tar.gz
+677f71abfec9e74db8f7976e6cb8c4eba052df71162390fa26e7c31f064a179d8587f07088eb0a5ada507a345b11af8d663162c77aad5e7fd129503eb15f83af fix-cmake.patch"
diff --git a/testing/ttyd/fix-cmake.patch b/testing/ttyd/fix-cmake.patch
new file mode 100644
index 0000000000..274bfcb7ef
--- /dev/null
+++ b/testing/ttyd/fix-cmake.patch
@@ -0,0 +1,20 @@
+find_package doesn't find Libwebsockets (with capital "L"). Eventually it finds
+libwebsockets with pkg-config, but includes libwebsockets.a on the path first,
+so the resulting library links libwebsockets statically.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,11 +13,11 @@
+ set(SOURCE_FILES src/server.c src/http.c src/protocol.c src/utils.c)
+
+ find_package(OpenSSL REQUIRED)
+-find_package(Libwebsockets ${LIBWEBSOCKETS_MIN_VERSION} QUIET)
++find_package(libwebsockets ${LIBWEBSOCKETS_MIN_VERSION} QUIET)
+
+ find_package(PkgConfig)
+
+-if(Libwebsockets_FOUND)
++if(libwebsockets_FOUND)
+ set(LIBWEBSOCKETS_INCLUDE_DIR ${LIBWEBSOCKETS_INCLUDE_DIR} ${LIBWEBSOCKETS_INCLUDE_DIRS})
+ else() # try to find libwebsockets with pkg-config
+ pkg_check_modules(Libwebsockets REQUIRED libwebsockets>=${LIBWEBSOCKETS_MIN_VERSION})