aboutsummaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2021-02-17 17:37:42 +0000
committerMikhail Teterin <mi@FreeBSD.org>2021-02-17 17:37:42 +0000
commit5df8661a4a9d84c3a67e0a3ef97863d7339fd5d8 (patch)
treed2ff04d11bfd946df04bb5fb078ae4f636098e17 /lang
parentbfbfe8e87ee4e2e599b7fdd7912be967759a559c (diff)
downloadports-5df8661a4a9d84c3a67e0a3ef97863d7339fd5d8.tar.gz
ports-5df8661a4a9d84c3a67e0a3ef97863d7339fd5d8.zip
Notes
Diffstat (limited to 'lang')
-rw-r--r--lang/siod/Makefile11
-rw-r--r--lang/siod/files/patch-statfs97
-rw-r--r--lang/siod/pkg-plist1
3 files changed, 107 insertions, 2 deletions
diff --git a/lang/siod/Makefile b/lang/siod/Makefile
index 8e7bd8284a1f..db2af73ba09e 100644
--- a/lang/siod/Makefile
+++ b/lang/siod/Makefile
@@ -18,12 +18,14 @@ USES= uidfix tar:tgz dos2unix
USE_LDCONFIG= ${PREFIX}/lib ${PREFIX}/lib/siod
DOS2UNIX_FILES= sql_oracle.c ss.c
-OPTIONS_DEFINE= SQL_SYBASE GD NDBM REGEX SS DOCS
+OPTIONS_DEFINE= SQL_SYBASE GD NDBM REGEX SS STATFS DOCS
OPTIONS_DEFINE_i386=SQL_ORACLE # oracle-client port only available for i386
OPTIONS_DEFAULT=NDBM REGEX SS
+SQL_ORACLE_DESC=Build Oracle client-module (i386 only)
SQL_SYBASE_DESC=Build Sybase (and MS-SQL) client-module (using FreeTDS)
SS_DESC= Sockets support - required for any network programs
NDBM_DESC= Support for NDBM-databases
+STATFS_DESC= Module giving access to statfs(2)
NO_WRKSUBDIR= yes
EXTRACT_AFTER_ARGS=--exclude md5\* --exclude regex.h --exclude reg????*.c
MAKE_ARGS= VPATH=${WRKSRC} MODULES=${MODULES:Q}
@@ -33,7 +35,7 @@ MAKE_ENV+= MAN1PREFIX=${MAN1PREFIX} PREFIX=${PREFIX:Q}
MAKE_ENV+= INSTALL_MAN=${INSTALL_MAN:Q} INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
MAKE_ENV+= INSTALL_DATA=${INSTALL_DATA:Q}
-MODULES= tar parser_pratt
+MODULES= statfs tar parser_pratt
SQL_SYBASE_LIB_DEPENDS= libct.so:databases/freetds # Or freetds-devel
GD_LIB_DEPENDS= libgd.so:graphics/gd # Or ukrainian/gd
@@ -55,6 +57,11 @@ post-build:
.include <bsd.port.options.mk>
MODULES+= ${SELECTED_OPTIONS:NDOCS:tl}
+# XXX This should not be necessary:
+.if ${ARCH} != i386
+PLIST_SUB+= SQL_ORACLE=@comment
+.endif
+
do-configure:
${MKDIR} ${WRKSRC}/lib
${LN} -sf ${FILESDIR}/BSDmakefile.lib ${WRKSRC}/lib/BSDmakefile
diff --git a/lang/siod/files/patch-statfs b/lang/siod/files/patch-statfs
new file mode 100644
index 000000000000..4e5045120875
--- /dev/null
+++ b/lang/siod/files/patch-statfs
@@ -0,0 +1,97 @@
+--- statfs.c 2014-03-25 04:10:42.000000000 -0400
++++ statfs.c 2021-02-17 12:25:44.681462000 -0500
+@@ -4,9 +4,15 @@
+
+ #include <stdio.h>
++#ifdef HAVE_SYS_PARAM_H
++#include <sys/param.h>
++#endif
+ #include <sys/mount.h>
++#ifndef BSD
+ #include <sys/fs_types.h>
++#endif
+ #include <fstab.h>
+ #include "siod.h"
+
++#ifndef BSD
+ #define MNT_NUMTYPES 128
+ /*
+@@ -14,16 +20,28 @@
+ */
+ extern char *mnt_names[];
++#endif
+
+-LISP lstatfs(LISP path)
++static LISP lstatfs(LISP path)
+ {long iflag;
+ struct statfs s;
+ iflag = no_interrupt(1);
+- if (statfs(get_c_string(path),&s,sizeof(s)))
++ if (statfs(get_c_string(path), &s
++#ifndef BSD
++ ,sizeof(s)
++#endif
++ ))
+ return(err("statfs",llast_c_errmsg(-1)));
++
+ no_interrupt(iflag);
+- return(symalist("type",(((s.f_type >= 0) && (s.f_type < MNT_NUMTYPES) &&
++ return(symalist("type",
++#ifdef BSD
++ s.f_fstypename[0] != '\0'
++ ? rintern(s.f_fstypename)
++#else
++ ((s.f_type >= 0) && (s.f_type < MNT_NUMTYPES) &&
+ mnt_names[s.f_type])
+ ? rintern(mnt_names[s.f_type])
+- : flocons(s.f_type)),
++#endif
++ : flocons(s.f_type),
+ "bsize",flocons(s.f_bsize),
+ "blocks",flocons(s.f_blocks),
+@@ -34,8 +52,16 @@
+ "mntonname",strcons(-1,s.f_mntonname),
+ "mntfromname",strcons(-1,s.f_mntfromname),
++#ifdef BSD
++ "syncwrites", flocons(s.f_syncwrites),
++ "asyncwrites", flocons(s.f_asyncwrites),
++ "syncreads", flocons(s.f_syncreads),
++ "asyncreads", flocons(s.f_asyncreads),
++ "namemax", flocons(s.f_namemax),
++#endif
++ /* TODO: Add decoding of f_flags */
+ NULL));}
+
+
+-static LISP decode_fstab(struct fstab *p)
++static LISP decode_fstab(const struct fstab *p)
+ {if (p)
+ return(symalist("spec",strcons(-1,p->fs_spec),
+@@ -50,5 +76,5 @@
+ return(NIL);}
+
+-LISP lgetfsent(void)
++static LISP lgetfsent(void)
+ {long iflag;
+ LISP result;
+@@ -58,5 +84,5 @@
+ return(result);}
+
+-LISP lsetfsent(void)
++static LISP lsetfsent(void)
+ {long iflag;
+ LISP result;
+@@ -66,5 +92,5 @@
+ return(result);}
+
+-LISP lendfsent(void)
++static LISP lendfsent(void)
+ {long iflag;
+ iflag = no_interrupt(1);
+@@ -73,4 +99,6 @@
+ return(NIL);}
+
++void init_statfs(void); /* The sole symbol exported from a SIOD-module */
++
+ void init_statfs(void)
+ {init_subr_1("statfs",lstatfs);
diff --git a/lang/siod/pkg-plist b/lang/siod/pkg-plist
index 20d43bd43e20..648443d78f6c 100644
--- a/lang/siod/pkg-plist
+++ b/lang/siod/pkg-plist
@@ -36,6 +36,7 @@ lib/siod/sql_msql.scm
%%GD%%lib/siod/gd.so
%%NDBM%%lib/siod/ndbm.so
%%SS%%lib/siod/ss.so
+lib/siod/statfs.so
lib/siod/tar.so
%%SQL_ORACLE%%lib/siod/sql_oracle.so
%%SQL_SYBASE%%lib/siod/sql_sybase.so