Skip to content

Commit

Permalink
hobbits: update to 0.53.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
classabbyamp committed Apr 8, 2022
1 parent 3bbe0b5 commit 025b2ff
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 19 deletions.
125 changes: 125 additions & 0 deletions srcpkgs/hobbits/patches/cmake.patch
@@ -0,0 +1,125 @@
From f4683e308793221d54640300bf9d3eadb7a685ea Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Thu, 7 Apr 2022 19:16:13 -0400
Subject: [PATCH 1/4] cmake/PackExternalDeps.cmake: fix endfunction name

---
cmake/PackExternalDeps.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hobbits-0.53.1/cmake/PackExternalDeps.cmake b/hobbits-0.53.1/cmake/PackExternalDeps.cmake
index 4be07c7..330be03 100644
--- a/hobbits-0.53.1/cmake/PackExternalDeps.cmake
+++ b/hobbits-0.53.1/cmake/PackExternalDeps.cmake
@@ -145,7 +145,7 @@ endfunction(pack_python)
function(pack_pffft)
install(FILES ${PFFFT_LIBRARIES}
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endfunction(pack_pcap)
+endfunction(pack_pffft)

function(pack_pcap)
if (LINUX)

From d239b55b805122617d9dd41930140e317653c8aa Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Thu, 7 Apr 2022 19:17:19 -0400
Subject: [PATCH 2/4] CMakeLists.txt: remove EXACT option for finding python

without this, cmake will accept Python >=3.9
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hobbits-0.53.1/CMakeLists.txt b/hobbits-0.53.1/CMakeLists.txt
index 1cc283d..b95d6e6 100644
--- a/hobbits-0.53.1/CMakeLists.txt
+++ b/hobbits-0.53.1/CMakeLists.txt
@@ -124,7 +124,7 @@ elseif( MANUAL_PYTHON_PATH )
set ( Python3_ROOT_DIR "${MANUAL_PYTHON_PATH}" )
endif()

-find_package (Python3 3.9 EXACT COMPONENTS Interpreter Development REQUIRED)
+find_package (Python3 3.9 COMPONENTS Interpreter Development REQUIRED)
message("Python3 Libs: ${Python3_LIBRARIES}")

#

From a9a4d40eca079f4b197849cf3d00f3f11069c482 Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Thu, 7 Apr 2022 19:19:54 -0400
Subject: [PATCH 3/4] CMakeLists.txt: allow specifying VERSION_STRING with
-DBUILD_VERSION

this will make it easier for distros to specify the version without
writing to .version
---
CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hobbits-0.53.1/CMakeLists.txt b/hobbits-0.53.1/CMakeLists.txt
index b95d6e6..7e766b2 100644
--- a/hobbits-0.53.1/CMakeLists.txt
+++ b/hobbits-0.53.1/CMakeLists.txt
@@ -15,7 +15,10 @@ if (UNIX AND NOT APPLE)
set(LINUX TRUE)
endif()

-if (EXISTS "${CMAKE_SOURCE_DIR}/.version")
+if (DEFINED BUILD_VERSION)
+ message("Using build version from command-line")
+ set(VERSION_STRING "${BUILD_VERSION}")
+elseif (EXISTS "${CMAKE_SOURCE_DIR}/.version")
message("Getting build version from .version file")
file (STRINGS "${CMAKE_SOURCE_DIR}/.version" BUILD_VERSION)
string(REGEX REPLACE "\n$" "" BUILD_VERSION "${BUILD_VERSION}")

From b72cb09edd3850f4c2fe7d0ca693766704121f97 Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Thu, 7 Apr 2022 20:55:02 -0400
Subject: [PATCH 4/4] Add pffft as a submodule and include cmake build files
for it

---

diff --git a/hobbits-0.53.1/CMakeLists.txt b/hobbits-0.53.1/CMakeLists.txt
index 7e766b2..993eeb6 100644
--- a/hobbits-0.53.1/CMakeLists.txt
+++ b/hobbits-0.53.1/CMakeLists.txt
@@ -109,7 +109,7 @@ else()
endif()

# PFFFT
- find_package(PFFFT REQUIRED)
+ add_subdirectory(external)

endif()

diff --git a/hobbits-0.53.1/external/CMakeLists.txt b/hobbits-0.53.1/external/CMakeLists.txt
new file mode 100644
index 0000000..668fff4
--- /dev/null
+++ b/hobbits-0.53.1/external/CMakeLists.txt
@@ -0,0 +1,22 @@
+option(USE_SYSTEM_PFFFT "Use a system-provided version of pffft" OFF)
+# can't assume the target system has the required SIMD instructions
+option(PFFFT_ENABLE_SIMD "Enable SIMD support for pffft" OFF)
+
+if(USE_SYSTEM_PFFFT)
+ message(STATUS "Using system pffft")
+ find_package(PFFFT REQUIRED)
+else()
+ message(STATUS "Using bundled pffft")
+ add_library(pffft STATIC pffft/pffft.c)
+ if(PFFFT_ENABLE_SIMD)
+ message(STATUS "Enabling SIMD support for pffft")
+ else()
+ message(STATUS "Disabling SIMD support for pffft")
+ target_compile_definitions(pffft PUBLIC PFFFT_SIMD_DISABLE)
+ endif()
+ target_compile_options(pffft PUBLIC "${PFFFT_CFLAGS}")
+ target_link_libraries(pffft m)
+ target_include_directories(pffft INTERFACE pffft)
+
+ add_library(PFFFT::PFFFT ALIAS pffft)
+endif()
11 changes: 0 additions & 11 deletions srcpkgs/hobbits/patches/python_version.patch

This file was deleted.

45 changes: 37 additions & 8 deletions srcpkgs/hobbits/template
@@ -1,28 +1,57 @@
# Template file for 'hobbits'
pkgname=hobbits
version=0.52.0
version=0.53.1
revision=1
_pffft_commit=7914df2127c206ae501a6cb2950ee65a94662215
_pffft_dir="jpommier-pffft-${_pffft_commit:0:12}"
create_wrksrc=yes
build_wrksrc="hobbits-${version}"
build_style=cmake
configure_args="-DBUILD_VERSION=${version}"
hostmakedepends="pkg-config qt5-host-tools qt5-qmake python3"
makedepends="fftw-devel libusb-devel libpcap-devel python3-devel qt5-devel"
makedepends="libusb-devel libpcap-devel python3-devel qt5-devel"
short_desc="Multi-platform GUI for bit-based analysis, processing and visualization"
maintainer="classabbyamp <void@placeviolette.net>"
license="MIT, GPL-2.0-or-later"
license="MIT, custom:FFTPACK"
homepage="https://mahlet-inc.github.io"
changelog="https://raw.githubusercontent.com/Mahlet-Inc/hobbits/master/CHANGELOG.md"
distfiles="https://github.com/Mahlet-Inc/hobbits/archive/refs/tags/v${version}.tar.gz"
checksum=3332e02380ab46649f0ec2066b63b6e0fb04b55cdca973d28880f1607ebbf27e
distfiles="https://github.com/Mahlet-Inc/hobbits/archive/refs/tags/v${version}.tar.gz
https://bitbucket.org/jpommier/pffft/get/${_pffft_commit}.tar.gz"
checksum="e63c51228c3f00f56a2ebf79fec1975544b1c6c986d58dff69643da46148316b
@0b9f0e99ace190e607961f72953394aa0f0387826d4e478027111d71d56839a8"

case "$XBPS_TARGET_MACHINE" in
arm*|aarch64*|ppc*) CXXFLAGS+=" -fsigned-char"
esac

