guix: arm64-apple-darwin builds

This commit is contained in:
tobtoht 2023-03-23 20:10:01 +01:00
parent ffd6d332da
commit 913efe350f
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
14 changed files with 83 additions and 2179 deletions

View file

@ -3,13 +3,13 @@ work/
built/
sources/
config.site
x86_64-*
i686-*
mips-*
arm-*
aarch64-*
powerpc-*
riscv32-*
riscv64-*
s390x-*
arm64-*
x86_64-*/
i686-*/
mips-*/
arm-*/
aarch64-*/
powerpc-*/
riscv32-*/
riscv64-*/
s390x-*/
arm64-*/

View file

@ -1,29 +1,26 @@
package=libgcrypt
$(package)_version=1.8.9
$(package)_version=1.10.1
$(package)_download_path=https://www.gnupg.org/ftp/gcrypt/libgcrypt/
$(package)_file_name=libgcrypt-$($(package)_version).tar.bz2
$(package)_sha256_hash=2bda4790aa5f0895d3407cf7bf6bd7727fd992f25a45a63d92fef10767fa3769
$(package)_sha256_hash=ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de
$(package)_dependencies=libgpg-error
$(package)_patches=gost-sb.h no_gen_gost-sb.patch
define $(package)_set_vars
$(package)_build_opts=CFLAGS="-fPIE"
endef
# TODO: do a native compile first to eliminate the need for this patch
define $(package)_preprocess_cmds
mv $($(package)_patch_dir)/gost-sb.h cipher/gost-sb.h && \
patch -p1 < $($(package)_patch_dir)/no_gen_gost-sb.patch
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux
endef
# TODO: building on linux with $($(package)_autoconf) fails for mysterious reasons
ifeq ($(host_os),linux)
define $(package)_config_cmds
CFLAGS='-fPIE' CXXFLAGS='-fPIE' ./configure --host=$(host) --enable-digests="sha256 blake2" --enable-ciphers=aes --disable-amd64-as-feature-detection --disable-asm --disable-avx-support --disable-avx2-support --disable-sse41-support --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix) --prefix=$(host_prefix)
CFLAGS='-fPIE' CXXFLAGS='-fPIE' ./configure --host=$(host) --enable-digests="sha256 blake2" --enable-ciphers="aes chacha20" --disable-amd64-as-feature-detection --disable-asm --disable-avx-support --disable-avx2-support --disable-sse41-support --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix) --prefix=$(host_prefix)
endef
else
define $(package)_config_cmds
$($(package)_autoconf) --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix)
$($(package)_autoconf) --disable-shared --enable-static --disable-doc --disable-asm --with-libgpg-error-prefix=$(host_prefix)
endef
endif

View file

@ -8,6 +8,10 @@ define $(package)_set_vars
$(package)_build_opts=CFLAGS="-fPIE"
endef
define $(package)_preprocess_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux
endef
define $(package)_config_cmds
$($(package)_autoconf) --enable-static --disable-shared
endef

View file

