nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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.5";
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-PfxDQ1vpfhEIFrrG1gKw8gagOFRieWg9nSU3L/En21I=";
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 preFixup = ''
97 moveToOutput "lib/gstreamer-1.0/pkgconfig" "$dev"
98 '';
99
100 passthru = {
101 tests = {
102 lgplOnly = gst-plugins-ugly.override {
103 enableGplPlugins = false;
104 };
105 };
106
107 updateScript = directoryListingUpdater { };
108 };
109
110 meta = {
111 description = "Gstreamer Ugly Plugins";
112 homepage = "https://gstreamer.freedesktop.org";
113 longDescription = ''
114 a set of plug-ins that have good quality and correct functionality,
115 but distributing them might pose problems. The license on either
116 the plug-ins or the supporting libraries might not be how we'd
117 like. The code might be widely known to present patent problems.
118 '';
119 license = if enableGplPlugins then lib.licenses.gpl2Plus else lib.licenses.lgpl2Plus;
120 platforms = lib.platforms.unix;
121 maintainers = [ ];
122 };
123})