Skip to content

Commit

Permalink
samba4: fix build with gcc14 and on older OS
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Dec 9, 2024
1 parent bff380a commit 3f93991
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion net/samba4/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ distname samba-${version}

perl5.major 5.34

depends_build port:pkgconfig \
depends_build path:bin/pkg-config:pkgconfig \
port:gettext \
port:bison

Expand Down Expand Up @@ -81,6 +81,9 @@ patchfiles-append patch-samba-install.diff
# https://bugzilla.samba.org/show_bug.cgi?id=15763
patchfiles-append patch-ldb-wscript.diff

# Add a missing header for renameat.
patchfiles-append patch-vfs_default.c.diff

configure.perl ${perl5.bin}
configure.python ${prefix}/bin/python3.12
configure.env-append \
Expand All @@ -98,6 +101,12 @@ configure.args -C \
--with-gpgme \
--disable-spotlight

# https://trac.macports.org/ticket/71494
if {[string match *gcc* ${configure.compiler}]} {
configure.cflags-append \
-Wno-error=incompatible-pointer-types
}

build.pre_args
build.env-append PYTHON=${configure.python} DESTDIR=${destroot}

Expand Down
10 changes: 10 additions & 0 deletions net/samba4/files/patch-vfs_default.c.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- source3/modules/vfs_default.c
+++ source3/modules/vfs_default.c 2024-12-09 15:33:36.000000000 +0800
@@ -37,6 +37,7 @@
#include "offload_token.h"
#include "util_reparse.h"
#include "lib/util/string_wrappers.h"
+#include <sys/stdio.h> /* renameat */

#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS

0 comments on commit 3f93991

Please sign in to comment.