summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2023-02-08 23:52:11 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2023-02-17 15:29:33 -0500
commite677d82a9c7fd44c944e06c90e50436349c91144 (patch)
tree9dc9888d7012310bd424873122f6e2d4771eb008
parentff44678204248626af7f1f9c65ba5149ce643620 (diff)
[gst-plugins-bad]: tweak for armv7h and i686
-rw-r--r--libre/gst-plugins-bad/PKGBUILD102
1 files changed, 79 insertions, 23 deletions
diff --git a/libre/gst-plugins-bad/PKGBUILD b/libre/gst-plugins-bad/PKGBUILD
index 3d3fafd96..610dd6958 100644
--- a/libre/gst-plugins-bad/PKGBUILD
+++ b/libre/gst-plugins-bad/PKGBUILD
@@ -10,19 +10,20 @@
# parabola changes and rationale:
# libre:
# - removed support for non-free 'faac' codec
-# - removed 'nvidia-utils' from optdepends
-# - adapt pkgdesc variable substitutions in package() functions
-# - disable 'svthevcenc' for 32-bit arches
+# - disabled tests which require networking
# technical:
-# - disable tests which require networking
-# - FIXME: disable 'opencv' - package FTBS
+# - disabled 'svthevcenc' for 32-bit arches
+# - disabled 'msdk' for armv7h
+# - disabled 'qsv' for armv7h
+# - FIXME: disabled 'opencv' - package FTBS
# /usr/include/opencv4/opencv2/tracking/tracking_internals.hpp:18:10:
# fatal error: opencv2/video/detail/tracking.private.hpp: No such file or directory
# NOTE: This PKGBUILD is kept in-sync, as closely as possible,
# with arch{,arm,32} (gstreamer), for the sake of documentation and cleaner diffs.
-# However, only the small sub-set which require FSDG treatments are compiled.
# That also helps to identify which changes were made by Parabola vs upstream.
+# However, only the small sub-set of split-packages which require FSDG treatments
+# are compiled; and some noisy/irrelevant segments are deleted entirely.
# Therefore, this PKGBUILD may declare blacklisted dependencies, non-free sources,
# or include code for anti-features; but those will be filtered-out subsequently.
# Any code which implements an anti-feature should be commented-out;
@@ -38,6 +39,10 @@ pkgname=(gst-plugins-bad-libs gst-plugins-bad gst-plugin-opencv gst-plugin-wpe)
pkgname=( ${pkgname[*]/gst-plugin-opencv/} ) # FIXME: 'opencv' package FTBS - undefined reference to `cblas_{c,d,s,z}gemm'
pkgver=1.22.0
pkgrel=3
+_pkgver_i686=1.20.5 # NOTE: v1.20.5 fails to compile for i686 - after this moves ahead,
+_pkgrel_i686=3.0 # try to remove the LOCs with comment: # n/a in v1.20.5
+[[ "${CARCH}" == i686 ]] && eval "pkgver=\$_pkgver_${CARCH}" # our different arches do not
+[[ "${CARCH}" == i686 ]] && eval "pkgrel=\$_pkgrel_${CARCH}" # always roll at the same speed
pkgrel+=.parabola1
pkgdesc="Multimedia graph framework"
url="https://gstreamer.freedesktop.org/"
@@ -89,46 +94,64 @@ _sed_fail() # ("match_rx" "replace_rx" "target_file")
local match_rx="$1"
local replace_rx="$2"
local target_file="$3"
+ local sed_cmd="/${match_rx}/{s//${replace_rx}/ ; h} ; \${x ; /./{x ; q0} ; x ; q1} ;"
+ local err_msg="\`sed\` replace failure in: ${FUNCNAME[1]}() at line: ${BASH_LINENO[1]}"
+ local err_loc=" > ${BASH_LINENO[1]}: $(tail -n +${BASH_LINENO[1]} ${BASH_SOURCE[1]} | head -n 1)"
local exit_code
- echo "\`sed\` replace - processing: '${target_file}'"
- sed -i "/${match_rx}/{s//${replace_rx}/ ; h} ; \${x ; /./{x ; q0} ; x ; q1} ;" ${target_file}
+ echo -n "\`sed\` replace processing: '${target_file}' .... "
+ if sed -i "${sed_cmd}" ${target_file}
+ then exit_code=$? ; echo DONE ;
+ else exit_code=$? ; echo FAIL ; echo -e "${err_msg}\n${err_loc}" ;
+ fi
+
+ return $exit_code
}
prepare()
{
+ # NOTE: for some reason, the trick below works for armv7h, but not x86_64
+ # the sed replace succeeds, but the disabled tests run anyways (and fail)
+# OTOH, dont think it works for armv7h either
+ [[ "${CARCH}" != x86_64 ]] || return 0
+
cd gstreamer
# disable tests which require networking
local target_file=subprojects/gst-plugins-bad/tests/check/meson.build
- _sed_fail "\(\[\['elements\/webrtcbin\.c'\], \)not libnice_dep\.found()," \
- "\1false ," ${target_file}
_sed_fail "\(\[\['elements\/rtpsrc\.c'\], \)get_option('rtp').disabled()]," \
"\1false]," ${target_file}
_sed_fail "\(\[\['elements\/rtpsink\.c'\], \)get_option('rtp').disabled()]," \
"\1false]," ${target_file}
+ [[ "${CARCH}" == i686 ]] || # srtp.c n/a in v1.20.5
_sed_fail "\(\[\['elements\/srtp\.c'\], \)not srtp_dep.found()," \
"\1false ," ${target_file}
+ _sed_fail "\(\[\['elements\/webrtcbin\.c'\], \)not libnice_dep\.found()," \
+ "\1false ," ${target_file}
}
build() {
+ ## build configuration ##
+
local meson_options=(
# Superproject options
- -D devtools=disabled
+ -D devtools=disabled # n/a (deleted below)
-D doc=disabled
- -D examples=disabled
+ -D examples=disabled # n/a (deleted below)
-D gobject-cast-checks=disabled
-D gpl=enabled
- -D gst-examples=disabled
- -D libnice=disabled
- -D orc-source=system
- -D package-origin="https://www.parabola.nu/"
- -D vaapi=enabled
+ -D gst-examples=disabled # n/a (deleted below)
+ -D libnice=disabled # n/a (deleted below)
+ -D orc-source=system # n/a (deleted below)
+ -D package-origin="https://www.archlinux.org/"
+ -D vaapi=enabled # n/a (deleted below)
# Package names
- -D gst-plugins-bad:package-name="Parabola GNU/Linux-libre gst-plugins-bad $pkgver-$pkgrel"
+ # NOTE: we want only the 'gst-plugins-bad:' entries here
+ -D gst-plugins-bad:package-name="Arch Linux gst-plugins-bad $pkgver-$pkgrel"
# Subproject options
+ # NOTE: we want only the 'gst-plugins-bad:' entries here
-D gst-plugins-bad:amfcodec=disabled
-D gst-plugins-bad:directfb=disabled
-D gst-plugins-bad:directshow=disabled
@@ -151,22 +174,55 @@ build() {
-D gst-plugins-bad:win32ipc=disabled
)
- # parabola tweaks
+
+ ## parabola over-rides ##
+
meson_options=( "${meson_options[@]/gst-plugins-bad:/}" )
+
+ # over-rides to "Superproject options"
+ meson_options=( "${meson_options[@]/devtools=disabled/faac=disabled}" )
+ meson_options=( "${meson_options[@]/gst-examples=disabled/faac=disabled}" )
+ meson_options=( "${meson_options[@]/examples=disabled/faac=disabled}" )
+ meson_options=( "${meson_options[@]/libnice=disabled/faac=disabled}" )
+ meson_options=( "${meson_options[@]/orc-source=system/faac=disabled}" )
+ meson_options=( "${meson_options[@]/vaapi=enabled/faac=disabled}" )
+ meson_options=( "${meson_options[@]/archlinux.org/parabola.nu}" )
+
+ # over-rides to "Package names"
+ meson_options=( "${meson_options[@]/Arch Linux/Parabola GNU\/Linux-libre}" )
+
+ # over-rides to "Subproject options"
+ if [[ "${CARCH}" == i686 ]]
+ then meson_options=( "${meson_options[@]/amfcodec=disabled/faac=disabled}" ) # n/a in v1.20.5
+ meson_options=( "${meson_options[@]/directshow=disabled/faac=disabled}" ) # n/a in v1.20.5
+ meson_options=( "${meson_options[@]/wic=disabled/faac=disabled}" ) # n/a in v1.20.5
+ meson_options=( "${meson_options[@]/win32ipc=disabled/faac=disabled}" ) # n/a in v1.20.5
+ fi
+
+ # libre options
+ meson_options+=( -D faac=disabled ) # non-free
+
+ # arch-specific options
meson_options+=(
- -D faac=disabled # non-free
- $( [[ "${CARCH}" == x86_64 ]] || echo '-D svthevcenc=disabled' ) # x86_64 only
+ $( case "${CARCH}" in armv7h) echo '-D msdk=disabled' # x86_64 only
+ echo '-D qsv=disabled' # x86 only
+ echo '-D svthevcenc=disabled' ;; # x86_64 only
+ i686 ) echo '-D msdk=disabled' # x86_64 only
+ echo '-D svthevcenc=disabled' ;; # x86_64 only
+ esac )
)
+ # emergency options :(
meson_options+=(-D opencv=disabled) # FIXME: 'opencv' package FTBS - undefined reference to `cblas_{c,d,s,z}gemm'
+
+ ## build ##
+
arch-meson gstreamer/subprojects/${pkgbase} build "${meson_options[@]}"
meson configure build # Print config
meson compile -C build
}
check() (
-# (( _SHOULD_RUN_TESTS )) || return
-
mkdir -p -m 700 "${XDG_RUNTIME_DIR:=$PWD/runtime-dir}"
export XDG_RUNTIME_DIR