Skip to content

Commit

Permalink
Merge branch 'main' into meshlab-1032-add-3mf-export-and-import
Browse files Browse the repository at this point in the history
  • Loading branch information
lvk88 committed Aug 15, 2024
2 parents db1d6e0 + ad347bd commit ac360d1
Show file tree
Hide file tree
Showing 96 changed files with 2,734 additions and 550 deletions.
81 changes: 81 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM --platform=linux/amd64 ubuntu:20.04

ARG USERNAME=meshlab
ARG USER_UID=1000
ARG USER_GID=$USER_UID

ARG QT_VERSION=5.15.2

ENV PATH=/opt/qt/${QT_VERSION}/gcc_64/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/qt/${QT_VERSION}/gcc_64/lib/
ENV QT_PLUGIN_PATH=/opt/qt/${QT_VERSION}/gcc_64/plugins/
ENV QML_IMPORT_PATH=/opt/qt/${QT_VERSION}/gcc_64/qml/
ENV QML2_IMPORT_PATH=/opt/qt/${QT_VERSION}/gcc_64/qml/

RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential \
dbus-x11 \
fontconfig \
fuse \
git \
kmod \
libboost-dev \
libcanberra-gtk3-0 \
libdbus-1-3 \
libegl-dev \
libfuse2 \
libgmp-dev \
libglu1-mesa-dev \
libmpfr-dev \
libpulse-mainloop-glib0 \
libtbb-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-render-util0-dev \
libxcb-shape0 \
libxcb-xinerama0-dev \
libxerces-c-dev \
libxkbcommon-x11-dev \
patchelf \
packagekit-gtk3-module \
# to be removed
python3 \
python3-pip \
unzip \
wget

RUN pip3 install aqtinstall

RUN aqt install-qt -O /opt/qt linux desktop ${QT_VERSION} && \
pip3 uninstall -y aqtinstall && \
apt-get -y remove python3-pip python3

# install latest cmake and embree
RUN wget -qO- "https://cmake.org/files/v3.19/cmake-3.19.2-Linux-x86_64.tar.gz" \
| tar --strip-components=1 -xz -C /usr/local &&\
wget -qO- "https://github.com/embree/embree/releases/download/v4.3.2/embree-4.3.2.x86_64.linux.tar.gz" \
| tar -xz -C /usr/local && \
bash /usr/local/embree-vars.sh && \
wget -q "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip" && \
unzip -o ninja-linux.zip -d /usr/bin/ && \
rm ninja-linux.zip && \
chmod +x /usr/bin/ninja && \
apt-get -y remove wget unzip && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*

# Generating a universally unique ID for the Container
RUN dbus-uuidgen > /etc/machine-id

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

USER $USERNAME
13 changes: 13 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Running Meshlab in a Docker container

After built meshlab in the container, you can run it, but you'll need to give it access to the X server. You can do this by running the following command in the host machine:

```bash
xhost +local:* # or xhost +local:docker
```

You can disable access to the X server later by running the following command in the host machine:

```bash
xhost -local:* # or xhost -local:docker
```
20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "MeshLab",
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/meshlab",

// vscode extensions
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools"
],
"settings": {
"cmake.buildDirectory": "${workspaceFolder}/build"
}
}
}
}
27 changes: 27 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
devcontainer:
platform: linux/amd64
build:
context: .
dockerfile: Dockerfile
stdin_open: true # docker run -i
tty: true # docker run -t
# flag -e DISPLAY=$DISPLAY
environment:
DISPLAY: $DISPLAY
volumes:
- ..:/workspaces/meshlab
- /tmp/.X11-unix:/tmp/.X11-unix
# Next flags are necessary to deploy meshlab and create the AppImage
# fuse is needed. If you don't plan to create the AppImage, you can remove the
# following lines
- /lib/modules:/lib/modules
# flag --device /dev/fuse
devices:
- /dev/fuse
# flag --cap-add SYS_ADMIN
cap_add:
- SYS_ADMIN
# flag --security-opt apparmor:unconfined
security_opt:
- apparmor:unconfined
39 changes: 39 additions & 0 deletions .github/actions/0_setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Setup Environment'
description: 'Setup Environment'

inputs:
use-jurpel-qt-action:
description: 'Use jurpel/qt-action'
required: false
type: boolean
default: true
qt-version:
description: 'Qt Version'
required: false
default: '5.15.2'

