mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-06 22:24:12 -05:00
Add build test source file to tools dir & hello_world_chromebrew build test package (#9316)
* Add build test source file to tests Signed-off-by: Satadru Pramanik <satadru@gmail.com> * move file to tools Signed-off-by: Satadru Pramanik <satadru@gmail.com> * add descriptive header Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add hello_world_chromebrew package Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ac52769bad
commit
94699dea02
57
packages/hello_world_chromebrew.rb
Executable file
57
packages/hello_world_chromebrew.rb
Executable file
@@ -0,0 +1,57 @@
|
||||
require 'package'
|
||||
|
||||
class Hello_world_chromebrew < Package
|
||||
description 'Chromebrew Package Build Test (for use in PR Actions)'
|
||||
homepage 'https://github.com/chromebrew/chromebrew'
|
||||
version '1.0'
|
||||
license 'MIT' # Package license (eg. GPL-3, MIT, etc.)
|
||||
compatibility 'all' # Package architecture compatibility (eg. aarch64, armv7l, i686, x86_64 or all)
|
||||
source_url 'https://github.com/chromebrew/chromebrew/raw/master/tools/hello_world_chromebrew.c'
|
||||
source_sha256 'ff3632aba26639630ff8c1d91ebc168e185c2cb4fda8c856e61f33d53215aac3'
|
||||
binary_compression 'tar.zst'
|
||||
|
||||
# These are needed to successfully build and check for dependencies.
|
||||
binary_sha256({
|
||||
aarch64: '000',
|
||||
armv7l: '000',
|
||||
i686: '111',
|
||||
x86_64: '222'
|
||||
})
|
||||
|
||||
# Register dependencies (use the following line as a basis)
|
||||
#
|
||||
# Runtime dependencies:
|
||||
# depends_on '*' # R
|
||||
# Build dependencies:
|
||||
# depends_on '*' => :build
|
||||
#
|
||||
|
||||
# Function to perform patch operations prior to build from source.
|
||||
def self.patch
|
||||
system "sed -i 's/Hello Chromebrew/Hello, Chromebrew/' hello_world_chromebrew.c"
|
||||
end
|
||||
|
||||
# Function to perform pre-build operations prior to build from source.
|
||||
def self.prebuild; end
|
||||
|
||||
# Function to perform build from source.
|
||||
def self.build
|
||||
system 'gcc -o hello hello_world_chromebrew.c'
|
||||
end
|
||||
|
||||
# Function to perform check from source build.
|
||||
# This is executed only during `crew build`.
|
||||
def self.check
|
||||
system "#{CREW_PREFIX}/bin/hello"
|
||||
end
|
||||
|
||||
# Function to perform install from source build.
|
||||
def self.install
|
||||
FileUtils.install 'hello', "#{CREW_DEST_PREFIX}/bin/hello_chromebrew", mode: 0o755
|
||||
end
|
||||
|
||||
# Function to perform post-install for both source build and binary distribution
|
||||
def self.postinstall
|
||||
system "#{CREW_PREFIX}/bin/hello"
|
||||
end
|
||||
end
|
||||
8
tools/hello_world_chromebrew.c
Normal file
8
tools/hello_world_chromebrew.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* This file is used by the hello_world_chromebrew build test package.
|
||||
It should be kept in tools/hello_world_chromebrew.c
|
||||
*/
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
printf("Hello Chromebrew!");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user