Skip to content

Commit 8f70723

Browse files
committed
Add nasm build. See compiler-explorer/infra#1102
1 parent c027cc1 commit 8f70723

File tree

8 files changed

+83
-1
lines changed

8 files changed

+83
-1
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
image: ['misc', 'rocm', 'compcert', 'rust-cg-gcc', 'rust-linux', 'iwyu', 'lc3']
10+
image: ['misc', 'rocm', 'compcert', 'rust-cg-gcc', 'rust-linux', 'iwyu', 'lc3', 'nasm']
1111
steps:
1212
- name: Docker Setup Buildx
1313
uses: docker/setup-buildx-action@v2

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc-builder.iml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile.nasm

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ubuntu:20.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
RUN apt update -y -q && apt upgrade -y -q && apt update -y -q && \
5+
apt install -y -q \
6+
build-essential \
7+
curl \
8+
git
9+
10+
RUN mkdir -p /root
11+
COPY nasm /root/
12+
COPY common.sh /root/
13+
14+
WORKDIR /root

nasm/build.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
source common.sh
5+
6+
VERSION=$1
7+
8+
URL=https://www.nasm.us/pub/nasm/releasebuilds/${VERSION}/nasm-${VERSION}.tar.xz
9+
10+
FULLNAME=nasm-${VERSION}.tar.xz
11+
OUTPUT=$2/${FULLNAME}
12+
13+
REVISION="nasm-${VERSION}"
14+
LAST_REVISION="${3:-}"
15+
16+
initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}"
17+
18+
PREFIX=$(pwd)/prefix
19+
DIR=$(pwd)/build
20+
21+
mkdir "${DIR}"
22+
cd "${DIR}"
23+
curl -sL "${URL}" | tar Jxf - --strip-components 1
24+
25+
if [[ -e include/nasmlib.h ]]; then
26+
sed -i 's/void pure_func seg_init(void);/void seg_init(void);/' include/nasmlib.h
27+
fi
28+
./configure "--prefix=${PREFIX}"
29+
make "-j$(nproc)" install
30+
31+
complete "${PREFIX}" "nasm-${VERSION}" "${OUTPUT}"

0 commit comments

Comments
 (0)