2019-10-02 12:03:58 -05:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, meson
|
|
|
|
, ninja
|
2021-01-18 22:50:56 -08:00
|
|
|
, pkg-config
|
2019-10-02 12:03:58 -05:00
|
|
|
, gettext
|
|
|
|
, gobject-introspection
|
|
|
|
, bison
|
|
|
|
, flex
|
|
|
|
, python3
|
|
|
|
, glib
|
|
|
|
, makeWrapper
|
|
|
|
, libcap
|
|
|
|
, libunwind
|
|
|
|
, darwin
|
2019-01-21 02:48:04 +01:00
|
|
|
, elfutils # for libdw
|
|
|
|
, bash-completion
|
2018-04-23 12:31:36 -05:00
|
|
|
, lib
|
2019-06-21 20:01:33 +02:00
|
|
|
, CoreServices
|
2013-12-23 23:36:37 +08:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gstreamer";
|
2020-12-07 01:15:03 +00:00
|
|
|
version = "1.18.2";
|
2013-12-23 23:36:37 +08:00
|
|
|
|
2020-10-02 00:31:58 +02:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
# "devdoc" # disabled until `hotdoc` is packaged in nixpkgs, see:
|
|
|
|
# - https://github.com/NixOS/nixpkgs/pull/98767
|
|
|
|
# - https://github.com/NixOS/nixpkgs/issues/98769#issuecomment-702296551
|
|
|
|
];
|
2019-10-02 12:03:58 -05:00
|
|
|
outputBin = "dev";
|
2013-12-23 23:36:37 +08:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-10-02 11:59:16 -05:00
|
|
|
url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
|
2020-12-07 01:15:03 +00:00
|
|
|
sha256 = "0ijlmvr660m8zn09xlmnq1ajrziqsivp2hig5a9mabhcjx7ypkb6";
|
2013-12-23 23:36:37 +08:00
|
|
|
};
|
|
|
|
|
2018-04-23 12:31:36 -05:00
|
|
|
patches = [
|
2018-03-31 13:39:20 +02:00
|
|
|
./fix_pkgconfig_includedir.patch
|
|
|
|
];
|
|
|
|
|
2013-12-23 23:36:37 +08:00
|
|
|
nativeBuildInputs = [
|
2019-10-02 12:03:58 -05:00
|
|
|
meson
|
|
|
|
ninja
|
2021-01-18 22:50:56 -08:00
|
|
|
pkg-config
|
2019-10-02 12:03:58 -05:00
|
|
|
gettext
|
|
|
|
bison
|
|
|
|
flex
|
|
|
|
python3
|
|
|
|
makeWrapper
|
2020-02-24 21:47:55 -05:00
|
|
|
glib
|
2019-10-02 12:03:58 -05:00
|
|
|
gobject-introspection
|
2019-01-21 02:48:04 +01:00
|
|
|
bash-completion
|
2019-10-02 12:03:58 -05:00
|
|
|
|
|
|
|
# documentation
|
2020-10-02 00:31:58 +02:00
|
|
|
# TODO add hotdoc here
|
2013-12-23 23:36:37 +08:00
|
|
|
];
|
2019-01-21 02:48:04 +01:00
|
|
|
|
2020-02-24 21:47:55 -05:00
|
|
|
buildInputs = [
|
|
|
|
bash-completion
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2019-10-02 12:03:58 -05:00
|
|
|
libcap
|
|
|
|
libunwind
|
|
|
|
elfutils
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreServices
|
|
|
|
];
|
2013-12-23 23:36:37 +08:00
|
|
|
|
2019-10-02 12:03:58 -05:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
];
|
2014-02-28 02:03:07 +01:00
|
|
|
|
2019-01-21 02:48:04 +01:00
|
|
|
mesonFlags = [
|
2019-05-01 16:10:36 +02:00
|
|
|
"-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
|
2019-01-21 02:48:04 +01:00
|
|
|
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
|
2020-10-02 00:31:58 +02:00
|
|
|
"-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
|
2019-10-02 12:03:58 -05:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-01-18 22:50:56 -08:00
|
|
|
# darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it.
|
2019-10-02 12:03:58 -05:00
|
|
|
"-Dlibunwind=disabled"
|
|
|
|
"-Dlibdw=disabled"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs \
|
|
|
|
gst/parse/get_flex_version.py \
|
|
|
|
gst/parse/gen_grammar.py.in \
|
|
|
|
gst/parse/gen_lex.py.in \
|
2020-10-02 00:31:58 +02:00
|
|
|
libs/gst/helpers/ptp_helper_post_install.sh \
|
|
|
|
scripts/extract-release-date-from-doap-file.py
|
2019-10-02 12:03:58 -05:00
|
|
|
'';
|
2019-01-21 02:48:04 +01:00
|
|
|
|
2015-01-19 22:49:22 +01:00
|
|
|
postInstall = ''
|
2016-11-06 22:50:41 +01:00
|
|
|
for prog in "$dev/bin/"*; do
|
2019-01-19 22:05:58 +01:00
|
|
|
# We can't use --suffix here due to quoting so we craft the export command by hand
|
2020-12-23 21:35:19 +01:00
|
|
|
wrapProgram "$prog" --run 'export GST_PLUGIN_SYSTEM_PATH_1_0=$GST_PLUGIN_SYSTEM_PATH_1_0''${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$(unset _tmp; for profile in $NIX_PROFILES; do _tmp="$profile/lib/gstreamer-1.0''${_tmp:+:}$_tmp"; done; printf '%s' "$_tmp")'
|
2015-01-19 22:49:22 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2016-04-24 07:39:30 -05:00
|
|
|
preFixup = ''
|
|
|
|
moveToOutput "share/bash-completion" "$dev"
|
|
|
|
'';
|
|
|
|
|
2014-02-28 02:03:07 +01:00
|
|
|
setupHook = ./setup-hook.sh;
|
2019-10-02 12:03:58 -05:00
|
|
|
|
|
|
|
meta = with lib ;{
|
|
|
|
description = "Open source multimedia framework";
|
|
|
|
homepage = "https://gstreamer.freedesktop.org";
|
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ ttuegel matthewbauer ];
|
|
|
|
};
|
2013-12-23 23:36:37 +08:00
|
|
|
}
|