Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a core status attribute #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ To add a new core, add a stanza like the below:
| ``branch`` | The git branch to switch to when building |
| ``makeoptions`` | Settings and options for building the core (see makeoptions table below) |
| ``options`` | Options to be set by the emulator (see options table below) |
| ``status`` | ``0`` or not set = ``stable``<br />``1`` = ``beta``<br />``2`` = ``experimental``<br />``3`` = ``don't build`` - the build script will skip building the core |

### makeoptions
| Attribute | Definition |
Expand Down
118 changes: 62 additions & 56 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,77 +129,83 @@ for row in $(jq -r '.[] | @base64' ../cores.json); do
makescript=`echo $(_jq '.') | jq -r '.makeoptions.makescript'`
arguments=`echo $(_jq '.') | jq -r '.makeoptions.arguments[] | @base64'`
options=`echo $(_jq '.') | jq -r '.options'`
status=`echo $(_jq '.') | jq -r '.status'`

argumentstring=""
for rowarg in $(echo "${arguments}"); do
argumentstring="$argumentstring `echo $rowarg | base64 --decode`"
done
# only compile if the status attribute is not 3
if [ -a "$status" != 3 ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we "if status == 3 then continue"? or is that not available in bash?


echo "Starting compile of core $name"
echo "Working dir $PWD"
argumentstring=""
for rowarg in $(echo "${arguments}"); do
argumentstring="$argumentstring `echo $rowarg | base64 --decode`"
done

compileProject "$name" "$repo.git" "$branch" "$buildpath" "$makescript" "$argumentstring" >> "$logPath/$name-compile.log"
echo "Starting compile of core $name"
echo "Working dir $PWD"

# write JSON stanza for this core to disk
echo ${row} | base64 --decode > "./core.json"
compileProject "$name" "$repo.git" "$branch" "$buildpath" "$makescript" "$argumentstring" >> "$logPath/$name-compile.log"

if [ ! -z "$license" -a "$license" != " " ]; then
# license file is provided - copy it
echo "License file: $name/$license"
cp $name/$license "./license.txt"
fi
# write JSON stanza for this core to disk
echo ${row} | base64 --decode > "./core.json"

echo "Building wasm's for core $name"
cd "RetroArch"
cd "dist-scripts"
if [ ! -z "$license" -a "$license" != " " ]; then
# license file is provided - copy it
echo "License file: $name/$license"
cp $name/$license "./license.txt"
fi

mv core-temp/normal/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean no no >> "$logPath/$name-emake.log"
rm -f *.bc
echo "Building wasm's for core $name"
cd "RetroArch"
cd "dist-scripts"

mv core-temp/threads/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean yes no >> "$logPath/$name-emake.log"
rm -f *.bc
mv core-temp/normal/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean no no >> "$logPath/$name-emake.log"
rm -f *.bc

mv core-temp/legacy/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean no yes >> "$logPath/$name-emake.log"
rm -f *.bc
mv core-temp/threads/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean yes no >> "$logPath/$name-emake.log"
rm -f *.bc

mv core-temp/legacyThreads/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean yes yes >> "$logPath/$name-emake.log"
rm -f *.bc
mv core-temp/legacy/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean no yes >> "$logPath/$name-emake.log"
rm -f *.bc

echo "Packing core information for $name"
cd $compileStartPath
if [ -f "EmulatorJS/data/cores/$name-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-wasm.data $outputPath
fi
mv core-temp/legacyThreads/*.bc ./
emmake ./build-emulatorjs.sh emscripten clean yes yes >> "$logPath/$name-emake.log"
rm -f *.bc

if [ -f "EmulatorJS/data/cores/$name-thread-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-thread-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-thread-wasm.data $outputPath
fi
echo "Packing core information for $name"
cd $compileStartPath
if [ -f "EmulatorJS/data/cores/$name-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-wasm.data $outputPath
fi

if [ -f "EmulatorJS/data/cores/$name-legacy-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-legacy-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-legacy-wasm.data $outputPath
fi
if [ -f "EmulatorJS/data/cores/$name-thread-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-thread-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-thread-wasm.data $outputPath
fi

if [ -f "EmulatorJS/data/cores/$name-thread-legacy-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-thread-legacy-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-thread-legacy-wasm.data $outputPath
fi
if [ -f "EmulatorJS/data/cores/$name-legacy-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-legacy-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-legacy-wasm.data $outputPath
fi

# clean up to make sure the next build in the json gets the right license and core file
rm ./license.txt
rm ./core.json

# write report to report file
endTime=`date -u -Is`
reportString="{ \"core\": \"$name\", \"buildStart\": \"$startTime\", \"buildEnd\": \"$endTime\", \"options\": $options }"
buildReportFile="$buildReport/$name.json"
echo $reportString > $buildReportFile
if [ -f "EmulatorJS/data/cores/$name-thread-legacy-wasm.data" ]; then
7z a -t7z EmulatorJS/data/cores/$name-thread-legacy-wasm.data ./core.json ./license.txt ../build.json
cp EmulatorJS/data/cores/$name-thread-legacy-wasm.data $outputPath
fi

# clean up to make sure the next build in the json gets the right license and core file
rm ./license.txt
rm ./core.json

# write report to report file
endTime=`date -u -Is`
reportString="{ \"core\": \"$name\", \"buildStart\": \"$startTime\", \"buildEnd\": \"$endTime\", \"status\": $status, \"options\": $options }"
buildReportFile="$buildReport/$name.json"
echo $reportString > $buildReportFile

fi
done

# delete all compile files
Expand Down
12 changes: 8 additions & 4 deletions cores.json
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,8 @@
},
"options": {},
"license": "LICENSE",
"repo": "https://github.com/libretro/81-libretro"
"repo": "https://github.com/libretro/81-libretro",
"status": 2
},
{
"name": "fuse",
Expand All @@ -547,7 +548,8 @@
},
"options": {},
"license": "LICENSE",
"repo": "https://github.com/libretro/fuse-libretro"
"repo": "https://github.com/libretro/fuse-libretro",
"status": 2
},
{
"name": "cap32",
Expand All @@ -559,7 +561,8 @@
},
"options": {},
"license": "",
"repo": "https://github.com/libretro/libretro-cap32"
"repo": "https://github.com/libretro/libretro-cap32",
"status": 2
},
{
"name": "crocods",
Expand All @@ -571,6 +574,7 @@
},
"options": {},
"license": "LICENSE",
"repo": "https://github.com/libretro/libretro-crocods"
"repo": "https://github.com/libretro/libretro-crocods",
"status": 2
}
]