Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libaom: Fix static compilation #179266

Merged
merged 3 commits into from
Oct 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pkgs/development/libraries/libaom/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
, enableVmaf ? true, libvmaf
}:

let
isCross = stdenv.buildPlatform != stdenv.hostPlatform;
in
stdenv.mkDerivation rec {
pname = "libaom";
version = "3.4.0";
version = "3.5.0";

src = fetchzip {
url = "https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz";
sha256 = "sha256-NgzpVxQmsgOPzKkGpJIJrLiNQcruhpEoCi/CYJx5b3A=";
sha256 = "sha256-kEU8DVgB4JoyB6Lbh/XfC3LZcsVEM2STkZV8iZBCNis=";
stripRoot = false;
};

Expand Down Expand Up @@ -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
Expand All @@ -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" ];
Expand All @@ -70,6 +75,7 @@ stdenv.mkDerivation rec {
changelog = "https://aomedia.googlesource.com/aom/+/refs/tags/v${version}/CHANGELOG";
maintainers = with maintainers; [ primeos kiloreux dandellion ];
platforms = platforms.all;
outputsToInstall = [ "bin" ];
license = licenses.bsd2;
};
}