Skip to content
This repository was archived by the owner on Mar 12, 2022. It is now read-only.

Commit f48e7d7

Browse files
committed
update to modern LuaSkin syntax and semantics
1 parent 25aecf2 commit f48e7d7

5 files changed

+16
-280
lines changed

Diff for: Makefile

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
22
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
33

4+
# Universal build info mostly from
5+
# https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary
6+
# Insight on Universal dSYM from
7+
# https://lists.apple.com/archives/xcode-users/2009/Apr/msg00034.html
8+
49
MODULE := $(lastword $(subst ., ,$(current_dir)))
510
PREFIX ?= ~/.hammerspoon
611
MODPATH = hs/_asm/undocumented
@@ -41,9 +46,13 @@ ALLFILES += $(SOFILES)
4146
# CC=clang
4247
CC=@clang
4348
WARNINGS ?= -Weverything -Wno-objc-missing-property-synthesis -Wno-implicit-atomic-properties -Wno-direct-ivar-access -Wno-cstring-format-directive -Wno-padded -Wno-covered-switch-default -Wno-missing-prototypes -Werror-implicit-function-declaration -Wno-documentation-unknown-command -Wno-poison-system-directories
44-
EXTRA_CFLAGS ?= -F$(HS_APPLICATION)/Hammerspoon.app/Contents/Frameworks -mmacosx-version-min=10.13
49+
EXTRA_CFLAGS ?= -F$(HS_APPLICATION)/Hammerspoon.app/Contents/Frameworks -DSOURCE_PATH="$(mkfile_path)"
50+
MIN_intel_VERSION ?= -mmacosx-version-min=10.13
51+
MIN_arm64_VERSION ?= -mmacosx-version-min=11
4552

4653
CFLAGS += $(DEBUG_CFLAGS) -fmodules -fobjc-arc -DHS_EXTERNAL_MODULE $(WARNINGS) $(EXTRA_CFLAGS)
54+
release: CFLAGS += -DRELEASE_VERSION=$(VERSION)
55+
releaseWithDocs: CFLAGS += -DRELEASE_VERSION=$(VERSION)
4756
LDFLAGS += -dynamiclib -undefined dynamic_lookup $(EXTRA_LDFLAGS)
4857

4958
all: verify $(shell uname -m)
@@ -58,19 +67,19 @@ universal: verify x86_64 arm64 $(SOFILES_univeral)
5867
# (see also SOFILES above)
5968

6069
obj_x86_64/%.so: %.m $(HEADERS)
61-
$(CC) $< $(CFLAGS) $(LDFLAGS) -target x86_64-apple-macos10.13 -o $@
70+
$(CC) $< $(CFLAGS) $(MIN_intel_VERSION) $(LDFLAGS) -target x86_64-apple-macos10.13 -o $@
6271

6372
obj_arm64/%.so: %.m $(HEADERS)
64-
$(CC) $< $(CFLAGS) $(LDFLAGS) -target arm64-apple-macos11 -o $@
73+
$(CC) $< $(CFLAGS) $(MIN_arm64_VERSION) $(LDFLAGS) -target arm64-apple-macos11 -o $@
6574

6675
# for compiling all source files into one library
6776
# (see also SOFILES above)
6877

6978
# obj_x86_64/%.so: $(OBJCFILES) $(HEADERS)
70-
# $(CC) $(OBJCFILES) $(CFLAGS) $(LDFLAGS) -target x86_64-apple-macos10.13 -o $@
79+
# $(CC) $(OBJCFILES) $(CFLAGS) $(MIN_intel_VERSION) $(LDFLAGS) -target x86_64-apple-macos10.13 -o $@
7180
#
7281
# obj_arm64/%.so: $(OBJCFILES) $(HEADERS)
73-
# $(CC) $(OBJCFILES) $(CFLAGS) $(LDFLAGS) -target arm64-apple-macos11 -o $@
82+
# $(CC) $(OBJCFILES) $(CFLAGS) $(MIN_arm64_VERSION) $(LDFLAGS) -target arm64-apple-macos11 -o $@
7483

7584
# creating the universal dSYM bundle is a total hack because I haven't found a better
7685
# way yet... suggestions welcome

Diff for: docs.json

-273
This file was deleted.

Diff for: internal.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
extern CGSConnectionID _CGSDefaultConnection(void);
66
#define CGSDefaultConnection _CGSDefaultConnection()
77

8-
static int refTable ;
8+
static LSRefTable refTable ;
99

1010
#pragma mark - Support Functions
1111

@@ -456,7 +456,7 @@ static int spaceManagedShape(lua_State *L) {
456456

457457
int luaopen_hs__asm_undocumented_spaces_internal(lua_State* L) {
458458
LuaSkin *skin = [LuaSkin sharedWithState:L] ;
459-
refTable = [skin registerLibrary:moduleLib metaFunctions:nil] ;
459+
refTable = [skin registerLibrary:"hs._asm.undocumented.spaces" functions:moduleLib metaFunctions:nil] ;
460460

461461
spacesMasksTable(L) ; lua_setfield(L, -2, "masks") ;
462462
spacesTypesTable(L) ; lua_setfield(L, -2, "types") ;

Diff for: spaces-v0.2.1-universal.tar.gz

-51.1 KB
Binary file not shown.

Diff for: spaces-v0.2.1.1-universal.tar.gz

51.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)