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: Fri, 28 Jun 2024 04:57:29 +0200	[thread overview]
Message-ID: <20240628025729.4EFFA23E02@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: 2448 bytes --]

From cb6b0b8c9ca26aeff772c06a84032594ff54716d 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, 21 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/apparmor/template b/srcpkgs/apparmor/template
index 13586d0976f979..467075257a3e2e 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="$(vopt_with python) $(vopt_with perl)"
 hostmakedepends="bison flex gettext python3 which python3-setuptools pkg-config
- perl"
+ perl $(vopt_if python swig)"
+makedepends="$(vopt_if python python3-devel)"
 depends="runit-void-apparmor libapparmor-${version}_${revision} python3-notify2
  python3-psutil python3-dbus iproute2"
 checkdepends="dejagnu"
@@ -20,10 +22,20 @@ distfiles="https://launchpad.net/apparmor/${version%.*}/${version}/+download/app
 checksum=c6c161d6dbd99c2f10758ff347cbc6848223c7381f311de62522f22b0a16de64
 replaces="apparmor-vim>=0"
 
+# /usr/lib/perl5/core_perl/CORE/perl.h:3360:22: error: unknown type name 'off64_t';
+CFLAGS="-D_LARGEFILE64_SOURCE"
+CXXFLAGS="-D_LARGEFILE64_SOURCE"
+
+build_options="python perl"
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|i686*)
+		build_options_default+=" python"
+	;;
+esac
+
 if [ -z "$CROSS_BUILD" ]; then
-	configure_args="--with-perl --with-python"
-	hostmakedepends+=" swig"
-	makedepends="python3-devel"
+	build_options_default+=" perl"
 fi
 
 pre_build() {
@@ -55,7 +67,7 @@ post_install() {
 	make DESTDIR="${DESTDIR}" install -C profiles
 
 	# requires perl bindings not generated when cross-compiling
-	if [ "$CROSS_BUILD" ]; then
+	if [ "$build_option_perl" ]; then
 		rm -f ${DESTDIR}/usr/bin/aa-notify
 	fi
 
@@ -71,8 +83,10 @@ libapparmor_package() {
 	license="LGPL-2.1-only"
 	pkg_install() {
 		vmove "usr/lib/libapparmor.so*"
-		if [ -z "$CROSS_BUILD" ]; then
+		if [ "$build_option_perl" ]; then
 			vmove usr/lib/perl5
+		fi
+		if [ "$build_option_python" ]; then
 			vmove "${py3_sitelib}/LibAppArmor*"
 		fi
 		vmove usr/share/man/man2

  parent reply	other threads:[~2024-06-28  2:57 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
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 [this message]
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=20240628025729.4EFFA23E02@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).