Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Aliases/qwt-qt5

This file was deleted.

7 changes: 4 additions & 3 deletions Formula/gnuradio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Gnuradio < Formula
url "https://github.com/gnuradio/gnuradio/archive/refs/tags/v3.9.3.0.tar.gz"
sha256 "4073ac72524f95fed4bda7dd553cb946f66d2e00bd07c4ae7758f1b787d507e0"
license "GPL-3.0-or-later"
revision 1
head "https://github.com/gnuradio/gnuradio.git"

livecheck do
Expand Down Expand Up @@ -37,7 +38,7 @@ class Gnuradio < Formula
depends_on "pyqt@5"
depends_on "python@3.9"
depends_on "qt@5"
depends_on "qwt"
depends_on "qwt-qt5"
depends_on "six"
depends_on "soapyrtlsdr"
depends_on "uhd"
Expand Down Expand Up @@ -109,8 +110,8 @@ def install
-DENABLE_DEFAULT=OFF
-DPYTHON_EXECUTABLE=#{venv_root}/bin/python
-DPYTHON_VERSION_MAJOR=3
-DQWT_LIBRARIES=#{Formula["qwt"].lib}/qwt.framework/qwt
-DQWT_INCLUDE_DIRS=#{Formula["qwt"].lib}/qwt.framework/Headers
-DQWT_LIBRARIES=#{Formula["qwt-qt5"].lib}/qwt.framework/qwt
-DQWT_INCLUDE_DIRS=#{Formula["qwt-qt5"].lib}/qwt.framework/Headers
-DCMAKE_PREFIX_PATH=#{Formula["qt@5"].opt_lib}
-DQT_BINARY_DIR=#{Formula["qt@5"].opt_bin}
-DENABLE_TESTING=OFF
Expand Down
4 changes: 2 additions & 2 deletions Formula/qcli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Qcli < Formula
url "https://github.com/bavc/qctools/archive/v1.2.tar.gz"
sha256 "d648a5fb6076c6367e4eac320018ccbd1eddcb2160ce175b361b46fcf0d4a710"
license "GPL-3.0-or-later"
revision 3
revision 4
head "https://github.com/bavc/qctools.git", branch: "master"

bottle do
Expand All @@ -17,7 +17,7 @@ class Qcli < Formula
depends_on "pkg-config" => :build
depends_on "ffmpeg"
depends_on "qt@5"
depends_on "qwt"
depends_on "qwt-qt5"

def install
qt5 = Formula["qt@5"].opt_prefix
Expand Down
107 changes: 107 additions & 0 deletions Formula/qwt-qt5.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
class QwtQt5 < Formula
desc "Qt Widgets for Technical Applications"
homepage "https://qwt.sourceforge.io/"
url "https://downloads.sourceforge.net/project/qwt/qwt/6.2.0/qwt-6.2.0.tar.bz2"
sha256 "9194f6513955d0fd7300f67158175064460197abab1a92fa127a67a4b0b71530"
license "LGPL-2.1-only" => { with: "Qwt-exception-1.0" }

livecheck do
url :stable
regex(%r{url=.*?/qwt[._-]v?(\d+(?:\.\d+)+)\.t}i)
end

keg_only "it conflicts with qwt"

depends_on "qt@5"

on_linux do
depends_on "gcc"
end

fails_with gcc: "5"

# Update designer plugin linking back to qwt framework/lib after install
# See: https://sourceforge.net/p/qwt/patches/45/
patch :DATA

def install
inreplace "qwtconfig.pri" do |s|
s.gsub!(/^\s*QWT_INSTALL_PREFIX\s*=(.*)$/, "QWT_INSTALL_PREFIX=#{prefix}")

# Install Qt plugin in `lib/qt/plugins/designer`, not `plugins/designer`.
s.sub! %r{(= \$\$\{QWT_INSTALL_PREFIX\})/(plugins/designer)$},
"\\1/lib/qt/\\2"
end

args = ["-config", "release", "-spec"]
spec = if OS.linux?
"linux-g++"
elsif ENV.compiler == :clang
"macx-clang"
else
"macx-g++"
end
spec << "-arm64" if Hardware::CPU.arm?
args << spec

qt5 = Formula["qt@5"].opt_prefix
system "#{qt5}/bin/qmake", *args
system "make"
system "make", "install"
end

test do
(testpath/"test.cpp").write <<~EOS
#include <qwt_plot_curve.h>
int main() {
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
return (curve1 == NULL);
}
EOS
if OS.mac?
system ENV.cxx, "test.cpp", "-o", "out",
"-std=c++11",
"-framework", "qwt", "-framework", "QtCore",
"-F#{lib}", "-F#{Formula["qt@5"].opt_lib}",
"-I#{lib}/qwt.framework/Headers",
"-I#{Formula["qt@5"].opt_lib}/QtCore.framework/Versions/5/Headers",
"-I#{Formula["qt@5"].opt_lib}/QtGui.framework/Versions/5/Headers"
else
system ENV.cxx,
"-I#{Formula["qt@5"].opt_include}",
"-I#{Formula["qt@5"].opt_include}/QtCore",
"-I#{Formula["qt@5"].opt_include}/QtGui",
"test.cpp",
"-lqwt", "-lQt5Core", "-lQt5Gui",
"-L#{Formula["qt@5"].opt_lib}",
"-L#{lib}",
"-Wl,-rpath=#{Formula["qt@5"].opt_lib}",
"-Wl,-rpath=#{lib}",
"-o", "out", "-std=c++11", "-fPIC"
end
system "./out"
end
end

__END__
diff --git a/designer/designer.pro b/designer/designer.pro
index c269e9d..c2e07ae 100644
--- a/designer/designer.pro
+++ b/designer/designer.pro
@@ -126,6 +126,16 @@ contains(QWT_CONFIG, QwtDesigner) {

target.path = $${QWT_INSTALL_PLUGINS}
INSTALLS += target
+
+ macx {
+ contains(QWT_CONFIG, QwtFramework) {
+ QWT_LIB = qwt.framework/Versions/$${QWT_VER_MAJ}/qwt
+ }
+ else {
+ QWT_LIB = libqwt.$${QWT_VER_MAJ}.dylib
+ }
+ QMAKE_POST_LINK = install_name_tool -change $${QWT_LIB} $${QWT_INSTALL_LIBS}/$${QWT_LIB} $(DESTDIR)$(TARGET)
+ }
}
else {
TEMPLATE = subdirs # do nothing