crew: Add cflags for armv7l, add some CREW_ constants (#7585)

* Add armv7l cflags and CREW_KERNEL_VERSION const

* Adjust package code which uses kernel version

* rework logic

* adjust logic

* debugging

* add CREW_IN_CONTAINER

* Use CREW_IN_CONTAINER in packages.

* Add CREW_IS_AMD and CREW_IS_INTEL

* suggested changes

* test new cpu logic

* cleanup cpu logic

* add CREW_CPU_VENDOR

* fix cpu detection on x86

* lint

* fix package dynamic versioning

* lint changes

* update for non-x86, and make linuxheaders a one-shot deal

* add 5.10 x86_64 binaries for linuxheaders

* lint

* suggested changes

* fix musl_linuxheaders

* show container info in sysinfo

* Use CREW_KERNEL_VERSION

* add markdown interpretation code

* refactor markdown code

* modify issue template to get markdown code for crew sysinfo

* attempt to change the issue template to the newer github yaml format

* move issue template to yaml file

* update Linters logic

* lint crew

* update linter.rb too

* bump linter.rb version
This commit is contained in:
Satadru Pramanik
2022-11-08 17:18:09 -05:00
committed by GitHub
parent 246d632a91
commit 47838138db
15 changed files with 244 additions and 182 deletions

View File

@@ -1,41 +0,0 @@
<!--
## Before you submit an issue
Please look up our issues, maybe your problem was mentioned before.
-->
## Description
<!-- Provide a short description of your problem here. -->
If you executed a specific command:
```shell
# your command here
```
Output:
```
# output of your command here
```
## Versions and system information
<!--
Paste the output of `crew sysinfo` between two `***` below
*If `crew sysinfo` does not work, use `cat /etc/lsb-release` instead.
-->
***
***
## Additional information
<!--
Mention things we might need to know. Like:
What I think needs to be done:
- [ ] step one
- [ ] step two
-->
<!--
## That's it
Thank you for submitting your issue.
When done, please delete the parts of this template which you don't need or these, which are only for guidance.
-->

64
.github/ISSUE_TEMPLATE.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
---
name: 🐞 Bug
description: File a bug/issue
title: "[BUG] <title>"
labels: [Bug, Needs Triage]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Description
description: A concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. I executed this command:
```shell
# your command here
```
Output:
```
# output of your command
```
render: markdown
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
Paste the output of `crew sysinfo -v` between two `***` below
value: |
***
***
render: markdown
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
What I think needs to be done:
- [ ] step one
- [ ] step two
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
render: markdown
validations:
required: false

View File

@@ -26,31 +26,33 @@ jobs:
ruby=
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
ext="${file##*.}"
type="$(file -b $file | cut -d' ' -f1)"
case $type in
Bourne-Again)
ext="sh"
;;
HTML)
ext="md"
;;
Ruby)
ext="rb"
;;
esac
if ! [[ "$ext" =~ ^(md|rb|sh|yml|yaml)$ ]]; then
type="$(file -b "$file" | cut -d' ' -f1)"
case $type in
Bourne-Again)
ext="sh"
;;
HTML)
ext="md"
;;
Ruby)
ext="rb"
;;
esac
fi
case $ext in
md)
mdl $file
mdl "$file"
;;
rb)
ruby=true
ruby -wcWlevel=2 $file
ruby -wcWlevel=2 "$file"
;;
sh)
shellcheck $file
shellcheck "$file"
;;
yml|yaml)
yaml-lint $file
yaml-lint "$file"
;;
*)
echo "Unable to check syntax of $file."

View File

