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 16:17:37 +0200	[thread overview]
Message-ID: <20240627141737.AE27A20F50@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: 2125 bytes --]

From e74dfb0d82b16fb3d25d5297e6a8ac8add936f62 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/template | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/apparmor/template b/srcpkgs/apparmor/template
index 13586d0976f979..e782dc50ef9bf2 100644
--- a/srcpkgs/apparmor/template
+++ b/srcpkgs/apparmor/template
@@ -1,7 +1,7 @@
 # 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/*"
@@ -20,10 +20,24 @@ distfiles="https://launchpad.net/apparmor/${version%.*}/${version}/+download/app
 checksum=c6c161d6dbd99c2f10758ff347cbc6848223c7381f311de62522f22b0a16de64
 replaces="apparmor-vim>=0"
 
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|i686*)
+		configure_args+=" --with-python"
+		hostmakedepends+=" swig"
+		makedepends+=" python3-devel"
+		_have_python=yes
+	;;
+esac
+
 if [ -z "$CROSS_BUILD" ]; then
-	configure_args="--with-perl --with-python"
-	hostmakedepends+=" swig"
-	makedepends="python3-devel"
+	configure_args+=" --with-perl"
+	_have_perl=yes
+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() {
@@ -55,7 +69,7 @@ post_install() {
 	make DESTDIR="${DESTDIR}" install -C profiles
 
 	# requires perl bindings not generated when cross-compiling
-	if [ "$CROSS_BUILD" ]; then
+	if [ "$_have_perl" ]; then
 		rm -f ${DESTDIR}/usr/bin/aa-notify
 	fi
 
@@ -71,8 +85,10 @@ libapparmor_package() {
 	license="LGPL-2.1-only"
 	pkg_install() {
 		vmove "usr/lib/libapparmor.so*"
-		if [ -z "$CROSS_BUILD" ]; then
+		if [ "$_have_perl" ]; then
 			vmove usr/lib/perl5
+		fi
+		if [ "$_have_python" ]; then
 			vmove "${py3_sitelib}/LibAppArmor*"
 		fi
 		vmove usr/share/man/man2

  parent reply	other threads:[~2024-06-27 14:17 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 ` [PR PATCH] [Updated] apparmor: fix build on musl, enable python on cross-compile Calandracas606
2024-06-27 13:46 ` Calandracas606
2024-06-27 13:52 ` Calandracas606
2024-06-27 14:16 ` Calandracas606
2024-06-27 14:17 ` Calandracas606 [this message]
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=20240627141737.AE27A20F50@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).