Skip to content

Commit

Permalink
fix: .deb creation files
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrothenberger committed Nov 14, 2024
1 parent ee9500e commit 21a0c51
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
34 changes: 27 additions & 7 deletions DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,39 @@ LLVM_DIR=${DP_BUILD_DIR}/third_party/llvm-11.1.0

echo "Building DiscoPoP"
cd ${DP_BUILD_DIR}
cmake -DLLVM_DIST_PATH=${LLVM_DIR} -DIS_DEB_INSTALL="TRUE" ..
cmake .. -DLLVM_DIST_PATH=${LLVM_DIR} -DIS_DEB_INSTALL="TRUE" -DDP_PTHREAD_COMPATIBILITY_MODE=0 -DDP_NUM_WORKERS=8 -DDP_RTLIB_VERBOSE=0 -DDP_MEMORY_REGION_DEALIASING=0 -DDP_BRANCH_TRACKING=0 -DDP_CALLSTACK_PROFILING=0 -DDP_STACK_ACCESS_DETECTION=0 -DDP_CALLSTACK_PROFILING_ENABLE_CUTOFF=1 -DDP_INTERNAL_TIMER=0 -DDP_HYBRID_PROFILING=1 -DDP_HYBRID_PROFILING_CUTOFF=0 -DDP_HYBRID_PROFILING_CUTOFF_IGNORE_PROBABILITY=1 -DDP_PROFILING_SAMPLING_PROBABILITY=0 -DDP_CALLTREE_PROFILING=1 -DDP_CALLTREE_PROFILING_METADATA_CUTOFF=5 -DDP_CALLTREE_PROFILING_METADATA_CUTOFF_IGNORE_PROBABILITY=1
make -j

chmod -R 777 ${DP_DIR}

echo "Installing DiscoPoP python modules"
echo "Setting up DiscoPoP python venv"
cd ${DP_DIR}
su ${SUDO_USER} -c "python3 -m pipx install ."
su ${SUDO_USER} -c "python3 -m venv venv"
VENV_PYTHON=${DP_DIR}/venv/bin/python3

echo "Installing DiscoPoP python modules"
su ${SUDO_USER} -c "${VENV_PYTHON} -m pip install . -v"

#
#echo "Creating symlinks"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_cc"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_cxx"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_cmake"

echo "Creating symlinks"
su ${SUDO_USER} -c "rm -f ~/.local/bin/disocpop_cc"
su ${SUDO_USER} -c "rm -f ~/.local/bin/disocpop_cxx"
su ${SUDO_USER} -c "rm -f ~/.local/bin/disocpop_cmake"
su ${SUDO_USER} -c "ln -sf ${DP_BUILD_DIR}/scripts/CC_wrapper.sh ~/.local/bin/discopop_cc"
su ${SUDO_USER} -c "ln -sf ${DP_BUILD_DIR}/scripts/CXX_wrapper.sh ~/.local/bin/discopop_cxx"
su ${SUDO_USER} -c "ln -sf ${DP_BUILD_DIR}/scripts/CMAKE_wrapper.sh ~/.local/bin/discopop_cmake"

su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_auto_tuner"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_config_provider"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_explorer"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_optimizer"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_patch_applicator"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_patch_generator"

su ${SUDO_USER} -c "ln -sf ${DP_DIR}/venv/bin/discopop_auto_tuner ~/.local/bin/discopop_auto_tuner"
su ${SUDO_USER} -c "ln -sf ${DP_DIR}/venv/bin/discopop_config_provider ~/.local/bin/discopop_config_provider"
su ${SUDO_USER} -c "ln -sf ${DP_DIR}/venv/bin/discopop_explorer ~/.local/bin/discopop_explorer"
su ${SUDO_USER} -c "ln -sf ${DP_DIR}/venv/bin/discopop_optimizer ~/.local/bin/discopop_optimizer"
su ${SUDO_USER} -c "ln -sf ${DP_DIR}/venv/bin/discopop_patch_applicator ~/.local/bin/discopop_patch_applicator"
su ${SUDO_USER} -c "ln -sf ${DP_DIR}/venv/bin/discopop_patch_generator ~/.local/bin/discopop_patch_generator"
12 changes: 11 additions & 1 deletion DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
rm -rf /opt/DiscoPoP
su ${SUDO_USER} -c "python3 -m pipx uninstall discopop"

su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_cc"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_cxx"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_cmake"

su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_auto_tuner"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_config_provider"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_explorer"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_optimizer"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_patch_applicator"
su ${SUDO_USER} -c "rm -f ~/.local/bin/discopop_patch_generator"
3 changes: 3 additions & 0 deletions scripts/dev/check-license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ for file in "$@"; do
# third-party software
[[ "$file" = *"third_party/"* ]] && continue

# DEBIAN files for .deb creation
[[ "$file" = *"DEBIAN/"* ]] && continue


# check for the license tag in the first 20 lines of the file
FILE_ERROR=""
Expand Down

0 comments on commit 21a0c51

Please sign in to comment.