@@ -298,7 +298,7 @@ def generate_compatible
end
if @pkg.compatible? && @compatibility
# add to compatible packages
puts "Adding #{pkgName} to compatible packages.".lightgreen if @opt_verbose
puts "Adding #{pkgName} #{@pkg.version} to compatible packages.".lightgreen if @opt_verbose
@device[:compatible_packages].push(name: @pkg.name)
elsif @opt_verbose
puts "#{pkgName} is not a compatible package.".lightred
@@ -439,7 +439,8 @@ def help(pkgName)
EOT
when 'sysinfo'
puts <<~EOT
Show system infomation in Markdown style.
Show system infomation.
If `-v` or `--verbose` is present, show system infomation with raw Markdown.
Usage: crew sysinfo
EOT
@@ -1820,13 +1821,16 @@ def sysinfo_command(_args)
git_commit_message_format = '%h `%s (%cr)`'
puts <<~MD
@sysinfo_markdown_header = <<~MDHEADER
<details><summary>Expand</summary>
MDHEADER
@sysinfo_markdown_body = <<~MDBODY
- Architecture: `#{KERN_ARCH}` (`#{ARCH}`)
- Processor vendor: `#{CPUINFO['vendor_id'] || 'ARM'}`
- User space: `#{Dir.exist?('/lib64') ? '64' : '32'}-bit`
- Kernel version: `#{`uname -r`.chomp}`
- Chromebrew Kernel version: `#{CREW_KERNEL_VERSION}`
- Chromebrew Running in Container: `#{CREW_IN_CONTAINER}`
- Chromebrew version: `#{CREW_VERSION}`
- Chromebrew prefix: `#{CREW_PREFIX}`
@@ -1837,9 +1841,18 @@ def sysinfo_command(_args)
- OS variant: `#{lsb_release['CHROMEOS_RELEASE_NAME']}`
- OS version: `#{lsb_release['CHROMEOS_RELEASE_BUILDER_PATH']}`
- OS channel: `#{lsb_release['CHROMEOS_RELEASE_TRACK']}`
MDBODY
@sysinfo_markdown_footer = <<~MDFOOTER
</details>
MD
MDFOOTER
if @opt_verbose
puts @sysinfo_markdown_header
puts @sysinfo_markdown_body
puts @sysinfo_markdown_footer
else
puts @sysinfo_markdown_body.gsub('`', '')
end
end
def update_command(args)

View File

@@ -1,6 +1,6 @@
# Defines common constants used in different parts of crew
CREW_VERSION = '1.28.0'
CREW_VERSION = '1.28.1'
# kernel architecture
KERN_ARCH = `uname -m`.chomp
@@ -57,6 +57,27 @@ else
HOME = CREW_PREFIX + Dir.home
end
CREW_IN_CONTAINER = File.exist?('/.dockerenv') || !ENV['CREW_IN_CONTAINER'].to_s.empty?
CREW_CPU_VENDOR = CPUINFO['vendor_id'] || 'unknown'
# vendor_id may not exist on non-x86 platforms.
CREW_IS_AMD = ARCH == 'x86_64' ? CPUINFO['vendor_id'].include?('AuthenticAMD') : false
CREW_IS_INTEL = ARCH == 'x86_64' || ARCH == 'i686' ? CPUINFO['vendor_id'].include?('GenuineIntel') : false
# Use sane minimal defaults if in container and no override specified.
if CREW_IN_CONTAINER && ENV['CREW_KERNEL_VERSION'].to_s.empty?
case ARCH
when 'i686'
CREW_KERNEL_VERSION = '3.8'
when 'aarch64', 'armv7l'
CREW_KERNEL_VERSION = '4.14'
when 'x86_64'
CREW_KERNEL_VERSION = '4.14'
end
else
CREW_KERNEL_VERSION = ENV.fetch('CREW_KERNEL_VERSION', `uname -r`.rpartition('.')[0])
end
CREW_LIB_PREFIX = "#{CREW_PREFIX}/#{ARCH_LIB}"
CREW_MAN_PREFIX = "#{CREW_PREFIX}/share/man"
CREW_LIB_PATH = "#{CREW_PREFIX}/lib/crew/"
@@ -151,12 +172,17 @@ case ARCH
when 'aarch64', 'armv7l'
CREW_TGT = 'armv7l-cros-linux-gnueabihf'
CREW_BUILD = 'armv7l-cros-linux-gnueabihf'
# These settings have been selected to match debian armhf.
# Using -mfpu=neon breaks builds such as webkit2gtk.
CREW_ARCH_FLAGS = '-mfloat-abi=hard -mtls-dialect=gnu -mthumb -mfpu=vfpv3-d16 -mlibarch=armv7-a+fp -march=armv7-a+fp'
when 'i686'
CREW_TGT = 'i686-cros-linux-gnu'
CREW_BUILD = 'i686-cros-linux-gnu'
CREW_ARCH_FLAGS = ''
when 'x86_64'
CREW_TGT = 'x86_64-cros-linux-gnu'
CREW_BUILD = 'x86_64-cros-linux-gnu'
CREW_ARCH_FLAGS = ''
end
CREW_LINKER = if ENV['CREW_LINKER'].to_s.empty?
@@ -166,7 +192,7 @@ CREW_LINKER = if ENV['CREW_LINKER'].to_s.empty?
end
CREW_LINKER_FLAGS = ENV.fetch('CREW_LINKER_FLAGS', nil)
CREW_CORE_FLAGS = "-O2 -pipe -ffat-lto-objects -fPIC -fuse-ld=#{CREW_LINKER} #{CREW_LINKER_FLAGS}"
CREW_CORE_FLAGS = "-O2 -pipe -ffat-lto-objects -fPIC #{CREW_ARCH_FLAGS} -fuse-ld=#{CREW_LINKER} #{CREW_LINKER_FLAGS}"
CREW_COMMON_FLAGS = "#{CREW_CORE_FLAGS} -flto"
CREW_COMMON_FNO_LTO_FLAGS = "#{CREW_CORE_FLAGS} -fno-lto"
CREW_LDFLAGS = "-flto #{CREW_LINKER_FLAGS}"

