From 86f28dc401fdfc82e0098f88a61bf3dbecf79468 Mon Sep 17 00:00:00 2001 From: rewine Date: Tue, 26 Sep 2023 14:30:45 +0800 Subject: [PATCH] dde-api: 5.5.32 -> 6.0.7 --- .../dde-api/0001-dont-set-PATH.patch | 54 ----- .../deepin/go-package/dde-api/default.nix | 54 ++--- .../deepin/go-package/dde-api/deps.nix | 210 ------------------ 3 files changed, 24 insertions(+), 294 deletions(-) delete mode 100644 pkgs/desktops/deepin/go-package/dde-api/0001-dont-set-PATH.patch delete mode 100644 pkgs/desktops/deepin/go-package/dde-api/deps.nix diff --git a/pkgs/desktops/deepin/go-package/dde-api/0001-dont-set-PATH.patch b/pkgs/desktops/deepin/go-package/dde-api/0001-dont-set-PATH.patch deleted file mode 100644 index 679c343604d7..000000000000 --- a/pkgs/desktops/deepin/go-package/dde-api/0001-dont-set-PATH.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 47952eb3dfeea945a070496ef6f77e8446d42f86 Mon Sep 17 00:00:00 2001 -From: rewine -Date: Tue, 21 Mar 2023 10:36:20 +0800 -Subject: [PATCH] chore: dont set PATH env -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Log: dbus 环境缺失环境变量应该由 dbus-update-activation-environment 处理 ,不应该由 dde-api 设置 PATH ---- - device/main.go | 2 -- - locale-helper/main.go | 2 -- - 2 files changed, 4 deletions(-) - -diff --git a/device/main.go b/device/main.go -index 6c5404c..261f109 100644 ---- a/device/main.go -+++ b/device/main.go -@@ -5,7 +5,6 @@ - package main - - import ( -- "os" - "time" - - "github.com/linuxdeepin/go-lib/dbusutil" -@@ -15,7 +14,6 @@ import ( - var logger = log.NewLogger(dbusServiceName) - - func main() { -- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") - service, err := dbusutil.NewSystemService() - if err != nil { - logger.Fatal("failed to new system service:", err) -diff --git a/locale-helper/main.go b/locale-helper/main.go -index 92e1ddb..5e3a2ff 100644 ---- a/locale-helper/main.go -+++ b/locale-helper/main.go -@@ -5,7 +5,6 @@ - package main - - import ( -- "os" - "os/exec" - "sync" - "time" -@@ -45,7 +44,6 @@ var ( - ) - - func main() { -- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") - logger.BeginTracing() - defer logger.EndTracing() - diff --git a/pkgs/desktops/deepin/go-package/dde-api/default.nix b/pkgs/desktops/deepin/go-package/dde-api/default.nix index 87038ae5e49b..11aa986124b2 100644 --- a/pkgs/desktops/deepin/go-package/dde-api/default.nix +++ b/pkgs/desktops/deepin/go-package/dde-api/default.nix @@ -1,53 +1,53 @@ { stdenv , lib , fetchFromGitHub -, buildGoPackage -, wrapQtAppsHook -, wrapGAppsHook -, gtk3 +, fetchpatch +, buildGoModule , pkg-config , deepin-gettext-tools +, wrapQtAppsHook +, wrapGAppsHook , alsa-lib -, go-dbus-factory -, go-gir-generator -, go-lib +, gtk3 , libcanberra , libgudev , librsvg , poppler , pulseaudio , gdk-pixbuf-xlib -, dbus , coreutils -, deepin-desktop-base +, dbus }: -buildGoPackage rec { +buildGoModule rec { pname = "dde-api"; - version = "5.5.32"; - - goPackagePath = "github.com/linuxdeepin/dde-api"; + version = "6.0.7"; src = fetchFromGitHub { owner = "linuxdeepin"; repo = pname; rev = version; - sha256 = "sha256-F+vEOSpysqVtjs8de5mCmeANuCbYUQ860ZHl5rwNYac="; + hash = "sha256-kdf1CoZUyda6bOTW0WJTgaXYhocrjRU9ptj7i+k8aaQ="; }; - patches = [ ./0001-dont-set-PATH.patch ]; + patches = [ + (fetchpatch { + name = "modify_PKGBUILD_to_support_OBS.patch"; + url = "https://github.com/linuxdeepin/dde-api/commit/1399522d032c6c649db79a33348cdb1a233bc23a.patch"; + hash = "sha256-kSHnYaOxIvv7lAJnvxpSwyRDPyDxpAq9x+gJcBdU3T8="; + }) + ]; + + vendorHash = "sha256-4Yscw3QjWG1rlju6sMRHGn3dSe65b1nx10B3KeyAzBM="; postPatch = '' - substituteInPlace lang_info/lang_info.go \ - --replace "/usr/share/i18n/language_info.json" "${deepin-desktop-base}/share/i18n/language_info.json" - substituteInPlace misc/systemd/system/deepin-shutdown-sound.service \ --replace "/usr/bin/true" "${coreutils}/bin/true" substituteInPlace sound-theme-player/main.go \ --replace "/usr/sbin/alsactl" "alsactl" - substituteInPlace misc/scripts/deepin-boot-sound.sh \ + substituteInPlace misc/{scripts/deepin-boot-sound.sh,systemd/system/deepin-login-sound.service} \ --replace "/usr/bin/dbus-send" "${dbus}/bin/dbus-send" substituteInPlace lunar-calendar/huangli.go adjust-grub-theme/main.go \ @@ -62,8 +62,6 @@ buildGoPackage rec { done ''; - goDeps = ./deps.nix; - nativeBuildInputs = [ pkg-config deepin-gettext-tools @@ -73,11 +71,8 @@ buildGoPackage rec { dontWrapGApps = true; buildInputs = [ - go-dbus-factory - go-gir-generator - go-lib - gtk3 alsa-lib + gtk3 libcanberra libgudev librsvg @@ -88,16 +83,15 @@ buildGoPackage rec { buildPhase = '' runHook preBuild - addToSearchPath GOPATH "${go-dbus-factory}/share/gocode" - addToSearchPath GOPATH "${go-gir-generator}/share/gocode" - addToSearchPath GOPATH "${go-lib}/share/gocode" - make -C go/src/${goPackagePath} + make GOBUILD_OPTIONS="$GOFLAGS" runHook postBuild ''; + doCheck = false; + installPhase = '' runHook preInstall - make install DESTDIR="$out" PREFIX="/" -C go/src/${goPackagePath} + make install DESTDIR="$out" PREFIX="/" runHook postInstall ''; diff --git a/pkgs/desktops/deepin/go-package/dde-api/deps.nix b/pkgs/desktops/deepin/go-package/dde-api/deps.nix deleted file mode 100644 index 52ee3d963cf9..000000000000 --- a/pkgs/desktops/deepin/go-package/dde-api/deps.nix +++ /dev/null @@ -1,210 +0,0 @@ -[ - { - goPackagePath = "gopkg.in/alecthomas/kingpin.v2"; - fetch = { - type = "git"; - url = "https://gopkg.in/alecthomas/kingpin.v2"; - rev = "v2.2.6"; - sha256 = "sha256-uViE2kPj7tMrGYVjjdLOl2jFDmmu+3P7GvnZBse2zVY="; - }; - } - { - goPackagePath = "github.com/disintegration/imaging"; - fetch = { - type = "git"; - url = "https://github.com/disintegration/imaging"; - rev = "v1.6.2"; - sha256 = "sha256-pSeMTPvSkxlthh65LjNYYhPLvCZDkBgVgAGYWW0Aguo="; - }; - } - { - goPackagePath = "github.com/linuxdeepin/go-x11-client"; - fetch = { - type = "git"; - url = "https://github.com/linuxdeepin/go-x11-client"; - rev = "0.6.9"; - sha256 = "sha256-xXNaXpFFHJN1fCFLoVrQFCXQ4ya+Kga55QWcJL/InkA="; - }; - } - { - goPackagePath = "github.com/mattn/go-sqlites"; - fetch = { - type = "git"; - url = "https://github.com/mattn/go-sqlite3"; - rev = "v1.14.12"; - sha256 = "sha256-SLW1FyyfJGPUid1epgmJHZGJebI77Wg5WMAPiz1GcYs="; - }; - } - { - goPackagePath = "github.com/godbus/dbus"; - fetch = { - type = "git"; - url = "https://github.com/godbus/dbus"; - rev = "v5.1.0"; - sha256 = "sha256-JSPtmkGEStBEVrKGszeLCb7P38SzQKgMiDC3eDppXs0="; - }; - } - { - goPackagePath = "github.com/fsnotify/fsnotify"; - fetch = { - type = "git"; - url = "https://github.com/fsnotify/fsnotify"; - rev = "v1.5.1"; - sha256 = "sha256-B8kZ8yiWgallT7R2j1kSRJcJkSGFVf9ise+TpXa+7XY="; - }; - } - { - goPackagePath = "golang.org/x/sys"; - fetch = { - type = "git"; - url = "https://github.com/golang/sys"; - rev = "289d7a0edf712062d9f1484b07bdf2383f48802f"; - sha256 = "sha256-AzS/J3OocI7mA0xsIfQzyskNKVija7F2yvuts+EFJBs="; - }; - } - { - goPackagePath = "github.com/stretchr/testify"; - fetch = { - type = "git"; - url = "https://github.com/stretchr/testify"; - rev = "v1.7.1"; - sha256 = "sha256-disUVIHiIDSj/go3APtJH8awSl8QwKRRFLKI7LRnl0w="; - }; - } - { - goPackagePath = "github.com/davecgh/go-spew"; - fetch = { - type = "git"; - url = "https://github.com/davecgh/go-spew"; - rev = "v1.1.1"; - sha256 = "sha256-nhzSUrE1fCkN0+RL04N4h8jWmRFPPPWbCuDc7Ss0akI="; - }; - } - { - goPackagePath = "github.com/pmezard/go-difflib"; - fetch = { - type = "git"; - url = "https://github.com/pmezard/go-difflib"; - rev = "5d4384ee4fb2527b0a1256a821ebfc92f91efefc"; - sha256 = "sha256-XA4Oj1gdmdV/F/+8kMI+DBxKPthZ768hbKsO3d9Gx90="; - }; - } - { - goPackagePath = "github.com/stretchr/objx"; - fetch = { - type = "git"; - url = "https://github.com/stretchr/objx"; - rev = "v0.3.0"; - sha256 = "sha256-T753/EiD5Cpk6H2JFhd+s1gFvpNptG2XlEHxZF6dQaw="; - }; - } - { - goPackagePath = "gopkg.in/yaml.v3"; - fetch = { - type = "git"; - url = "https://github.com/go-yaml/yaml"; - rev = "496545a6307b2a7d7a710fd516e5e16e8ab62dbc"; - sha256 = "sha256-j8yDji+vqsitpRZirpb4w/Em8nstgf28wpwkcrOlxBk="; - }; - } - { - goPackagePath = "golang.org/x/image"; - fetch = { - type = "git"; - url = "https://github.com/golang/image"; - rev = "a8550c1d254a56cf1762a2993881d2b23c0c83dd"; - sha256 = "sha256-gtRGCsCe8tKLsZWhKLL8c5whz9rCMoCHfH13rcSW/OM="; - }; - } - { - goPackagePath = "github.com/alecthomas/units"; - fetch = { - type = "git"; - url = "https://github.com/alecthomas/units"; - rev = "b94a6e3cc13755c0a75fffecbb089eb346fc4289"; - sha256 = "sha256-uriYmwxT69xbmWKO/5OAyeMa2lFBOJDrU2KtQh/+ZjY="; - }; - } - { - goPackagePath = "github.com/alecthomas/template"; - fetch = { - type = "git"; - url = "https://github.com/alecthomas/template"; - rev = "fb15b899a75114aa79cc930e33c46b577cc664b1"; - sha256 = "sha256-RsS4qxdRQ3q+GejA8D9Iu31A/mZNms4LbJ7518jWiu4="; - }; - } - { - goPackagePath = "github.com/cryptix/wav"; - fetch = { - type = "git"; - url = "https://github.com/cryptix/wav"; - rev = "8bdace674401f0bd3b63c65479b6a6ff1f9d5e44"; - sha256 = "sha256-psUCHRFGEOpN3obFbCvSfW0AGEFSI29d0q4MFsHG3qI="; - }; - } - { - goPackagePath = "github.com/fogleman/gg"; - fetch = { - type = "git"; - url = "https://github.com/fogleman/gg"; - rev = "v1.3.0"; - sha256 = "sha256-Fs2JI0FmF4N5EzXJzGAPZMxZxo6wKyebkN/iBZ9sdNo="; - }; - } - { - goPackagePath = "github.com/golang/freetype"; - fetch = { - type = "git"; - url = "https://github.com/golang/freetype"; - rev = "e2365dfdc4a05e4b8299a783240d4a7d5a65d4e4"; - sha256 = "sha256-rOOsv1sNLbYEKnwXZtUlB2CXVkFANyzZy2E7w2QbnKQ="; - }; - } - { - goPackagePath = "github.com/gosexy/gettext"; - fetch = { - type = "git"; - url = "https://github.com/gosexy/gettext"; - rev = "74466a0a0c4a62fea38f44aa161d4bbfbe79dd6b"; - sha256 = "sha256-8U2oSi446U13c3uqcbg/14okypxKmckRuvWfZlGHVys="; - }; - } - { - goPackagePath = "github.com/nfnt/resize"; - fetch = { - type = "git"; - url = "https://github.com/nfnt/resize"; - rev = "83c6a9932646f83e3267f353373d47347b6036b2"; - sha256 = "sha256-yvPV+HlDOyJsiwAcVHQkmtw8DHSXyw+cXHkigXm8rAA="; - }; - } - { - goPackagePath = "github.com/youpy/go-wav"; - fetch = { - type = "git"; - url = "https://github.com/youpy/go-wav"; - rev = "v0.3.2"; - sha256 = "sha256-jNqXW3F3fcgjT47+d2MVXauWkA7+1KfYVu3ZZpRCTkM="; - }; - } - { - goPackagePath = "github.com/zaf/g711"; - fetch = { - type = "git"; - url = "https://github.com/zaf/g711"; - rev = "v1.2"; - sha256 = "sha256-G+0cgGw/fcOUFVn32AeqUE0YjyOS82Z5MTcn6IANhCY="; - }; - } - { - goPackagePath = "github.com/youpy/go-riff"; - fetch = { - type = "git"; - url = "https://github.com/youpy/go-riff"; - rev = "v0.1.0"; - sha256 = "sha256-d/3rkxDeRTPveZblArKc61gB4LJVV08n7g0THieuhx8="; - }; - } -] -