Skip to content

Commit

Permalink
Merge branch 'main' into devpod
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles authored May 1, 2024
2 parents 8f84208 + 72cb958 commit 3de3eaf
Show file tree
Hide file tree
Showing 41 changed files with 6,460 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/wolfi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and Upload Wolfi Packages
on:
schedule:
- cron: '50 5,17 * * *' # 5:50 AM and 5:50 PM UTC every day
pull_request:
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
upload-wolfi-packages:
name: Build and upload Wolfi packages
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
uses: actions/checkout@v4

- name: Generate package list
run: |
cd wolfi
# Copy package resources to workdir
RESOURCES=$(ls -d */)
for resource in $RESOURCES; do
cp -r $resource/* .
done
# Create package list
APK_LIST=$(find *.yaml -type 'f' | tr '\n' ',')
echo "APK_LIST=$APK_LIST" >> $GITHUB_ENV
# Build APKs with melange
- name: Build APKs
id: melange
uses: chainguard-dev/actions/melange-build@main
with:
archs: aarch64,x86_64
empty-workspace: false
multi-config: ${{ env.APK_LIST }}
sign-with-temporary-key: true
workdir: ./wolfi

# Upload packages
- name: 'Upload built packages archive to Github Artifacts'
uses: actions/upload-artifact@v4
with:
name: wolfi-packages
path: ./packages
retention-days: 1 # Low ttl since this is just an intermediary used once
if-no-files-found: error
27 changes: 27 additions & 0 deletions akmods/framework-laptop/framework-laptop-kmod-common.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
%global real_name framework-laptop

Name: %{real_name}-kmod-common
Version: {{{ git_dir_version }}}
Release: 1%{?dist}
Summary: Kernel module to expose more Framework Laptop stuff
License: GPLv2
URL: https://github.com/KyleGospo/framework-laptop-kmod
BuildArch: noarch

Source: %{url}/archive/refs/heads/main.tar.gz

Requires: %{real_name}-kmod = %{?epoch:%{epoch}:}%{version}
Provides: %{real_name}-kmod-common = %{?epoch:%{epoch}:}%{version}

%description
A kernel module that exposes the Framework Laptop (13, 16)'s battery charge limit and LEDs to userspace.

%prep
%autosetup -p1 -n %{real_name}-kmod-main

%files
%license LICENSE
%doc README.md

%changelog
{{{ git_dir_changelog }}}
53 changes: 53 additions & 0 deletions akmods/framework-laptop/framework-laptop-kmod.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Build only the akmod package and no kernel module packages:
%define buildforkernels akmod
%global real_name framework-laptop
%global modname framework_laptop

%global debug_package %{nil}

Name: %{real_name}-kmod
Version: {{{ git_dir_version }}}
Release: 1%{?dist}
Summary: Kernel module to expose more Framework Laptop stuff
License: GPLv2
URL: https://github.com/KyleGospo/framework-laptop-kmod

Source: %{url}/archive/refs/heads/main.tar.gz

# Get the needed BuildRequires (in parts depending on what we build for):
BuildRequires: kmodtool

# kmodtool does its magic here
%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }

%description
A kernel module that exposes the Framework Laptop (13, 16)'s battery charge limit and LEDs to userspace.

%prep
# Error out if there was something wrong with kmodtool:
%{?kmodtool_check}
# Print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null

%autosetup -p1 -n %{real_name}-kmod-main

for kernel_version in %{?kernel_versions} ; do
mkdir -p _kmod_build_${kernel_version%%___*}
cp -a %{modname}.c Makefile _kmod_build_${kernel_version%%___*}/
done

%build
for kernel_version in %{?kernel_versions} ; do
make V=1 %{?_smp_mflags} -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} VERSION=v%{version} modules
done

%install
for kernel_version in %{?kernel_versions}; do
mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
install -D -m 755 _kmod_build_${kernel_version%%___*}/%{modname}.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/%{modname}.ko
done
%{?akmod_install}

%changelog
{{{ git_dir_changelog }}}
208 changes: 208 additions & 0 deletions staging/gnome-settings-daemon/353.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
From 325ea8da548bac876d7c707b616e1bb4190305f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 13 Dec 2023 17:31:07 +0100
Subject: [PATCH] xsettings: Get UI scaling factor from dedicated D-Bus API

Instead of getting the UI scaling factor from the display configuration
API, get it from a new X11 properties API exposed by mutter.
---
plugins/xsettings/gsd-xsettings-manager.c | 140 ++++++++--------------
1 file changed, 53 insertions(+), 87 deletions(-)

diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
index f8ec6ebc..8a8f069f 100644
--- a/plugins/xsettings/gsd-xsettings-manager.c
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -609,81 +609,47 @@ get_dpi_from_gsettings (GsdXSettingsManager *manager)
return dpi * factor;
}

-static gboolean
-get_legacy_ui_scale (GVariantIter *properties,
- int *scale)
-{
- const char *key;
- GVariant *value;
-
- *scale = 0;
-
- while (g_variant_iter_loop (properties, "{&sv}", &key, &value)) {
- if (!g_str_equal (key, "legacy-ui-scaling-factor"))
- continue;
-
- *scale = g_variant_get_int32 (value);
- break;
- }
-
- if (*scale < 1) {
- g_warning ("Failed to get current UI legacy scaling factor");
- *scale = 1;
- return FALSE;
- }
-
- return TRUE;
-}
-
-#define MODE_FORMAT "(siiddada{sv})"
-#define MODES_FORMAT "a" MODE_FORMAT
-
-#define MONITOR_SPEC_FORMAT "(ssss)"
-#define MONITOR_FORMAT "(" MONITOR_SPEC_FORMAT MODES_FORMAT "a{sv})"
-#define MONITORS_FORMAT "a" MONITOR_FORMAT
-
-#define LOGICAL_MONITOR_FORMAT "(iiduba" MONITOR_SPEC_FORMAT "a{sv})"
-#define LOGICAL_MONITORS_FORMAT "a" LOGICAL_MONITOR_FORMAT
-
-#define CURRENT_STATE_FORMAT "(u" MONITORS_FORMAT LOGICAL_MONITORS_FORMAT "a{sv})"
-
static int
get_window_scale (GsdXSettingsManager *manager)
{
g_autoptr(GError) error = NULL;
- g_autoptr(GVariant) current_state = NULL;
+ g_autoptr(GVariant) res = NULL;
+ g_autoptr(GVariant) ui_scaling_factor_variant = NULL;
g_autoptr(GVariantIter) properties = NULL;
- int scale = 1;
-
- current_state =
- g_dbus_connection_call_sync (manager->dbus_connection,
- "org.gnome.Mutter.DisplayConfig",
- "/org/gnome/Mutter/DisplayConfig",
- "org.gnome.Mutter.DisplayConfig",
- "GetCurrentState",
- NULL,
- NULL,
- G_DBUS_CALL_FLAGS_NO_AUTO_START,
- -1,
- NULL,
- &error);
- if (!current_state) {
- g_warning ("Failed to get current display configuration state: %s",
- error->message);
+ int ui_scaling_factor = 1;
+
+ res = g_dbus_connection_call_sync (manager->dbus_connection,
+ "org.gnome.Mutter.X11",
+ "/org/gnome/Mutter/X11",
+ "org.freedesktop.DBus.Properties",
+ "Get",
+ g_variant_new ("(ss)",
+ "org.gnome.Mutter.X11",
+ "UiScalingFactor"),
+ NULL,
+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
+ -1,
+ NULL,
+ &error);
+ if (!res) {
+ if (g_error_matches (error,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NAME_HAS_NO_OWNER)) {
+ /* Mutter X11 interface is not yet on the bus, this is expected
+ * while starting up, it'll appear on the bus right away.
+ */
+ } else {
+ g_warning ("Failed to get current UI scaling factor: %s",
+ error->message);
+ }
+
return 1;
}