View File

@@ -28,6 +28,11 @@ class Package
class << self
attr_accessor :name, :cached_build, :in_build, :build_from_source,
:in_upgrade
# Via https://stackoverflow.com/questions/7849521/set-attribute-dynamically-of-ruby-object/39063481#39063481
def set_property(name, value)
prop_name = "@#{name}".to_sym # you need the property name, prefixed with a '@', as a symbol
instance_variable_set(prop_name, value)
end
end
def self.load_package(pkgFile, pkgName = File.basename(pkgFile, '.rb'))

View File

@@ -41,7 +41,7 @@ class Ffmpeg < Package
depends_on 'freetype' # R
depends_on 'fribidi' # R
depends_on 'gsm' # R
depends_on 'intel_media_sdk' if ARCH == 'x86_64' && `grep -c 'GenuineIntel' /proc/cpuinfo`.to_i.positive? # R
depends_on 'intel_media_sdk' if ARCH == 'x86_64' && CREW_IS_INTEL # R
depends_on 'jack' # R
depends_on 'libaom' # R
depends_on 'libass' # R
@@ -53,7 +53,7 @@ class Ffmpeg < Package
depends_on 'libfdk_aac' # R
depends_on 'libiec61883' # R
depends_on 'libjpeg' # R
depends_on 'libmfx' if ARCH == 'i686' && `grep -c 'GenuineIntel' /proc/cpuinfo`.to_i.positive? # R
depends_on 'libmfx' if ARCH == 'i686' && CREW_IS_INTEL # R
depends_on 'libmodplug' # R
depends_on 'libmp3lame' # R
depends_on 'libopencoreamr' # R

View File

@@ -69,7 +69,7 @@ class Icu4c < Package
def self.postinstall
# Check for packages that expect an older icu library, but not in a container, since we have already
# checked all obvious packages there.
return if File.exist?('/.dockerenv')
return if CREW_IN_CONTAINER
Dir.chdir CREW_LIB_PREFIX do
@oldicuver.each do |oldver|

View File

@@ -23,7 +23,7 @@ class Intel_media_driver < Package
depends_on 'libva'
# def self.preflight
# abort 'Not an Intel processor, aborting.'.lightred unless `grep -c 'GenuineIntel' /proc/cpuinfo`.to_i.positive?
# abort 'Not an Intel processor, aborting.'.lightred unless CREW_IS_INTEL
# end
def self.build

View File

@@ -53,7 +53,7 @@ class Libcap < Package
def self.check
# Tests do not work in a Docker container.
return if File.exist?('/.dockerenv')
return if CREW_IN_CONTAINER
system 'make', 'test'
end

View File

