if [ -z ${CONDA_BUILD+x} ]; then
    source /conda/miniconda3/conda-bld/nsight-compute_1721099007475/work/build_env_setup.sh
fi
#!/bin/bash

# Install to conda style directories
[[ -d lib64 ]] && mv lib64 lib

baseDir="$(ls)"
nsightVersion=$(echo $PKG_VERSION | cut -d. -f1-3)
nsightLib32="$baseDir/target/linux-desktop-glibc_2_11_3-x86/"

# Remove 32bit libraries
[[ -d "${nsightLib32}" ]] && rm -rf ${nsightLib32}

mkdir -p $PREFIX/nsight-compute-$nsightVersion
cp -rv $baseDir/* $PREFIX/nsight-compute-$nsightVersion/

# Create symlinks to the binaries in bin for easier access
mkdir -p $PREFIX/bin
ln -s $PREFIX/nsight-compute-$nsightVersion/ncu $PREFIX/bin/
ln -s $PREFIX/nsight-compute-$nsightVersion/ncu-ui $PREFIX/bin/
