Skip to content

Commit

Permalink
net-misc/nx: fix compilation with clang
Browse files Browse the repository at this point in the history
Also fix ```VariableOrderWrong``` for the ```${S}``` variable

Link: ArcticaProject/nx-libs#1044
Link: https://trac.macports.org/ticket/71014
Closes: https://bugs.gentoo.org/930440
Signed-off-by: Cristian Othón Martínez Vera <[email protected]>
  • Loading branch information
cfuga committed Feb 10, 2025
1 parent 4751d14 commit 744bb12
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
17 changes: 17 additions & 0 deletions net-misc/nx/files/nx-3.5.99.26-clang-bind.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Fix:

Loop.cpp:4224:34: error: invalid operands to binary expression ('__bind<int &, sockaddr *&, unsigned int &>' and 'int')

https://github.com/ArcticaProject/nx-libs/issues/1044
https://bugs.gentoo.org/930440
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -4221,7 +4221,7 @@
goto SetupSocketError;
}

- if (bind(newFD, addr, addrlen) == -1)
+ if (::bind(newFD, addr, addrlen) == -1)
{
nxfatal << "Loop: PANIC! Call to bind failed for " << label
<< ". Error is " << EGET()
5 changes: 3 additions & 2 deletions net-misc/nx/nx-3.5.99.26.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ inherit autotools flag-o-matic toolchain-funcs
DESCRIPTION="NX compression technology core libraries"
HOMEPAGE="https://github.com/ArcticaProject/nx-libs"
SRC_URI="https://github.com/ArcticaProject/nx-libs/archive/${PV}.tar.gz -> nx-libs-${PV}.tar.gz"
S="${WORKDIR}/nx-libs-${PV}"

LICENSE="GPL-2"
SLOT="0"
Expand Down Expand Up @@ -41,8 +42,6 @@ BDEPEND="virtual/pkgconfig

RDEPEND+=" selinux? ( sec-policy/selinux-nx )"

S="${WORKDIR}/nx-libs-${PV}"

PATCHES=(
# https://github.com/ArcticaProject/nx-libs/pull/1012
"${FILESDIR}/${PN}-3.5.99.26-binutils-2.36.patch"
Expand All @@ -53,6 +52,8 @@ PATCHES=(
# https://github.com/ArcticaProject/nx-libs/pull/1087
"${FILESDIR}/${PN}-3.5.99.26-gcc14-32bit.patch"
"${FILESDIR}/${PN}-3.5.99.26-gcc14-access.patch"
# https://github.com/ArcticaProject/nx-libs/issues/1044
"${FILESDIR}/${PN}-3.5.99.26-clang-bind.patch"
)

src_prepare() {
Expand Down
5 changes: 3 additions & 2 deletions net-misc/nx/nx-3.5.99.27.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DESCRIPTION="NX compression technology core libraries"
HOMEPAGE="https://github.com/ArcticaProject/nx-libs"

SRC_URI="https://github.com/ArcticaProject/nx-libs/archive/${PV}.tar.gz -> nx-libs-${PV}.tar.gz"
S="${WORKDIR}/nx-libs-${PV}"

LICENSE="GPL-2"
SLOT="0"
Expand Down Expand Up @@ -39,14 +40,14 @@ BDEPEND="virtual/pkgconfig
x11-misc/gccmakedep
x11-misc/imake"

S="${WORKDIR}/nx-libs-${PV}"

PATCHES=(
"${FILESDIR}/${PN}-3.5.99.26-musl.patch"
"${FILESDIR}/${PN}-3.5.99.27-which.patch"
# https://github.com/ArcticaProject/nx-libs/pull/1087
"${FILESDIR}/${PN}-3.5.99.26-gcc14-32bit.patch"
"${FILESDIR}/${PN}-3.5.99.26-gcc14-access.patch"
# https://github.com/ArcticaProject/nx-libs/issues/1044
"${FILESDIR}/${PN}-3.5.99.26-clang-bind.patch"
)

src_prepare() {
Expand Down

0 comments on commit 744bb12

Please sign in to comment.