Skip to content

Commit 58bb2fd

Browse files
committed
packaging: update Macports portfile
1 parent 3e9de91 commit 58bb2fd

3 files changed

Lines changed: 112 additions & 34 deletions

File tree

host/packaging/Portfile

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2+
3+
PortSystem 1.0
4+
PortGroup cmake 1.1
5+
PortGroup conflicts_build 1.0
6+
PortGroup github 1.0
7+
PortGroup legacysupport 1.1
8+
9+
github.setup greatscottgadgets ubertooth 3e9de91f406ea13f4a5a76c3fd5e21c2a0375ad8
10+
version 2022-07-19
11+
revision 0
12+
categories devel net security
13+
description Software, firmware and hardware designs for Ubertooth.
14+
long_description Project Ubertooth is an open source wireless development platform suitable \
15+
for Bluetooth experimentation. Ubertooth ships with a capable BLE (Bluetooth Smart) \
16+
sniffer and can sniff some data from Basic Rate (BR) Bluetooth Classic connections.
17+
license GPL-2
18+
maintainers {@barracuda156 gmail.com:vital.had} openmaintainer
19+
20+
homepage https://ubertooth.readthedocs.io
21+
22+
checksums rmd160 3a3545670f44bcb3a1ce257bf5dd5da42fba1014 \
23+
sha256 3ad1dc36accd8b7f69fdf4489df93afcaa4d1e7bdd9448b24a23eacc525deec5 \
24+
size 1307090
25+
26+
# clock_gettime
27+
legacysupport.newest_darwin_requires_legacy 15
28+
29+
patchfiles patch-python3.diff
30+
31+
set python_branch 3.10
32+
set python_ver [string map {. {}} ${python_branch}]
33+
configure.python ${prefix}/bin/python${python_branch}
34+
35+
depends_build-append \
36+
port:pkgconfig
37+
38+
depends_lib-append path:lib/pkgconfig/libbtbb.pc:libbtbb \
39+
path:lib/pkgconfig/libusb-1.0.pc:libusb
40+
41+
if {${build_arch} ni [list ppc ppc64]} {
42+
depends_lib-append \
43+
port:python${python_ver} \
44+
port:py${python_ver}-numpy \
45+
port:py${python_ver}-pyside \
46+
port:py${python_ver}-setuptools
47+
}
48+
49+
post-patch {
50+
fs-traverse f ${worksrcpath}/host/python {
51+
if {[file extension ${f}] eq ".py"} {
52+
reinplace -q "s|/usr/bin/env python3|${configure.python}|" ${f}
53+
}
54+
}
55+
reinplace "s|/usr/bin/env python3|${configure.python}|" ${worksrcpath}/host/python/ubtbr/ubertooth-btbr
56+
reinplace "s|/usr/bin/env python3|${configure.python}|" ${worksrcpath}/host/python/specan_ui/ubertooth-specan-ui
57+
reinplace "s|/usr/bin/env python3|${configure.python}|" ${worksrcpath}/host/python/specan_ui/setup.py.in
58+
reinplace "s|@PYTHON3@|${configure.python}|g" ${worksrcpath}/host/python/ubtbr/CMakeLists.txt
59+
}
60+
61+
cmake.source_dir ${worksrcpath}/host
62+
cmake.module_path ${cmake.source_dir}/cmake/modules
63+
64+
# See: https://github.com/greatscottgadgets/ubertooth/blob/master/host/README.md
65+
conflicts_build ${name}
66+
67+
compiler.blacklist-append *gcc-4.*
68+
69+
platform darwin powerpc {
70+
# Indirect dependency, py310-shiboken, currently fails on PPC: https://trac.macports.org/ticket/65708
71+
configure.args-append \
72+
-DENABLE_PYTHON=OFF
73+
# Needed for Rosetta
74+
compiler.blacklist-append clang
75+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--- host/python/CMakeLists.txt.orig 2022-07-19 05:15:57.000000000 +0800
2+
+++ host/python/CMakeLists.txt 2022-11-01 18:44:41.000000000 +0800
3+
@@ -20,7 +20,8 @@
4+
project(ubertooth-python)
5+
6+
# Check for python installation
7+
-find_package(Python3)
8+
+set(Python3_FIND_UNVERSIONED_NAMES NEVER)
9+
+find_package(PYTHON3)
10+
if(NOT Python3_FOUND)
11+
return()
12+
else()
13+
14+
--- host/python/ubtbr/CMakeLists.txt.orig 2022-07-19 05:15:57.000000000 +0800
15+
+++ host/python/ubtbr/CMakeLists.txt 2022-11-01 19:48:10.000000000 +0800
16+
@@ -1,4 +1,5 @@
17+
-find_program(PYTHON3 "python3")
18+
+set(Python3_FIND_UNVERSIONED_NAMES NEVER)
19+
+find_package(PYTHON3)
20+
set(SETUP_PY_IN ${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in)
21+
set(SETUP_PY ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
22+
set(DEPS ${CMAKE_CURRENT_SOURCE_DIR}/ubtbr/__init__.py
23+
@@ -9,12 +10,12 @@
24+
configure_file(${SETUP_PY_IN} ${SETUP_PY})
25+
26+
add_custom_command(OUTPUT ${OUTPUT}/timestamp
27+
- COMMAND ${PYTHON3} setup.py build
28+
+ COMMAND @PYTHON3@ setup.py build
29+
COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}/timestamp
30+
DEPENDS ${DEPS})
31+
32+
add_custom_target(ubtbr ALL DEPENDS ${OUTPUT}/timestamp)
33+
-install(CODE "execute_process(COMMAND ${PYTHON3} ${SETUP_PY} build -b ${OUTPUT} install -f --prefix=${CMAKE_INSTALL_PREFIX})")
34+
+install(CODE "execute_process(COMMAND @PYTHON3@ ${SETUP_PY} build -b ${OUTPUT} install -f --prefix=${CMAKE_INSTALL_PREFIX})")
35+
36+
add_custom_target(ubertooth-btbr ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ubertooth-btbr)
37+
install(PROGRAMS ubertooth-btbr DESTINATION ${INSTALL_DEFAULT_BINDIR})

0 commit comments

Comments
 (0)