summary refs log tree commit diff
diff options
context:
space:
mode:
authorWill Dietz <github@wdtz.org>2018-12-28 13:04:44 -0600
committerGitHub <noreply@github.com>2018-12-28 13:04:44 -0600
commit19894adb7703cb5bdacdcdfdac49ea0837814a05 (patch)
tree31a38fcd5390cf3e6510b7f01f35c1558ff1872a
parentaebec730715e81cc6e363a61b5f0fecf082da6f9 (diff)
parent1720abc263384992c10587dc51f8635bfa4e2391 (diff)
downloadnixpkgs-19894adb7703cb5bdacdcdfdac49ea0837814a05.tar
nixpkgs-19894adb7703cb5bdacdcdfdac49ea0837814a05.tar.gz
nixpkgs-19894adb7703cb5bdacdcdfdac49ea0837814a05.tar.bz2
nixpkgs-19894adb7703cb5bdacdcdfdac49ea0837814a05.tar.lz
nixpkgs-19894adb7703cb5bdacdcdfdac49ea0837814a05.tar.xz
nixpkgs-19894adb7703cb5bdacdcdfdac49ea0837814a05.tar.zst
nixpkgs-19894adb7703cb5bdacdcdfdac49ea0837814a05.zip
Merge pull request #52443 from dtzWill/fix/aom-version-and-shared
libaom: create shared libraries, fix version reported in aom.pc
-rw-r--r--pkgs/development/libraries/libaom/default.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix
index a08a1e33523..f6ff7e75895 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, python3, writeText }:
 
 stdenv.mkDerivation rec {
   name = "libaom-${version}";
@@ -10,8 +10,23 @@ stdenv.mkDerivation rec {
     sha256 = "07h2vhdiq7c3fqaz44rl4vja3dgryi6n7kwbwbj1rh485ski4j82";
   };
 
-  buildInputs = [ perl yasm ];
-  nativeBuildInputs = [ cmake pkgconfig python3Packages.python ];
+  nativeBuildInputs = [
+    yasm perl cmake pkgconfig python3
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+  ];
+
+  preConfigure = ''
+    # build uses `git describe` to set the build version
+    cat > $NIX_BUILD_TOP/git << "EOF"
+    #!${stdenv.shell}
+    echo v${version}
+    EOF
+    chmod +x $NIX_BUILD_TOP/git
+    export PATH=$NIX_BUILD_TOP:$PATH
+  '';
 
   meta = with stdenv.lib; {
     description = "AV1 Bitstream and Decoding Library";