Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Commit

Permalink
Build: Add Linux builds thx @chriswayg
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Jan 7, 2020
1 parent 8b3ab8a commit 0a66205
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 33 deletions.
22 changes: 18 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ matrix:
secure: "At/5woONV8OpfI+HP5FgTfYrIrPd9ktU9aqVitHnxlk8J+WXt6bfta8ofNRFQmcpIYCVAfrk1HtfYZ/YkHuFCdzvx4QRP0rAbIun5wwMEPMrNaGB8GdMhH3VP7Lcalox+V2A+XuHaLLi/7kineeZssEWm9uWnhOXUV5tdcLHXWSNr5xAV6ttVOH+B4FTzQwhtaKzzl4KpPj7NLqw+T+9DXvYk8l9YtlZUwnoSLyPJD1PxawZOvqyWT1EY8IDTcd/Ca31Af3GwtrLSSUvkyq1CfEtbo5ZYE8hGG1ZyYMaVgP6FAH8CCVAi3sdUPjgj6Lq6b+rNXNTLVpDtFsOvr332CbhI1QSVlTf2RoWN8BwErguLLkmb+AdpxNhzVV2Xddms6I9PmRZks5j0Dx9ux+PxlXaJ7VIYWqiA2RLqcXVbVBAumYFR/4SujjjKLzLTBap7VdUVeEsYwO2Q+0+FVVijRUxYENoKe31sa7z+gGzSLkeZ81tMebq/UcIUNcLhepTduyxj+ZRw8PgReD8wTWNN4nvUQoXjPo0PpBJs8A6euDbjT8+Xud39FSLODXWLUiJRDG5d+R0aiCW0N32sDnQyGu6Igx9Sq4cAN+Xrabx9F+dTuMWSWWZ4P7L6sstKKfv8mVkBMg9ljyrxZtE+ayRPW3U4viE9WOvEP/8fEM8kIg="
on:
tags: true
script:
- ./macserial/build.tool || exit 1
- python2 ./update_generated.py || exit 1
- if [ "$(git status --porcelain)" != "" ]; then echo "DataBase desync"; exit 1 ; fi
script:
- ./macserial/build.tool || exit 1
- python2 ./update_generated.py || exit 1
- if [ "$(git status --porcelain)" != "" ]; then echo "DataBase desync"; exit 1 ; fi
- os: linux
name: "Build Linux"
deploy:
provider: releases
skip_cleanup: true
file:
- "macserial/bin/macinfo-*-linux.zip"
file_glob: true
api_key:
secure: "At/5woONV8OpfI+HP5FgTfYrIrPd9ktU9aqVitHnxlk8J+WXt6bfta8ofNRFQmcpIYCVAfrk1HtfYZ/YkHuFCdzvx4QRP0rAbIun5wwMEPMrNaGB8GdMhH3VP7Lcalox+V2A+XuHaLLi/7kineeZssEWm9uWnhOXUV5tdcLHXWSNr5xAV6ttVOH+B4FTzQwhtaKzzl4KpPj7NLqw+T+9DXvYk8l9YtlZUwnoSLyPJD1PxawZOvqyWT1EY8IDTcd/Ca31Af3GwtrLSSUvkyq1CfEtbo5ZYE8hGG1ZyYMaVgP6FAH8CCVAi3sdUPjgj6Lq6b+rNXNTLVpDtFsOvr332CbhI1QSVlTf2RoWN8BwErguLLkmb+AdpxNhzVV2Xddms6I9PmRZks5j0Dx9ux+PxlXaJ7VIYWqiA2RLqcXVbVBAumYFR/4SujjjKLzLTBap7VdUVeEsYwO2Q+0+FVVijRUxYENoKe31sa7z+gGzSLkeZ81tMebq/UcIUNcLhepTduyxj+ZRw8PgReD8wTWNN4nvUQoXjPo0PpBJs8A6euDbjT8+Xud39FSLODXWLUiJRDG5d+R0aiCW0N32sDnQyGu6Igx9Sq4cAN+Xrabx9F+dTuMWSWWZ4P7L6sstKKfv8mVkBMg9ljyrxZtE+ayRPW3U4viE9WOvEP/8fEM8kIg="
on:
tags: true
script:
- ./macserial/build.tool || exit 1
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MacInfoPkg changelog
#### v2.1.0
- Added MacPro7,1 model codes
- Improved legacy MLB logic
- Added Linux binaries

#### v2.0.9
- Added MacBookPro16,1 model codes
Expand Down
72 changes: 43 additions & 29 deletions macserial/build.tool
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
#!/bin/bash

