handbrake: allow building from checkout
This commit is contained in:
parent
c57a98affe
commit
ed077f6818
@ -7,7 +7,7 @@
|
|||||||
# be nice to add the native GUI (and/or the GTK GUI) as an option too, but that
|
# 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.
|
# requires invoking the Xcode build system, which is non-trivial for now.
|
||||||
|
|
||||||
{ stdenv, lib, fetchurl,
|
{ stdenv, lib, fetchFromGitHub,
|
||||||
# Main build tools
|
# Main build tools
|
||||||
pkgconfig, autoconf, automake, libtool, m4, lzma, python3,
|
pkgconfig, autoconf, automake, libtool, m4, lzma, python3,
|
||||||
numactl,
|
numactl,
|
||||||
@ -44,21 +44,48 @@
|
|||||||
useFdk ? false, fdk_aac ? null
|
useFdk ? false, fdk_aac ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert stdenv.isDarwin -> AudioToolbox != null && Foundation != null
|
assert stdenv.isDarwin -> AudioToolbox != null
|
||||||
&& libobjc != null && VideoToolbox != null;
|
&& Foundation != null
|
||||||
|
&& libobjc != null
|
||||||
|
&& VideoToolbox != null;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "handbrake";
|
pname = "handbrake";
|
||||||
version = "1.3.2";
|
version = "1.3.2";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchFromGitHub {
|
||||||
# 2020-05-05: NOTE: Thou fetching from GitHub, still fetchurl required,
|
owner = "HandBrake";
|
||||||
# because this tarball has their "special" packaging and so
|
repo = "HandBrake";
|
||||||
# internal "special" version information
|
rev = version;
|
||||||
url = ''https://github.com/HandBrake/HandBrake/releases/download/${version}/HandBrake-${version}-source.tar.bz2'';
|
sha256 = "04z3hcy7m5yvma849rlrsx2wdqmkilkl1qds9yrzr2ydpw697f85";
|
||||||
sha256 = "0w7jxjrccvxp7g15dv0spildg5apmqp4gwbcqmg58va2gylynvzc";
|
extraPostFetch = ''
|
||||||
|
echo "DATE=$(date +"%F %T %z" -r $out/NEWS.markdown)" > $out/version.txt
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# we put as little as possible in src.extraPostFetch as it's much easier to
|
||||||
|
# add to it here without having to fiddle with src.sha256
|
||||||
|
# only DATE and HASH are absolutely necessary
|
||||||
|
postPatch = ''
|
||||||
|
cat >> version.txt <<_EOF
|
||||||
|
HASH=${src.rev}
|
||||||
|
SHORTHASH=${src.rev}
|
||||||
|
TAG=${version}
|
||||||
|
URL=${src.meta.homepage}
|
||||||
|
_EOF
|
||||||
|
|
||||||
|
patchShebangs scripts
|
||||||
|
|
||||||
|
substituteInPlace libhb/module.defs \
|
||||||
|
--replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2
|
||||||
|
|
||||||
|
# Force using nixpkgs dependencies
|
||||||
|
sed -i '/MODULES += contrib/d' make/include/main.defs
|
||||||
|
sed -e 's/^[[:space:]]*\(meson\|ninja\|nasm\)[[:space:]]*= ToolProbe.*$//g' \
|
||||||
|
-e '/ ## Additional library and tool checks/,/ ## MinGW specific library and tool checks/d' \
|
||||||
|
-i make/configure.py
|
||||||
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgconfig autoconf automake libtool m4 python3
|
pkgconfig autoconf automake libtool m4 python3
|
||||||
] ++ lib.optionals useGtk [ intltool wrapGAppsHook ];
|
] ++ lib.optionals useGtk [ intltool wrapGAppsHook ];
|
||||||
@ -78,20 +105,10 @@ stdenv.mkDerivation rec {
|
|||||||
# 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;
|
||||||
|
|
||||||
preConfigure = ''
|
enableParallelBuilding = true;
|
||||||
patchShebangs scripts
|
|
||||||
|
|
||||||
substituteInPlace libhb/module.defs \
|
|
||||||
--replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2
|
|
||||||
|
|
||||||
# Force using nixpkgs dependencies
|
|
||||||
sed -i '/MODULES += contrib/d' make/include/main.defs
|
|
||||||
sed -e 's/^[[:space:]]*\(meson\|ninja\|nasm\)[[:space:]]*= ToolProbe.*$//g' \
|
|
||||||
-e '/ ## Additional library and tool checks/,/ ## MinGW specific library and tool checks/d' \
|
|
||||||
-i make/configure.py
|
|
||||||
'';
|
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
|
"--harden"
|
||||||
"--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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user