Files
chromebrew/packages/js78.rb
Satadru Pramanik, DO, MPH, MEng e91463ec30 compiler rework (#8391)
* initial llvm16 rework

* update openmp

* start i686 builds

* fix getrealdeps grep with multiple exclusions

* fix crew conflicts handling _build packages, fix getrealdeps handling _build packages

* add more libs to gcc_lib

* update libssp

* add armv7 builds

* add builds

* suggested changes

* update rubocop
2023-06-15 10:22:41 -05:00

95 lines
4.1 KiB
Ruby

require 'package'
class Js78 < Package
description 'Spidermonkey is a javaScript interpreter with libraries from Mozilla — Version 78'
@_ver = '78.7.0'
version @_ver
license 'MPL-2.0'
compatibility 'all'
source_url "https://archive.mozilla.org/pub/firefox/releases/#{@_ver}esr/source/firefox-#{@_ver}esr.source.tar.xz"
source_sha256 '1aa041db28cd742e93d663a9da8defd33040b38d8b9470350538473251621643'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/js78/78.7.0_armv7l/js78-78.7.0-chromeos-armv7l.tar.xz',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/js78/78.7.0_armv7l/js78-78.7.0-chromeos-armv7l.tar.xz',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/js78/78.7.0_i686/js78-78.7.0-chromeos-i686.tar.xz',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/js78/78.7.0_x86_64/js78-78.7.0-chromeos-x86_64.tar.xz'
})
binary_sha256({
aarch64: 'bf8e6afa9277745bad6e9d4f16f86e4b5bb41357ef502c9776968d0a4ecbe008',
armv7l: 'bf8e6afa9277745bad6e9d4f16f86e4b5bb41357ef502c9776968d0a4ecbe008',
i686: '68e098b895ecd069ed0f2eb0fec321a03caded6cbc426daec7d2e63e8572f2e3',
x86_64: '4cb92c9bd6d44208816cf8bbfb6504795766544a509e06ee2f792a8c44d99beb'
})
depends_on 'autoconf213' => :build
depends_on 'rust' => :build
depends_on 'llvm16_dev' => :build
depends_on 'nspr'
@rust_default_host = case ARCH
when 'aarch64', 'armv7l'
'armv7-unknown-linux-gnueabihf'
else
"#{ARCH}-unknown-linux-gnu"
end
def self.patch
# Ubuntu patches
# http://changelogs.ubuntu.com/changelogs/pool/main/m/mozjs78/mozjs78_78.4.0-2/changelog
patch_url = 'http://archive.ubuntu.com/ubuntu/pool/main/m/mozjs78/mozjs78_78.4.0-2.debian.tar.xz'
patch_sha256 = 'dcf2eec86c275448656cf18b3c142c3a2067dc8fdeff029211b66182b9179d21'
system('curl -#L', patch_url, '-o', 'unzippatches.tar.xz')
abort 'Checksum mismatch :/ try again' unless Digest::SHA256.hexdigest(File.read('./unzippatches.tar.xz')) == patch_sha256
system('tar', '-xf', 'unzippatches.tar.xz')
system('for i in `cat debian/patches/series`; do patch -p 1 < debian/patches/$i; done')
# Arch Patches
patch2_url = 'https://github.com/archlinux/svntogit-packages/raw/packages/js78/trunk/0002-Bug-1667736-Update-packed_simd-to-compile-on-Rust-1..patch'
patch2_sha256 = 'ad3dd149651d76c1c3de2dc71d3fb3361181a1add75ff095df7bfba88a4e4ad6'
system('curl', '-Lf', patch2_url, '-o', '0002-Bug-1667736-Update-packed_simd-to-compile-on-Rust-1..patch')
abort 'Checksum mismatch :/ try again' unless Digest::SHA256.hexdigest(File.read('./0002-Bug-1667736-Update-packed_simd-to-compile-on-Rust-1..patch')) == patch2_sha256
system('patch -p 1 < ./0002-Bug-1667736-Update-packed_simd-to-compile-on-Rust-1..patch')
end
def self.build
FileUtils.mkdir_p 'obj'
Dir.chdir 'obj' do
system '../js/src/configure --help'
system "env CFLAGS='-stdlib=libc++ -flto=thin' \
RUSTFLAGS='-Clinker-plugin-lto' \
CXXFLAGS='-I#{CREW_PREFIX}/include/c++/v1/ -flto=thin'
CXX='clang++ -stdlib=libc++ -I#{CREW_PREFIX}/include/c++/v1/ -flto=thin' \
AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib \
LDFLAGS='-lreadline -ltinfo -flto=thin' \
../js/src/configure --prefix=#{CREW_PREFIX} \
--libdir=#{CREW_LIB_PREFIX} \
--disable-debug \
--disable-debug-symbols \
--disable-jemalloc \
--disable-strip \
--enable-hardening \
--enable-linker=lld \
--enable-optimize \
--enable-release \
--enable-lto \
--enable-shared-js \
--with-intl-api \
--with-system-zlib \
--without-system-icu \
--enable-rust-simd \
--with-system-nspr"
system 'make'
end
end
def self.install
Dir.chdir 'obj' do
system "make DESTDIR=#{CREW_DEST_DIR} install"
FileUtils.rm Dir.glob("#{CREW_DEST_LIB_PREFIX}/*.ajs")
end
end
end