summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Olsen <daniel.olsen99@gmail.com>2022-06-27 02:24:26 +0200
committerDaniel Olsen <daniel.olsen99@gmail.com>2022-09-30 02:15:13 +0200
commit9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144 (patch)
tree1712ca0dc057076898326573473c9b11baf39d66
parent4dca7afed548262b3da966d884892ae7c1a20739 (diff)
downloadnixpkgs-9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144.tar
nixpkgs-9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144.tar.gz
nixpkgs-9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144.tar.bz2
nixpkgs-9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144.tar.lz
nixpkgs-9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144.tar.xz
nixpkgs-9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144.tar.zst
nixpkgs-9ccaecf0e71392a3eb33f1bdc8a8210c8cfc2144.zip
libaom: fix static compilation
-rw-r--r--pkgs/development/libraries/libaom/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix
index 5ec8c75e2af..2578126d3ab 100644
--- a/pkgs/development/libraries/libaom/default.nix
+++ b/pkgs/development/libraries/libaom/default.nix
@@ -3,6 +3,9 @@
 , enableVmaf ? true, libvmaf
 }:
 
+let
+  isCross = stdenv.buildPlatform != stdenv.hostPlatform;
+in
 stdenv.mkDerivation rec {
   pname = "libaom";
   version = "3.5.0";
@@ -45,7 +48,7 @@ stdenv.mkDerivation rec {
   ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
     # CPU detection isn't supported on Darwin and breaks the aarch64-darwin build:
     "-DCONFIG_RUNTIME_CPU_DETECT=0"
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+  ] ++ lib.optionals (isCross && !stdenv.hostPlatform.isx86) [
     "-DAS_EXECUTABLE=${stdenv.cc.targetPrefix}as"
   ] ++ lib.optionals stdenv.isAarch32 [
     # armv7l-hf-multiplatform does not support NEON
@@ -55,6 +58,8 @@ stdenv.mkDerivation rec {
 
   postFixup = ''
     moveToOutput lib/libaom.a "$static"
+  '' + lib.optionalString stdenv.hostPlatform.isStatic ''
+    ln -s $static $out
   '';
 
   outputs = [ "out" "bin" "dev" "static" ];