From 90ea935252d0aa09095c8fd7a1189d57521e2596 Mon Sep 17 00:00:00 2001 From: codyopel Date: Thu, 12 Feb 2015 17:53:07 -0500 Subject: [PATCH 1/3] x265: 1.4 -> 1.5 --- pkgs/development/libraries/x265/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/x265/default.nix b/pkgs/development/libraries/x265/default.nix index d7e66a4f618b..30fbdcd1e8df 100644 --- a/pkgs/development/libraries/x265/default.nix +++ b/pkgs/development/libraries/x265/default.nix @@ -1,7 +1,7 @@ { callPackage, ... } @ args: callPackage ./generic.nix (args // { - version = "1.4"; - rev = "5e604833c5aa605d0b6efbe5234492b5e7d8ac61"; - sha256 = "1aqksqi1qmjpva5cal6j7h0hzk298wk3nhqv73wnyqdchq2sa8v5"; + version = "1.5"; + rev = "9f0324125f53a12f766f6ed6f98f16e2f42337f4"; + sha256 = "1nyim0l975faj7926s4wba8yvjy4rvx005zb7krv0gb5p84nzgi7"; }) \ No newline at end of file From b60f5a004a9a1a312cbb3600e3d950671688c0d7 Mon Sep 17 00:00:00 2001 From: codyopel Date: Thu, 12 Feb 2015 17:53:48 -0500 Subject: [PATCH 2/3] x265-hg: bump commit --- pkgs/development/libraries/x265/hg.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/x265/hg.nix b/pkgs/development/libraries/x265/hg.nix index 5793bd343388..d26df82b3e30 100644 --- a/pkgs/development/libraries/x265/hg.nix +++ b/pkgs/development/libraries/x265/hg.nix @@ -1,7 +1,7 @@ { callPackage, ... } @ args: callPackage ./generic.nix (args // rec { - version = "hg"; - rev = "5f9f7194267b76f733e9ffb0f9e8b474dfe89a71"; - sha256 = "056ng8nsadmjf6s7igbgbxmiapjcxpfy6pbayl764xbhpkv4md88"; + version = "2015-2-11"; # Date of commit used Y-M-D + rev = "9ab104096834f51bd799ea1cf1160092f8182944"; + sha256 = "1j4k6ylglrzng5rz29qx2z06amdrq8wyzvqhm4ivfzvpndfniim6"; }) \ No newline at end of file From 3f22fdf7b0f03322a08a64c183293984f7a71388 Mon Sep 17 00:00:00 2001 From: codyopel Date: Thu, 12 Feb 2015 17:55:23 -0500 Subject: [PATCH 3/3] x265: refactor & add optionals --- pkgs/development/libraries/x265/generic.nix | 66 ++++++++++----------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/pkgs/development/libraries/x265/generic.nix b/pkgs/development/libraries/x265/generic.nix index 58a39dbbe384..2779b5811433 100644 --- a/pkgs/development/libraries/x265/generic.nix +++ b/pkgs/development/libraries/x265/generic.nix @@ -1,12 +1,21 @@ -{ stdenv, cmake, fetchhg, mercurial, yasm +{ stdenv, fetchhg, cmake, yasm , rev , sha256, version -, highBitDepth ? false -, debuggingSupport ? false -, enableCli ? true -, testSupport ? false +, debugSupport ? false # Run-time sanity checks (debugging) +, highbitdepthSupport ? false # false=8bits per channel, true=10/12bits per channel +, werrorSupport ? false # Warnings as errors +, ppaSupport ? false # PPA profiling instrumentation +, vtuneSupport ? false # Vtune profiling instrumentation +, custatsSupport ? false # Internal profiling of encoder work +, cliSupport ? true # Build standalone CLI application +, unittestsSupport ? false # Unit tests , ... }: +let + mkFlag = optSet: flag: if optSet then "-D${flag}=ON" else "-D${flag}=OFF"; +in + +with stdenv.lib; stdenv.mkDerivation rec { name = "x265-${version}"; @@ -20,39 +29,28 @@ stdenv.mkDerivation rec { sed -i 's/unknown/${version}/g' source/cmake/version.cmake ''; - cmakeFlags = with stdenv.lib; - '' - ${if debuggingSupport - then "-DCHECKED_BUILD=ON" - else "-DCHECKED_BUILD=OFF" - } - -DSTATIC_LINK_CRT=OFF - ${if (stdenv.system == "x86_64-linux" && highBitDepth) - then "-DHIGH_BIT_DEPTH=ON" - else "-DHIGH_BIT_DEPTH=OFF" - } - -DWARNINGS_AS_ERRORS=OFF - -DENABLE_PPA=OFF - -DENABLE_SHARED=ON - ${if enableCli - then "-DENABLE_CLI=ON" - else "-DENABLE_CLI=OFF" - } - ${if testSupport - then "-DENABLE_TESTS=ON" - else "-DENABLE_TESTS=OFF" - } - ''; + cmakeFlags = with stdenv.lib; [ + (mkFlag debugSupport "CHECKED_BUILD") + "-DSTATIC_LINK_CRT=OFF" + (mkFlag (highbitdepthSupport && stdenv.isx86_64) "HIGH_BIT_DEPTH") + (mkFlag werrorSupport "WARNINGS_AS_ERRORS") + (mkFlag ppaSupport "ENABLE_PPA") + "-DENABLE_SHARED=ON" + (mkFlag cliSupport "ENABLE_CLI") + (mkFlag unittestsSupport "ENABLE_TESTS") + ]; - preConfigure = "cd source"; + preConfigure = '' + cd source + ''; - buildInputs = [ cmake yasm ]; + nativeBuildInputs = [ cmake yasm ]; - meta = with stdenv.lib; { - homepage = "http://x265.org"; + meta = { description = "Library for encoding h.265/HEVC video streams"; - license = licenses.gpl2; - platforms = platforms.linux; + homepage = http://x265.org; + license = licenses.gpl2; maintainers = with maintainers; [ codyopel ]; + platforms = platforms.all; }; } \ No newline at end of file