git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #17973 from vbgl/mpv-darwin

mpv: fix on darwin

commit30107249b1a5681771591cd65aa4f1c98f4cb023 authorvbgl <vbgl@users.noreply.github.com> dateMon 12 Sep 2016, 15:13 (10 years ago) parent44dc13a637412e
2 files changed+19−8
pkgs/applications/video/mpv/default.nix+14−8 pkgs/top-level/lua-packages.nix+5
pkgs/applications/video/mpv/default.nix+14−8
@@ -1,7 +1,7 @@
11{ stdenv, fetchurl, fetchFromGitHub, makeWrapper
22, docutils, perl, pkgconfig, python3, which, ffmpeg
33, freefont_ttf, freetype, libass, libpthreadstubs
4−, lua, lua5_sockets, libuchardet, rubberband
4+, lua, lua5_sockets, libuchardet, libiconv ? null, darwin
55
66, x11Support ? true,
77 mesa ? null,
@@ -13,18 +13,19 @@
1313 wayland ? null,
1414 libxkbcommon ? null
1515
16+, rubberbandSupport ? !stdenv.isDarwin, rubberband ? null
1617, xineramaSupport ? true, libXinerama ? null
1718, xvSupport ? true, libXv ? null
1819, sdl2Support ? true, SDL2 ? null
19−, alsaSupport ? true, alsaLib ? null
20+, alsaSupport ? !stdenv.isDarwin, alsaLib ? null
2021, screenSaverSupport ? true, libXScrnSaver ? null
2122, vdpauSupport ? true, libvdpau ? null
22−, dvdreadSupport ? true, libdvdread ? null
23−, dvdnavSupport ? true, libdvdnav ? null
23+, dvdreadSupport ? !stdenv.isDarwin, libdvdread ? null
24+, dvdnavSupport ? dvdreadSupport, libdvdnav ? null
2425, bluraySupport ? true, libbluray ? null
2526, speexSupport ? true, speex ? null
2627, theoraSupport ? true, libtheora ? null
27−, pulseSupport ? true, libpulseaudio ? null
28+, pulseSupport ? !stdenv.isDarwin, libpulseaudio ? null
2829, bs2bSupport ? true, libbs2b ? null
2930, cacaSupport ? true, libcaca ? null
3031, libpngSupport ? true, libpng ? null
@@ -39,11 +40,12 @@
3940
4041with stdenv.lib;
4142
42−let
43+let
4344 available = x: x != null;
4445in
4546assert x11Support -> all available [mesa libX11 libXext libXxf86vm];
4647assert waylandSupport -> all available [wayland libxkbcommon];
48+assert rubberbandSupport -> available rubberband;
4749assert xineramaSupport -> x11Support && available libXinerama;
4850assert xvSupport -> x11Support && available libXv;
4951assert sdl2Support -> available SDL2;
@@ -109,7 +111,7 @@ in stdenv.mkDerivation rec {
109111
110112 buildInputs = [
111113 ffmpeg freetype libass libpthreadstubs
112− lua lua5_sockets libuchardet rubberband
114+ lua lua5_sockets libuchardet
113115 ] ++ optional alsaSupport alsaLib
114116 ++ optional xvSupport libXv
115117 ++ optional theoraSupport libtheora
@@ -118,6 +120,10 @@ in stdenv.mkDerivation rec {
118120 ++ optional bluraySupport libbluray
119121 ++ optional jackaudioSupport libjack2
120122 ++ optional pulseSupport libpulseaudio
123+ ++ optional stdenv.isDarwin libiconv
124+ ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
125+ Cocoa CoreAudio ])
126+ ++ optional rubberbandSupport rubberband
121127 ++ optional screenSaverSupport libXScrnSaver
122128 ++ optional vdpauSupport libvdpau
123129 ++ optional speexSupport speex
@@ -158,7 +164,7 @@ in stdenv.mkDerivation rec {
158164 homepage = http://mpv.io;
159165 license = licenses.gpl2Plus;
160166 maintainers = with maintainers; [ AndersonTorres fuuzetsu ];
161− platforms = platforms.linux;
167+ platforms = platforms.darwin ++ platforms.linux;
162168
163169 longDescription = ''
164170 mpv is a free and open-source general-purpose video player,
pkgs/top-level/lua-packages.nix+5
@@ -192,6 +192,11 @@ let
192192 patchPhase = ''
193193 sed -e "s,^LUAPREFIX_linux.*,LUAPREFIX_linux=$out," \
194194 -i src/makefile
195+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
196+ export PLAT=macosx
197+ export LUAPREFIX_macosx=$out
198+ substituteInPlace src/Makefile --replace gcc cc \
199+ --replace 10.3 10.5
195200 '';
196201
197202 meta = {