2018-03-31 12:39:20 +01:00
|
|
|
{ stdenv, fetchurl, fetchpatch, meson, ninja
|
2018-12-02 11:41:15 +00:00
|
|
|
, pkgconfig, gettext, gobject-introspection
|
2018-03-31 12:39:20 +01:00
|
|
|
, bison, flex, python3, glib, makeWrapper
|
|
|
|
, libcap,libunwind, darwin
|
2019-01-21 01:48:04 +00:00
|
|
|
, elfutils # for libdw
|
|
|
|
, bash-completion
|
|
|
|
, docbook_xsl, docbook_xml_dtd_412
|
|
|
|
, gtk-doc
|
2018-04-23 18:31:36 +01:00
|
|
|
, lib
|
2019-06-21 19:01:33 +01:00
|
|
|
, CoreServices
|
2013-12-23 15:36:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gstreamer";
|
2019-05-01 15:10:36 +01:00
|
|
|
version = "1.16.0";
|
2013-12-23 15:36:37 +00:00
|
|
|
|
2018-04-23 18:31:36 +01:00
|
|
|
meta = with lib ;{
|
2013-12-23 15:36:37 +00:00
|
|
|
description = "Open source multimedia framework";
|
2017-09-16 20:28:31 +01:00
|
|
|
homepage = https://gstreamer.freedesktop.org;
|
2018-04-23 18:31:36 +01:00
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ ttuegel matthewbauer ];
|
2013-12-23 15:36:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "${meta.homepage}/src/gstreamer/${pname}-${version}.tar.xz";
|
2019-05-01 15:10:36 +01:00
|
|
|
sha256 = "003wy1p1in85p9sr5jsyhbnwqaiwz069flwkhyx7qhxy31qjz3hf";
|
2013-12-23 15:36:37 +00:00
|
|
|
};
|
|
|
|
|
2018-04-23 18:31:36 +01:00
|
|
|
patches = [
|
2018-03-31 12:39:20 +01:00
|
|
|
./fix_pkgconfig_includedir.patch
|
|
|
|
];
|
|
|
|
|
2016-08-29 01:30:01 +01:00
|
|
|
outputs = [ "out" "dev" ];
|
2016-04-26 19:39:57 +01:00
|
|
|
outputBin = "dev";
|
2016-04-24 13:39:30 +01:00
|
|
|
|
2013-12-23 15:36:37 +00:00
|
|
|
nativeBuildInputs = [
|
2018-12-02 11:41:15 +00:00
|
|
|
meson ninja pkgconfig gettext bison flex python3 makeWrapper gobject-introspection
|
2019-01-21 01:48:04 +00:00
|
|
|
bash-completion
|
|
|
|
gtk-doc
|
|
|
|
# Without these, enabling the 'gtk_doc' gives us `FAILED: meson-install`
|
|
|
|
docbook_xsl docbook_xml_dtd_412
|
2013-12-23 15:36:37 +00:00
|
|
|
];
|
2019-01-21 01:48:04 +00:00
|
|
|
|
2019-06-22 00:04:05 +01:00
|
|
|
buildInputs =
|
|
|
|
lib.optionals stdenv.isLinux [ libcap libunwind elfutils ]
|
2019-06-21 19:01:33 +01:00
|
|
|
++ lib.optional stdenv.isDarwin CoreServices;
|
2013-12-23 15:36:37 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ glib ];
|
2014-02-28 01:03:07 +00:00
|
|
|
|
2019-01-21 01:48:04 +00:00
|
|
|
mesonFlags = [
|
|
|
|
# Enables all features, so that we know when new dependencies are necessary.
|
2019-06-22 00:04:05 +01:00
|
|
|
"-Dauto_features=enabled"
|
2019-05-01 15:10:36 +01:00
|
|
|
"-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
|
2019-01-21 01:48:04 +00:00
|
|
|
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
|
2019-06-21 19:01:33 +01:00
|
|
|
]
|
|
|
|
# darwin.libunwind doesn't have pkgconfig definitions so meson doesn't detect it.
|
2019-06-22 00:04:05 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ "-Dlibunwind=disabled" "-Dlibdw=disabled" ];
|
2019-01-21 01:48:04 +00:00
|
|
|
|
2015-01-19 21:49:22 +00:00
|
|
|
postInstall = ''
|
2016-11-06 21:50:41 +00:00
|
|
|
for prog in "$dev/bin/"*; do
|
2019-01-19 21:05:58 +00:00
|
|
|
# We can't use --suffix here due to quoting so we craft the export command by hand
|
|
|
|
wrapProgram "$prog" --run "export GST_PLUGIN_SYSTEM_PATH=\$GST_PLUGIN_SYSTEM_PATH"$\{GST_PLUGIN_SYSTEM_PATH:+:\}"\$(unset _tmp; for profile in \$NIX_PROFILES; do _tmp="\$profile/lib/gstreamer-1.0''$\{_tmp:+:\}\$_tmp"; done; printf "\$_tmp")"
|
2015-01-19 21:49:22 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2019-05-01 15:10:36 +01:00
|
|
|
preConfigure=
|
|
|
|
# These files are not executable upstream, so we need to
|
|
|
|
# make them executable for `patchShebangs` to pick them up.
|
|
|
|
# Can be removed when this is merged and available:
|
|
|
|
# https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/141
|
|
|
|
''
|
|
|
|
chmod +x gst/parse/get_flex_version.py
|
|
|
|
'' +
|
|
|
|
''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
2018-03-31 12:39:20 +01:00
|
|
|
|
2016-04-24 13:39:30 +01:00
|
|
|
preFixup = ''
|
|
|
|
moveToOutput "share/bash-completion" "$dev"
|
|
|
|
'';
|
|
|
|
|
2014-02-28 01:03:07 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
2013-12-23 15:36:37 +00:00
|
|
|
}
|