diff --git a/packages/gcc/10.2.0/build.sh b/packages/gcc/10.2.0/build.sh deleted file mode 100755 index 0ed183a..0000000 --- a/packages/gcc/10.2.0/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to build your package in here -[[ -d "bin" ]] && exit 0 -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build obj - -cd build - -curl "https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz" -o gcc.tar.gz - -tar xzf gcc.tar.gz --strip-components=1 - -./contrib/download_prerequisites - -cd ../obj - -# === autoconf based === -../build/configure --prefix "$PREFIX" --enable-languages=c,c++,d,fortran --disable-multilib --disable-bootstrap - -make -j$(nproc) -make install -j$(nproc) -cd ../ -rm -rf build obj - diff --git a/packages/gcc/10.2.0/compile b/packages/gcc/10.2.0/compile deleted file mode 100644 index a77ba35..0000000 --- a/packages/gcc/10.2.0/compile +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to compile source code, remove this file if the language does not require this stage - - -case "${PISTON_LANGUAGE}" in - c) - rename 's/$/\.c/' "$@" # Add .c extension - gcc -std=c11 *.c -lm - ;; - c++) - rename 's/$/\.cpp/' "$@" # Add .cpp extension - g++ -std=c++17 *.cpp - ;; - d) - rename 's/.code$/\.d/' "$@" # Add .d extension - gdc *.d - ;; - fortran) - rename 's/.code$/\.f90/' "$@" # Add .f90 extension - gfortran *.f90 - ;; - *) - echo "How did you get here? (${PISTON_LANGUAGE})" - exit 1 - ;; -esac - -chmod +x a.out \ No newline at end of file diff --git a/packages/gcc/10.2.0/environment b/packages/gcc/10.2.0/environment deleted file mode 100644 index a0b5a11..0000000 --- a/packages/gcc/10.2.0/environment +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Put 'export' statements here for environment variables -export PATH=$PWD/bin:$PATH -export LD_LIBRARY_PATH="$PWD/lib:$PWD/lib64" # Need this to properly link Fortran diff --git a/packages/gcc/10.2.0/metadata.json b/packages/gcc/10.2.0/metadata.json deleted file mode 100644 index 367de7c..0000000 --- a/packages/gcc/10.2.0/metadata.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "language": "gcc", - "version": "10.2.0", - "provides": [ - { - "language": "c", - "aliases": ["gcc"] - }, - { - "language": "c++", - "aliases": ["cpp", "g++"] - }, - { - "language": "d", - "aliases": ["gdc"] - }, - { - "language": "fortran", - "aliases": ["fortran", "f90"] - } - ] -} diff --git a/packages/gcc/10.2.0/run b/packages/gcc/10.2.0/run deleted file mode 100644 index 60ad16b..0000000 --- a/packages/gcc/10.2.0/run +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime - -shift # Discard main filename -./a.out "$@" diff --git a/packages/gcc/10.2.0/test.c b/packages/gcc/10.2.0/test.c deleted file mode 100644 index fafae75..0000000 --- a/packages/gcc/10.2.0/test.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(void) { - printf("OK"); - return 0; -} \ No newline at end of file diff --git a/packages/gcc/10.2.0/test.cpp b/packages/gcc/10.2.0/test.cpp deleted file mode 100644 index 9d0499e..0000000 --- a/packages/gcc/10.2.0/test.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(void) { - printf("OK"); - return 0; -} \ No newline at end of file diff --git a/packages/gcc/10.2.0/test.d b/packages/gcc/10.2.0/test.d deleted file mode 100644 index e74851d..0000000 --- a/packages/gcc/10.2.0/test.d +++ /dev/null @@ -1,5 +0,0 @@ -import std.stdio; - -void main() { - writeln("OK"); -} \ No newline at end of file diff --git a/packages/gcc/10.2.0/test.f90 b/packages/gcc/10.2.0/test.f90 deleted file mode 100644 index 99fc062..0000000 --- a/packages/gcc/10.2.0/test.f90 +++ /dev/null @@ -1,3 +0,0 @@ -program test - print "(a)", 'OK' -end program test diff --git a/runtimes/default.nix b/runtimes/default.nix index 23b997e..bd8dbf3 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -48,4 +48,5 @@ args: { "gcc-c" = import ./gcc-c.nix args; "gcc-c++" = import ./gcc-c++.nix args; "gcc-d" = import ./gcc-d.nix args; + "gcc-fortran" = import ./gcc-fortran.nix args; } diff --git a/runtimes/gcc-fortran.nix b/runtimes/gcc-fortran.nix new file mode 100644 index 0000000..7173753 --- /dev/null +++ b/runtimes/gcc-fortran.nix @@ -0,0 +1,39 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.gfortran; +in piston.mkRuntime { + language = "fortran"; + version = pkg.version; + runtime = "gcc"; + + aliases = [ + "gfortran" + "f90" + ]; + + compile = '' + rename 's/.code$/\.f90/' "$@" # Add .f90 extension + ${pkg}/bin/gfortran *.f90 + ''; + + run = '' + shift + ./a.out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.f90" = '' + program test + print "(a)", 'OK' + end program test + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.f90"; + }) + ]; +} \ No newline at end of file