forked from TVTower/TVTower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.bmk
69 lines (59 loc) · 2.1 KB
/
post.bmk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@define doPostInstall
# MAC: replace icon when doing a GUI build (aka "package")
if bmk.Platform() == "macos" and bmk.AppType() == "gui" then
#replace icon
sys.CopyFile( %buildpath% .. "/Misc/appData/mac_icon.icns", %exepath% .. "/../Resources/" .. %outfile% .. ".icns" )
#touch the icns file so some kind of "mac cache" gets redone
bmk.Sys( "touch " .. %exepath% .. "/../Resources/" .. %outfile% .. ".icns" )
#replace info.plist
#sys.CopyFile( %buildpath% .. "/Misc/appData/info.plist", %exepath% .. "/../info.plist" )
end
# WINDOWS/LINUX/MAC: strip binary when doing a releasebuild
if bmk.IsDebugBuild() == 0 then
if bmk.Platform() == "linux" then
bmk.Sys( "strip --strip-all " .. %exepath% .. "/" .. %outfile% )
elseif bmk.Platform() == "macos" then
bmk.Sys( "strip " .. %exepath% .. "/" .. %outfile% )
elseif bmk.Platform() == "win32" then
local outFile = %outfile% .. ".exe"
# if bmk.CPU() == "x86" then
# outFile = outFile .. "_Win32.exe"
# elseif bmk.CPU() == "x64" then
# outFile = outFile .. "_Win64.exe"
# else
# outFile = outFile .. "_Win.exe"
# end
bmk.Sys( bmk.MinGWBinPath() .. "\\strip.exe --strip-all " .. %exepath% .. "\\" .. outFile )
end
end
@end
@define doCopyBinaries
local inFile = %exepath% .. "/" .. %outfile%
local outFile = %exepath% .. "/TVTower"
if bmk.Platform() == "linux" and bmk.IsDebugBuild() == 0 then
if bmk.CPU() == "x86" then
outFile = outFile .. "_Linux32"
elseif bmk.CPU() == "x64" then
outFile = outFile .. "_Linux64"
else
outFile = outFile .. "_Linux"
end
#copying with "sys" does not copy file attributes (like x-bit)
#sys.CopyFile(inFile, outFile)
bmk.Sys("cp " .. bmk.Quote(inFile) .. " " .. bmk.Quote(outFile))
elseif bmk.Platform() == "win32" and bmk.IsDebugBuild() == 0 then
inFile = inFile .. ".exe"
if bmk.CPU() == "x86" then
outFile = outFile .. "_Win32.exe"
elseif bmk.CPU() == "x64" then
outFile = outFile .. "_Win64.exe"
else
outFile = outFile .. "_Win.exe"
end
sys.CopyFile(inFile, outFile)
end
@end
# run the post install
doPostInstall
# copy files accordingly
doCopyBinaries