mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-24 11:11:02 -07:00
Hopefully beat the OSX build into working.
This commit is contained in:
@@ -26,7 +26,7 @@ def main():
|
|||||||
print("link", sf)
|
print("link", sf)
|
||||||
os.makedirs(dirname(sf), exist_ok=True)
|
os.makedirs(dirname(sf), exist_ok=True)
|
||||||
try:
|
try:
|
||||||
os.link(abspath(f), sf)
|
os.symlink(abspath(f), sf)
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
shutil.copy(f, sf)
|
shutil.copy(f, sf)
|
||||||
|
|
||||||
|
|||||||
25
build/_zip.py
Executable file
25
build/_zip.py
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
from os.path import *
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
from zipfile import ZipFile
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("-z", "--zipfile")
|
||||||
|
parser.add_argument("-v", "--verbose", action="store_true")
|
||||||
|
parser.add_argument("-f", "--file", nargs=2, action="append")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
assert args.zipfile, "You must specify a zipfile to create"
|
||||||
|
|
||||||
|
with ZipFile(args.zipfile, mode="w") as zf:
|
||||||
|
for zipname, filename in args.file:
|
||||||
|
if args.verbose:
|
||||||
|
print(filename, "->", zipname)
|
||||||
|
zf.write(filename, arcname=zipname)
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
from build.ab import simplerule, simplerule
|
from build.ab import simplerule, simplerule
|
||||||
from build.utils import objectify
|
from build.utils import objectify
|
||||||
from build.c import clibrary
|
from build.c import clibrary
|
||||||
|
from build.zip import zip
|
||||||
|
from glob import glob
|
||||||
|
from os.path import *
|
||||||
|
|
||||||
icons = ["fluxfile", "hardware", "icon", "imagefile"]
|
icons = ["fluxfile", "hardware", "icon", "imagefile"]
|
||||||
|
|
||||||
@@ -15,24 +18,17 @@ clibrary(
|
|||||||
)
|
)
|
||||||
|
|
||||||
simplerule(
|
simplerule(
|
||||||
name="fluxengine_iconset",
|
name="fluxengine_icns",
|
||||||
ins=["./icon.png"],
|
ins=["./icon.png"],
|
||||||
outs=["=fluxengine.iconset"],
|
outs=["=fluxengine.icns"],
|
||||||
commands=[
|
commands=[
|
||||||
"mkdir -p $[outs[0]]",
|
"mkdir -p fluxengine.iconset",
|
||||||
"sips -z 64 64 $[ins[0]] --out $[outs[0]]/icon_32x32@2x.png > /dev/null",
|
"sips -z 64 64 $[ins[0]] --out fluxengine.iconset/icon_32x32@2x.png > /dev/null",
|
||||||
|
"iconutil -c icns -o $[outs[0]] fluxengine.iconset",
|
||||||
],
|
],
|
||||||
label="ICONSET",
|
label="ICONSET",
|
||||||
)
|
)
|
||||||
|
|
||||||
simplerule(
|
|
||||||
name="fluxengine_icns",
|
|
||||||
ins=[".+fluxengine_iconset"],
|
|
||||||
outs=["=fluxengine.icns"],
|
|
||||||
commands=["iconutil -c icns -o $[outs[0]] $[ins[0]]"],
|
|
||||||
label="ICONUTIL",
|
|
||||||
)
|
|
||||||
|
|
||||||
simplerule(
|
simplerule(
|
||||||
name="fluxengine_ico",
|
name="fluxengine_ico",
|
||||||
ins=["./icon.png"],
|
ins=["./icon.png"],
|
||||||
@@ -40,3 +36,18 @@ simplerule(
|
|||||||
commands=["png2ico $[outs[0]] $[ins[0]]"],
|
commands=["png2ico $[outs[0]] $[ins[0]]"],
|
||||||
label="MAKEICON",
|
label="MAKEICON",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
template_files = [
|
||||||
|
f
|
||||||
|
for f in glob(
|
||||||
|
"**", recursive=True, root_dir="extras/FluxEngine.app.template"
|
||||||
|
)
|
||||||
|
if isfile(join("extras/FluxEngine.app.template", f))
|
||||||
|
]
|
||||||
|
zip(
|
||||||
|
name="fluxengine_template",
|
||||||
|
items={
|
||||||
|
join("FluxEngine.app", k): join("extras/FluxEngine.app.template", k)
|
||||||
|
for k in template_files
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|||||||
@@ -58,38 +58,28 @@ cxxprogram(
|
|||||||
if config.osx:
|
if config.osx:
|
||||||
simplerule(
|
simplerule(
|
||||||
name="fluxengine_pkg",
|
name="fluxengine_pkg",
|
||||||
ins=[".+fluxengine_app"],
|
|
||||||
outs=["=FluxEngine.pkg"],
|
|
||||||
commands=[
|
|
||||||
"pkgbuild --quiet --install-location /Applications --component $[ins[0]] $[outs[0]]"
|
|
||||||
],
|
|
||||||
label="PKGBUILD",
|
|
||||||
)
|
|
||||||
|
|
||||||
simplerule(
|
|
||||||
name="fluxengine_app",
|
|
||||||
ins=[
|
ins=[
|
||||||
".+gui",
|
".+gui",
|
||||||
"extras+fluxengine_icns",
|
"extras+fluxengine_icns",
|
||||||
"extras/FluxEngine.app.template/",
|
"extras+fluxengine_template",
|
||||||
],
|
],
|
||||||
outs=["=FluxEngine.app"],
|
outs=["=FluxEngine.pkg"],
|
||||||
commands=[
|
commands=[
|
||||||
"rm -rf $[outs[0]]",
|
"rm -rf $[outs[0]]",
|
||||||
"cp -a $[ins[2]] $[outs[0]]",
|
"unzip -q $[ins[2]]", # creates FluxEngine.app
|
||||||
"touch $[outs[0]]",
|
"cp $[ins[0]] FluxEngine.app/Contents/MacOS/fluxengine-gui",
|
||||||
"cp $[ins[0]] $[outs[0]]/Contents/MacOS/fluxengine-gui",
|
"mkdir -p FluxEngine.app/Contents/Resources",
|
||||||
"mkdir -p $[outs[0]]/Contents/Resources",
|
"cp $[ins[1]] FluxEngine.app/Contents/Resources/FluxEngine.icns",
|
||||||
"cp $[ins[1]] $[outs[0]]/Contents/Resources/FluxEngine.icns",
|
"dylibbundler -of -x FluxEngine.app/Contents/MacOS/fluxengine-gui -b -d FluxEngine.app/Contents/libs -cd > /dev/null",
|
||||||
"dylibbundler -of -x $[outs[0]]/Contents/MacOS/fluxengine-gui -b -d $[outs[0]]/Contents/libs -cd > /dev/null",
|
"cp $$(brew --prefix wxwidgets)/README.md FluxEngine.app/Contents/libs/wxWidgets.md",
|
||||||
"cp $$(brew --prefix wxwidgets)/README.md $[outs[0]]/Contents/libs/wxWidgets.md",
|
"cp $$(brew --prefix protobuf)/LICENSE FluxEngine.app/Contents/libs/protobuf.txt",
|
||||||
"cp $$(brew --prefix protobuf)/LICENSE $[outs[0]]/Contents/libs/protobuf.txt",
|
"cp $$(brew --prefix fmt)/LICENSE* FluxEngine.app/Contents/libs/fmt.rst",
|
||||||
"cp $$(brew --prefix fmt)/LICENSE* $[outs[0]]/Contents/libs/fmt.rst",
|
"cp $$(brew --prefix libpng)/LICENSE FluxEngine.app/Contents/libs/libpng.txt",
|
||||||
"cp $$(brew --prefix libpng)/LICENSE $[outs[0]]/Contents/libs/libpng.txt",
|
"cp $$(brew --prefix libjpeg)/README FluxEngine.app/Contents/libs/libjpeg.txt",
|
||||||
"cp $$(brew --prefix libjpeg)/README $[outs[0]]/Contents/libs/libjpeg.txt",
|
"cp $$(brew --prefix abseil)/LICENSE FluxEngine.app/Contents/libs/abseil.txt",
|
||||||
"cp $$(brew --prefix abseil)/LICENSE $[outs[0]]/Contents/libs/abseil.txt",
|
"cp $$(brew --prefix libtiff)/LICENSE.md FluxEngine.app/Contents/libs/libtiff.txt",
|
||||||
"cp $$(brew --prefix libtiff)/LICENSE.md $[outs[0]]/Contents/libs/libtiff.txt",
|
"cp $$(brew --prefix zstd)/LICENSE FluxEngine.app/Contents/libs/zstd.txt",
|
||||||
"cp $$(brew --prefix zstd)/LICENSE $[outs[0]]/Contents/libs/zstd.txt",
|
"pkgbuild --quiet --install-location /Applications --component FluxEngine.app $[outs[0]]",
|
||||||
],
|
],
|
||||||
label="MKAPP",
|
label="MKAPP",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user