Skip to content

Commit

Permalink
Merge pull request visualfc#381 from FredFoonly/master
Browse files Browse the repository at this point in the history
OpenBSD 5.6
  • Loading branch information
visualfc committed Feb 13, 2015
2 parents 4c77f34 + 52fbc4c commit 7362e79
Show file tree
Hide file tree
Showing 22 changed files with 343 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*.dylib
*.7z

#Emacs
*~

# Qt-es

*.pro.user
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ _LiteIDE is a simple, open source, cross-platform Go IDE._
* Windows x86 (32-bit or 64-bit)
* Linux x86 (32-bit or 64-bit)
* MacOS X10.6 or higher (64-bit)
* OpenBSD 5.6 or higher (64-bit)

### Website
* LiteIDE Source code
Expand Down
90 changes: 90 additions & 0 deletions build/build_openbsd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/sh

export BUILD_ROOT=$PWD

if [ -z $LITEIDE_ROOT ]; then
export LITEIDE_ROOT=$PWD/../liteidex
fi

echo build liteide
echo QTDIR=$QTDIR
echo GOROOT=$GOROOT
echo BUILD_ROOT=$BUILD_ROOT
echo LITEIDE_ROOT=$LITEIDE_ROOT
echo .

if [ -z $QTDIR ]; then
echo 'error, QTDIR is null'
exit 1
fi

export PATH=$QTDIR/bin:$PATH

echo qmake liteide ...
echo .
qmake $LITEIDE_ROOT -spec openbsd-g++ "CONFIG+=release"

if [ $? -ge 1 ]; then
echo 'error, qmake fail'
exit 1
fi

echo make liteide ...
echo .
make

if [ $? -ge 1 ]; then
echo 'error, make fail'
exit 1
fi

go version
if [ $? -ge 1 ]; then
echo 'error, not find go in PATH'
exit 1
fi

echo build liteide tools ...
cd $LITEIDE_ROOT
export GOPATH=$PWD:$GOPATH

go install -ldflags "-s" -v github.com/visualfc/gotools

if [ $? -ge 1 ]; then
echo 'error, go install fail'
exit 1
fi

go install -ldflags "-s" -v github.com/nsf/gocode

if [ $? -ge 1 ]; then
echo 'error, go install fail'
exit 1
fi

echo deploy ...

cd $BUILD_ROOT

rm -r liteide
mkdir -p liteide
mkdir -p liteide/local/bin
mkdir -p liteide/local/share/liteide
mkdir -p liteide/local/share/pixmaps
mkdir -p liteide/local/lib/liteide/plugins

cp -RpP $LITEIDE_ROOT/LICENSE.LGPL liteide
cp -RpP $LITEIDE_ROOT/LGPL_EXCEPTION.TXT liteide
cp -RpP $LITEIDE_ROOT/../README.md liteide
cp -RpP $LITEIDE_ROOT/../CONTRIBUTORS liteide

