summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Correia2022-07-29 19:27:50 -0300
committerSergio Correia2022-07-29 19:32:17 -0300
commita0cbbf16ae24eeef35b046699d074ef57f80edff (patch)
tree98aab98b9d51e0152b87f2683bcc90a49726d210
parentbf28d27e58f4667bfecafd5ecce4b80a6bb4d347 (diff)
downloadaur-a0cbbf16ae24eeef35b046699d074ef57f80edff.tar.gz
Use -std=c++14 for compiling c++ code
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD9
-rw-r--r--ns-2.35-use-std-cpp14.patch36
3 files changed, 45 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f146fa38104a..7a746034f709 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ns
pkgdesc = Discrete event simulator targeted at networking research
pkgver = 2.35
- pkgrel = 8
+ pkgrel = 9
url = http://www.isi.edu/nsnam/ns/
arch = i686
arch = x86_64
@@ -16,11 +16,12 @@ pkgbase = ns
source = ns-2.35-tcl86.patch
source = ns-2.35-getopts.patch
source = ns-2.35-gcc-compile-errors.patch
+ source = ns-2.35-use-std-cpp14.patch
sha256sums = 2a32e831bcec7d255042a544577559d15eae67696d0e3d30881cedc1112e2387
sha256sums = aedba646d1bc4d716031f9ea996e6d99c9bb227e7647138cccf39bdd6c069c3a
sha256sums = 7aa4a22492f2be37c81fcdc813972a6bde105e183a013d7b814a56f7bcef872c
sha256sums = 4d02ff0cf1c79d67c440c788d7163c7c873a6e4e2970bab3319cbe29f9b20c14
sha256sums = d3a6e6bcc22ca9aa8f8901774eb58a4df3f2f4d6856a260561568a5a6d9f600e
+ sha256sums = 2fac6b24607dedfd8b96c70a9222f0b92318b2cf0cc1501caf8c1a796771547d
pkgname = ns
-
diff --git a/PKGBUILD b/PKGBUILD
index c9ce0074b8d1..57a6152a9d32 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=ns
pkgver=2.35
-pkgrel=8
+pkgrel=9
pkgdesc="Discrete event simulator targeted at networking research"
url="http://www.isi.edu/nsnam/ns/"
license=('GPL')
@@ -15,12 +15,14 @@ source=(http://downloads.sourceforge.net/sourceforge/nsnam/ns-2/"${pkgver}"/ns-s
ns-2.35-linkstate-erase.fix
ns-2.35-tcl86.patch
ns-2.35-getopts.patch
- ns-2.35-gcc-compile-errors.patch)
+ ns-2.35-gcc-compile-errors.patch
+ ns-2.35-use-std-cpp14.patch)
sha256sums=('2a32e831bcec7d255042a544577559d15eae67696d0e3d30881cedc1112e2387'
'aedba646d1bc4d716031f9ea996e6d99c9bb227e7647138cccf39bdd6c069c3a'
'7aa4a22492f2be37c81fcdc813972a6bde105e183a013d7b814a56f7bcef872c'
'4d02ff0cf1c79d67c440c788d7163c7c873a6e4e2970bab3319cbe29f9b20c14'
- 'd3a6e6bcc22ca9aa8f8901774eb58a4df3f2f4d6856a260561568a5a6d9f600e')
+ 'd3a6e6bcc22ca9aa8f8901774eb58a4df3f2f4d6856a260561568a5a6d9f600e'
+ '2fac6b24607dedfd8b96c70a9222f0b92318b2cf0cc1501caf8c1a796771547d')
optdepends=('nam: Tcl/TK based animation tool for viewing network simulation traces',
'xgraph: X-Windows application for interactive plotting and graphing')
@@ -31,6 +33,7 @@ prepare() {
patch -uNp1 -i ../ns-2.35-tcl86.patch
patch -uNp1 -i ../ns-2.35-getopts.patch
patch -uNp1 -i ../ns-2.35-gcc-compile-errors.patch
+ patch -uNp1 -i ../ns-2.35-use-std-cpp14.patch
}
build() {
diff --git a/ns-2.35-use-std-cpp14.patch b/ns-2.35-use-std-cpp14.patch
new file mode 100644
index 000000000000..b11eab984904
--- /dev/null
+++ b/ns-2.35-use-std-cpp14.patch
@@ -0,0 +1,36 @@
+From d35cb66b7b63cb2fee2314efc69fb5c550b6fa09 Mon Sep 17 00:00:00 2001
+From: Sergio Correia <scorreia@redhat.com>
+Date: Fri, 29 Jul 2022 19:25:25 -0300
+Subject: [PATCH] Use -std=c++14 for compiling c++ code
+
+---
+ Makefile.in | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 2e6ff5f..bf76943 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -84,6 +84,10 @@ LIB = \
+
+ CFLAGS += $(CCOPT) $(DEFINE)
+
++# It won't build with c++17, but it does with previous
++# ones, so let's use c++14 instead.
++CXXSTD = -std=c++14
++
+ # Explicitly define compilation rules since SunOS 4's make doesn't like gcc.
+ # Also, gcc does not remove the .o before forking 'as', which can be a
+ # problem if you don't own the file but can write to the directory.
+@@ -91,7 +95,7 @@ CFLAGS += $(CCOPT) $(DEFINE)
+
+ .cc.o:
+ @rm -f $@
+- $(CPP) -c $(CFLAGS) $(INCLUDES) -o $@ $*.cc
++ $(CPP) -c $(CFLAGS) $(CXXSTD) $(INCLUDES) -o $@ $*.cc
+
+ .c.o:
+ @rm -f $@
+--
+2.37.1
+