Merge pull request #141782 from fufexan/tlp

authored by

Artturi and committed by
GitHub
b0f2a754 15f14d50

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