edouard@112: edouard@112: VERSIONPY=sources/beremiz/version.py edouard@112: BVERSION?=$(if $(file <$(VERSIONPY)), $(shell python2 $(VERSIONPY)), $(shell date '+%x_%R' | tr '/: ' '---')) edouard@37: edouard@37: CROSS_COMPILE=i686-w64-mingw32 edouard@37: CROSS_COMPILE_LIBS_DIR=$(shell dirname $(shell $(CROSS_COMPILE)-gcc -print-libgcc-file-name)) edouard@37: CC=$(CROSS_COMPILE)-gcc edouard@37: CXX=$(CROSS_COMPILE)-g++ edouard@37: edouard@37: installer: edouard@37: mkdir -p installer edouard@116: cp $(src)/winpaths.py installer edouard@37: edouard@37: edouard@37: CURDIR:=$(shell pwd) edouard@37: PACMANPFX=$(CURDIR)/pacman edouard@38: msysdir=msys32 edouard@37: MSYS_ROOT=$(CURDIR)/$(msysdir) edouard@37: edouard@94: XVFBRUN ?= xvfb-run -a edouard@79: edouard@116: msysfinaldir=installer/msys2 edouard@38: edouard@38: pacman/.stamp: edouard@37: rm -rf pacman pacman-6.0.0 edouard@37: $(call get_src_http,https://sources.archlinux.org/other/pacman,pacman-6.0.0.tar.xz)\ edouard@37: tar -xJf $$dld edouard@37: cd pacman-6.0.0 ;\ edouard@37: patch -p1 < $(src)/pacman-6.0.0-nogpg-relative_conf.patch ;\ edouard@37: meson -Droot-dir=$(MSYS_ROOT) -Dsysconfdir=$(MSYS_ROOT)/etc -Dlocalstatedir=$(MSYS_ROOT)/var build ;\ edouard@37: DESTDIR=$(PACMANPFX) ninja -C build install edouard@37: touch $@ edouard@37: edouard@37: define pacman_install edouard@38: LD_LIBRARY_PATH=$(PACMANPFX)/usr/lib/x86_64-linux-gnu/ fakeroot pacman/usr/bin/pacman -S $(1) --arch i686 --noconfirm --cachedir $(distfiles) edouard@37: endef edouard@37: edouard@38: $(msysdir)/.stamp: pacman/.stamp edouard@38: rm -rf $(msysdir) edouard@37: $(call get_src_http,http://repo.msys2.org/distrib/i686,msys2-base-i686-20210705.tar.xz)\ edouard@38: tar -xJf $$dld edouard@116: $(call pacman_install, mingw-w64-i686-gcc) edouard@116: $(call pacman_install, make) edouard@37: touch $@ edouard@37: edouard@116: $(msysfinaldir): $(msysdir)/.stamp | installer edouard@116: rm -rf $(msysfinaldir) edouard@116: cp -a $(msysdir) $(msysfinaldir) edouard@37: edouard@37: msiexec = WINEPREFIX=$(tmp) $(XVFBRUN) msiexec edouard@37: wine = WINEPREFIX=$(tmp) $(XVFBRUN) wine edouard@37: pydir = installer/python edouard@37: pysite = $(pydir)/Lib/site-packages edouard@37: edouard@37: python: $(pydir)/.stamp edouard@37: $(pydir)/.stamp: | installer edouard@37: rm -rf $(pydir) edouard@37: mkdir -p $(pydir) edouard@37: edouard@37: # Python edouard@37: $(call get_src_http,http://www.python.org/ftp/python/2.7.13,python-2.7.13.msi)\ edouard@37: $(msiexec) /qn /i $$dld TARGETDIR=.\\$(pydir) edouard@37: edouard@37: # # wxPython fails if VC9.0 redistribuable is not fully here. edouard@37: # $(call get_src_http,http://download.microsoft.com/download/1/1/1/1116b75a-9ec3-481a-a3c8-1777b5381140,vcredist_x86.exe)\ edouard@37: # cp $$dld $(tmp) edouard@37: # $(wine) $(tmp)/vcredist_x86.exe /qn /i edouard@37: # cp -fu $(tmp)/drive_c/windows/winsxs/x86_microsoft.vc90*/* $(pydir) edouard@37: edouard@37: $(wine) $(pydir)/python.exe -m pip install --only-binary :all: --cache-dir $(distfiles) \ edouard@37: wxPython \ edouard@37: future \ edouard@37: matplotlib \ edouard@37: pywin32 \ edouard@37: twisted \ edouard@37: pyOpenSSL \ edouard@37: Nevow \ edouard@37: autobahn \ edouard@37: msgpack_python \ edouard@37: u-msgpack-python \ edouard@40: zeroconf-py2compat \ edouard@37: lxml \ edouard@37: sslpsk \ edouard@37: pycountry \ edouard@37: fonttools \ edouard@37: Brotli edouard@37: edouard@37: $(wine) $(pydir)/python.exe -m pip install --cache-dir $(distfiles) \ edouard@37: Pyro \ edouard@37: gnosis edouard@37: edouard@37: # # FIXME : this uses 'some' binaries of openssl that forces us to stick to python 2.7.13 edouard@37: # # FIXME : (from here : https://www.npcglib.org/~stathis/blog/precompiled-openssl/) edouard@37: # # FIXME : build it, and use openssl binaries from https://github.com/python/cpython-bin-deps/tree/openssl-bin-1.0.2k edouard@37: # WxGlade edouard@37: $(call get_src_http,https://github.com/wxGlade/wxGlade/archive,v0.8.3.zip)\ edouard@37: unzip -d $(tmp) $$dld edouard@37: mv $(tmp)/wxGlade-0.8.3 $(pysite)/wxglade edouard@37: edouard@37: touch $@ edouard@37: edouard@37: matiecdir = installer/matiec edouard@37: matiec: $(matiecdir)/.stamp edouard@37: $(matiecdir)/.stamp: sources/matiec_src | installer edouard@37: cp -a sources/matiec $(tmp);\ edouard@37: cd $(tmp)/matiec;\ edouard@37: autoreconf;\ edouard@37: automake --add-missing;\ edouard@37: ./configure --host=$(CROSS_COMPILE);\ edouard@37: make -j$(CPUS); edouard@37: rm -rf $(matiecdir) edouard@37: mkdir -p $(matiecdir) edouard@37: mv $(tmp)/matiec/*.exe $(matiecdir) edouard@37: edouard@37: # install necessary shared libraries from local cross-compiler edouard@37: cp $(CROSS_COMPILE_LIBS_DIR)/libgcc_s_sjlj-1.dll $(matiecdir) edouard@37: cp $(CROSS_COMPILE_LIBS_DIR)/libstdc++-6.dll $(matiecdir) edouard@37: edouard@37: mv $(tmp)/matiec/lib $(matiecdir) edouard@37: touch $@ edouard@37: edouard@37: beremizdir = installer/beremiz edouard@37: edouard@37: beremiz: $(beremizdir)/.stamp edouard@37: $(beremizdir)/.stamp: sources/beremiz_src | installer edouard@37: rm -rf $(beremizdir);\ edouard@37: cp -a sources/beremiz $(beremizdir);\ edouard@37: touch $@ edouard@37: edouard@37: ide_revisions = installer/revisions.txt edouard@37: $(ide_revisions): revisions.txt edouard@37: cp $< $@ edouard@37: edouard@101: Beremiz-build: Beremiz-$(BVERSION)_build edouard@116: Beremiz-$(BVERSION)_build: $(msysfinaldir) $(pydir)/.stamp $(matiecdir)/.stamp $(beremizdir)/.stamp ide_targets_from_dist $(ide_revisions) edouard@37: touch $@ edouard@37: edouard@101: Beremiz-archive: Beremiz-$(BVERSION).zip edouard@37: edouard@101: Beremiz-installer: Beremiz-$(BVERSION).exe edouard@37: edouard@101: Beremiz-$(BVERSION).zip: Beremiz-$(BVERSION)_build edouard@37: rm -f $@ edouard@37: cd installer; zip -r -q ../$@ . edouard@37: edouard@101: Beremiz-$(BVERSION).exe: Beremiz-$(BVERSION)_build $(src)/license.txt $(src)/install.nsi edouard@101: sed -e 's/\$$BVERSION/$(BVERSION)/g' $(src)/license.txt > installer/license.txt edouard@101: sed -e 's/\$$BVERSION/$(BVERSION)/g' $(src)/install.nsi |\ edouard@37: makensis - edouard@37: edouard@37: edouard@37: