Hi Barry,

I wasn't aware you were looking for a script to build the source tarball.

I made up a maintainer script some time back that allows me to build
either the current RC branch or the Devel branch, both the tarball and
application build. It's not real fancy, but gets the job done.

The script will provide / perform the following:
* Get WSJT-X SVN revision
* Downloads, then uses the latest supberbuild script from svn
* Downloads the latest Hamlib3 sources via superbuild
* Downloads the latest WSJT-X sources via superbuild
* Creates a single tar.gz file ready for compiling
* Configure and Build WSJT-X
* Install the build to the users home directory

The install directories are located in:
* ~/wsjtx-superbuild/wsjtx-sb/{1.7.0,1.6.0} .. ..

Source Packages are located in:
* ~/wsjtx-superbuild/archive

I stash the script in my $HOME/bin directory, and call it with:

For 1.7.0 Devel Branch:
wsjtx-superbuild -d

For 1.6.0 Release Candidate
wsjtx-superbuild -r

The RC branch location should be updated whenever Bill sets up another
RC location, right now it is using ^branches/wsjtx-1.6

For 1.6.0, you'll also get a warning message if the script does not find
the KVASD binary in /usr/bin, however, that is a local use message, and
does not affect on the tarball generation.


73's
Greg, KI7MT

On 11/26/2015 05:14 PM, Barry Jackson wrote:
> On 26/11/15 12:47, Bill Somerville wrote:
>> On 26/11/2015 12:28, Barry Jackson wrote:
> 
>> ...
>>> Regarding Hamlib, I would rather avoid any bundled software that is
>>> available in the distro (it's also policy). I have been testing wsjtx
>>> with our packaged hamlib and not had any problems that I am aware of, it
>>> seems fine handling CAT with my TS-450S.
>>> I have tested in both Mageia 5 (hamlib-1.2.15.3) and Mageia
>>> 6(dev)(hamlib-3.0).
>>> What is the difference between your fork of hamlib (which I also tested)
>>> and upstream hamlib? If there are major differences, and we were to
>>> patch upstream with your changes, are they likely to adversely affect
>>> other softwares that use hamlib?
>> This is a tricky area. First off there is no impact on other
>> applications as we statically link Hamlib into WSJT-X.
>>
>> The background is that we found many issues with Hamlib despite it being
>> the best available library for CAT control and more. I forked Hamlib and
>> set about fixing the issues. WSJT-X should be built with a Hamlib from
>> my fork at present, it is hoped that we can switch back to a Hamlib
>> official package soon but we currently are still finding issues that are
>> not fixed in Hamlib 3.0 stable. I am pushing all my fixes upstream to
>> the Hamlib team so they are getting into their repo but there is still a
>> lag.
>>
>> It is still strongly recommended to build with my Hamlib fork although
>> the differences with Hamlib 3.0 are currently minimal, nevertheless a
>> check with one rig is insufficient since the differences may only effect
>> other rigs. The upstream source tarball we provide which you can build
>> yourself (See ^/branches/wsjtx-superbuild for the project that does
>> that) contains the correct Hamlib fork sources to match the WSJT-X it
>> builds. Because of static linking, provision of an upstream source
>> tarball and my fork being in a public repository (github) there should
>> not be any packaging policy issues. Just think of it as more sources to
>> WSJT-X rather than a package dependency.
> 
> Thanks Bill,
> I finally sorted it - but it's been a long night.
> I think the INSTALL in  wsjtx-superbuild dir could do with an update as
> I could not make sense of it for making the tarball.
> 
> I eventually experimented and wrote a little script to do the job.
> One snag is that it includes CMakeCache.txt in the tarball which breaks
> things.
> 
> The script is attached for your interest and I will include it in our
> .src rpm to make my life easier in future ;)
> 
> I will put 1.6.0-rc1 in our repositories for the dev branch which is not
> due for release as Mageia 6 until next year, so that will give time for
> an update to the full release of wsjtx-1.6.0 as and when.
> 
> Many thanks for all your work on this project!
> 
> 73
> Barry
> G4MKT
> 
>>>
>>> 73
>>> Barry
>>> G4MKT
>> 73
>> Bill
>> G4WJS.
#!/usr/bin/env bash
#
# Name                  : wsjtx-superbuid.sh
# Execution             : As normal user type: wsjtx-superbuild.sh <OPTION>
# Copyright             : Greg Beam, KI7MT <ki7mt01 -at- gmail.com>
#
# wsjtx-superbuild.sh is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation either version 3 of the License, or
# (at your option) any later version. 
#
# wsjtx-superbuild.sh is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------#

