nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix

115 lines
2.7 KiB
Nix
Raw Normal View History

2019-10-02 10:03:58 -07:00
{ stdenv
, fetchurl
, meson
, ninja
, pkgconfig
, gettext
, gobject-introspection
, bison
, flex
, python3
, glib
, makeWrapper
, libcap
, libunwind
, darwin
, elfutils # for libdw
, bash-completion
2018-04-23 10:31:36 -07:00
, lib
2019-06-21 11:01:33 -07:00
, CoreServices
2013-12-23 07:36:37 -08:00
}:
stdenv.mkDerivation rec {
pname = "gstreamer";
2020-11-14 15:03:53 -08:00
version = "1.18.1";
2013-12-23 07:36:37 -08: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 10:03:58 -07:00
outputBin = "dev";
2013-12-23 07:36:37 -08:00
src = fetchurl {
2019-10-02 09:59:16 -07:00
url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
2020-11-14 15:03:53 -08:00
sha256 = "1fpcpsw740svvdxvvwn0hly5i72miizm4s0mbid10ji83zi8vpvr";
2013-12-23 07:36:37 -08:00
};
2018-04-23 10:31:36 -07:00
patches = [
./fix_pkgconfig_includedir.patch
];
2013-12-23 07:36:37 -08:00
nativeBuildInputs = [
2019-10-02 10:03:58 -07:00
meson
ninja
pkgconfig
gettext
bison
flex
python3
makeWrapper
glib
2019-10-02 10:03:58 -07:00
gobject-introspection
bash-completion
2019-10-02 10:03:58 -07:00
# documentation
# TODO add hotdoc here
2013-12-23 07:36:37 -08:00
];
buildInputs = [
bash-completion
] ++ lib.optionals stdenv.isLinux [
2019-10-02 10:03:58 -07:00
libcap
libunwind
elfutils
] ++ lib.optionals stdenv.isDarwin [
CoreServices
];
2013-12-23 07:36:37 -08:00
2019-10-02 10:03:58 -07:00
propagatedBuildInputs = [
glib
];
mesonFlags = [
"-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
"-Dexamples=disabled" # requires many dependencies and probably not useful for our users
"-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
2019-10-02 10:03:58 -07:00
] ++ lib.optionals stdenv.isDarwin [
2019-06-21 11:01:33 -07:00
# darwin.libunwind doesn't have pkgconfig definitions so meson doesn't detect it.
2019-10-02 10:03:58 -07: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 \
libs/gst/helpers/ptp_helper_post_install.sh \
scripts/extract-release-date-from-doap-file.py
2019-10-02 10:03:58 -07:00
'';
postInstall = ''
for prog in "$dev/bin/"*; do
# 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 '%s' "$_tmp")'
done
'';
2016-04-24 05:39:30 -07:00
preFixup = ''
moveToOutput "share/bash-completion" "$dev"
'';
setupHook = ./setup-hook.sh;
2019-10-02 10:03:58 -07: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 07:36:37 -08:00
}