diff --git a/0001-uos-startdde-fix-kvm-gpu-message-pci-error.patch b/0001-uos-startdde-fix-kvm-gpu-message-pci-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..d49947620a389a43821c8ec83affec0a1187e0cc --- /dev/null +++ b/0001-uos-startdde-fix-kvm-gpu-message-pci-error.patch @@ -0,0 +1,72 @@ +diff -Nuar startdde-5.9.61/display/util.go startdde-5.9.61.new/display/util.go +--- startdde-5.9.61/display/util.go 2022-12-09 11:19:18.000000000 +0800 ++++ startdde-5.9.61.new/display/util.go 2023-04-12 11:21:51.145365556 +0800 +@@ -15,6 +15,7 @@ + "sort" + "strconv" + "strings" ++ "os/exec" + + "github.com/godbus/dbus" + hostname1 "github.com/linuxdeepin/go-dbus-factory/org.freedesktop.hostname1" +@@ -333,6 +334,32 @@ + return chassis, nil + } + ++func CheckKvm() string { ++ var maty string ++ out, err := exec.Command("systemd-detect-virt").Output() ++ if err != nil { ++ maty = "" ++ }else { ++ maty = string(out) ++ maty = strings.Replace(maty, "\n", "", -1) ++ } ++ return maty ++} ++ ++func CheckArch() string { ++ var KArch string ++ out, err := exec.Command("arch").Output() ++ ++ if err != nil { ++ KArch = "" ++ }else { ++ KArch = string(out) ++ KArch = strings.Replace(KArch,"\n","",-1) ++ } ++ return KArch ++} ++ ++ + func getGraphicsCardPciId() string { + var pciId string + subsystems := []string{"drm"} +@@ -362,6 +389,27 @@ + } + } + } ++//qxl not support in arm/loongarch ++//just try drm/card0 ++ if pciId == "" { ++ maty := CheckKvm() ++ KArch := CheckArch() ++ if maty == "kvm" { ++ if KArch == "aarch64" || KArch == "loongarch64" { ++ for _, dev := range devices { ++ name := dev.GetName() ++ if name == "card0" { ++ cardDevice := dev.GetParent() ++ parentDevice := cardDevice.GetParent() ++ pciId = parentDevice.GetProperty("PCI_ID") ++ cardDevice.Unref() ++ parentDevice.Unref() ++ break ++ } ++ } ++ } ++ } ++ } + + return pciId + } diff --git a/0002-uos-startdde-rm-redshift.patch b/0002-uos-startdde-rm-redshift.patch new file mode 100644 index 0000000000000000000000000000000000000000..42eb18b25fbf73795ce008c32fe1311661a51598 --- /dev/null +++ b/0002-uos-startdde-rm-redshift.patch @@ -0,0 +1,282 @@ +diff -Nuar startdde-5.9.61/display/display.go startdde-5.9.61.new/display/display.go +--- startdde-5.9.61/display/display.go 2022-12-09 11:19:18.000000000 +0800 ++++ startdde-5.9.61.new/display/display.go 2023-04-13 09:51:43.128038184 +0800 +@@ -119,7 +119,7 @@ + m.initTouchscreens() + + if !_greeterMode { +- controlRedshift("disable") ++ //controlRedshift("disable") + m.applyColorTempConfig(m.DisplayMode) + } + +diff -Nuar startdde-5.9.61/.history/display/display_20221209111917.go startdde-5.9.61.new/.history/display/display_20221209111917.go +--- startdde-5.9.61/.history/display/display_20221209111917.go 1970-01-01 08:00:00.000000000 +0800 ++++ startdde-5.9.61.new/.history/display/display_20221209111917.go 2023-04-13 09:51:43.124036951 +0800 +@@ -0,0 +1,131 @@ ++// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++ ++package display ++ ++import ( ++ "errors" ++ "reflect" ++ ++ "github.com/godbus/dbus" ++ sysdisplay "github.com/linuxdeepin/go-dbus-factory/com.deepin.system.display" ++ "github.com/linuxdeepin/go-lib/dbusutil" ++ "github.com/linuxdeepin/go-lib/log" ++) ++ ++var logger = log.NewLogger("daemon/display") ++ ++const ( ++ dbusServiceName = "com.deepin.daemon.Display" ++ dbusInterface = "com.deepin.daemon.Display" ++ dbusPath = "/com/deepin/daemon/Display" ++) ++ ++var _dpy *Manager ++ ++var _greeterMode bool ++ ++func SetGreeterMode(val bool) { ++ _greeterMode = val ++} ++ ++type scaleFactorsHelper struct { ++ changedCb func(factors map[string]float64) error ++} ++ ++// ScaleFactorsHelper 全局的 scale factors 相关 helper,要传给 xsettings 模块。 ++var ScaleFactorsHelper scaleFactorsHelper ++ ++// 用于在 display.Start 还没被调用时,先由 xsettings.Start 调用了 ScaleFactorsHelper.SetScaleFactors, 缓存数据。 ++var _scaleFactors map[string]float64 ++ ++func (h *scaleFactorsHelper) SetScaleFactors(factors map[string]float64) error { ++ if _dpy == nil { ++ _scaleFactors = factors ++ return nil ++ } ++ return _dpy.setScaleFactors(factors) ++} ++ ++func (h *scaleFactorsHelper) GetScaleFactors() (map[string]float64, error) { ++ sysBus, err := dbus.SystemBus() ++ if err != nil { ++ return nil, err ++ } ++ sysDisplay := sysdisplay.NewDisplay(sysBus) ++ cfgJson, err := sysDisplay.GetConfig(0) ++ if err != nil { ++ return nil, err ++ } ++ var rootCfg struct { ++ Config struct { ++ ScaleFactors map[string]float64 ++ } ++ } ++ err = jsonUnmarshal(cfgJson, &rootCfg) ++ if err != nil { ++ return nil, err ++ } ++ return rootCfg.Config.ScaleFactors, nil ++} ++ ++func (h *scaleFactorsHelper) SetChangedCb(fn func(factors map[string]float64) error) { ++ h.changedCb = fn ++} ++ ++func (m *Manager) setScaleFactors(factors map[string]float64) error { ++ logger.Debug("setScaleFactors", factors) ++ m.sysConfig.mu.Lock() ++ defer m.sysConfig.mu.Unlock() ++ ++ if reflect.DeepEqual(m.sysConfig.Config.ScaleFactors, factors) { ++ return nil ++ } ++ m.sysConfig.Config.ScaleFactors = factors ++ err := m.saveSysConfigNoLock("scale factors changed") ++ if err != nil { ++ logger.Warning(err) ++ } ++ return err ++} ++ ++func Start(service *dbusutil.Service) error { ++ m := newManager(service) ++ m.init() ++ ++ if !_greeterMode { ++ // 正常 startdde ++ err := service.Export(dbusPath, m) ++ if err != nil { ++ return err ++ } ++ ++ err = service.RequestName(dbusServiceName) ++ if err != nil { ++ return err ++ } ++ } ++ _dpy = m ++ return nil ++} ++ ++func StartPart2() error { ++ if _dpy == nil { ++ return errors.New("_dpy is nil") ++ } ++ m := _dpy ++ m.initSysDisplay() ++ m.initTouchscreens() ++ ++ if !_greeterMode { ++ controlRedshift("disable") ++ m.applyColorTempConfig(m.DisplayMode) ++ } ++ ++ return nil ++} ++ ++func SetLogLevel(level log.Priority) { ++ logger.SetLogLevel(level) ++} +diff -Nuar startdde-5.9.61/.history/display/display_20230413095143.go startdde-5.9.61.new/.history/display/display_20230413095143.go +--- startdde-5.9.61/.history/display/display_20230413095143.go 1970-01-01 08:00:00.000000000 +0800 ++++ startdde-5.9.61.new/.history/display/display_20230413095143.go 2023-04-13 09:51:43.132039419 +0800 +@@ -0,0 +1,131 @@ ++// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++ ++package display ++ ++import ( ++ "errors" ++ "reflect" ++ ++ "github.com/godbus/dbus" ++ sysdisplay "github.com/linuxdeepin/go-dbus-factory/com.deepin.system.display" ++ "github.com/linuxdeepin/go-lib/dbusutil" ++ "github.com/linuxdeepin/go-lib/log" ++) ++ ++var logger = log.NewLogger("daemon/display") ++ ++const ( ++ dbusServiceName = "com.deepin.daemon.Display" ++ dbusInterface = "com.deepin.daemon.Display" ++ dbusPath = "/com/deepin/daemon/Display" ++) ++ ++var _dpy *Manager ++ ++var _greeterMode bool ++ ++func SetGreeterMode(val bool) { ++ _greeterMode = val ++} ++ ++type scaleFactorsHelper struct { ++ changedCb func(factors map[string]float64) error ++} ++ ++// ScaleFactorsHelper 全局的 scale factors 相关 helper,要传给 xsettings 模块。 ++var ScaleFactorsHelper scaleFactorsHelper ++ ++// 用于在 display.Start 还没被调用时,先由 xsettings.Start 调用了 ScaleFactorsHelper.SetScaleFactors, 缓存数据。 ++var _scaleFactors map[string]float64 ++ ++func (h *scaleFactorsHelper) SetScaleFactors(factors map[string]float64) error { ++ if _dpy == nil { ++ _scaleFactors = factors ++ return nil ++ } ++ return _dpy.setScaleFactors(factors) ++} ++ ++func (h *scaleFactorsHelper) GetScaleFactors() (map[string]float64, error) { ++ sysBus, err := dbus.SystemBus() ++ if err != nil { ++ return nil, err ++ } ++ sysDisplay := sysdisplay.NewDisplay(sysBus) ++ cfgJson, err := sysDisplay.GetConfig(0) ++ if err != nil { ++ return nil, err ++ } ++ var rootCfg struct { ++ Config struct { ++ ScaleFactors map[string]float64 ++ } ++ } ++ err = jsonUnmarshal(cfgJson, &rootCfg) ++ if err != nil { ++ return nil, err ++ } ++ return rootCfg.Config.ScaleFactors, nil ++} ++ ++func (h *scaleFactorsHelper) SetChangedCb(fn func(factors map[string]float64) error) { ++ h.changedCb = fn ++} ++ ++func (m *Manager) setScaleFactors(factors map[string]float64) error { ++ logger.Debug("setScaleFactors", factors) ++ m.sysConfig.mu.Lock() ++ defer m.sysConfig.mu.Unlock() ++ ++ if reflect.DeepEqual(m.sysConfig.Config.ScaleFactors, factors) { ++ return nil ++ } ++ m.sysConfig.Config.ScaleFactors = factors ++ err := m.saveSysConfigNoLock("scale factors changed") ++ if err != nil { ++ logger.Warning(err) ++ } ++ return err ++} ++ ++func Start(service *dbusutil.Service) error { ++ m := newManager(service) ++ m.init() ++ ++ if !_greeterMode { ++ // 正常 startdde ++ err := service.Export(dbusPath, m) ++ if err != nil { ++ return err ++ } ++ ++ err = service.RequestName(dbusServiceName) ++ if err != nil { ++ return err ++ } ++ } ++ _dpy = m ++ return nil ++} ++ ++func StartPart2() error { ++ if _dpy == nil { ++ return errors.New("_dpy is nil") ++ } ++ m := _dpy ++ m.initSysDisplay() ++ m.initTouchscreens() ++ ++ if !_greeterMode { ++ //controlRedshift("disable") ++ m.applyColorTempConfig(m.DisplayMode) ++ } ++ ++ return nil ++} ++ ++func SetLogLevel(level log.Priority) { ++ logger.SetLogLevel(level) ++} diff --git a/0003-uos-startdde-rm-message-greeter-BadMatch-error.patch b/0003-uos-startdde-rm-message-greeter-BadMatch-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..05e5ddb5174fe9f1a247e1c9b9d8ccc382a6f5fc --- /dev/null +++ b/0003-uos-startdde-rm-message-greeter-BadMatch-error.patch @@ -0,0 +1,14 @@ +diff -Nuar startdde-5.9.61/display/greeter.go startdde-5.9.61.new/display/greeter.go +--- startdde-5.9.61/display/greeter.go 2022-12-09 11:19:18.000000000 +0800 ++++ startdde-5.9.61.new/display/greeter.go 2023-04-19 17:14:55.561867197 +0800 +@@ -27,7 +27,9 @@ + } + err := m.doShowCursor(true) + if err != nil { +- logger.Warning(err) ++ //display only on greeter stage and in xorg server the err occurs when it show hide cursor ++ //just replace warning with debug to avoid print the err in /var/log/messages ++ logger.Debug(err) + } + m.cursorShowed = true + } diff --git a/startdde-5.8.11.3.tar.xz b/startdde-5.8.11.3.tar.xz deleted file mode 100644 index a1f0eda9a21f0a984da36be588870aa5f46e307e..0000000000000000000000000000000000000000 Binary files a/startdde-5.8.11.3.tar.xz and /dev/null differ diff --git a/startdde-5.9.61.tar.gz b/startdde-5.9.61.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6d0e55d59ba4c546c54c504b5cdd205cb024eb60 Binary files /dev/null and b/startdde-5.9.61.tar.gz differ diff --git a/startdde.spec b/startdde.spec index feada2ccd13ecc41b4ec81164ce938f093fcda4f..66e2f39fd10aca6c4b7538a30f5e4c9f7552941d 100644 --- a/startdde.spec +++ b/startdde.spec @@ -1,20 +1,21 @@ %global _missing_build_ids_terminate_build 0 %global debug_package %{nil} -%define specrelease 5%{?dist} -%if 0%{?openeuler} -%define specrelease 5 -%endif +%define specrelease 1 Name: startdde -Version: 5.8.11.3 +Version: 5.9.61 Release: %{specrelease} Summary: Starter of deepin desktop environment License: GPLv3 URL: https://github.com/linuxdeepin/startdde -Source0: %{name}-%{version}.tar.xz +Source0: %{name}-%{version}.tar.gz Source1: vendor.tar.gz +Patch1: 0001-uos-startdde-fix-kvm-gpu-message-pci-error.patch +Patch2: 0002-uos-startdde-rm-redshift.patch +Patch3: 0003-uos-startdde-rm-message-greeter-BadMatch-error.patch + BuildRequires: golang BuildRequires: jq BuildRequires: glib2-devel @@ -43,16 +44,25 @@ Recommends: dde-qt5integration %{summary}. %prep -%autosetup -n %{name}-%{version} +%setup -n %{name}-%{version} sed -i 's|/usr/lib/deepin-daemon|/usr/libexec/deepin-daemon|g' \ misc/auto_launch/chinese.json misc/auto_launch/default.json -patch Makefile < rpm/Makefile.patch patch main.go < rpm/main.go.patch + +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + tar -xf %{SOURCE1} %build -export GOPATH=%{_builddir}/%{name}-%{version}/vendor:$GOPATH +%ifarch loongarch64 +export GOOS="linux" +export CGO_ENABLE=1 +%endif + +export GOPATH=%{_datadir}/gocode:%{_builddir}/%{name}-%{version}/vendor:$GOPATH ## Scripts in /etc/X11/Xsession.d are not executed after xorg start sed -i 's|X11/Xsession.d|X11/xinit/xinitrc.d|g' Makefile @@ -77,6 +87,7 @@ fi %license LICENSE %{_sysconfdir}/X11/xinit/xinitrc.d/00deepin-dde-env %{_sysconfdir}/X11/xinit/xinitrc.d/01deepin-profile +%{_sysconfdir}/X11/xinit/xinitrc.d/94qt_env %{_sysconfdir}/profile.d/deepin-xdg-dir.sh %{_bindir}/%{name} %{_sbindir}/deepin-fix-xauthority-perm @@ -89,8 +100,13 @@ fi %{_datadir}/glib-2.0/schemas/com.deepin.dde.display.gschema.xml %{_datadir}/glib-2.0/schemas/com.deepin.dde.startdde.gschema.xml /usr/lib/deepin-daemon/greeter-display-daemon +%{_datadir}/locale/ +%{_datadir}/dsg/configs/org.deepin.startdde/ %changelog +* Thu Aug 03 2023 leeffo - 5.9.61-1 +- upgrade to version 5.9.61 + * Wed Jun 28 2023 liweigang - 5.8.11.3-5 - feat: update vendor(update golang.org/x/sys) diff --git a/vendor.tar.gz b/vendor.tar.gz index 8eedde65a7004ecfc5893413a8ecc61347dd4901..6b45a62f0f75465bd8d5e750039c1628dd0f64a8 100644 Binary files a/vendor.tar.gz and b/vendor.tar.gz differ