From 2c6c6bc995f0685215657e02ee61afe93d00217b Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 10 Jun 2023 16:23:08 +0200 Subject: [PATCH 1/9] Implement --enable-windows-installer based on --enable-app-bundle --- Makefile.am | 9 +++++++++ configure.ac | 40 +++++++++++++++++++++++++++++++++++++++- data/Makefile.am | 20 +++++++++++++++++--- data/nsis/Makefile.am | 17 +++++++++++++++++ src/Makefile.am | 4 ++++ 5 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 data/nsis/Makefile.am diff --git a/Makefile.am b/Makefile.am index b427f558..a3fb02a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -123,6 +123,15 @@ doc: .PHONY: doc +if ENABLE_WINDOWS_INSTALLER +nsis: install + $(MAKE) -C data/nsis $@ +else +nsis: + @echo "You have to run './configure --enable-windows-installer' first!"; false +endif +.PHONY: nsis + .NOTPARALLEL: install # remove pkgdatadir and docdir (if empty) diff --git a/configure.ac b/configure.ac index 346fcba1..c025c592 100644 --- a/configure.ac +++ b/configure.ac @@ -723,6 +723,23 @@ ENABLE_AUTO([isatty], [support for isatty()], AC_SEARCH_LIBS([isatty], , , [have_isatty=no]) ]) +dnl trying to mimic the default setting +pkgdatadir='${datadir}/${PACKAGE}' + +ENABLE_EXPLICIT([windows-installer], [creation of an installer for Windows], +[ + AC_CHECK_PROG([have_nsis], [nsis], [yes], [no]) + AS_IF([test x$enable_windows_installer = xyes -o x$enable_windows_installer = x], + [WINDOWS_INSTALLER=SoundScapeRenderer-$PACKAGE_VERSION], + [WINDOWS_INSTALLER=$enable_windows_installer]) + + dnl WARNING: any user-specified --prefix, --bindir, ... is overwritten! + dnl however, it can still be specified at make time (although kinda useless)! + prefix=$(pwd)/windows-installer + docdir=\${prefix}/Documentation + pkgdatadir=\${prefix}/PkgData +]) + ENABLE_AUTO([browser-gui], [creation of HTML/JavaScript files for browser GUI], [ AC_ARG_VAR([YARN], [Yarn package manager command]) @@ -744,6 +761,9 @@ ENABLE_AUTO([browser-gui], [creation of HTML/JavaScript files for browser GUI], ]) ]) +AC_SUBST(WINDOWS_INSTALLER) +AC_SUBST(pkgdatadir) + AC_SUBST(OPT_FLAGS) AC_SUBST(PKG_FLAGS) AC_SUBST(WARNING_FLAGS) @@ -751,7 +771,7 @@ AC_SUBST(DEBUGGING_FLAGS) dnl List of output files generated by AC_OUTPUT from their respective *.in files AC_CONFIG_FILES([Makefile src/Makefile man/Makefile browser-gui/Makefile]) -AC_CONFIG_FILES([tests/Makefile data/Makefile]) +AC_CONFIG_FILES([tests/Makefile data/Makefile data/nsis/Makefile]) dnl AC_OUTPUT should be the last command (except maybe some status messages) dnl It generates and runs config.status, which in turn creates the Makefiles and @@ -811,7 +831,13 @@ echo "| Network: legacy/WebSocket/FUDI ......... : $have_ip_interface/$have_webs echo "| Qt GUI/Browser GUI ..................... : $have_gui/$have_browser_gui" echo "|" echo "| Enable debugging/optimization .......... : $have_debugging/$have_optimization" +AS_IF([test x$have_windows_installer = xyes], +[ +echo "| Installer for Windows .................. : $WINDOWS_INSTALLER" +], +[ echo "| Install prefix ......................... : $prefix" +]) AS_IF([test x$have_ecasound = xyes -a x$have_ecasound_program != xyes], [ @@ -825,7 +851,19 @@ AS_IF([test x$have_manpages != xyes], echo "|> WARNING: help2man was not found!" echo "|> Disabling building of manpages" ]) +AS_IF([test x$have_windows_installer = xyes -a x$have_nsis != xyes], +[ + echo "|" + echo "|> WARNING: NSIS was not found!" + echo "|> It is needed for creating the Windows installer." +]) echo +AS_IF([test x$have_windows_installer = xyes], +[ +echo 'If everything looks OK, continue with "make" and "make nsis".' +], +[ echo 'If everything looks OK, continue with "make" and "make install".' +]) echo diff --git a/data/Makefile.am b/data/Makefile.am index 08fa3e31..02edf5f0 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -7,7 +7,18 @@ dist_bin_SCRIPTS = ssr +if ENABLE_WINDOWS_INSTALLER +SUBDIRS = nsis +extrasdir = $(prefix)/Extras +scenesdir = $(prefix)/Scenes + +## these are always distributed, but only installed if ENABLE_WINDOWS_INSTALLER +dist_scenes_DATA = \ + scenes/asdf2html.xsl \ + scenes/live_input.asd +else extrasdir = $(pkgdatadir) +endif ## stuff that will end up in $prefix/share/ssr/ nobase_dist_pkgdata_DATA = \ @@ -33,7 +44,7 @@ nobase_dist_pkgdata_DATA = \ ## the whole directory is distributed, including browser GUI files EXTRA_DIST = websocket_resources -## stuff that will end up in $prefix/share/ssr/ +## stuff that will end up in $extrasdir nobase_dist_extras_DATA = \ reproduction_setups/2.0.asd \ reproduction_setups/2.1.asd \ @@ -85,17 +96,20 @@ dist_noinst_SCRIPTS = local_ssr.sh ##dist-hook: ## ... +# https://stackoverflow.com/q/63018330#comment111445661_63020485 +HASH := \# + # compute relative path between $(pkgdatadir) and $(extrasdir) REL_LINK_DIR = $(shell \ target="${extrasdir}"; \ common_part="${pkgdatadir}"; \ if test "x$$target" = "x$$common_part"; then echo .; exit; fi; \ back= ; \ - while test "x$${target\#$$common_part}" = "x$$target"; do \ + while test "x$${target$(HASH)$$common_part}" = "x$$target"; do \ common_part="`dirname "$$common_part"`"; \ back="../$$back" ; \ done; \ - echo "$${back}$${target\#$$common_part/}") + echo "$${back}$${target$(HASH)$$common_part/}") # create symbolic links in the install directory (for default files) and # before that, remove old symbolic links diff --git a/data/nsis/Makefile.am b/data/nsis/Makefile.am new file mode 100644 index 00000000..3367e81c --- /dev/null +++ b/data/nsis/Makefile.am @@ -0,0 +1,17 @@ +## This file will be processed by automake (which is called by autogen.sh) to +## generate Makefile.in, which in turn will be processed by configure to +## generate Makefile. + +## comments starting with a single # are copied to Makefile.in (and afterwards +## to Makefile), comments with ## are dropped. + +## This file is only taken into account if --enable-windows-installer was chosen! +if ENABLE_WINDOWS_INSTALLER + +# create Windows installer +nsis: + @echo "TODO: run NSIS!" + +.PHONY: nsis + +endif diff --git a/src/Makefile.am b/src/Makefile.am index bb5d41c5..0b6cfbd2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,11 @@ AM_CPPFLAGS += -I$(srcdir)/../apf AM_CPPFLAGS += -I$(srcdir)/../gml/include AM_CPPFLAGS += -I$(srcdir)/../rapidjson/include +if ENABLE_WINDOWS_INSTALLER +AM_CPPFLAGS += -DSSR_DATA_DIR=\"PkgData\" +else AM_CPPFLAGS += -DSSR_DATA_DIR="\"$(pkgdatadir)\"" +endif ## this is somehow needed for Solaris (or not?) AM_CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS From a118d8644b37662f4cb4a0433ea0958aa3a5fb0f Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 8 May 2021 23:00:42 +0200 Subject: [PATCH 2/9] CI: build SSR on Windows --- .github/workflows/windows-msys2.yml | 98 +++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/windows-msys2.yml diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml new file mode 100644 index 00000000..cc2a6240 --- /dev/null +++ b/.github/workflows/windows-msys2.yml @@ -0,0 +1,98 @@ +name: SSR for Windows, using MSYS2 +on: [push, pull_request] +jobs: + build-win: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + env: + MSYS: winsymlinks:native + steps: + - name: Install MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: UCRT64 + install: >- + git + pacboy: >- + asio:p + autotools:p + fftw:p + fmt:p + jack2:p + libsndfile:p + libmysofa:p + libxml2:p + mesa:p + nsis:p + qt5-base:p + vrpn:p + yarn:p + - name: checkout websocketpp + uses: actions/checkout@v3 + with: + repository: zaphoyd/websocketpp + path: websocketpp + - name: Get SSR source code + uses: actions/checkout@v3 + with: + submodules: true + # This is required to be able to fetch tags, + # see https://github.com/actions/checkout/issues/290: + fetch-depth: 0 + path: ssr + - name: autogen + working-directory: ssr + run: | + ./autogen.sh + - name: fetch Git tags + working-directory: ssr + run: | + # Fetch tags for obtaining the version number, + # see https://github.com/actions/checkout/issues/290: + git fetch --tags --force + - name: configure + working-directory: ssr + run: | + CONFIGURE_OPTIONS=( + --enable-browser-gui + --enable-fudi-interface + --enable-gui + --enable-ip-interface + #--enable-polhemus + #--enable-razor + --enable-sofa + #--enable-vrpn + --enable-websocket-interface + --enable-windows-installer + --disable-ecasound + --disable-intersense + CPPFLAGS="-I/ucrt64/include -I`pwd`/../websocketpp -D_WEBSOCKETPP_CPP11_THREAD_" + # TODO: move this to configure.ac: + CFLAGS=-mwin32 + LDFLAGS=-L/ucrt64/lib + # TODO: move this to configure.ac: + LIBS="-lws2_32 -lwsock32 -lglu32 -lopengl32" + ) + ./configure --disable-dependency-tracking "${CONFIGURE_OPTIONS[@]}" + - name: upload config.log + if: failure() + uses: actions/upload-artifact@v3 + with: + name: config.log + path: ssr/config.log + - name: make + working-directory: ssr + run: | + make + - name: make nsis + working-directory: ssr + run: | + make nsis + - name: upload installer + uses: actions/upload-artifact@v3 + with: + # TODO: upload the actual installer + name: ssr-installer + path: ssr/windows-installer From 3d783756996c1686ab00f079e3851d5881df7762 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Tue, 13 Jun 2023 18:26:34 +0200 Subject: [PATCH 3/9] Copy DLL dependencies --- .github/workflows/windows-msys2.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index cc2a6240..221f6b84 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -86,6 +86,23 @@ jobs: working-directory: ssr run: | make + - name: make install + working-directory: ssr + run: | + make install + # This is an old shell script for backwards compatibility. + # It is not needed on Windows. + - name: remove "ssr" script + working-directory: ssr/windows-installer + run: | + rm bin/ssr + - name: copy dependencies + working-directory: ssr/windows-installer + # See https://github.com/msys2/MINGW-packages/issues/5204#issuecomment-1013818547 + run: | + ldd bin/* | grep -iv system32 | grep -v :$ | cut -f2 -d\> | cut -f1 -d\( | while read a; do ! [ -e "bin/`basename $a`" ] && cp -v "$a" bin/ || true; done + echo "Remaining dependencies:" + ldd bin/* - name: make nsis working-directory: ssr run: | From 9708c9e14edccbb8012f5aed18e68fef56164c58 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Thu, 15 Jun 2023 14:05:56 +0200 Subject: [PATCH 4/9] Use windeployqt --- .github/workflows/windows-msys2.yml | 11 ++--------- configure.ac | 7 +++++++ data/Makefile.am | 4 ++-- data/nsis/Makefile.am | 8 ++++++++ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index 221f6b84..684c1d64 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -27,6 +27,7 @@ jobs: mesa:p nsis:p qt5-base:p + qt5-tools:p vrpn:p yarn:p - name: checkout websocketpp @@ -90,19 +91,11 @@ jobs: working-directory: ssr run: | make install - # This is an old shell script for backwards compatibility. - # It is not needed on Windows. - - name: remove "ssr" script - working-directory: ssr/windows-installer - run: | - rm bin/ssr - name: copy dependencies working-directory: ssr/windows-installer # See https://github.com/msys2/MINGW-packages/issues/5204#issuecomment-1013818547 run: | - ldd bin/* | grep -iv system32 | grep -v :$ | cut -f2 -d\> | cut -f1 -d\( | while read a; do ! [ -e "bin/`basename $a`" ] && cp -v "$a" bin/ || true; done - echo "Remaining dependencies:" - ldd bin/* + ldd bin/*.exe | grep -iv system32 | grep -v :$ | cut -f2 -d\> | cut -f1 -d\( | while read a; do ! [ -e "bin/`basename $a`" ] && cp -v "$a" bin/ || true; done - name: make nsis working-directory: ssr run: | diff --git a/configure.ac b/configure.ac index c025c592..c58da66e 100644 --- a/configure.ac +++ b/configure.ac @@ -729,6 +729,7 @@ pkgdatadir='${datadir}/${PACKAGE}' ENABLE_EXPLICIT([windows-installer], [creation of an installer for Windows], [ AC_CHECK_PROG([have_nsis], [nsis], [yes], [no]) + AC_CHECK_PROG([have_windeployqt], [windeployqt], [yes], [no]) AS_IF([test x$enable_windows_installer = xyes -o x$enable_windows_installer = x], [WINDOWS_INSTALLER=SoundScapeRenderer-$PACKAGE_VERSION], [WINDOWS_INSTALLER=$enable_windows_installer]) @@ -857,6 +858,12 @@ AS_IF([test x$have_windows_installer = xyes -a x$have_nsis != xyes], echo "|> WARNING: NSIS was not found!" echo "|> It is needed for creating the Windows installer." ]) +AS_IF([test x$have_windows_installer = xyes -a x$have_windeployqt != xyes], +[ + echo "|" + echo "|> WARNING: windeployqt was not found!" + echo "|> It is needed for collecting dependencies for the Windows installer." +]) echo AS_IF([test x$have_windows_installer = xyes], diff --git a/data/Makefile.am b/data/Makefile.am index 02edf5f0..ae4f7a4d 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,8 +5,6 @@ ## comments starting with a single # are copied to Makefile.in (and afterwards ## to Makefile), comments with ## are dropped. -dist_bin_SCRIPTS = ssr - if ENABLE_WINDOWS_INSTALLER SUBDIRS = nsis extrasdir = $(prefix)/Extras @@ -18,6 +16,8 @@ dist_scenes_DATA = \ scenes/live_input.asd else extrasdir = $(pkgdatadir) +## this compatibility script is not needed for the Windows installer +dist_bin_SCRIPTS = ssr endif ## stuff that will end up in $prefix/share/ssr/ diff --git a/data/nsis/Makefile.am b/data/nsis/Makefile.am index 3367e81c..c847b71f 100644 --- a/data/nsis/Makefile.am +++ b/data/nsis/Makefile.am @@ -8,6 +8,14 @@ ## This file is only taken into account if --enable-windows-installer was chosen! if ENABLE_WINDOWS_INSTALLER +# this is done after installing the executables +install-exec-hook: + for exec in $(SSR_executables); do \ + windeployqt --no-compiler-runtime $(DESTDIR)$(bindir)/$$exec \ + ; done + $(RM) -r $(DESTDIR)$(bindir)/styles + $(RM) -r $(DESTDIR)$(bindir)/imageformats + # create Windows installer nsis: @echo "TODO: run NSIS!" From 757c285a233ff6a3edd5dcaff00beba8114ad306 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Thu, 15 Jun 2023 14:42:04 +0200 Subject: [PATCH 5/9] PkgData -> ../PkgData --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0b6cfbd2..b4b4d045 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ AM_CPPFLAGS += -I$(srcdir)/../gml/include AM_CPPFLAGS += -I$(srcdir)/../rapidjson/include if ENABLE_WINDOWS_INSTALLER -AM_CPPFLAGS += -DSSR_DATA_DIR=\"PkgData\" +AM_CPPFLAGS += -DSSR_DATA_DIR=\"../PkgData\" else AM_CPPFLAGS += -DSSR_DATA_DIR="\"$(pkgdatadir)\"" endif From 48a4ea218d56724e925196aa15903a66693e2092 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 17 Jun 2023 16:16:13 +0200 Subject: [PATCH 6/9] Strip .exe files --- .github/workflows/windows-msys2.yml | 4 ++-- Makefile.am | 2 +- data/nsis/Makefile.am | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index 684c1d64..fc448a98 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -87,10 +87,10 @@ jobs: working-directory: ssr run: | make - - name: make install + - name: make install-strip working-directory: ssr run: | - make install + make install-strip - name: copy dependencies working-directory: ssr/windows-installer # See https://github.com/msys2/MINGW-packages/issues/5204#issuecomment-1013818547 diff --git a/Makefile.am b/Makefile.am index a3fb02a8..fc2a4054 100644 --- a/Makefile.am +++ b/Makefile.am @@ -124,7 +124,7 @@ doc: .PHONY: doc if ENABLE_WINDOWS_INSTALLER -nsis: install +nsis: install-strip $(MAKE) -C data/nsis $@ else nsis: diff --git a/data/nsis/Makefile.am b/data/nsis/Makefile.am index c847b71f..ad7348c9 100644 --- a/data/nsis/Makefile.am +++ b/data/nsis/Makefile.am @@ -11,8 +11,8 @@ if ENABLE_WINDOWS_INSTALLER # this is done after installing the executables install-exec-hook: for exec in $(SSR_executables); do \ - windeployqt --no-compiler-runtime $(DESTDIR)$(bindir)/$$exec \ - ; done + windeployqt --no-compiler-runtime $(DESTDIR)$(bindir)/$$exec ; \ + done $(RM) -r $(DESTDIR)$(bindir)/styles $(RM) -r $(DESTDIR)$(bindir)/imageformats From 78b390db16870097300b268bf0d27d0e70790f50 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 17 Jun 2023 17:27:31 +0200 Subject: [PATCH 7/9] copy dependencies in Makefile --- .github/workflows/windows-msys2.yml | 9 --------- data/nsis/Makefile.am | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index fc448a98..e7b76020 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -87,15 +87,6 @@ jobs: working-directory: ssr run: | make - - name: make install-strip - working-directory: ssr - run: | - make install-strip - - name: copy dependencies - working-directory: ssr/windows-installer - # See https://github.com/msys2/MINGW-packages/issues/5204#issuecomment-1013818547 - run: | - ldd bin/*.exe | grep -iv system32 | grep -v :$ | cut -f2 -d\> | cut -f1 -d\( | while read a; do ! [ -e "bin/`basename $a`" ] && cp -v "$a" bin/ || true; done - name: make nsis working-directory: ssr run: | diff --git a/data/nsis/Makefile.am b/data/nsis/Makefile.am index ad7348c9..1ce6f5fc 100644 --- a/data/nsis/Makefile.am +++ b/data/nsis/Makefile.am @@ -10,9 +10,13 @@ if ENABLE_WINDOWS_INSTALLER # this is done after installing the executables install-exec-hook: +## the line starting with "ldd" was adapted from +## https://github.com/msys2/MINGW-packages/issues/5204#issuecomment-1013818547 for exec in $(SSR_executables); do \ windeployqt --no-compiler-runtime $(DESTDIR)$(bindir)/$$exec ; \ + ldd $(DESTDIR)$(bindir)/$$exec | grep -iv system32 | cut -f2 -d\> | cut -f1 -d\( | while read a; do ! [ -e "$(DESTDIR)$(bindir)/`basename $$a`" ] && cp -v "$$a" $(DESTDIR)$(bindir)/ || true; done \ done +## those are copied by windeployqt, but they are not needed: $(RM) -r $(DESTDIR)$(bindir)/styles $(RM) -r $(DESTDIR)$(bindir)/imageformats From b1f198ac612b9d7d54482bd22d6aed91ea4fc3e1 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Fri, 7 Jul 2023 22:58:49 +0200 Subject: [PATCH 8/9] --enable-dynamic-asdf --- .github/workflows/windows-msys2.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index e7b76020..064f8ef9 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -18,6 +18,8 @@ jobs: pacboy: >- asio:p autotools:p + cargo-c:p + cmake:p fftw:p fmt:p jack2:p @@ -28,8 +30,20 @@ jobs: nsis:p qt5-base:p qt5-tools:p + rust:p vrpn:p yarn:p + - name: checkout asdf-rust + uses: actions/checkout@v3 + with: + repository: AudioSceneDescriptionFormat/asdf-rust + ref: '1.0.0' + path: asdf + submodules: true + - name: Install ASDF + working-directory: asdf + run: | + cargo cinstall --verbose --prefix=/ucrt64 - name: checkout websocketpp uses: actions/checkout@v3 with: @@ -58,6 +72,7 @@ jobs: run: | CONFIGURE_OPTIONS=( --enable-browser-gui + --enable-dynamic-asdf --enable-fudi-interface --enable-gui --enable-ip-interface From b2b4dd2f7313d77894b325b929d30c5327a36777 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sun, 24 Sep 2023 19:46:23 +0200 Subject: [PATCH 9/9] Add first version of a Windows installer --- .github/workflows/windows-msys2.yml | 7 +--- configure.ac | 24 ++++++++++-- data/nsis/Makefile.am | 4 +- data/nsis/installer-script.nsi.in | 57 +++++++++++++++++++++++++++++ src/Makefile.am | 2 +- 5 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 data/nsis/installer-script.nsi.in diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index 064f8ef9..07556d5f 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -85,11 +85,7 @@ jobs: --disable-ecasound --disable-intersense CPPFLAGS="-I/ucrt64/include -I`pwd`/../websocketpp -D_WEBSOCKETPP_CPP11_THREAD_" - # TODO: move this to configure.ac: - CFLAGS=-mwin32 LDFLAGS=-L/ucrt64/lib - # TODO: move this to configure.ac: - LIBS="-lws2_32 -lwsock32 -lglu32 -lopengl32" ) ./configure --disable-dependency-tracking "${CONFIGURE_OPTIONS[@]}" - name: upload config.log @@ -109,6 +105,5 @@ jobs: - name: upload installer uses: actions/upload-artifact@v3 with: - # TODO: upload the actual installer name: ssr-installer - path: ssr/windows-installer + path: "ssr/windows-installer/SoundScape Renderer * Installer.exe" diff --git a/configure.ac b/configure.ac index c58da66e..b1ed6f1e 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ AC_CANONICAL_TARGET dnl Compute the canonical host-system type variable, 'host', and its three dnl individual parts 'host_cpu', 'host_vendor', and 'host_os'. -dnl AC_CANONICAL_HOST +AC_CANONICAL_HOST dnl Runs many macros required for proper operation of the generated Makefiles. dnl see http://sources.redhat.com/automake/automake.html#Options for options @@ -123,6 +123,11 @@ dnl AC_DEFINE writes values in config.h dnl AC_DEFINE_UNQUOTED performs additional shell expansions, e.g. substitution dnl of variable with value. + +AS_IF([test "$host_os" = "mingw32"], [ + CXXFLAGS="$CXXFLAGS -mwin32" +]) + ENABLE_AUTO([all], [all renderers (use --enable-xyz to re-enable certain renderers)], [ @@ -496,6 +501,9 @@ ENABLE_FORCED([gui], [graphical user interface (using Qt)], AC_CHECK_HEADER([OpenGL/glu.h], , [have_gui=no]) LIBS="$LIBS -framework OpenGL" ]) + AS_IF([test "$host_os" = "mingw32"], [ + LIBS="$LIBS -lglu32 -lopengl32" + ]) AC_SEARCH_LIBS([gluNewQuadric], [GLU], , [have_gui=no]) # on some systems this is needed, on the others it doesn't hurt: AC_SEARCH_LIBS([glSelectBuffer], [GL], , [have_gui=no]) @@ -562,6 +570,13 @@ ENABLE_AUTO([fudi-interface], [FUDI interface (needs Asio and {fmt})], [have_fudi_interface=no]) ]) +AS_IF([test "$host_os" = "mingw32"], [ + AS_IF([test x$have_ip_interface = xyes -o x$have_websocket_interface = xyes -o x$have_fudi_interface = xyes], +[ + LIBS="$LIBS -lws2_32 -lwsock32" + ]) +]) + ENABLE_FORCED([ecasound], [Ecasound soundfile playback/recording], [ dnl Checking for libecasoundc. It does not provide pkg-config and installs @@ -731,14 +746,14 @@ ENABLE_EXPLICIT([windows-installer], [creation of an installer for Windows], AC_CHECK_PROG([have_nsis], [nsis], [yes], [no]) AC_CHECK_PROG([have_windeployqt], [windeployqt], [yes], [no]) AS_IF([test x$enable_windows_installer = xyes -o x$enable_windows_installer = x], - [WINDOWS_INSTALLER=SoundScapeRenderer-$PACKAGE_VERSION], + [WINDOWS_INSTALLER="SoundScape Renderer $PACKAGE_VERSION Installer"], [WINDOWS_INSTALLER=$enable_windows_installer]) dnl WARNING: any user-specified --prefix, --bindir, ... is overwritten! dnl however, it can still be specified at make time (although kinda useless)! prefix=$(pwd)/windows-installer docdir=\${prefix}/Documentation - pkgdatadir=\${prefix}/PkgData + pkgdatadir=\${prefix}/data ]) ENABLE_AUTO([browser-gui], [creation of HTML/JavaScript files for browser GUI], @@ -772,7 +787,8 @@ AC_SUBST(DEBUGGING_FLAGS) dnl List of output files generated by AC_OUTPUT from their respective *.in files AC_CONFIG_FILES([Makefile src/Makefile man/Makefile browser-gui/Makefile]) -AC_CONFIG_FILES([tests/Makefile data/Makefile data/nsis/Makefile]) +AC_CONFIG_FILES([tests/Makefile data/Makefile]) +AC_CONFIG_FILES([data/nsis/Makefile data/nsis/installer-script.nsi]) dnl AC_OUTPUT should be the last command (except maybe some status messages) dnl It generates and runs config.status, which in turn creates the Makefiles and diff --git a/data/nsis/Makefile.am b/data/nsis/Makefile.am index 1ce6f5fc..81128a31 100644 --- a/data/nsis/Makefile.am +++ b/data/nsis/Makefile.am @@ -19,10 +19,12 @@ install-exec-hook: ## those are copied by windeployqt, but they are not needed: $(RM) -r $(DESTDIR)$(bindir)/styles $(RM) -r $(DESTDIR)$(bindir)/imageformats +## this is assumed to be available on the target system: + $(RM) -r $(DESTDIR)$(bindir)/libjack*.dll # create Windows installer nsis: - @echo "TODO: run NSIS!" + cd $(DESTDIR)$(prefix) && MakeNSIS.exe -NOCD $(abs_builddir)/installer-script.nsi .PHONY: nsis diff --git a/data/nsis/installer-script.nsi.in b/data/nsis/installer-script.nsi.in new file mode 100644 index 00000000..a5f03cb8 --- /dev/null +++ b/data/nsis/installer-script.nsi.in @@ -0,0 +1,57 @@ +# https://nsis.sourceforge.io/Docs/ + +!define APPNAME "SoundScape Renderer @PACKAGE_VERSION@" + +Name "${APPNAME}" + +OutFile "@WINDOWS_INSTALLER@.exe" + +InstallDir "$PROGRAMFILES64\${APPNAME}" + +SetCompressor lzma + +#Page license +#Page components +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + +Section "Everything" + SetOutPath $INSTDIR + + File /r ".\bin" + File /r ".\data" + + WriteUninstaller "$INSTDIR\uninstall.exe" + + # Set the working directory of the following Start Menu shortcuts: + SetOutPath "$INSTDIR\bin" + + CreateDirectory "$SMPROGRAMS\${APPNAME}" + CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-binaural.lnk" "cmd" "/k ssr-binaural.exe" + CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-brs.lnk" "cmd" "/k ssr-brs.exe" + CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-wfs.lnk" "cmd" "/k ssr-wfs.exe" + CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-vbap.lnk" "cmd" "/k ssr-vbap.exe" + CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-aap.lnk" "cmd" "/k ssr-aap.exe" + CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-dca.lnk" "cmd" "/k ssr-dca.exe" + CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-generic.lnk" "cmd" "/k ssr-generic.exe" + CreateShortcut "$SMPROGRAMS\${APPNAME}\uninstall.lnk" "$INSTDIR\uninstall.exe" + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \ + "DisplayName" "${APPNAME}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \ + "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" +SectionEnd + +Section "Uninstall" + RMDir /r "$INSTDIR\bin" + RMDir /r "$INSTDIR\data" + Delete "$INSTDIR\uninstall.exe" + RMDir $INSTDIR + + RMDir /r "$SMPROGRAMS\${APPNAME}" + + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" +SectionEnd diff --git a/src/Makefile.am b/src/Makefile.am index b4b4d045..dbfe92a7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ AM_CPPFLAGS += -I$(srcdir)/../gml/include AM_CPPFLAGS += -I$(srcdir)/../rapidjson/include if ENABLE_WINDOWS_INSTALLER -AM_CPPFLAGS += -DSSR_DATA_DIR=\"../PkgData\" +AM_CPPFLAGS += -DSSR_DATA_DIR=\"../data\" else AM_CPPFLAGS += -DSSR_DATA_DIR="\"$(pkgdatadir)\"" endif