+openssl+make (#58)

This commit is contained in:
Max Howell 2022-08-01 21:18:01 -04:00 committed by GitHub
parent b4f0306e97
commit 80a2c405a9
3 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,26 @@
distributable:
url: https://ftp.gnu.org/gnu/make/make-{{ version.raw }}.tar.gz
strip-components: 1
versions:
github: mirror/make/tags
build:
dependencies:
gnu.org/m4: 1
tea.xyz/gx/make: '*' #FIXME bootstrapping system
tea.xyz/gx/cc: c99
script: |
./configure --prefix={{ prefix }} --disable-dependency-tracking
make --jobs {{ hw.concurrency }} install
test:
#TODO build self
script: |
make --file=$FIXTURE
test "$(cat foo)" = bar
make --question --file=$FIXTURE
fixture:
"foo:\n\techo bar > $@"
env:
MAKEFLAGS: --file=$FIXTURE

View file

@ -0,0 +1,38 @@
distributable:
url: https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1q.tar.gz
strip-components: 1
versions:
- 1.1.118
# TODO
# github: openssl/openssl
# parser: version-parser.ts
provides:
- bin/openssl
- bin/c_rehash
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
perl.org: 5
script: |
case "X{{ hw.target }}" in
"Xaarch64-apple-darwin") ARCH="darwin64-arm64-cc";;
"Xx86_64-apple-darwin") ARCH="darwin64-x86_64-cc";;
"Xx86_64-unknown-linux-gnu") ARCH="linux-x86_64";;
"Xaarch64-unknown-linux-gnu") ARCH="linux-aarch64";;
esac
./Configure --prefix={{ prefix }} $ARCH no-tests
make --jobs {{ hw.concurrency }}
make install
test:
script: |
echo "This is a test file" > in
openssl dgst -sha256 -out out ./in
test "$(cat ./out)" = "$SAMPLE"
env:
SAMPLE: SHA256(./in)= c87e2ca771bab6024c269b933389d2a92d4941c848c52f155b9b84e1f109fe35

View file

@ -0,0 +1,15 @@
import { SemVer, semver } from "types"
import { panic } from "utils"
export default function parse(input: string): SemVer {
if (input.startsWith('openssl-')) {
return semver.coerce(input) ?? panic()
} else {
const [major, minor, patch, letter] = /OpenSSL_(\d+)_(\d+)_(\d+)(\w)/.exec(input)!
const letter_number = letter.toLowerCase().charCodeAt(0) - 96
const revised_patch = 100 * parseInt(patch) + letter_number
if (Number.isNaN(revised_patch)) throw new Error()
const v = `${major}.${minor}.${revised_patch}`
return new SemVer(v)
}
}