runs:
using: "composite"
steps:
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Check
shell: bash
run: |
echo "Install Qt Action: ${{ inputs.use-jurpel-qt-action }}"
- name: Install Qt
if: inputs.use-jurpel-qt-action == 'true'
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ inputs.qt-version }}
- name: Install dependencies
if: inputs.use-jurpel-qt-action == 'true'
shell: bash
run: |
bash scripts/${{ runner.os }}/0_setup_env.sh --dont_install_qt
- name: Install dependencies
if: inputs.use-jurpel-qt-action == 'false'
shell: bash
run: |
bash scripts/${{ runner.os }}/0_setup_env.sh
60 changes: 60 additions & 0 deletions .github/actions/1_build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 'Build'
description: 'Build'

inputs:
cache-path:
description: 'Directory to cache after build'
required: false
default: ''
cache-key:
description: 'Cache key'
required: false
default: ''
build-precision:
description: 'Build precision'
required: false
default: ''
build-options:
description: 'Build options'
required: false
default: ''
nightly:
description: 'Nightly build'
required: false
type: boolean
default: false

runs:
using: "composite"
steps:
- name: Setup env variables
id: envs
shell: bash
run: |
if [ "${{ inputs.build-precision }}" != "" ]; then
echo "build_option=--${{ inputs.build-precision }}" >> $GITHUB_OUTPUT
echo "artifact_suffix=_${{ inputs.build-precision }}" >> $GITHUB_OUTPUT
else
echo "build_option=" >> $GITHUB_OUTPUT
echo "artifact_suffix=" >> $GITHUB_OUTPUT
fi
if [ "${{ inputs.nightly }}" = "true" ]; then
echo "nightly=--nightly" >> $GITHUB_OUTPUT
else
echo "nightly=" >> $GITHUB_OUTPUT
fi
- name: Cache external libraries sources
id: cache-ext-libs
if: ${{ inputs.cache-path != '' }}
uses: actions/cache@v4
with:
path: ${{ inputs.cache-path }}
key: ${{ runner.os }}-${{ inputs.cache-key }}
- name: Ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ github.ref }}-${{ inputs.build-precision }}
- name: Configure and Build
shell: bash
run: |
bash scripts/${{ runner.os }}/1_build.sh ${{ steps.envs.outputs.build_option }} ${{ inputs.build-options }} ${{ steps.envs.outputs.nightly }} --ccache
74 changes: 74 additions & 0 deletions .github/actions/2_deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: 'Deploy'
description: 'Deploy'

inputs:
mac-certificate:
description: 'MacOS Certificate'
required: false
default: ''
mac-certificate-id:
description: 'MacOS Certificate ID'
required: false
default: ''
mac-certificate-pssw:
description: 'MacOS Certificate Password'
required: false
mac-notarization-user:
description: 'MacOS Notarization User'
required: false
default: ''
mac-notarization-team:
description: 'MacOS Notarization Team'
required: false
default: ''
mac-notarization-pssw:
description: 'MacOS Notarization Password'
required: false
default: ''
win-certificate:
description: 'Windows Certificate'
required: false
default: ''
win-certificate-pssw:
description: 'Windows Certificate Password'
required: false
default: ''
use-brew-qt:
description: 'Qt Option'
required: false
default: 'false'

runs:
using: "composite"
steps:
- name: Set Notarization settings
id: envs
shell: bash
run: |
if [ "${{ inputs.mac-notarization-user }}" != "" ]; then
echo "not_setting=--notarization_user='${{ inputs.mac-notarization-user }}' --notarization_team='${{ inputs.mac-notarization-team }}' --notarization_pssw='${{ inputs.mac-notarization-pssw }}'" >> $GITHUB_OUTPUT
else
echo "not_setting=" >> $GITHUB_OUTPUT
fi
if [ "${{ inputs.use-brew-qt }}" == "true" ]; then
echo "qt-option=--use_brew_qt" >> $GITHUB_OUTPUT
else
echo "qt-option=" >> $GITHUB_OUTPUT
fi
- name: Set CodeSign Certificate macOS
if: ${{ runner.os == 'macOS' && inputs.mac-certificate != ''}}
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ inputs.mac-certificate }}
p12-password: ${{ inputs.mac-certificate-pssw }}
- name: Set CodeSign Certificate Windows
shell: powershell
if: ${{ runner.os == 'Windows' && inputs.win-certificate != '' }}
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ inputs.win-certificate }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
- name: Deploy
shell: bash
run: |
bash scripts/${{ runner.os }}/2_deploy.sh ${{ steps.envs.outputs.qt-option }} --cert_pssw='${{ inputs.win-certificate-pssw }}' --cert_id='${{ inputs.mac-certificate-id }}' ${{ steps.envs.outputs.not_setting }}
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ markComment: >
limitPerRun: 10

# Limit to only `issues` or `pulls`
# only: issues
only: issues

# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/AutoMergeMainOnDevel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Merge main -> devel
uses: devmasx/merge-branch@master
with:
Expand Down
Loading

0 comments on commit ac360d1

Please sign in to comment.