Radix cross Linux

The main Radix cross Linux repository contains the build scripts of packages, which have the most complete and common functionality for desktop machines

452 Commits   2 Branches   1 Tag
Index: 1.76.1/Makefile
===================================================================
--- 1.76.1/Makefile	(revision 124)
+++ 1.76.1/Makefile	(revision 125)
@@ -75,6 +75,8 @@
 build_target       = $(TARGET_BUILD_DIR)/.build_done
 install_target     = $(TARGET_BUILD_DIR)/.install_done
 
+build_dev_dir      = $(TARGET_BUILD_DIR)/build-dev
+
 cross_file         = $(TARGET_BUILD_DIR)/$(TARGET)-cross
 
 
@@ -130,39 +132,47 @@
                              $(TOOLCHAIN_H3_GLIBC)     $(TOOLCHAIN_RK328X_GLIBC) \
                              $(TOOLCHAIN_S8XX_GLIBC)   $(TOOLCHAIN_IMX6_GLIBC)   \
                              $(TOOLCHAIN_AM335X_GLIBC) $(TOOLCHAIN_OMAP543X_GLIBC)),)
-cpu_name = arm
-endian   = little
+cpu_name  = arm
+endian    = little
+qemu_arch = arm
 endif
 ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_H5_GLIBC)     $(TOOLCHAIN_RK33XX_GLIBC) \
                              $(TOOLCHAIN_RK339X_GLIBC) $(TOOLCHAIN_RK358X_GLIBC) \
                              $(TOOLCHAIN_S9XX_GLIBC)   \
                              $(TOOLCHAIN_A311X_GLIBC)  $(TOOLCHAIN_M1000_GLIBC)),)
-cpu_name = aarch64
-endian   = little
+cpu_name  = aarch64
+endian    = little
+qemu_arch = aarch64
 endif
 ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_JZ47XX_GLIBC) $(TOOLCHAIN_P5600_GLIBC)),)
-cpu_name = mips
-endian   = little
+cpu_name  = mips
+endian    = little
+qemu_arch = mipsel
 endif
 ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_POWER8_GLIBC) $(TOOLCHAIN_POWER9_GLIBC)),)
-cpu_name = ppc64
-endian   = big
+cpu_name  = ppc64
+endian    = big
+qemu_arch = ppc64
 endif
 ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_POWER8LE_GLIBC) $(TOOLCHAIN_POWER9LE_GLIBC)),)
-cpu_name = ppc64
-endian   = little
+cpu_name  = ppc64
+endian    = little
+qemu_arch = ppc64le
 endif
 ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_RISCV64_GLIBC)),)
-cpu_name = riscv64
-endian   = little
+cpu_name  = riscv64
+endian    = little
+qemu_arch = riscv64
 endif
 ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_I586_GLIBC) $(TOOLCHAIN_I686_GLIBC)),)
-cpu_name = x86
-endian   = little
+cpu_name  = x86
+endian    = little
+qemu_arch = i386
 endif
 ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_X86_64_GLIBC)),)
-cpu_name = x86_64
-endian   = little
+cpu_name  = x86_64
+endian    = little
+qemu_arch = x86_64
 endif
 
 
@@ -176,15 +186,25 @@
 extra_configure_switches += -Dcairo=disabled
 extra_configure_switches += -Ddoctool=enabled
 extra_configure_switches += -Dpython='python3'
-extra_configure_switches += -Dbuild_introspection_data=false
 
+extra_configure_switches += -Dbuild_introspection_data=true
+
+extra_configure_switches += -Dgi_cross_use_prebuilt_gi=true
+extra_configure_switches += -Dgi_cross_binary_wrapper=$(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-qemuwrapper
+extra_configure_switches += -Dgi_cross_ldd_wrapper=$(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-lddwrapper
+
 extra_configure_switches += -Dgtk_doc=false
 
+g-ir-compiler-wrapper     = $(TARGET_DEST_DIR)/usr/bin/g-ir-compiler-wrapper
+g-ir-scanner-lddwrapper   = $(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-lddwrapper
+g-ir-scanner-wrapper      = $(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-wrapper
+g-ir-scanner-qemuwrapper  = $(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-qemuwrapper
 
+
 PYTHON3_VERSION = 3.10
 
 python_environment  = PYTHON=$(PYTHON3)
-python_environment += PYTHONPATH='$(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/python$(PYTHON3_VERSION)/lib-dynload'
+python_environment += PYTHONPATH='./giscanner:$(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/python$(PYTHON3_VERSION)/lib-dynload'
 
 
 CFLAGS  += -Wno-deprecated-declarations -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
@@ -203,6 +223,49 @@
 $(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
 	$(UNPACK_SRC_ARCHIVE)
 	$(APPLY_PATCHES)
+	@mkdir -p $(TARGET_DEST_DIR)/usr/bin
+	# ======= Create g-ir-compiler-wrapper    =======
+	@echo "#!/bin/sh"                                               >  $(g-ir-compiler-wrapper)
+	@echo ""                                                        >> $(g-ir-compiler-wrapper)
+	@echo "$(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-qemuwrapper \\"  >> $(g-ir-compiler-wrapper)
+	@echo "  $(TARGET_DEST_DIR)/usr/bin/g-ir-compiler \"\$$@\""     >> $(g-ir-compiler-wrapper)
+	@chmod a+x $(g-ir-compiler-wrapper)
+	# ======= Create g-ir-scanner-lddwrapper  =======
+	@echo "#!/bin/sh"                                               >  $(g-ir-scanner-lddwrapper)
+	@echo ""                                                        >> $(g-ir-scanner-lddwrapper)
+	@echo "$(OBJDUMP) -p \"\$$@\""                                  >> $(g-ir-scanner-lddwrapper)
+	@chmod a+x $(g-ir-scanner-lddwrapper)
+	# ======= Create g-ir-scanner-wrapper     =======
+	@echo "#!/bin/sh"                                                                      >  $(g-ir-scanner-wrapper)
+	@echo ""                                                                               >> $(g-ir-scanner-wrapper)
+	@echo "# Prevent g-ir-scanner from writing to HOME directory:"                         >> $(g-ir-scanner-wrapper)
+	@echo "export GI_SCANNER_DISABLE_CACHE=1"                                              >> $(g-ir-scanner-wrapper)
+	@echo ""                                                                               >> $(g-ir-scanner-wrapper)
+	@echo "g-ir-scanner \\"                                                                >> $(g-ir-scanner-wrapper)
+	@echo "  --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH \\"                                     >> $(g-ir-scanner-wrapper)
+	@echo "  --use-binary-wrapper=$(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-qemuwrapper \\"  >> $(g-ir-scanner-wrapper)
+	@echo "  --use-ldd-wrapper=$(TARGET_DEST_DIR)/usr/bin/g-ir-scanner-lddwrapper \\"      >> $(g-ir-scanner-wrapper)
+	@echo "  --add-include-path=$(TARGET_DEST_DIR)/usr/share/gir-1.0 \\"                   >> $(g-ir-scanner-wrapper)
+	@echo "  --add-include-path=$(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/gir-1.0 \\"         >> $(g-ir-scanner-wrapper)
+	@echo "  \"\$$@\""                                                                     >> $(g-ir-scanner-wrapper)
+	@chmod a+x $(g-ir-scanner-wrapper)
+	# ======= Create g-ir-scanner-qemuwrapper =======
+	@echo "#!/bin/sh"                                                                      >  $(g-ir-scanner-qemuwrapper)
+	@echo ""                                                                               >> $(g-ir-scanner-qemuwrapper)
+	@echo "# Use a modules directory which doesn't exist  so we don't load random things"  >> $(g-ir-scanner-qemuwrapper)
+	@echo "# which may then get deleted (or their dependencies) and potentially segfault"  >> $(g-ir-scanner-qemuwrapper)
+	@echo "export GIO_MODULE_DIR=$(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/gio/modules-dummy" >> $(g-ir-scanner-qemuwrapper)
+	@echo ""                                                                               >> $(g-ir-scanner-qemuwrapper)
+	@echo "$(BUILDSYSTEM)/usr/bin/qemu-$(qemu_arch) \\"                                    >> $(g-ir-scanner-qemuwrapper)
+	@echo "  -L $(TARGET_DEST_DIR) \\"                                                     >> $(g-ir-scanner-qemuwrapper)
+	@echo "  -E LD_LIBRARY_PATH=\"$(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX):.libs:\$${GIR_EXTRA_LIBS_PATH}\" \\" >> $(g-ir-scanner-qemuwrapper)
+	@echo "  \"\$$@\""                                                                     >> $(g-ir-scanner-qemuwrapper)
+	@echo "if [ \$$? -ne 0 ]; then"                                                        >> $(g-ir-scanner-qemuwrapper)
+	@echo "  echo \"If the above error message is about missing .so libraries,\""          >> $(g-ir-scanner-qemuwrapper)
+	@echo "  echo \"then setting up GIR_EXTRA_LIBS_PATH  environment variable.\""          >> $(g-ir-scanner-qemuwrapper)
+	@echo "  exit 1"                                                                       >> $(g-ir-scanner-qemuwrapper)
+	@echo "fi"                                                                             >> $(g-ir-scanner-qemuwrapper)
+	@chmod a+x $(g-ir-scanner-qemuwrapper)
 	@touch $@
 
 $(build_target): $(src_done)
@@ -255,7 +318,10 @@
 	    -Dcpp_link_args="`echo -n "--sysroot=$(TARGET_DEST_DIR) $(LDFLAGS)" | tr -s ' '`" \
 	    $(extra_configure_switches) \
 	    --cross-file=$(cross_file) $(SRC_DIR) $(build_dir)
-	@cd $(build_dir) && ninja -v
+	@( cd $(build_dir) ; \
+	   sed -i 's,COMMAND = /usr/bin/g-ir-scanner,COMMAND = $(python_environment) /usr/bin/g-ir-scanner,g' build.ninja ; \
+	 )
+	@( cd $(build_dir) ; env -i ninja -v )
 	@touch $@
 
 $(install_target): $(build_target)
@@ -297,6 +363,12 @@
 	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
 	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" gobject-introspection-1.0.pc             \
 	                                            gobject-introspection-no-export-1.0.pc ; \
+	   sed -i "s,^g_ir_scanner=.*,g_ir_scanner=\$${bindir}/g-ir-scanner-wrapper," \
+	                                            gobject-introspection-1.0.pc             \
+	                                            gobject-introspection-no-export-1.0.pc ; \
+	   sed -i "s,^g_ir_compiler=.*,g_ir_compiler=\$${bindir}/g-ir-compiler-wrapper," \
+	                                            gobject-introspection-1.0.pc             \
+	                                            gobject-introspection-no-export-1.0.pc ; \
 	 )
 	# ======= Strip binaries =======
 	@( cd $(GOBJECT_PKG) ; \
Index: 1.76.1-ppc32/Makefile
===================================================================
--- 1.76.1-ppc32/Makefile	(revision 124)
+++ 1.76.1-ppc32/Makefile	(revision 125)
@@ -124,6 +124,7 @@
 $(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
 	$(UNPACK_SRC_ARCHIVE)
 	$(APPLY_PATCHES)
+	exit 1
 	@touch $@
 
 $(build_target): $(src_done)