cp $LITEIDE_ROOT/liteide/bin/liteide liteide/local/bin
cp $LITEIDE_ROOT/liteide/bin/*.so.* liteide/local/lib
cp -RpP $LITEIDE_ROOT/bin/gotools liteide/local/bin
cp -RpP $LITEIDE_ROOT/bin/gocode liteide/local/bin
cp -RpP $LITEIDE_ROOT/liteide/lib/liteide/plugins/*.so liteide/local/lib/liteide/plugins

cp -r $LITEIDE_ROOT/deploy/* liteide/local/share/liteide/
cp -r $LITEIDE_ROOT/os_deploy/openbsd/* liteide/local/share/liteide/
cp $LITEIDE_ROOT/deploy/welcome/images/liteide-logo*.png liteide/local/share/pixmaps

12 changes: 12 additions & 0 deletions liteidex/deploy/welcome/en/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,16 @@ Source code for LiteIDE can be found at <https://github.com/visualfc/liteide>.
$ ./build_osx.sh
$ ./deploy_osx_qt4.sh

### OpenBSD
$ git clone https://github.com/visualfc/liteide.git
$ export QTDIR=/usr/local/lib/qt4
$ cd liteide/build
$ ./update_pkg.sh
$ ./build_openbsd.sh

## Run it: ##
$ export LD_LIBRARY_PATH=$HOME/liteide/build/liteide/bin:$LD_LIBRARY_PATH
$ cd ~/liteide/build/liteide/bin
$ ./liteide

Be sure to set `QTDIR` (and `MINGWDIR` for Windows users) accordingly based on your local environment.
17 changes: 17 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-arm5.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# cross-compiler linux arm5

GOROOT=$HOME/go
#GOBIN=
GOARCH=arm
GOARM=5
GOOS=linux
CGO_ENABLED=0

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
17 changes: 17 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-arm6.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# cross-compiler linux arm6

GOROOT=$HOME/go
#GOBIN=
GOARCH=arm
GOARM=6
GOOS=linux
CGO_ENABLED=0

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-darwin32.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# native compiler drawin 386

GOROOT=$HOME/go
#GOBIN=
GOARCH=386
GOOS=darwin
CGO_ENABLED=1

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=/usr/local/bin/gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-darwin64.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# native compiler drawin amd64

GOROOT=$HOME/go
#GOBIN=
GOARCH=amd64
GOOS=darwin
CGO_ENABLED=1

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=/usr/local/bin/gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-freebsd32.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# native compiler drawin 386

GOROOT=$HOME/go
#GOBIN=
GOARCH=386
GOOS=freebsd
CGO_ENABLED=1

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=/usr/local/bin/gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-freebsd64.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# native compiler drawin amd64

GOROOT=$HOME/go
#GOBIN=
GOARCH=amd64
GOOS=freebsd
CGO_ENABLED=1

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=/usr/local/bin/gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-linux32.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# cross-compiler linux 386

GOROOT=$HOME/go
#GOBIN=
GOARCH=386
GOOS=linux
CGO_ENABLED=0

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-linux64.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# cross-compiler linux amd64

GOROOT=$HOME/go
#GOBIN=
GOARCH=amd64
GOOS=linux
CGO_ENABLED=0

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-win32.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# cross-compiler windows 386

GOROOT=$HOME/go
#GOBIN=
GOARCH=386
GOOS=windows
CGO_ENABLED=0

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/cross-win64.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# cross-compiler windows amd64

GOROOT=$HOME/go
#GOBIN=
GOARCH=amd64
GOOS=windows
CGO_ENABLED=0

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/bin/open
LITEIDE_TERMARGS=-a Terminal
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/openbsd32.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# native compiler openbsd 386

GOROOT=$HOME/go
#GOBIN=
GOARCH=386
GOOS=openbsd
CGO_ENABLED=1

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=/usr/bin/gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/local/bin/open
LITEIDE_TERMARGS=
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/openbsd64.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# native compiler openbsd amd64

GOROOT=$HOME/go
#GOBIN=
GOARCH=amd64
GOOS=openbsd
CGO_ENABLED=1

PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=/usr/bin/gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/local/bin/open
LITEIDE_TERMARGS=
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
16 changes: 16 additions & 0 deletions liteidex/os_deploy/openbsd/liteenv/system.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# native compiler openbsd amd64

#GOROOT=/usr/local/go
#GOBIN=
#GOARCH=amd64
#GOOS=freebsd
#CGO_ENABLED=1

#PATH=$GOROOT/bin:$PATH

LITEIDE_GDB=/usr/bin/gdb
LITEIDE_MAKE=make
LITEIDE_TERM=/usr/local/bin/open
LITEIDE_TERMARGS=
LITEIDE_EXEC=/usr/X11R6/bin/xterm
LITEIDE_EXECOPT=-e
13 changes: 9 additions & 4 deletions liteidex/src/api/liteenvapi/liteenvapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,23 @@ inline QProcessEnvironment getCurrentEnvironment(LiteApi::IApplication *app)

inline QString getDefaultGOOS()
{
const char* goos = "";
#ifdef Q_OS_WIN
return "windows";
goos = "windows";
#endif
#ifdef Q_OS_LINUX
return "linux";
goos = "linux";
#endif
#ifdef Q_OS_DARWIN
return "darwin";
goos = "darwin";
#endif
#ifdef Q_OS_FREEBSD
return "freebsd";
goos = "freebsd";
#endif
#ifdef Q_OS_OPENBSD
goos = "openbsd";
#endif
return goos;
}

inline QString getDefaultGOROOT()
Expand Down
4 changes: 4 additions & 0 deletions liteidex/src/liteidex/goapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ var contexts = []*build.Context{
{GOOS: "windows", GOARCH: "386"},
{GOOS: "freebsd", GOARCH: "amd64"},
{GOOS: "freebsd", GOARCH: "386"},
{GOOS: "openbsd", GOARCH: "386", CgoEnabled: true},
{GOOS: "openbsd", GOARCH: "386"},
{GOOS: "openbsd", GOARCH: "amd64", CgoEnabled: true},
{GOOS: "openbsd", GOARCH: "amd64"},
}

func contextName(c *build.Context) string {
Expand Down
1 change: 1 addition & 0 deletions liteidex/src/liteidex/liteapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ static void cdrv_cb(void *cb, void *id, void *reply, int size, int err, void* ct
#cgo windows LDFLAGS: -L../../liteide/bin -lliteapp
#cgo linux LDFLAGS: -L../../liteide/bin -lliteapp
#cgo openbsd LDFLAGS: -L../../liteide/bin -lliteapp
#cgo darwin LDFLAGS: -L../../liteide/bin/liteide.app/Contents/MacOS
*/
import "C"
Expand Down
Loading

0 comments on commit 7362e79

Please sign in to comment.