if [ "$BUILD_32" = "" ]; then
if [ $(uname -r | cut -f1 -d'.') -gt 17 ]; then
echo "Warning: Disabling 32-bit compilation by default on 10.14..."
BUILD_32=false
else
BUILD_32=true
if [ "$(uname)" = "Darwin" ]; then
if [ "$BUILD_32" = "" ]; then
if [ $(uname -r | cut -f1 -d'.') -gt 17 ]; then
echo "Warning: Disabling 32-bit compilation by default on 10.14..."
BUILD_32=false
else
BUILD_32=true
fi
fi
fi

if [ "$MACOS_MIN" = "" ]; then
if [ $(uname -r | cut -f1 -d'.') -gt 17 ]; then
echo "Warning: Disabling 10.4 and 10.5 support by default on 10.14..."
MACOS_MIN="10.6"
else
MACOS_MIN="10.4"
if [ "$MACOS_MIN" = "" ]; then
if [ $(uname -r | cut -f1 -d'.') -gt 17 ]; then
echo "Warning: Disabling 10.4 and 10.5 support by default on 10.14..."
MACOS_MIN="10.6"
else
MACOS_MIN="10.4"
fi
fi

TARGET=mac
else
TARGET=linux
fi

cd "$(dirname "$0")" || exit 1
Expand All @@ -29,28 +35,36 @@ if [ "$VER" == "" ]; then
VER=unknown
fi

if [ "$DEBUG" != "" ]; then
if $BUILD_32; then
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m32 -mmacosx-version-min=$MACOS_MIN -O0 -g src/macserial.c -o bin/macserial32 || exit 1
if [ "$(uname)" = "Darwin" ]; then
if [ "$DEBUG" != "" ]; then
if $BUILD_32; then
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m32 -mmacosx-version-min=$MACOS_MIN -O0 -g src/macserial.c -o bin/macserial32 || exit 1
fi
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m64 -mmacosx-version-min=$MACOS_MIN -O0 -g src/macserial.c -o bin/macserial64 || exit 1
else
if $BUILD_32; then
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m32 -flto -mmacosx-version-min=$MACOS_MIN -O3 src/macserial.c -o bin/macserial32 || exit 1
strip -x bin/macserial32 || exit 1
fi
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m64 -flto -mmacosx-version-min=$MACOS_MIN -O3 src/macserial.c -o bin/macserial64 || exit 1
strip -x bin/macserial64 || exit 1
fi
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m64 -mmacosx-version-min=$MACOS_MIN -O0 -g src/macserial.c -o bin/macserial64 || exit 1
else

if $BUILD_32; then
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m32 -flto -mmacosx-version-min=$MACOS_MIN -O3 src/macserial.c -o bin/macserial32 || exit 1
strip -x bin/macserial32 || exit 1
lipo -create bin/macserial32 bin/macserial64 -output bin/macserial || exit 1
else
cp bin/macserial64 bin/macserial
fi
clang -std=c11 -Werror -Wall -Wextra -pedantic -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -m64 -flto -mmacosx-version-min=$MACOS_MIN -O3 src/macserial.c -o bin/macserial64 || exit 1
strip -x bin/macserial64 || exit 1
fi

if $BUILD_32; then
lipo -create bin/macserial32 bin/macserial64 -output bin/macserial || exit 1
rm -f bin/macserial32 bin/macserial64
else
cp bin/macserial64 bin/macserial
if [ "$DEBUG" != "" ]; then
gcc -static -std=c11 -Werror -Wall -Wextra -pedantic -O0 -g src/macserial.c -o bin/macserial || exit 1
else
gcc -static -s -std=c11 -Werror -Wall -Wextra -pedantic -O3 src/macserial.c -o bin/macserial || exit 1
fi
fi

rm -f bin/macserial32 bin/macserial64

if [ "$(which i686-w64-mingw32-gcc)" != "" ]; then
if [ "$DEBUG" != "" ]; then
i686-w64-mingw32-gcc -std=c11 -Werror -Wall -Wextra -pedantic -O0 -g src/macserial.c -o bin/macserial32.exe || exit 1
Expand All @@ -68,7 +82,7 @@ cp ../../macrecovery/macrecovery.py tmp || exit 1
cp ../../macrecovery/recovery_urls.txt tmp || exit 1
cp ../FORMAT.md tmp || exit 1
cd tmp || exit 1
zip -qry -FS ../"macinfo-${VER}-mac.zip" * || exit 1
zip -qry -FS ../"macinfo-${VER}-${TARGET}.zip" * || exit 1
if [ -f ../macserial32.exe ]; then
rm -f macserial || exit 1
cp ../macserial32.exe . || exit 1
Expand Down

0 comments on commit 0a66205

Please sign in to comment.