From 369f32b97aa30e62898640234320cd280b81e51f Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Mon, 23 Sep 2024 21:09:55 +0200 Subject: [PATCH] enhancement: cherry-pick build improvements from upstream --- {docs => .github}/CODE_OF_CONDUCT.md | 0 .../pull_request_template.md | 0 .github/workflows/c-cpp.yml | 552 ++---------------- CMakeLists.txt | 204 ++++--- Makefile | 13 +- cmake/Findmpg123.cmake | 91 ++- cmake/Toolchain-aarch64-linux-gnu.cmake | 6 + cmake/Toolchain-arm-linux-gnueabihf.cmake | 6 + data/Amiberry.desktop | 28 + debian/changelog | 5 - debian/control | 12 - debian/copyright | 7 - debian/rules | 3 - debian/source/format | 1 - external/capsimage/CMakeLists.txt | 8 +- external/libguisan/CMakeLists.txt | 10 +- external/libguisan/Makefile | 8 - .../include/guisan/sdl/sdl2graphics.hpp | 2 +- .../include/guisan/sdl/sdlgraphics.hpp | 2 +- .../libguisan/include/guisan/sdl/sdlimage.hpp | 2 +- .../include/guisan/sdl/sdlimageloader.hpp | 2 +- .../libguisan/include/guisan/sdl/sdlinput.hpp | 2 +- .../libguisan/include/guisan/sdl/sdlpixel.hpp | 2 +- .../include/guisan/sdl/sdltruetypefont.hpp | 2 +- external/libguisan/src/sdl/sdlimageloader.cpp | 2 +- external/libguisan/src/widgets/listbox.cpp | 2 +- external/mt32emu/CMakeLists.txt | 109 ++-- make-bundle.sh | 12 +- src/main.cpp | 2 +- src/osdep/target.h | 6 +- 30 files changed, 341 insertions(+), 760 deletions(-) rename {docs => .github}/CODE_OF_CONDUCT.md (100%) rename PULL_REQUEST_TEMPLATE => .github/pull_request_template.md (100%) create mode 100644 cmake/Toolchain-aarch64-linux-gnu.cmake create mode 100644 cmake/Toolchain-arm-linux-gnueabihf.cmake create mode 100644 data/Amiberry.desktop delete mode 100644 debian/changelog delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/rules delete mode 100644 debian/source/format diff --git a/docs/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from docs/CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/PULL_REQUEST_TEMPLATE b/.github/pull_request_template.md similarity index 100% rename from PULL_REQUEST_TEMPLATE rename to .github/pull_request_template.md diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index b3f6fe0e2..4619c8230 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -34,7 +34,7 @@ jobs: run: | brew update brew upgrade - brew install autoconf sdl2 mpg123 sdl2_ttf sdl2_image flac libmpeg2 libserialport portmidi dylibbundler wget + brew install sdl2 mpg123 sdl2_ttf sdl2_image flac libmpeg2 libserialport portmidi dylibbundler - name: make for macOS X64 run: make -j4 PLATFORM=osx-x86 @@ -73,7 +73,7 @@ jobs: run: | brew update brew upgrade - brew install autoconf sdl2 mpg123 sdl2_ttf sdl2_image flac libmpeg2 libserialport portmidi dylibbundler wget + brew install sdl2 mpg123 sdl2_ttf sdl2_image flac libmpeg2 libserialport portmidi dylibbundler - name: make for macOS Apple Silicon run: make -j4 PLATFORM=osx-m1 @@ -104,8 +104,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: 'true' - name: Run the build process with Docker uses: addnab/docker-run-action@v3 @@ -113,47 +111,19 @@ jobs: image: midwan/amiberry-debian-x86_64:bullseye options: -v ${{ github.workspace }}:/build run: | - make -j8 PLATFORM=x86-64 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-x86_64 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bullseye-x86_64.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot + cmake -B build && cmake --build build -j4 + cpack --config build/CPackConfig.cmake - name: Upload artifact - if: github.ref_type == 'tag' uses: actions/upload-artifact@v4 with: name: amiberry-debian-bullseye-x86_64 - path: amiberry-${{ github.ref_name }}-debian-bullseye-x86_64.zip + path: amiberry_*.deb build-debian-bookworm-x86_64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: 'true' - name: Run the build process with Docker uses: addnab/docker-run-action@v3 @@ -161,47 +131,19 @@ jobs: image: midwan/amiberry-debian-x86_64:bookworm options: -v ${{ github.workspace }}:/build run: | - make -j8 PLATFORM=x86-64 + cmake -B build && cmake --build build -j4 + cpack --config build/CPackConfig.cmake - name: Upload artifact - if: github.ref_type != 'tag' uses: actions/upload-artifact@v4 with: name: amiberry-debian-bookworm-x86_64 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bookworm-x86_64.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot + path: amiberry_*.deb - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-x86_64 - path: amiberry-${{ github.ref_name }}-debian-bookworm-x86_64.zip - - build-debian-bookworm-aarch64-rpi5: + build-debian-bookworm-aarch64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: 'true' - name: Run the build process with Docker uses: addnab/docker-run-action@v3 @@ -209,48 +151,19 @@ jobs: image: midwan/amiberry-debian-aarch64:bookworm options: -v ${{ github.workspace }}:/build run: | - make -j8 PLATFORM=rpi5-64-sdl2 + cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-aarch64-linux-gnu.cmake -B build && cmake --build build -j4 + cpack --config build/CPackConfig.cmake - name: Upload artifact - if: github.ref_type != 'tag' uses: actions/upload-artifact@v4 with: - name: amiberry-debian-bookworm-aarch64-rpi5 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi5.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot + name: amiberry-debian-bookworm-aarch64 + path: amiberry_*.deb - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-aarch64-rpi5 - path: amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi5.zip - - build-debian-bookworm-armhf-rpi5: - if: (github.ref == 'refs/heads/master') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) + build-debian-bookworm-armhf: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: 'true' - name: Run the build process with Docker uses: addnab/docker-run-action@v3 @@ -258,47 +171,19 @@ jobs: image: midwan/amiberry-debian-armhf:bookworm options: -v ${{ github.workspace }}:/build run: | - make -j8 PLATFORM=rpi5-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-armhf-rpi5 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi5.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot + cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-arm-linux-gnueabihf.cmake -B build && cmake --build build -j4 + cpack --config build/CPackConfig.cmake - name: Upload artifact - if: github.ref_type == 'tag' uses: actions/upload-artifact@v4 with: - name: amiberry-debian-bookworm-armhf-rpi5 - path: amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi5.zip + name: amiberry-debian-bookworm-armhf + path: amiberry_*.deb - build-debian-bullseye-aarch64-rpi4: + build-debian-bullseye-aarch64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: 'true' - name: Run the build process with Docker uses: addnab/docker-run-action@v3 @@ -306,48 +191,19 @@ jobs: image: midwan/amiberry-debian-aarch64:bullseye options: -v ${{ github.workspace }}:/build run: | - make -j8 PLATFORM=rpi4-64-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-aarch64-rpi4 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bullseye-aarch64-rpi4.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot + cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-aarch64-linux-gnu.cmake -B build && cmake --build build -j4 + cpack --config build/CPackConfig.cmake - name: Upload artifact - if: github.ref_type == 'tag' uses: actions/upload-artifact@v4 with: - name: amiberry-debian-bullseye-aarch64-rpi4 - path: amiberry-${{ github.ref_name }}-debian-bullseye-aarch64-rpi4.zip + name: amiberry-debian-bullseye-aarch64 + path: amiberry_*.deb - build-debian-bullseye-armhf-rpi4: - if: (github.ref == 'refs/heads/master') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) + build-debian-bullseye-armhf: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: 'true' - name: Run the build process with Docker uses: addnab/docker-run-action@v3 @@ -355,336 +211,17 @@ jobs: image: midwan/amiberry-debian-armhf:bullseye options: -v ${{ github.workspace }}:/build run: | - make -j8 PLATFORM=rpi4-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-armhf-rpi4 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bullseye-armhf-rpi4.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot - - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-armhf-rpi4 - path: amiberry-${{ github.ref_name }}-debian-bullseye-armhf-rpi4.zip - - build-debian-bookworm-aarch64-rpi4: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: midwan/amiberry-debian-aarch64:bookworm - options: -v ${{ github.workspace }}:/build - run: | - make -j8 PLATFORM=rpi4-64-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-aarch64-rpi4 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi4.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot - - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-aarch64-rpi4 - path: amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi4.zip - - build-debian-bookworm-armhf-rpi4: - if: (github.ref == 'refs/heads/master') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: midwan/amiberry-debian-armhf:bookworm - options: -v ${{ github.workspace }}:/build - run: | - make -j8 PLATFORM=rpi4-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-armhf-rpi4 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi4.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot - - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-armhf-rpi4 - path: amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi4.zip - - build-debian-bullseye-aarch64-rpi3: - if: (github.ref == 'refs/heads/master') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: midwan/amiberry-debian-aarch64:bullseye - options: -v ${{ github.workspace }}:/build - run: | - make -j8 PLATFORM=rpi3-64-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-aarch64-rpi3 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bullseye-aarch64-rpi3.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot - - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-aarch64-rpi3 - path: amiberry-${{ github.ref_name }}-debian-bullseye-aarch64-rpi3.zip - - build-debian-bullseye-armhf-rpi3: - if: (github.ref == 'refs/heads/master') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: midwan/amiberry-debian-armhf:bullseye - options: -v ${{ github.workspace }}:/build - run: | - make -j8 PLATFORM=rpi3-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-armhf-rpi3 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bullseye-armhf-rpi3.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot - - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bullseye-armhf-rpi3 - path: amiberry-${{ github.ref_name }}-debian-bullseye-armhf-rpi3.zip - - build-debian-bookworm-aarch64-rpi3: - if: (github.ref == 'refs/heads/master') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: midwan/amiberry-debian-aarch64:bookworm - options: -v ${{ github.workspace }}:/build - run: | - make -j8 PLATFORM=rpi3-64-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-aarch64-rpi3 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi3.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot - - - name: Upload artifact - if: github.ref_type == 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-aarch64-rpi3 - path: amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi3.zip - - build-debian-bookworm-armhf-rpi3: - if: (github.ref == 'refs/heads/master') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: midwan/amiberry-debian-armhf:bookworm - options: -v ${{ github.workspace }}:/build - run: | - make -j8 PLATFORM=rpi3-sdl2 - - - name: Upload artifact - if: github.ref_type != 'tag' - uses: actions/upload-artifact@v4 - with: - name: amiberry-debian-bookworm-armhf-rpi3 - path: | - amiberry - cdroms/** - conf/** - controllers/** - data/** - floppies/** - harddrives/** - inputrecordings/** - kickstarts/** - lha/** - nvram/** - plugins/** - savestates/** - screenshots/** - whdboot/** - - - name: ZIP binaries - if: github.ref_type == 'tag' - run: zip -r amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi3.zip amiberry cdroms conf controllers data floppies harddrives kickstarts lha nvram plugins savestates screenshots whdboot + cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-arm-linux-gnueabihf.cmake -B build && cmake --build build -j4 + cpack --config build/CPackConfig.cmake - name: Upload artifact - if: github.ref_type == 'tag' uses: actions/upload-artifact@v4 with: - name: amiberry-debian-bookworm-armhf-rpi3 - path: amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi3.zip + name: amiberry-debian-bullseye-armhf + path: amiberry_*.deb create-release: - needs: [build-macOS-x86_64, build-macOS-apple-silicon, build-debian-bullseye-x86_64, build-debian-bookworm-x86_64, build-debian-bookworm-aarch64-rpi5, build-debian-bookworm-armhf-rpi5, build-debian-bullseye-aarch64-rpi4, build-debian-bullseye-armhf-rpi4, build-debian-bookworm-aarch64-rpi4, build-debian-bookworm-armhf-rpi4, build-debian-bullseye-aarch64-rpi3, build-debian-bullseye-armhf-rpi3, build-debian-bookworm-aarch64-rpi3, build-debian-bookworm-armhf-rpi3] + needs: [build-macOS-x86_64, build-macOS-apple-silicon, build-debian-bookworm-x86_64, build-debian-bookworm-aarch64, build-debian-bookworm-armhf, build-debian-bullseye-x86_64, build-debian-bullseye-aarch64, build-debian-bullseye-armhf] runs-on: ubuntu-latest if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') steps: @@ -711,21 +248,15 @@ jobs: artifacts: | amiberry-macOS-64bit-intel/amiberry-${{ github.ref_name }}-macOS-x86_64.zip amiberry-macOS-64bit-apple-silicon/amiberry-${{ github.ref_name }}-macOS-apple-silicon.zip - amiberry-debian-bullseye-x86_64/amiberry-${{ github.ref_name }}-debian-bullseye-x86_64.zip - amiberry-debian-bookworm-x86_64/amiberry-${{ github.ref_name }}-debian-bookworm-x86_64.zip - amiberry-debian-bookworm-aarch64-rpi5/amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi5.zip - amiberry-debian-bookworm-armhf-rpi5/amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi5.zip - amiberry-debian-bullseye-aarch64-rpi4/amiberry-${{ github.ref_name }}-debian-bullseye-aarch64-rpi4.zip - amiberry-debian-bullseye-armhf-rpi4/amiberry-${{ github.ref_name }}-debian-bullseye-armhf-rpi4.zip - amiberry-debian-bookworm-aarch64-rpi4/amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi4.zip - amiberry-debian-bookworm-armhf-rpi4/amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi4.zip - amiberry-debian-bullseye-aarch64-rpi3/amiberry-${{ github.ref_name }}-debian-bullseye-aarch64-rpi3.zip - amiberry-debian-bullseye-armhf-rpi3/amiberry-${{ github.ref_name }}-debian-bullseye-armhf-rpi3.zip - amiberry-debian-bookworm-aarch64-rpi3/amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi3.zip - amiberry-debian-bookworm-armhf-rpi3/amiberry-${{ github.ref_name }}-debian-bookworm-armhf-rpi3.zip + amiberry-debian-bookworm-x86_64/amiberry_*.deb + amiberry-debian-bookworm-aarch64/amiberry_*.deb + amiberry-debian-bookworm-armhf/amiberry_*.deb + amiberry-debian-bullseye-x86_64/amiberry_*.deb + amiberry-debian-bullseye-aarch64/amiberry_*.deb + amiberry-debian-bullseye-armhf/amiberry_*.deb create-prerelease: - needs: [build-macOS-x86_64, build-macOS-apple-silicon, build-debian-bullseye-x86_64, build-debian-bookworm-x86_64, build-debian-bookworm-aarch64-rpi5, build-debian-bullseye-aarch64-rpi4, build-debian-bookworm-aarch64-rpi4] + needs: [build-macOS-x86_64, build-macOS-apple-silicon, build-debian-bookworm-x86_64, build-debian-bookworm-aarch64, build-debian-bookworm-armhf, build-debian-bullseye-x86_64, build-debian-bullseye-aarch64, build-debian-bullseye-armhf] runs-on: ubuntu-latest if: github.ref_type == 'tag' && startsWith(github.ref_name, 'preview-v') steps: @@ -753,8 +284,9 @@ jobs: artifacts: | amiberry-macOS-64bit-intel/amiberry-${{ github.ref_name }}-macOS-x86_64.zip amiberry-macOS-64bit-apple-silicon/amiberry-${{ github.ref_name }}-macOS-apple-silicon.zip - amiberry-debian-bullseye-x86_64/amiberry-${{ github.ref_name }}-debian-bullseye-x86_64.zip - amiberry-debian-bookworm-x86_64/amiberry-${{ github.ref_name }}-debian-bookworm-x86_64.zip - amiberry-debian-bookworm-aarch64-rpi5/amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi5.zip - amiberry-debian-bullseye-aarch64-rpi4/amiberry-${{ github.ref_name }}-debian-bullseye-aarch64-rpi4.zip - amiberry-debian-bookworm-aarch64-rpi4/amiberry-${{ github.ref_name }}-debian-bookworm-aarch64-rpi4.zip + amiberry-debian-bookworm-x86_64/amiberry_*.deb + amiberry-debian-bookworm-aarch64/amiberry_*.deb + amiberry-debian-bookworm-armhf/amiberry_*.deb + amiberry-debian-bullseye-x86_64/amiberry_*.deb + amiberry-debian-bullseye-aarch64/amiberry_*.deb + amiberry-debian-bullseye-armhf/amiberry_*.deb diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c6b79b2e..0d4281d88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.16) -project(amiberry) +project(amiberry-lite VERSION 5.7.5) enable_language(C CXX ASM) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_C_FLAGS_RELEASE "-O3 -pipe") -set(CMAKE_C_FLAGS_DEBUG "-Og -g -rdynamic -funwind-tables -DDEBUG -Wl,--export-dynamic -pipe") +set(CMAKE_C_FLAGS_RELEASE "-O3 -pipe -fno-pie -no-pie") +set(CMAKE_C_FLAGS_DEBUG "-Og -g -funwind-tables -DDEBUG -pipe -fno-pie -no-pie") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}") @@ -33,38 +33,20 @@ endif () # Needed so that cmake uses our find modules. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -include(CheckSymbolExists) -function(detect_architecture symbol arch) - if (NOT DEFINED ARCHITECTURE) - set(CMAKE_REQUIRED_QUIET 1) - check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch}) - unset(CMAKE_REQUIRED_QUIET) - - # The output variable needs to be unique across invocations otherwise - # CMake's crazy scope rules will keep it defined - if (ARCHITECTURE_${arch}) - set(ARCHITECTURE "${arch}" PARENT_SCOPE) - endif () - endif () -endfunction() - -detect_architecture("__x86_64__" x86_64) -detect_architecture("__aarch64__" arm64) -detect_architecture("__arm__" arm32) - -message(STATUS "Target architecture: ${ARCHITECTURE}") - if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(MACOS TRUE) message(STATUS "macOS platform detected") - if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR ARCHITECTURE MATCHES "arm64") - set(CMAKE_EXE_LINKER_FLAGS "-L/usr/local/lib external/libguisan/dylib/libguisan.dylib -L/opt/homebrew/lib/ -framework IOKit -framework Foundation") + if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") + include_directories("/opt/homebrew/include") + set(CMAKE_EXE_LINKER_FLAGS "-L/opt/homebrew/lib -framework IOKit -framework Foundation -liconv") else () - set(CMAKE_EXE_LINKER_FLAGS "-L/usr/local/lib external/libguisan/dylib/libguisan.dylib -framework IOKit -framework Foundation") + include_directories("/usr/local/include") + set(CMAKE_EXE_LINKER_FLAGS "-L/usr/local/lib -framework IOKit -framework Foundation -liconv") endif () endif () -add_executable(${PROJECT_NAME} +# Define the list of source files +set(SOURCE_FILES src/a2065.cpp src/a2091.cpp src/akiko.cpp @@ -329,10 +311,19 @@ add_executable(${PROJECT_NAME} src/cpuemu_44.cpp ) -target_compile_options(${PROJECT_NAME} PRIVATE -fno-pie) +if (APPLE) + add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${SOURCE_FILES}) + set_target_properties(${PROJECT_NAME} PROPERTIES + MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/Info.plist + ) +else () + add_executable(${PROJECT_NAME} ${SOURCE_FILES}) +endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE _FILE_OFFSET_BITS=64) -if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR ARCHITECTURE MATCHES "arm64") +if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") target_compile_definitions(${PROJECT_NAME} PRIVATE CPU_AARCH64) target_sources(${PROJECT_NAME} PRIVATE src/osdep/aarch64_helper.s @@ -343,7 +334,7 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR ARCHITECTURE MATCHES "arm64") ) endif () -if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR ARCHITECTURE MATCHES "arm32") +if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm") target_compile_definitions(${PROJECT_NAME} PRIVATE CPU_arm ARMV6_ASSEMBLY ARMV6T2 USE_ARMNEON ARM_HAS_DIV) target_sources(${PROJECT_NAME} PRIVATE src/osdep/neon_helper.s @@ -354,9 +345,10 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR ARCHITECTURE MATCHES "arm32") ) endif () -find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2) -find_package(SDL2_image REQUIRED) -find_package(SDL2_ttf REQUIRED) +find_package(SDL2 CONFIG REQUIRED) +find_package(SDL2_image MODULE REQUIRED) +find_package(SDL2_ttf MODULE REQUIRED) +include_directories(${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR} ${SDL2_TTF_INCLUDE_DIR}) if (USE_GPIOD) target_compile_definitions(${PROJECT_NAME} PRIVATE USE_GPIOD) @@ -389,9 +381,8 @@ add_subdirectory(external/libguisan) # Add dependencies to ensure external libraries are built add_dependencies(${PROJECT_NAME} mt32emu floppybridge capsimage guisan) -target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS} src src/osdep src/include src/threaddep src/archivers external/libguisan/include external/mt32emu/src external/floppybridge/src) -target_link_libraries(${PROJECT_NAME} PRIVATE SDL2 SDL2_image SDL2_ttf guisan mt32emu ${DBUS_LIBRARIES} FLAC portmidi png mpg123 mpeg2convert mpeg2 serialport z) -target_link_options(${PROJECT_NAME} PRIVATE "LINKER:-as-needed,-no-pie") +target_include_directories(${PROJECT_NAME} PRIVATE src src/osdep src/include src/threaddep src/archivers src/ppc/pearpc external/libguisan/include external/mt32emu/src external/floppybridge/src) +target_link_libraries(${PROJECT_NAME} PRIVATE SDL2 SDL2_image SDL2_ttf guisan mt32emu ${DBUS_LIBRARIES} FLAC portmidi png MPG123::libmpg123 mpeg2convert mpeg2 serialport z pthread dl) if (USE_OPENGL) target_compile_definitions(${PROJECT_NAME} PRIVATE USE_OPENGL) @@ -453,58 +444,93 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD DEPENDS external/capsimage) # Install the executable -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) +if (APPLE) + install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION .) +else () + install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) + # Install additional directories + install(DIRECTORY ${CMAKE_SOURCE_DIR}/cdroms + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/controllers + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/data + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/floppies + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/harddrives + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/inputrecordings + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/kickstarts + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/lha + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/nvram + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/savestates + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/screenshots + DESTINATION share/${PROJECT_NAME} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/whdboot + DESTINATION share/${PROJECT_NAME} + ) -# Install additional directories -install(DIRECTORY ${CMAKE_SOURCE_DIR}/cdroms - DESTINATION share/${PROJECT_NAME}/cdroms -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf - DESTINATION share/${PROJECT_NAME}/conf -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/controllers - DESTINATION share/${PROJECT_NAME}/controllers -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/data - DESTINATION share/${PROJECT_NAME}/data -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/floppies - DESTINATION share/${PROJECT_NAME}/floppies -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/harddrives - DESTINATION share/${PROJECT_NAME}/harddrives -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/inputrecordings - DESTINATION share/${PROJECT_NAME}/inputrecordings -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/kickstarts - DESTINATION share/${PROJECT_NAME}/kickstarts -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/lha - DESTINATION share/${PROJECT_NAME}/lha -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/nvram - DESTINATION share/${PROJECT_NAME}/nvram -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins - DESTINATION share/${PROJECT_NAME}/plugins -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/savestates - DESTINATION share/${PROJECT_NAME}/savestates -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/screenshots - DESTINATION share/${PROJECT_NAME}/screenshots -) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/whdboot - DESTINATION share/${PROJECT_NAME}/whdboot -) + # Install shared libraries + install(FILES ${CMAKE_BINARY_DIR}/external/floppybridge/libfloppybridge.so + DESTINATION share/${PROJECT_NAME}/plugins + ) + install(FILES ${CMAKE_BINARY_DIR}/external/capsimage/libcapsimage.so + DESTINATION share/${PROJECT_NAME}/plugins + ) -# Install shared libraries -install(FILES ${CMAKE_BINARY_DIR}/external/floppybridge/libfloppybridge.so - DESTINATION share/${PROJECT_NAME}/plugins -) -install(FILES ${CMAKE_BINARY_DIR}/external/capsimage/libcapsimage.so - DESTINATION share/${PROJECT_NAME}/plugins -) + # Install desktop file + install(FILES ${CMAKE_SOURCE_DIR}/data/Amiberry.desktop + DESTINATION share/applications + ) +endif () + +include(InstallRequiredSystemLibraries) + +if(APPLE) + set(CPACK_GENERATOR "Bundle") + set(CPACK_BUNDLE_NAME "Amiberry") + set(CPACK_BUNDLE_PLIST ${CMAKE_SOURCE_DIR}/Info.plist) + set(CPACK_BUNDLE_APPLE_ENTITLEMENTS ${CMAKE_SOURCE_DIR}/Entitlements.plist) + set(CPACK_BUNDLE_ICON ${CMAKE_SOURCE_DIR}/data/amiberry.png) +else() + set(CPACK_GENERATOR "DEB") + set(CPACK_SOURCE_IGNORE_FILES .git/ .github/ .vscode/ _CPack_Packages/) + SET(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) + SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) + SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) + SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + SET(CPACK_PACKAGE_VENDOR "BlitterStudio") + SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") + SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/docs/README.md") + SET(CPACK_DEBIAN_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) + set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://amiberry.com") + set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dimitris Panokostas ") # Required + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.27), libstdc++6 (>= 8.3.0), libsdl2-2.0-0, libsdl2-image-2.0-0, libsdl2-ttf-2.0-0, flac, libmpg123-0, libpng16-16, zlib1g, libserialport0, libportmidi0, libmpeg2-4") # Adjust dependencies as needed + set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Amiberry-Lite is an optimized Amiga emulator various platforms.") + set(CPACK_DEBIAN_PACKAGE_SECTION "games") + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +endif() -include(CPack) \ No newline at end of file +include(CPack) diff --git a/Makefile b/Makefile index bb0acc7b1..063982ab5 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ CPPFLAGS = -MD -MT $@ -MF $(@:%.o=%.d) $(SDL_CFLAGS) -Iexternal/libguisan/includ CFLAGS=-pipe -Wno-shift-overflow -Wno-narrowing -fno-pie LDFLAGS = $(SDL_LDFLAGS) -lSDL2_image -lSDL2_ttf -lserialport -lportmidi -lguisan -Lexternal/libguisan/lib -lmt32emu -Lexternal/mt32emu -LDFLAGS += -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lpthread -lz -lpng -lrt -lFLAC -lmpg123 -ldl -lmpeg2convert -lmpeg2 -lstdc++fs -no-pie +LDFLAGS += -Wl,-O1 -lpthread -lz -lpng -lFLAC -lmpg123 -ldl -lmpeg2convert -lmpeg2 -no-pie ifdef USE_OPENGL CFLAGS += -DUSE_OPENGL @@ -76,7 +76,7 @@ endif ifndef DEBUG CFLAGS += -O3 else - CFLAGS += -g -rdynamic -funwind-tables -DDEBUG -Wl,--export-dynamic + CFLAGS += -g -rdynamic -funwind-tables -DDEBUG endif ifdef USE_OLDGCC @@ -239,16 +239,17 @@ else ifeq ($(PLATFORM),oga) # macOS Apple Silicon (SDL2, 64-bit, Apple Silicon) else ifeq ($(PLATFORM),osx-m1) - LDFLAGS = -L/usr/local/lib external/libguisan/dylib/libguisan.dylib -Lexternal/mt32emu -lSDL2_image -lSDL2_ttf -lpng -liconv -lz -lFLAC -L/opt/homebrew/lib/ -lmpg123 -lmpeg2 -lmpeg2convert -lserialport -lportmidi -lmt32emu $(SDL_LDFLAGS) -framework IOKit -framework Foundation - CPPFLAGS = -MD -MT $@ -MF $(@:%.o=%.d) $(SDL_CFLAGS) -I/opt/homebrew/include -Iexternal/libguisan/include -Isrc -Isrc/osdep -Isrc/threaddep -Isrc/include -Isrc/archivers -Iexternal/floppybridge/src -Iexternal/mt32emu/src -D_FILE_OFFSET_BITS=64 -DCPU_AARCH64 $(SDL_CFLAGS) + LDFLAGS += -L/opt/homebrew/lib/ -framework IOKit -framework Foundation -liconv + CPPFLAGS += $(CPPFLAGS64) + CPPFLAGS += -I/opt/homebrew/include CXX=/usr/bin/c++ # DEBUG=1 APPBUNDLE=1 # macOS intel (SDL2, 64-bit, x86-64) else ifeq ($(PLATFORM),osx-x86) - LDFLAGS = -L/usr/local/lib external/libguisan/dylib/libguisan.dylib -Lexternal/mt32emu -lSDL2_image -lSDL2_ttf -lpng -liconv -lz -lFLAC -lmpg123 -lmpeg2 -lmpeg2convert -lserialport -lportmidi -lmt32emu $(SDL_LDFLAGS) -framework IOKit -framework Foundation - CPPFLAGS = -MD -MT $@ -MF $(@:%.o=%.d) $(SDL_CFLAGS) -I/usr/local/include -Iexternal/libguisan/include -Isrc -Isrc/osdep -Isrc/threaddep -Isrc/include -Isrc/archivers -Iexternal/floppybridge/src -Iexternal/mt32emu/src -D_FILE_OFFSET_BITS=64 $(SDL_CFLAGS) + LDFLAGS += -L/usr/local/lib -framework IOKit -framework Foundation -liconv + CPPFLAGS += -I/usr/local/include CXX=/usr/bin/c++ # DEBUG=1 APPBUNDLE=1 diff --git a/cmake/Findmpg123.cmake b/cmake/Findmpg123.cmake index 046f3f58f..ff3d19ee0 100644 --- a/cmake/Findmpg123.cmake +++ b/cmake/Findmpg123.cmake @@ -1,31 +1,58 @@ -# - Find mpg123 -# Find the native mpg123 includes and libraries -# -# MPG123_INCLUDE_DIRS - where to find mpg123.h, etc. -# MPG123_LIBRARIES - List of libraries when using mpg123. -# MPG123_FOUND - True if Mpg123 found. - -if (MPG123_INCLUDE_DIR) +#[=======================================================================[.rst: +Findmpg123 +------- + +Finds the mpg123 library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module provides the following imported targets, if found: + +``MPG123::libmpg123`` + The mpg123 library + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables: + +``mpg123_FOUND`` + True if the system has the mpg123 package. +``mpg123_VERSION`` + The version of mpg123 that was found on the system. + +Cache Variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``mpg123_INCLUDE_DIR`` + The directory containing ``mpg123.h``. +``mpg123_LIBRARY`` + The path to the mpg123 library. + +#]=======================================================================] + +if (mpg123_INCLUDE_DIR) # Already in cache, be silent - set(MPG123_FIND_QUIETLY TRUE) + set(mpg123_FIND_QUIETLY TRUE) endif () find_package (PkgConfig QUIET) pkg_check_modules(PC_MPG123 QUIET libmpg123>=1.25.10) -set (MPG123_VERSION ${PC_MPG123_VERSION}) - -find_path (MPG123_INCLUDE_DIR mpg123.h +find_path (mpg123_INCLUDE_DIR mpg123.h HINTS ${PC_MPG123_INCLUDEDIR} ${PC_MPG123_INCLUDE_DIRS} - ${MPG123_ROOT} + ${mpg123_ROOT} ) # MSVC built mpg123 may be named mpg123_static. # The provided project files name the library with the lib prefix. -find_library (MPG123_LIBRARY +find_library (mpg123_LIBRARY NAMES mpg123 mpg123_static @@ -34,31 +61,35 @@ find_library (MPG123_LIBRARY HINTS ${PC_MPG123_LIBDIR} ${PC_MPG123_LIBRARY_DIRS} - ${MPG123_ROOT} + ${mpg123_ROOT} ) -# Handle the QUIETLY and REQUIRED arguments and set MPG123_FOUND +if (PC_MPG123_FOUND) + set (mpg123_VERSION ${PC_MPG123_VERSION}) +elseif (mpg123_INCLUDE_DIR) + file (READ "${mpg123_INCLUDE_DIR}/mpg123.h" _mpg123_h) + string (REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" _mpg123_version_re "${_mpg123_h}") + set (mpg123_VERSION "${_mpg123_version_re}") +endif () + +# Handle the QUIETLY and REQUIRED arguments and set mpg123_FOUND # to TRUE if all listed variables are TRUE. include(FindPackageHandleStandardArgs) find_package_handle_standard_args (mpg123 REQUIRED_VARS - MPG123_LIBRARY - MPG123_INCLUDE_DIR + mpg123_LIBRARY + mpg123_INCLUDE_DIR VERSION_VAR - MPG123_VERSION + mpg123_VERSION ) -if (MPG123_FOUND) - set (MPG123_LIBRARIES ${MPG123_LIBRARY}) - set (MPG123_INCLUDE_DIRS ${MPG123_INCLUDE_DIR}) - - if (NOT TARGET MPG123::libmpg123) - add_library (MPG123::libmpg123 UNKNOWN IMPORTED) - set_target_properties (MPG123::libmpg123 PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${MPG123_INCLUDE_DIRS}" - IMPORTED_LOCATION "${MPG123_LIBRARIES}" +if (mpg123_FOUND AND NOT TARGET MPG123::libmpg123) + add_library (MPG123::libmpg123 UNKNOWN IMPORTED) + set_target_properties (MPG123::libmpg123 + PROPERTIES + IMPORTED_LOCATION "${mpg123_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${mpg123_INCLUDE_DIR}" ) - endif () endif () -mark_as_advanced(MPG123_INCLUDE_DIR MPG123_LIBRARY) \ No newline at end of file +mark_as_advanced(mpg123_INCLUDE_DIR mpg123_LIBRARY) \ No newline at end of file diff --git a/cmake/Toolchain-aarch64-linux-gnu.cmake b/cmake/Toolchain-aarch64-linux-gnu.cmake new file mode 100644 index 000000000..dbcc4697c --- /dev/null +++ b/cmake/Toolchain-aarch64-linux-gnu.cmake @@ -0,0 +1,6 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) +set(CMAKE_SYSTEM_PROCESSOR aarch64) +set(CMAKE_CROSSCOMPILING TRUE) +set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64) \ No newline at end of file diff --git a/cmake/Toolchain-arm-linux-gnueabihf.cmake b/cmake/Toolchain-arm-linux-gnueabihf.cmake new file mode 100644 index 000000000..9e57c2d79 --- /dev/null +++ b/cmake/Toolchain-arm-linux-gnueabihf.cmake @@ -0,0 +1,6 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) +set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) +set(CMAKE_SYSTEM_PROCESSOR arm) +set(CMAKE_CROSSCOMPILING TRUE) +set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf) \ No newline at end of file diff --git a/data/Amiberry.desktop b/data/Amiberry.desktop new file mode 100644 index 000000000..5bfab694a --- /dev/null +++ b/data/Amiberry.desktop @@ -0,0 +1,28 @@ +[Desktop Entry] + +# The type of the Desktop Entry, usually Application +Type = Application + +# The version of the Desktop Entry specification to which this file complies +Version = 1.0 + +# The name of the application +Name = Amiberry + +# A comment which can/will be used as a tooltip +Comment = Amiga Emulator + +# The executable of the application, possibly with arguments +Exec = /usr/bin/amiberry + +# The name of the icon that will be used to display this entry +Icon = /usr/share/amiberry/data/amiberry.png + +# Describes whether this application needs to be run in a terminal or not +Terminal = false + +# Describes the categories in which this entry should be shown +Categories = Game;Emulator; + +# Describes the encoding for the desktop entry +Encoding=UTF-8 diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 3a41827c9..000000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -amiberry (6.3.5-1) UNRELEASED; urgency=low - - * Initial release. (Closes: #XXXXXX) - - -- Dimitris Panokostas Wed, 11 Sep 2024 18:53:49 +0200 diff --git a/debian/control b/debian/control deleted file mode 100644 index aea589a74..000000000 --- a/debian/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: amiberry -Maintainer: Dimitris Panokostas -Section: games -Priority: optional -Standards-Version: 4.6.2 -Build-Depends: debhelper-compat (= 13) - -Package: amiberry -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: An optimized Amiga emulator - Amiberry is an optimized multi-platform Amiga emulator diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index ff3d2429c..000000000 --- a/debian/copyright +++ /dev/null @@ -1,7 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: Amiberry -Upstream-Contact: Dimitris Panokostas -Source: https://github.com/BlitterStudio/amiberry - -Files: * -License: GPL-3 \ No newline at end of file diff --git a/debian/rules b/debian/rules deleted file mode 100644 index 933b1da34..000000000 --- a/debian/rules +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/make -f -%: - dh $@ \ No newline at end of file diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8d8..000000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/external/capsimage/CMakeLists.txt b/external/capsimage/CMakeLists.txt index 9586b5c81..378658b2b 100644 --- a/external/capsimage/CMakeLists.txt +++ b/external/capsimage/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.16) project(capsimage) set(PROJECT_TITLE CAPSImage) @@ -71,9 +71,9 @@ install(TARGETS ${PROJECT_NAME} FRAMEWORK DESTINATION "/Library/Frameworks" PUBLIC_HEADER DESTINATION include/caps${INCLUDE_SUFFIX}) -if (NOT APPLE OR NOT BUILD_FRAMEWORK) - install(FILES ${API_HEADERS} DESTINATION include/caps${INCLUDE_SUFFIX}) -endif() +#if (NOT APPLE OR NOT BUILD_FRAMEWORK) +# install(FILES ${API_HEADERS} DESTINATION include/caps${INCLUDE_SUFFIX}) +#endif() if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_FRAMEWORK) message(STATUS "macOS platform detected") diff --git a/external/libguisan/CMakeLists.txt b/external/libguisan/CMakeLists.txt index c96ef4a89..9e4ddc924 100644 --- a/external/libguisan/CMakeLists.txt +++ b/external/libguisan/CMakeLists.txt @@ -55,12 +55,6 @@ add_library(guisan STATIC src/widgets/textfield.cpp src/widgets/togglebutton.cpp src/widgets/window.cpp) -target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS} ./include) +target_include_directories(${PROJECT_NAME} PRIVATE include) +target_link_libraries(${PROJECT_NAME} SDL2 SDL2_ttf SDL2_image) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SDL2IMAGE_LIBRARIES}) - -install(TARGETS ${PROJECT_NAME} - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin -) diff --git a/external/libguisan/Makefile b/external/libguisan/Makefile index 652725b56..ba6dfb8cf 100644 --- a/external/libguisan/Makefile +++ b/external/libguisan/Makefile @@ -8,14 +8,6 @@ SOURCE = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.cpp)) OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) DEPS = $(SOURCE:%.cpp=%.d) -ifneq (,$(findstring osx,$(PLATFORM))) - # Create DYLIB on OS X - TARGET=dylib/libguisan.dylib - LDFLAGS += -lsdl2 -no_branch_islands - AR=$(CXX) -dynamiclib -std=c++14 -install_name libguisan.dylib -fvisibility=hidden -undefined dynamic_lookup -o - ARARGS= -endif - CPPFLAGS +=-I./include $(SDL_CFLAGS) -MD -MT $@ -MF $(@:%.o=%.d) .PHONY : all clean diff --git a/external/libguisan/include/guisan/sdl/sdl2graphics.hpp b/external/libguisan/include/guisan/sdl/sdl2graphics.hpp index 21da0af61..eceaf47ef 100644 --- a/external/libguisan/include/guisan/sdl/sdl2graphics.hpp +++ b/external/libguisan/include/guisan/sdl/sdl2graphics.hpp @@ -57,7 +57,7 @@ #ifndef GCN_SDL2GRAPHICS_HPP #define GCN_SDL2GRAPHICS_HPP -#include "SDL.h" +#include #include "guisan/color.hpp" #include "guisan/graphics.hpp" diff --git a/external/libguisan/include/guisan/sdl/sdlgraphics.hpp b/external/libguisan/include/guisan/sdl/sdlgraphics.hpp index 7fa22aef4..a20ad2e82 100644 --- a/external/libguisan/include/guisan/sdl/sdlgraphics.hpp +++ b/external/libguisan/include/guisan/sdl/sdlgraphics.hpp @@ -57,7 +57,7 @@ #ifndef GCN_SDLGRAPHICS_HPP #define GCN_SDLGRAPHICS_HPP -#include "SDL.h" +#include #include "guisan/color.hpp" #include "guisan/graphics.hpp" diff --git a/external/libguisan/include/guisan/sdl/sdlimage.hpp b/external/libguisan/include/guisan/sdl/sdlimage.hpp index 0aaa2bffe..1927e911e 100644 --- a/external/libguisan/include/guisan/sdl/sdlimage.hpp +++ b/external/libguisan/include/guisan/sdl/sdlimage.hpp @@ -57,7 +57,7 @@ #ifndef GCN_SDLIMAGE_HPP #define GCN_SDLIMAGE_HPP -#include "SDL.h" +#include #include diff --git a/external/libguisan/include/guisan/sdl/sdlimageloader.hpp b/external/libguisan/include/guisan/sdl/sdlimageloader.hpp index 5437c3d9e..fd7f74ed3 100644 --- a/external/libguisan/include/guisan/sdl/sdlimageloader.hpp +++ b/external/libguisan/include/guisan/sdl/sdlimageloader.hpp @@ -60,7 +60,7 @@ #include "guisan/imageloader.hpp" #include "guisan/platform.hpp" -#include "SDL.h" +#include namespace gcn { diff --git a/external/libguisan/include/guisan/sdl/sdlinput.hpp b/external/libguisan/include/guisan/sdl/sdlinput.hpp index 9ae74871d..76d9f98df 100644 --- a/external/libguisan/include/guisan/sdl/sdlinput.hpp +++ b/external/libguisan/include/guisan/sdl/sdlinput.hpp @@ -59,7 +59,7 @@ #include -#include "SDL.h" +#include #include "guisan/input.hpp" #include "guisan/keyinput.hpp" diff --git a/external/libguisan/include/guisan/sdl/sdlpixel.hpp b/external/libguisan/include/guisan/sdl/sdlpixel.hpp index 242d0f2b0..c0899c62d 100644 --- a/external/libguisan/include/guisan/sdl/sdlpixel.hpp +++ b/external/libguisan/include/guisan/sdl/sdlpixel.hpp @@ -57,7 +57,7 @@ #ifndef GCN_SDLPIXEL_HPP #define GCN_SDLPIXEL_HPP -#include "SDL.h" +#include #include "guisan/color.hpp" namespace gcn diff --git a/external/libguisan/include/guisan/sdl/sdltruetypefont.hpp b/external/libguisan/include/guisan/sdl/sdltruetypefont.hpp index 602e79bed..8ec96969b 100644 --- a/external/libguisan/include/guisan/sdl/sdltruetypefont.hpp +++ b/external/libguisan/include/guisan/sdl/sdltruetypefont.hpp @@ -47,7 +47,7 @@ #include #include -#include "SDL_ttf.h" +#include #include "guisan/color.hpp" #include "guisan/font.hpp" diff --git a/external/libguisan/src/sdl/sdlimageloader.cpp b/external/libguisan/src/sdl/sdlimageloader.cpp index bd4b3e64e..ef44777bf 100644 --- a/external/libguisan/src/sdl/sdlimageloader.cpp +++ b/external/libguisan/src/sdl/sdlimageloader.cpp @@ -60,7 +60,7 @@ #include "guisan/sdl/sdlimage.hpp" -#include "SDL_image.h" +#include #include "guisan/exception.hpp" #include "guisan/sdl/sdlimageloader.hpp" diff --git a/external/libguisan/src/widgets/listbox.cpp b/external/libguisan/src/widgets/listbox.cpp index e3eaddb76..2410171a8 100644 --- a/external/libguisan/src/widgets/listbox.cpp +++ b/external/libguisan/src/widgets/listbox.cpp @@ -133,7 +133,7 @@ namespace gcn startRow = 0; } - const auto inactive_color = Color(170, 170, 170); + const auto inactive_color = getSelectionColor() - 0x303030; // The y coordinate where we start to draw the text is // simply the y coordinate multiplied with the font height. diff --git a/external/mt32emu/CMakeLists.txt b/external/mt32emu/CMakeLists.txt index 93838a818..d911c6fea 100644 --- a/external/mt32emu/CMakeLists.txt +++ b/external/mt32emu/CMakeLists.txt @@ -323,63 +323,64 @@ target_include_directories(mt32emu set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Runtime) set(libmt32emu_COMPONENT_DEVEL COMPONENT Devel) -install(TARGETS mt32emu EXPORT MT32EmuTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) -# TODO: Use NAMELINK_COMPONENT with CMake 3.12 instead. if(libmt32emu_SHARED) - install(TARGETS mt32emu EXPORT MT32EmuTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL} NAMELINK_ONLY - ) -endif() + install(TARGETS mt32emu EXPORT MT32EmuTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + # TODO: Use NAMELINK_COMPONENT with CMake 3.12 instead. -install(DIRECTORY - "${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ${libmt32emu_COMPONENT_DEVEL} -) -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ${libmt32emu_COMPONENT_DEVEL} -) -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/mt32emu.pc - DESTINATION ${libmt32emu_PKGCONFIG_INSTALL_DIR} - ${libmt32emu_COMPONENT_DEVEL} -) -install(EXPORT MT32EmuTargets - DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR} - NAMESPACE MT32Emu:: - ${libmt32emu_COMPONENT_DEVEL} -) -configure_file(cmake/MT32EmuConfig.cmake.in cmake/MT32EmuConfig.cmake @ONLY) -include(CMakePackageConfigHelpers) -write_basic_package_version_file(cmake/MT32EmuConfigVersion.cmake - VERSION ${libmt32emu_VERSION} - COMPATIBILITY SameMajorVersion -) -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfigVersion.cmake - DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR} - ${libmt32emu_COMPONENT_DEVEL} -) -if(libmt32emu_EXT_MODULE) - install(FILES - cmake/CheckDependencies.cmake - cmake/${libmt32emu_EXT_MODULE} - DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR} - ${libmt32emu_COMPONENT_DEVEL} - ) -endif() + install(TARGETS mt32emu EXPORT MT32EmuTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL} NAMELINK_ONLY + ) -install(FILES - AUTHORS.txt COPYING.txt COPYING.LESSER.txt NEWS.txt README.md TODO.txt - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/munt/${PROJECT_NAME} -) + install(DIRECTORY + "${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ${libmt32emu_COMPONENT_DEVEL} + ) + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ${libmt32emu_COMPONENT_DEVEL} + ) + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/mt32emu.pc + DESTINATION ${libmt32emu_PKGCONFIG_INSTALL_DIR} + ${libmt32emu_COMPONENT_DEVEL} + ) + install(EXPORT MT32EmuTargets + DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR} + NAMESPACE MT32Emu:: + ${libmt32emu_COMPONENT_DEVEL} + ) + configure_file(cmake/MT32EmuConfig.cmake.in cmake/MT32EmuConfig.cmake @ONLY) + include(CMakePackageConfigHelpers) + write_basic_package_version_file(cmake/MT32EmuConfigVersion.cmake + VERSION ${libmt32emu_VERSION} + COMPATIBILITY SameMajorVersion + ) + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfigVersion.cmake + DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR} + ${libmt32emu_COMPONENT_DEVEL} + ) + if(libmt32emu_EXT_MODULE) + install(FILES + cmake/CheckDependencies.cmake + cmake/${libmt32emu_EXT_MODULE} + DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR} + ${libmt32emu_COMPONENT_DEVEL} + ) + endif() + + install(FILES + AUTHORS.txt COPYING.txt COPYING.LESSER.txt NEWS.txt README.md TODO.txt + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/munt/${PROJECT_NAME} + ) +endif() # Facilitates usage of the library in another project either through # an imported target or directly from the build tree. diff --git a/make-bundle.sh b/make-bundle.sh index be549431b..cdc63664c 100644 --- a/make-bundle.sh +++ b/make-bundle.sh @@ -16,10 +16,8 @@ mkdir -p Amiberry.app/Contents/Frameworks mkdir -p Amiberry.app/Contents/Resources # Copy executable into App bundle cp amiberry Amiberry.app/Contents/MacOS/Amiberry -# Copy capsimg.so into App bundle -cp plugins/capsimg.so Amiberry.app/Contents/Resources/capsimg.so -# Copy floppybridge lib into App bundle -cp plugins/libfloppybridge.so Amiberry.app/Contents/Resources/libfloppybridge.so +# Copy plugin libs into App bundle +cp plugins/*.so Amiberry.app/Contents/Resources/ # Copy init script into the bundle cp macos_init_amiberry.zsh Amiberry.app/Contents/Resources chmod +x Amiberry.app/Contents/Resources/macos_init_amiberry.zsh @@ -46,9 +44,3 @@ cp -R whdboot Amiberry.app/Contents/Resources/Whdboot # Overwrite default conf with OSX specific one cat conf/amiberry-osx.conf | sed -e "s#USERDIR#$USERDIR#g" >Amiberry.app/Contents/Resources/Configurations/amiberry.conf -# Use dylibbundler to install into app if exists -dylibbundler -od -b -x Amiberry.app/Contents/MacOS/Amiberry -d Amiberry.app/Contents/libs/ -s external/libguisan/dylib/ -if [ $? -gt 0 ]; then - echo "Can't find dylibbundler, use brew to install it, or manually copy external/libguisan/dylib/libguisan.dylib into /usr/local/lib (you'll need sudo)" -fi - diff --git a/src/main.cpp b/src/main.cpp index 3f30a801b..d4149e056 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,7 +75,7 @@ #include "fsdb_host.h" #include "keyboard.h" -static const char __ver[40] = "$VER: Amiberry 5.7.4 (2024-09-01)"; +static const char __ver[40] = "$VER: Amiberry-Lite 5.7.4 (2024-09-01)"; long int version = 256 * 65536L * UAEMAJOR + 65536L * UAEMINOR + UAESUBREV; extern int console_logging; diff --git a/src/osdep/target.h b/src/osdep/target.h index 825458701..c1459c98d 100644 --- a/src/osdep/target.h +++ b/src/osdep/target.h @@ -9,7 +9,7 @@ #include "options.h" -#define TARGET_NAME _T("amiberry") +#define TARGET_NAME _T("amiberry-lite") #define NO_MAIN_IN_MAIN_C @@ -20,8 +20,8 @@ #define GETBDM(x) (((x) - (((x) / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define AMIBERRYVERSION _T("Amiberry v5.7.4 (2024-09-01)") -#define AMIBERRYDATE MAKEBD(2024, 9, 1) +#define AMIBERRYVERSION _T("Amiberry-Lite v5.7.5 (2024-09-23)") +#define AMIBERRYDATE MAKEBD(2024, 9, 23) #define COPYRIGHT _T("Copyright (C) 2016-2024 Dimitris Panokostas") #define IHF_WINDOWHIDDEN 6