mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-24 11:11:02 -07:00 
			
		
		
		
	Build the GUI on OSX.
This commit is contained in:
		
							
								
								
									
										3
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
									
									
									
									
								
							| @@ -10,7 +10,8 @@ OBJ = .obj | ||||
| ifeq ($(shell uname),Darwin) | ||||
| 	LDFLAGS += \ | ||||
| 		-framework IOKit \ | ||||
| 		-framework Foundation | ||||
| 		-framework Foundation \ | ||||
| 		-Wl,-no_warn_duplicate_libraries | ||||
| endif | ||||
|  | ||||
| .PHONY: all | ||||
|   | ||||
							
								
								
									
										6
									
								
								build.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								build.py
									
									
									
									
									
								
							| @@ -2,6 +2,7 @@ from build.ab import export | ||||
| from build.c import clibrary, cxxlibrary | ||||
| from build.protobuf import proto, protocc | ||||
| from build.pkg import package | ||||
| import config | ||||
|  | ||||
| package(name="protobuf_lib", package="protobuf") | ||||
| package(name="z_lib", package="zlib") | ||||
| @@ -223,6 +224,9 @@ export( | ||||
|         "brother120tool": "tools+brother120tool", | ||||
|         "brother240tool": "tools+brother240tool", | ||||
|         "upgrade-flux-file": "tools+upgrade-flux-file", | ||||
|     }, | ||||
|     } | ||||
|     | {"FluxEngine.pkg": "src/gui+fluxengine_pkg"} | ||||
|     if config.osx | ||||
|     else {}, | ||||
|     deps=["tests", "src/formats+docs", "scripts+mkdocindex"], | ||||
| ) | ||||
|   | ||||
| @@ -24,7 +24,7 @@ update-ab: | ||||
|  | ||||
| .PHONY: clean | ||||
| clean:: | ||||
| 	@echo [-/-] CLEAN | ||||
| 	@echo CLEAN | ||||
| 	$(hide) rm -rf $(OBJ) bin | ||||
|  | ||||
| export PYTHONHASHSEED = 1 | ||||
|   | ||||
| @@ -247,6 +247,8 @@ def targetof(s, cwd): | ||||
|         s = cwd + s[1:] | ||||
|     elif s.startswith("./"): | ||||
|         s = normpath(join(cwd, s)) | ||||
|     elif s.endswith("/"): | ||||
|         return fileinvocation(s) | ||||
|     elif s.startswith("$"): | ||||
|         return fileinvocation(s) | ||||
|  | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| from build.ab import normalrule, simplerule | ||||
| from build.utils import objectify | ||||
| from build.c import clibrary | ||||
|  | ||||
| @@ -12,3 +13,22 @@ clibrary( | ||||
|         for n in icons | ||||
|     }, | ||||
| ) | ||||
|  | ||||
| normalrule( | ||||
|     name="fluxengine_iconset", | ||||
|     ins=["./icon.png"], | ||||
|     outs=["fluxengine.iconset"], | ||||
|     commands=[ | ||||
|         "mkdir -p {outs[0]}", | ||||
|         "sips -z 64 64 {ins[0]} --out {outs[0]}/icon_32x32@2x.png > /dev/null", | ||||
|     ], | ||||
|     label="ICONSET", | ||||
| ) | ||||
|  | ||||
| normalrule( | ||||
|     name="fluxengine_icns", | ||||
|     ins=[".+fluxengine_iconset"], | ||||
|     outs=["fluxengine.icns"], | ||||
|     commands=["iconutil -c icns -o {outs[0]} {ins[0]}"], | ||||
|     label="ICONUTIL", | ||||
| ) | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| from build.ab import emit | ||||
| from build.ab import emit, normalrule | ||||
| from build.c import cxxprogram | ||||
| import config | ||||
|  | ||||
| emit( | ||||
|     """ | ||||
| @@ -54,3 +55,42 @@ cxxprogram( | ||||
|         "+protobuf_lib", | ||||
|     ], | ||||
| ) | ||||
|  | ||||
| if config.osx: | ||||
|     normalrule( | ||||
|         name="fluxengine_pkg", | ||||
|         ins=[".+fluxengine_app"], | ||||
|         outs=["FluxEngine.pkg"], | ||||
|         commands=[ | ||||
|             "pkgbuild --quiet --install-location /Applications --component {ins[0]} {outs[0]}" | ||||
|         ], | ||||
|         label="PKGBUILD", | ||||
|     ) | ||||
|  | ||||
|     normalrule( | ||||
|         name="fluxengine_app", | ||||
|         ins=[ | ||||
|             ".+gui", | ||||
|             "extras+fluxengine_icns", | ||||
|             "extras/FluxEngine.app.template/", | ||||
|         ], | ||||
|         outs=["FluxEngine.app"], | ||||
|         commands=[ | ||||
|             "rm -rf {outs[0]}", | ||||
|             "cp -a {ins[2]} {outs[0]}", | ||||
|             "touch {outs[0]}", | ||||
|             "cp {ins[0]} {outs[0]}/Contents/MacOS/fluxengine-gui", | ||||
|             "mkdir -p {outs[0]}/Contents/Resources", | ||||
|             "cp {ins[1]} {outs[0]}/Contents/Resources/FluxEngine.icns", | ||||
|             "dylibbundler -of -x {outs[0]}/Contents/MacOS/fluxengine-gui -b -d {outs[0]}/Contents/libs -cd > /dev/null", | ||||
|             "cp $$(brew --prefix wxwidgets)/README.md $@/Contents/libs/wxWidgets.md", | ||||
|             "cp $$(brew --prefix protobuf)/LICENSE $@/Contents/libs/protobuf.txt", | ||||
|             "cp $$(brew --prefix fmt)/LICENSE.rst $@/Contents/libs/fmt.rst", | ||||
|             "cp $$(brew --prefix libpng)/LICENSE $@/Contents/libs/libpng.txt", | ||||
|             "cp $$(brew --prefix libjpeg)/README $@/Contents/libs/libjpeg.txt", | ||||
|             "cp $$(brew --prefix abseil)/LICENSE $@/Contents/libs/abseil.txt", | ||||
|             "cp $$(brew --prefix libtiff)/LICENSE.md $@/Contents/libs/libtiff.txt", | ||||
|             "cp $$(brew --prefix zstd)/LICENSE $@/Contents/libs/zstd.txt", | ||||
|         ], | ||||
|         label="MKAPP", | ||||
|     ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user