Create Ravenports release 20230101.1
[ravenports.git] / bucket_0D / sndio
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               sndio
4 VERSION=                1.9.0
5 KEYWORDS=               audio
6 VARIANTS=               standard
7 SDESC[standard]=        Small audio and MIDI framework from OpenBSD
8 HOMEPAGE=               http://www.sndio.org/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            http://www.sndio.org/
13 DISTFILE[1]=            sndio-1.9.0.tar.gz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        single
16
17 OPTIONS_AVAILABLE=      none
18 OPTIONS_STANDARD=       none
19
20 BROKEN[sunos]=          Needs err.h which is not available on Sol10
21
22 BR_DEPS[linux]=         libbsd:single:standard alsa-lib:single:standard
23
24 USERS=                  _sndio
25 GROUPS=                 _sndio
26 USERGROUP_SPKG=         single
27
28 LICENSE=                ISCL:single
29 LICENSE_FILE=           ISCL:{{WRKDIR}}/ISC_LICENSE
30 LICENSE_AWK=            ISCL:"^\#ifndef"
31 LICENSE_SOURCE=         ISCL:{{WRKSRC}}/libsndio/sndio.h
32 LICENSE_SCHEME=         solo
33
34 FPC_EQUIVALENT=         audio/sndio
35
36 MUST_CONFIGURE=         yes
37 CONFIGURE_ARGS=         --prefix={{PREFIX}}
38                         --mandir={{MANPREFIX}}/man
39
40 SINGLE_JOB=             yes
41
42 SOVERSION=              7.2
43 RC_SUBR=                sndiod:single
44
45 VAR_OPSYS[linux]=       CONFIGURE_ARGS= --with-libbsd
46
47 post-patch:
48         # Make sure sndiod can be started inside jails as root
49         ${REINPLACE_CMD} 's|err(1, "setpriority")|warn("setpriority")|' \
50                 ${WRKSRC}/sndiod/sndiod.c
51
52 post-patch-dragonfly:
53         ${REINPLACE_CMD} -e 's@\(FreeBSD\))@\1|DragonFly)@g' \
54                 ${WRKSRC}/configure
55
56 post-install:
57         ${STRIP_CMD} \
58                 ${STAGEDIR}${PREFIX}/lib/libsndio.${LIBEXT} \
59                 ${STAGEDIR}${PREFIX}/bin/sndioctl \
60                 ${STAGEDIR}${PREFIX}/bin/sndiod \
61                 ${STAGEDIR}${PREFIX}/bin/aucat \
62                 ${STAGEDIR}${PREFIX}/bin/midicat
63
64 [FILE:449:descriptions/desc.single]
65 Sndio is a small audio and MIDI framework part of the OpenBSD project.
66
67 It provides an lightweight audio & MIDI server and a fully documented
68 user-space API to access either the server or directly the hardware in
69 a uniform way.  Sndio is designed to work for desktop applications,
70 but pays special attention to synchronization mechanisms and
71 reliability required by music applications.  Reliability through
72 simplicity are part of the project goals.
73
74
75 [FILE:97:distinfo]
76 f30826fc9c07e369d3924d5fcedf6a0a53c0df4ae1f5ab50fe9cf280540f699a       157354 sndio-1.9.0.tar.gz
77
78
79 [FILE:823:manifests/plist.single]
80 bin/
81  aucat
82  midicat
83  sndioctl
84  sndiod
85 include/sndio.h
86 lib/
87  libsndio.so
88  libsndio.so.%%SOVERSION%%
89 lib/pkgconfig/sndio.pc
90 share/man/man1/
91  aucat.1.gz
92  midicat.1.gz
93  sndioctl.1.gz
94 share/man/man3/
95  mio_close.3.gz
96  mio_eof.3.gz
97  mio_nfds.3.gz
98  mio_open.3.gz
99  mio_pollfd.3.gz
100  mio_read.3.gz
101  mio_revents.3.gz
102  mio_write.3.gz
103  sio_close.3.gz
104  sio_eof.3.gz
105  sio_getcap.3.gz
106  sio_getpar.3.gz
107  sio_initpar.3.gz
108  sio_nfds.3.gz
109  sio_onmove.3.gz
110  sio_onvol.3.gz
111  sio_open.3.gz
112  sio_pollfd.3.gz
113  sio_read.3.gz
114  sio_revents.3.gz
115  sio_setpar.3.gz
116  sio_setvol.3.gz
117  sio_start.3.gz
118  sio_stop.3.gz
119  sio_write.3.gz
120  sioctl_close.3.gz
121  sioctl_eof.3.gz
122  sioctl_nfds.3.gz
123  sioctl_ondesc.3.gz
124  sioctl_onval.3.gz
125  sioctl_open.3.gz
126  sioctl_pollfd.3.gz
127  sioctl_revents.3.gz
128  sioctl_setval.3.gz
129 share/man/man7/sndio.7.gz
130 share/man/man8/sndiod.8.gz
131
132
133 [FILE:249:patches/patch-aucat_defs.h]
134 --- aucat/defs.h.orig   2022-07-16 09:38:24 UTC
135 +++ aucat/defs.h
136 @@ -17,6 +17,12 @@
137  #ifndef DEFS_H
138  #define DEFS_H
139  
140 +#ifdef __sun__
141 +#define BIG_ENDIAN 4321
142 +#define LITTLE_ENDIAN 1234
143 +#define BYTE_ORDER LITTLE_ENDIAN
144 +#endif
145 +
146  /*
147   * limits
148   */
149
150
151 [FILE:1228:patches/patch-configure]
152 --- configure.orig      2022-07-16 09:38:24 UTC
153 +++ configure
154 @@ -64,9 +64,9 @@ case `uname` in
155         Linux)
156                 alsa=yes
157                 ldadd="-lrt"
158 -               user=sndiod
159 -               so_link="libsndio.so libsndio.so.\${MAJ} libsndio.so.\${MAJ}.0"
160 -               so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}"
161 +               user=_sndio
162 +               so_link="libsndio.so"
163 +               so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}.\${MIN}"
164                 defs='-D_GNU_SOURCE -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
165                 ;;
166         NetBSD)
167 @@ -74,6 +74,7 @@ case `uname` in
168                 rmidi=yes
169                 user=_sndio
170                 so_link="libsndio.so"
171 +               so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}.\${MIN}"
172                 defs='-DHAVE_ARC4RANDOM -DHAVE_GETPEEREID -DHAVE_ISSETUGID \\\
173                 -DHAVE_STRLCAT -DHAVE_STRLCPY \\\
174                 -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
175 @@ -96,6 +97,17 @@ case `uname` in
176                 -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM \\\
177                 -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
178                 ;;
179 +       SunOS)
180 +               ldadd="-lrt -lsocket"
181 +               sun=no   # doesn't compile
182 +               umidi=yes
183 +               user=_sndio
184 +               so_ldflags="-Wl,-soname,libsndio.so.\${MAJ}.\${MIN}"
185 +               so_link="libsndio.so"
186 +               defs='-DHAVE_ISSETUGID -DO_CLOEXEC=0 \\\
187 +               -DHAVE_STRLCAT -DHAVE_STRLCPY \\\
188 +               -DSOCK_CLOEXEC=0 -DHAVE_CLOCK_GETTIME'
189 +               ;;
190         Darwin)
191                 rmidi=no
192                 so="libsndio.\${MAJ}.\${MIN}.dylib"
193
194
195 [FILE:1039:patches/patch-libsndio_aucat.c]
196 --- libsndio/aucat.c.orig       2022-07-16 09:38:24 UTC
197 +++ libsndio/aucat.c
198 @@ -43,6 +43,26 @@
199  #define DEV_RANDOM "/dev/urandom"
200  #endif
201  
202 +#ifdef __sun__
203 +#include <libgen.h>
204 +static const char *getprogname (void) {
205 +    static const char *progname;
206 +
207 +    if (progname == NULL) {
208 +        const char *e = getexecname();
209 +        if (e != NULL) {
210 +            /* Have to make a copy since getexecname can return a readonly
211 +               string, but basename expects to be able to modify its arg. */
212 +            char *n = strdup(e);
213 +            if (n != NULL) {
214 +                progname = basename(n);
215 +            }
216 +        }
217 +    }
218 +    return progname;
219 +}
220 +#endif
221 +
222  static int
223  random_bytes(unsigned char *buf, int len)
224  {
225 @@ -472,7 +492,11 @@ parsestr(const char *str, char *rstr, un
226  int
227  _aucat_open(struct aucat *hdl, const char *str, unsigned int mode)
228  {
229 +#ifdef __sun__
230 +       const char * __progname = getprogname();
231 +#else
232         extern char *__progname;
233 +#endif
234         int eof;
235         char host[NI_MAXHOST], opt[AMSG_OPTMAX];
236         const char *p;
237
238
239 [FILE:261:patches/patch-sndiod_defs.h]
240 --- sndiod/defs.h.orig  2022-07-16 09:38:24 UTC
241 +++ sndiod/defs.h
242 @@ -17,6 +17,12 @@
243  #ifndef DEFS_H
244  #define DEFS_H
245  
246 +#ifdef __sun__
247 +#define BIG_ENDIAN 4321
248 +#define LITTLE_ENDIAN 1234
249 +#define BYTE_ORDER LITTLE_ENDIAN
250 +#endif
251 +
252  /*
253   * MIDI buffer size
254   */
255
256
257 [FILE:465:files/sndiod.in]
258 #!/bin/sh
259 #
260 # $FreeBSD: head/audio/sndio/files/sndiod.in 427071 2016-11-25 01:11:41Z cpm $
261 #
262 # PROVIDE: sndiod
263 # REQUIRE: NETWORKING sysctl
264 # BEFORE:  DAEMON
265 # KEYWORD: shutdown
266
267 . /etc/rc.subr
268
269 name=sndiod
270 rcvar=sndiod_enable
271
272 load_rc_config $name
273
274 : ${sndiod_dev="rsnd/$($SYSCTL -n hw.snd.default_unit)"}
275 : ${sndiod_enable="NO"}
276 : ${sndiod_flags="-f ${sndiod_dev} -c 0:7 -j off -s default -m mon -s monitor"}
277
278 command="%%PREFIX%%/bin/sndiod"
279
280 run_rc_command "$1"
281