pre_configure() {
# upstream provides no way to set the version through configure_args
echo "${version}" > .version
case "$XBPS_TARGET_MACHINE" in
aarch64*)
configure_args+=" -DPFFFT_ENABLE_SIMD=ON"
;;
ppc64*)
configure_args+=" -DPFFFT_ENABLE_SIMD=ON"
CFLAGS+=" -maltivec -mabi=altivec"
;;
x86_64*|i686*)
configure_args+=" -DPFFFT_ENABLE_SIMD=ON"
CFLAGS+=" -msse -mfpmath=sse"
;;
*) # don't use SIMD on unsupported platforms
;;
esac

post_extract() {
# until upstream merges Mahlet-Inc/hobbits#143 and releases a new version,
# the directory must be added, instead of removing the submodule
# rm -rf ${build_wrksrc}/external/pffft
mkdir ${build_wrksrc}/external
mv ${_pffft_dir} ${build_wrksrc}/external/pffft
}

post_install() {
vinstall src/hobbits-gui/images/icons/HobbitsRingSmall.png 644 usr/share/pixmaps
# capture the FFTPACK license from the header comment of pffft.c
sed -E '/\*\//,$d; 1s/\/\* //; s/^[[:blank:]]+//' external/pffft/pffft.c > LICENSE.pffft
vlicense LICENSE.pffft
vlicense LICENSE.txt
}

0 comments on commit 025b2ff

Please sign in to comment.