Skip to content

Conversation

@imchristina
Copy link

No description provided.

@Johnnynator
Copy link
Member

musl can be easily patched

--- source/modules/hylia/link/asio/impl/error_code.ipp	2018-01-22 21:05:35.000000000 +0000
+++ -	2018-06-18 09:13:32.145486974 +0000
@@ -101,7 +101,7 @@
 #elif defined(__MACH__) && defined(__APPLE__) \
   || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
   || defined(_AIX) || defined(__hpux) || defined(__osf__) \
-  || defined(__ANDROID__)
+  || defined(__ANDROID__) || !defined(__GLIBC__)
     char buf[256] = "";
     using namespace std;
     strerror_r(value, buf, sizeof(buf));

@Johnnynator
Copy link
Member

Johnnynator commented Jun 18, 2018

For non i686/x86_64 arches this may help, compilation succeeded on armv7l-musl. aarch64 seems to make troubles.

diff --git a/srcpkgs/Carla/template b/srcpkgs/Carla/template
index fcb3162c98..a9be2390fd 100644
--- a/srcpkgs/Carla/template
+++ b/srcpkgs/Carla/template
@@ -16,10 +16,33 @@ homepage="http://kxstudio.linuxaudio.org/Applications:Carla"
 distfiles="https://github.com/falkTX/Carla/archive/${version}.tar.gz"
 checksum=966647c508bf92eafb03d0aaf687acb399c687782461154fad40d64745786e67
 
+case $XBPS_TARGET_MACHINE in
+	x86_64* | i686*);;
+	*) make_build_args+=" NOOPT=true"
+	   make_install_args+=" NOOPT=true";;
+esac
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" Carla-devel"
+fi
+
 pre_build() {
-	make features
+	if [ "$CROSS_BUILD" ]; then
+		sed -i -e 's#\./carla-lv2-export#/usr/bin/carla-lv2-export#g' \
+			source/plugin/Makefile
+	fi
+
+	make ${make_build_args} features
 }
 
 post_install() {
 	mv ${DESTDIR}/usr/lib/python3{,.5}
+	vbin bin/carla-lv2-export
+}
+
+Carla-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/bin/carla-lv2-export
+	}
 }

makedepends="
python3-PyQt5-devel-tools python3-PyQt5 libmagic file-devel liblo-devel
alsa-lib-devel pulseaudio-devel libX11-devel gtk+3-devel gtk+-devel qt5-devel
qt-devel fluidsynth-devel fftw-devel mxml-devel zlib-devel python3-rdflib"
Copy link
Member

Choose a reason for hiding this comment

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

Any particular reason to enable support for qt4? Imo it should be disabled except if it is really needed.

Copy link
Author

@imchristina imchristina Jun 18, 2018

Choose a reason for hiding this comment

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

qt4 is needed for full support of lv2 plugins. I'm not sure how many plugins actually use qt4 however.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. If it actually add functionality that you won't get with qt5 only then let it there. I just would prefer not adding to much new stuff that depends on qt4 since qt4 is EOL.

@Johnnynator
Copy link
Member

aarch64.patch

--- source/modules/water/memory/ByteOrder.h	2018-01-22 21:05:35.000000000 +0000
+++ -	2018-06-18 09:58:25.563913205 +0000
@@ -153,7 +153,7 @@
 {
    #ifdef CARLA_OS_MAC
     return OSSwapInt32 (n);
-   #elif defined(CARLA_OS_WIN) || ! (defined (__arm__) || defined (__arm64__))
+   #elif defined(CARLA_OS_WIN) || ! (defined (__arm__) || ! defined (__arm64__))
     asm("bswap %%eax" : "=a"(n) : "a"(n));
     return n;
    #else

@imchristina
Copy link
Author

Sorry, this is my first time creating a package and I don't have any experience with patch files. I made the aarch64.patch and musl.patch files in srcpkg/Carla/patch and added your changes to template, but it fails on aarch64.patch.

=> Carla-1.9.8_1: running post-extract hook: 00-patches ...
=> Carla-1.9.8_1: patching: aarch64.patch.
1 out of 1 hunk FAILED -- saving rejects to file source/modules/water/memory/ByteOrder.h.rej
=> ERROR: Carla-1.9.8_1: post-extract_00-patches: 'patch -sl ${_args} -i ${_patch} 2> /dev/null' exited with 1
=> ERROR:   in _process_patch() at common/hooks/post-extract/00-patches.sh:34
=> ERROR:   in hook() at common/hooks/post-extract/00-patches.sh:51
=> ERROR:   in run_func() at common/xbps-src/shutils/common.sh:21
=> ERROR:   in run_pkg_hooks() at common/xbps-src/shutils/common.sh:251
=> ERROR:   in main() at common/xbps-src/libexec/xbps-src-doextract.sh:71

@Johnnynator
Copy link
Member

@nutcase84 damn. the Carla Source Code mixes unix and dos line endings and ByteOrder.h uses dos ones so the patch also has to use them but since you copied and pasted it from my comment you have unix line endings in a patch that should have dos ones.
You can just fetch the file from here https://raw.githubusercontent.com/Johnnynator/void-packages-1/carla/srcpkgs/Carla/patches/aarch64.patch . Or create the patch yourself.

@imchristina
Copy link
Author

@Johnnynator That fixed it. But now it needs a devel package. Why does it need it? Sorry if this is a obvious question, I'm just curious.

Also, should the devel package be in a different PR?

@Johnnynator
Copy link
Member

Carla-devel is a subpackage of Carla with a binary that is only needed on Compile time for cross builds. Subpackages are always a symlink to the package.

cd srcpkgs
ln -s Carla Carla-devel

Carla tries to execute a binary that was compiled for the target system on the host. The devel subpackage includes said binary and the path to id get overwritten in pre_build.
This issue could have also been solved by patching the build system to compile the binary with the host compiler but that would have been way more work.

@imchristina
Copy link
Author

Thank you for the explanation. I've pushed everything, hopefully I didn't mess anything up.

@Johnnynator
Copy link
Member

Lgtm, Travis failing on aarch64 is not related to this PR.

@maxice8 maxice8 merged commit 61a4bc4 into void-linux:master Jun 19, 2018
@imchristina imchristina deleted the carla branch June 19, 2018 10:50
}

post_install() {
mv ${DESTDIR}/usr/lib/python3{,.5}
Copy link
Member

Choose a reason for hiding this comment

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

wth is this? Please fix.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not entirely sure about why this is, but I think Carla writes to /usr/lib/python3 but the hook expects a specific python version to be specified. Hook 03-rewrite-python-shebang will fail without this hack.

kevcrumb pushed a commit to kevcrumb/void-packages that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants