From 87e4f8ea444ce5610a9f853961c1ebe8dbe0a07c Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Tue, 12 Mar 2024 14:53:03 +0100 Subject: [PATCH 01/10] build: initial attempt to build on Windows --- .github/workflows/c-cpp.yml | 45 ++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 33bde20e..8a1a9cc8 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -7,36 +7,54 @@ on: branches: ["main"] jobs: + env: + RUNNER_DEFAULT_SHELL: bash build: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest] + os: [macos-latest,windows-latest] steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Install Dependencies + - name: Install Dependencies - Windows + if: runner.os == 'windows' run: | - if [ "${{ matrix.os }}" = "macos-latest" ]; then - #brew update - brew install wxwidgets m4 tinyxml zstd autoconf libtool automake wxwidgets libpng sqlite + choco install mingw wxwidgets sqlite make + choco install gnuwin32-m4 + - name: Install Dependencies - Linux + if: runner.os == 'linux' + run: | + brew install wxwidgets m4 tinyxml zstd autoconf libtool automake wxwidgets libpng sqlite bash brew install dylibbundler - elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then - sudo apt-get update - sudo apt install libwxgtk3.2-dev || sudo apt install wx3.2-headers || sudo apt install libwxgtk3.0-gtk3-dev || sudo apt install libwxgtk3.0-dev - fi + - name: Install Dependencies - MacOS + if: runner.os == 'macos' + run: | + sudo apt-get update + sudo apt install libwxgtk3.2-dev || sudo apt install wx3.2-headers || sudo apt install libwxgtk3.0-gtk3-dev || sudo apt install libwxgtk3.0-dev - name: remove local redundancy to build-deps + if: runner.os == 'linux' || runner.os == 'macOS' run: rm -f mysql* sqlite* && rm -rf clustalw tinyxml - name: autogen + if: runner.os == 'linux' || runner.os == 'macOS' run: ./autogen.sh - name: configure + if: runner.os == 'linux' || runner.os == 'macOS' run: ./configure - name: make - run: make + run: | + if [ "${{ matrix.os }}" = "macos-latest" ]; then + make + elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then + make + else + g++ -o GENtle *.cpp ipc/*.cpp + fi - name: install asciidoc + if: runner.os == 'windows' || runner.os == 'macOS' run: | if [ "${{ matrix.os }}" = "macos-latest" ]; then brew install asciidoc @@ -44,7 +62,12 @@ jobs: sudo apt install asciidoc fi - name: build manual.html - run: asciidoc docs/manual.adoc + run: | + if [ "${{ matrix.os }}" = "macos-latest" ]; then + asciidoc docs/manual.adoc + else + echo "No manual created for ${{ matrix.os }}." > docs/manual.html + fi - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From 3b4626ef1d904222dcaccdbdd984bc318e816140 Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Tue, 12 Mar 2024 16:18:07 +0100 Subject: [PATCH 02/10] ci build: Windows bash dependency --- .github/workflows/c-cpp.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 8a1a9cc8..7e4ca95d 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -7,15 +7,15 @@ on: branches: ["main"] jobs: - env: - RUNNER_DEFAULT_SHELL: bash - build: runs-on: ${{ matrix.os }} + env: + RUNNER_DEFAULT_SHELL: bash + strategy: matrix: - os: [macos-latest,windows-latest] + os: [macos-latest, windows-latest] steps: - name: Check out repository code @@ -25,16 +25,18 @@ jobs: run: | choco install mingw wxwidgets sqlite make choco install gnuwin32-m4 + choco install bash - name: Install Dependencies - Linux if: runner.os == 'linux' run: | - brew install wxwidgets m4 tinyxml zstd autoconf libtool automake wxwidgets libpng sqlite bash + brew install wxwidgets m4 tinyxml zstd autoconf libtool automake + brew install libpng sqlite brew install dylibbundler - name: Install Dependencies - MacOS if: runner.os == 'macos' run: | sudo apt-get update - sudo apt install libwxgtk3.2-dev || sudo apt install wx3.2-headers || sudo apt install libwxgtk3.0-gtk3-dev || sudo apt install libwxgtk3.0-dev + sudo apt install libwxgtk3.2-dev || sudo apt install wx3.2-headers - name: remove local redundancy to build-deps if: runner.os == 'linux' || runner.os == 'macOS' run: rm -f mysql* sqlite* && rm -rf clustalw tinyxml From e31bd7f05c6e69dee96f393e6630c00adc42853a Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Tue, 12 Mar 2024 18:17:06 +0100 Subject: [PATCH 03/10] codeql: eliminating a few lintian warnings --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 479079ad..2ea9b4e5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,9 +2,9 @@ name: "CodeQL" on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] schedule: - cron: '40 21 * * 3' @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'c-cpp' ] + language: ['c-cpp'] steps: - name: Checkout repository From 3360d36e762cd159e55a4795bef9a15fa281f4b8 Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Tue, 12 Mar 2024 18:19:05 +0100 Subject: [PATCH 04/10] codeql build: assign apt to Linux, not macOS --- .github/workflows/c-cpp.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 7e4ca95d..54789f82 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -29,14 +29,14 @@ jobs: - name: Install Dependencies - Linux if: runner.os == 'linux' run: | - brew install wxwidgets m4 tinyxml zstd autoconf libtool automake - brew install libpng sqlite - brew install dylibbundler + sudo apt-get update + sudo apt install libwxgtk3.2-dev || sudo apt install wx3.2-headers - name: Install Dependencies - MacOS if: runner.os == 'macos' run: | - sudo apt-get update - sudo apt install libwxgtk3.2-dev || sudo apt install wx3.2-headers + brew install wxwidgets m4 tinyxml zstd autoconf libtool automake + brew install libpng sqlite + brew install dylibbundler - name: remove local redundancy to build-deps if: runner.os == 'linux' || runner.os == 'macOS' run: rm -f mysql* sqlite* && rm -rf clustalw tinyxml From 852074423ac09b80cedab8487ade60d7e65acfb3 Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Wed, 13 Mar 2024 13:49:41 +0100 Subject: [PATCH 05/10] build ci: improved compatibility with Windows --- .github/workflows/c-cpp.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 54789f82..5044a2c5 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -25,7 +25,6 @@ jobs: run: | choco install mingw wxwidgets sqlite make choco install gnuwin32-m4 - choco install bash - name: Install Dependencies - Linux if: runner.os == 'linux' run: | @@ -37,39 +36,44 @@ jobs: brew install wxwidgets m4 tinyxml zstd autoconf libtool automake brew install libpng sqlite brew install dylibbundler - - name: remove local redundancy to build-deps + - name: remove local redundancy to build-deps - Linux or MacOS if: runner.os == 'linux' || runner.os == 'macOS' run: rm -f mysql* sqlite* && rm -rf clustalw tinyxml - - name: autogen + - name: autogen - Linux or MacOS if: runner.os == 'linux' || runner.os == 'macOS' run: ./autogen.sh - - name: configure + - name: configure - Linux or MacOS if: runner.os == 'linux' || runner.os == 'macOS' run: ./configure - - name: make + - name: make - Windows + if: runner.os == 'windows' + run: | + g++ -o GENtle *.cpp ipc/*.cpp + - name: make - Linux or MacOS + if: runner.os == 'linux' || runner.os == 'macOS' run: | if [ "${{ matrix.os }}" = "macos-latest" ]; then make elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then make else - g++ -o GENtle *.cpp ipc/*.cpp + echo "Unexpected runer.os: ${{ runner.os }}" + exit fi - name: install asciidoc - if: runner.os == 'windows' || runner.os == 'macOS' + if: runner.os == 'linux' || runner.os == 'macOS' run: | if [ "${{ matrix.os }}" = "macos-latest" ]; then brew install asciidoc elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then sudo apt install asciidoc fi - - name: build manual.html - run: | - if [ "${{ matrix.os }}" = "macos-latest" ]; then - asciidoc docs/manual.adoc - else - echo "No manual created for ${{ matrix.os }}." > docs/manual.html - fi + - name: build manual.html - Linux or MacOS + if: runner.os == 'windows' + run: echo "No manual created for ${{ matrix.os }}." > docs/manual.html + - name: build manual.html - regular + if: runner.os == 'linux' || runner.os == 'macOS' + run: asciidoc docs/manual.adoc - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From a105d31745a822fc5ca9dca4f36125b1a9478e50 Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Wed, 13 Mar 2024 17:35:35 +0100 Subject: [PATCH 06/10] Introduce include path for wxWidgets. --- .github/workflows/c-cpp.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 5044a2c5..36ff6f8f 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -47,8 +47,7 @@ jobs: run: ./configure - name: make - Windows if: runner.os == 'windows' - run: | - g++ -o GENtle *.cpp ipc/*.cpp + run: g++ -I\\wxWidgets-3.1.2\\include -I\\wxWidgets-3.1.2\\include\\msvc -o GENtle *.cpp ipc/*.cpp - name: make - Linux or MacOS if: runner.os == 'linux' || runner.os == 'macOS' run: | @@ -57,8 +56,8 @@ jobs: elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then make else - echo "Unexpected runer.os: ${{ runner.os }}" - exit + echo "Unexpected runer.os: ${{ runner.os }}" + exit fi - name: install asciidoc if: runner.os == 'linux' || runner.os == 'macOS' From 795e744c0aefdc4c9f298284aa5474a07f7b3014 Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Wed, 13 Mar 2024 18:07:13 +0100 Subject: [PATCH 07/10] ci windows: toying with paths --- .github/workflows/c-cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 36ff6f8f..bf739817 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -47,7 +47,9 @@ jobs: run: ./configure - name: make - Windows if: runner.os == 'windows' - run: g++ -I\\wxWidgets-3.1.2\\include -I\\wxWidgets-3.1.2\\include\\msvc -o GENtle *.cpp ipc/*.cpp + run: | + pwd + g++ -D__WXMSW__ -IC:\wxWidgets-3.1.2\include -IC:\wxWidgets-3.1.2\include\msvc -o GENtle *.cpp ipc/*.cpp - name: make - Linux or MacOS if: runner.os == 'linux' || runner.os == 'macOS' run: | From 13439d77fddfe4cef9ba4f97ee80d6a5e8cfd8eb Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Wed, 13 Mar 2024 20:46:50 +0100 Subject: [PATCH 08/10] build ci: wxWidgets needs to be built on Windows --- .github/workflows/c-cpp.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index bf739817..9e5b2368 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -25,6 +25,13 @@ jobs: run: | choco install mingw wxwidgets sqlite make choco install gnuwin32-m4 + echo "I: This is where our home is" + pwd + echo "I: Changing to wxWidgets install directory" + cd C:\wxWidgets-3.1.2 + pwd + echo "I: Now compiling wxWidgets" + mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release mswu - name: Install Dependencies - Linux if: runner.os == 'linux' run: | From b47b9678ad1d455354127260467e743ff0abb417 Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Fri, 15 Mar 2024 12:46:36 +0100 Subject: [PATCH 09/10] build: syntax action --- .github/workflows/c-cpp.yml | 12 ++++++------ CloningAssistant.cpp | 32 +++++++++++++++++--------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 9e5b2368..d0a43202 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -25,13 +25,13 @@ jobs: run: | choco install mingw wxwidgets sqlite make choco install gnuwin32-m4 - echo "I: This is where our home is" - pwd - echo "I: Changing to wxWidgets install directory" - cd C:\wxWidgets-3.1.2 + echo "I: This is where our home is" pwd - echo "I: Now compiling wxWidgets" - mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release mswu + echo "I: Changing to wxWidgets install directory" + cd C:\wxWidgets-3.1.2 + pwd + echo "I: Now compiling wxWidgets" + mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release mswu - name: Install Dependencies - Linux if: runner.os == 'linux' run: | diff --git a/CloningAssistant.cpp b/CloningAssistant.cpp index 429d6533..569255ec 100644 --- a/CloningAssistant.cpp +++ b/CloningAssistant.cpp @@ -345,18 +345,20 @@ void TCloningAssistantPanel::arrange () for ( c = b - 1 ; c >= 0 ; c-- ) { if ( b > 0 && c >= 0 && - i->children[c]->vector == i->children[b]->vector && - i->children[b]->original == NULL && - i->children[c]->original == NULL && + i->children[c]->vector == i->children[b]->vector && + i->children[b]->original == NULL && + i->children[c]->original == NULL && // i->children[c]->item && // i->children[b]->item && - i->children[c]->item->to + 50 < i->children[b]->item->from ) - break ; + i->children[c]->item->to + 50 < i->children[b]->item->from ) + { + break ; + } } if ( c >= 0 && ( i->children[b]->item->getType() != VIT_CDS || i->children[c]->item->getType() != VIT_CDS )) - { - lastx += 15 ; - } + { + lastx += 15 ; + } i->children[b]->resizeForText ( dc ) ; i->children[b]->r.x = lastx + 5 ; i->children[b]->r.y = 25 ; @@ -375,11 +377,11 @@ void TCloningAssistantPanel::do_drop ( TDDR *source , TDDR *target ) { if ( ( source->dragging & target->type & DDR_AS_SEQUENCE ) > 0 ) // Sequence { - if ( ! ca->tlist ) - { - wxPrintf( "E: TCloningAssistantPanel::do_drop: ! ca->tlist\n" ) ; - exit( -1 ) ; - } + if ( ! ca->tlist ) + { + wxPrintf( "E: TCloningAssistantPanel::do_drop: ! ca->tlist\n" ) ; + exit( -1 ) ; + } for ( unsigned int a = 0 ; a < ca->tlist->children.size() ; a++ ) { if ( ca->tlist->children[a] != target ) continue ; @@ -580,9 +582,9 @@ void TDDR::do_highlight ( const wxPoint& p ) void TDDR::duplicate_from ( const TDDR * const b ) // FIXME: This sounds like trouble, should be a contructor { TDDR *old_parent = parent ; - clear_children () ; // deleted the children pointed to and the vector itself + clear_children () ; // deleted the children pointed to and the vector itself *this = *b ; - children.clear () ; // clears only the vector, not the objects pointed to, i.e. the copied values + children.clear () ; // clears only the vector, not the objects pointed to, i.e. the copied values while ( children.size() < b->children.size() ) { From 65484b66d5edc815156213de064b312b68bb8c75 Mon Sep 17 00:00:00 2001 From: Steffen Moeller Date: Fri, 15 Mar 2024 20:14:43 +0100 Subject: [PATCH 10/10] build windows: Invocation of wxWidgets build --- .github/workflows/c-cpp.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index d0a43202..e9b30563 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -23,15 +23,16 @@ jobs: - name: Install Dependencies - Windows if: runner.os == 'windows' run: | - choco install mingw wxwidgets sqlite make - choco install gnuwin32-m4 + choco install --no-progress mingw wxwidgets sqlite make + choco install --no-progress gnuwin32-m4 echo "I: This is where our home is" pwd echo "I: Changing to wxWidgets install directory" cd C:\wxWidgets-3.1.2 pwd echo "I: Now compiling wxWidgets" - mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release mswu + #mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release mswu + mingw32-make - name: Install Dependencies - Linux if: runner.os == 'linux' run: |