Merge pull request #225838 from wineee/deepin-clear

deepin: clear up
This commit is contained in:
Nick Cao
2023-04-12 14:11:45 +08:00
committed by GitHub
16 changed files with 94 additions and 80 deletions
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "chore: use GNUInstallDirs in CmakeLists";
name = "chore-use-GNUInstallDirs-in-CmakeLists.patch";
url = "https://github.com/linuxdeepin/deepin-draw/commit/dac714fe603e1b77fc39952bfe6949852ee6c2d5.patch";
sha256 = "sha256-zajxmKkZJT1lcyvPv/PRPMxcstF69PB1tC50gYKDlWA=";
})
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "chore: use GNUInstallDirs in CmakeLists";
name = "chore-use-GNUInstallDirs-in-CmakeLists.patch";
url = "https://github.com/linuxdeepin/deepin-editor/commit/7f4314f386a3c8f5cdea3618591b8eb027d034c3.patch";
sha256 = "sha256-/aSBa2nILc/YrFchUyhBHHs2c7Mv6N1juwD5Sdc39Uo=";
})
@@ -32,12 +32,12 @@ stdenv.mkDerivation rec {
patches = [
./0001-fix-install-path-for-nix.patch
(fetchpatch {
name = "chore: use GNUInstallDirs in CmakeLists";
name = "chore-use-GNUInstallDirs-in-CmakeLists.patch";
url = "https://github.com/linuxdeepin/deepin-image-viewer/commit/4a046e6207fea306e592fddc33c1285cf719a63d.patch";
sha256 = "sha256-aIgYmq6WDfCE+ZcD0GshxM+QmBWZGjh9MzZcTMrhBJ0=";
})
(fetchpatch {
name = "fix build with libraw 0.21";
name = "fix-build-with-libraw-0_21.patch";
url = "https://raw.githubusercontent.com/archlinux/svntogit-community/2ff11979704dd7156a7e7c3bae9b30f08894063d/trunk/libraw-0.21.patch";
sha256 = "sha256-I/w4uiANT8Z8ud/F9WCd3iRHOfplu3fpqnu8ZIs4C+w=";
})
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "chore: use GNUInstallDirs in CmakeLists";
name = "chore-use-GNUInstallDirs-in-CmakeLists.patch";
url = "https://github.com/linuxdeepin/deepin-terminal/commit/b18a2ca8411f09f5573aa2a8403a484b693ec975.patch";
sha256 = "sha256-Qy8Jg+7BfZr8tQEsCAzhMEwf6rU96gkgup5f9bMMELY=";
})
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "chore: use GNUInstallDirs in CmakeLists";
name = "chore-use-GNUInstallDirs-in-CmakeLists.patch";
url = "https://github.com/linuxdeepin/dde-calendar/commit/b9d9555d90a36318eeee62ece49250b4bf8acd10.patch";
sha256 = "sha256-pvgxZPczs/lkwNjysNuVu+1AY69VZlxOn7hR9A02/3M=";
})
@@ -1,7 +1,6 @@
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, dtkwidget
, qt5integration
, qt5platform-plugins
+2 -11
View File
@@ -3,15 +3,6 @@ let
packages = self:
let
inherit (self) callPackage;
replaceAll = x: y: ''
echo Replacing "${x}" to "${y}":
for file in $(grep -rl "${x}"); do
echo -- $file
substituteInPlace $file \
--replace "${x}" "${y}"
done
'';
in {
#### LIBRARIES
dtkcommon = callPackage ./library/dtkcommon { };
@@ -62,10 +53,10 @@ let
deepin-voice-note = callPackage ./apps/deepin-voice-note { };
#### Go Packages
go-lib = callPackage ./go-package/go-lib { inherit replaceAll; };
go-lib = callPackage ./go-package/go-lib { };
go-gir-generator = callPackage ./go-package/go-gir-generator { };
go-dbus-factory = callPackage ./go-package/go-dbus-factory { };
dde-api = callPackage ./go-package/dde-api { inherit replaceAll; };
dde-api = callPackage ./go-package/dde-api { };
dde-daemon = callPackage ./go-package/dde-daemon { };
deepin-pw-check = callPackage ./go-package/deepin-pw-check { };
deepin-desktop-schemas = callPackage ./go-package/deepin-desktop-schemas { };
@@ -0,0 +1,54 @@
From 47952eb3dfeea945a070496ef6f77e8446d42f86 Mon Sep 17 00:00:00 2001
From: rewine <lhongxu@outlook.com>
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()
@@ -1,39 +0,0 @@
From c8f597bd7286a76e7ce371e4f7982d9d2700868a Mon Sep 17 00:00:00 2001
From: rewine <luhongxu@deepin.org>
Date: Wed, 28 Dec 2022 23:06:53 +0800
Subject: [PATCH] fix PATH for NixOS
---
device/main.go | 2 +-
locale-helper/main.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/device/main.go b/device/main.go
index 6c5404c..f79bcfc 100644
--- a/device/main.go
+++ b/device/main.go
@@ -15,7 +15,7 @@ import (
var logger = log.NewLogger(dbusServiceName)
func main() {
- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
+ os.Setenv("PATH", "/run/current-system/sw/bin:/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 0866e48..ef000b5 100644
--- a/locale-helper/main.go
+++ b/locale-helper/main.go
@@ -45,7 +45,7 @@ var (
)
func main() {
- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
+ os.Setenv("PATH", "/run/current-system/sw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
logger.BeginTracing()
defer logger.EndTracing()
--
2.38.1
@@ -2,7 +2,6 @@
, lib
, fetchFromGitHub
, buildGoPackage
, replaceAll
, wrapQtAppsHook
, wrapGAppsHook
, gtk3
@@ -36,18 +35,31 @@ buildGoPackage rec {
sha256 = "sha256-F+vEOSpysqVtjs8de5mCmeANuCbYUQ860ZHl5rwNYac=";
};
patches = [ ./0001-fix-PATH-for-NixOS.patch ];
patches = [ ./0001-dont-set-PATH.patch ];
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 \
--replace "/usr/bin/dbus-send" "${dbus}/bin/dbus-send"
postPatch = replaceAll "/usr/lib/deepin-api" "/run/current-system/sw/lib/deepin-api"
+ replaceAll "/usr/share/i18n/language_info.json" "${deepin-desktop-base}/share/i18n/language_info.json"
+ replaceAll "/usr/bin/dbus-send" "${dbus}/bin/dbus-send"
+ replaceAll "/usr/bin/true" "${coreutils}/bin/true"
+ replaceAll "/usr/sbin/alsactl" "alsactl"
+ ''
substituteInPlace lunar-calendar/huangli.go adjust-grub-theme/main.go \
--replace "/usr/share/dde-api" "$out/share/dde-api"
substituteInPlace themes/{theme.go,settings.go} \
--replace "/usr/share" "/run/current-system/sw/share"
for file in $(grep "/usr/lib/deepin-api" * -nR |awk -F: '{print $1}')
do
sed -i 's|/usr/lib/deepin-api|/run/current-system/sw/lib/deepin-api|g' $file
done
'';
goDeps = ./deps.nix;
@@ -76,9 +88,9 @@ buildGoPackage rec {
buildPhase = ''
runHook preBuild
GOPATH="$GOPATH:${go-dbus-factory}/share/gocode"
GOPATH="$GOPATH:${go-gir-generator}/share/gocode"
GOPATH="$GOPATH:${go-lib}/share/gocode"
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}
runHook postBuild
'';
@@ -32,7 +32,7 @@ buildGoPackage rec {
buildPhase = ''
runHook preBuild
GOPATH="$GOPATH:${go-lib}/share/gocode"
addToSearchPath GOPATH "${go-lib}/share/gocode"
make ARCH=${stdenv.targetPlatform.linuxArch} -C go/src/${goPackagePath}
runHook postBuild
'';
@@ -59,9 +59,9 @@ buildGoPackage rec {
buildPhase = ''
runHook preBuild
GOPATH="$GOPATH:${go-dbus-factory}/share/gocode"
GOPATH="$GOPATH:${go-gir-generator}/share/gocode"
GOPATH="$GOPATH:${go-lib}/share/gocode"
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}
runHook postBuild
'';
@@ -2,7 +2,6 @@
, lib
, fetchFromGitHub
, fetchpatch
, replaceAll
, runtimeShell
}:
@@ -19,14 +18,12 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "fix_IsDir_for_symlink";
name = "fix_IsDir_for_symlink.patch";
url = "https://github.com/linuxdeepin/go-lib/commit/79239904679dc70a11e1ac8e65670afcfdd7c122.patch";
sha256 = "sha256-RsN9hK26i/W6P/+e1l1spCLdlgIEWTehhIW6POBOvW4=";
})
];
postPatch = replaceAll "/bin/sh" "${runtimeShell}";
installPhase = ''
runHook preInstall
mkdir -p $out/share/gocode/src/github.com/linuxdeepin/go-lib
@@ -27,12 +27,12 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "feat_check_PREFIX_value_before_set";
name = "feat_check_PREFIX_value_before_set.patch";
url = "https://github.com/linuxdeepin/image-editor/commit/dae86e848cf53ba0ece879d81e8d5335d61a7473.patch";
sha256 = "sha256-lxmR+nIrMWVyhl1jpA17x2yqJ40h5vnpqKKcjd8j9RY=";
})
(fetchpatch {
name = "feat_use_FULL_install_path";
name = "feat_use_FULL_install_path.patch";
url = "https://github.com/linuxdeepin/image-editor/commit/855ae53a0444ac628aa0fe893932df6263b82e2e.patch";
sha256 = "sha256-3Dynlwl/l/b6k6hOHjTdoDQ/VGBDfyRz9b8QY8FEsCc=";
})
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "fix: use pkgconfig to check mount";
name = "fix-use-pkgconfig-to-check-mount.patch";
url = "https://github.com/linuxdeepin/util-dfm/commit/fb8425a8c13f16e86db38ff84f43347fdc8ea468.diff";
sha256 = "sha256-PGSRfnQ1MGmq0V3NBCoMk4p/T2x19VA04u9C+WcBKow=";
})
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
patches = [
(fetchpatch {
name = "chore: don't use hardcode path";
name = "chore-do-not-use-hardcode-path.patch";
url = "https://github.com/linuxdeepin/dde-device-formatter/commit/b836a498b8e783e0dff3820302957f15ee8416eb.patch";
sha256 = "sha256-i/VqJ6EmCyhE6weHKUB66bW6b51gLyssIAzb5li4aJM=";
})