Skip to content

Commit 79fd4da

Browse files
committed
[WIP] Updater plugin
1 parent a748374 commit 79fd4da

File tree

6 files changed

+1525
-1
lines changed

6 files changed

+1525
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ all: $(EXE)
178178
check: $(TEST_EXE)
179179
$(TEST_EXE)
180180

181-
for p in $(PLUGINS); \
181+
for p in $(filter-out updater,$(PLUGINS)) updater; \
182182
do \
183183
$(MAKE) -C plugins/$${p} LUA=$(LUA) check || exit $$?; \
184184
done

plugins/updater/Makefile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Application Updater plugin for REHex
2+
# Copyright (C) 2025 Daniel Collins <[email protected]>
3+
#
4+
# This program is free software; you can redistribute it and/or modify it
5+
# under the terms of the GNU General Public License version 2 as published by
6+
# the Free Software Foundation.
7+
#
8+
# This program is distributed in the hope that it will be useful, but WITHOUT
9+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11+
# more details.
12+
#
13+
# You should have received a copy of the GNU General Public License along with
14+
# this program; if not, write to the Free Software Foundation, Inc., 51
15+
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16+
17+
INSTALL_FILES := \
18+
json.lua \
19+
updater.lua
20+
21+
prefix ?= /usr/local
22+
exec_prefix ?= $(prefix)
23+
bindir ?= $(exec_prefix)/bin
24+
datarootdir ?= $(prefix)/share
25+
libdir ?= $(exec_prefix)/lib
26+
27+
LUA ?= lua
28+
29+
PLUGIN_NAME := updater
30+
PLUGINS_INST_DIR ?= $(DESTDIR)$(libdir)/rehex
31+
32+
ifeq ($(BUSTED),)
33+
# LuaRocks under MinGW doesn't install busted under a bin/ directory - it sticks it
34+
# elsewhere and puts a .bat that runs it under the right Lua environment for Reasons.
35+
36+
BUSTED := $(shell busted --version > /dev/null 2>&1 && echo busted --lua=$(LUA))
37+
ifeq ($(BUSTED),)
38+
BUSTED := $(shell busted.bat --version > /dev/null 2>&1 && echo busted.bat --lua=$(LUA))
39+
endif
40+
41+
ifeq ($(BUSTED),)
42+
X := $(error Neither busted or busted.bat found in PATH)
43+
endif
44+
endif
45+
46+
.PHONY: all
47+
all:
48+
49+
.PHONY: check
50+
check:
51+
$(BUSTED) .
52+
53+
.PHONY: install
54+
install:
55+
for f in $(INSTALL_FILES); \
56+
do \
57+
mkdir -p $(PLUGINS_INST_DIR)/$(PLUGIN_NAME)/`dirname $${f}`; \
58+
install -m 0644 $${f} $(PLUGINS_INST_DIR)/$(PLUGIN_NAME)/$${f}; \
59+
done
60+
61+
.PHONY: uninstall
62+
uninstall:
63+
rm -f $(addprefix $(PLUGINS_INST_DIR)/$(PLUGIN_NAME)/,$(INSTALL_FILES))
64+
rm -df $(PLUGINS_INST_DIR)/$(PLUGIN_NAME)/

0 commit comments

Comments
 (0)