1 # This is free and unencumbered software released into the public
2 # domain. To the extent possible under law, the author of this file
3 # waives all copyright and related or neighboring rights to it.
5 $(call include-once.
,programs.mk
)
8 osx-x64.zip osx-ia32.zip \
9 linux-x64.
tar.gz linux-ia32.
tar.gz \
12 nwjs-pattern
:= $(addprefix nwjs-v
%-,$(nwjs-platforms
))
14 # These are like 30MB, don't download them every time.
15 .PRECIOUS
: $(nwjs-pattern
)
19 wget
-O
'$@'.inprogress
'https://dl.nwjs.io/v$(*F)/$(@F)'
20 mv
'$@'.inprogress
"$@"
22 nwjs-version ?
= 0.12.0
24 nwjs-directx
= $(addprefix $(nwjsdir
),d3dcompiler_43.dll d3dcompiler_46.dll
)
26 nwjs
= $(nwjsdir
)nwjs-v
$(firstword $(value nwjs-version-
$1) $(nwjs-version
))-$1
28 nwjs-archives
= $(foreach p
,$(nwjs-platforms
),$(call nwjs
,$(p
)))
30 define nwjs-package-osx
34 mv
$(@D
)/$(notdir $(2:.zip
=)) $(@
:.zip
=)
35 tools
/generate-osx-app
$(@
:.zip
=) $1
37 mv
$(@
:.zip
=)/credits.html
$(@
:.zip
=)/nwjs\ credits.html
38 cd
$(@D
) && $(ZIP
) -r
$(@F
) $(@F
:.zip
=)
42 %-osx-ia32.zip
: %.nw
$(call nwjs
,osx-ia32.zip
)
43 $(call nwjs-package-osx
,$<,$(word 2,$^
))
45 %-osx-x64.zip
: %.nw
$(call nwjs
,osx-x64.zip
)
46 $(call nwjs-package-osx
,$<,$(word 2,$^
))
48 define nwjs-package-linux
50 $(RM
) -r
$(@
:.
tar.gz
=)
52 $(MKDIR
) $(@
:.
tar.gz
=)
53 mv
$(@D
)/$(notdir $(2:.
tar.gz
=)) $(@
:.
tar.gz
=)/nw
54 cp
-a
$1 $(@
:.
tar.gz
=)/nw
/package.nw
55 cp
-a tools
/nw-linux-wrapper
$(@
:.
tar.gz
=)/`echo $(notdir $1) | sed -E 's/_.+//'`
56 $(RM
) $(@
:.
tar.gz
=)/nw
/nwjc
57 mv
$(@
:.
tar.gz
=)/nw
/credits.html
$(@
:.
tar.gz
=)/nw
/nwjs\ credits.html
58 tar -czf
$@
-C
$(@D
) $(@F
:.
tar.gz
=)
59 $(RM
) -r
$(@
:.
tar.gz
=)
62 %-linux-ia32.
tar.gz
: %.nw
$(call nwjs
,linux-ia32.
tar.gz
)
63 $(call nwjs-package-linux
,$<,$(word 2,$^
))
65 %-linux-x64.
tar.gz
: %.nw
$(call nwjs
,linux-x64.
tar.gz
)
66 $(call nwjs-package-linux
,$<,$(word 2,$^
))
68 nwjs-icon
= $(shell $(UNZIP
) -p
$1 package.json | grep
-Eo
'"[^"]+.ico"' -m
1)
70 define nwjs-package-win
74 mv
$(@D
)/$(notdir $(2:.zip
=)) $(@
:.zip
=)
75 $(RM
) $(@
:.zip
=)/nwjc.exe
76 $(UNZIP
) -p
$< $(call nwjs-icon
,$<) > $(@D
)/icon.ico
77 $(WINE
) tools
/rcedit.exe
$(@
:.zip
=)/nw.exe
--set-icon
$(@D
)/icon.ico
79 mv
$(@
:.zip
=)/credits.html
$(@
:.zip
=)/nwjs\ credits.html
80 cp
-a
$< $(@
:.zip
=)/package.nw
81 cp
-a
$(nwjs-directx
) $(@
:.zip
=)
82 mv
$(@
:.zip
=)/nw.exe
$(@
:.zip
=)/`echo $(notdir $1) | sed -E 's/_.+/.exe/'`
83 cd
$(@D
) && $(ZIP
) -r
$(@F
) $(@F
:.zip
=)
87 %-win-ia32.zip
: %.nw
$(call nwjs
,win-ia32.zip
) $(nwjs-directx
)
88 $(call nwjs-package-win
,$<,$(word 2,$^
))
91 wget
-O
$@
'https://github.com/cefsharp/cef-binary/raw/1e51255cf77d267899bf7834768b8774affaad2d/cef_binary_3.y.z_windows32/Release/'$(notdir $@
)
93 $(nwjsdir
)dxwebsetup.exe
:
94 wget
-O
$@ https
://download.microsoft.com
/download
/1/7/1/1718CCC4-6315-4D8E-9543-8E28A4E18C4C
/dxwebsetup.exe
97 $(RM
) $(nwjs-archives
)
99 $(RM
) $(nwjsdir
)dxwebsetup.exe