Skip to content

Commit 1810008

Browse files
Add enet.
1 parent 0b238b8 commit 1810008

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

enet/VITABUILD

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
pkgname=enet
2+
pkgver=1.3.18
3+
pkgrel=1
4+
url="https://github.com/lsalzman/enet"
5+
source=("https://github.com/lsalzman/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz" "enet.patch")
6+
sha256sums=('28603c895f9ed24a846478180ee72c7376b39b4bb1287b73877e5eae7d96b0dd')
7+
8+
build() {
9+
cd $pkgname-$pkgver
10+
patch unix.c "${srcdir}/enet.patch"
11+
cmake -DCMAKE_TOOLCHAIN_FILE=$VITASDK/share/vita.toolchain.cmake
12+
make -j$(nproc)
13+
}
14+
15+
package () {
16+
cd $pkgname-$pkgver
17+
cp lib$pkgname.a $pkgdir/$VITASDK/arm-vita-eabi/lib/
18+
cp include/$pkgname $pkgdir/$VITASDK/arm-vita-eabi/include/
19+
}

enet/enet.patch

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--- unix.c 2024-04-15 05:06:53.000000000 +0200
2+
+++ unix.c 2024-06-09 13:46:43.009847600 +0200
3+
@@ -6,7 +6,9 @@
4+
5+
#include <sys/types.h>
6+
#include <sys/socket.h>
7+
+#ifndef __vita__
8+
#include <sys/ioctl.h>
9+
+#endif
10+
#include <sys/time.h>
11+
#include <netinet/tcp.h>
12+
#include <netdb.h>
13+
@@ -303,11 +305,15 @@
14+
switch (option)
15+
{
16+
case ENET_SOCKOPT_NONBLOCK:
17+
+#ifdef __vita__
18+
+ result = setsockopt (socket, SOL_SOCKET, SO_NONBLOCK, (char *) & value, sizeof (int));
19+
+#else
20+
#ifdef HAS_FCNTL
21+
result = fcntl (socket, F_SETFL, (value ? O_NONBLOCK : 0) | (fcntl (socket, F_GETFL) & ~O_NONBLOCK));
22+
#else
23+
result = ioctl (socket, FIONBIO, & value);
24+
#endif
25+
+#endif
26+
break;
27+
28+
case ENET_SOCKOPT_BROADCAST:

0 commit comments

Comments
 (0)