1{
2 stdenv,
3 fetchurl,
4 meson,
5 ninja,
6 pkg-config,
7 python3,
8 gst-plugins-base,
9 orc,
10 gettext,
11 a52dec,
12 libcdio,
13 libdvdread,
14 libmad,
15 libmpeg2,
16 x264,
17 libintl,
18 lib,
19 enableGplPlugins ? true,
20 # Checks meson.is_cross_build(), so even canExecute isn't enough.
21 enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
22 hotdoc,
23 directoryListingUpdater,
24 gst-plugins-ugly,
25 apple-sdk_gstreamer,
26}:
27
28stdenv.mkDerivation (finalAttrs: {
29 pname = "gst-plugins-ugly";
30 version = "1.26.0";
31
32 outputs = [
33 "out"
34 "dev"
35 ];
36
37 src = fetchurl {
38 url = "https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${finalAttrs.version}.tar.xz";
39 hash = "sha256-qGtRyEVKgTEghIyANCHzJ9jAeqvK5GHgWXzEk5jA/N4=";
40 };
41
42 nativeBuildInputs = [
43 meson
44 ninja
45 gettext
46 pkg-config
47 python3
48 ]
49 ++ lib.optionals enableDocumentation [
50 hotdoc
51 ];
52
53 buildInputs = [
54 gst-plugins-base
55 orc
56 libintl
57 ]
58 ++ lib.optionals enableGplPlugins [
59 a52dec
60 libcdio
61 libdvdread
62 libmad
63 libmpeg2
64 x264
65 ]
66 ++ lib.optionals stdenv.hostPlatform.isDarwin [
67 apple-sdk_gstreamer
68 ];
69
70 mesonFlags = [
71 "-Dglib_debug=disabled" # cast checks should be disabled on stable releases
72 "-Dsidplay=disabled" # sidplay / sidplay/player.h isn't packaged in nixpkgs as of writing
73 (lib.mesonEnable "doc" enableDocumentation)
74 ]
75 ++ (
76 if enableGplPlugins then
77 [
78 "-Dgpl=enabled"
79 ]
80 else
81 [
82 "-Da52dec=disabled"
83 "-Dcdio=disabled"
84 "-Ddvdread=disabled"
85 "-Dmpeg2dec=disabled"
86 "-Dsidplay=disabled"
87 "-Dx264=disabled"
88 ]
89 );
90
91 postPatch = ''
92 patchShebangs \
93 scripts/extract-release-date-from-doap-file.py
94 '';
95
96 passthru = {
97 tests = {
98 lgplOnly = gst-plugins-ugly.override {
99 enableGplPlugins = false;
100 };
101 };
102
103 updateScript = directoryListingUpdater { };
104 };
105
106 meta = with lib; {
107 description = "Gstreamer Ugly Plugins";
108 homepage = "https://gstreamer.freedesktop.org";
109 longDescription = ''
110 a set of plug-ins that have good quality and correct functionality,
111 but distributing them might pose problems. The license on either
112 the plug-ins or the supporting libraries might not be how we'd
113 like. The code might be widely known to present patent problems.
114 '';
115 license = if enableGplPlugins then licenses.gpl2Plus else licenses.lgpl2Plus;
116 platforms = platforms.unix;
117 maintainers = with maintainers; [ matthewbauer ];
118 };
119})