Merge with default

#0
This commit is contained in:
Dan Smith 2019-02-10 16:50:02 -08:00
commit 9aeb129cb8
4 changed files with 4 additions and 165 deletions

View file

@ -1,6 +1,7 @@
include *.xsd
include share/*.desktop
include share/chirp.png
include share/chirp.ico
include share/*.1
include stock_configs/*
include COPYING

View file

@ -1,105 +0,0 @@
#!/bin/bash -x
OUTPUT=$(echo "c:\\cygwin\\${1}/" | sed 's/\//\\/'g)
VERSION=$(cat build/version)
ZIP=${OUTPUT}chirp-$VERSION-win32.zip
IST=${OUTPUT}chirp-$VERSION-installer.exe
LOG=d-rats_build.log
PYTHON=Python27
export GTK_BASEPATH='C:\GTK'
export PATH=$PATH:/cygdrive/c/GTK/bin
shift
build_locale() {
/bin/find.exe . -name '*.py'
make -C locale
}
build_win32() {
echo Building Win32 executable...
/cygdrive/c/$PYTHON/python.exe setup.py py2exe
if [ $? -ne 0 ]; then
echo "Build failed"
exit
fi
}
copy_lib() {
echo Copying GTK lib, etc, share...
if [ -d /cygdrive/c/$PYTHON/Lib/site-packages/gtk-2.0/runtime ]; then
runtime=/cygdrive/c/Python27/Lib/site-packages/gtk-2.0/runtime
else
runtime=/cygdrive/c/GTK
fi
exclude="--exclude=share/locale --exclude=share/*doc --exclude=share/icons"
dirs="share lib etc"
(cd $runtime && tar cf - $exclude $dirs) | (cd dist && tar xvf -)
}
copy_data() {
mkdir dist
list="COPYING *.xsd stock_configs locale"
for i in $list; do
cp -rv $i dist >> $LOG
done
}
make_zip() {
echo Making ZIP archive...
(cd dist && zip -9 -r $ZIP .) >> $LOG
}
make_installer() {
echo Making Installer...
cat > chirp.nsi <<EOF
Name "CHIRP Installer"
OutFile "${IST}"
InstallDir \$PROGRAMFILES\CHIRP
DirText "This will install CHIRP v$VERSION"
#Icon d-rats2.ico
SetCompressor 'lzma'
Section ""
InitPluginsDir
RMDir /r "\$INSTDIR"
SetOutPath "\$INSTDIR"
File /r 'dist\*.*'
CreateDirectory "\$SMPROGRAMS\CHIRP"
CreateShortCut "\$SMPROGRAMS\CHIRP\CHIRP.lnk" "\$INSTDIR\chirpw.exe"
Delete "\$SMPROGRAMS\CHIRP\CSV Dump.lnk"
WriteUninstaller \$INSTDIR\Uninstall.exe
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CHIRP" "DisplayName" "CHIRP"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CHIRP" "UninstallString" \$\"\$INSTDIR\Uninstall.exe\$\""
SectionEnd
Section "Uninstall"
RMDir /r "\$INSTDIR"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CHIRP"
RMDir /r "\$SMPROGRAMS\CHIRP"
SectionEnd
EOF
unix2dos chirp.nsi
pfiles=$(echo $PROGRAMFILES | sed 's/C:.//')
"/cygdrive/c/$pfiles/NSIS/makensis" chirp.nsi
}
rm -f $LOG
build_locale
copy_data
build_win32
copy_lib
if [ "$1" = "-z" ]; then
make_zip
elif [ "$1" = "-i" ]; then
make_installer
elif [ -z "$1" ]; then
make_zip
make_installer
fi

View file

@ -1,57 +0,0 @@
#!/usr/bin/env bash
set -x
VERSION=$(cat build/version)
HOST=$1
shift
SSH='ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null'
SCP='scp -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null'
if [ -z "$HOST" ]; then
echo "Usage: $0 [host]"
exit 1
fi
temp_dir() {
$SSH $HOST "mktemp -d /tmp/${1}.XXXXXX"
}
copy_source() {
tmp=$1
hg status -nmca > .files
rsync -e "$SSH" -av --files-from=.files . $HOST:$tmp
}
do_build() {
tmp=$1
out=$2
shift
shift
$SSH $HOST "cd $tmp && ./build/make_win32_build.sh $out $* && chmod 755 $out/*"
}
grab_builds() {
out=$1
$SCP -r "$HOST:$out/*" dist
}
cleanup () {
tmp=$1
$SSH $HOST "rm -Rf $tmp"
}
sed -i 's/^CHIRP_VERSION.*$/CHIRP_VERSION=\"'$VERSION'\"/' chirp/__init__.py
tmp1=$(temp_dir chirp_build)
tmp2=$(temp_dir chirp_output)
copy_source $tmp1
do_build $tmp1 $tmp2 $*
grab_builds $tmp2
cleanup $tmp1

View file

@ -21,9 +21,9 @@ from chirp import chirp_common, errors, directory
LOG = logging.getLogger(__name__)
def _isuhf(pipe):
def _isuhf(radio):
try:
md = icf.get_model_data(pipe)
md = icf.get_model_data(radio)
val = ord(md[20])
uhf = val & 0x10
except:
@ -87,7 +87,7 @@ class ICx8xRadio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
return rf
def _get_type(self):
flag = (_isuhf(self.pipe) != 0)
flag = (_isuhf(self) != 0)
if self._isuhf is not None and (self._isuhf != flag):
raise errors.RadioError("VHF/UHF model mismatch")