mirror of https://gitlab.com/pamhyr/pamhyr2
pamhyr: Add package and installer build script.
parent
f1c4ebec25
commit
10f1d11ddf
|
|
@ -1,3 +1,14 @@
|
|||
### CUSTOM ###
|
||||
|
||||
*.exe
|
||||
*.tar.xz
|
||||
*.zip
|
||||
*.spec
|
||||
|
||||
pamhyrBuild
|
||||
|
||||
### END CUSTOM ###
|
||||
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/python
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=python
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
#! /bin/sh
|
||||
|
||||
echo " *** SETUP ENV"
|
||||
|
||||
python3 -m venv pamhyrBuild
|
||||
source pamhyrBuild/bin/activate
|
||||
pip3 install -r ../requirements.txt
|
||||
|
||||
echo " *** PYINSTALL"
|
||||
|
||||
pyinstaller --paths pamhyrBuild/lib/python3.8/site-packages ../src/pamhyr.py
|
||||
|
||||
echo " *** COPY DATA"
|
||||
|
||||
mkdir -p dist/pamhyr/View/ui
|
||||
cp -r ../src/View/ui/ressources/ dist/pamhyr/View/ui/
|
||||
cp -r ../src/View/ui/Widgets/*.ui dist/pamhyr/View/ui/
|
||||
cp -r ../src/View/ui/*.ui dist/pamhyr/View/ui/
|
||||
|
||||
echo " *** MAKE PACKAGE"
|
||||
|
||||
OLD_PWD=$PWD
|
||||
cd dist/
|
||||
tar --xz -cf pamhyr-gnulinux-amd64.tar.xz pamhyr
|
||||
cd $OLD_PWD
|
||||
|
||||
mv dist/pamhyr-gnulinux-amd64.tar.xz ./
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
!include "x64.nsh"
|
||||
|
||||
Name "PAMHYR"
|
||||
|
||||
OutFile "pamhyr-win-amd64.exe"
|
||||
|
||||
RequestExecutionLevel admin
|
||||
|
||||
Unicode True
|
||||
InstallDir $PROGRAMFILES\PAMHYR
|
||||
|
||||
InstallDirRegKey HKLM "Software\PAMHYR" "Install_Dir"
|
||||
|
||||
Page components
|
||||
Page directory
|
||||
Page instfiles
|
||||
|
||||
UninstPage uninstConfirm
|
||||
UninstPage instfiles
|
||||
|
||||
Section "PAMHYR"
|
||||
SectionIn RO
|
||||
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
File /r "dist\pamhyr\*"
|
||||
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PAMHYR" "DisplayName" "NSIS PAMHYR"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PAMHYR" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PAMHYR" "NoModify" 1
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PAMHYR" "NoRepair" 1
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
|
||||
SectionEnd
|
||||
|
||||
Section "Start Menu Shortcuts"
|
||||
|
||||
CreateDirectory "$SMPROGRAMS\PAMHYR"
|
||||
CreateShortcut "$SMPROGRAMS\PAMHYR\Uninstall.lnk" "$INSTDIR\uninstall.exe"
|
||||
CreateShortcut "$SMPROGRAMS\PAMHYR\PAMHYR.lnk" "$INSTDIR\pamhyr.exe"
|
||||
|
||||
SectionEnd
|
||||
|
||||
Section "Uninstall"
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PAMHYR"
|
||||
DeleteRegKey HKLM SOFTWARE\NSIS_PAMHYR
|
||||
|
||||
Delete "$SMPROGRAMS\PAMHYR\*.lnk"
|
||||
|
||||
RMDir "$SMPROGRAMS\PAMHYR"
|
||||
RMDir /R "$INSTDIR"
|
||||
SectionEnd
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
#! /bin/sh
|
||||
|
||||
echo " *** SETUP ENV"
|
||||
|
||||
export WINARCH=win64
|
||||
|
||||
if [ -z $WINEPREFIX ];
|
||||
then
|
||||
# FIXME Not tested yet...
|
||||
export WINEPREFIX=./wine-pamhyr-build
|
||||
|
||||
wget https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe
|
||||
wget https://freefr.dl.sourceforge.net/project/nsis/NSIS%203/3.08/nsis-3.08-setup.exe
|
||||
|
||||
# Dummy display
|
||||
Xvfb :42 -screen 0 1024x768x16 &
|
||||
jid=$!
|
||||
|
||||
# Install soft
|
||||
winetricks \
|
||||
corefonts \
|
||||
7zip \
|
||||
win10
|
||||
|
||||
DISPLAY=:42.0 wine cmd /c python-3.8.10-amd64.exe /quiet PrependPath=1
|
||||
wine python $WINEPREFIX/drive_c/Program\ Files/Python38/Tools/scripts/win_add2path.py
|
||||
wine python -m pip install pyinstaller
|
||||
|
||||
DISPLAY=:42.0 wine cmd /c nsis-3.08-setup.exe /quiet
|
||||
fi
|
||||
|
||||
echo " *** PYINSTALL"
|
||||
|
||||
wine pyinstaller ../src/pamhyr.py -y
|
||||
|
||||
echo " *** COPY DATA"
|
||||
|
||||
mkdir -p dist/pamhyr/View/ui
|
||||
cp -r ../src/View/ui/ressources/ dist/pamhyr/View/ui/
|
||||
cp -r ../src/View/ui/Widgets/*.ui dist/pamhyr/View/ui/
|
||||
cp -r ../src/View/ui/*.ui dist/pamhyr/View/ui/
|
||||
|
||||
echo " *** MAKE PACKAGES"
|
||||
|
||||
echo " TAR pamhyr-win-amd64.tar.xz"
|
||||
|
||||
OLD_PWD=$PWD
|
||||
cd dist/
|
||||
tar --xz -cf pamhyr-win-amd64.tar.xz pamhyr
|
||||
cd $OLD_PWD
|
||||
mv dist/pamhyr-win-amd64.tar.xz ./
|
||||
|
||||
echo " ZIP pamhyr-win-amd64.zip"
|
||||
|
||||
OLD_PWD=$PWD
|
||||
cd dist/
|
||||
zip -r pamhyr-win-amd64.zip pamhyr/
|
||||
cd $OLD_PWD
|
||||
mv dist/pamhyr-win-amd64.zip ./
|
||||
|
||||
echo " *** MAKE INSTALLER"
|
||||
|
||||
wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/NSIS/makensis.exe \
|
||||
pamhyr.nsi
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
PyQt5==5.15.4
|
||||
PyQt5-Qt5==5.15.2
|
||||
PyQt5-sip==12.8.1
|
||||
pyqtgraph>=0.12.1
|
||||
matplotlib>=3.4.1
|
||||
numpy>=1.24.2
|
||||
colorama>=0.4.3
|
||||
pyinstaller>=5.11.0
|
||||
shapely>=2.0.1
|
||||
Loading…
Reference in New Issue