### this file is sourced not run
PKGVER=2023.06.20
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=live555.$PKGVER.tar.gz
MD5SUM=687acb4c517a09e48ffde6f2ad883d0b
SRC_URL=http://www.live555.com/liveMedia/public/live.$PKGVER.tar.gz
BUNDLE=

SLACKREQ=
SLACKDESC="liblive555: liblive555 $PKGVER (RTP/RTSP/SIP Library)
liblive555:
liblive555: This code forms a set of C++ libraries for multimedia streaming,
liblive555: using open standard protocols (RTP/RTCP, RTSP, SIP).
liblive555:
liblive555: http://www.live555.com/liveMedia/
liblive555:
liblive555:
liblive555:
liblive555:
liblive555:
"

### default pkg_download
### default pkg_prepare
### package
pkg_package() {
	# delete all the test and example programs
	cd ./usr/bin &&
	rm -f test* MPEG2TransportStreamIndexer registerRTSPStream vobStreamer
}

### build
pkg_build() {
	cd /tmp/live* &&
	
	# 2023.06.20 no build unless NO_STD_LIB is defined
	# see relevant changelog.txt below
	# the C++ compiler feature it needs only exist in c++20 standard, so don't enable it yet
	sed -i -e 's/^COMPILE_OPTS =.*/& -DNO_STD_LIB/' config.* &&

	./genMakefiles linux-with-shared-libraries &&
	MAKEFLAGS="PREFIX=/usr LIBDIR=/usr/$LIBDIR"
	make $MAKEFLAGS &&
	make $MAKEFLAGS install &&

	pkg_build_slackdesc
}

# 2023.06.20:
# - Updated the event trigger implementation again - in the case where "NO_STD_LIB" is
#   defined.  In this case, "fTriggersAwaitingHandling" is implemented as an array of
#   "Boolean volatile"s, rather than as a 32-bit bitmap.  This should make 'race conditions'
#   less likely even if "NO_STD_LIB" is defined (though you should use the preferred, default
#   implementation - that uses an array of "std::atomic_flag"s - if possible).
# 2023.06.16:
# - Changed the (default) implementation of 'event triggers' in "BasicTaskScheduler" to
#   implement "fTriggersAwaitingHandling" using "std:atomic_flag"s, rather than as a bitmap.
#   This should overcome 'race conditions' that some users experienced when calling
#   "triggerEvent()" from a non-LIVE555 thread.  (Thanks to Jan RÃ¸rgaard Hansen for reporting
#   this issue.)
#   Note that this is the first time the LIVE555 code has required the C++ standard library.
#   (If you cannot use the C++ standard library, then you can compile the code - but getting the
#   old behavior - by defining "NO_STD_LIB".)

# vim:ft=sh:
