# HatchKeeper 

HatchKeeper is an open-source cross-platform program that keeps track of
egg incubation. HatchKeeper currently runs on Linux, Windows and macOS. 
For more help see the HatchKeeper Manual. To file a bug report or if you 
have a patch, comment or question, see the forum and tickets on our 
[SourceForge](https://sourceforge.net/projects/hatchkeeper/) page or visit our
[homepage](http://hatchkeeper.sourceforge.io/).

### License: 

See gpl-3.0.txt
			
### Setting up on Linux:

HatchKeeper is now avalible as an AppImage. If this doesnt work 
for you, it is possible to extract HatchKeeper with ./*.AppImage 
--appimage-extract, this will work as a portable app or you can 
manually install it.

To use as a portable app just extract the AppImage and give 
HatchKeeper execute permission. Make sure that .HatchKeeper_Data_* 
has read and write permission.

Or Just copy HatchKeeper_* to /usr/bin and copy .HatchKeeper_Data_*
to you home folder. Make sure you have the right permissions. 
run HatchKeeper_* to launch

NOTE: beginning with version 0.75.0 hatchkeeperd will no longer
be available, use the built-in notifications instead.


### Setting up on Windows:

HatchKeeper for windows is avalible as a portable app or an 
install.

For the portable version: Just run the self-extracting .exe 
file extract to the location of your choice. Double-click 
HatchKeeper.exe to run your app.
    
For the installer: Run the installer, then launch from the Start 
Menu. 

Before uninstalling HatchKeeper on Windows, right-click the 
HatchKeeper icon notification area on the Taskbar and select 
Exit Completely before running the uninstaller.

### Setting up on Mac:

On Mac right-click the .dmg installer. Select open and then 
select open in the warning dialog. In Finder drag HatchKeeper to 
the Applications shortcut in the same directory.

To uninstall, Navigate to /Applications with Finder, Right-
Click HatchKeeper. Select Move To Trash.

To set HatchKeeper to start at login: Open HatchKeeper, right-
click the HatchKeeper icon in the Dock, select Options > 
Start At Login.

### Compiling HatchKeeper

#### Dependecies: 

G++ and Make:
	Linux: Install g++ and make via your package manager
	Mac: Install Command Line Tools For Xcode
	Windows: Install the [TDM GCC](http://tdm-gcc.tdragon.net) compiler 

[wxWidgets](https://www.wxwidgets.org) >= 3.1.1 source code. 
See below for info on builing for each platform. 

[wxFreeChart](https://www.github.com/iwbnwif/wxFreeChart), 
You can manually specfiy NO_GRAPH and edit out the wxFreeChart library 
in the makefile to eliminate the wxFreeChart dependency.


#### On Windows:
You'll need to build a copy of wxWidgets 3.1.1. install source to C:\wxWidgets 3.1.1
Next open C:\wxWidgets-3.1.1\build\msw\config.gcc in a text editor and modify some 
lines to look like this:
```
# Standard flags for C++ 
CXXFLAGS ?= "--std=gnu++11"

# What type of library to build? [0,1]
SHARED ?= 1

# Type of compiled binaries [,release]
BUILD ?= release

# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= 0

# Value of wxDEBUG_LEVEL. The default value is the same as 1 and means that all
# but expensive assert checks are enabled, use 0 to completely remove debugging
# code. [0,1,default]
DEBUG_FLAG ?= 1

# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic
```

Next cd to C:\wxWidgets-3.1.1\build\msw\ and run:
```
mingw32-make -j2 -f makefile.gcc 
```

Copy the following files into the root of HatchKeeper source.
```
/lib/wxbase311u_gcc_custom.dll
/lib/wxmsw311u_adv_gcc_custom.dll
/lib/wxmsw311u_aui_gcc_custom.dll
/lib/wxmsw311u_core_gcc_custom.dll
/lib/wxmsw311u_html_gcc_custom.dll
```
To build the wxFreeChart cd into the source/build and run
```
mingw32-make -f makefile.gcc WX_DIR=C:\wxWidgets-3.1.1 WX_UNICODE=1 WX_DEBUG=0 WX_SHARED=1
```

Copy the include folder, the /lib/wxcode*.a file and
the /lib/wxcode*.dll file to the root of the HatchKeeper 
source.

Finally build HatchKeeper by cd into the directory and run:
```
 mingw32-make -j2 -f WinMakefile
```
To build an installer you'll need to install [NSIS](https://nsis.sourceforge.io/) and the 
[AccessControl](https://nsis.sourceforge.io/AccessControl_plug-in) plug-in. 
Copy the HatchInstaller.nsi file from Platforms/Windows to the root of 
the HatchKeeper source and compile it with the nsis compiler, this will 
produce an installable .exe installer in the root of the source.

#### On Linux. 
Make sure you have g++/gcc, make, etc installed. If you
want to use native notifications, install libnotify 
development files.

Build wxWidgets 3.1.1 first. cd into the wx source and run:
```
./configure --disable-shared
make -j2
sudo make install

```
Next build wxFreeChart. cd into the source and run:
```
./configure
```
Make sure the summary specifies wx 3.1.1 than run:
```
make
```

Copy the include folder and the /lib/libwxcode*.a file
to the root of the HatchKeeper source.

In HatchKeeper Rename LinMakefile to Makefile and run:
```
make
```
To package as an AppImage you'll need to download the 
[appimagetool](https://github.com/AppImage/AppImageKit/releases). 
Copy the HatchKeeper executable and the HatchKeeper_Data_* folder to 
Platforms/Linux/HatchKeeper_v*.AppDir. Cd into Platforms/Linux and run
```
chmod +x ./HatchKeeper_v*.AppDir/AppRun 
<path-to-appimagetool> -n ./HatchKeeper_v*.AppDir. 

```
The AppImage should be found in Platforms/Linux.

#### On Mac.
Assuming you have the Command Line Tools For Xcode Installed.
You'll have to build and install wxWidgets 3.1.1, Open terminal
and cd into the wx directory. Run:
```
./configure --disable-shared
make
sudo make install

```

Next build wxFreeChart. cd into the source and run:
```
./configure 
```
Make sure the summary specifies wx 3.1.1 than run:
```
make
```

Copy the include folder and the /lib/libwxcode*.a file to the 
root of the HatchKeeper source.

Now extract HatchKeeper source and cd into it. Run:
```
make -f MacMakefile
```
The finished product will be called HatchKeeper.app. Copy this to 
/Applications to install.

### Documentation

#### User Documentation
For user documentation, check https://hatchkeeper.sourceforge.io/help

#### Developer Documentation
HatchKeeper source is documented with doxygen. Make sure you have doxygen
installed and run:
```
cd ./doc
doxygen ./Doxyfile
```

Open ./html/index.html with your favorite web browser. 
