Browse Source

Can create installer package including foohid package

Thomas Buck 8 years ago
parent
commit
4865d4b89f

+ 33
- 2
Makefile View File

@@ -7,25 +7,56 @@
7 7
 
8 8
 CFLAGS ?= -Wall -pedantic -std=c11
9 9
 
10
-all: bin/protocol bin/foohid SerialGamepad.app
10
+# Build everything
11
+all: bin/protocol bin/foohid build/Release/SerialGamepad.app build/Installer.pkg
12
+	cp -R build/Release/SerialGamepad.app bin/SerialGamepad.app
13
+	cp -R build/Installer.pkg bin/SerialGamepad.pkg
11 14
 
15
+# Install locally
12 16
 install: all
13 17
 	cp bin/protocol ~/bin/protocol
14 18
 	cp bin/foohid ~/bin/foohid
15 19
 	cp -r build/Release/SerialGamepad.app /Applications/SerialGamepad.app
16 20
 
17
-SerialGamepad.app:
21
+# Build GUI project
22
+build/Release/SerialGamepad.app:
18 23
 	xcodebuild
19 24
 
25
+# Build protocol binary
20 26
 bin/protocol: src/serial.o src/protocol.o
21 27
 	@mkdir -p bin
22 28
 	$(CC) -o bin/protocol src/serial.o src/protocol.o
23 29
 
30
+# Build foohid binary
24 31
 bin/foohid: src/serial.o src/foohid.o
25 32
 	@mkdir -p bin
26 33
 	$(CC) -o bin/foohid -framework IOKit src/serial.o src/foohid.o
27 34
 
35
+# Download foohid binary dependency
36
+build/foohid.pkg:
37
+	@mkdir -p build
38
+	curl -o build/foohid.pkg \
39
+		-L https://github.com/unbit/foohid/releases/download/0.1/foohid.pkg
40
+
41
+# Create installer pkg for our App
42
+build/SerialGamepad.pkg: build/Release/SerialGamepad.app
43
+	pkgbuild \
44
+		--root build/Release/SerialGamepad.app \
45
+		--identifier de.xythobuz.SerialGamepad \
46
+		--install-location "/Applications/SerialGamepad.app" \
47
+		build/SerialGamepad.pkg
48
+
49
+# Create installer bundling our App and fooHID
50
+build/Installer.pkg: build/SerialGamepad.pkg build/foohid.pkg Resources/Distribution.xml Resources/readme.rtf Resources/license.txt
51
+	productbuild \
52
+		--distribution Resources/Distribution.xml \
53
+		--package-path build \
54
+		--resources Resources \
55
+		build/Installer.pkg
56
+
57
+# Delete intermediate files
28 58
 clean:
29 59
 	rm -rf bin
60
+	rm -rf build
30 61
 	rm -rf src/*.o
31 62
 

+ 30
- 0
Resources/Distribution.xml View File

@@ -0,0 +1,30 @@
1
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
2
+<installer-gui-script minSpecVersion="2">
3
+    <title>SerialGamepad Emulator</title>
4
+    <readme file="readme.rtf"/>
5
+    <license file="license.txt"/>
6
+    <pkg-ref id="de.xythobuz.SerialGamepad"/>
7
+    <pkg-ref id="it.unbit.foohid"/>
8
+    <options require-scripts="false" rootVolumeOnly="true" hostArchitectures="i386,x86_64"/>
9
+    <volume-check>
10
+        <allowed-os-versions>
11
+            <os-version min="10.8"/>
12
+        </allowed-os-versions>
13
+    </volume-check>
14
+    <choices-outline>
15
+        <line choice="de.xythobuz.SerialGamepad"/>
16
+        <line choice="it.unbit.foohid"/>
17
+    </choices-outline>
18
+    <choice id="de.xythobuz.SerialGamepad" visible="true"
19
+            title="Install SerialGamepad"
20
+            description="Install SerialGamepad.app to /Applications">
21
+        <pkg-ref id="de.xythobuz.SerialGamepad"/>
22
+    </choice>
23
+    <choice id="it.unbit.foohid" visible="true"
24
+            title="Install virtual HID driver"
25
+            description="Install virtual HID Kernel driver foohid.kext to /Library/Extensions">
26
+        <pkg-ref id="it.unbit.foohid"/>
27
+    </choice>
28
+    <pkg-ref id="de.xythobuz.SerialGamepad" version="0" onConclusion="none">SerialGamepad.pkg</pkg-ref>
29
+    <pkg-ref id="it.unbit.foohid" version="1.0.0" onConclusion="none">foohid.pkg</pkg-ref>
30
+</installer-gui-script>

+ 17
- 0
Resources/license.txt View File

@@ -0,0 +1,17 @@
1
+SerialGamepad
2
+----------------------------------------------------------------------------
3
+"THE BEER-WARE LICENSE" (Revision 42): <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Thomas Buck
4
+----------------------------------------------------------------------------
5
+
6
+foohid
7
+----------------------------------------------------------------------------
8
+The MIT License (MIT)
9
+
10
+Copyright (c) 2015 unbit
11
+
12
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13
+
14
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15
+
16
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
+----------------------------------------------------------------------------

+ 26
- 0
Resources/readme.rtf View File

@@ -0,0 +1,26 @@
1
+{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170
2
+{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;}
3
+{\colortbl;\red255\green255\blue255;\red38\green38\blue38;}
4
+\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
5
+\deftab720
6
+\pard\pardeftab720
7
+
8
+\f0\b\fs48 \cf2 \expnd0\expndtw0\kerning0
9
+Gamepad Driver for Flysky compatible transmitters
10
+\fs72 \
11
+\pard\pardeftab720
12
+
13
+\b0\fs32 \cf2 \expnd0\expndtw0\kerning0
14
+\
15
+
16
+\fs28 This project emulates a virtual Gamepad using input data from a serial port. This can be used to enable Flysky CT6A / CT6B compatible transmitters (Turbobrix, Exceed, Modelcraft) in games or simulators.\
17
+\pard\pardeftab720
18
+
19
+\b\fs32 \cf2 \expnd0\expndtw0\kerning0
20
+\
21
+
22
+\fs28 You need to install the virtual userspace IOKit HID driver 
23
+\i \expnd0\expndtw0\kerning0
24
+foohid
25
+\i0 \expnd0\expndtw0\kerning0
26
+ (included in this package).}

BIN
SerialGamepad.xcodeproj/project.xcworkspace/xcuserdata/thomas.xcuserdatad/UserInterfaceState.xcuserstate View File


+ 1
- 1
SerialGamepad/Info.plist View File

@@ -21,7 +21,7 @@
21 21
 	<key>CFBundleSignature</key>
22 22
 	<string>????</string>
23 23
 	<key>CFBundleVersion</key>
24
-	<string>87</string>
24
+	<string>88</string>
25 25
 	<key>LSApplicationCategoryType</key>
26 26
 	<string>public.app-category.utilities</string>
27 27
 	<key>LSMinimumSystemVersion</key>

Loading…
Cancel
Save