Skip to content

Commit

Permalink
Merge pull request #3 from danielnachun/1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sjackman authored Aug 22, 2022
2 parents 1bfe5fe + 753eca8 commit d0ee6c3
Show file tree
Hide file tree
Showing 18 changed files with 276 additions and 99 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Build bootstrap binaries for glibc on Linux

# FILL in

on:
pull_request:
paths:
- .github/workflows/build.yml
- Library/Homebrew/glibc-bootstrap/**
- "build-*.sh"
- debian7/Dockerfile

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
binary: [
"bison",
"gawk",
"gcc",
"make",
"python3",
"sed",]
binary:
- binutils
- bison
- gawk
- gcc
- make
- python3
- sed
include:
- container: debian7
steps:
- uses: actions/checkout@v2

- name: Build Docker image
run: docker build -t ${{matrix.container}} .
working-directory: Library/Homebrew/glibc-bootstrap/debian7
run: docker build --tag ${{matrix.container}} .
working-directory: debian7

- name: Run Docker container
run: docker run --rm --detach --user linuxbrew --name ${{github.sha}} -w /home/linuxbrew -v $(pwd)/Library/Homebrew/glibc-bootstrap:/home/linuxbrew/glibc-bootstrap ${{matrix.container}} sleep inf
run: docker run --rm --detach --user linuxbrew --name ${{github.sha}} --workdir /home/linuxbrew --volume $(pwd):/home/linuxbrew/glibc-bootstrap ${{matrix.container}} sleep inf

- name: Build ${{matrix.binary}}
run: docker exec ${{github.sha}} /bin/bash -c "/home/linuxbrew/glibc-bootstrap/build-${{matrix.binary}}.sh"
Expand All @@ -40,7 +40,7 @@ jobs:
run: docker cp ${{github.sha}}:/home/linuxbrew/bootstrap-binaries .

- name: Upload binaries to GitHub Actions
uses: actions/upload-artifact@v2
with:
uses: actions/upload-artifact@v3
with:
name: Bootstrap binaries
path: bootstrap-binaries
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Upload new release

on:
workflow_dispatch:
inputs:
tag:
description: Version to use for release tag
required: true

jobs:
build:
uses: ./.github/workflows/build.yml

release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{github.token}}
TAG: ${{github.event.inputs.tag}}
steps:
- uses: actions/checkout@v2

- name: Download binaries from GitHub Actions
uses: actions/download-artifact@v3
with:
name: Bootstrap binaries
path: bootstrap-binaries

- name: Push tag
run: gh release create "$TAG" --generate-notes

- name: Upload to GitHub Releases
run: gh release upload "$TAG" bootstrap-binaries/*.tar.gz
25 changes: 25 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2009-present, Homebrew contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18 changes: 0 additions & 18 deletions Library/Homebrew/glibc-bootstrap/build-bison.sh

This file was deleted.

11 changes: 0 additions & 11 deletions Library/Homebrew/glibc-bootstrap/build-gawk.sh

This file was deleted.

11 changes: 0 additions & 11 deletions Library/Homebrew/glibc-bootstrap/build-make.sh

This file was deleted.

14 changes: 0 additions & 14 deletions Library/Homebrew/glibc-bootstrap/build-python3.sh

This file was deleted.

11 changes: 0 additions & 11 deletions Library/Homebrew/glibc-bootstrap/build-sed.sh

This file was deleted.

12 changes: 0 additions & 12 deletions Library/Homebrew/glibc-bootstrap/debian7/Dockerfile

This file was deleted.

30 changes: 30 additions & 0 deletions build-binutils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -e
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

VERSION=2.38
SHA256SUM=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024

# Build binutils
wget --no-check-certificate https://ftp.gnu.org/gnu/binutils/binutils-$VERSION.tar.xz
verify_checksum binutils-$VERSION.tar.xz $SHA256SUM

tar --extract --file binutils-$VERSION.tar.xz
cd binutils-$VERSION
./configure --prefix="${PREFIX}" \
--enable-deterministic-archives \
--prefix="${PREFIX}" \
--disable-werror \
--enable-interwork \
--enable-multilib \
--enable-64-bit-bfd \
--enable-targets=all \
--disable-nls

make
make install
cd ..
rm -rf binutils-$VERSION

package binutils $VERSION
34 changes: 34 additions & 0 deletions build-bison.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

set -e
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

M4_VERSION=1.4.19
M4_SHA256SUM=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
BISON_VERSION=3.8.2
BISON_SHA256SUM=9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5bf2

# Build m4
wget --no-check-certificate https://ftp.gnu.org/gnu/m4/m4-$M4_VERSION.tar.xz
verify_checksum m4-$M4_VERSION.tar.xz $M4_SHA256SUM

tar --extract --file m4-$M4_VERSION.tar.xz
cd m4-$M4_VERSION
./configure --prefix="${PREFIX}"
make
make install
cd ..
rm --recursive --force m4-$M4_VERSION

# Build bison
wget --no-check-certificate https://ftp.gnu.org/gnu/bison/bison-$BISON_VERSION.tar.xz
verify_checksum bison-$BISON_VERSION.tar.xz $BISON_SHA256SUM

tar --extract --file bison-$BISON_VERSION.tar.xz
cd bison-$BISON_VERSION
./configure --prefix="${PREFIX}" M4="${PREFIX}/bin/m4"
make install
cd ..
rm --recursive --force bison-$BISON_VERSION

package bison $BISON_VERSION
21 changes: 21 additions & 0 deletions build-gawk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

VERSION=5.1.1
SHA256SUM=d87629386e894bbea11a5e00515fc909dc9b7249529dad9e6a3a2c77085f7ea2

# Build gawk
wget --no-check-certificate https://ftp.gnu.org/gnu/gawk/gawk-$VERSION.tar.xz
verify_checksum gawk-$VERSION.tar.xz $SHA256SUM

tar --extract --file gawk-$VERSION.tar.xz
cd gawk-$VERSION
./configure --prefix="${PREFIX}" --disable-mpfr --without-libsigsegv
make
make install
cd ..
rm --recursive --force gawk-$VERSION

package gawk ${VERSION}
24 changes: 17 additions & 7 deletions ...ary/Homebrew/glibc-bootstrap/build-gcc.sh → build-gcc.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#/bin/bash
#!/bin/bash

set -e
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

VERSION=9.5.0
SHA256SUM=27769f64ef1d4cd5e2be8682c0c93f9887983e6cfd1a927ce5a0a2915a95cf8f

# Build GCC
curl -LO --insecure https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.xz
tar xf gcc-$VERSION.tar.xz && cd gcc-$VERSION
wget --no-check-certificate https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.xz
verify_checksum gcc-$VERSION.tar.xz $SHA256SUM

tar --extract --file gcc-$VERSION.tar.xz
cd gcc-$VERSION

# Download GCC support libraries
./contrib/download_prerequisites

# Disable building documentation
gcc_cv_prog_makeinfo_modern=no

mkdir build && cd build
mkdir build
cd build

# Disable everything that isn't needed to build glibc.
../configure \
Expand All @@ -32,8 +40,10 @@ mkdir build && cd build
--disable-multilib \
--with-newlib \
--without-headers
make && make install
make
make install

cd ../.. && rm -rf gcc-$VERSION
cd ../..
rm --recursive --force gcc-$VERSION

cd $PREFIX && tar --remove-files -czf $PKGDIR/bootstrap-gcc-$VERSION.tar.gz .
package gcc $VERSION
20 changes: 20 additions & 0 deletions build-make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

VERSION=4.3
SHA256SUM=e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19

# Build make
wget --no-check-certificate https://ftp.gnu.org/gnu/make/make-${VERSION}.tar.gz
verify_checksum make-${VERSION}.tar.gz $SHA256SUM

tar --extract --gunzip --file make-${VERSION}.tar.gz
cd make-${VERSION}
./configure --prefix="${PREFIX}"
make install
cd ..
rm --recursive --force make-${VERSION}

package make ${VERSION}
23 changes: 23 additions & 0 deletions build-python3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

VERSION=3.9.13
SHA256SUM=125b0c598f1e15d2aa65406e83f792df7d171cdf38c16803b149994316a3080f

# Build Python 3
wget --no-check-certificate https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz
verify_checksum Python-$VERSION.tar.xz $SHA256SUM

tar --extract --file Python-$VERSION.tar.xz
cd Python-$VERSION

./configure --prefix="${PREFIX}" ac_cv_search_crypt=no ac_cv_search_crypt_r=no
make
make install

cd ..
rm --recursive --force Python-$VERSION

package python3 ${VERSION}
Loading

0 comments on commit d0ee6c3

Please sign in to comment.