diff options
author | Swyter | 2023-04-25 06:15:43 +0200 |
---|---|---|
committer | Swyter | 2023-04-25 06:15:43 +0200 |
commit | 65c9d5447078a46353c58f33db14b060bb235ff5 (patch) | |
tree | 2475e937a19dfda78e3520adacb6883c6ff06a0e | |
parent | 8aa5e6e9af10eddd0d4fc47b61d3e829d0cffbe2 (diff) | |
download | aur-65c9d5447078a46353c58f33db14b060bb235ff5.tar.gz |
Fix the build. Add a nice install message explaining the fact that one will need to set the $PATH envvar for it to work. Add the extra bundled libraries to the global ld list. Otherwise the binaries will fail with a .so not found error. Use almost all the cores for building, get the number at runtime.
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 27 | ||||
-rw-r--r-- | osxcross-git.install | 22 |
3 files changed, 45 insertions, 9 deletions
@@ -1,8 +1,9 @@ pkgbase = osxcross-git pkgdesc = OS X cross toolchain for Linux, FreeBSD and NetBSD - pkgver = 0.14 + pkgver = 0.15 pkgrel = 1 url = https://github.com/tpoechtrager/osxcross + install = osxcross-git.install arch = x86_64 license = MIT makedepends = clang>=3.2 @@ -13,7 +14,9 @@ pkgbase = osxcross-git optdepends = uuid: for ld64 -random_uuid support optdepends = xar: for ld64 -bitcode_bundle support provides = osxcross + provides = xar conflicts = osxcross + conflicts = xar noextract = MacOSX10.11.sdk.tar.xz options = !strip source = git+https://github.com/tpoechtrager/osxcross.git @@ -1,7 +1,8 @@ # Maintainer: emersion <contact@emersion.fr> +# Maintainer: swyter <swyterzone+aur@gmail.com> pkgname=osxcross-git _pkgname=${pkgname%-git} -pkgver=0.14 +pkgver=0.15 pkgrel=1 pkgdesc="OS X cross toolchain for Linux, FreeBSD and NetBSD" arch=('x86_64') @@ -14,24 +15,34 @@ optdepends=( 'uuid: for ld64 -random_uuid support' 'xar: for ld64 -bitcode_bundle support' ) -provides=("$_pkgname") -conflicts=("$_pkgname") +provides=("$_pkgname" "xar") +conflicts=("$_pkgname" "xar") source=('git+https://github.com/tpoechtrager/osxcross.git' 'https://s3.dockerproject.org/darwin/v2/MacOSX10.11.sdk.tar.xz') md5sums=('SKIP' 'b0d81b95746c7e698c39c7df1e15ca7d') noextract=('MacOSX10.11.sdk.tar.xz') options=('!strip') +install="$pkgname.install" -build() { +prepare() { cd "$srcdir/$_pkgname" - mv ../MacOSX10.11.sdk.tar.xz tarballs/ - sed -i -e 's|-march=native||g' build_clang.sh wrapper/build.sh - UNATTENDED=yes OSX_VERSION_MIN=10.6 ./build.sh +} + +build() { + # swy: use almost all available processor cores, for compiling speed. Leave a spare one. + cd "$srcdir/$_pkgname" + JOBS=$(( `nproc` - 1 )) UNATTENDED=yes OSX_VERSION_MIN=10.6 ./build.sh # OCDEBUG=1 } package() { cd "$srcdir/$_pkgname" + # swy: put all the generated files in there mkdir -p $pkgdir/usr/local mv target $pkgdir/usr/local/osx-ndk-x86 -} + + # swy: make sure the cross-compiled binaries can locate the .so dependencies stored aside in every + # case without having to set funky environment variables or patching the .elf RUNPATH + mkdir -p $pkgdir/etc/ld.so.conf.d/ + echo '/usr/local/osx-ndk-x86/lib' > $pkgdir/etc/ld.so.conf.d/osxcross.conf +}
\ No newline at end of file diff --git a/osxcross-git.install b/osxcross-git.install new file mode 100644 index 000000000000..6d3d376b3202 --- /dev/null +++ b/osxcross-git.install @@ -0,0 +1,22 @@ +# Maintainer: swyter <swyterzone+aur@gmail.com> + +post_install() +{ + echo "" + echo -e "\e[1mImportant:\e[0m Don't forget to add \x1B[32m/usr/local/osx-ndk-x86/bin\x1B[0m to your PATH variable when trying to use your cross-compiler:" + echo -e " Now you can use \e[3mo32-clang(++)\e[0m and \e[3mo64-clang(++)\e[0m like a normal compiler." + echo "" + echo -e "\e[1m Example usage:\e[0m" + echo -e "\e[1m Example 1:\e[0m CC=o32-clang ./configure --host=i386-apple-darwin15" + echo -e "\e[1m Example 2:\e[0m CC=i386-apple-15-clang ./configure --host=i386-apple-darwin15" + echo -e "\e[1m Example 3:\e[0m o64-clang -Wall test.c -o test" + echo -e "\e[1m Example 4:\e[0m x86_64-apple-darwin15-strip -x test" + echo -e "" + + # ldconfig +} + +post_upgrade() +{ + post_install +} |