Fixes in mac build script, some gofmt works.

This commit is contained in:
Stanislav Nikitin 2018-11-10 20:57:28 +05:00
parent 127e1b8ab9
commit 39ac02dfc5
6 changed files with 181 additions and 216 deletions

View File

@ -1,29 +1,17 @@
# URTrator
[![Join the chat at https://gitter.im/urtrator/Lobby](https://badges.gitter.im/urtrator/Lobby.svg)](https://gitter.im/urtrator/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Chat on Matrix: #gitter_urtrator=2Flobby:matrix.org (Gitter bridge).
![Main Window](/doc/screenshots/0.2-main_window.png)
URTrator is a desktop application that should (eventually) replace
Urban Terror's and IRC client interfaces for you, because they're
pretty shitty :).
URTrator is a desktop application that should (eventually) replace Urban Terror's and IRC client interfaces for you, because they're pretty shitty :).
*Disclaimer: This software isn't written nor supported (for now) by FrozenSand.
All code is a community effort.*
*Disclaimer: This software isn't written nor supported (for now) by FrozenSand. All code is a community effort.*
Right now it can:
* Obtaining list of Urban Terror servers from master server and
updating information about them.
* Obtaining list of Urban Terror servers from master server and updating information about them.
* Local caching of whole data (in SQLite3 database).
* Extended Urban Terror launching capabilities (e.g. launching game
in another X session).
* Supporting of multiple profiles with multiple game versions.
When you're launching Urban Terror URTrator will check profile you're
trying to use and, if version incompatability found, will not launch
the game.
* Extended Urban Terror launching capabilities (e.g. launching game in another X session).
* Supporting of multiple profiles with multiple game versions. When you're launching Urban Terror URTrator will check profile you're trying to use and, if version incompatability found, will not launch the game.
* Favorites servers.
* Updating single server.
* Automatically update servers information.
@ -37,23 +25,20 @@ Planning:
* Game updating (not from official servers yet, sorry).
* Pickup/matchmaking interfaces.
* All kinds of notifications.
* Extended profile editor, so every profile could have own configuration
files, etc.
* Extended profile editor, so every profile could have own configuration files, etc.
* ...maybe more :)
# Installation
## Precautions
Due to Go's GC bugs, it is required to use devel version of Go
compiler!
There is no precautions for latest source with Golang 1.11.2 and GTK+2 2.24.32.
## Release
You don't need to install anything, thanks to Go's.
URTrator executable contains everything we need. Just download
approriate binary and launch it! :) The only thing is to make
sure you have GTK2 and sqlite3 installed.
You don't need to install anything, thanks to Go's. URTrator executable contains everything we need. Just download approriate binary and launch it! :) The only thing is to make sure you have GTK2 and sqlite3 installed.
Windows and macOS users will receive full distribution that is ready to be launched OOB, no need to additionally install anything.
## Distro-and-OS specific instructions
@ -63,60 +48,46 @@ sure you have GTK2 and sqlite3 installed.
## Development version
URTrator written in Go and GTK2, so you should have them installed.
Make sure your ``GOPATH`` variable is defined.
URTrator written in Go and GTK2, so you should have them installed. Make sure your ``GOPATH`` variable is defined.
Then execute:
```
go get -d github.com/pztrn/urtrator
go install github.com/pztrn/urtrator
go get -d gitlab.com/pztrn/urtrator
go install gitlab.com/pztrn/urtrator
```
First command will get sources of URTrator and dependencies, second
command will build executable for you and place it in ``$GOROOT/bin``.
First command will get sources of URTrator and dependencies, second command will build executable for you and place it in ``$GOROOT/bin``.
### Updating
``go get`` will do initial repo clone for you, but flag ``-u`` is
required to get updated URTrator source. So, for updating sources
just issue:
``go get`` will do initial repo clone for you, but flag ``-u`` is required to get updated URTrator source. So, for updating sources just issue:
```
go get -d -u github.com/pztrn/urtrator
go get -d -u gitlab.com/pztrn/urtrator
```
Again, this will only update sources. To build executable you have to
issue:
Again, this will only update sources. To build executable you have to issue:
```
go install github.com/pztrn/urtrator
go install gitlab.com/pztrn/urtrator
```
# Important information
## Translation
Feel free to ping me everywhere you can and ask for adding a language
for translation, if not already added [here](https://www.transifex.com/issuewarrior/urtrator/dashboard/).
Feel free to ping me everywhere you can and ask for adding a language for translation, if not already added [here](https://www.transifex.com/issuewarrior/urtrator/dashboard/).
Also, if you're testing (or using) URTrator from source tree with `go run`
you should also specify `URTRATOR_BINDIR` variable. This variable tells
URTrator where it sources is and from where translations should be taken.
Also, if you're testing (or using) URTrator from source tree with `go run` you should also specify `URTRATOR_BINDIR` variable. This variable tells URTrator where it sources is and from where translations should be taken.
## GTK warnings in console
Many GTK warnings in console may appear while using URTrator. Unfortunately,
they are out of control, because they are related to Go GTK+2 bindings
and nothing can be done on URTrator side.
Many GTK warnings in console may appear while using URTrator. Unfortunately, they are out of control, because they are related to Go GTK+2 bindings and nothing can be done on URTrator side.
## Why GTK+2?
Because GTK+3 going on "stable api nonsense" way. And also it have some
troubles with integrating with current popular WM/DE (like XFCE4,
Openbox, etc.). And also I already tired of that shitty Adwaita and
Cantarella.
Because GTK+3 going on "stable api nonsense" way. And also it have some troubles with integrating with current popular WM/DE (like XFCE4, Openbox, etc.). And also I already tired of that shitty Adwaita and Cantarella.
If you want to use GTK+3, well, you can write UI for yourself, Go
bindings exist.
If you want to use GTK+3, well, you can write UI for yourself, Go bindings exist.

View File

@ -16,6 +16,6 @@ const (
// Self-named.
var SUPPORTED_URT_VERSIONS []string = []string{
"4.2.023",
"4.3.1",
"4.3.2",
"4.3.3",
"4.3.4",
}

View File

@ -50,13 +50,6 @@ if [ $? -ne 0 ]; then
fi
# Okay, let's compile.
echo "Getting URTrator (and dependencies) sources"
go get -u -v -d gitlab.com/pztrn/urtrator
if [ $? -ne 0 ]; then
echo "Failed to get URTrator sources"
exit 1
fi
echo "Building URTrator..."
go install -v gitlab.com/pztrn/urtrator
if [ $? -ne 0 ]; then
@ -108,11 +101,12 @@ echo -e '#!/bin/bash\ncd "${0%/*}"\nexport GTK_PATH="../lib/gtk-2.0/"\nexport GT
chmod +x ./URTrator.app/Contents/MacOS/urtrator.sh
#####################################################################
# Copying helper binaries.
cp /usr/local/Cellar/gdk-pixbuf/2.36.0_2/bin/gdk-pixbuf-query-loaders ./URTrator.app/Contents/MacOS/
cp /usr/local/Cellar/gdk-pixbuf/2.38.0/bin/gdk-pixbuf-query-loaders ./URTrator.app/Contents/MacOS/
# Copy GTK engines as needed for default theme.
cp /usr/local/lib/gtk-2.0/2.10.0/engines/* ./URTrator.app/Contents/Framework/
cp /usr/local/Cellar/gdk-pixbuf/2.36.0_2/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.so ./URTrator.app/Contents/Framework/
cp /usr/local/lib/gtk-2.0/modules/* ./URTrator.app/Contents/Framework/
cp /usr/local/Cellar/gdk-pixbuf/2.38.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.so ./URTrator.app/Contents/Framework/
chmod -R 0644 ./URTrator.app/Contents/Framework/*
chmod -R 0755 ./URTrator.app/Contents/MacOS/*

View File

@ -56,7 +56,7 @@ func (r *Requester) getServers() error {
}
fmt.Println("Using master server address: " + master_server + ":" + master_server_port)
// IP addresses we will compose to return.
conn, err1 := net.Dial("udp", master_server + ":" + master_server_port)
conn, err1 := net.Dial("udp", master_server+":"+master_server_port)
if err1 != nil {
fmt.Println("Error dialing to master server!")
Eventer.LaunchEvent("setToolbarLabelText", map[string]string{"text": "Failed to connect to master server!"})

View File

@ -6,8 +6,8 @@ import (
"path/filepath"
// other
"github.com/mattn/go-gtk/gtk"
"github.com/couchbase/goutils/platform"
"github.com/mattn/go-gtk/gtk"
)
func (m *MainWindow) closeWin() {