11# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
22
3- { stdenvNoCC
3+ { stdenv
44, fetchFromGitHub
55, autoreconfHook
66, makeWrapper
77, gnused
88, getopt
99, termux-am
10+ ,
1011} :
1112
12- stdenvNoCC . mkDerivation rec {
13+ stdenv . mkDerivation ( finalAttrs : {
1314 name = "termux-tools" ;
14- version = "1.42.4" ;
15+ version = "1.47.1" ;
16+
1517 src = fetchFromGitHub {
1618 owner = "termux" ;
1719 repo = "termux-tools" ;
18- rev = "v${ version } " ;
19- sha256 = "sha256-LkkeaEQcY8HgunBYAg3Ymn5xYPvrGqGNCZTd/NyIOKY =" ;
20+ tag = "v${ finalAttrs . version } " ;
21+ hash = "sha256-YfIxDegzIHyy62IlpSgrDz4fQiPoZNgSzXNtAk5lmn8 =" ;
2022 } ;
21- nativeBuildInputs = [ autoreconfHook makeWrapper ] ;
23+
24+ nativeBuildInputs = [
25+ autoreconfHook
26+ makeWrapper
27+ ] ;
28+
2229 propagatedInputs = [ termux-am ] ;
2330
24- # https://github.com/termux/termux-tools/pull/95
25- patches = [ ./termux-tools.patch ] ;
2631 postPatch = ''
2732 substituteInPlace scripts/termux-setup-storage.in \
28- --replace @TERMUX_HOME@ /data/data/com.termux.nix/files/home/ \
29- --replace @TERMUX_APP_PACKAGE@ com.termux.nix
33+ --replace-fail " @TERMUX_HOME@" " /data/data/com.termux.nix/files/home/" \
34+ --replace-fail " @TERMUX_APP_PACKAGE@" " com.termux.nix"
3035 substituteInPlace scripts/termux-open.in \
31- --replace ' getopt ' ' ${ getopt } /bin/getopt '
36+ --replace-fail " getopt " " ${ getopt } /bin/getopt "
3237 substituteInPlace \
3338 scripts/termux-open.in \
3439 scripts/termux-wake-lock.in \
3540 scripts/termux-wake-unlock.in \
36- --replace @[email protected] com.termux.app \ 37- --replace @TERMUX_APP_PACKAGE@ com.termux.nix
41+ --replace-fail " @[email protected] " " com.termux.app" \ 42+ --replace-fail " @TERMUX_APP_PACKAGE@" " com.termux.nix"
3843 substituteInPlace scripts/termux-reload-settings.in \
39- --replace @TERMUX_APP_PACKAGE@ com.termux.nix
44+ --replace-fail " @TERMUX_APP_PACKAGE@" " com.termux.nix"
4045 ${ gnused } /bin/sed -i 's|^am |${ termux-am } /bin/am |' scripts/*
4146
42- rm -r doc # manpage is half misleading, pulling pandoc is not worth it
43- substituteInPlace Makefile.am --replace \
44- 'SUBDIRS = . scripts doc mirrors motds' \
45- 'SUBDIRS = . scripts'
46- substituteInPlace configure.ac --replace \
47- 'AC_CONFIG_FILES([Makefile scripts/Makefile doc/Makefile' \
48- 'AC_CONFIG_FILES([Makefile scripts/Makefile])'
49- substituteInPlace configure.ac --replace \
50- 'mirrors/Makefile motds/Makefile])' ""
47+ rm --recursive doc # manpage is half misleading, pulling pandoc is not worth it
48+ substituteInPlace Makefile.am \
49+ --replace-fail "SUBDIRS = . scripts doc mirrors motds src" "SUBDIRS = . scripts"
50+ substituteInPlace configure.ac \
51+ --replace-fail "AC_CONFIG_FILES([Makefile scripts/Makefile doc/Makefile" "AC_CONFIG_FILES([Makefile scripts/Makefile])" \
52+ --replace-fail "mirrors/Makefile motds/Makefile src/Makefile])" ""
5153 '' ;
5254
5355 outputs = [
@@ -67,7 +69,6 @@ stdenvNoCC.mkDerivation rec {
6769 rm -d $out/etc
6870
6971 rm $out/bin/chsh # we offer a declarative way to change your shell
70- rm $out/bin/cmd # doesn't work because we overlay /system/bin
7172 rm $out/bin/dalvikvm # doesn't work because we overlay /system/bin
7273 rm $out/bin/df # works without the magic
7374 rm $out/bin/getprop # doesn't work because we overlay /system/bin
@@ -121,4 +122,4 @@ stdenvNoCC.mkDerivation rec {
121122 echo ./share/examples/termux/termux.properties >> expected # useful
122123 diff -u expected effective
123124 '' ;
124- }
125+ } )
0 commit comments