Loading pkgs/development/compilers/ghdl/expected-output.txt→pkgs/by-name/gh/ghdl/expected-output.txt +0 −0 File moved. View file pkgs/development/compilers/ghdl/default.nix→pkgs/by-name/gh/ghdl/package.nix +125 −0 Original line number Diff line number Diff line Loading @@ -5,10 +5,18 @@ , zlib , llvm , lib , gcc-unwrapped , texinfo , gmp , mpfr , libmpc , gnutar , glibc , makeWrapper , backend ? "mcode" }: assert backend == "mcode" || backend == "llvm"; assert backend == "mcode" || backend == "llvm" || backend == "gcc"; stdenv.mkDerivation (finalAttrs: { pname = "ghdl-${backend}"; Loading @@ -25,20 +33,29 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ gnat ] ++ lib.optionals (backend == "gcc") [ texinfo makeWrapper ]; buildInputs = [ zlib ] ++ lib.optionals (backend == "llvm") [ llvm ] ++ lib.optionals (backend == "gcc") [ gmp mpfr libmpc ]; propagatedBuildInputs = [ ] ++ lib.optionals (backend == "llvm") [ ] ++ lib.optionals (backend == "llvm" || backend == "gcc") [ zlib ]; preConfigure = '' # If llvm 7.0 works, 7.x releases should work too. sed -i 's/check_version 7.0/check_version 7/g' configure '' + lib.optionalString (backend == "gcc") '' ${gnutar}/bin/tar -xf ${gcc-unwrapped.src} ''; configureFlags = [ Loading @@ -47,14 +64,51 @@ stdenv.mkDerivation (finalAttrs: { "--enable-synth" ] ++ lib.optionals (backend == "llvm") [ "--with-llvm-config=${llvm.dev}/bin/llvm-config" ] ++ lib.optionals (backend == "gcc") [ "--with-gcc=gcc-${gcc-unwrapped.version}" ]; buildPhase = lib.optionalString (backend == "gcc") '' make copy-sources mkdir gcc-objs cd gcc-objs ../gcc-${gcc-unwrapped.version}/configure \ --with-native-system-header-dir=/include \ --with-build-sysroot=${lib.getDev glibc} \ --prefix=$out \ --enable-languages=c,vhdl \ --disable-bootstrap \ --disable-lto \ --disable-multilib \ --disable-libssp \ --disable-libgomp \ --disable-libquadmath make -j $NIX_BUILD_CORES make install cd ../ make -j $NIX_BUILD_CORES ghdllib ''; postFixup = lib.optionalString (backend == "gcc") '' wrapProgram $out/bin/ghdl \ --set LIBRARY_PATH ${lib.makeLibraryPath [ glibc ]} ''; hardeningDisable = [ ] ++ lib.optionals (backend == "gcc") [ # GCC compilation fails with format errors "format" ]; enableParallelBuilding = true; passthru = { # run with either of # run with: # nix-build -A ghdl-mcode.passthru.tests # nix-build -A ghdl-llvm.passthru.tests # nix-build -A ghdl-gcc.passthru.tests tests = { simple = callPackage ./test-simple.nix { inherit backend; }; }; Loading pkgs/development/compilers/ghdl/simple-tb.vhd→pkgs/by-name/gh/ghdl/simple-tb.vhd +0 −0 File moved. View file pkgs/development/compilers/ghdl/simple.vhd→pkgs/by-name/gh/ghdl/simple.vhd +0 −0 File moved. View file pkgs/development/compilers/ghdl/test-simple.nix→pkgs/by-name/gh/ghdl/test-simple.nix +3 −3 Original line number Diff line number Diff line { stdenv, ghdl-llvm, ghdl-mcode, backend }: { stdenv, lib, ghdl-llvm, ghdl-mcode, ghdl-gcc, backend }: let ghdl = if backend == "llvm" then ghdl-llvm else ghdl-mcode; ghdl = if backend == "llvm" then ghdl-llvm else if backend == "gcc" then ghdl-gcc else ghdl-mcode; in stdenv.mkDerivation { name = "ghdl-test-simple"; Loading @@ -13,7 +13,7 @@ stdenv.mkDerivation { mkdir -p ghdlwork ghdl -a --workdir=ghdlwork --ieee=synopsys simple.vhd simple-tb.vhd ghdl -e --workdir=ghdlwork --ieee=synopsys -o sim-simple tb '' + (if backend == "llvm" then '' '' + (if backend == "llvm" || backend == "gcc" then '' ./sim-simple --assert-level=warning > output.txt '' else '' ghdl -r --workdir=ghdlwork --ieee=synopsys tb > output.txt Loading Loading
pkgs/development/compilers/ghdl/expected-output.txt→pkgs/by-name/gh/ghdl/expected-output.txt +0 −0 File moved. View file
pkgs/development/compilers/ghdl/default.nix→pkgs/by-name/gh/ghdl/package.nix +125 −0 Original line number Diff line number Diff line Loading @@ -5,10 +5,18 @@ , zlib , llvm , lib , gcc-unwrapped , texinfo , gmp , mpfr , libmpc , gnutar , glibc , makeWrapper , backend ? "mcode" }: assert backend == "mcode" || backend == "llvm"; assert backend == "mcode" || backend == "llvm" || backend == "gcc"; stdenv.mkDerivation (finalAttrs: { pname = "ghdl-${backend}"; Loading @@ -25,20 +33,29 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ gnat ] ++ lib.optionals (backend == "gcc") [ texinfo makeWrapper ]; buildInputs = [ zlib ] ++ lib.optionals (backend == "llvm") [ llvm ] ++ lib.optionals (backend == "gcc") [ gmp mpfr libmpc ]; propagatedBuildInputs = [ ] ++ lib.optionals (backend == "llvm") [ ] ++ lib.optionals (backend == "llvm" || backend == "gcc") [ zlib ]; preConfigure = '' # If llvm 7.0 works, 7.x releases should work too. sed -i 's/check_version 7.0/check_version 7/g' configure '' + lib.optionalString (backend == "gcc") '' ${gnutar}/bin/tar -xf ${gcc-unwrapped.src} ''; configureFlags = [ Loading @@ -47,14 +64,51 @@ stdenv.mkDerivation (finalAttrs: { "--enable-synth" ] ++ lib.optionals (backend == "llvm") [ "--with-llvm-config=${llvm.dev}/bin/llvm-config" ] ++ lib.optionals (backend == "gcc") [ "--with-gcc=gcc-${gcc-unwrapped.version}" ]; buildPhase = lib.optionalString (backend == "gcc") '' make copy-sources mkdir gcc-objs cd gcc-objs ../gcc-${gcc-unwrapped.version}/configure \ --with-native-system-header-dir=/include \ --with-build-sysroot=${lib.getDev glibc} \ --prefix=$out \ --enable-languages=c,vhdl \ --disable-bootstrap \ --disable-lto \ --disable-multilib \ --disable-libssp \ --disable-libgomp \ --disable-libquadmath make -j $NIX_BUILD_CORES make install cd ../ make -j $NIX_BUILD_CORES ghdllib ''; postFixup = lib.optionalString (backend == "gcc") '' wrapProgram $out/bin/ghdl \ --set LIBRARY_PATH ${lib.makeLibraryPath [ glibc ]} ''; hardeningDisable = [ ] ++ lib.optionals (backend == "gcc") [ # GCC compilation fails with format errors "format" ]; enableParallelBuilding = true; passthru = { # run with either of # run with: # nix-build -A ghdl-mcode.passthru.tests # nix-build -A ghdl-llvm.passthru.tests # nix-build -A ghdl-gcc.passthru.tests tests = { simple = callPackage ./test-simple.nix { inherit backend; }; }; Loading
pkgs/development/compilers/ghdl/simple-tb.vhd→pkgs/by-name/gh/ghdl/simple-tb.vhd +0 −0 File moved. View file
pkgs/development/compilers/ghdl/simple.vhd→pkgs/by-name/gh/ghdl/simple.vhd +0 −0 File moved. View file
pkgs/development/compilers/ghdl/test-simple.nix→pkgs/by-name/gh/ghdl/test-simple.nix +3 −3 Original line number Diff line number Diff line { stdenv, ghdl-llvm, ghdl-mcode, backend }: { stdenv, lib, ghdl-llvm, ghdl-mcode, ghdl-gcc, backend }: let ghdl = if backend == "llvm" then ghdl-llvm else ghdl-mcode; ghdl = if backend == "llvm" then ghdl-llvm else if backend == "gcc" then ghdl-gcc else ghdl-mcode; in stdenv.mkDerivation { name = "ghdl-test-simple"; Loading @@ -13,7 +13,7 @@ stdenv.mkDerivation { mkdir -p ghdlwork ghdl -a --workdir=ghdlwork --ieee=synopsys simple.vhd simple-tb.vhd ghdl -e --workdir=ghdlwork --ieee=synopsys -o sim-simple tb '' + (if backend == "llvm" then '' '' + (if backend == "llvm" || backend == "gcc" then '' ./sim-simple --assert-level=warning > output.txt '' else '' ghdl -r --workdir=ghdlwork --ieee=synopsys tb > output.txt Loading