Merge #63643: handbrake: fix build on Darwin
This commit is contained in:
commit
48af02a402
@ -2,10 +2,14 @@
|
|||||||
#
|
#
|
||||||
# Derivation patches HandBrake to use Nix closure dependencies.
|
# Derivation patches HandBrake to use Nix closure dependencies.
|
||||||
#
|
#
|
||||||
|
# NOTE: 2019-07-19: This derivation does not currently support the native macOS
|
||||||
|
# GUI--it produces the "HandbrakeCLI" CLI version only. In the future it would
|
||||||
|
# be nice to add the native GUI (and/or the GTK GUI) as an option too, but that
|
||||||
|
# requires invoking the Xcode build system, which is non-trivial for now.
|
||||||
|
|
||||||
{ stdenv, lib, fetchurl,
|
{ stdenv, lib, fetchurl,
|
||||||
# Main build tools
|
# Main build tools
|
||||||
python2, pkgconfig, autoconf, automake, cmake, nasm, libtool, m4,
|
python2, pkgconfig, autoconf, automake, cmake, nasm, libtool, m4, lzma,
|
||||||
# Processing, video codecs, containers
|
# Processing, video codecs, containers
|
||||||
ffmpeg-full, nv-codec-headers, libogg, x264, x265, libvpx, libtheora,
|
ffmpeg-full, nv-codec-headers, libogg, x264, x265, libvpx, libtheora,
|
||||||
# Codecs, audio
|
# Codecs, audio
|
||||||
@ -14,20 +18,34 @@
|
|||||||
libiconv, fribidi, fontconfig, freetype, libass, jansson, libxml2, harfbuzz,
|
libiconv, fribidi, fontconfig, freetype, libass, jansson, libxml2, harfbuzz,
|
||||||
# Optical media
|
# Optical media
|
||||||
libdvdread, libdvdnav, libdvdcss, libbluray,
|
libdvdread, libdvdnav, libdvdcss, libbluray,
|
||||||
useGtk ? true, wrapGAppsHook ? null,
|
# Darwin-specific
|
||||||
intltool ? null,
|
AudioToolbox ? null,
|
||||||
glib ? null,
|
Foundation ? null,
|
||||||
gtk3 ? null,
|
libobjc ? null,
|
||||||
libappindicator-gtk3 ? null,
|
VideoToolbox ? null,
|
||||||
libnotify ? null,
|
# GTK
|
||||||
gst_all_1 ? null,
|
# NOTE: 2019-07-19: The gtk3 package has a transitive dependency on dbus,
|
||||||
dbus-glib ? null,
|
# which in turn depends on systemd. systemd is not supported on Darwin, so
|
||||||
udev ? null,
|
# for now we disable GTK GUI support on Darwin. (It may be possible to remove
|
||||||
libgudev ? null,
|
# this restriction later.)
|
||||||
hicolor-icon-theme ? null,
|
useGtk ? !stdenv.isDarwin, wrapGAppsHook ? null,
|
||||||
|
intltool ? null,
|
||||||
|
glib ? null,
|
||||||
|
gtk3 ? null,
|
||||||
|
libappindicator-gtk3 ? null,
|
||||||
|
libnotify ? null,
|
||||||
|
gst_all_1 ? null,
|
||||||
|
dbus-glib ? null,
|
||||||
|
udev ? null,
|
||||||
|
libgudev ? null,
|
||||||
|
hicolor-icon-theme ? null,
|
||||||
|
# FDK
|
||||||
useFdk ? false, fdk_aac ? null
|
useFdk ? false, fdk_aac ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert stdenv.isDarwin -> AudioToolbox != null && Foundation != null
|
||||||
|
&& libobjc != null && VideoToolbox != null;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "handbrake";
|
pname = "handbrake";
|
||||||
version = "1.2.2";
|
version = "1.2.2";
|
||||||
@ -45,12 +63,13 @@ stdenv.mkDerivation rec {
|
|||||||
ffmpeg-full libogg libtheora x264 x265 libvpx
|
ffmpeg-full libogg libtheora x264 x265 libvpx
|
||||||
libopus lame libvorbis a52dec speex libsamplerate
|
libopus lame libvorbis a52dec speex libsamplerate
|
||||||
libiconv fribidi fontconfig freetype libass jansson libxml2 harfbuzz
|
libiconv fribidi fontconfig freetype libass jansson libxml2 harfbuzz
|
||||||
libdvdread libdvdnav libdvdcss libbluray
|
libdvdread libdvdnav libdvdcss libbluray lzma
|
||||||
] ++ lib.optionals useGtk [
|
] ++ lib.optionals useGtk [
|
||||||
glib gtk3 libappindicator-gtk3 libnotify
|
glib gtk3 libappindicator-gtk3 libnotify
|
||||||
gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev
|
gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev
|
||||||
libgudev hicolor-icon-theme
|
libgudev hicolor-icon-theme
|
||||||
] ++ lib.optional useFdk fdk_aac
|
] ++ lib.optional useFdk fdk_aac
|
||||||
|
++ lib.optionals stdenv.isDarwin [ AudioToolbox Foundation libobjc VideoToolbox ]
|
||||||
# NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only,
|
# NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only,
|
||||||
# look at ./make/configure.py search "enable_nvenc"
|
# look at ./make/configure.py search "enable_nvenc"
|
||||||
++ lib.optional stdenv.isLinux nv-codec-headers;
|
++ lib.optional stdenv.isLinux nv-codec-headers;
|
||||||
@ -59,13 +78,16 @@ stdenv.mkDerivation rec {
|
|||||||
# (default distribution bundles&builds 3rd party libs),
|
# (default distribution bundles&builds 3rd party libs),
|
||||||
# don't trigger cmake build
|
# don't trigger cmake build
|
||||||
dontUseCmakeConfigure = true;
|
dontUseCmakeConfigure = true;
|
||||||
enableParallelBuilding = true;
|
# cp: cannot create regular file './internal_defaults.json': File exists
|
||||||
|
enableParallelBuilding = false;
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
patchShebangs scripts
|
patchShebangs scripts
|
||||||
|
|
||||||
substituteInPlace libhb/module.defs \
|
substituteInPlace libhb/module.defs \
|
||||||
--replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2
|
--replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2
|
||||||
|
substituteInPlace libhb/module.defs \
|
||||||
|
--replace '$(CONTRIB.build/)include/libxml2' ${libxml2.dev}/include/libxml2
|
||||||
|
|
||||||
# Force using nixpkgs dependencies
|
# Force using nixpkgs dependencies
|
||||||
sed -i '/MODULES += contrib/d' make/include/main.defs
|
sed -i '/MODULES += contrib/d' make/include/main.defs
|
||||||
@ -75,8 +97,9 @@ stdenv.mkDerivation rec {
|
|||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--disable-df-fetch"
|
"--disable-df-fetch"
|
||||||
"--disable-df-verify"
|
"--disable-df-verify"
|
||||||
(if useGtk then "--disable-gtk-update-checks" else "--disable-gtk")
|
(if useGtk then "--disable-gtk-update-checks" else "--disable-gtk")
|
||||||
(if useFdk then "--enable-fdk-aac" else "")
|
(if useFdk then "--enable-fdk-aac" else "")
|
||||||
|
(if stdenv.isDarwin then "--disable-xcode" else "")
|
||||||
];
|
];
|
||||||
|
|
||||||
# NOTE: 2018-12-27: Check NixOS HandBrake test if changing
|
# NOTE: 2018-12-27: Check NixOS HandBrake test if changing
|
||||||
|
@ -19193,7 +19193,10 @@ in
|
|||||||
|
|
||||||
lxdvdrip = callPackage ../applications/video/lxdvdrip { };
|
lxdvdrip = callPackage ../applications/video/lxdvdrip { };
|
||||||
|
|
||||||
handbrake = callPackage ../applications/video/handbrake { };
|
handbrake = callPackage ../applications/video/handbrake {
|
||||||
|
inherit (darwin.apple_sdk.frameworks) AudioToolbox Foundation VideoToolbox;
|
||||||
|
inherit (darwin) libobjc;
|
||||||
|
};
|
||||||
|
|
||||||
lilyterm = callPackage ../applications/misc/lilyterm {
|
lilyterm = callPackage ../applications/misc/lilyterm {
|
||||||
inherit (gnome2) vte;
|
inherit (gnome2) vte;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user