diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..524facd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build +on: + push: + branches: [ main ] + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Docker Setup Buildx + uses: docker/setup-buildx-action@v2 + - name: Docker Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build and push to Docker Hub + id: hub_build + uses: docker/build-push-action@v4 + with: + push: true + tags: compilerexplorer/cobol-builder:latest + cache-from: type=registry,ref=compilerexplorer/cobol-builder:latest + cache-to: type=inline + - name: Docker Hub Image Digest + run: echo ${{ steps.hub_build.outputs.digest }} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..37d1005 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,77 @@ +# Contributor Covenant Code of Conduct + +**Compiler Explorer** contributor covenant Code of Conduct. + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as + contributors and maintainers pledge to making participation in our project + and our community a harassment-free experience for everyone, regardless of age, + body size, disability, ethnicity, gender identity and expression, + level of experience, nationality, personal appearance, race, religion, + or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language. +* Being respectful of differing viewpoints and experiences. +* Gracefully accepting constructive criticism. +* Focusing on what is best for the community. +* Showing empathy towards other community members. + +Examples of **unacceptable** behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances. +* Trolling, insulting/derogatory comments, and personal or political attacks. +* Public or private harassment. +* Publishing others' private information, such as a physical or electronic + address, without explicit permission. +* Other conduct which could reasonably be considered inappropriate in a + professional setting. + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable + behavior and are expected to take appropriate and fair corrective action in + response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or + reject comments, commits, code, wiki edits, issues, and other contributions + that are not aligned to this Code of Conduct, or to ban + temporarily or permanently any contributor for other behaviors that they deem + inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces + when an individual is representing the project or its community. Examples of + representing a project or community include using an official project e-mail + address, posting via an official social media account, or acting as + an appointed representative at an online or offline event. + Representation of a project may be further defined and clarified by project + maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be + reported by contacting the project owner at + [matt@godbolt.org](mailto:matt@godbolt.org). The project team will review + and investigate all complaints, and will respond in a way that it deems + appropriate to the circumstances. The project team is obligated to maintain + confidentiality with regard to the reporter of an incident. Further details of + specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good + faith may face temporary or permanent repercussions as determined by other + members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], + version 1.4, available at [contributor-covenant.org/version/1/4][version] + +[homepage]: https://www.contributor-covenant.org/ +[version]: https://www.contributor-covenant.org/version/1/4/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..85b3cca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:20.04 +MAINTAINER Matt Godbolt + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt update -y -q && apt upgrade -y -q && apt upgrade -y -q && apt install -y -q \ + bison \ + bzip2 \ + curl \ + file \ + flex \ + gawk \ + gcc \ + git \ + libc6-dev-i386 \ + libelf-dev \ + linux-libc-dev \ + make \ + patch \ + texinfo \ + unzip \ + wget \ + xz-utils + +WORKDIR /opt/compiler-explorer/gcc-build diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f655233 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2023, Compiler Explorer Authors +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..aaee67f --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +### Cobol Compiler build scripts + +The repository is part of the [Compiler Explorer](https://godbolt.org/) project. It builds +the docker images used to build the Cobol compilers used on the site. diff --git a/build/build.sh b/build/build.sh new file mode 100755 index 0000000..45305b8 --- /dev/null +++ b/build/build.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -ex + +VERSION=$1 +URL=https://sourceforge.net/projects/gnucobol/files/gnucobol/${VERSION}/gnucobol-${VERSION}-rc2.tar.bz2 + +FULLNAME=gnucobol-${VERSION} +OUTPUT=$2/${FULLNAME}.tar.xz + +REVISION="cobol-${VERSION}" +LAST_REVISION="${3}" + +echo "ce-build-revision:${REVISION}" +echo "ce-build-output:${OUTPUT}" + +if [[ "${REVISION}" == "${LAST_REVISION}" ]]; then + echo "ce-build-status:SKIPPED" + exit +fi + +STAGING_DIR=$(pwd)/staging +mkdir -p "${STAGING_DIR}" + +cd "${STAGING_DIR}" +curl -sL ${URL} | tar --strip-components=1 Jxf - + +./autogen.sh +./configure +make -j$(nproc) +make DESTDIR=${STAGING_DIR} prefix=${STAGING_DIR} install + +export XZ_DEFAULTS="-T 0" +tar Jcf "${OUTPUT}" --transform "s,^./,./cobol-${VERSION}/," -C "${STAGING_DIR}" . + +echo "ce-build-status:OK"