Skip to content

Commit

Permalink
ns-3: migrate to python@3.10
Browse files Browse the repository at this point in the history
Closes #100035.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
  • Loading branch information
cho-m authored and BrewTestBot committed Apr 24, 2022
1 parent 03f8d73 commit f85b50c
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Formula/ns-3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Ns3 < Formula
url "https://gitlab.com/nsnam/ns-3-dev/-/archive/ns-3.35/ns-3-dev-ns-3.35.tar.bz2"
sha256 "946abd1be8eeeb2b0f72a67f9d5fa3b9839bb6973297d4601c017a6c3a50fc10"
license "GPL-2.0-only"
revision 1

bottle do
sha256 cellar: :any, arm64_monterey: "d343727db81354f68bbbc2c56550e0d1c5c0c946aa87c5b30e2b0d90bf491a8e"
Expand All @@ -16,7 +17,7 @@ class Ns3 < Formula
end

depends_on "boost" => :build
depends_on "python@3.9" => [:build, :test]
depends_on "python@3.10" => [:build, :test]

uses_from_macos "libxml2"
uses_from_macos "sqlite"
Expand All @@ -29,8 +30,16 @@ class Ns3 < Formula
fails_with gcc: "5"

resource "pybindgen" do
url "https://files.pythonhosted.org/packages/7a/c6/14a9359621000ee5b7d5620af679be23f72c0ed17887b15228327427f97d/PyBindGen-0.22.0.tar.gz"
sha256 "5b4837d3138ac56863d93fe462f1dac39fb87bd50898e0da4c57fefd645437ac"
url "https://files.pythonhosted.org/packages/e0/8e/de441f26282eb869ac987c9a291af7e3773d93ffdb8e4add664b392ea439/PyBindGen-0.22.1.tar.gz"
sha256 "8c7f22391a49a84518f5a2ad06e3a5b1e839d10e34da7631519c8a28fcba3764"
end

# Fix ../src/lte/model/fdmt-ff-mac-scheduler.cc:1044:16: error:
# variable 'bytesTxed' set but not used [-Werror,-Wunused-but-set-variable]
# TODO: remove in the next release.
patch do
url "https://gitlab.com/nsnam/ns-3-dev/-/commit/dbd49741fcd5938edec17eddcde251b5dee25d05.diff"
sha256 "28e92297cfe058cfb587527dc3cfdb8ac66b51aba672be29539b6544591e2f1e"
end

def install
Expand All @@ -39,7 +48,7 @@ def install
system "./waf", "configure", "--prefix=#{prefix}",
"--build-profile=release",
"--disable-gtk",
"--with-python=#{Formula["python@3.9"].opt_bin/"python3"}",
"--with-python=#{which("python3")}",
"--with-pybindgen=#{buildpath}/pybindgen"
system "./waf", "--jobs=#{ENV.make_jobs}"
system "./waf", "install"
Expand All @@ -54,6 +63,6 @@ def install
"-std=c++11", "-o", "test"
system "./test"

system Formula["python@3.9"].opt_bin/"python3", pkgshare/"first.py"
system Formula["python@3.10"].opt_bin/"python3", pkgshare/"first.py"
end
end

0 comments on commit f85b50c

Please sign in to comment.