Package Details: c47 00.109.03.01b1-1

Git Clone URL: https://aur.archlinux.org/c47.git (read-only, click to copy)
Package Base: c47
Description: Emulator for the C47 pocket calculator
Upstream URL: https://47calc.com
Licenses: GPL-3.0-or-later
Submitter: HurricanePootis
Maintainer: HurricanePootis
Last Packager: HurricanePootis
Votes: 1
Popularity: 0.26
First Submitted: 2025-12-22 09:04 (UTC)
Last Updated: 2026-03-03 22:34 (UTC)

Latest Comments

raprism commented on 2026-02-02 11:11 (UTC) (edited on 2026-02-03 16:21 (UTC) by raprism)

Okay, 2 packages works fine at least without unnecessary rebuilds of binaries. In the r47 package are some intermediate icon files, but I suggest another clean-up: /usr/share/$pkgname is redundant, if both packages are installed, but a shared package might be not worth. But all DMCP-related files are only for hardware, so I would explicitly copy only necessary files as shown in this diff:

diff --git a/PKGBUILD b/PKGBUILD
index 96fdc50..142480a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@ _pkgname=c43
 pkgbase=c47
 pkgname=(c47 r47)
 pkgver=00.109.03.00b1
-pkgrel=5
+pkgrel=5.1
 pkgdesc="Emulator for the C47 pocket calculator"
 arch=(x86_64)
 url="https://47calc.com"
