diff options
author | rewine <lhongxu@outlook.com> | 2023-04-12 11:25:22 +0800 |
---|---|---|
committer | rewine <lhongxu@outlook.com> | 2023-04-12 11:27:25 +0800 |
commit | 136e1d9aa368f72bf8390eef3384fbdaf37dea04 (patch) | |
tree | 6b3329d3bcb0948ccb28601d733c509310208b00 /pkgs/desktops/deepin | |
parent | ef5caa6748fad30a87c68dd87c28667c71b317b9 (diff) |
deepin(go-package): don't use replaceAll
Diffstat (limited to 'pkgs/desktops/deepin')
-rw-r--r-- | pkgs/desktops/deepin/default.nix | 13 | ||||
-rw-r--r-- | pkgs/desktops/deepin/go-package/dde-api/default.nix | 26 | ||||
-rw-r--r-- | pkgs/desktops/deepin/go-package/go-lib/default.nix | 3 |
3 files changed, 21 insertions, 21 deletions
diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix index e48d88f962f3d..aa0c50f0a88c6 100644 --- a/pkgs/desktops/deepin/default.nix +++ b/pkgs/desktops/deepin/default.nix @@ -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 { }; diff --git a/pkgs/desktops/deepin/go-package/dde-api/default.nix b/pkgs/desktops/deepin/go-package/dde-api/default.nix index 3f38a599a25d4..9643ee35dc8b5 100644 --- a/pkgs/desktops/deepin/go-package/dde-api/default.nix +++ b/pkgs/desktops/deepin/go-package/dde-api/default.nix @@ -2,7 +2,6 @@ , lib , fetchFromGitHub , buildGoPackage -, replaceAll , wrapQtAppsHook , wrapGAppsHook , gtk3 @@ -38,16 +37,29 @@ buildGoPackage rec { patches = [ ./0001-fix-PATH-for-NixOS.patch ]; - 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" - + '' + 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" + 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; diff --git a/pkgs/desktops/deepin/go-package/go-lib/default.nix b/pkgs/desktops/deepin/go-package/go-lib/default.nix index 706ff58ebfbed..751cba56ce35c 100644 --- a/pkgs/desktops/deepin/go-package/go-lib/default.nix +++ b/pkgs/desktops/deepin/go-package/go-lib/default.nix @@ -2,7 +2,6 @@ , lib , fetchFromGitHub , fetchpatch -, replaceAll , runtimeShell }: @@ -25,8 +24,6 @@ stdenv.mkDerivation rec { }) ]; - postPatch = replaceAll "/bin/sh" "${runtimeShell}"; - installPhase = '' runHook preInstall mkdir -p $out/share/gocode/src/github.com/linuxdeepin/go-lib |