Package Details: townsemu-git 3304.5959e45-1

Git Clone URL: https://aur.archlinux.org/townsemu-git.git (read-only, click to copy)
Package Base: townsemu-git
Description: An emulator of legendary Fujitsu FM TOWNS computer
Upstream URL: https://github.com/captainys/TOWNSEMU
Licenses: GPL
Conflicts: townsemu
Provides: townsemu
Submitter: heavysink
Maintainer: heavysink (lilac)
Last Packager: lilac
Votes: 1
Popularity: 0.000000
First Submitted: 2020-09-09 13:59 (UTC)
Last Updated: 2025-06-07 17:20 (UTC)

Dependencies (6)

Required by (0)

Sources (1)

Latest Comments

rubin55 commented on 2025-08-16 07:28 (UTC)

Upstream needs to merge a PR related to usage of termio which was removed in glibc 2.42. It doesn't seem to get merged very soon, so here's the patch:

diff --git a/.github/workflows/build_test_only.yml b/.github/workflows/build_test_only.yml
index 0216aec2..11292723 100644
--- a/.github/workflows/build_test_only.yml
+++ b/.github/workflows/build_test_only.yml
@@ -37,6 +37,8 @@ jobs:
     - uses: actions/checkout@v2
     - name: mkdir
       run: mkdir ci_ubuntu
+    - name: update-local-apt-get-cache
+      run: sudo apt-get update
     - name: install-OpenGL
       run: sudo apt-get install libglu1-mesa-dev mesa-common-dev
     - name: cmake
diff --git a/src/externals/fssimplewindow/src/nownd/fssimplenowindow.cpp b/src/externals/fssimplewindow/src/nownd/fssimplenowindow.cpp
index 18e21329..edf6d0a4 100644
--- a/src/externals/fssimplewindow/src/nownd/fssimplenowindow.cpp
+++ b/src/externals/fssimplewindow/src/nownd/fssimplenowindow.cpp
@@ -57,7 +57,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        #include <dirent.h>
        #include <fcntl.h>
        #include <unistd.h>
-       #include <termio.h>
+       #include <termios.h>
        #include <stdio.h>
        #include <stdlib.h>
        #include <time.h>
@@ -74,7 +74,7 @@ static int mapFSKEYtoVK[FSKEY_NUM_KEYCODE];
 #ifdef __APPLE__
 static struct sgttyb OriginalConsoleSetting;
 #elif !defined(_WIN32)
-struct termio OriginalConsoleSetting;
+struct termios OriginalConsoleSetting;
 #endif


@@ -242,7 +242,7 @@ static void Restore(int)
 #elif defined(__APPLE__)
        ioctl(fileno(stdin),TIOCSETP,&OriginalConsoleSetting);
 #else
-       ioctl(0,TCSETA,&OriginalConsoleSetting);
+       tcsetattr(STDIN_FILENO, TCSANOW, &OriginalConsoleSetting);
 #endif
        printf("%s %d\n",__FUNCTION__,__LINE__);
        exit(0);
@@ -263,14 +263,14 @@ static void FsSetUpInkeyConsole(void)
        inkey.sg_flags&=~ECHO;
        ioctl(fileno(stdin),TIOCSETP,&inkey);
 #else
-       struct termio inkey;
-       ioctl(0,TCGETA,&OriginalConsoleSetting);
+       struct termios inkey;
+       tcgetattr(STDIN_FILENO, &OriginalConsoleSetting);
        inkey=OriginalConsoleSetting;
        inkey.c_lflag&=~ECHO;
        inkey.c_lflag&=~ICANON;
        inkey.c_cc[VMIN]=0;   /* Zero wait */
        inkey.c_cc[VTIME]=0;  /* Wait 0 second */
-       ioctl(0,TCSETA,&inkey);
+       tcsetattr(STDIN_FILENO, TCSANOW, &inkey);
 #endif
 }

There is no requirement for gcc13 anymore, also a lot of sed stuff the PKGBUILD did is not necessary anymore. Here's the PKGBUILD:

# Maintainer: heavysink <winstonwu91@gmail.com>

pkgname=townsemu-git
pkgver=3334.9387017b
pkgrel=1
pkgdesc="An emulator of legendary Fujitsu FM TOWNS computer"
arch=('i686' 'x86_64')
url="https://github.com/captainys/TOWNSEMU"
license=('GPL')
depends=('alsa-lib' 'glu')
makedepends=('git' 'cmake')
provides=('townsemu')
conflicts=('townsemu')
source=("git+https://github.com/captainys/TOWNSEMU" "from-termio-to-termios.patch")
options=('!buildflags')
md5sums=('SKIP' 'SKIP')

pkgver() {
  cd TOWNSEMU
  printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd TOWNSEMU
  cat "${srcdir}/from-termio-to-termios.patch" | patch -p1
  mkdir -p build build_gui
  cd gui/src
  git clone https://github.com/captainys/public.git
}

build() {
  cd TOWNSEMU/build
  cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_POLICY_VERSION_MINIMUM=3.5
  cmake --build . --config Release
  cd ../build_gui
  cmake ../gui/src -DCMAKE_C_FLAGS='-Wno-error=incompatible-pointer-types' -DCMAKE_CXX_FLAGS='-Wno-error=incompatible-pointer-types' -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_POLICY_VERSION_MINIMUM=3.5
  cmake --build main_gui --config Release
}