@@ -47,7 +47,8 @@ package_c47() {
    cd "$srcdir"
    install -dm755 "$pkgdir/usr/bin"
    install -dm755 "$pkgdir/usr/share/$pkgname"
-   cp -a ${_pkgname}-${pkgver}/res "$pkgdir/usr/share/$pkgname/res"
+   mkdir -p "$pkgdir/usr/share/$pkgname/res"
+   cp -a ${_pkgname}-${pkgver}/res/{[CR]47*.png,c47_pre.css,tone,PROGRAMS,STATE,testPgms} "$pkgdir/usr/share/$pkgname/res/"
    install -Dm755 build/src/${pkgname}-gtk/${pkgname} "$pkgdir/usr/lib/$pkgname/$pkgname"
    cat >> "$pkgdir/usr/bin/$pkgname" <<-EOF
 #!/usr/bin/env sh
@@ -98,7 +99,8 @@ package_r47() {
    cd "$srcdir"
    install -dm755 "$pkgdir/usr/bin"
    install -dm755 "$pkgdir/usr/share/$pkgname"
-   cp -a ${_pkgname}-${pkgver}/res "$pkgdir/usr/share/$pkgname/res"
+   mkdir -p "$pkgdir/usr/share/$pkgname/res"
+   cp -a ${_pkgname}-${pkgver}/res/{[CR]47*.png,c47_pre.css,tone,PROGRAMS,STATE,testPgms} "$pkgdir/usr/share/$pkgname/res/"
    install -Dm755 build/src/${pkgname/r/c}-gtk/${pkgname} "$pkgdir/usr/lib/$pkgname/$pkgname"
    cat >> "$pkgdir/usr/bin/$pkgname" <<-EOF
 #!/usr/bin/env sh

testPgms could be omitted, or moved to doc files. It's not possible to use them, if the user does not override this res linking mechanism. It's also not useful to enable them by default IMHO. In principle same problem for 'Light\ background\ C47' folder content, that I omitted here. Though one could insert it in res or doc.

raprism commented on 2026-02-01 23:13 (UTC)

Here is a diff that includes some further safety checks for configuration files, and includes r47 for R47 variant of C47 project. This simulator is different to 'c47 --r47' call, because settings in KEYS are different, and extra config files are stored to accommodate these specific settings.

diff --git a/PKGBUILD b/PKGBUILD
index dcc0945..198f2bb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,11 @@
 # Maintainer: HurricanePootis <hurricanepootis@protonmail.com>
 _pkgname=c43
 pkgname=c47
+pkgname_r=r47
 pkgver=00.109.03.00b1
-pkgrel=4
+pkgrel=4.1
 pkgdesc="Emulator for the C47 pocket calculator"
+pkgdesc_r="Emulator for the R47 pocket calculator"
 arch=(x86_64)
 url="https://47calc.com"
 license=('GPL-3.0-or-later')
@@ -20,7 +22,14 @@ prepare() {
    --exec="${pkgname}" \
    --icon=${pkgname} \
    --terminal=false \
-   --categories="Education;Office;Utilities"
+   --categories="Office;Science;Math"
+   gendesk -n -f \
+   --pkgname=${pkgname_r} \
+   --pkgdesc="${pkgdesc_r}" \
+   --exec="${pkgname_r}" \
+   --icon=${pkgname_r} \
+   --terminal=false \
+   --categories="Office;Science;Math"
 }

 build() {
@@ -41,44 +50,57 @@ package() {
    install -dm755 "$pkgdir/usr/share/$pkgname"
    cp -a ${_pkgname}-${pkgver}/res "$pkgdir/usr/share/$pkgname/res"
    install -Dm755 build/src/${pkgname}-gtk/${pkgname} "$pkgdir/usr/lib/$pkgname/$pkgname"
+   install -Dm755 build/src/${pkgname}-gtk/${pkgname_r} "$pkgdir/usr/lib/$pkgname/$pkgname_r"
    cat >> "$pkgdir/usr/bin/$pkgname" <<-EOF
 #!/usr/bin/env sh
 [[ ! -d "\$HOME/.config/${pkgname}" ]] && mkdir -p "\$HOME/.config/${pkgname}"
 cd "\$HOME/.config/${pkgname}" || exit
-ln -s /usr/share/${pkgname}/res ./
-ln -s /usr/lib/${pkgname}/${pkgname} ${pkgname}
+[[ -e ./res ]] || ln -s /usr/share/${pkgname}/res ./
+[[ -e ${pkgname} ]] || ln -s /usr/lib/${pkgname}/${pkgname} ${pkgname}
 ./${pkgname} "\$@"
 wait
-if [[ -d res ]]
-then
-rm res
-fi
-if [[ -f c47 ]]
-then
-rm ${pkgname}
-fi
+[[ -L res ]] && rm res
+[[ -L ${pkgname} ]] && rm ${pkgname}
 EOF
    chmod 755 "$pkgdir/usr/bin/$pkgname"
+   cat >> "$pkgdir/usr/bin/${pkgname_r}" <<-EOF
+#!/usr/bin/env sh
+[[ ! -d "\$HOME/.config/${pkgname}" ]] && mkdir -p "\$HOME/.config/${pkgname}"
+cd "\$HOME/.config/${pkgname}" || exit
+[[ -e ./res ]] || ln -s /usr/share/${pkgname}/res ./
+[[ -e ${pkgname_r} ]] || ln -s /usr/lib/${pkgname}/${pkgname_r} ${pkgname_r}
+./${pkgname_r} "\$@"
+wait
+[[ -L res ]] && rm res
+[[ -L ${pkgname_r} ]] && rm ${pkgname_r}
+EOF
+   chmod 755 "$pkgdir/usr/bin/${pkgname_r}"

-   install -Dm644 "$srcdir/c47.desktop" "$pkgdir/usr/share/applications/c47.desktop"
+   install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
+   install -Dm644 "$srcdir/$pkgname_r.desktop" "$pkgdir/usr/share/applications/$pkgname_r.desktop"
    cd "$srcdir/${_pkgname}-${pkgver}/res"
    icotool -x "${pkgname}.ico"
+   icotool -x "${pkgname_r}.ico"
    _count=1
    for _size in {16,24,32,48,64,128,256};
    do
        case $_size in
            16|24|32|48|64)
                _depth=8
+               _depth_r=8
            ;;
            128)
                _depth=24
+               _depth_r=32
            ;;
            256)
                _depth=32
+               _depth_r=32
            ;;
        esac

        install -Dm644 ${pkgname}_${_count}_${_size}x${_size}x${_depth}.png "$pkgdir/usr/share/icons/hicolor/${_size}x${_size}/apps/${pkgname}.png"
+       install -Dm644 ${pkgname_r}_${_count}_${_size}x${_size}x${_depth_r}.png "$pkgdir/usr/share/icons/hicolor/${_size}x${_size}/apps/${pkgname_r}.png"
        _count=$(($_count + 1))

    done

raprism commented on 2026-02-01 21:13 (UTC)

The shell-script /usr/bin/c47 contains

cd "\$HOME/.config/${pkgname}" || exit
ln -s /usr/share/${pkgname}/res ./
ln -s /usr/lib/${pkgname}/${pkgname} ${pkgname}
./${pkgname} "\$@"
wait
rm -rf res ${pkgname}

The command in last line can destroy manually configured files. Especially the -r for rm is wrong, if one intends to remove only links.