summary refs log tree commit diff
path: root/pkgs/development/libraries/libaom/default.nix
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-12-17 08:32:50 -0600
committerWill Dietz <w@wdtz.org>2018-12-17 09:54:14 -0600
commitcee81d59ac8c9ca834c97bd20b7529440040b5c6 (patch)
treebcf517a099b1459dc155f0ac798cf4ceb660e59a /pkgs/development/libraries/libaom/default.nix
parent4ae47a69de4af13c0d4325acc7d66a95f3397f6b (diff)
downloadnixpkgs-cee81d59ac8c9ca834c97bd20b7529440040b5c6.tar
nixpkgs-cee81d59ac8c9ca834c97bd20b7529440040b5c6.tar.gz
nixpkgs-cee81d59ac8c9ca834c97bd20b7529440040b5c6.tar.bz2
nixpkgs-cee81d59ac8c9ca834c97bd20b7529440040b5c6.tar.lz
nixpkgs-cee81d59ac8c9ca834c97bd20b7529440040b5c6.tar.xz
nixpkgs-cee81d59ac8c9ca834c97bd20b7529440040b5c6.tar.zst
nixpkgs-cee81d59ac8c9ca834c97bd20b7529440040b5c6.zip
libaom: create shared libraries, fix version reported in aom.pc
See added comment for explanation of version fix.
Diffstat (limited to 'pkgs/development/libraries/libaom/default.nix')
-rw-r--r--pkgs/development/libraries/libaom/default.nix28
1 files changed, 27 insertions, 1 deletions
diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix
index a08a1e33523..77d75a8c1d3 100644
--- a/pkgs/development/libraries/libaom/default.nix
+++ b/pkgs/development/libraries/libaom/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, yasm, perl, cmake, pkgconfig, python3Packages }:
+{ stdenv, fetchgit, yasm, perl, cmake, pkgconfig, python3Packages, writeText }:
 
 stdenv.mkDerivation rec {
   name = "libaom-${version}";
@@ -13,6 +13,32 @@ stdenv.mkDerivation rec {
   buildInputs = [ perl yasm ];
   nativeBuildInputs = [ cmake pkgconfig python3Packages.python ];
 
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  # * libaom tries to detect what version it is
+  #   * I couldn't get it to grab this from git info,
+  #     (which needs at least leaveDotGit=true)
+  #   * it uses a perl script to parse from CHANGELOG,
+  #     but 1.0.0 doesn't contain an entry for itself :(
+  # * Upstream patch that adds the entry also nukes all of
+  #   the versions before a project change (open-sourcing?)
+  #   and as a result is 34K which is way too big just to fix this!
+  #   * A stable URL to fetch this from works, but...
+  # * Upon inspection the resulting CHANGELOG is shorter
+  #   than this comment, so while yes this is a bit gross
+  #   adding these 4 lines here does the job without
+  #   a huge patch in spirit of preferring upstream's fix
+  #   instead of `sed -i 's/v0\.1\.0/v1.0.0/g' aom.pc` or so.
+  postPatch = let actual_changelog = writeText "CHANGELOG" ''
+    2018-06-28 v1.0.0
+      AOMedia Codec Workgroup Approved version 1.0
+
+    2016-04-07 v0.1.0 "AOMedia Codec 1"
+      This release is the first Alliance for Open Media codec.
+  ''; in ''
+   cp ${actual_changelog} CHANGELOG
+  '';
+
   meta = with stdenv.lib; {
     description = "AV1 Bitstream and Decoding Library";
     homepage    = https://aomedia.org/av1-features/get-started/;