- g_variant_get (current_state,
- CURRENT_STATE_FORMAT,
- NULL,
- NULL,
- NULL,
- &properties);
-
- if (!get_legacy_ui_scale (properties, &scale))
- g_warning ("Failed to get current UI legacy scaling factor");
+ g_variant_get (res, "(v)", &ui_scaling_factor_variant);
+ g_variant_get (ui_scaling_factor_variant, "i", &ui_scaling_factor);

- return scale;
+ return ui_scaling_factor;
}

typedef struct {
@@ -1120,33 +1086,33 @@ setup_xsettings_managers (GsdXSettingsManager *manager)
}

static void
-monitors_changed (GsdXSettingsManager *manager)
+ui_scaling_factor_changed (GsdXSettingsManager *manager)
{
update_xft_settings (manager);
queue_notify (manager);
}

static void
-on_monitors_changed (GDBusConnection *connection,
- const gchar *sender_name,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *signal_name,
- GVariant *parameters,
- gpointer data)
+on_mutter_x11_properties_changed (GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer data)
{
GsdXSettingsManager *manager = data;
- monitors_changed (manager);
+ ui_scaling_factor_changed (manager);
}

static void
-on_display_config_name_appeared_handler (GDBusConnection *connection,
- const gchar *name,
- const gchar *name_owner,
- gpointer data)
+on_mutter_x11_name_appeared_handler (GDBusConnection *connection,
+ const gchar *name,
+ const gchar *name_owner,
+ gpointer data)
{
GsdXSettingsManager *manager = data;
- monitors_changed (manager);
+ ui_scaling_factor_changed (manager);
}

static void
@@ -1422,20 +1388,20 @@ gsd_xsettings_manager_start (GsdXSettingsManager *manager,

manager->monitors_changed_id =
g_dbus_connection_signal_subscribe (manager->dbus_connection,
- "org.gnome.Mutter.DisplayConfig",
- "org.gnome.Mutter.DisplayConfig",
- "MonitorsChanged",
- "/org/gnome/Mutter/DisplayConfig",
+ "org.gnome.Mutter.X11",
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ "/org/gnome/Mutter/X11",
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
- on_monitors_changed,
+ on_mutter_x11_properties_changed,
manager,
NULL);
manager->display_config_watch_id =
g_bus_watch_name_on_connection (manager->dbus_connection,
- "org.gnome.Mutter.DisplayConfig",
+ "org.gnome.Mutter.X11",
G_BUS_NAME_WATCHER_FLAGS_NONE,
- on_display_config_name_appeared_handler,
+ on_mutter_x11_name_appeared_handler,
NULL,
manager,
NULL);
--
GitLab

Loading

0 comments on commit 3de3eaf

Please sign in to comment.