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

x264: unstable-2021-06-13 -> 0-unstable-2023-10-01 #300980

Merged
merged 1 commit into from
Apr 3, 2024
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
29 changes: 12 additions & 17 deletions pkgs/development/libraries/x264/default.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
{ stdenv
, lib
, fetchFromGitLab
, fetchpatch
, nasm
, enableShared ? !stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
pname = "x264";
version = "unstable-2021-06-13";
version = "0-unstable-2023-10-01";

src = fetchFromGitLab {
domain = "code.videolan.org";
owner = "videolan";
repo = pname;
rev = "5db6aa6cab1b146e07b60cc1736a01f21da01154";
sha256 = "0swyrkz6nvajivxvrr08py0jrfcsjvpxw78xm1k5gd9xbdrxvknh";
rev = "31e19f92f00c7003fa115047ce50978bc98c3a0d";
hash = "sha256-7/FaaDFmoVhg82BIhP3RbFq4iKGNnhviOPxl3/8PWCM=";
};

# Upstream ./configure greps for (-mcpu|-march|-mfpu) in CFLAGS, which in nix
# is put in the cc wrapper anyway.
patches = [
# Upstream ./configure greps for (-mcpu|-march|-mfpu) in CFLAGS, which in nix
# is put in the cc wrapper anyway.
./disable-arm-neon-default.patch
(fetchpatch {
# https://code.videolan.org/videolan/x264/-/merge_requests/114
name = "fix-parallelism.patch";
url = "https://code.videolan.org/videolan/x264/-/commit/e067ab0b530395f90b578f6d05ab0a225e2efdf9.patch";
hash = "sha256-16h2IUCRjYlKI2RXYq8QyXukAdfoQxyBKsK/nI6vhRI=";
})
];

postPatch = ''
patchShebangs .
''
# Darwin uses `llvm-strip`, which results in a crash at runtime in assembly-based routines when `-x` is specified.
+ lib.optionalString stdenv.isDarwin ''
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace Makefile --replace '$(if $(STRIP), $(STRIP) -x $@)' '$(if $(STRIP), $(STRIP) -S $@)'
'';

Expand All @@ -53,6 +42,12 @@ stdenv.mkDerivation rec {
++ lib.optional (!stdenv.isi686) "--enable-pic"
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}";

makeFlags = [
"BASHCOMPLETIONSDIR=$(out)/share/bash-completion/completions"
"install-bashcompletion"
"install-lib-shared"
];

nativeBuildInputs = lib.optional stdenv.hostPlatform.isx86 nasm;

meta = with lib; {
Expand Down