[GNC] Newest version for Ubuntu 20.04 LTS

john jralls at ceridwen.us
Fri Nov 19 12:00:02 EST 2021


You do, so cd $SOURCEDIR before git checkout -b 4.8a 4.8a.

You want package googletest instead of libgtest-dev and google-mock. The former includes the sources for both googletest and googlemock that GnuCash builds into static libraries for building its tests. This is the way that the googletest developers recommend for building googletest-based tests as it ensures that the compiler options are the same for the googletest binaries and the test programs.

You can also use `sudo apt build-dep gnucash` to install all of the required packages--including build-essential and googletest--instead of the long list in David's instructions provided that your Debian/Ubuntu version is one that provides GnuCash 4.x.

Note as well that you should always check the tags rather than blindly assuming that release x.y is tagged x.y: Sometimes something goes wrong during the release after I've pushed the initial tag and I have to re-tag. That's why the current release is 4.8a instead of 4.8.

Regards,
John Ralls


> On Nov 19, 2021, at 8:21 AM, brad <bradhaack at fastmail.com> wrote:
> 
> Don't you need to be in $SOURCEDIR for the git commands?
> 
> 
> On 11/19/21 12:10 AM, david whiting wrote:
>> Hi Brad,
>> 
>> Once you have the sources you can use git to checkout any previous
>> version you want. To see the tagged versions, in a terminal type:
>> 
>> git tag
>> 
>> The last 10 lines show:
>> 
>> 4.2-post-string-freeze
>> 4.3
>> 4.3-string-freeze
>> 4.4
>> 4.5
>> 4.6
>> 4.7
>> 4.8
>> 4.8a
>> gnucash-1-9-0
>> 
>> So, if you want version 4.8a, you can do:
>> 
>> git checkout -b 4.8a 4.8a
>> 
>> This will checkout the version tagged 4.8a, and create a new branch
>> called 4.8a. Once you have that, you can just change to the build
>> directory and run the cmake and make commands. I have selected 4.8a,
>> if you want version 4.8 instead, just use 4.8 instead of 4.8a in the
>> git checkout. Note, once you have the source code, you don't need to
>> run the whole script again to get a new version. When there is a new
>> release, e.g. 4.9 or 5.0, or 5.1, or whatever, you can just:
>> 
>> git checkout maint
>> git pull
>> 
>> to get the latest commits, then:
>> 
>> git checkout -b 5.0 5.0
>> 
>> (for example) to get that version.
>> 
>> Here is the script again, with the git checkout command added (near the end):
>> 
>> ==== build-gnucash.sh  ====
>> 
>> ## Change this if you want to build it somewhere else.
>> SOURCEDIR="$HOME/Documents/gnucash/source"
>> BUILDDIR="$HOME/Documents/gnucash/build"
>> 
>> sudo apt update
>> sudo apt upgrade
>> 
>> sudo apt-get install build-essential
>> ## This is one long line
>> sudo apt install git make cmake libglib2.0-dev libxml2-dev
>> libxslt1-dev libwebkit2gtk-4.0-dev gettext swig guile-3.0-dev
>> libofx-dev xsltproc libboost-all-dev libdbi1 libdbi-dev libdbd-sqlite3
>> libsecret-1-0 libsecret-1-dev aqbanking-tools libaqbanking-dev
>> gwenhywfar-tools libgwengui-gtk3-dev
>> 
>> # Only use the next 2 lines if you have not installed [[Google_Test |
>> Google Test]] already.
>> sudo apt install libgtest-dev                # >=1.7.0
>> sudo apt install google-mock                 # 1.8.0 installs
>> googlemock in a subdirectory of gtest
>> 
>> mkdir -p $SOURCEDIR
>> mkdir -p $BUILDDIR
>> 
>> ## Clone gnucash source from git, if it is not already there
>> [ ! -d $SOURCEDIR/gnucash ] && git clone
>> https://github.com/Gnucash/gnucash.git $SOURCEDIR
>> 
>> ## Checkout version 4.8a
>> git checkout -b 4.8a 4.8a
>> 
>> cd $BUILDDIR
>> cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/gnucash $SOURCEDIR
>> 
>> make
>> 
>> ==== end of script ====
>> 
>> 
>> David
>> 
>> On Thu, 18 Nov 2021 at 22:07, brad <bradhaack at fastmail.com> wrote:
>>> David,  Will your script build the latest stable release?  If not what
>>> do I change to do that?
>>> 
>>> On 10/2/21 11:48 AM, david whiting wrote:
>>>> Hi Jeff,
>>>> 
>>>> On Wed, 29 Sept 2021 at 07:11, Jeff <beastmaster126 at hotmail.com> wrote:
>>>> [...]
>>>>> I would settle for a copy of "Building the Newest Version of GNC for
>>>>> Dummies Course" book.
>>>> Others have shown you that you can use flatpak to get the latest
>>>> version, but if you do want to build from source I have found that the
>>>> following works on Ubuntu 20.04. I have also attached it as a script.
>>>> This clones the source from git and by default builds the maintenance
>>>> version. The versions are tagged, so you can use git to checkout a
>>>> different version and build that if you want, e.g. you could build 4.8
>>>> rather than maint.
>>>> 
>>>> ==== build-gnucash.sh  ====
>>>> 
>>>> ## Change this if you want to build it somewhere else.
>>>> SOURCEDIR="$HOME/Documents/gnucash/source"
>>>> BUILDDIR="$HOME/Documents/gnucash/build"
>>>> 
>>>> sudo apt update
>>>> sudo apt upgrade
>>>> 
>>>> sudo apt-get install build-essential
>>>> ## This is one long line
>>>> sudo apt install git make cmake libglib2.0-dev libxml2-dev
>>>> libxslt1-dev libwebkit2gtk-4.0-dev gettext swig guile-3.0-dev
>>>> libofx-dev xsltproc libboost-all-dev libdbi1 libdbi-dev libdbd-sqlite3
>>>> libsecret-1-0 libsecret-1-dev aqbanking-tools libaqbanking-dev
>>>> gwenhywfar-tools libgwengui-gtk3-dev
>>>> 
>>>> # Only use the next 2 lines if you have not installed [[Google_Test |
>>>> Google Test]] already.
>>>> sudo apt install libgtest-dev                # >=1.7.0
>>>> sudo apt install google-mock                 # 1.8.0 installs
>>>> googlemock in a subdirectory of gtest
>>>> 
>>>> mkdir -p $SOURCEDIR
>>>> mkdir -p $BUILDDIR
>>>> 
>>>> ## Clone gnucash source from git, if it is not already there
>>>> [ ! -d $SOURCEDIR/gnucash ] && git clone
>>>> https://github.com/Gnucash/gnucash.git $SOURCEDIR
>>>> 
>>>> cd $BUILDDIR
>>>> cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/gnucash $SOURCEDIR
>>>> 
>>>> make
>>>> 
>>>> ==== end of script ====
>>>> 
>>>> David
>>>> 
>>>> _______________________________________________
>>>> gnucash-user mailing list
>>>> gnucash-user at gnucash.org
>>>> To update your subscription preferences or to unsubscribe:
>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>> -----
>>>> Please remember to CC this list on all your replies.
>>>> You can do this by using Reply-To-List or Reply-All.
>>> _______________________________________________
>>> gnucash-user mailing list
>>> gnucash-user at gnucash.org
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>> -----
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>> 
>> 
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.



More information about the gnucash-user mailing list