Initial commit

This commit is contained in:
2026-02-18 14:58:42 +02:00
commit 053c13f88f
4 changed files with 76 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
cat > "$BPM_SOURCE"/src/gn/last_commit_position.h <<EOF
#ifndef OUT_LAST_COMMIT_POSITION_H_
#define OUT_LAST_COMMIT_POSITION_H_
#define LAST_COMMIT_POSITION_NUM 0
#define LAST_COMMIT_POSITION "0 (304bbef6c7e9a86630c12986b99c8654eb7fe648)"
#endif // OUT_LAST_COMMIT_POSITION_H_
EOF
"$BPM_SOURCE"/build/gen.py --no-last-commit-position --no-static-libstdc++ --no-strip --allow-warnings
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
ninja -C out
}
# The check function is executed in the source directory
# This function is used to run tests to verify the package has been compiled correctly
check() {
./out/gn_unittests
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
install -Dm644 out/gn "$BPM_OUTPUT"/usr/bin/gn
# Install documentation
install -Dm644 docs/* -t "$BPM_OUTPUT"/usr/share/doc/gn/
# Install vim plugins
install -d "$BPM_OUTPUT"/usr/share/vim/vimfiles
cp -r misc/vim/{autoload,ftdetect,ftplugin,syntax} -t "$BPM_OUTPUT"/usr/share/vim/vimfiles
# Install emacs plugin
install -Dm644 misc/emacs/gn-mode.el "$BPM_OUTPUT"/usr/share/emacs/site-lisp/gn-mode.el
# Install package license
install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/gn/LICENSE
}