lol

Merge pull request #141840 from lovesegfault/revert-141782

Revert "Merge pull request #141782 from fufexan/tlp"

authored by

Bernardo Meurer and committed by
GitHub
6c4e10fd bdefa8be

+24 -22
+2 -2
pkgs/tools/misc/tlp/default.nix
··· 23 23 , networkmanager 24 24 }: stdenv.mkDerivation rec { 25 25 pname = "tlp"; 26 - version = "1.4.0"; 26 + version = "1.3.1"; 27 27 28 28 src = fetchFromGitHub { 29 29 owner = "linrunner"; 30 30 repo = "TLP"; 31 31 rev = version; 32 - sha256 = "sha256-Blwj4cqrrYXohnGyJYe+1NYifxqfS4DoVUHmxFf62i4="; 32 + sha256 = "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"; 33 33 }; 34 34 35 35 # XXX: See patch files for relevant explanations.
+8 -9
pkgs/tools/misc/tlp/patches/fix-makefile-sed.patch
··· 1 + commit c44347b3b813e209fff537b4d46d23430727a5e2 2 + Author: Bernardo Meurer <meurerbernardo@gmail.com> 3 + Date: Tue Feb 25 21:27:39 2020 -0800 1 4 2 5 makefile: correctly sed paths 3 - 6 + 4 7 The default Makefile for tlp makes a mess with catenating `DESTDIR` to 5 8 everything, but then not actualy using the catenated (_ prefixed) 6 9 variables to sed it's `.in` files. 7 - 10 + 8 11 This patch makes sure that it correctly sets the paths, taking `DESTDIR` 9 12 in account where it makes sense (e.g. /bin where we want $out/bin) but 10 13 not where it doesn't (/etc/tlp.conf should be just that). 11 - 14 + 12 15 The reason DESTDIR is used at all, as opposed to the more appropriate 13 16 PREFIX, is covered in the nix formula, and is (also) due to the Makefile 14 17 being a bit "different." 15 18 16 19 diff --git a/Makefile b/Makefile 17 - index e9bbab4..6b66651 100644 20 + index b5af74e..95122df 100644 18 21 --- a/Makefile 19 22 +++ b/Makefile 20 - @@ -51,19 +51,19 @@ _TPACPIBAT = $(DESTDIR)$(TPACPIBAT) 23 + @@ -47,17 +47,17 @@ _TPACPIBAT = $(DESTDIR)$(TPACPIBAT) 21 24 22 25 SED = sed \ 23 26 -e "s|@TLPVER@|$(TLPVER)|g" \ ··· 25 28 - -e "s|@TLP_TLIB@|$(TLP_TLIB)|g" \ 26 29 - -e "s|@TLP_FLIB@|$(TLP_FLIB)|g" \ 27 30 - -e "s|@TLP_ULIB@|$(TLP_ULIB)|g" \ 28 - - -e "s|@TLP_BATD@|$(TLP_BATD)|g" \ 29 31 + -e "s|@TLP_SBIN@|$(_SBIN)|g" \ 30 32 + -e "s|@TLP_TLIB@|$(_TLIB)|g" \ 31 33 + -e "s|@TLP_FLIB@|$(_FLIB)|g" \ 32 34 + -e "s|@TLP_ULIB@|$(_ULIB)|g" \ 33 - + -e "s|@TLP_BATD@|$(_BATD)|g" \ 34 35 -e "s|@TLP_CONFUSR@|$(TLP_CONFUSR)|g" \ 35 36 -e "s|@TLP_CONFDIR@|$(TLP_CONFDIR)|g" \ 36 37 - -e "s|@TLP_CONFDEF@|$(TLP_CONFDEF)|g" \ 37 - - -e "s|@TLP_CONFREN@|$(TLP_CONFREN)|g" \ 38 38 + -e "s|@TLP_CONFDEF@|$(_CONFDEF)|g" \ 39 - + -e "s|@TLP_CONFREN@|$(_CONFREN)|g" \ 40 39 -e "s|@TLP_CONF@|$(TLP_CONF)|g" \ 41 40 -e "s|@TLP_RUN@|$(TLP_RUN)|g" \ 42 41 -e "s|@TLP_VAR@|$(TLP_VAR)|g" \
+14 -11
pkgs/tools/misc/tlp/patches/tlp-sleep-service.patch
··· 1 + commit ca94cd56210067e2a55c1f413bd7713f7d338f9f 2 + Author: Bernardo Meurer <meurerbernardo@gmail.com> 3 + Date: Wed Feb 26 10:46:23 2020 -0800 1 4 2 5 tlp-sleep.service: reintroduce 3 - 6 + 4 7 This patch reintroduces tlp-sleep as a systemd unit as opposed to a 5 8 systemd system-sleep hook script. This is due to the recommendation by 6 9 systemd itself to not use the hook scripts. As per the manual: 7 - 10 + 8 11 > Note that scripts or binaries dropped in /usr/lib/systemd/system-sleep/ 9 12 > are intended for local use only and should be considered hacks. If 10 13 > applications want to react to system suspend/hibernation and resume, 11 14 > they should rather use the Inhibitor interface[1]. 12 15 13 16 diff --git a/Makefile b/Makefile 14 - index e9bbab4..7d71e02 100644 17 + index 95122df..0e9230a 100644 15 18 --- a/Makefile 16 19 +++ b/Makefile 17 - @@ -76,6 +76,7 @@ INFILES = \ 20 + @@ -70,6 +70,7 @@ INFILES = \ 18 21 tlp.rules \ 19 22 tlp-readconfs \ 20 23 tlp-run-on \ ··· 22 25 tlp.service \ 23 26 tlp-stat \ 24 27 tlp.upstart \ 25 - @@ -106,7 +107,6 @@ SHFILES = \ 28 + @@ -99,7 +100,6 @@ SHFILES = \ 26 29 tlp-rdw-udev.in \ 27 30 tlp-rf.in \ 28 31 tlp-run-on.in \ ··· 30 33 tlp-sleep.elogind \ 31 34 tlp-stat.in \ 32 35 tlp-usb-udev.in 33 - @@ -159,7 +159,7 @@ ifneq ($(TLP_NO_INIT),1) 36 + @@ -147,7 +147,7 @@ ifneq ($(TLP_NO_INIT),1) 34 37 endif 35 38 ifneq ($(TLP_WITH_SYSTEMD),0) 36 39 install -D -m 644 tlp.service $(_SYSD)/tlp.service 37 40 - install -D -m 755 tlp-sleep $(_SDSL)/tlp 38 - + install -D -m 644 tlp-sleep.service $(_SDSL)/tlp-sleep.service 41 + + install -D -m 644 tlp-sleep.service $(_SYSD)/tlp-sleep.service 39 42 endif 40 43 ifneq ($(TLP_WITH_ELOGIND),0) 41 44 install -D -m 755 tlp-sleep.elogind $(_ELOD)/49-tlp-sleep 42 - @@ -216,7 +216,7 @@ uninstall-tlp: 45 + @@ -204,7 +204,7 @@ uninstall-tlp: 43 46 rm $(_ULIB)/rules.d/85-tlp.rules 44 47 rm -f $(_SYSV)/tlp 45 48 rm -f $(_SYSD)/tlp.service 46 49 - rm -f $(_SDSL)/tlp-sleep 47 - + rm -f $(_SDSL)/tlp-sleep.service 50 + + rm -f $(_SYSD)/tlp-sleep.service 48 51 rm -f $(_ELOD)/49-tlp-sleep 49 52 rm -f $(_SHCPL)/tlp-stat 50 53 rm -f $(_SHCPL)/bluetooth 51 54 diff --git a/tlp-sleep b/tlp-sleep 52 55 deleted file mode 100644 53 - index e548d55..0000000 56 + index 3de85ce..0000000 54 57 --- a/tlp-sleep 55 58 +++ /dev/null 56 59 @@ -1,11 +0,0 @@ ··· 58 61 - 59 62 -# tlp - systemd suspend/resume hook 60 63 -# 61 - -# Copyright (c) 2021 Thomas Koch <linrunner at gmx.net> and others. 64 + -# Copyright (c) 2020 Thomas Koch <linrunner at gmx.net> and others. 62 65 -# This software is licensed under the GPL v2 or later. 63 66 - 64 67 -case $1 in