{ lib, stdenv, autoconf, automake, autoreconfHook, boost, fetchFromGitHub, gnumake, libtool, withCFlags, useIntel ? true, adaptivecpp ? null, intelPackages ? null, useGit ? false, gitUrl ? "git@gitlab-internal.bsc.es:task-awareness/tasycl/tasycl.git", gitBranch ? "main", gitCommit ? "78f98dcf60a66e0eaa3b4ebcf55be076bec64825", }: assert !useIntel -> adaptivecpp != null; assert useIntel -> intelPackages != null; let variant = if useIntel then "intel" else "acpp"; syclStdenv = withCFlags [ "-O3" ] (if useIntel then intelPackages.stdenv else stdenv); release = rec { version = "2.1.0"; src = fetchFromGitHub { owner = "bsc-pm"; repo = "tasycl"; rev = version; hash = "sha256-0kXnb0lHeQNHR27GTLbJ8xbiICLU8k2+FqEnnFSrzzo="; }; }; git = rec { version = src.shortRev; src = builtins.fetchGit { url = gitUrl; ref = gitBranch; rev = gitCommit; }; }; source = if (useGit) then git else release; in syclStdenv.mkDerivation { pname = "tasycl-${variant}"; inherit (source) src version; enableParallelBuilding = true; separateDebugInfo = true; nativeBuildInputs = [ autoreconfHook automake autoconf libtool gnumake ]; buildInputs = [ boost ]; configureFlags = lib.optionals (!useIntel) [ "CXX=${lib.getExe adaptivecpp}" ]; # add symlinks so we can explicitly link with tasycl-intel / tasycl-acpp postInstall = '' pushd $out/lib for i in libtasycl* ; do ln -s "$i" "''\${i/tasycl/tasycl-${variant}}" done popd ''; hardeningDisable = [ "all" ]; }