Pulseview: new recipe

This commit is contained in:
Adrien Destugues
2019-01-12 10:49:25 +01:00
parent 2581c1de0a
commit 76cac5a71f
2 changed files with 165 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
From e0ab2bde670d875a7134b225ec3feda7f8865f2a Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 12 Jan 2019 10:48:33 +0100
Subject: Build and packaging fixes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a19593d..ae751c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,8 +72,12 @@ add_subdirectory(manual)
#= Dependencies
#-------------------------------------------------------------------------------
+# glibmm uses c++14 features
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
list(APPEND PKGDEPS glib-2.0>=2.28.0)
-list(APPEND PKGDEPS glibmm-2.4>=2.28.0)
+list(APPEND PKGDEPS glibmm-2.58>=2.28.0)
set(LIBSR_CXX_BINDING "libsigrokcxx>=0.5.1")
list(APPEND PKGDEPS "${LIBSR_CXX_BINDING}")
@@ -137,7 +141,6 @@ function(check_working_cxx_atomics varname additional_lib)
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)
cmake_push_check_state()
- set(CMAKE_REQUIRED_FLAGS "-std=c++11")
set(CMAKE_REQUIRED_LIBRARIES "${additional_lib}")
set(CMAKE_REQUIRED_QUIET 1)
CHECK_CXX_SOURCE_COMPILES("
@@ -411,7 +414,6 @@ qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
add_definitions(-DQT_NO_KEYWORDS)
add_definitions(-D__STDC_LIMIT_MACROS)
add_definitions(-Wall -Wextra)
-add_definitions(-std=c++11)
add_definitions(-DBOOST_MATH_DISABLE_FLOAT128=1)
if(ENABLE_DECODE)
@@ -467,6 +469,11 @@ else()
list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES})
endif()
+if(HAIKU)
+ # Why do we need to manually link in libsigrok dependencies on Haiku?
+ list(APPEND PULSEVIEW_LINK_LIBS network usb-1.0 zip ftdi1)
+endif()
+
if(WIN32)
# On Windows we need to statically link the libqsvg imageformat
# plugin (and the QtSvg component) for SVG graphics/icons to work.
@@ -507,12 +514,16 @@ endif()
#= Installation
#-------------------------------------------------------------------------------
-# Install the executable.
-install(TARGETS ${PROJECT_NAME} DESTINATION bin/)
-
# Install the manpage.
install(FILES doc/pulseview.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc)
+if(HAIKU)
+install(TARGETS ${PROJECT_NAME} DESTINATION apps/)
+
+else()
+# Install the executable.
+install(TARGETS ${PROJECT_NAME} DESTINATION bin/)
+
# Install the desktop file.
install(FILES contrib/org.sigrok.PulseView.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
@@ -525,6 +536,7 @@ install(FILES icons/pulseview.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons
# Generate Windows installer script.
configure_file(contrib/pulseview_cross.nsi.in contrib/pulseview_cross.nsi @ONLY)
+endif()
#===============================================================================
#= Packaging (handled by CPack)
--
2.19.1

View File

@@ -0,0 +1,82 @@
SUMMARY="Logic analyzer, oscilloscope and MSO GUI for sigrok"
DESCRIPTION="A graphical frontend for the libsigrok and libsigrokdecode \
libraries, permitting access to a wide range of devices and protocol decoders \
to let you record, analyze, process and export analog and logic data.
The sigrok suite needs some kind of hardware to interface to the signals you \
want to examine.
A variety of compatible low cost chinese made logic analyzer products are \
available for as little as $5. Sigrok also supports FX2-based oscilloscopes \
such as the Hantek 6022BE, non-FX2 devices like the Openbench Logic Sniffer \
or devices that make use of the SCPI protocol, as all reasonably modern \
oscilloscopes do (Rigol DS1054z, LeCroy WaveRunner, Yokogawa DLM and similar)."
HOMEPAGE="https://sigrok.org/wiki/PulseView"
COPYRIGHT="2012-2019 PulseView contributors"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="http://sigrok.org/download/source/pulseview/pulseview-$portVersion.tar.gz"
CHECKSUM_SHA256="9ee7ce3dd1457c6a5f5e4e9c2469903a1f070ba077ea68535cc29ef1dfac6f2f"
PATCHES="pulseview-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
pulseview$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libsigrok$secondaryArchSuffix
lib:libsigrokcxx$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libboost_filesystem$secondaryArchSuffix
lib:libboost_serialization$secondaryArchSuffix
lib:libzip$secondaryArchSuffix
lib:libqt5core$secondaryArchSuffix
lib:libqt5gui$secondaryArchSuffix
lib:libqt5widgets$secondaryArchSuffix
lib:libglibmm_2.58$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libftdi1$secondaryArchSuffix
lib:libsigrokdecode$secondaryArchSuffix
lib:libusb_1.0$secondaryArchSuffix
lib:libsigc_3.0$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libsigrokcxx$secondaryArchSuffix
devel:libsigrokdecode$secondaryArchSuffix
devel:libqt5core$secondaryArchSuffix
devel:libboost_filesystem$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libftdi1$secondaryArchSuffix
devel:libusb_1.0$secondaryArchSuffix
devel:libzip$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
cmd:ninja
"
BUILD()
{
cmake $cmakeDirArgs -GNinja
ninja $jobArgs
}
INSTALL()
{
ninja install
rm -rf $prefix/share
addAppDeskbarSymlink $appsDir/pulseview
}
TEST()
{
ninja check
}