Skip to content

Commit 7e896c3

Browse files
authored
Merge pull request #2 from sschuberth/no-bash
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 <[email protected]>
2 parents fb8531b + 99673dd commit 7e896c3

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

7z/p7z-9.38.1/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
#
33
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.
44

@@ -23,7 +23,7 @@ function build_lib {
2323

2424
# OS-specific setup and build
2525
os_name=$(uname -s)
26-
if [[ "$os_name" =~ "Linux" ]]; then
26+
if echo "$os_name" | grep -q "Linux"; then
2727
# assuming Debian/Ubuntu Linux
2828
# sudo apt-get install -y wget build-essential
2929
build_lib

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.
44
#
55
# A simple re/build script for ScanCode thirdparty native deps on Linux
6-
# Requirements:
6+
# Requirements:
77
# - a Linux 64bits installation
88
# - the scancode requirements in development versions and a toolchain
99
# on RH/Fedora/Centos likely something like:

file/5.23/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
#
33
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.
44

@@ -23,7 +23,7 @@ function build_lib {
2323

2424
# OS-specific setup and build
2525
os_name=$(uname -s)
26-
if [[ "$os_name" =~ "Linux" ]]; then
26+
if echo "$os_name" | grep -q "Linux"; then
2727
# assuming Debian/Ubuntu Linux
2828
# sudo apt-get install -y wget build-essential
2929
build_lib

libarchive/build.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
#
33
# Copyright (c) 2017 nexB Inc. http://www.nexb.com/ - All rights reserved.
44

@@ -26,7 +26,7 @@ function build_lib {
2626

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

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

51-
elif [[ "$os_name" =~ "MINGW32" ]]; then
50+
51+
elif echo "$os_name" | grep -q "MINGW32"; then
5252
# assuming that mingw-get is installed
53-
mingw-get install msys-wget liblzma-dev bzip2-dev zlib libiconv-dev
53+
mingw-get install msys-wget liblzma-dev bzip2-dev zlib libiconv-dev
5454
build_lib
5555
mkdir -p .build/bin
5656
cp .libs/libarchive-13.dll build/bin/libarchive.dll

libdwarf/build.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)