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

gst_all_1.gstreamer: use a better libunwind check #339006

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions pkgs/development/libraries/gstreamer/core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
, buildPackages
, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
, libunwind
# darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it.
, withLibunwind ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform libunwind
, withLibunwind ?
lib.meta.availableOn stdenv.hostPlatform libunwind &&
lib.elem "libunwind" libunwind.meta.pkgConfigModules or []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I find f x.a or b to be a really confusing parse, and would prefer parentheses around the relevant subexpression here. (Non‐blocking, will merge soon regardless of any response if you don’t beat me to it.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also find it confusing, but unless we can enforce parentheses treewide, I think it's better to teach it through exposure, rather than making it rare and therefore even more surprising.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened NixOS/nixfmt#251 and merging :)

# Checks meson.is_cross_build(), so even canExecute isn't enough.
, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc
}:
Expand Down
17 changes: 13 additions & 4 deletions pkgs/development/libraries/libunwind/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{ stdenv, lib, fetchpatch, fetchFromGitHub, autoreconfHook, xz, buildPackages }:
{ stdenv, lib, fetchpatch, fetchFromGitHub, autoreconfHook, buildPackages
, xz
, testers
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "libunwind";
version = "1.8.1";

src = fetchFromGitHub {
owner = "libunwind";
repo = "libunwind";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-rCFBHs6rCSnp5FEwbUR5veNNTqSQpFblAv8ebSPX0qE=";
};

Expand Down Expand Up @@ -50,12 +53,18 @@ stdenv.mkDerivation rec {

doCheck = false; # fails

passthru.tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
versionCheck = true;
};

meta = with lib; {
homepage = "https://www.nongnu.org/libunwind";
description = "Portable and efficient API to determine the call-chain of a program";
maintainers = with maintainers; [ orivej ];
pkgConfigModules = [ "libunwind" "libunwind-coredump" "libunwind-generic" "libunwind-ptrace" "libunwind-setjmp" ];
# https://github.com/libunwind/libunwind#libunwind
platforms = [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-freebsd" "i686-linux" "loongarch64-linux" "mips64el-linux" "mipsel-linux" "powerpc64-linux" "powerpc64le-linux" "riscv64-linux" "s390x-linux" "x86_64-freebsd" "x86_64-linux" "x86_64-solaris" ];
license = licenses.mit;
};
}
})