From e8408498f79c71d6bc25d2b430ca015cc4bbec30 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 16 May 2023 23:20:58 +0300 Subject: [PATCH] vlang: eliminate env.VFLAGS --- pkgs/development/compilers/vlang/default.nix | 36 ++++++-------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/pkgs/development/compilers/vlang/default.nix b/pkgs/development/compilers/vlang/default.nix index 865980d78661..bfc90c76fe08 100644 --- a/pkgs/development/compilers/vlang/default.nix +++ b/pkgs/development/compilers/vlang/default.nix @@ -53,30 +53,22 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; - buildInputs = lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa; + buildInputs = [ + binaryen + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Cocoa + ] ++ lib.optionals stdenv.isLinux [ + xorg.libX11 + xorg.libXau + xorg.libXdmcp + xorg.xorgproto + ]; makeFlags = [ "local=1" ]; env.VC = vc; - env.VFLAGS = toString ([ - "-cc ${stdenv.cc}/bin/cc" - "-no-retry-compilation" - "-ldflags -L${binaryen}/lib" - ] - # builder error: Header file , needed for module `clipboard.x11` was not found. - ++ lib.optionals stdenv.isLinux [ - "-cflags -I${xorg.libX11.dev}/include" - "-cflags -I${xorg.xorgproto}/include" - "-ldflags -L${xorg.libX11}/lib" - "-ldflags -L${xorg.libxcb}/lib" - "-ldflags -lxcb" - "-ldflags -L${xorg.libXau}/lib" - "-ldflags -lXau" - "-ldflags -L${xorg.libXdmcp}/lib" - "-ldflags -lXdmcp" - ]); preBuild = '' export HOME=$(mktemp -d) @@ -87,14 +79,6 @@ stdenv.mkDerivation { # vcreate_test.v requires git, so we must remove it when building the tools. preInstall = '' mv cmd/tools/vcreate/vcreate_test.v $HOME/vcreate_test.v - '' - # builder error: Header file , needed for module `clipboard` was not found. - + lib.optionalString stdenv.isDarwin '' - for flag in $NIX_CFLAGS_COMPILE; do - if [[ $flag == /*/Library/Frameworks ]]; then - VFLAGS+=" -ldflags -F$flag" - fi - done ''; installPhase = ''