Skip to content

Commit eefc758

Browse files
committed
Merge branches 'refactor/binstall', 'refactor/clean-extract', 'update/git', 'update/github-release', 'update/openssl', 'update/nethack', 'refactor/install.sh', 'refactor/xz-mt', 'update/binaries', 'fp/xproto', 'fp/libx11', 'update/sshfs-fuse', 'refactor/install.sh-var', 'update/perl', 'update/glib' and 'update/bc' into work
17 parents f31cd00 + 69067f0 + 64c4e14 + f225c85 + f2214d6 + 8a3e007 + e31c088 + 98a9dc5 + b80468d + 04a291e + 2989fe9 + c8e142c + 513c4f9 + 1e371e6 + 9aaeba6 + 93d896c + 7e1a319 commit eefc758

55 files changed

Lines changed: 867 additions & 26 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crew

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CREW_NOT_STRIP = ENV["CREW_NOT_STRIP"]
3636
# Set XZ_OPT environment variable for build command.
3737
# If CREW_XZ_OPT is defined, use it by default. Use `-7e`, otherwise.
3838
if ENV["CREW_XZ_OPT"].to_s == ''
39-
ENV["XZ_OPT"] = "-7e"
39+
ENV["XZ_OPT"] = "-7e -T #{CREW_NPROC}"
4040
else
4141
ENV["XZ_OPT"] = ENV["CREW_XZ_OPT"]
4242
end
@@ -188,6 +188,10 @@ def help (pkgName)
188188
puts "Build a package."
189189
puts "Usage: crew build [package]"
190190
puts "Build [package] from source and place the archive and checksum in the current working directory."
191+
when "binstall"
192+
puts "Build and install a package."
193+
puts "Usage: crew binstall [package]"
194+
puts "Build and install [package] from source and place the archive and checksum in the current working directory."
191195
when "download"
192196
puts "Download a package."
193197
puts "Usage: crew download [package]"
@@ -383,6 +387,7 @@ def unpack (meta)
383387
target_dir = nil
384388
Dir.chdir CREW_BREW_DIR do
385389
puts "Unpacking archive, this may take a while..."
390+
system "rm", "-rf", "#{extract_dir}"
386391
Dir.mkdir("#{extract_dir}") unless Dir.exist?("#{extract_dir}")
387392
if meta[:filename][-4,4] == ".zip"
388393
system "unzip", "-qq", "-d", "#{extract_dir}", meta[:filename]
@@ -640,6 +645,43 @@ def resolve_dependencies_and_build
640645
end
641646
end
642647

648+
def resolve_dependencies_and_build_and_install
649+
begin
650+
origin = @pkg.name
651+
652+
# mark current package as which is required to compile from source
653+
@pkg.build_from_source = true
654+
resolve_dependencies
655+
656+
search origin, true
657+
build_package Dir.pwd
658+
if @device[:installed_packages].any? { |pkg| pkg[:name] == @pkg.name }
659+
puts "Removing since forcing install..."
660+
remove @pkg.name
661+
end
662+
puts "Installing..."
663+
install_package CREW_DEST_DIR
664+
665+
#add to installed packages
666+
@device[:installed_packages].push(name: @pkg.name, version: @pkg.version)
667+
File.open(CREW_CONFIG_PATH + 'device.json', 'w') do |file|
668+
output = JSON.parse @device.to_json
669+
file.write JSON.pretty_generate(output)
670+
end
671+
puts "#{@pkg.name.capitalize} installed!"
672+
rescue InstallError => e
673+
abort "#{@pkg.name} failed to build: #{e.to_s}"
674+
ensure
675+
#cleanup
676+
unless ARGV[2] == 'keep'
677+
Dir.chdir CREW_BREW_DIR do
678+
system "rm -rf *"
679+
system "mkdir dest" #this is a little ugly, feel free to find a better way
680+
end
681+
end
682+
end
683+
end
684+
643685
def build_package (pwd)
644686
abort "It is not possible to build fake package".lightred if @pkg.is_fake?
645687
abort "It is not possible to build without source".lightred if !@pkg.is_source?(@device[:architecture])
@@ -774,6 +816,13 @@ when "build"
774816
else
775817
help "build"
776818
end
819+
when "binstall"
820+
if @pkgName
821+
search @pkgName
822+
resolve_dependencies_and_build_and_install
823+
else
824+
help "binstall"
825+
end
777826
when "remove"
778827
if @pkgName
779828
remove @pkgName

install.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ case "$architecture" in
2525
exit 1;;
2626
esac
2727

28-
#This will allow things to work without sudo
28+
# This will allow things to work without sudo
2929
sudo chown -R `id -u`:`id -g` /usr/local
3030

31+
# On chromiumos/cloudready there is unnecessary symbolic link, so remove it.
32+
if [ -L /usr/local/var ]; then sudo rm /usr/local/var; fi
33+
3134
#prepare directories
3235
for dir in $CREW_LIB_PATH $CREW_CONFIG_PATH $CREW_CONFIG_PATH/meta $CREW_BREW_DIR $CREW_DEST_DIR $CREW_PACKAGES_PATH; do
3336
mkdir -p $dir
@@ -182,3 +185,14 @@ echo crew >> .git/info/sparse-checkout
182185
git fetch origin master
183186
git reset --hard origin/master
184187
echo "Chromebrew installed successfully and package lists updated."
188+
189+
#check LD_LIBRARY_PATH on x86_64
190+
case "$architecture" in
191+
"x86_64")
192+
(echo $LD_LIBRARY_PATH | grep '/usr/local/lib[^6]\|/usr/local/lib$' > /dev/null) || cat << EOF
193+
194+
Several packages may install their libraries into $CREW_PREFIX/lib, so adding below to your ~/.bash_profile is recommended.
195+
export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib
196+
EOF
197+
;;
198+
esac