set -e

# $1 for v1.7 or v1.6 RC
# USAGE:
# For Development........: wsjtx-superbuid.sh -d
# For Release Candidate..: wsjtx-superbuid.sh -r
SELECT="$1"

# Foreground colours
C_R='\033[01;31m'               # red
C_G='\033[01;32m'               # green
C_Y='\033[01;33m'               # yellow
C_C='\033[01;36m'               # cyan
C_NC='\033[01;37m'              # no color

# RC is the current release candidate branch
# DEV is the current development branch
case "$SELECT" in
        rc|RC|-r|-R )
        BRANCH="wsjtx-1.6"
        VERSION=1.6.0
        TARBALL="wsjtx-1.6.0-rc.tgz" ;;

        dev|DEV|-d|-D )
        BRANCH="wsjtx"
        VERSION=1.7.0
        TARBALL="wsjtx.tgz" ;;

        * )
        clear ||:
        echo '-------------------------------------------'
        echo -e ${C_Y}' WSJTX Superbuild Options'${C_NC}
        echo '-------------------------------------------'
        echo ''
        echo 'Please use -d or -e as options'
        echo ''
        echo 'For v1.7 Development.......: wsjtx-superbuid.sh -d'
        echo 'For v1.6 Release Candidate.: wsjtx-superbuid.sh -r'
        echo ''
        echo 'NOTE: the wsjtx_exp is currently dormant'
        echo ''
        exit 0
        ;;
esac

# Install Prefix
# You should not use a system location !!
PREFIXD=~/wsjtx-superbuild


# Enable Separate
# Sepertate builds by SVN revision in $INSTALLD
# Default is Yes
SEPARATE=Yes


# Verbose Option for Superbuild
# Default is [ 0 ], set to [ 1 ] for verbose
OPT1=0

# Variables used in process
BASED="$PREFIXD"/tmp/wsjtx-sb
APP_NAME=wsjtx-sb
BUILDD="$BASED/build"
SRCD="$BASED/wsjtx-superbuild"
ARCHIVED="$PREFIXD"/archive
SBCOURL="https://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx-superbuild";
HAMLIBSRC="$BUILDD/hamlib-prefix/src/hamlib"
JJ=$(grep -c proc /proc/cpuinfo)

################################################################################
# Functions                                                                    #
################################################################################

function link_kvasd() {

# Only display KVASD message for RC (v1.6 series ) as 
# Development version 1.7.0 longer requires it
case "$SELECT" in
    rc|RC|-rc|-RC )
        # Link KVASD Binary to $INSTALLD/bin
        if [[ -f /usr/bin/kvasd ]] ; then
                KVSTATUS=YES
                echo "-- Linking KVASD binary to: $INSTALLD/bin"
                if [[ ! -L $INSTALLD/bin/kvasd ]] ; then ln -sf /usr/bin/kvasd 
"$INSTALLD"/bin/kvasd ; fi
        else
                KVSTATUS=NO
                echo ''
                echo '-------------------------------------------'
                echo -e ${C_R}' KVASD WARNING'${C_NC}
                echo '-------------------------------------------'
                echo ''
                echo ' * The KVASD Binary was not found in /usr/bin'
                echo ' * Use the KVASD-Installer package to install the binary'
                echo '   before running WSJT-X'
                echo ' * After installation, in a terminal, you should link the'
                echo '   binary to your installation directory, for example:'
                echo ''
                echo "   ln -s /usr/bin/kvasd $INSTALLD/bin/kvasd"
                echo ''
                echo ' * Alternatively, after installing the binary with 
