mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 07:43:39 -05:00
Fix i386 build
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user