+go+unzip+tar (#74)

This commit is contained in:
Max Howell 2022-08-05 09:43:01 -04:00 committed by GitHub
parent 6cef318164
commit c7e3d90b60
4 changed files with 125 additions and 4 deletions

View file

@ -69,10 +69,6 @@ jobs:
exit 1
esac
- name: HACKS
uses: denoland/setup-deno@v1
if: ${{ matrix.os == 'macos-11' }}
- uses: teaxyz/setup@v0
env:
TEA_SECRET: ${{ secrets.TEA_SECRET }}
@ -88,6 +84,7 @@ jobs:
id: build
env:
GITHUB_TOKEN: ${{ github.token }}
FORCE_UNSAFE_CONFIGURE: 1 # some configure scripts refuse to run as root
- name: Test
run: |

View file

@ -0,0 +1,19 @@
distributable:
url: https://ftp.gnu.org/gnu/tar/tar-{{ version.raw }}.tar.gz
strip-components: 1
versions:
- 1.34
#TODO scrape https://ftp.gnu.org/gnu/tar/
build:
dependencies:
tea.xyz/gx/cc: 'c99'
tea.xyz/gx/make: '*'
script: |
./configure --prefix={{ prefix }} --disable-debug
make --jobs {{ hw.concurrency }} install
test:
script:
tar czvf test.tar.gz {{ prefix }}

View file

@ -0,0 +1,68 @@
distributable:
url: https://go.dev/dl/go{{ version.raw }}.src.tar.gz
strip-components: 1
versions:
github: golang/go/tags
strip: /^go/
relocatable: true
provides:
- bin/go
interprets:
- .go
build:
dependencies:
gnu.org/m4: 1
tea.xyz/gx/make: '*'
tea.xyz/gx/cc: c99
curl.se: '*'
script: |-
export GOROOT_BOOTSTRAP="$(cd ../.. && echo $PWD)/bootstrap"
if test -d $GOROOT_BOOTSTRAP
then
true
else
# TODO something better than this...
case "X{{ hw.target }}" in
"Xaarch64-apple-darwin") GOARCH="darwin-arm64";;
"Xx86_64-apple-darwin") GOARCH="darwin-amd64";;
"Xx86_64-unknown-linux-gnu") GOARCH="linux-amd64";;
"Xxaarch64-unknown-linux-gnu") GOARCH="linux-arm64";;
*)
echo "Unknown arch. Please update the pantry."
exit 1
esac
curl -L https://storage.googleapis.com/golang/go1.16.${GOARCH}.tar.gz | tar xzf - -C ../..
mv ../../go ../../bootstrap
fi
export GOROOT_BOOTSTRAP="$(cd ../.. && echo $PWD)/bootstrap"
export GOROOT_FINAL="{{ prefix }}"
cd src
./make.bash
# cleanup
cd ../..
mv src foo
mv foo/* .
rmdir foo
rm src/*.{bash,bat,rc}
rm src/Make.dist
find . -mindepth 1 -maxdepth 1 -type f -delete -not -name build.sh
test:
script: |
mv $FIXTURE $FIXTURE.go
OUTPUT=$(go run $FIXTURE.go)
test "Hello World" = "$OUTPUT"
fixture: |
package main
import "fmt"
func main() {
fmt.Println("Hello World")
}

View file

@ -0,0 +1,37 @@
distributable:
url:
https://downloads.sourceforge.net/project/infozip/UnZip
{{ version.major }}.x
(latest)/UnZip
{{ version.raw }}/unzip{{ version.major }}{{version.minor }}.tar.gz
strip-components: 1
versions:
- '6.0'
#TODO
# see brew formula, they apply a SHIT TONNE of patches
# because this is unmaintained I guess
# https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/unzip.rb
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
script: |
case {{ hw.platform }} in
darwin) TARGET=macosx;;
linux) TARGET=macosx;; #SURPRISE!
esac
make --file unix/Makefile --jobs {{ hw.concurrency }} $TARGET
make prefix={{prefix}} install
test:
script: unzip -h
provides:
- bin/funzip
- bin/unzip
- bin/unzipsfx
- bin/zipgrep
- bin/zipinfo