Skip to content

Commit

Permalink
initial from CRiSTiK24
Browse files Browse the repository at this point in the history
  • Loading branch information
dxli committed Aug 18, 2023
1 parent 0a0d818 commit df3fa1e
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Librecad3 Builders
'on':
workflow_dispatch: null
push:
branches:
- main
- ci_dev

jobs:
linux:
name: Building LibreCAD3 on ubuntu runner
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- run: ${{ github.workspace }}/scripts/ubuntu-install/installDependenciesAndBuildRepo.sh

- run: cd ${{ github.workspace }}

- run: sudo ${{ github.workspace }}/scripts/ubuntu-install/createAppImage.sh

- run: cd ${{ github.workspace }}

- run: ${{ github.workspace }}/scripts/ubuntu-install/createSnap.sh

- name: Uploading AppImage
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/build/LibreCAD**AppImage
name: LibreCAD3.AppImage
retention-days: 2

- name: Uploading snap
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/librecad**snap
name: LibreCAD3.snap
retention-days: 2

windows:
name: Building LibreCAD3 on windows runner
runs-on: windows-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install Visual Studio 2019 with tools
run: ${{ github.workspace }}/scripts/windows-install/installVisualStudio.bat

- run: cd ${{ github.workspace }}

- run: ${{ github.workspace }}/scripts/windows-install/installConan.bat

- run: ${{ github.workspace }}/scripts/windows-install/createConanDirAndInstallDependencies.bat

- run: cd ${{ github.workspace }}/..

- name: Install Qt5
uses: jurplel/install-qt-action@v3
with:
version: 5.15.14

- run: setx QTDIR "${{ env.Qt5_DIR }}\5.15.14\msvc2019_64"

- run: setx QT_QPA_PLATFORM_PLUGIN_PATH "${{ env.Qt5_DIR }}\plugins\platforms\\"

- run: ${{ github.workspace }}/scripts/windows-install/addPathVariables.ps1

- run: cd ${{ github.workspace }}

- run: ${{ github.workspace }}/scripts/windows-install/buildLibrecadAndCreatePackage.bat
- name: Uploading exe
uses: actions/upload-artifact@v3
with:
path: '${{ github.workspace }}/out/build/windows-default/LibreCAD3**.exe'
name: LibreCAD3.exe
retention-days: 2
20 changes: 20 additions & 0 deletions scripts/ubuntu-install/createAppImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=On
make -j 4

sudo make install DESTDIR=AppDir

sudo cp ../AppImage/librecad.* AppDir/
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage

chmod a+x linuxdeploy-x86_64.AppImage
chmod a+x linuxdeploy-plugin-qt-x86_64.AppImage

sudo cp ../AppImage/librecad.* AppDir/
sudo cp /usr/local/lib/libdxfrw.so.1 AppDir/usr/lib


sudo LD_LIBRARY_PATH=AppDir/usr/lib/x86_64-linux-gnu/:AppDir/usr/lib64:AppDir/usr/lib ./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage --executable AppDir/usr/bin/librecad --desktop-file AppDir/librecad.desktop --icon-file AppDir/librecad.svg --plugin qt
6 changes: 6 additions & 0 deletions scripts/ubuntu-install/createSnap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo snap install snapcraft --classic

snap run snapcraft --destructive-mode

sudo snap install librecad_0.0.9_amd64.snap --devmode --dangerous

33 changes: 33 additions & 0 deletions scripts/ubuntu-install/installDependenciesAndBuildRepo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
sudo apt update
sudo apt upgrade
sudo apt install cmake qt5-default qttools5-dev qttools5-dev-tools libqt5opengl5-dev liblua5.2-dev git g++ libcairo2-dev libpango-1.0-0 libpango1.0-dev libboost-dev libboost-log-dev libboost-program-options-dev libqt5svg5-dev libgtest-dev libeigen3-dev libcurl4-gnutls-dev libgtk-3-dev libglew-dev rapidjson-dev libbz2-dev libglfw3-dev libglm-dev

#This is for versions older that 20.04, like ubuntu 18.04

#sudo apt remove --purge --auto-remove cmake
#sudo apt update && \
#sudo apt install -y software-properties-common lsb-release && \
#sudo apt clean all
#wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
#sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
#sudo apt update
#sudo apt install kitware-archive-keyring
#sudo rm /etc/apt/trusted.gpg.d/kitware.gpg
#sudo apt update
#sudo apt install cmake

cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make

cd lib #meeded in ubuntu 20.04+
sudo cp ./*.a /usr/lib

cd
git clone --branch LibreCAD_3 https://github.com/LibreCAD/libdxfrw
cd libdxfrw
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ..
make
sudo make install
1 change: 1 addition & 0 deletions scripts/windows-install/addPathVariables.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Environment]::SetEnvironmentVariable('Path', $env:Path + ';${{ env.Qt5_DIR }}\5.15.14\msvc2019_64;${{ github.workspace }}\LibreCAD_3\out\build\x64-Debug\lib;${{ env.Qt5_DIR }}\5.15.14\msvc2019_64\bin', 'User')
18 changes: 18 additions & 0 deletions scripts/windows-install/buildLibrecadAndCreatePackage.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cd ${{ github.workspace }}

cmake -S %cd% -B %cd%\out\build\windows-default -DCMAKE_BUILD_TYPE=RelWithDebInfo --install-prefix %cd%\installprefix

cmake -S %cd% -B %cd%\out\build\windows-default -DCMAKE_BUILD_TYPE=RelWithDebInfo --install-prefix %cd%\installprefix

cd out\build\windows-default

cmake --build . --config RelWithDebInfo

cd bin

WinDeployQt librecad.exe

cd ..

cpack -C RelWithDebInfo

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mkdir conan
cd conan
conan install .. -s build_type=RelWithDebInfo --build missing
if NOT %errorlevel% == "0" (
conan profile update settings.compiler.version=16 default
conan install .. -s build_type=RelWithDebInfo --build missing
)
cd ..\..
1 change: 1 addition & 0 deletions scripts/windows-install/installConan.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip install conan
1 change: 1 addition & 0 deletions scripts/windows-install/installVisualStudio.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
choco install visualstudio2019community --package-parameters='"--add Microsoft.VisualStudio.Component.VC.CMake.Project Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.Windows10SDK.19041"'

0 comments on commit df3fa1e

Please sign in to comment.