-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: utilities and restructuring to create .deb packages for releases
- Loading branch information
1 parent
a14b9fb
commit ee9500e
Showing
10 changed files
with
134 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,9 @@ venv.bak/ | |
*.a | ||
*.lib | ||
|
||
# Packages | ||
packages/ | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Package: discopop | ||
Maintainer: Lukas Rothenberger <[email protected]> | ||
Depends: libc6,python3-tk,python3,pipx | ||
Architecture: amd64 | ||
Homepage: http://example.com | ||
Description: A program that prints hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
DP_DIR=/opt/DiscoPoP | ||
chmod 777 ${DP_DIR} | ||
DP_BUILD_DIR=/opt/DiscoPoP/build | ||
mkdir -p ${DP_BUILD_DIR} | ||
chmod 777 ${DP_BUILD_DIR} | ||
cd ${DP_BUILD_DIR} | ||
echo "Created DiscoPoP build dir: ${DP_BUILD_DIR}" | ||
|
||
echo "Downloading llvm 11.1.0" | ||
mkdir third_party | ||
cd third_party | ||
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz | ||
tar -xvf clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz | ||
mv clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10 llvm-11.1.0 | ||
rm clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz | ||
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" .. | ||
make -j | ||
|
||
chmod -R 777 ${DP_DIR} | ||
|
||
echo "Installing DiscoPoP python modules" | ||
cd ${DP_DIR} | ||
su ${SUDO_USER} -c "python3 -m pipx install ." | ||
|
||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rm -rf /opt/DiscoPoP | ||
su ${SUDO_USER} -c "python3 -m pipx uninstall discopop" |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# create a temporary copy of the code to build the package | ||
rm -rf tmp_package_build_dir | ||
mkdir -p tmp_package_build_dir | ||
cp -r * tmp_package_build_dir | ||
|
||
# modify folder structure to install DiscoPoP to /opt when installing the package | ||
cd tmp_package_build_dir | ||
mkdir opt | ||
mkdir opt/DiscoPoP | ||
|
||
mv * opt/DiscoPoP | ||
mv opt/DiscoPoP/DEBIAN . | ||
|
||
# add the Version tag to DEBIAN/control.raw to create DEBIAN/control | ||
echo "$(cat DEBIAN/control.raw)" > DEBIAN/control | ||
echo "Version: $(cat opt/DiscoPoP/discopop_library/global_data/version/VERSION)" >> DEBIAN/control | ||
echo "" >> DEBIAN/control | ||
|
||
# delete build folder if exists | ||
rm -rf opt/DiscoPoP/build | ||
# delete packages folder if exists | ||
rm -rf opt/DiscoPoP/packages | ||
# cleanup | ||
rm -rf opt/DiscoPoP/tmp_packages_build_dir | ||
|
||
# create packages folder | ||
cd .. | ||
mkdir -p packages | ||
# build package | ||
dpkg-deb --build tmp_package_build_dir packages/DiscoPoP.deb | ||
chmod 775 packages/DiscoPoP.deb | ||
|
||
# cleanup | ||
rm -rf tmp_package_build_dir |