KVASD-Installer,'
                echo '   re-run the last build, which will automatically 
perform the'
                echo '   link for you.'
                echo ''
                read -p "Press [ Enter ] to continue ..."
        fi
        ;;
    * )
         KVSTATUS="Not Required"
    ;;
esac

}

################################################################################
# Start Main Script                                                            #
################################################################################

# Display build information ----------------------------------------------------
clear ||:
echo "-------------------------------------------"
echo -e ${C_G} "WSJT-X SUPERBUILD"${C_NC}
echo "-------------------------------------------"
echo ''
echo 'This scipt will perform the following:'
echo ''
echo ' * Get WSJT-X SVN version'
echo ' * Download the latest Hamlib3 sources'
echo ' * Download the latest WSJT-X sources'
echo ' * Create a single tar.gz file ready for compiling'
echo ' * Configure and Build WSJT-X'
echo ' * Install the build to the users home directory'

# Setup checkout and build directories -----------------------------------------
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "SETUP DIRECTORIES"${C_NC}
echo "-------------------------------------------"
echo ''


# remove old checkout and build directories if exists
if [ -d "$BASED" ]
then
        echo '..Removing old build and checkout directories'
        rm -rf "$BASED"
fi


# Add the required directories
echo '..Creating directory structure'
mkdir -p "$BASED" "$BUILDD" "$ARCHIVED"
cd "$BASED"


# Get remote SVN version -------------------------------------------------------
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "GET WSJT-X SVN VERSION for v$VERSION"${C_NC}
echo "-------------------------------------------"
echo ''
echo '..Get WSJT-X and Superbuild version infomation from SourceForge'
WSJTXV=$(svn info https://svn.code.sf.net/p/wsjt/wsjt/branches/$BRANCH |grep 
"Last Changed Rev:" |awk '{print $4}')
WSJTXSBV=$(svn info 
https://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx-superbuild |grep "Last 
Changed Rev:" |awk '{print $4}')
echo "..Superbuild SVN Version ..: $WSJTXSBV"
echo "..WSJT-X SVN Version ......: $WSJTXV" 

# Checkout WSJTX-SuperBuild ----------------------------------------------------
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "CHECKOUT SUPERBUILD"${C_NC}
echo "-------------------------------------------"
echo ''
echo '..Downloading from SourceForge'
svn co $SBCOURL
echo ''

# Configure Source Package -----------------------------------------------------
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "CONFIGURE SOURCE PACKAGE for v$VERSION"${C_NC}
echo "-------------------------------------------"
echo ''
cd "$BUILDD"
cmake -Wno-dev -D WSJTX_TAG=branches/$BRANCH $SRCD

# Build Source Package 
------------------------------------------------------------
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "BUILD SOURCE PACKAGE for v$VERSION"${C_NC}
echo "-------------------------------------------"
echo  ''

# For verbose builds, use: cmake --build . --target source -- VERBOSE=1
echo '..Please be patient as this can take a few minutes.'
echo ''
cd "$BUILDD"


# Verbose option settings
case "$OPT1" in
        1) cmake --build . --target source -- VERBOSE=1 ;;
        *) cmake --build . --target source ;;
esac

# Get Hamlib3 Hash -------------------------------------------------------------
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "GET HAMLIB3 HASH"${C_NC}
echo "-------------------------------------------"
echo  ''
echo '..Get Hamlib3 Hash from checkout'
cd $HAMLIBSRC
HL3HASH=$(git rev-parse HEAD)
cd "$BASED"


# Source Package Complete
echo ''
echo "-------------------------------------------"
echo -e ${C_G} "SOURCE PACKAGE COMPLETE"${C_NC}
echo "-------------------------------------------"
echo ''
echo "..WSJT-X Version ...: $WSJTXV"
echo "..Build Directory ..: $BUILDD"

case $SELECT in
        dev|DEV|-d|-D )
        SRCPKG="wsjtx_$VERSION-r$WSJTXV.orig.tar.gz" ;;

        exp|EXP|-e|-E )
        SRCPKG="wsjtx_exp_$VERSION-r$WSJTXV.orig.tar.gz" ;;
