diff --git a/contrib/AppImage/build-appimage.sh b/contrib/AppImage/build-appimage.sh index fba19cd..fde0a82 100755 --- a/contrib/AppImage/build-appimage.sh +++ b/contrib/AppImage/build-appimage.sh @@ -18,13 +18,18 @@ chmod +x "$APPDIR/usr/bin/feather" export LD_LIBRARY_PATH=/feather/contrib/depends/x86_64-linux-gnu/lib/:/gnu/store:/gnu/store/yk91cxchassi5ykxsyd4vci32vncgjkf-gcc-cross-x86_64-linux-gnu-10.3.0-lib/x86_64-linux-gnu/lib -# fuck you linuxdeployqt +# linuxdeployqt glibc moaning bypass mkdir -p "$APPDIR/usr/share/doc/libc6" touch "$APPDIR/usr/share/doc/libc6/copyright" -linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs -unsupported-allow-new-glibc +# TODO: linuxdeployqt can't build ARM appimages on x86_64, skip this step for ARM builds +case "$HOST" in + x86_64*) + linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs -unsupported-allow-new-glibc + rm "$APPDIR/AppRun" + ;; +esac -rm "$APPDIR/AppRun" cp "contrib/AppImage/AppRun" "$APPDIR/" chmod +x "$APPDIR/AppRun" @@ -37,7 +42,7 @@ mksquashfs feather.AppDir feather.squashfs -info -root-owned -no-xattrs -noappen printf '\x00\x00\x00\x00' | dd conv=notrunc of=feather.squashfs bs=1 seek=$((0x8)) rm -f feather.AppImage -## Don't hardcode this -cat /feather/contrib/depends/x86_64-linux-gnu/runtime-x86_64 >> feather.AppImage + +cat /feather/contrib/depends/${HOST}/runtime >> feather.AppImage cat feather.squashfs >> feather.AppImage chmod a+x feather.AppImage diff --git a/contrib/depends/.gitignore b/contrib/depends/.gitignore index 2287886..d1985d7 100644 --- a/contrib/depends/.gitignore +++ b/contrib/depends/.gitignore @@ -3,12 +3,12 @@ work/ built/ sources/ config.site -x86_64* -i686* -mips* -arm* -aarch64* -powerpc* -riscv32* -riscv64* -s390x* \ No newline at end of file +x86_64-* +i686-* +mips-* +arm-* +aarch64-* +powerpc-* +riscv32-* +riscv64-* +s390x-* diff --git a/contrib/depends/packages/appimage_runtime.mk b/contrib/depends/packages/appimage_runtime.mk index 7ad05df..3f49889 100644 --- a/contrib/depends/packages/appimage_runtime.mk +++ b/contrib/depends/packages/appimage_runtime.mk @@ -12,7 +12,7 @@ define $(package)_preprocess_cmds endef define $(package)_config_cmds - $($(package)_cmake) -DCMAKE_INSTALL_PREFIX=$(host_prefix) . + $($(package)_cmake) -DCMAKE_INSTALL_PREFIX=$(host_prefix) -DHOST=$(host) -DGLIBC_DYNAMIC_LINKER=$(GLIBC_DYNAMIC_LINKER) . endef define $(package)_build_cmds @@ -20,5 +20,5 @@ define $(package)_build_cmds endef define $(package)_stage_cmds - cp -a runtime $($(package)_staging_prefix_dir)/runtime-x86_64 + cp -a runtime $($(package)_staging_prefix_dir)/runtime endef diff --git a/contrib/depends/packages/libXau.mk b/contrib/depends/packages/libXau.mk new file mode 100644 index 0000000..7a24a0a --- /dev/null +++ b/contrib/depends/packages/libXau.mk @@ -0,0 +1,34 @@ +package=libXau +$(package)_version=1.0.9 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=libXau-$($(package)_version).tar.bz2 +$(package)_sha256_hash=ccf8cbf0dbf676faa2ea0a6d64bcc3b6746064722b606c8c52917ed00dcb73ec +$(package)_dependencies=xproto + +# When updating this package, check the default value of +# --disable-xthreads. It is currently enabled. +define $(package)_set_vars + $(package)_config_opts=--disable-shared --disable-lint-library --without-lint + $(package)_config_opts += --disable-dependency-tracking --enable-option-checking + $(package)_config_opts += --with-pic +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share lib/*.la +endef diff --git a/contrib/depends/packages/libfuse.mk b/contrib/depends/packages/libfuse.mk index fbd9c25..9457ea7 100644 --- a/contrib/depends/packages/libfuse.mk +++ b/contrib/depends/packages/libfuse.mk @@ -4,11 +4,16 @@ $(package)_version=2.9.9 $(package)_download_path=https://github.com/libfuse/libfuse/releases/download/fuse-2.9.9/ $(package)_file_name=fuse-$($(package)_version).tar.gz $(package)_sha256_hash=d0e69d5d608cc22ff4843791ad097f554dd32540ddc9bed7638cc6fea7c1b4b5 +$(package)_patches = arm64.patch define $(package)_config_cmds $($(package)_autoconf) endef +define $(package)_preprocess_cmds + patch -p1 -i $($(package)_patch_dir)/arm64.patch +endef + define $(package)_build_cmds $(MAKE) endef diff --git a/contrib/depends/packages/libgcrypt.mk b/contrib/depends/packages/libgcrypt.mk index 8b8c637..05ebad7 100644 --- a/contrib/depends/packages/libgcrypt.mk +++ b/contrib/depends/packages/libgcrypt.mk @@ -16,10 +16,10 @@ define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/no_gen_gost-sb.patch endef -# TODO: building on linux with $($(package)_autoconf) fails for mysterious reasons (related to --host) +# TODO: building on linux with $($(package)_autoconf) fails for mysterious reasons ifeq ($(host_os),linux) define $(package)_config_cmds - CFLAGS='-fPIE' CXXFLAGS='-fPIE' ./configure --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 --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 diff --git a/contrib/depends/packages/libxcb.mk b/contrib/depends/packages/libxcb.mk new file mode 100644 index 0000000..77ff2d5 --- /dev/null +++ b/contrib/depends/packages/libxcb.mk @@ -0,0 +1,41 @@ +package=libxcb +$(package)_version=1.14 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=libxcb-$($(package)_version).tar.xz +$(package)_sha256_hash=a55ed6db98d43469801262d81dc2572ed124edc3db31059d4e9916eb9f844c34 +$(package)_dependencies=xcb_proto libXau +$(package)_patches = remove_pthread_stubs.patch + +define $(package)_set_vars +$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen --without-launchd +$(package)_config_opts += --disable-dependency-tracking --enable-option-checking +# Disable unneeded extensions. +# More info is available from: https://doc.qt.io/qt-5.15/linux-requirements.html +$(package)_config_opts += --disable-composite --disable-damage --disable-dpms +$(package)_config_opts += --disable-dri2 --disable-dri3 --disable-glx +$(package)_config_opts += --disable-present --disable-record --disable-resource +$(package)_config_opts += --disable-screensaver --disable-xevie --disable-xfree86-dri +$(package)_config_opts += --disable-xinput --disable-xprint --disable-selinux +$(package)_config_opts += --disable-xtest --disable-xv --disable-xvmc +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux && \ + patch -p1 -i $($(package)_patch_dir)/remove_pthread_stubs.patch +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share lib/*.la +endef \ No newline at end of file diff --git a/contrib/depends/packages/libxcb_util.mk b/contrib/depends/packages/libxcb_util.mk new file mode 100644 index 0000000..6f1b9cd --- /dev/null +++ b/contrib/depends/packages/libxcb_util.mk @@ -0,0 +1,32 @@ +package=libxcb_util +$(package)_version=0.4.0 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-util-$($(package)_version).tar.bz2 +$(package)_sha256_hash=46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9 +$(package)_dependencies=libxcb + +define $(package)_set_vars +$(package)_config_opts = --disable-shared --disable-devel-docs --without-doxygen +$(package)_config_opts += --disable-dependency-tracking --enable-option-checking +$(package)_config_opts += --with-pic +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share/man share/doc lib/*.la +endef diff --git a/contrib/depends/packages/libxcb_util_image.mk b/contrib/depends/packages/libxcb_util_image.mk new file mode 100644 index 0000000..d12d67e --- /dev/null +++ b/contrib/depends/packages/libxcb_util_image.mk @@ -0,0 +1,31 @@ +package=libxcb_util_image +$(package)_version=0.4.0 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-util-image-$($(package)_version).tar.bz2 +$(package)_sha256_hash=2db96a37d78831d643538dd1b595d7d712e04bdccf8896a5e18ce0f398ea2ffc +$(package)_dependencies=libxcb libxcb_util + +define $(package)_set_vars +$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen +$(package)_config_opts+= --disable-dependency-tracking --enable-option-checking +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share/man share/doc lib/*.la +endef diff --git a/contrib/depends/packages/libxcb_util_keysyms.mk b/contrib/depends/packages/libxcb_util_keysyms.mk new file mode 100644 index 0000000..d4f72de --- /dev/null +++ b/contrib/depends/packages/libxcb_util_keysyms.mk @@ -0,0 +1,31 @@ +package=libxcb_util_keysyms +$(package)_version=0.4.0 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-util-keysyms-$($(package)_version).tar.bz2 +$(package)_sha256_hash=0ef8490ff1dede52b7de533158547f8b454b241aa3e4dcca369507f66f216dd9 +$(package)_dependencies=libxcb xproto + +define $(package)_set_vars +$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen +$(package)_config_opts += --disable-dependency-tracking --enable-option-checking +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share/man share/doc lib/*.la +endef diff --git a/contrib/depends/packages/libxcb_util_render.mk b/contrib/depends/packages/libxcb_util_render.mk new file mode 100644 index 0000000..28f1fb0 --- /dev/null +++ b/contrib/depends/packages/libxcb_util_render.mk @@ -0,0 +1,31 @@ +package=libxcb_util_render +$(package)_version=0.3.9 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-util-renderutil-$($(package)_version).tar.bz2 +$(package)_sha256_hash=c6e97e48fb1286d6394dddb1c1732f00227c70bd1bedb7d1acabefdd340bea5b +$(package)_dependencies=libxcb + +define $(package)_set_vars +$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen +$(package)_config_opts += --disable-dependency-tracking --enable-option-checking +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share/man share/doc lib/*.la +endef diff --git a/contrib/depends/packages/libxcb_util_wm.mk b/contrib/depends/packages/libxcb_util_wm.mk new file mode 100644 index 0000000..3b905ba --- /dev/null +++ b/contrib/depends/packages/libxcb_util_wm.mk @@ -0,0 +1,31 @@ +package=libxcb_util_wm +$(package)_version=0.4.1 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-util-wm-$($(package)_version).tar.bz2 +$(package)_sha256_hash=28bf8179640eaa89276d2b0f1ce4285103d136be6c98262b6151aaee1d3c2a3f +$(package)_dependencies=libxcb + +define $(package)_set_vars +$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen +$(package)_config_opts += --disable-dependency-tracking --enable-option-checking +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share/man share/doc lib/*.la +endef diff --git a/contrib/depends/packages/libxkbcommon.mk b/contrib/depends/packages/libxkbcommon.mk new file mode 100644 index 0000000..4c8e68f --- /dev/null +++ b/contrib/depends/packages/libxkbcommon.mk @@ -0,0 +1,36 @@ +package=libxkbcommon +$(package)_version=0.8.4 +$(package)_download_path=https://xkbcommon.org/download/ +$(package)_file_name=libxkbcommon-$($(package)_version).tar.xz +$(package)_sha256_hash=60ddcff932b7fd352752d51a5c4f04f3d0403230a584df9a2e0d5ed87c486c8b +$(package)_dependencies=libxcb + +# This package explicitly enables -Werror=array-bounds, which causes build failures +# with GCC 12.1+. Work around that by turning errors back into warnings. +# This workaround would be dropped if the package was updated, as that would require +# a different build system (Meson) +define $(package)_set_vars +$(package)_config_opts = --enable-option-checking --disable-dependency-tracking +$(package)_config_opts += --disable-static --disable-docs +$(package)_cflags += -Wno-error=array-bounds +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm lib/*.la +endef diff --git a/contrib/depends/packages/native_qt.mk b/contrib/depends/packages/native_qt.mk index baa2f4a..4070b0c 100644 --- a/contrib/depends/packages/native_qt.mk +++ b/contrib/depends/packages/native_qt.mk @@ -114,7 +114,6 @@ $(package)_config_opts += -no-feature-undoview $(package)_config_opts += -no-feature-vnc #$(package)_config_opts += -no-feature-wizard # Needed $(package)_config_opts += -no-feature-fontconfig -$(package)_config_opts += -no-feature-dbus $(package)_config_opts += -xcb $(package)_config_opts += -no-xcb-xlib diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index f1c9c7a..8db6c5e 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -4,10 +4,12 @@ packages := boost openssl libiconv ldns unbound qrencode zbar sodium polyseed hi hardware_packages := hidapi protobuf libusb hardware_native_packages := native_protobuf -linux_packages := eudev libzip liblzma libarchive libfuse libsquashfuse libappimage +linux_packages := eudev libzip liblzma libarchive libfuse libsquashfuse libappimage appimage_runtime linux_native_packages = $(hardware_native_packages) native_patchelf -qt_linux_packages:=qt native_expat native_libxcb native_xcb_proto native_libXau native_xproto native_freetype native_fontconfig native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm appimage_runtime +linux_native_packages += native_qt native_expat native_libxcb native_xcb_proto native_libXau native_xproto native_freetype native_fontconfig native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm + +qt_linux_packages:=native_expat libxcb xcb_proto libXau xproto native_freetype native_fontconfig libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm qt qt_darwin_packages=native_qt qt qt_mingw32_packages=native_qt diff --git a/contrib/depends/packages/qt.mk b/contrib/depends/packages/qt.mk index a2d0cf2..ea4af34 100644 --- a/contrib/depends/packages/qt.mk +++ b/contrib/depends/packages/qt.mk @@ -6,7 +6,7 @@ $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=cb6475a0bd8567c49f7ffbb072a05516ee6671171bed55db75b22b94ead9b37d $(package)_darwin_dependencies=native_cctools native_qt openssl $(package)_mingw32_dependencies=openssl native_cmake native_qt native_freetype native_fontconfig native_libxkbcommon -$(package)_linux_dependencies=openssl native_cmake native_freetype native_fontconfig native_libxcb native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm +$(package)_linux_dependencies=openssl native_qt native_cmake native_freetype native_fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_linguist_tools = lrelease lupdate lconvert $(package)_patches = root_CMakeLists.txt @@ -32,6 +32,8 @@ $(package)_patches += missing-include.patch $(package)_patches += no-__builtin_available.patch $(package)_patches += no-ffmpeg.patch $(package)_patches += remove-shaders.patch +$(package)_patches += aarch64Toolchain.cmake +$(package)_patches += gnueabihfToolchain.cmake $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=7ab93a930b693eeb53ab97b038b4e6e057d06374e6f49a3814d99145a276925f @@ -177,6 +179,12 @@ ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx))) $(package)_config_opts_x86_64_linux = -xplatform linux-clang-libc++ endif +$(package)_config_opts_arm_linux += -qt-host-path $(build_prefix)/qt-host +$(package)_config_opts_arm_linux += -- -DCMAKE_TOOLCHAIN_FILE=gnueabihfToolchain.cmake -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib + +$(package)_config_opts_aarch64_linux += -qt-host-path $(build_prefix)/qt-host +$(package)_config_opts_aarch64_linux += -- -DCMAKE_TOOLCHAIN_FILE=aarch64Toolchain.cmake -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib + $(package)_config_opts_mingw32 = -no-opengl $(package)_config_opts_mingw32 += -no-dbus $(package)_config_opts_mingw32 += -no-freetype @@ -267,6 +275,8 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/no-__builtin_available.patch && \ mv $($(package)_patch_dir)/WindowsToolchain.cmake . && \ mv $($(package)_patch_dir)/MacToolchain.cmake . && \ + mv $($(package)_patch_dir)/aarch64Toolchain.cmake . && \ + mv $($(package)_patch_dir)/gnueabihfToolchain.cmake . && \ cd qtmultimedia && \ patch -p1 -i $($(package)_patch_dir)/no-ffmpeg.patch && \ patch -p1 -i $($(package)_patch_dir)/remove-shaders.patch && \ diff --git a/contrib/depends/packages/tor_linux.mk b/contrib/depends/packages/tor_linux.mk index 2ecf69b..ed62618 100644 --- a/contrib/depends/packages/tor_linux.mk +++ b/contrib/depends/packages/tor_linux.mk @@ -11,10 +11,12 @@ define $(package)_set_vars $(package)_config_opts+=--with-libevent-dir=$(host_prefix) --with-openssl-dir=$(host_prefix) $(package)_config_opts+=--with-zlib-dir=$(host_prefix) --disable-tool-name-check --enable-fatal-warnings $(package)_config_opts+=--prefix=$(host_prefix) + $(package)_cflags+=-O2 + $(package)_cxxflags+=-O2 endef define $(package)_config_cmds - ./configure $($(package)_config_opts) + $($(package)_autoconf) $($(package)_config_opts) endef define $(package)_build_cmds @@ -26,7 +28,7 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - strip -s -D bin/tor && \ + $(host_toolchain)strip -s -D bin/tor && \ mkdir $($(package)_staging_prefix_dir)/Tor/ && \ cp bin/tor $($(package)_staging_prefix_dir)/Tor endef \ No newline at end of file diff --git a/contrib/depends/packages/xcb_proto.mk b/contrib/depends/packages/xcb_proto.mk new file mode 100644 index 0000000..9be8225 --- /dev/null +++ b/contrib/depends/packages/xcb_proto.mk @@ -0,0 +1,21 @@ +package=xcb_proto +$(package)_version=1.14.1 +$(package)_download_path=https://xorg.freedesktop.org/archive/individual/proto +$(package)_file_name=xcb-proto-$($(package)_version).tar.xz +$(package)_sha256_hash=f04add9a972ac334ea11d9d7eb4fc7f8883835da3e4859c9afa971efdf57fcc3 + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf lib/python*/site-packages/xcbgen/__pycache__ +endef diff --git a/contrib/depends/packages/xproto.mk b/contrib/depends/packages/xproto.mk new file mode 100644 index 0000000..f18bf02 --- /dev/null +++ b/contrib/depends/packages/xproto.mk @@ -0,0 +1,26 @@ +package=xproto +$(package)_version=7.0.31 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/proto +$(package)_file_name=xproto-$($(package)_version).tar.bz2 +$(package)_sha256_hash=c6f9747da0bd3a95f86b17fb8dd5e717c8f3ab7f0ece3ba1b247899ec1ef7747 + +define $(package)_set_vars + $(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs + $(package)_config_opts += --disable-dependency-tracking --enable-option-checking +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/patches/appimage_runtime/CMakeLists.txt b/contrib/depends/patches/appimage_runtime/CMakeLists.txt index a619acd..5459d98 100644 --- a/contrib/depends/patches/appimage_runtime/CMakeLists.txt +++ b/contrib/depends/patches/appimage_runtime/CMakeLists.txt @@ -8,6 +8,8 @@ project(appimage_runtime) # The runtime produced here is not guaranteed to run on all officially supported platforms. # You have been warned. +# TODO: Switch to https://github.com/AppImageCrafters/appimage-runtime + set(CMAKE_VERBOSE_MAKEFILE ON) # C and C++ versions @@ -33,8 +35,8 @@ endif() # must not include -flto in the following flags, otherwise the data sections will be stripped out set(runtime_cflags -std=c99 -ffunction-sections -fdata-sections - -I/feather/contrib/depends/x86_64-linux-gnu/include - -I/feather/contrib/depends/x86_64-linux-gnu/include/appimage + -I/feather/contrib/depends/${HOST}/include + -I/feather/contrib/depends/${HOST}/include/appimage ) # must not include -Wl,--gc-sections in the following flags, otherwise the data sections will be stripped out set(runtime_ldflags -s -ffunction-sections -fdata-sections -flto) @@ -80,28 +82,28 @@ add_custom_command( # TODO: find out whether all the sections can be embedded in a single objcopy call add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.1.o - COMMAND objcopy --add-section .digest_md5=16_blank_bytes --set-section-flags .digest_md5=noload,readonly runtime.0.o runtime.1.o + COMMAND ${HOST}-objcopy --add-section .digest_md5=16_blank_bytes --set-section-flags .digest_md5=noload,readonly runtime.0.o runtime.1.o MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.0.o DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/16_blank_bytes WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.2.o - COMMAND objcopy --add-section .upd_info=1024_blank_bytes --set-section-flags .upd_info=noload,readonly runtime.1.o runtime.2.o + COMMAND ${HOST}-objcopy --add-section .upd_info=1024_blank_bytes --set-section-flags .upd_info=noload,readonly runtime.1.o runtime.2.o MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.1.o DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/1024_blank_bytes WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.3.o - COMMAND objcopy --add-section .sha256_sig=1024_blank_bytes --set-section-flags .sha256_sig=noload,readonly runtime.2.o runtime.3.o + COMMAND ${HOST}-objcopy --add-section .sha256_sig=1024_blank_bytes --set-section-flags .sha256_sig=noload,readonly runtime.2.o runtime.3.o MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.2.o DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/1024_blank_bytes WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.4.o - COMMAND objcopy --add-section .sig_key=8192_blank_bytes --set-section-flags .sig_key=noload,readonly runtime.3.o runtime.4.o + COMMAND ${HOST}-objcopy --add-section .sig_key=8192_blank_bytes --set-section-flags .sig_key=noload,readonly runtime.3.o runtime.4.o MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.3.o DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/8192_blank_bytes WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} @@ -118,14 +120,14 @@ else() endif() # CMake gets confused by the .o object, therefore we need to tell it that it shall link everything using the C compiler set_property(TARGET runtime PROPERTY LINKER_LANGUAGE C) -target_link_libraries(runtime PRIVATE -Wl,--as-needed -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 -static-libstdc++ -Wl,-O2 -zmuldefs -L/feather/contrib/depends/x86_64-linux-gnu/lib squashfuse squashfuse_ll fuseprivate lzma z dl pthread appimage_shared appimage_hashlib ) +target_link_libraries(runtime PRIVATE -Wl,--as-needed -Wl,--dynamic-linker=${GLIBC_DYNAMIC_LINKER} -static-libstdc++ -Wl,-no-pie -Wl,-O2 -zmuldefs -L/feather/contrib/depends/${HOST}/lib squashfuse squashfuse_ll fuseprivate lzma z dl pthread appimage_shared appimage_hashlib ) target_include_directories(runtime PRIVATE ${PROJECT_SOURCE_DIR}/include) add_custom_command( TARGET runtime POST_BUILD - COMMAND strip ${CMAKE_CURRENT_BINARY_DIR}/runtime + COMMAND ${HOST}-strip ${CMAKE_CURRENT_BINARY_DIR}/runtime ) add_custom_command( diff --git a/contrib/depends/patches/libfuse/arm64.patch b/contrib/depends/patches/libfuse/arm64.patch new file mode 100644 index 0000000..027f54a --- /dev/null +++ b/contrib/depends/patches/libfuse/arm64.patch @@ -0,0 +1,35 @@ +From 914871b20a901e3e1e981c92bc42b1c93b7ab81b Mon Sep 17 00:00:00 2001 +From: Riku Voipio +Date: Thu, 07 Feb 2013 11:04:21 +0000 +Subject: fuse_kernel.h: clean includes + +Use for linux and define types used for other operating systems +using types. +--- +(limited to 'include/fuse_kernel.h') + +diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h +index 501450c..df8e9b9 100644 +--- a/include/fuse_kernel.h ++++ b/include/fuse_kernel.h +@@ -91,12 +91,16 @@ + #ifndef _LINUX_FUSE_H + #define _LINUX_FUSE_H + +-#include ++#ifdef __linux__ ++#include ++#else ++#include + #define __u64 uint64_t + #define __s64 int64_t + #define __u32 uint32_t + #define __s32 int32_t + #define __u16 uint16_t ++#endif + + /* + * Version negotiation: +-- +cgit v0.9.0.3-67-gacbf + diff --git a/contrib/depends/patches/libxcb/remove_pthread_stubs.patch b/contrib/depends/patches/libxcb/remove_pthread_stubs.patch new file mode 100644 index 0000000..d6eb83b --- /dev/null +++ b/contrib/depends/patches/libxcb/remove_pthread_stubs.patch @@ -0,0 +1,12 @@ +Remove uneeded pthread-stubs dependency +--- a/configure ++++ b/configure +@@ -19695,7 +19695,7 @@ fi + NEEDED="xau >= 0.99.2" + case $host_os in + linux*) ;; +- *) NEEDED="$NEEDED pthread-stubs" ;; ++ *) NEEDED="$NEEDED" ;; + esac + + pkg_failed=no \ No newline at end of file diff --git a/contrib/depends/patches/qt/aarch64Toolchain.cmake b/contrib/depends/patches/qt/aarch64Toolchain.cmake new file mode 100644 index 0000000..1acf4a5 --- /dev/null +++ b/contrib/depends/patches/qt/aarch64Toolchain.cmake @@ -0,0 +1,10 @@ +set(CMAKE_SYSTEM_NAME Linux) + +set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) +set(CMAKE_FIND_ROOT_PATH /feather/contrib/depends/aarch64-linux-gnu/) + +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/contrib/depends/patches/qt/gnueabihfToolchain.cmake b/contrib/depends/patches/qt/gnueabihfToolchain.cmake new file mode 100644 index 0000000..d8ceb75 --- /dev/null +++ b/contrib/depends/patches/qt/gnueabihfToolchain.cmake @@ -0,0 +1,10 @@ +set(CMAKE_SYSTEM_NAME Linux) + +set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) +set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) +set(CMAKE_FIND_ROOT_PATH /feather/contrib/depends/arm-linux-gnueabihf/) + +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build index ebd380f..e242c02 100755 --- a/contrib/guix/guix-build +++ b/contrib/guix/guix-build @@ -70,7 +70,7 @@ mkdir -p "$VERSION_BASE" ################ # Default to building for all supported HOSTs (overridable by environment) -export HOSTS="${HOSTS:-x86_64-linux-gnu x86_64-linux-gnu.tails x86_64-w64-mingw32 x86_64-w64-mingw32.installer x86_64-apple-darwin}" +export HOSTS="${HOSTS:-x86_64-linux-gnu x86_64-linux-gnu.tails aarch64-linux-gnu arm-linux-gnueabihf x86_64-w64-mingw32 x86_64-w64-mingw32.installer x86_64-apple-darwin}" # Usage: distsrc_for_host HOST # diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index b890f62..ad43764 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -168,6 +168,8 @@ case "$HOST" in ;; esac +export GLIBC_DYNAMIC_LINKER=${glibc_dynamic_linker} + # Environment variables for determinism export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name" export TZ="UTC" @@ -286,6 +288,9 @@ mkdir -p "$DISTSRC" ;; esac ;; + *gnueabihf) + CMAKEVARS+=" -DNO_AES=On" # Raspberry Pi + ;; esac # Configure this DISTSRC for $HOST