Github messages for voidlinux
 help / color / mirror / Atom feed
From: Calandracas606 <Calandracas606@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] apparmor: fix build on musl, enable python on cross-compile
Date: Thu, 27 Jun 2024 15:31:32 +0200	[thread overview]
Message-ID: <20240627133132.94DF0270BC@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-51024@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages apparmor-musl-fix
https://github.com/void-linux/void-packages/pull/51024

apparmor: fix build on musl, enable python on cross-compile
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - i686
  - aarch64 (native + cross)
  - aarch64-musl (native + cross)
  - armv7l (cross)
  - armv7l-musl (cross)
  - armv6l (cross)
  - armv6l-musl (cross)



A patch file from https://github.com/void-linux/void-packages/pull/51024.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-apparmor-musl-fix-51024.patch --]
[-- Type: text/x-diff, Size: 3944 bytes --]

From f144a6e6d5df1594c6cb0968a1c9d4840babc509 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 27 Jun 2024 08:48:00 -0400
Subject: [PATCH] apparmor: fix build on musl, enable python on cross-compile

---
 srcpkgs/apparmor/patches/cross-cflags.patch | 44 +++++++++++++++++++++
 srcpkgs/apparmor/template                   | 16 +++++---
 2 files changed, 55 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/apparmor/patches/cross-cflags.patch

diff --git a/srcpkgs/apparmor/patches/cross-cflags.patch b/srcpkgs/apparmor/patches/cross-cflags.patch
new file mode 100644
index 00000000000000..f38093fd9e6b1a
--- /dev/null
+++ b/srcpkgs/apparmor/patches/cross-cflags.patch
@@ -0,0 +1,44 @@
+From a8637a5aa189392d5f7a8d61432a11c4ba8ee19e Mon Sep 17 00:00:00 2001
+From: Christian Boltz <gitlab2@cboltz.de>
+Date: Fri, 7 Jun 2024 21:55:12 +0000
+Subject: [PATCH] Merge Honor global CFLAGS when building Python library
+
+Similarly to https://gitlab.com/apparmor/apparmor/-/merge_requests/689, use the
+global CFLAGS when building Python library, so we honor extra flags set by
+distributions, such
+as -fstack-protector-strong -fstack-clash-protection -Werror=format-security -fcf-protection.
+
+Spotted by blhc on Debian.
+
+Gbp-Pq: Name Honor-global-CFLAGS-when-building-Python-library.patch
+
+MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1254
+Approved-by: Christian Boltz <apparmor@cboltz.de>
+Merged-by: Christian Boltz <apparmor@cboltz.de>
+
+
+(cherry picked from commit 1ec42d8bec215b16dc3bb74fa6946ff59592a692)
+
+b7d75638 Honor global CFLAGS when building Python library
+
+Co-authored-by: Christian Boltz <apparmor@cboltz.de>
+---
+ libraries/libapparmor/swig/python/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libraries/libapparmor/swig/python/Makefile.am b/libraries/libapparmor/swig/python/Makefile.am
+index bf05fe0fc..b42ebb1e2 100644
+--- a/libraries/libapparmor/swig/python/Makefile.am
++++ b/libraries/libapparmor/swig/python/Makefile.am
+@@ -14,7 +14,7 @@ MOSTLYCLEANFILES=libapparmor_wrap.c LibAppArmor.py
+ 
+ all-local: libapparmor_wrap.c setup.py
+ 	if test ! -f libapparmor_wrap.c; then cp $(srcdir)/libapparmor_wrap.c . ; fi
+-	CC="$(CC)" CFLAGS="$(PYTHON_CPPFLAGS) $(EXTRA_WARNINGS)" LDSHARED="$(CC) -shared" LDFLAGS="$(PYTHON_LDFLAGS) $(LDFLAGS)" $(PYTHON) setup.py build
++	CC="$(CC)" CFLAGS="$(PYTHON_CPPFLAGS) $(CFLAGS) $(EXTRA_WARNINGS)" LDSHARED="$(CC) -shared" LDFLAGS="$(PYTHON_LDFLAGS) $(LDFLAGS)" $(PYTHON) setup.py build
+ 
+ install-exec-local:
+ 	$(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+-- 
+GitLab
+
diff --git a/srcpkgs/apparmor/template b/srcpkgs/apparmor/template
index 13586d0976f979..abccabde5030cd 100644
--- a/srcpkgs/apparmor/template
+++ b/srcpkgs/apparmor/template
@@ -1,13 +1,15 @@
 # Template file for 'apparmor'
 pkgname=apparmor
 version=3.1.7
-revision=1
+revision=2
 build_wrksrc=libraries/libapparmor
 build_style=gnu-configure
 conf_files="/etc/apparmor.d/local/* /etc/apparmor/*"
 make_dirs="/etc/apparmor.d/disable 0755 root root"
+configure_args="--with-python"
 hostmakedepends="bison flex gettext python3 which python3-setuptools pkg-config
- perl"
+ perl swig automake"
+makedepends="python3-devel"
 depends="runit-void-apparmor libapparmor-${version}_${revision} python3-notify2
  python3-psutil python3-dbus iproute2"
 checkdepends="dejagnu"
@@ -21,9 +23,13 @@ checksum=c6c161d6dbd99c2f10758ff347cbc6848223c7381f311de62522f22b0a16de64
 replaces="apparmor-vim>=0"
 
 if [ -z "$CROSS_BUILD" ]; then
-	configure_args="--with-perl --with-python"
-	hostmakedepends+=" swig"
-	makedepends="python3-devel"
+	configure_args+=" --with-perl"
+fi
+
+# /usr/lib/perl5/core_perl/CORE/perl.h:3360:22: error: unknown type name 'off64_t';
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	CFLAGS+=" -D_LARGEFILE64_SOURCE"
+	CXXFLAGS+=" -D_LARGEFILE64_SOURCE"
 fi
 
 pre_build() {

  parent reply	other threads:[~2024-06-27 13:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 12:57 [PR PATCH] apparmor: fix build on musl Calandracas606
2024-06-27 13:09 ` [PR PATCH] [Updated] " Calandracas606
2024-06-27 13:31 ` Calandracas606 [this message]
2024-06-27 13:46 ` [PR PATCH] [Updated] apparmor: fix build on musl, enable python on cross-compile Calandracas606
2024-06-27 13:52 ` Calandracas606
2024-06-27 14:16 ` Calandracas606
2024-06-27 14:17 ` Calandracas606
2024-06-27 22:31 ` [PR REVIEW] " classabbyamp
2024-06-27 22:32 ` classabbyamp
2024-06-27 22:47 ` [PR REVIEW] " Calandracas606
2024-06-28  2:42 ` [PR PATCH] [Updated] " Calandracas606
2024-06-28  2:57 ` Calandracas606
2024-06-28  3:00 ` Calandracas606
2024-07-02  6:52 ` [PR PATCH] [Closed]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240627133132.94DF0270BC@inbox.vuxu.org \
    --to=calandracas606@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).