esac
echo "..Source Package ...: $SRCPKG"


# Setup to compile WSJT-X
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "SETUP WSJTX-BUILD for v$VERSION"${C_NC}
echo "-------------------------------------------"
echo ''


# Move original $TARBALL based on build type
echo '..Moving Souorce Tarball'
case $SELECT in
        dev|DEV|-d|-D )
        mv $BUILDD/wsjtx.tgz $BASED/wsjtx_$VERSION-r$WSJTXV.orig.tar.gz
        SRCD="$BASED/wsjtx"
        SRCPKG="wsjtx_$VERSION-r$WSJTXV.orig.tar.gz"

        # Extract new TARBALL based on build type
        echo '..Removing source package diretories'
        rm -rf "$BUILDD" "$BASED/wsjtx-superbiild"
        echo '..Creating new build diretory'
        mkdir -p "$BUILDD"
        echo '..Extracting Source file'
        tar -xf wsjtx_$VERSION-r$WSJTXV.orig.tar.gz
        cp -u wsjtx_$VERSION-r$WSJTXV.orig.tar.gz "$ARCHIVED"/
        cd "$BUILDD" ;;
        
        exp|EXP|-e|-E )
        mv $BUILDD/wsjtx_exp.tgz $BASED/wsjtx_exp_$VERSION-r$WSJTXV.orig.tar.gz
        SRCD="$BASED/wsjtx_exp"
        SRCPKG="wsjtx_exp_$VERSION-r$WSJTXV.orig.tar.gz"

        # Extract new TARBALL based on build type
        echo '..Removing source package diretories'
        rm -rf "$BUILDD" "$BASED/wsjtx-superbiild"
        echo '..Creating new build diretory'
        mkdir -p "$BUILDD"
        echo '..Extracting Source file'
        tar -xf wsjtx_exp_$VERSION-r$WSJTXV.orig.tar.gz
        cp -u wsjtx_exp_$VERSION-r$WSJTXV.orig.tar.gz "$ARCHIVED"/
        cd "$BUILDD" ;;
esac

# Setup to compile WSJT-X
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "CONFIGURING WSJTX v$VERSION r$WSJTXV"${C_NC}
echo "-------------------------------------------"
echo ''
echo "..Configuring the build"

# set install locaiton
if [ $SEPARATE == "Yes" ] ; then 
        INSTALLD="$PREFIXD/$APP_NAME/$VERSION/$WSJTXV"
else
        INSTALLD="$PREFIXD/$APP_NAME/$VERSION"
fi

# Configure the build
cmake -Wno-dev -D CMAKE_INSTALL_PREFIX="$INSTALLD" "$SRCD"


# Compile and Install the Release Target
echo ''
echo "-------------------------------------------"
echo -e ${C_Y} "COMPILING WSJTX v$VERSION r$WSJTXV"${C_NC}
echo "-------------------------------------------"
echo ''
cd $BUILDD
cmake --build . --target install -- -j "$JJ"

# Link KVASD Binary
link_kvasd

# Finished building source package ---------------------------------------------
echo ''
echo "-------------------------------------------"
echo -e ${C_G} "FINISHED SUPERBUILD"${C_NC}
echo "-------------------------------------------"
echo ''
echo " Superbuild Version ..: $WSJTXSBV"
echo " WSJT-X Version ......: $WSJTXV"
echo " Hamlib3 Hash ........: $HL3HASH"
echo " Source Package ......: $SRCPKG"
echo " Install Location ....: $INSTALLD"
if [[ $KVSTATUS = "YES" ]] ; then
        echo -e ' KVASD Installed .....: '${C_G}"$KVSTATUS"${C_NC}
else
        case "$SELECT" in
                dev|DEV|-d|-D ) 
                        echo -e ' KVASD Installed .....: 
'${C_G}"$KVSTATUS"${C_NC}
                ;;
                * )
                        echo -e ' KVASD Installed .....: 
'${C_R}"$KVSTATUS"${C_NC}
                ;;
        esac
fi
echo ''

------------------------------------------------------------------------------
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to