Bladeren bron

fix(installer): set XDG_DATA_DIRS for vala builds and add missing deps

Export XDG_DATA_DIRS in build_invercargill_json and build_usm functions
to ensure GObject Introspection and Vala can find .gir and .vapi files
from bundled and system libraries.

Also add json-glib-devel, libarchive-devel, and libgee-devel to dnf
dependencies, and remove git which is not a build dependency.
clanker 5 dagen geleden
bovenliggende
commit
0f84d2c3cb
5 gewijzigde bestanden met toevoegingen van 66 en 1 verwijderingen
  1. 20 0
      containers/debian/Dockerfile
  2. 14 0
      containers/fedora/Dockerfile
  3. 20 0
      containers/ubuntu/Dockerfile
  4. 11 0
      installer/build_config.sh
  5. 1 1
      installer/pm_dnf.sh

+ 20 - 0
containers/debian/Dockerfile

@@ -0,0 +1,20 @@
+FROM debian:latest
+
+# Install basic dependencies that might be needed
+RUN apt-get update && apt-get -y upgrade && apt-get clean
+
+# Copy the installer
+COPY install-builddir/install-usm.sh /tmp/install-usm.sh
+RUN chmod +x /tmp/install-usm.sh
+
+# Run the installer non-interactively
+RUN /tmp/install-usm.sh -y
+
+# Verify installation
+RUN /usr/bin/usm --help
+
+# Clean up installer
+RUN rm /tmp/install-usm.sh
+
+# Default command
+CMD ["/usr/bin/usm"]

+ 14 - 0
containers/fedora/Dockerfile

@@ -0,0 +1,14 @@
+FROM fedora:latest
+
+# Copy the installer
+COPY install-builddir/install-usm.sh /tmp/install-usm.sh
+RUN chmod +x /tmp/install-usm.sh
+
+# Run the installer non-interactively
+RUN /tmp/install-usm.sh -y
+
+# Clean up installer
+RUN rm /tmp/install-usm.sh
+
+# Default command
+CMD ["/usr/bin/usm"]

+ 20 - 0
containers/ubuntu/Dockerfile

@@ -0,0 +1,20 @@
+FROM ubuntu:latest
+
+# Install basic dependencies that might be needed
+RUN apt-get update && apt-get -y upgrade && apt-get clean
+
+# Copy the installer
+COPY install-builddir/install-usm.sh /tmp/install-usm.sh
+RUN chmod +x /tmp/install-usm.sh
+
+# Run the installer non-interactively
+RUN /tmp/install-usm.sh -y
+
+# Verify installation
+RUN /usr/bin/usm --help
+
+# Clean up installer
+RUN rm /tmp/install-usm.sh
+
+# Default command
+CMD ["/usr/bin/usm"]

+ 11 - 0
installer/build_config.sh

@@ -81,6 +81,13 @@ build_invercargill_json() {
     
     pushd "$src_dir" >/dev/null || return 1
     
+    # Set PKG_CONFIG_PATH to find bundled Invercargill library
+    export PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$prefix/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
+    
+    # Set XDG_DATA_DIRS for GObject Introspection and Vala to find .gir and .vapi files
+    # Include default system paths to ensure system vapi files are found
+    export XDG_DATA_DIRS="$prefix/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}:/usr/local/share:/usr/share"
+    
     # Configure with meson (force libdir=lib for consistency across platforms)
     if ! meson setup src builddir --prefix="$prefix" --libdir=lib -Ddefault_library=static >"$output_redirect" 2>&1; then
         log_error "Failed to configure Invercargill-Json"
@@ -121,6 +128,10 @@ build_usm() {
     # Set PKG_CONFIG_PATH to find bundled Invercargill libraries
     export PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$prefix/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
     
+    # Set XDG_DATA_DIRS for GObject Introspection and Vala to find .gir and .vapi files
+    # Include default system paths to ensure system vapi files are found
+    export XDG_DATA_DIRS="$prefix/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}:/usr/local/share:/usr/share"
+    
     # Configure with meson (USM's meson.build is at root, force libdir=lib for consistency)
     if ! meson setup builddir --prefix="$prefix" --libdir=lib >"$output_redirect" 2>&1; then
         log_error "Failed to configure USM"

+ 1 - 1
installer/pm_dnf.sh

@@ -7,7 +7,7 @@
 #   - pm_<name>_install_missing_deps: Installs the missing packages
 
 # Package names required by USM
-DNF_DEPS="vala meson ninja-build git pkgconf-pkg-config gcc glib2-devel libsodium-devel"
+DNF_DEPS="vala meson ninja-build pkgconf-pkg-config gcc glib2-devel libsodium-devel json-glib-devel libarchive-devel libgee-devel"
 
 # Check if this package manager is available
 pm_dnf_detect() {