packages/applewmproto.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'package'
2+
3+
class Applewmproto < Package
4+
description 'The protocols for the X window system provide extended functionality for communication between a X client and the server.'
5+
homepage 'https://x.org'
6+
version '1.4.2'
7+
source_url 'https://www.x.org/archive/individual/proto/applewmproto-1.4.2.tar.gz'
8+
source_sha256 'ff8ac07d263a23357af2d6ff0cca3c1d56b043ddf7797a5a92ec624f4704df2e'
9+
10+
def self.build
11+
system "./configure"
12+
end
13+
14+
def self.install
15+
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
16+
end
17+
end

packages/bc.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Bc < Package
1010
depends_on 'readline'
1111
depends_on 'flex' => :build
1212
depends_on 'ed' => :build
13+
depends_on 'texinfo' => :build
1314

1415
def self.build
1516
system "./configure", "--with-readline"

packages/bigreqsproto.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'package'
2+
3+
class Bigreqsproto < Package
4+
description 'The protocols for the X window system provide extended functionality for communication between a X client and the server.'
5+
homepage 'https://x.org'
6+
version '1.1.2'
7+
source_url 'https://www.x.org/archive/individual/proto/bigreqsproto-1.1.2.tar.gz'
8+
source_sha256 'de68a1a9dd1a1219ad73531bff9f662bc62fcd777387549c43cd282399f4a6ea'
9+
10+
def self.build
11+
system "./configure"
12+
end
13+
14+
def self.install
15+
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
16+
end
17+
end

packages/compositeproto.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'package'
2+
3+
class Compositeproto < Package
4+
description 'The protocols for the X window system provide extended functionality for communication between a X client and the server.'
5+
homepage 'https://x.org'
6+
version '0.4'
7+
source_url 'https://www.x.org/archive/individual/proto/compositeproto-0.4.tar.gz'
8+
source_sha256 '1607f58409185203077de59801970b07a36f41e586a499918284c8d768d870cc'
9+
10+
def self.build
11+
system "./configure"
12+
end
13+
14+
def self.install
15+
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
16+
end
17+
end

packages/curl.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ class Curl < Package
66
version '7.54.1'
77
source_url 'https://curl.haxx.se/download/curl-7.54.1.tar.bz2'
88
source_sha256 'fdfc4df2d001ee0c44ec071186e770046249263c491fcae48df0e1a3ca8f25a0'
9+
binary_url ({
10+
aarch64: 'https://github.com/jam7/chrome-cross/releases/download/v1.8/curl-7.54.1-chromeos-armv7l.tar.xz',
11+
armv7l: 'https://github.com/jam7/chrome-cross/releases/download/v1.8/curl-7.54.1-chromeos-armv7l.tar.xz',
12+
i686: 'https://github.com/jam7/chrome-cross/releases/download/v1.8/curl-7.54.1-chromeos-i686.tar.xz',
13+
x86_64: 'https://github.com/jam7/chrome-cross/releases/download/v1.8/curl-7.54.1-chromeos-x86_64.tar.xz',
14+
})
15+
binary_sha256 ({
16+
aarch64: 'a4e20f96eb21adf6acfcacffa5ea6cf30765e3146cb6326660a1e1a40c25381f',
17+
armv7l: 'a4e20f96eb21adf6acfcacffa5ea6cf30765e3146cb6326660a1e1a40c25381f',
18+
i686: 'e25ef8822c7d5d2a58ef22f7130c348e152e6cec4a6a0512ad4a38a31ef1d07c',
19+
x86_64: '9840d2be7063109cc854296db2bfde63b6777d50016f50a5fb029bb6c685f0bd',
20+
})
921

1022
depends_on 'openssl' => :build
1123
depends_on 'zlibpkg' => :build

packages/damageproto.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'package'
2+
3+
class Damageproto < Package
4+
description 'The protocols for the X window system provide extended functionality for communication between a X client and the server.'
5+
homepage 'https://x.org'
6+
version '1.2.1'
7+
source_url 'https://www.x.org/archive/individual/proto/damageproto-1.2.1.tar.gz'
8+
source_sha256 'f65ccbf1de9750a527ea6e85694085b179f2d06495cbdb742b3edb2149fef303'
9+
10+
def self.build
11+
system "./configure"
12+
end
13+
14+
def self.install
15+
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
16+
end
17+
end

packages/dmxproto.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'package'
2+
3+
class Dmxproto < Package
4+
description 'The protocols for the X window system provide extended functionality for communication between a X client and the server.'
5+
homepage 'https://x.org'
6+
version '2.3'
7+
source_url 'https://www.x.org/archive/individual/proto/dmxproto-2.3.tar.gz'
8+
source_sha256 'a911a086a61c1bb16d35f70b391f167744ee721b5e2a7f22c00bc5a2c1ecb242'
9+
10+
def self.build
11+
system "./configure"
12+
end
13+
14+
def self.install
15+
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
16+
end
17+
end

packages/dri2proto.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'package'
2+
3+
class Dri2proto < Package
4+
description 'The protocols for the X window system provide extended functionality for communication between a X client and the server.'
5+
homepage 'https://x.org'
6+
version '2.8'
7+
source_url 'https://www.x.org/archive/individual/proto/dri2proto-2.8.tar.gz'
8+
source_sha256 '7e65b031eaa6ebe23c75583d4abd993ded7add8009b4200a4db7aa10728b0f61'
9+
10+
def self.build
11+
system "./configure"
12+
end
13+
14+
def self.install
15+
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
16+
end
17+
end

0 commit comments

Comments
 (0)