@@ -3,7 +3,7 @@ require 'package'
class Linter < Package
description 'Comprehensive linter and code analysis for various file types.'
homepage 'https://github.com/chromebrew/chromebrew'
version '1.1'
version '1.2'
license 'GPL-3'
compatibility 'all'
source_url 'SKIP'
@@ -27,24 +27,26 @@ class Linter < Package
fi
for file in $files; do
ext="${file##*.}"
type=$(file -b "$file" | cut -d' ' -f1)
case "$type" in
Bourne-Again)
ext="sh"
;;
HTML)
ext="md"
;;
Ruby)
ext="rb"
;;
esac
case "$ext" in
if ! [[ "$ext" =~ ^(md|rb|sh|yml|yaml)$ ]]; then
type="$(file -b "$file" | cut -d' ' -f1)"
case $type in
Bourne-Again)
ext="sh"
;;
HTML)
ext="md"
;;
Ruby)
ext="rb"
;;
esac
fi
case $ext in
md)
mdl "$file"
;;
rb)
ruby -wcWlevel=2 "$file"
ruby=true
rubocop "$file"
;;
sh)

View File

@@ -3,24 +3,12 @@ require 'package'
class Linux_sources < Package
description 'Sources for the Linux kernel'
homepage 'https://kernel.org/'
case ARCH
when 'aarch64', 'armv7l', 'x86_64'
@_ver = '4.14'
version "#{@_ver}-1"
when 'i686'
@_ver = '3.8'
version @_ver
end
# Only check for kernel version if not in container.
unless File.exist?('/.dockerenv')
@KERNEL_VERSION = `uname -r`.chomp.reverse.split('.', 2).collect(&:reverse)[1]
@ver = @KERNEL_VERSION.between?(@KERNEL_VERSION, '5.15') ? @ver : @KERNEL_VERSION
version @ver
end
@version = CREW_KERNEL_VERSION == '4.14' ? "#{CREW_KERNEL_VERSION}-1" : CREW_KERNEL_VERSION
set_property('version', @version)
license 'GPL-2'
compatibility 'all'
source_url 'https://chromium.googlesource.com/chromiumos/third_party/kernel.git'
git_hashtag "chromeos-#{@_ver}"
git_hashtag "chromeos-#{CREW_KERNEL_VERSION}"
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14-1_armv7l/linux_sources-4.14-1-chromeos-armv7l.tpxz',
@@ -35,15 +23,20 @@ class Linux_sources < Package
x86_64: '5dc236576f40cbf6926b4b5f9241ed7e9e3e7db8f2b26643316a2ce1f08a4a02'
})
no_env_options
no_fhs
def self.install
ENV['CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY'] = '1'
reload_constants
linux_src_dir = "#{CREW_DEST_PREFIX}/src/linux"
FileUtils.mkdir_p(linux_src_dir)
# make fails if it detects gold linker.
FileUtils.mkdir_p("#{linux_src_dir}/crew_bin")
FileUtils.ln_sf "#{CREW_PREFIX}/bin/ld.bfd", "#{linux_src_dir}/crew_bin/ld"
FileUtils.rm_rf('.git')
FileUtils.cp_r('.', linux_src_dir)
Dir.chdir(linux_src_dir) do
system 'make', 'defconfig'
system "PATH=#{linux_src_dir}/crew_bin:$PATH make defconfig"
end
FileUtils.rm_f "#{linux_src_dir}/crew_bin"
end
end

View File

@@ -3,49 +3,51 @@ require 'package'
class Linuxheaders < Package
description 'Linux headers for Chrome OS.'
homepage 'https://kernel.org/'
# KERNEL_VERSION = %x[uname -r].chomp.reverse.split('.',2).collect(&:reverse)[1]
case ARCH
when 'aarch64', 'armv7l', 'x86_64'
@_ver = '4.14'
version "#{@_ver}-1"
when 'i686'
@_ver = '3.8'
version @_ver
end
# Only check for kernel version if not in container.
unless File.exist?('/.dockerenv')
@KERNEL_VERSION = `uname -r`.chomp.reverse.split('.', 2).collect(&:reverse)[1]
@ver = @KERNEL_VERSION.between?(@KERNEL_VERSION, '5.15') ? @ver : @KERNEL_VERSION
version @ver
end
@version = CREW_KERNEL_VERSION == '4.14' ? "#{CREW_KERNEL_VERSION}-1" : CREW_KERNEL_VERSION
set_property('version', @version)
license 'GPL-2'
compatibility 'all'
source_url 'SKIP'
source_url 'https://chromium.googlesource.com/chromiumos/third_party/kernel.git'
git_hashtag "chromeos-#{CREW_KERNEL_VERSION}"
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_armv7l/linuxheaders-4.14-1-chromeos-armv7l.tpxz',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_armv7l/linuxheaders-4.14-1-chromeos-armv7l.tpxz',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/3.8_i686/linuxheaders-3.8-chromeos-i686.tpxz',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_x86_64/linuxheaders-4.14-1-chromeos-x86_64.tpxz'
})
binary_sha256({
aarch64: '75f253ac2cf0dd785ea8d9cdf9430d23d601ccc372e9f7afa95523a28273a340',
armv7l: '75f253ac2cf0dd785ea8d9cdf9430d23d601ccc372e9f7afa95523a28273a340',
i686: 'c16afcd95ebcffac67a026b724da19f498003ea80c13c87aeb613f09d412bb91',
x86_64: '5d58b327ca9bab5630f0df387a3036125e1f367e6c43cd551f4734ee3e634073'
})
case CREW_KERNEL_VERSION
when '3.8'
binary_url({
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/3.8_i686/linuxheaders-3.8-chromeos-i686.tpxz'
})
binary_sha256({
i686: 'c16afcd95ebcffac67a026b724da19f498003ea80c13c87aeb613f09d412bb91'
})
when '4.14'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_armv7l/linuxheaders-4.14-1-chromeos-armv7l.tpxz',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_armv7l/linuxheaders-4.14-1-chromeos-armv7l.tpxz',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_x86_64/linuxheaders-4.14-1-chromeos-x86_64.tpxz'
})
binary_sha256({
aarch64: '75f253ac2cf0dd785ea8d9cdf9430d23d601ccc372e9f7afa95523a28273a340',
armv7l: '75f253ac2cf0dd785ea8d9cdf9430d23d601ccc372e9f7afa95523a28273a340',
x86_64: '5d58b327ca9bab5630f0df387a3036125e1f367e6c43cd551f4734ee3e634073'
})
when '5.10'
binary_url({
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/5.10_x86_64/linuxheaders-5.10-chromeos-x86_64.tar.zst'
})
binary_sha256({
x86_64: '797e7a8369f613b50b049b2352f82d5842a2c9ae766d6d5b1165b90a528ac139'
})
end
depends_on 'linux_sources' => :build
no_env_options
no_fhs
def self.install
ENV['CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY'] = '1'
reload_constants
linux_src_dir = "#{CREW_PREFIX}/src/linux"
Dir.chdir(linux_src_dir) do
system 'make',
'headers_install',
"INSTALL_HDR_PATH=#{CREW_DEST_PREFIX}"
end
# make fails if it detects gold linker.
FileUtils.mkdir_p('crew_bin')
@workdir = Dir.pwd
FileUtils.ln_sf "#{CREW_PREFIX}/bin/ld.bfd", "#{@workdir}/crew_bin/ld"
system "PATH=#{@workdir}/crew_bin:$PATH make defconfig"
system "PATH=#{@workdir}/crew_bin:$PATH make headers_install INSTALL_HDR_PATH=#{CREW_DEST_PREFIX}"
Dir.chdir("#{CREW_DEST_PREFIX}/include") do
system "for file in \$(find . -not -type d -name '.*'); do
rm \${file};

View File

