From a6d98380d8c9ba7af742a2b0c18920edf7dc3a26 Mon Sep 17 00:00:00 2001 From: Elias Almqvist Date: Thu, 8 Aug 2024 10:04:57 -0700 Subject: [PATCH] Revert "ghdl-llvm" This reverts commit 56a4e6a01a1fa3807c66aa5cced8fe92824b4ce0. --- nix-darwin/home.nix | 5 -- nix-darwin/overlays/ghdl-llvm.nix | 126 ------------------------------ 2 files changed, 131 deletions(-) delete mode 100644 nix-darwin/overlays/ghdl-llvm.nix diff --git a/nix-darwin/home.nix b/nix-darwin/home.nix index a7239b9..e884a77 100644 --- a/nix-darwin/home.nix +++ b/nix-darwin/home.nix @@ -27,7 +27,6 @@ # patches = [ ./change-hello-to-hi.patch ]; # }); # }) - (import ./overlays/ghdl-llvm.nix) ]; # Configure your nixpkgs instance config = { @@ -88,11 +87,7 @@ sshfs libqalculate imagemagick - - # compiler stuff llvm - libllvm - ghdl-llvm # Simulators # ngspice diff --git a/nix-darwin/overlays/ghdl-llvm.nix b/nix-darwin/overlays/ghdl-llvm.nix deleted file mode 100644 index 4ccea2d..0000000 --- a/nix-darwin/overlays/ghdl-llvm.nix +++ /dev/null @@ -1,126 +0,0 @@ -{ stdenv -, fetchFromGitHub -, callPackage -, gnat -, zlib -, llvm -, lib -, gcc-unwrapped -, texinfo -, gmp -, mpfr -, libmpc -, gnutar -, glibc -, makeWrapper -, backend ? "mcode" -, isDarwin ? stdenv.isDarwin -}: - -assert backend == "mcode" || backend == "llvm" || backend == "gcc"; - -stdenv.mkDerivation (finalAttrs: { - pname = "ghdl-${backend}"; - version = "4.1.0"; - - src = fetchFromGitHub { - owner = "ghdl"; - repo = "ghdl"; - rev = "v${finalAttrs.version}"; - hash = "sha256-tPSHer3qdtEZoPh9BsEyuTOrXgyENFUyJqnUS3UYAvM="; - }; - - LIBRARY_PATH = "${stdenv.cc.libc}/lib"; - - 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" || 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 = [ - # See https://github.com/ghdl/ghdl/pull/2058 - "--disable-werror" - "--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: - # 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; }; - }; - }; - - meta = { - homepage = "https://github.com/ghdl/ghdl"; - description = "VHDL 2008/93/87 simulator"; - license = lib.licenses.gpl2Plus; - mainProgram = "ghdl"; - maintainers = with lib.maintainers; [ lucus16 thoughtpolice ]; - platforms = lib.platforms.all; - }; -})