Skip to content

Commit

Permalink
Add support to install on windows (#79)
Browse files Browse the repository at this point in the history
* Added some paths that were missing on Windows

* Conditionalized 'make install'

* Set direction to execute install.sh with bash
  • Loading branch information
budden authored and filhodanuvem committed Feb 16, 2019
1 parent dd5d887 commit cb2cec9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export LD_LIBRARY_PATH=$(PWD)/libgit2/install/lib
export DYLD_LIBRARY_PATH=$(PWD)/libgit2/install/lib
export PKG_CONFIG_PATH=$(PWD)/libgit2/install/lib/pkgconfig
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(PWD)/libgit2/install/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(PWD)/libgit2/install/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(PWD)/libgit2/install/lib/pkgconfig
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$(PWD)/libgit2/install/include
URL_BASE_GIT2GO=https://github.com/libgit2/git2go/archive
GIT2GO_VERSION=master
GOPATH=$(shell go env GOPATH)
Expand All @@ -24,9 +25,4 @@ build:
@echo "Ready to go!"

install:
@cp ./libgit2/install/lib/lib* /usr/local/lib/
@ldconfig /usr/local/lib >/dev/null 2>&1 || echo "ldconfig not found">/dev/null
@cp ./gitql /usr/local/bin/gitql
@ln -s -f /usr/local/bin/gitql /usr/local/bin/git-ql
@echo "Git is in /usr/local/bin/gitql"
@echo "You can also use: git ql 'query here'"
@bash install.sh
32 changes: 32 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -ex

unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac

if [[ $machine == MinGw ]]
then
# Everything here is ugly. But MinGW seem to have no ldconfig,
# no respect to /usr/local/bin, /usr/local/lib
cp ./libgit2/install/bin/libgit2.dll /usr/bin/
cp ./gitql.exe /usr/bin/gitql.exe
ln -s -f /usr/bin/gitql.exe /usr/bin/git-ql
echo "Gitql.exe is in /usr/bin/gitql.exe"
echo "You can also use: git ql 'query here'"
else
cp ./libgit2/install/lib/lib* /usr/local/lib/
ldconfig /usr/local/lib >/dev/null 2>&1 || echo "ldconfig not found">/dev/null
cp ./gitql /usr/local/bin/gitql
ln -s -f /usr/local/bin/gitql /usr/local/bin/git-ql
echo "Git is in /usr/local/bin/gitql"
echo "You can also use: git ql 'query here'"
fi


0 comments on commit cb2cec9

Please sign in to comment.