Merge #137495: libsepol: upstream fix for -fno-common

... into staging
This commit is contained in:
Vladimír Čunát 2021-09-24 09:10:16 +02:00
commit c1dfb09f84
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, flex }:
{ lib, stdenv, fetchurl, fetchpatch, flex }:
stdenv.mkDerivation rec {
pname = "libsepol";
@ -13,6 +13,20 @@ stdenv.mkDerivation rec {
sha256 = "0ygb6dh5lng91xs6xiqf5v0nxa68qmjc787p0s5h9w89364f2yjv";
};
patches = [
# upstream build fix against -fno-common compilers like >=gcc-10
(fetchpatch {
url = "https://github.com/SELinuxProject/selinux/commit/a96e8c59ecac84096d870b42701a504791a8cc8c.patch";
sha256 = "0aybv4kzbhx8xq6s82dsh4ib76k59qzh2bgxmk44iq5cjnqn5rd6";
stripLen = 1;
})
(fetchpatch {
url = "https://github.com/SELinuxProject/selinux/commit/3d32fc24d6aff360a538c63dad08ca5c957551b0.patch";
sha256 = "1mphwdlj4d6mwmsp5xkpf6ci4rxhgbi3fm79d08h4jbzxaf4wny4";
stripLen = 1;
})
];
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
substituteInPlace src/Makefile --replace 'all: $(LIBA) $(LIBSO)' 'all: $(LIBA)'
sed -i $'/^\t.*LIBSO/d' src/Makefile