Commit 83e55889 authored by Bart Ribbers's avatar Bart Ribbers Committed by Leo
Browse files

testing/libsurvive: new aport

parent c74f784d
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libsurvive
pkgver=0.2
pkgrel=0
pkgdesc="Open Source Lighthouse Tracking System"
url="https://github.com/cntools/libsurvive"
arch="all"
license="MIT"
depends_dev="
blas-dev
lapack-dev
libpcap-dev
libusb-dev
zlib-dev
"
makedepends="$depends_dev
cmake
"
subpackages="$pkgname-static $pkgname-dev $pkgname-bash-completion"
source="https://github.com/cntools/libsurvive/archive/v$pkgver/libsurvive-v$pkgver.tar.gz
fix-alpine-build-system.patch
include-library-version-in-libsurvive-target.patch
"
options="!check" # Requires live test data
build() {
cmake -B build \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_STATIC=OFF
cmake --build build
}
package() {
DESTDIR="$pkgdir" cmake --build build --target install
install -Dm644 useful_files/81-vive.rules "$pkgdir"/usr/lib/udev/rules.d/81-vive.rules
install -Dm644 survive_autocomplete.sh "$pkgdir"/usr/share/bash-completion/completions/survive
}
sha512sums="6b3318183f5b4c2d42280dccdb211aa01a3bde68cae7b3aef5c28e0e0e35fbf0129dd7ed06679f519e19790f607b2b24a343289a5d81cf5eb4ac0a8f9df61d95 libsurvive-v0.2.tar.gz
9a3580e34a2171e0d8c45e84ba4373128940f268bf4f2d92a3f5ce5f61d2b34069f419cf7320a54d2f703d5eb85f4dd355d90e3afbd00bee9ab3660b0c59a37a fix-alpine-build-system.patch
25d83f18c9f62fdb210e038194ffc8eaeb3430060abac52ca7cdf353580f8e0206539eb95f1ff3601422d2b31690bb63bf31f0307daedd8957f205c1eee45253 include-library-version-in-libsurvive-target.patch"
From 02f6240d8cc605f0e86b47b5d67ed99ff7f24139 Mon Sep 17 00:00:00 2001
From: Justin <j.david.berger@gmail.com>
Date: Fri, 18 Sep 2020 14:07:47 -0600
Subject: [PATCH] Fix for alpine build system
---
redist/symbol_enumerator.c | 9 +++++++--
redist/symbol_enumerator.h | 6 +-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/redist/symbol_enumerator.c b/redist/symbol_enumerator.c
index 518f12d..079a808 100644
--- a/redist/symbol_enumerator.c
+++ b/redist/symbol_enumerator.c
@@ -1,9 +1,9 @@
-#include <stdio.h>
#include "symbol_enumerator.h"
#if defined( WIN32 ) || defined( WINDOWS ) || defined( USE_WINDOWS ) || defined( _WIN32 )
-
+#include <stdio.h>
#include <windows.h>
+
#include <dbghelp.h>
BOOL CALLBACK mycb(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext) {
@@ -26,6 +26,7 @@ int EnumerateSymbols( SymEnumeratorCallback cb )
}
#elif __linux__
+#define _GNU_SOURCE
#include <stdio.h>
#include <dlfcn.h>
@@ -37,6 +38,10 @@ int EnumerateSymbols( SymEnumeratorCallback cb )
#define __int128_t long long long
#endif
+#ifndef __WORDSIZE
+#define __WORDSIZE (sizeof(size_t) * 8)
+#endif
+
#include <link.h>
#include <elf.h>
diff --git a/redist/symbol_enumerator.h b/redist/symbol_enumerator.h
index 87e033b..15af582 100644
--- a/redist/symbol_enumerator.h
+++ b/redist/symbol_enumerator.h
@@ -1,6 +1,4 @@
-#ifndef _SYMBOL_ENUMERATOR_H
-#define _SYMBOL_ENUMERATOR_H
-
+#pragma once
//Enumerates all symbols in the currently loaded excutable.
//Don't forget to compile with -rdynamic!
@@ -8,5 +6,3 @@
typedef int (*SymEnumeratorCallback)( const char * path, const char * name, void * location, long size );
int EnumerateSymbols( SymEnumeratorCallback cb );
-
-#endif
From e5759a0073954e43c770762e9c1d011dda0259e8 Mon Sep 17 00:00:00 2001
From: Bart Ribbers <bribbers@disroot.org>
Date: Fri, 25 Sep 2020 11:18:18 +0200
Subject: [PATCH] Include library version in libsurvive target
Without this linking to libsurvive would fail for e.g. Monado (at least
on Alpine Linux):
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lsurvive
---
CMakeLists.txt | 4 +++-
src/CMakeLists.txt | 5 ++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f214f5e..6bd9639 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.12.4)
-project(libsurvive C CXX)
+project(libsurvive
+ LANGUAGES C CXX
+ VERSION 0.2)
include(CheckIncludeFile)
include (CheckSymbolExists)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d32ae5d..167bf41 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -51,7 +51,10 @@ if(USE_HIDAPI OR WIN32)
endif()
add_library(survive ${SURVIVE_LIBRARY_TYPE} ${SURVIVE_SRCS})
-set_target_properties(survive PROPERTIES FOLDER "libraries")
+set_target_properties(survive PROPERTIES
+ FOLDER "libraries"
+ SOVERSION ${PROJECT_VERSION_MAJOR}
+ VERSION ${PROJECT_VERSION})
target_link_libraries(survive minimal_opencv ${ADDITIONAL_LIBRARIES} mpfit)
IF(HAVE_ZLIB_H)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment