diff --git a/bootstrap.d/dev-qt.yml b/bootstrap.d/dev-qt.yml index 6fb49375a..a00e3439c 100644 --- a/bootstrap.d/dev-qt.yml +++ b/bootstrap.d/dev-qt.yml @@ -7,7 +7,7 @@ sources: version: '6.3.0' regenerate: # Get the submodules that we'll need as a host tool - - args: ['./init-repository', '-f', '--module-subset', 'qtbase,qtsvg,qtimageformats,qtshadertools,qtlanguageserver,qtdeclarative,qtwayland,qtmultimedia'] + - args: ['./init-repository', '-f', '--module-subset', 'qtbase,qtsvg,qtimageformats,qtshadertools,qtlanguageserver,qtdeclarative,qtwayland,qtmultimedia,qtwebview,qtwebchannel,qtwebsockets,qtwebengine,qtpositioning,qtserialport'] tools: # We do a limited superbuild with only the needed modules of Qt6 to satisfy host tooling. @@ -15,6 +15,7 @@ tools: from_source: qt6 tools_required: - host-cmake + - host-ninja configure: - args: - 'cmake' @@ -26,6 +27,9 @@ tools: - '@THIS_SOURCE_DIR@' compile: - args: ['cmake', '--build', '.', '--parallel', '@PARALLELISM@'] + environ: + # Chromium (aka qtwebengine) will OOM otherwise + NINJAJOBS: '6' install: - args: ['cmake', '--install', '.'] @@ -395,3 +399,82 @@ packages: - args: ['ninja', 'install'] environ: DESTDIR: '@THIS_COLLECT_DIR@' + + - name: qtwebchannel6 + architecture: '@OPTION:arch@' + metadata: + summary: The Qt6 webchannel library + description: This package provides the Qt6 webview library, containing support for integrating C++ and QML applications with HTML/JavaScript clients. + spdx: 'GPL-2.0-only GPL-3.0-only LGPL-3.0-only GFDL-1.3-only' + website: 'https://code.qt.io/cgit/qt/qtwebchannel.git/' + maintainer: "Dennis Bonke " + categories: ['dev-qt'] + source: + subdir: 'ports' + git: 'http://code.qt.io/qt/qtwebchannel.git' + tag: 'v6.3.0' + version: '6.3.0' + tools_required: + - system-gcc + - host-cmake + - host-qt6 + pkgs_required: + - mlibc + - qtbase6 + - qtdeclarative6 + - qtwebsockets6 + - libxkbcommon + - mesa + configure: + - args: + - 'cmake' + - '-GNinja' + - '-DQT_HOST_PATH=@BUILD_ROOT@/tools/host-qt6' + - '-DCMAKE_INSTALL_PREFIX=/usr' + - '-DCMAKE_TOOLCHAIN_FILE=@SOURCE_ROOT@/scripts/CMakeToolchain-@OPTION:arch-triple@.txt' + - '-DCMAKE_BUILD_TYPE=Debug' + - '@THIS_SOURCE_DIR@' + build: + - args: ['ninja'] + - args: ['ninja', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' + + - name: qtwebsockets6 + architecture: '@OPTION:arch@' + metadata: + summary: The Qt6 websockets library + description: This package provides the Qt6 websockets library, containing support for the WebSockets protocol in Qt6. + spdx: 'GPL-2.0-only GPL-3.0-only LGPL-3.0-only GFDL-1.3-only' + website: 'https://code.qt.io/cgit/qt/qtwebsockets.git/' + maintainer: "Dennis Bonke " + categories: ['dev-qt'] + source: + subdir: 'ports' + git: 'http://code.qt.io/qt/qtwebsockets.git' + tag: 'v6.3.0' + version: '6.3.0' + tools_required: + - system-gcc + - host-cmake + - host-qt6 + pkgs_required: + - mlibc + - qtbase6 + - qtdeclarative6 + - libxkbcommon + - mesa + configure: + - args: + - 'cmake' + - '-GNinja' + - '-DQT_HOST_PATH=@BUILD_ROOT@/tools/host-qt6' + - '-DCMAKE_INSTALL_PREFIX=/usr' + - '-DCMAKE_TOOLCHAIN_FILE=@SOURCE_ROOT@/scripts/CMakeToolchain-@OPTION:arch-triple@.txt' + - '-DCMAKE_BUILD_TYPE=Debug' + - '@THIS_SOURCE_DIR@' + build: + - args: ['ninja'] + - args: ['ninja', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' diff --git a/bootstrap.d/dev-util.yml b/bootstrap.d/dev-util.yml index 26ec8c67f..7a87242f6 100644 --- a/bootstrap.d/dev-util.yml +++ b/bootstrap.d/dev-util.yml @@ -5,6 +5,12 @@ sources: tag: 'v3.22.0' version: '3.22.0' + - name: ninja + subdir: ports + git: 'https://github.com/ninja-build/ninja.git' + tag: 'v1.10.2' + version: '1.10.2' + - name: 'pkg-config' subdir: 'ports' git: 'https://gitlab.freedesktop.org/pkg-config/pkg-config.git' @@ -35,6 +41,18 @@ tools: - args: ['make', 'install'] - args: ['ln', '-sf', '@SOURCE_ROOT@/scripts/managarm.cmake', '@PREFIX@/share/cmake-3.22/Modules/Platform/'] + - name: host-ninja + from_source: ninja + configure: + - args: + - 'cmake' + - '-DCMAKE_INSTALL_PREFIX=@PREFIX@' + - '@THIS_SOURCE_DIR@' + compile: + - args: ['make', '-j@PARALLELISM@'] + install: + - args: ['make', 'install'] + # We could run an external pkg-config; however, we need the aclocal files. # The easiest way to ensure that they are available is to just install pkg-config. - name: host-pkg-config @@ -176,11 +194,7 @@ packages: website: 'https://ninja-build.org/' maintainer: "Dennis Bonke " categories: ['dev-util'] - source: - subdir: ports - git: 'https://github.com/ninja-build/ninja.git' - tag: 'v1.10.2' - version: '1.10.2' + from_source: ninja tools_required: - system-gcc - host-cmake diff --git a/bootstrap.d/sys-apps.yml b/bootstrap.d/sys-apps.yml index 64a59bce0..85280e0db 100644 --- a/bootstrap.d/sys-apps.yml +++ b/bootstrap.d/sys-apps.yml @@ -481,6 +481,40 @@ packages: environ: DESTDIR: '@THIS_COLLECT_DIR@' + - name: pciutils + architecture: '@OPTION:arch@' + metadata: + summary: Various utilities dealing with the PCI bus + description: This package contains a set of programs for listing PCI devices, inspecting their status and setting their configuration registers. + spdx: 'GPL-2.0-only' + website: 'https://mj.ucw.cz/sw/pciutils/' + maintainer: "Dennis Bonke " + categories: ['sys-apps'] + source: + subdir: ports + git: 'https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git' + # Commit message says released as 3.8.0, no tag made. + branch: 'master' + commit: 'd224993d423bcd0e88d8eacc0464bc3a66972e95' + version: '3.8.0' + tools_required: + - system-gcc + pkgs_required: + - mlibc + - zlib + configure: + - args: ['cp', '-r', '@THIS_SOURCE_DIR@/.', '@THIS_BUILD_DIR@'] + build: + - args: ['make', 'ZLIB=yes', 'DNS=no', 'LIBKMOD=no', 'HWDB=no', 'PREFIX=/usr', 'SHAREDIR=/usr/share/hwdata', 'SHARED=yes', 'CC=x86_64-managarm-gcc', 'CXX=x86_64-managarm-g++', '-j@PARALLELISM@'] + environ: + CC: 'x86_64-managarm-gcc' + CXX: 'x86_64-managarm-g++' + - args: ['make', 'ZLIB=yes', 'DNS=no', 'LIBKMOD=no', 'HWDB=no', 'PREFIX=/usr', 'SHAREDIR=/usr/share/hwdata', 'SHARED=yes', 'CC=x86_64-managarm-gcc', 'CXX=x86_64-managarm-g++', 'DESTDIR=@THIS_COLLECT_DIR@', 'install', 'install-lib'] + environ: + CC: 'x86_64-managarm-gcc' + CXX: 'x86_64-managarm-g++' + - args: ['chmod', '-v', '755', '@THIS_COLLECT_DIR@/usr/lib/libpci.so'] + - name: sed labels: [aarch64] architecture: '@OPTION:arch@' diff --git a/patches/ninja/0001-Add-support-for-NINJAJOBS.patch b/patches/ninja/0001-Add-support-for-NINJAJOBS.patch new file mode 100644 index 000000000..883f79559 --- /dev/null +++ b/patches/ninja/0001-Add-support-for-NINJAJOBS.patch @@ -0,0 +1,29 @@ +From 7dbf497370dac35a8e2dba6b64eb13989f1ab4fb Mon Sep 17 00:00:00 2001 +From: Dennis Bonke +Date: Fri, 29 Apr 2022 20:12:56 +0200 +Subject: [PATCH] Add support for NINJAJOBS + +Signed-off-by: Dennis Bonke +--- + src/ninja.cc | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/ninja.cc b/src/ninja.cc +index 471a023..5c1cb3f 100644 +--- a/src/ninja.cc ++++ b/src/ninja.cc +@@ -227,6 +227,11 @@ void Usage(const BuildConfig& config) { + + /// Choose a default value for the -j (parallelism) flag. + int GuessParallelism() { ++ int j = 0; ++ char* jobs = getenv( "NINJAJOBS" ); ++ if ( jobs != NULL ) j = atoi( jobs ); ++ if ( j > 0 ) return j; ++ + switch (int processors = GetProcessorCount()) { + case 0: + case 1: +-- +2.36.0 + diff --git a/patches/pciutils/0001-Add-initial-Managarm-support.patch b/patches/pciutils/0001-Add-initial-Managarm-support.patch new file mode 100644 index 000000000..b91adc879 --- /dev/null +++ b/patches/pciutils/0001-Add-initial-Managarm-support.patch @@ -0,0 +1,147 @@ +From f6c4152a19b2430b491ff9b0c0e16a2b368ca60d Mon Sep 17 00:00:00 2001 +From: Dennis Bonke +Date: Wed, 27 Apr 2022 23:11:14 +0200 +Subject: [PATCH] Add initial Managarm support + +Signed-off-by: Dennis Bonke +--- + lib/filter.c | 8 ++++---- + lib/i386-io-linux.h | 25 +++++++++++++++++++++++++ + lib/i386-ports.c | 20 ++++++++++++++++++++ + lib/sysdep.h | 6 +++--- + 4 files changed, 52 insertions(+), 7 deletions(-) + +diff --git a/lib/filter.c b/lib/filter.c +index b881b6b..294c69b 100644 +--- a/lib/filter.c ++++ b/lib/filter.c +@@ -304,20 +304,20 @@ pci_filter_match_v30(struct pci_filter_v30 *f, struct pci_dev *d) + + STATIC_ALIAS(void pci_filter_init(struct pci_access *a, struct pci_filter *f), pci_filter_init_v38(a, f)); + SYMBOL_VERSION(pci_filter_init_v30, pci_filter_init@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_init_v38, pci_filter_init@LIBPCI_3.3); ++//SYMBOL_VERSION(pci_filter_init_v38, pci_filter_init@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_init_v38, pci_filter_init@@LIBPCI_3.8); + + STATIC_ALIAS(char *pci_filter_parse_slot(struct pci_filter *f, char *str), pci_filter_parse_slot_v38(f, str)); + SYMBOL_VERSION(pci_filter_parse_slot_v30, pci_filter_parse_slot@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_parse_slot_v38, pci_filter_parse_slot@LIBPCI_3.3); ++//SYMBOL_VERSION(pci_filter_parse_slot_v38, pci_filter_parse_slot@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_parse_slot_v38, pci_filter_parse_slot@@LIBPCI_3.8); + + STATIC_ALIAS(char *pci_filter_parse_id(struct pci_filter *f, char *str), pci_filter_parse_id_v38(f, str)); + SYMBOL_VERSION(pci_filter_parse_id_v30, pci_filter_parse_id@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_parse_id_v38, pci_filter_parse_id@LIBPCI_3.3); ++//SYMBOL_VERSION(pci_filter_parse_id_v38, pci_filter_parse_id@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_parse_id_v38, pci_filter_parse_id@@LIBPCI_3.8); + + STATIC_ALIAS(int pci_filter_match(struct pci_filter *f, struct pci_dev *d), pci_filter_match_v38(f, d)); + SYMBOL_VERSION(pci_filter_match_v30, pci_filter_match@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_match_v38, pci_filter_match@LIBPCI_3.3); ++//SYMBOL_VERSION(pci_filter_match_v38, pci_filter_match@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_match_v38, pci_filter_match@@LIBPCI_3.8); +diff --git a/lib/i386-io-linux.h b/lib/i386-io-linux.h +index 731e8e3..6c22ed7 100644 +--- a/lib/i386-io-linux.h ++++ b/lib/i386-io-linux.h +@@ -6,6 +6,29 @@ + * Can be freely distributed and used under the terms of the GNU GPL. + */ + ++#ifdef __managarm__ ++ ++static int ++intel_setup_io(struct pci_access *a UNUSED) ++{ ++ return 0; ++} ++ ++static inline void ++intel_cleanup_io(struct pci_access *a UNUSED) ++{ ++} ++ ++static inline void intel_io_lock(void) ++{ ++} ++ ++static inline void intel_io_unlock(void) ++{ ++} ++ ++#else ++ + #include + + static int +@@ -27,3 +50,5 @@ static inline void intel_io_lock(void) + static inline void intel_io_unlock(void) + { + } ++ ++#endif +diff --git a/lib/i386-ports.c b/lib/i386-ports.c +index 2e64fe4..ca20192 100644 +--- a/lib/i386-ports.c ++++ b/lib/i386-ports.c +@@ -32,6 +32,26 @@ + #error Do not know how to access I/O ports on this OS. + #endif + ++#ifdef __managarm__ ++static void outb(unsigned char value, unsigned short int port) {} ++ ++static void outw(unsigned short int value, unsigned short int port) {} ++ ++static void outl(unsigned int value, unsigned short int port) {} ++ ++static unsigned char inb(unsigned short int port) { ++ return 0; ++} ++ ++static unsigned short int inw(unsigned short int port) { ++ return 0; ++} ++ ++static unsigned int inl(unsigned short int port) { ++ return 0; ++} ++#endif ++ + static int conf12_io_enabled = -1; /* -1=haven't tried, 0=failed, 1=succeeded */ + + static int +diff --git a/lib/sysdep.h b/lib/sysdep.h +index bdeb34a..a4f0a76 100644 +--- a/lib/sysdep.h ++++ b/lib/sysdep.h +@@ -29,7 +29,7 @@ typedef u16 word; + #endif + #endif + +-#ifdef PCI_HAVE_LINUX_BYTEORDER_H ++#if defined PCI_HAVE_LINUX_BYTEORDER_H && !defined __managarm__ + + #include + #define cpu_to_le16 __cpu_to_le16 +@@ -39,7 +39,7 @@ typedef u16 word; + + #else + +-#ifdef PCI_OS_LINUX ++#if defined PCI_OS_LINUX && !defined __managarm__ + #include + #define BYTE_ORDER __BYTE_ORDER + #define BIG_ENDIAN __BIG_ENDIAN +@@ -74,7 +74,7 @@ typedef u16 word; + #endif + #endif + +-#ifdef PCI_OS_SYLIXOS ++#if defined PCI_OS_SYLIXOS || defined __managarm__ + #include + #endif + +-- +2.36.0 +