@@ -3,48 +3,50 @@ require 'package'
class Musl_linuxheaders < Package
description 'Linux headers for Chrome OS, installed into MUSL_PREFIX.'
homepage 'https://kernel.org/'
case ARCH
when 'aarch64', 'armv7l', 'x86_64'
@_ver = '4.14'
version @_ver
when 'i686'
@_ver = '3.8'
version @_ver
end
# Only check for kernel version if not in container.
unless File.exist?('/.dockerenv')
@KERNEL_VERSION = `uname -r`.chomp.reverse.split('.', 2).collect(&:reverse)[1]
@ver = @KERNEL_VERSION.between?(@KERNEL_VERSION, '5.15') ? @ver : @KERNEL_VERSION
version @ver
end
version CREW_KERNEL_VERSION
license 'GPL-2'
compatibility 'all'
source_url 'SKIP'
source_url 'https://chromium.googlesource.com/chromiumos/third_party/kernel.git'
git_hashtag "chromeos-#{CREW_KERNEL_VERSION}"
binary_url({
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/3.8_i686/musl_linuxheaders-3.8-chromeos-i686.tpxz',
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/4.14_armv7l/musl_linuxheaders-4.14-chromeos-armv7l.tpxz',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/4.14_armv7l/musl_linuxheaders-4.14-chromeos-armv7l.tpxz',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/4.14_x86_64/musl_linuxheaders-4.14-chromeos-x86_64.tpxz'
})
binary_sha256({
i686: '92c0794189e3631847293ae517b4e0a7bc41e9898433d514f46391b5807369cd',
aarch64: '0673fa9ca73c10b60d4109dacc349247f98b5ea616110650a9f2917a281d780a',
armv7l: '0673fa9ca73c10b60d4109dacc349247f98b5ea616110650a9f2917a281d780a',
x86_64: '8cb5a33d005cae9be24d2491d20b855c9561853f89f974159094bb66ef41b02f'
})
case CREW_KERNEL_VERSION
when '3.8'
binary_url({
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/3.8_i686/musl_linuxheaders-3.8-chromeos-i686.tpxz'
})
binary_sha256({
i686: '92c0794189e3631847293ae517b4e0a7bc41e9898433d514f46391b5807369cd'
})
when '4.14'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/4.14_armv7l/musl_linuxheaders-4.14-chromeos-armv7l.tpxz',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/4.14_armv7l/musl_linuxheaders-4.14-chromeos-armv7l.tpxz',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/4.14_x86_64/musl_linuxheaders-4.14-chromeos-x86_64.tpxz'
})
binary_sha256({
aarch64: '0673fa9ca73c10b60d4109dacc349247f98b5ea616110650a9f2917a281d780a',
armv7l: '0673fa9ca73c10b60d4109dacc349247f98b5ea616110650a9f2917a281d780a',
x86_64: '8cb5a33d005cae9be24d2491d20b855c9561853f89f974159094bb66ef41b02f'
})
when '5.10'
binary_url({
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/musl_linuxheaders/5.10_x86_64/musl_linuxheaders-5.10-chromeos-x86_64.tar.zst'
})
binary_sha256({
x86_64: '4492e6a1a52b9ca39f11c9d68869761a3698c8d65bea501f57ad514298b9d182'
})
end
depends_on 'linux_sources' => :build
no_env_options
no_fhs
def self.install
ENV['CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY'] = '1'
reload_constants
linux_src_dir = "#{CREW_PREFIX}/src/linux"
Dir.chdir(linux_src_dir) do
system 'make',
'headers_install',
"INSTALL_HDR_PATH=#{CREW_DEST_MUSL_PREFIX}"
end
# make fails if it detects gold linker.
FileUtils.mkdir_p('crew_bin')
@workdir = Dir.pwd
FileUtils.ln_sf "#{CREW_PREFIX}/bin/ld.bfd", "#{@workdir}/crew_bin/ld"
system "PATH=#{@workdir}/crew_bin:$PATH make defconfig"
system "PATH=#{@workdir}/crew_bin:$PATH make headers_install INSTALL_HDR_PATH=#{CREW_DEST_MUSL_PREFIX}"
Dir.chdir("#{CREW_DEST_MUSL_PREFIX}/include") do
system "for file in \$(find . -not -type d -name '.*'); do
rm \${file};

View File

@@ -43,13 +43,7 @@ class Sommelier < Package
depends_on 'glibc' # R
def self.preflight
case ARCH
when 'armv7l', 'aarch64'
@container_check = File.exist?('/.dockerenv')
when 'i686', 'x86_64'
@container_check = `/usr/bin/crossystem inside_vm` == '1'
end
return if File.socket?('/var/run/chrome/wayland-0') || @container_check
return if File.socket?('/var/run/chrome/wayland-0') || CREW_IN_CONTAINER
abort 'This package is not compatible with your device :/'.lightred
end