@ -5,6 +5,7 @@ $(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5
define $(package)_preprocess_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . && \
autoreconf -i
endef
@ -15,17 +16,9 @@ define $(package)_set_vars
$(package)_config_opts_darwin=--disable-udev
endef
ifneq ($(host_os),darwin)
define $(package)_config_cmds
cp -f $(BASEDIR)/config.guess config.guess &&\
cp -f $(BASEDIR)/config.sub config.sub &&\
$($(package)_autoconf)
endef
else
define $(package)_config_cmds
$($(package)_autoconf)
endef
endif
define $(package)_config_cmds
$($(package)_autoconf)
endef
define $(package)_build_cmd
$(MAKE)

View file

@ -0,0 +1,10 @@
package=native_rcodesign
$(package)_version=0.22.0
$(package)_download_path=https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign/$($(package)_version)/
$(package)_file_name=apple-codesign-$($(package)_version)-x86_64-unknown-linux-musl.tar.gz
$(package)_sha256_hash=f6382c5e6e47bc4f6f02be2ad65a4fc5120b3df75aa520647abbadbae747fbcc
define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/bin && \
cp rcodesign $($(package)_staging_prefix_dir)/bin
endef

View file

@ -5,7 +5,7 @@ linux_packages := eudev liblzma libarchive libfuse libsquashfuse libappimage app
linux_native_packages = native_patchelf
darwin_packages :=
darwin_native_packages = darwin_sdk native_cctools native_libtapi native_clang
darwin_native_packages = darwin_sdk native_cctools native_libtapi native_clang native_rcodesign
mingw32_packages = icu4c
mingw32_native_packages = native_cmake

View file

@ -12,6 +12,9 @@ define $(package)_set_vars
endef
define $(package)_config_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . && \
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub ./third_party/googletest/googletest/build-aux/ && \
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub ./third_party/googletest/googlemock/build-aux/ && \
$($(package)_autoconf)
endef

View file

@ -10,6 +10,7 @@ $(package)_linux_dependencies=openssl native_qt freetype fontconfig libxcb libxk
$(package)_qt_libs=corelib network widgets gui plugins testlib
$(package)_linguist_tools = lrelease lupdate lconvert
$(package)_patches = aarch64Toolchain.cmake
$(package)_patches += arm64-apple-toolchain.cmake
$(package)_patches += dont_hardcode_pwd.patch
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_patches += gnueabihfToolchain.cmake
@ -140,13 +141,9 @@ $(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION)
$(package)_config_opts_darwin += -qt-host-path $(build_prefix)/qt-host
endif
ifneq ($(build_arch),$(host_arch))
$(package)_config_opts_aarch64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64
$(package)_config_opts_x86_64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64
endif
$(package)_config_opts_darwin += -no-feature-ffmpeg
$(package)_config_opts_darwin += -- -DCMAKE_TOOLCHAIN_FILE=MacToolchain.cmake -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib
$(package)_config_opts_aarch64_darwin += -- -DCMAKE_TOOLCHAIN_FILE=arm64-apple-toolchain.cmake -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib
$(package)_config_opts_x86_64_darwin += -- -DCMAKE_TOOLCHAIN_FILE=MacToolchain.cmake -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib
$(package)_config_opts_linux = -xcb
$(package)_config_opts_linux += -no-xcb-xlib
@ -263,6 +260,7 @@ define $(package)_preprocess_cmds
mv $($(package)_patch_dir)/WindowsToolchain.cmake . && \
mv $($(package)_patch_dir)/MacToolchain.cmake . && \
mv $($(package)_patch_dir)/aarch64Toolchain.cmake . && \
mv $($(package)_patch_dir)/arm64-apple-toolchain.cmake . && \
mv $($(package)_patch_dir)/gnueabihfToolchain.cmake . && \
mv $($(package)_patch_dir)/riscvToolchain.cmake . && \
cd qtmultimedia && \

View file

@ -11,6 +11,7 @@ define $(package)_set_vars
endef
define $(package)_preprocess_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux/ && \
patch -p1 < $($(package)_patch_dir)/disable-glibc-getrandom-getentropy.patch &&\
autoconf &&\
patch -p1 < $($(package)_patch_dir)/fix-whitespace.patch

File diff suppressed because it is too large Load diff

View file

@ -1,13 +0,0 @@
--- a/cipher/Makefile.in
+++ b/cipher/Makefile.in
@@ -1228,9 +1228,7 @@ uninstall-am:
.PRECIOUS: Makefile
-gost28147.lo: gost-sb.h
-gost-sb.h: gost-s-box
- ./gost-s-box $@
+gost28147.lo:
gost-s-box: gost-s-box.c
$(CC_FOR_BUILD) -o $@ $(srcdir)/gost-s-box.c

View file

@ -0,0 +1,25 @@
# Targeted operating system.
set(CMAKE_SYSTEM_NAME Darwin)
# TODO: don't hardcode this
set(TARGET_SYSROOT /feather/contrib/depends/arm64-apple-darwin/native/SDK)
set(CMAKE_SYSROOT ${TARGET_SYSROOT})
set(CMAKE_OSX_SYSROOT ${TARGET_SYSROOT})
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# TODO: don't hardcode this
set(CMAKE_C_FLAGS "--target=arm64-apple-darwin -mmacosx-version-min=10.14 -B/feather/contrib/depends/arm64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/arm64-apple-darwin/native/SDK -Xclang -internal-externc-isystem/gnu/store/rwsysyzpxzwi7g1jv4hxwi3m8i36iwcc-clang-10.0.1/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include")
set(CMAKE_CXX_FLAGS "--target=arm64-apple-darwin -mmacosx-version-min=10.14 -B/feather/contrib/depends/arm64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/arm64-apple-darwin/native/SDK -stdlib=libc++ -stdlib++-isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include/c++/v1 -isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include/c++/v1 -isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include -Xclang -internal-externc-isystem/gnu/store/rwsysyzpxzwi7g1jv4hxwi3m8i36iwcc-clang-10.0.1/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include")
set(CMAKE_INSTALL_NAME_TOOL arm64-apple-darwin-install_name_tool)
set(CMAKE_FIND_ROOT_PATH /feather/contrib/depends/arm64-apple-darwin/)
# Adjust the default behavior of the find commands:
# search headers and libraries in the target environment
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
# Search programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

View file

@ -77,7 +77,7 @@ export HOSTS="${HOSTS:-x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf
x86_64-linux-gnu.no-tor-bundle
riscv64-linux-gnu
x86_64-w64-mingw32 x86_64-w64-mingw32.installer
x86_64-apple-darwin}"
x86_64-apple-darwin arm64-apple-darwin}"
# Usage: distsrc_for_host HOST
#

View file

@ -319,6 +319,13 @@ mkdir -p "$DISTSRC"
;;
esac
DARWIN_ARCH=""
case "$HOST" in
arm64-apple-darwin)
DARWIN_ARCH="-arm64"
;;
esac
case "$HOST" in
*linux*)
bash contrib/AppImage/build-appimage.sh
@ -366,6 +373,12 @@ mkdir -p "$DISTSRC"
;;
esac
case "$HOST" in
arm64-apple-darwin)
/feather/contrib/depends/arm64-apple-darwin/native/bin/rcodesign sign Feather.app
;;
esac
# Finally, deterministically produce {non-,}debug binary tarballs ready
# for release
case "$HOST" in
@ -413,8 +426,8 @@ mkdir -p "$DISTSRC"
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
find . \
| sort \
| zip -X@ "${OUTDIR}/${DISTNAME}-mac.zip" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-mac.zip" && exit 1 )
| zip -X@ "${OUTDIR}/${DISTNAME}-mac${DARWIN_ARCH}.zip" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-mac${DARWIN_ARCH}.zip" && exit 1 )
;;
esac