Fix i386 build

pull/116/head
Junegunn Choi 10 years ago
parent 6109a0fe44
commit b277f5ae6f

@ -15,6 +15,7 @@ check_binary() {
echo "- Checking fzf executable"
echo -n " - "
if ! "$fzf_base"/bin/fzf --version; then
rm -v "$fzf_base"/bin/fzf
binary_error="Error occurred"
fi
}
@ -33,7 +34,7 @@ download() {
return
fi
local url=https://github.com/junegunn/fzf-bin/releases/download/snapshot/${1}.tgz
local url=https://github.com/junegunn/fzf-bin/releases/download/$version/${1}.tgz
if which curl > /dev/null; then
curl -fL $url | tar -xz
elif which wget > /dev/null; then
@ -56,11 +57,11 @@ archi=$(uname -sm)
binary_available=1
binary_error=""
case "$archi" in
"Darwin x86_64") download fzf-$version-darwin_amd64 ;;
# "Darwin i[36]86") download fzf-$version-darwin_386 ;;
"Linux x86_64") download fzf-$version-linux_amd64 ;;
# "Linux i[36]86") download fzf-$version-linux_386 ;;
*) binary_available=0 ;;
Darwin\ x86_64) download fzf-$version-darwin_amd64 ;;
Darwin\ i*86) download fzf-$version-darwin_386 ;;
Linux\ x86_64) download fzf-$version-linux_amd64 ;;
Linux\ i*86) download fzf-$version-linux_386 ;;
*) binary_available=0 ;;
esac
cd "$fzf_base"

@ -13,6 +13,12 @@ ENV GOPATH /go
ENV GOROOT /go1.4
ENV PATH /go1.4/bin:$PATH
# For i386 build
RUN echo '[multilib]' >> /etc/pacman.conf && \
echo 'Include = /etc/pacman.d/mirrorlist' >> /etc/pacman.conf && \
pacman-db-upgrade && yes | pacman -Sy gcc-multilib lib32-ncurses && \
cd $GOROOT/src && GOARCH=386 ./make.bash
# Symlink fzf directory
RUN mkdir -p /go/src/github.com/junegunn && \
ln -s /fzf /go/src/github.com/junegunn/fzf

@ -45,7 +45,7 @@ clean:
cd fzf && rm -f $(BINARY32) $(BINARY64) $(RELEASE32).tgz $(RELEASE64).tgz
# Linux distribution to build fzf on
DISTRO := ubuntu
DISTRO := arch
docker:
docker build -t junegunn/$(DISTRO)-sandbox - < Dockerfile.$(DISTRO)

@ -29,10 +29,9 @@ make linux
System requirements
-------------------
Currently prebuilt binaries are provided only for 64 bit OS X and Linux.
The install script will fall back to the legacy Ruby version on the other
systems, but if you have Go installed, you can try building it yourself.
(`make install`)
Currently prebuilt binaries are provided only for OS X and Linux. The install
script will fall back to the legacy Ruby version on the other systems, but if
you have Go installed, you can try building it yourself. (`make install`)
However, as pointed out in [golang.org/doc/install][req], the Go version will
not run on CentOS/RHEL 5.x and thus the install script will choose the Ruby

@ -1,8 +1,15 @@
package curses
// #include <ncurses.h>
// #include <locale.h>
// #cgo LDFLAGS: -lncurses
/*
#include <ncurses.h>
#include <locale.h>
#cgo LDFLAGS: -lncurses
void swapOutput() {
FILE* temp = stdout;
stdout = stderr;
stderr = temp;
}
*/
import "C"
import (
@ -162,7 +169,7 @@ func Init(color bool, color256 bool, black bool, mouse bool) {
// syscall.Dup2(int(in.Fd()), int(os.Stdin.Fd()))
}
swapOutput()
C.swapOutput()
C.setlocale(C.LC_ALL, C.CString(""))
C.initscr()
@ -218,13 +225,7 @@ func Init(color bool, color256 bool, black bool, mouse bool) {
func Close() {
C.endwin()
swapOutput()
}
func swapOutput() {
syscall.Dup2(2, 3)
syscall.Dup2(1, 2)
syscall.Dup2(3, 1)
C.swapOutput()
}
func GetBytes() []byte {

Loading…
Cancel
Save