summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/libptytty/APKBUILD43
-rw-r--r--user/libptytty/force-utmps.patch12
2 files changed, 55 insertions, 0 deletions
diff --git a/user/libptytty/APKBUILD b/user/libptytty/APKBUILD
new file mode 100644
index 000000000..d12a73c33
--- /dev/null
+++ b/user/libptytty/APKBUILD
@@ -0,0 +1,43 @@
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=libptytty
+pkgver=2.0
+pkgrel=0
+pkgdesc="OS independent and secure pty/tty and utmp/wtmp/lastlog handling"
+url="http://software.schmorp.de/pkg/libptytty.html"
+arch="all"
+options="!check" # No test suite.
+license="GPL-2.0+"
+depends=""
+makedepends="cmake utmps-dev"
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://dist.schmorp.de/libptytty/libptytty-$pkgver.tar.gz
+ force-utmps.patch
+ "
+
+build() {
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ export LDFLAGS="$LDFLAGS -Bdynamic"
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=RelWithDebugInfo \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ ${CMAKE_CROSSOPTS} \
+ -Bbuild
+ make -C build
+}
+
+check() {
+ CTEST_OUTPUT_ON_FAILURE=TRUE make -C build test
+}
+
+package() {
+ make DESTDIR="$pkgdir" -C build install
+}
+
+sha512sums="9cca5fddbcc4025c2bbe043e3367ac902d0024a34301258dafcf0de70935c055279d88227168d112d0e4c0dc37f1f49e1ea587bd6bddf0b9d92400657bc7be08 libptytty-2.0.tar.gz
+34155b4c06bb8dc8f78777fd3a9e749b1c3c056bd073fd7a0c85404f1dfe29dae6b2513a1ed8093fd528d0eb30cd463a5896c0d05203f47bb4f9cad8067bec26 force-utmps.patch"
diff --git a/user/libptytty/force-utmps.patch b/user/libptytty/force-utmps.patch
new file mode 100644
index 000000000..ce9c34d6d
--- /dev/null
+++ b/user/libptytty/force-utmps.patch
@@ -0,0 +1,12 @@
+We need to ensure linkage to utmps, or utmpx won't work.
+
+--- libptytty-2.0/CMakeLists.txt.old 2021-08-04 09:07:44.000000000 -0500
++++ libptytty-2.0/CMakeLists.txt 2024-05-30 19:50:40.078963587 -0500
+@@ -318,6 +318,7 @@
+ target_link_libraries(ptytty PRIVATE util)
+ list(APPEND LIBS -lutil)
+ endif()
++target_link_libraries(ptytty PRIVATE :libutmps.so.0.1)
+
+ configure_file(
+ libptytty.pc.in