Skip to content

Commit

Permalink
Update build for new yara dep
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemk14ebr committed Jun 8, 2023
1 parent 61fa188 commit c8898f2
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions build_all.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
export GOOS=linux
go build && mv GoReSym GoReSym_lin
export GOOS=windows
go build && mv GoReSym.exe GoReSym_win.exe
export GOOS=darwin
go build && mv GoReSym GoReSym_mac
export GOOS=linux
wget https://github.com/VirusTotal/yara/archive/refs/tags/v4.3.1.tar.gz
tar -zxf v4.3.1.tar.gz && cd yara-4.3.1

sudo apt-get install automake libtool make gcc pkg-config mingw-w64
./bootstrap.sh && ./configure && make && sudo make install
sudo ldconfig

cd $OLDPWD

GOOS=linux GOARCH=amd64 go build && mv GoReSym GoReSym_lin

cd yara-4.3.1
YARA_SRC=$(pwd)

make clean
./configure --host=x86_64-w64-mingw32 --disable-magic --disable-cuckoo --without-crypto --prefix=${YARA_SRC}/x86_64-w64-mingw32
make -C ${YARA_SRC}
sudo make -C ${YARA_SRC} install
cd $OLDPWD

go get -d -u github.com/hillu/go-yara/v4
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc PKG_CONFIG_PATH=${YARA_SRC}/x86_64-w64-mingw32/lib/pkgconfig go install -ldflags '-extldflags "-static"' github.com/hillu/go-yara/v4
GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build --ldflags '-extldflags "-lm -static"' && mv GoReSym.exe GoReSym_win64.exe

sudo rm -rf yara-4.3.1
rm v4.3.1.tar.gz

0 comments on commit c8898f2

Please sign in to comment.