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