Skip to content

Commit

Permalink
Merge pull request #2 from sschuberth/no-bash
Browse files Browse the repository at this point in the history
Improve build scripts to work without bash
This is to support building an Alpine-based Docker image
See aboutcode-org/scancode-toolkit#1262

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne authored Nov 7, 2018
2 parents fb8531b + 99673dd commit 7e896c3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions 7z/p7z-9.38.1/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.

Expand All @@ -23,7 +23,7 @@ function build_lib {

# OS-specific setup and build
os_name=$(uname -s)
if [[ "$os_name" =~ "Linux" ]]; then
if echo "$os_name" | grep -q "Linux"; then
# assuming Debian/Ubuntu Linux
# sudo apt-get install -y wget build-essential
build_lib
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.
#
# A simple re/build script for ScanCode thirdparty native deps on Linux
# Requirements:
# Requirements:
# - a Linux 64bits installation
# - the scancode requirements in development versions and a toolchain
# on RH/Fedora/Centos likely something like:
Expand Down
4 changes: 2 additions & 2 deletions file/5.23/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.

Expand All @@ -23,7 +23,7 @@ function build_lib {

# OS-specific setup and build
os_name=$(uname -s)
if [[ "$os_name" =~ "Linux" ]]; then
if echo "$os_name" | grep -q "Linux"; then
# assuming Debian/Ubuntu Linux
# sudo apt-get install -y wget build-essential
build_lib
Expand Down
12 changes: 6 additions & 6 deletions libarchive/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.

Expand Down Expand Up @@ -26,7 +26,7 @@ function build_lib {

# OS-specific setup and build
os_name=$(uname -s)
if [[ "$os_name" =~ "Linux" ]]; then
if echo "$os_name" | grep -q "Linux"; then
# assuming Debian/Ubuntu Linux
# sudo apt-get install -y wget build-essential zlib1g-dev liblzma-dev libbz2-dev
build_lib
Expand All @@ -36,7 +36,7 @@ if [[ "$os_name" =~ "Linux" ]]; then
cp .build/bin/libarchive.so ../../../scancode-toolkit/src/extractcode/bin/linux-64/lib/libarchive.so
echo "Build complete: ScanCode updated with linux-64 binaries"

elif [[ "$os_name" =~ "Darwin" ]]; then
elif echo "$os_name" | grep -q "Darwin"; then
# assuming that brew is installed
brew install git
brew tap homebrew/homebrew-dupes
Expand All @@ -46,11 +46,11 @@ elif [[ "$os_name" =~ "Darwin" ]]; then
cp .libs/libarchive.13.dylib .build/bin/libarchive.dylib
strip .build/bin/*
echo "Build complete: build contains extra sources for redist and binaries"


elif [[ "$os_name" =~ "MINGW32" ]]; then

elif echo "$os_name" | grep -q "MINGW32"; then
# assuming that mingw-get is installed
mingw-get install msys-wget liblzma-dev bzip2-dev zlib libiconv-dev
mingw-get install msys-wget liblzma-dev bzip2-dev zlib libiconv-dev
build_lib
mkdir -p .build/bin
cp .libs/libarchive-13.dll build/bin/libarchive.dll
Expand Down
Empty file modified libdwarf/build.sh
100644 → 100755
Empty file.

0 comments on commit 7e896c3

Please sign in to comment.