1 MAKEFLAGS
:= --no-builtin-rules
4 DEPS
:= $(wildcard deps
/*)
6 ifeq ($(shell uname
),Darwin
)
9 DIFF
:= $(shell gls
-t1
/usr
/local
/Cellar
/diffutils
/*/bin
/diff | head
-1)
28 pkgs_brew_cask_install \
41 @echo
'================================================================================'
42 @echo
'| Default target disabled. Specify a concrete one.'
43 @echo
'================================================================================'
52 mkdir
-p
$(shell .
/list dirs
)
67 sudo xbps-install
$(shell .
/list pkgs-void.list
)
69 # Mark $pkg as manually-installed:
71 # sudo xbps-pkgdb -m manual $pkg
73 # List manually-installed packages:
78 xbps-query
-m | awk
-F
- '{sub("-" $$NF "$$", ""); print}' |
sort -fu | grep
-vf
<(.
/list
-v sep
='\n' -v end
='\n' pkgs-void-src.list
) > pkgs-void.list
79 (echo
'#'; .
/patch-comments pkgs-void.list.comments pkgs-void.list
) | sponge pkgs-void.list
84 pkgs_golang
: list pkgs-golang.list
85 go
install $(shell .
/list pkgs-golang.list
)
90 pkgs_ubuntu
: list pkgs-ubuntu.list
91 sudo apt
install $(shell .
/list pkgs-ubuntu.list
)
93 pkgs_ubuntu_debfiles
: list pkgs-ubuntu-debfiles.list
94 .
/install-debfiles pkgs-ubuntu-debfiles.list
100 pip
install --user
$(shell .
/list pkgs-pip.list
)
103 pip
install --user
--upgrade
$(shell .
/list pkgs-pip.list
)
109 pkgs_cargo
: list pkgs-cargo.list
110 cargo
install $(shell .
/list pkgs-cargo.list
)
117 $(MAKE
) pkgs_brew_install
118 $(MAKE
) pkgs_brew_cask_install
120 # TODO: Test pkgs_brew_tap when list contains multiple items
121 pkgs_brew_tap
: list pkgs-brew-tap.list
122 brew tap
$(shell .
/list pkgs-brew-tap.list
)
124 pkgs_brew_install
: list pkgs-brew-install.list
125 brew
install $(shell .
/list pkgs-brew-install.list
)
127 pkgs_brew_cask_install
: list pkgs-brew-cask-install.list
128 brew cask
install $(shell .
/list pkgs-brew-cask-install.list
)
133 pkgs_deb_install
: list pkgs-deb-install.list
134 sudo apt
install $(shell .
/list pkgs-deb-install.list
)
136 pkgs_deb_purge
: list pkgs-deb-purge.list
137 sudo apt purge
$(shell .
/list pkgs-deb-purge.list
)
142 pkgs_snap_classic
: list pkgs-snap-classic.list
143 @
$(MAKE
) $(foreach p
,$(shell .
/list pkgs-snap-classic.list
),pkg_snap_classic_
$(p
))
145 pkgs_snap_strict
: list pkgs-snap-strict.list
146 @
$(MAKE
) $(foreach p
,$(shell .
/list pkgs-snap-strict.list
),pkg_snap_strict_
$(p
))
148 # 'snap' command comes from 'snapd' deb pkg
150 sudo snap
install --classic
$*
161 $(foreach d
,$(DEPS
),$(eval
$(call GEN_DEP_RULE
,$(d
))))
164 find home
-type f
-print0 \
165 |
$(SED
) -z
's/^home\///g' \
167 | xargs
-0 -I
% sh
-c
'echo %; $(DIFF) --color=auto ~/% home/%'
169 .PHONY
: diff_bins_untracked
171 ls
-1 ~
/bin |
sort | grep
-vf
<(ls
-1 home
/bin |
sort)
174 find home
-type f
-print0 \
175 |
$(SED
) -z
's/^home\///g' \
176 | xargs
-0 -I
% sh
-c
'$(DIFF) -q ~/% home/% > /dev/null || cp ~/% home/%'
179 # TODO Backup files before replacing.
180 # But - recursive copy is not a good strategy for this.
181 # Need to do a file by file pass, like the diff recipe.
183 # Limit depth because directories are copied recursively:
184 find home
-maxdepth
1 -print0 \
185 |
$(GREP
) -zv
'^home$$' \
186 | xargs
-0 -I
% cp
-Rp
% ~