package() {
  cd TOWNSEMU/build

  install -m 755 -d "${pkgdir}/usr/bin"
  install -m 755 ./main_cui/Tsugaru_CUI ${pkgdir}/usr/bin/Tsugaru_CUI

  cd ../../TOWNSEMU/build_gui
  install -m 755 ./main_gui/Tsugaru_GUI ${pkgdir}/usr/bin/Tsugaru_GUI
}

rubin55 commented on 2025-06-18 08:48 (UTC)

gcc13 and gcc13-libs was removed from core, so I needed to mangle the build a bit. I first tried regular build with current default gcc (version), but ran into incompatible pointer type errors, which could be circumvented by passing -Wno-error=incompatible-pointer-types, but due to a bug in src/gui/CmakeLists.txt this breaks the resulting make.flags.

If you're impatient, you can patch that CmakeLists.txt yourself with this fix-cmakelists-quoting.patch:

diff --git a/gui/src/CMakeLists.txt b/gui/src/CMakeLists.txt
index 7dbc7e16..5d925816 100644
--- a/gui/src/CMakeLists.txt
+++ b/gui/src/CMakeLists.txt
@@ -8,8 +8,8 @@ set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)

 if(UNIX)
-   set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-unused-variable)
-   set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wno-unused-variable)
+   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable")
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
 endif()

 set(DISC_IMAGE_DIR "C:/D/TownsISO")

I've also heavily cleaned up the PKGBUILD, removing commented-out seds, removing single-thread building, and making use of this fix by passing along CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to speficy -Wno-error=incompatible-pointer-types. Here's the complete PKGBUILD (patch file and command could be removed after upstream accepts previously linked PR):

# Maintainer: heavysink <winstonwu91@gmail.com>

pkgname=townsemu-git
pkgver=3304.5959e453
pkgrel=2
pkgdesc="An emulator of legendary Fujitsu FM TOWNS computer"
arch=('i686' 'x86_64')
url="https://github.com/captainys/TOWNSEMU"
license=('GPL')
depends=('alsa-lib' 'glu')
makedepends=('git' 'cmake')
provides=('townsemu')
conflicts=('townsemu')
source=(
  "git+https://github.com/captainys/TOWNSEMU"
  "fix-cmakelists-quoting.patch"
)
options=('!buildflags')
md5sums=('SKIP' 'SKIP')

pkgver() {
  cd TOWNSEMU
  printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd TOWNSEMU
  mkdir -p build build_gui
  cat "${srcdir}/fix-cmakelists-quoting.patch" | patch -p1
  cd gui/src
  git clone https://github.com/captainys/public.git
}

build() {
  cd TOWNSEMU/build
  cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_POLICY_VERSION_MINIMUM=3.5
  cmake --build . --config Release
  cd ../build_gui
  cmake ../gui/src -DCMAKE_C_FLAGS='-Wno-error=incompatible-pointer-types' -DCMAKE_CXX_FLAGS='-Wno-error=incompatible-pointer-types' -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_POLICY_VERSION_MINIMUM=3.5
  cmake --build main_gui --config Release
}

package() {
  cd TOWNSEMU/build

  install -m 755 -d "${pkgdir}/usr/bin"
  install -m 755 ./main_cui/Tsugaru_CUI ${pkgdir}/usr/bin/Tsugaru_CUI

  cd ../../TOWNSEMU/build_gui
  install -m 755 ./main_gui/Tsugaru_GUI ${pkgdir}/usr/bin/Tsugaru_GUI
}

rubin55 commented on 2025-02-15 10:00 (UTC)

This package seems to be broken due to some issue with cmake upstream. I filed: https://github.com/captainys/TOWNSEMU/issues/145

The error(s):

/bin/sh: line 1: -Wno-unused-variable: command not found
/bin/sh: line 1: -Wno-unused-variable: command not found
clang++/bin/sh: line 1: -Wno-unused-variable: command not found

rubin55 commented on 2024-08-01 12:44 (UTC)

I noticed I can't compile anymore since upgrading to GCC 14.x. As a workaround, you can compile with (latest, v19.x at this moment) clang, by exporting CC and CXX in the PKGBUILD. Juist add the following two lines to the build() function, at the beginning:

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++

klore commented on 2021-01-26 04:40 (UTC)

Now I can compile

klore commented on 2021-01-10 08:42 (UTC)

/usr/bin/ld: yssimplesound.cpp:(.text+0x10f8): undefined reference to `YsSoundPlayer::SoundData::CleanUpAPISpecific()' collect2: error: ld returned 1 exit status make[2]: [tests/CMakeFiles/disasm_addr.dir/build.make:162: tests/disasm_addr] Error 1 make[1]: [CMakeFiles/Makefile2:2560: tests/CMakeFiles/disasm_addr.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 98%] Linking CXX static library libfssimplewindow_connection.a [ 98%] Built target fssimplewindow_connection [ 99%] Linking CXX static library libtownsargv.a [ 99%] Built target townsargv [ 99%] Linking CXX static library libtownscommand.a [ 99%] Built target townscommand make: [Makefile:114: all] Error 2 ==> ERROR: A failure occurred in build(). Aborting...