Commit 7a099921 authored by satmandu's avatar satmandu Committed by GitHub

Crew update (#5640)

* enable git branch

* Add verbose testing text.

* add gemacs for testing

* Add gemacs dep rebuilds for newer perl

* speed up file conflicts algorithm with grep

* Fixup conflict files output

* revert perl package changes

* switch gemacs back to existing version and rework git_branch logic

* rubify gemacs

* make requested change

* Add checking message.
parent 184c4ea7
......@@ -454,6 +454,7 @@ def update
#update package lists
Dir.chdir CREW_LIB_PATH do
if @crew_testing == '1'
puts "Updating crew from testing repository..."
system "git remote add testing #{@crew_testing_repo} 2>/dev/null || \
git remote set-url testing #{@crew_testing_repo}"
system "git fetch testing #{@crew_testing_branch}"
......@@ -623,8 +624,16 @@ def download
system 'git config advice.detachedHead false'
system 'git config init.defaultBranch master'
system "git remote add origin #{@pkg.source_url}", exception: true
system "git fetch --depth 1 origin #{@pkg.git_hashtag}", exception: true
system 'git checkout FETCH_HEAD'
unless @pkg.git_branch.nil? || @pkg.git_branch.empty?
# Leave a message because this step can be slow.
puts "Downloading src from a git branch. This may take a while..."
system "git remote set-branches origin #{@pkg.git_branch}", exception: true
system "git fetch --progress origin #{@pkg.git_branch}", exception: true
system "git checkout #{@pkg.git_hashtag}", exception: true
else
system "git fetch --depth 1 origin #{@pkg.git_hashtag}", exception: true
system 'git checkout FETCH_HEAD'
end
system 'git submodule update --init --recursive'
puts "Repository downloaded".lightgreen
end
......@@ -756,17 +765,13 @@ def prepare_package (destdir)
system 'cut -c2- ../filelist > filelist'
# check for conflicts with other installed files
puts "Checking for conflicts with files from installed packages.".lightgreen
conflicts = []
Dir[CREW_META_PATH + '*.filelist'].each do |packageList|
packageName = File.basename packageList, '.filelist'
File.readlines(packageList).each do |line|
File.readlines('filelist').each do |item|
if line == item && packageName != @pkg.name
conflicts << [packageName, item.chomp]
end
end
end
end
@conflictscmd = "grep --exclude #{CREW_META_PATH}#{@pkg.name}.filelist \
-Fxf filelist #{CREW_META_PATH}*.filelist | tr ':' ' ' | \
sed 's,.filelist,,g' | sed 's,#{CREW_META_PATH},,g'"
conflicts << %x[#{@conflictscmd}].chomp.split(" ")
conflicts.reject!(&:empty?)
unless conflicts.empty?
puts "Unable to complete this build since there is a conflict with the same file in another package.".lightred
pp = ''
......
# Defines common constants used in different parts of crew
CREW_VERSION = '1.8.7'
CREW_VERSION = '1.8.8'
ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines
......
require 'package_helpers'
class Package
property :description, :homepage, :version, :license, :compatibility, :binary_url, :binary_sha256, :source_url, :source_sha256, :git_hashtag, :is_fake
property :description, :homepage, :version, :license, :compatibility, :binary_url, :binary_sha256, :source_url, :source_sha256, :git_branch, :git_hashtag, :is_fake
class << self
attr_reader :is_fake
......
......@@ -7,8 +7,9 @@ class Gemacs < Package
version "#{@_ver}-7a7b"
license 'GPL-3+, FDL-1.3+, BSD, HPND, MIT, W3C, unicode, PSF-2'
compatibility 'all'
source_url 'file:///dev/null'
source_sha256 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
source_url 'https://git.savannah.gnu.org/git/emacs.git'
git_branch 'feature/pgtk'
git_hashtag '7a7bc15242896b20c7af49f77f0e22c3d78e4d88'
binary_url({
aarch64: 'https://downloads.sourceforge.net/project/chromebrew/armv7l/gemacs-28.0.50.1-7a7b-chromeos-armv7l.tar.xz',
......@@ -25,6 +26,7 @@ class Gemacs < Package
depends_on 'alsa_lib'
depends_on 'cairo'
depends_on 'freetype' => :build
depends_on 'giflib'
depends_on 'gpm'
depends_on 'gtk3'
......@@ -38,56 +40,35 @@ class Gemacs < Package
depends_on 'texinfo'
depends_on 'webkit2gtk'
def self.prebuild
@git_dir = 'emacs_git'
@git_branch = 'feature/pgtk'
@git_hash = '7a7bc15242896b20c7af49f77f0e22c3d78e4d88'
@git_url = 'https://git.savannah.gnu.org/git/emacs.git'
FileUtils.rm_rf(@git_dir)
FileUtils.mkdir_p(@git_dir)
Dir.chdir @git_dir do
system 'git init'
system "git remote add origin #{@git_url}"
system "git remote set-branches origin '#{@git_branch}'"
system "git fetch --depth 1 origin #{@git_hash}"
system 'git checkout FETCH_HEAD'
end
end
def self.build
Dir.chdir 'emacs_git' do
system 'NOCONFIGURE=1 ./autogen.sh'
system "env CFLAGS='-pipe -fuse-ld=gold -flto=auto' CXXFLAGS='-pipe -fuse-ld=gold -flto=auto' \
LDFLAGS='-flto=auto' \
./configure \
--enable-link-time-optimization \
--localstatedir=#{CREW_PREFIX}/share \
--prefix=#{CREW_PREFIX} \
--with-cairo \
--with-gif=ifavailable \
--with-jpeg=yes \
--with-modules \
--with-native-compilation \
--without-gconf \
--without-gsettings \
--without-selinux \
--without-x \
--with-pgtk \
--with-png=yes \
--with-rsvg=yes \
--with-sound=alsa \
--with-tiff=ifavailable \
--with-x-toolkit=gtk3 \
--with-xwidgets"
system 'make'
end
system 'NOCONFIGURE=1 ./autogen.sh'
system "env #{CREW_ENV_OPTIONS} \
./configure \
--enable-link-time-optimization \
--localstatedir=#{CREW_PREFIX}/share \
--prefix=#{CREW_PREFIX} \
--with-cairo \
--with-gif=ifavailable \
--with-jpeg=yes \
--with-modules \
--with-native-compilation \
--without-gconf \
--without-gsettings \
--without-selinux \
--without-x \
--with-pgtk \
--with-png=yes \
--with-rsvg=yes \
--with-sound=alsa \
--with-tiff=ifavailable \
--with-x-toolkit=gtk3 \
--with-xwidgets"
system 'make'
end
def self.install
Dir.chdir 'emacs_git' do
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
system "install -Dm755 src/emacs #{CREW_DEST_PREFIX}/bin/gemacs"
system "install -Dm755 src/emacs-#{@_ver} #{CREW_DEST_PREFIX}/bin/gemacs-#{@_ver}"
end
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
FileUtils.install 'src/emacs', "#{CREW_DEST_PREFIX}/bin/gemacs", mode: 0o755
FileUtils.install "src/emacs-#{@_ver}", "#{CREW_DEST_PREFIX}/bin/gemacs-#{@_ver}", mode: 0o755
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment