Makefile
changeset 2 2d6e92fb19e9
parent 1 edaf97f39e5d
child 3 2ee55ffac580
equal deleted inserted replaced
1:edaf97f39e5d 2:2d6e92fb19e9
     1 #! gmake
     1 #! gmake
     2 
     2 
     3 # This is Makefile for Beremiz installer
     3 # This is Makefile for Beremiz installer
       
     4 #
     4 # invoke with "make" on a linux box having those packages installed :
     5 # invoke with "make" on a linux box having those packages installed :
     5 #  - wine
     6 #  - wine
     6 #  - mingw32
     7 #  - mingw32
     7 #  - tar
     8 #  - tar
     8 #  - unrar
     9 #  - unrar
     9 #  - wget
    10 #  - wget
    10 #  - nsis
    11 #  - nsis
       
    12 #
       
    13 # WARNING : DISPLAY variable have to be defined to a valid X server
       
    14 #           in case it would be a problem, run :
       
    15 #           xvfb-run make -f /path/to/this/Makefile
    11 
    16 
    12 version = 1.03
    17 version = 1.03
    13 
    18 
    14 HGROOT := ~/src
    19 HGROOT := ~/src
    15 CPUS = 8
    20 CPUS = 8
    79 	tar -C $(mingwdir) --lzma -xvf $$dld
    84 	tar -C $(mingwdir) --lzma -xvf $$dld
    80 	
    85 	
    81 	touch mingw
    86 	touch mingw
    82 
    87 
    83 # a directory to collect binaries that must be in the path
    88 # a directory to collect binaries that must be in the path
    84 bin_collect_dir = $(mingwdir)/bin
       
    85 $(bin_collect_dir): mingw
       
    86 
    89 
    87 msiexec = WINEPREFIX=$(tmp) msiexec
    90 msiexec = WINEPREFIX=$(tmp) msiexec
    88 wine = WINEPREFIX=$(tmp) wine
    91 wine = WINEPREFIX=$(tmp) wine
    89 pydir = build/python
    92 pydir = build/python
    90 pysite = $(pydir)/Lib/site-packages
    93 pysite = $(pydir)/Lib/site-packages
    91 
    94 
    92 python: $(bin_collect_dir)
    95 python:
       
    96 	mkdir -p $(pydir)
    93 	# Python
    97 	# Python
    94 	$(call get_src_http,http://www.python.org/ftp/python/2.7.2,python-2.7.2.msi)\
    98 	$(call get_src_http,http://www.python.org/ftp/python/2.7.2,python-2.7.2.msi)\
    95 	$(msiexec) /qn /a $$dld TARGETDIR=.\\$(pydir)
    99 	$(msiexec) /qn /a $$dld TARGETDIR=.\\$(pydir)
    96 	cp $(tmp)/drive_c/windows/system32/msvcr71.dll $(bin_collect_dir)
       
    97 	mv $(pydir)/python27.dll $(bin_collect_dir)
       
    98 	
   100 	
    99 	# WxPython (needs running inno unpacker in wine)
   101 	# WxPython (needs running inno unpacker in wine)
   100 	$(call get_src_sf,innounp/innounp/innounp%200.36,innounp036.rar)\
   102 	$(call get_src_sf,innounp/innounp/innounp%200.36,innounp036.rar)\
   101 	unrar e $$dld innounp.exe $(tmp)
   103 	unrar e $$dld innounp.exe $(tmp)
   102 	$(call get_src_sf,wxpython/wxPython/2.8.12.1,wxPython2.8-win32-unicode-2.8.12.1-py27.exe)\
   104 	$(call get_src_sf,wxpython/wxPython/2.8.12.1,wxPython2.8-win32-unicode-2.8.12.1-py27.exe)\
   103 	$(wine) $(tmp)/innounp.exe -d$(tmp) -x $$dld
   105 	$(wine) $(tmp)/innounp.exe -d$(tmp) -x $$dld
   104 	cp -R $(tmp)/\{code_GetPythonDir\}/* $(pydir)
   106 	cp -R $(tmp)/\{code_GetPythonDir\}/* $(pydir)
   105 	cp -R $(tmp)/\{app\}/* $(pysite)
   107 	cp -R $(tmp)/\{app\}/* $(pysite)
   106 	mv $(pysite)/wx-2.8-msw-unicode/wx/*.dll $(bin_collect_dir)
   108 	
       
   109 	# wxPython fails if VC9.0 bullshit is not fully here.
       
   110 	$(call get_src_http,http://download.microsoft.com/download/1/1/1/1116b75a-9ec3-481a-a3c8-1777b5381140,vcredist_x86.exe)\
       
   111 	cp $$dld $(tmp)
       
   112 	$(wine) $(tmp)/vcredist_x86.exe /qn /a
       
   113 	cp $(tmp)/drive_c/windows/winsxs/x86_Microsoft.VC90.CRT*/* $(pydir)
   107 	
   114 	
   108 	# pywin32
   115 	# pywin32
   109 	$(call get_src_sf,pywin32/pywin32/Build216,pywin32-216.win32-py2.7.exe)\
   116 	$(call get_src_sf,pywin32/pywin32/Build216,pywin32-216.win32-py2.7.exe)\
   110 	unzip -d $(tmp)/pw32 $$dld ; [ $$? -eq 1 ] #silence error unziping .exe
   117 	unzip -d $(tmp)/pw32 $$dld ; [ $$? -eq 1 ] #silence error unziping .exe
   111 	cp -R $(tmp)/pw32/PLATLIB/* $(pysite)
   118 	cp -R $(tmp)/pw32/PLATLIB/* $(pysite)
   112 	mv $(pysite)/pywin32_system32/*.dll $(bin_collect_dir)
       
   113 	
   119 	
   114 	# Twisted
   120 	# Twisted
   115 	$(call get_src_pypi,2.7/T/Twisted,Twisted-11.0.0.winxp32-py2.7.msi)\
   121 	$(call get_src_pypi,2.7/T/Twisted,Twisted-11.0.0.winxp32-py2.7.msi)\
   116 	$(msiexec) /qn /a $$dld TARGETDIR=.\\$(pydir)
   122 	$(msiexec) /qn /a $$dld TARGETDIR=.\\$(pydir)
   117 	
   123