Updated golly-4.0 PKGBUILD for Arch Linux and Artix

Has something gone haywire? Let us know about it!
Post Reply
nokangaroo
Posts: 81
Joined: February 16th, 2017, 6:21 pm

Updated golly-4.0 PKGBUILD for Arch Linux and Artix

Post by nokangaroo » December 4th, 2020, 11:45 am

Since the AUR package of golly is orphaned, an updated PKGBUILD can be found at
https://gist.githubusercontent.com/maks ... 1/PKGBUILD.

I had to change it to make it work:

Code: Select all

cat >local-gtk-template.mk <<EOF
#WX_CONFIG=${srcdir}/wxWidgets-${_wxver}/build/wx-config #for local wxgtk build
WX_CONFIG=wx-config
GOLLYDIR=/usr/share/golly
PYTHON=/usr/bin/python #probably not needed, just don't say python3
DOCSDIR=/usr/share/docs/golly
LUADIR=/usr/share/golly/Scripts/Lua
CXXFLAGS=${CXXFLAGS}
LDFLAGS=${LDFLAGS}
ENABLE_PERL=1
EOF
DOCSDIR and LUADIR seem to be needed, without them the Help menu and Lua scripts didn't work.
If the target is "local-gtk.mk", IRRKLANGDIR and PYTHON should be overwritten.
Python-3.9 is python, not python3 (at least on Artix). Change the depends accordingly.

The following patch will enlarge the statusbar fontsize and change the colour to white, for use
with dark statusbar colours:

Code: Select all

--- gui-wx/wxstatus.cpp	2020-08-01 11:32:24.000000000 +0200
+++ gui-wx/wxstatus.cpp	2020-11-29 19:06:05.498683140 +0100
@@ -176,7 +176,7 @@
 void StatusBar::SetStatusFont(wxDC& dc)
 {
     dc.SetFont(statusfont);
-    dc.SetTextForeground(*wxBLACK);
+    dc.SetTextForeground(*wxWHITE);
     dc.SetBrush(*wxBLACK_BRUSH);
     dc.SetBackgroundMode(wxTRANSPARENT);
 }
@@ -584,8 +584,8 @@
     }
 #elif defined(__WXGTK__)
     // use smaller font on GTK
-    statusfont = wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-    textascent = 11;
+    statusfont = wxFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
+    textascent = 12;
 #elif defined(__WXMAC__)
     // we need to specify facename to get Monaco instead of Courier
     statusfont = wxFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Monaco"));

User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Re: Updated golly-4.0 PKGBUILD for Arch Linux and Artix

Post by Scorbie » December 7th, 2020, 8:39 pm

Thank you for the porting work :)

- I *think* you can override `local-gtk-template.mk` via `local-gtk.mk`, or does that not work?
(And then using `make -f makefile-gtk` for building)
(Cause if it doesn't that's my bad; gotta fix that and cleanup that portable distribution mess I made last year)
- Perl is not supported, so you might not want to enable it

- Also, is the statusbar patch intended for use with only dark statusbar colors? (Wonder if there's a "portable" way for it)

nokangaroo
Posts: 81
Joined: February 16th, 2017, 6:21 pm

Re: Updated golly-4.0 PKGBUILD for Arch Linux and Artix

Post by nokangaroo » March 27th, 2021, 8:19 pm

I am experiencing choppy rendering with the current Linux kernel with 60Hz and 75Hz screen refresh rates (I'm in Europe, whose power grid uses 50Hz). When I switch to 50Hz refresh rate, the rendering is smooth, but I shouldn't have to do that.

This patch fixes the rendering for me (at least with 50Hz grid frequency and gtk2. Save as wxprefs.h.patch):

Code: Select all

--- gui-wx/wxprefs.h	2020-05-24 08:48:15.000000000 +0200
+++ gui-wx/wxprefs.h	2021-03-14 17:37:56.272970818 +0100
@@ -330,7 +330,7 @@
     const int SIXTY_HERTZ = 15;
 #else
     // Mac and Linux
-    const int SIXTY_HERTZ = 16;     // 1000/60
+    const int SIXTY_HERTZ = 12;
 #endif
 
 // Following are used by GetPrefs() before the view window is created:
Here is an updated PKGBUILD for archlinux and artix using golly-git and wxWidgets-git:

Code: Select all

# Maintainer: Kyle Sferrazza <kyle.sferrazza@gmail.com>

# Contributor: Maks Verver <maksverver@geocities.com>
# Contributor: p2k <Patrick.Schneider@uni-ulm.de>
# Contributor: nokangaroo <nokangaroo@aon.at>

_ver=4.1
pkgname=golly
pkgver=4.1+cba85fac
pkgrel=1
pkgdesc="A simulator for Conway's Game of Life and other cellular automata"
arch=('i686' 'x86_64')
url="http://golly.sourceforge.net/"
license=('GPL')
depends=('glu')
makedepends=('python3')
optdepends=('python3: for Python scripting support')
source=("golly::git+https://git.code.sf.net/p/golly/code"
        "git+https://github.com/wxWidgets/wxWidgets"
        "make-abicheck-non-fatal.patch"
        "golly.desktop")
md5sums=('SKIP'
         'SKIP'
         'e71ac89e0ed2562d821cfbf1263ce4cb'
         'bf54bb7268dcba539162ee106d2a5063')

pkgver() {
  cd "${srcdir}/golly"
  printf ${_ver}+`git describe --always`
}

prepare() {
  cd "${srcdir}/wxWidgets"
  git submodule init 3rdparty/catch
  git config submodule.platform.url "${srcdir}/wxWidgets"
  git submodule update
  patch -Np1 < ../make-abicheck-non-fatal.patch

  cd "${srcdir}/golly"
  #patch -p0 < ../../wxprefs.cpp.patch  # Fix prefs window with gtk3

  # If you experience choppy rendering:
  patch -p0 < ../../wxprefs.h.patch     # Fix choppy rendering with current Linux kernel (gtk2 only)
}

build() {
  cd "${srcdir}/wxWidgets/build"
  ../configure --with-gtk=2 --disable-shared --enable-unicode --with-opengl --without-gtkprint --without-subdirs --disable-gtktest  #--disable-sys-libs
  make

  cd "${srcdir}/golly/gui-wx"
  cat >local-gtk-template.mk <<EOF
WX_CONFIG=${srcdir}/wxWidgets/build/wx-config
GOLLYDIR=/usr/share/golly
PYTHON=/usr/bin/python
DOCSDIR=/usr/share/docs/golly
LUADIR=/usr/share/golly/Scripts/Lua
CXXFLAGS=${CXXFLAGS}
LDFLAGS=${LDFLAGS}
EOF

  make -f makefile-gtk
}

package() {
  cd "${srcdir}/golly"

  install -d "${pkgdir}"/usr/bin
  install bgolly golly "${pkgdir}"/usr/bin/

  mkdir -p "$pkgdir"/usr/share{/,/doc/}golly
  cp -R Help Patterns Rules Scripts "$pkgdir"/usr/share/golly
  cp docs/* "$pkgdir"/usr/share/doc/golly
  install -D -m644 "${srcdir}/golly.desktop" \
    "$pkgdir"/usr/share/applications/"golly.desktop"
  install -D -m644 gui-wx/icons/appicon.xpm \
    "${pkgdir}/usr/share/pixmaps/golly.xpm"
}
# vim: ft=sh ts=2 et:
make-abicheck-non-fatal.patch:

Code: Select all

diff -up wxGTK-2.8.12/src/common/appbase.cpp.abicheck wxGTK-2.8.12/src/common/appbase.cpp
--- wxGTK-2.8.12/src/common/appbase.cpp.abicheck	2015-03-12 17:15:18.000000000 +0100
+++ wxGTK-2.8.12/src/common/appbase.cpp	2015-03-12 17:15:57.000000000 +0100
@@ -424,10 +424,7 @@ bool wxAppConsole::CheckBuildOptions(con
         msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."),
                    lib.c_str(), progName.c_str(), prog.c_str());
 
-        wxLogFatalError(msg.c_str());
-
-        // normally wxLogFatalError doesn't return
-        return false;
+        wxLogWarning(msg.c_str());
     }
 #undef wxCMP
 
For an experimental gtk3 build replace "--with-gtk=2" with "--with-gtk" and uncomment the wxprefs.cpp.patch line.
Save the following as wxprefs.cpp.patch:

Code: Select all

--- gui-wx/wxprefs.cpp	2020-10-16 22:56:38.000000000 +0200
+++ gui-wx/wxprefs.cpp	2021-02-23 18:00:10.270454342 +0100
@@ -3354,10 +3354,10 @@
     minbox->SetMinSize( maxbox->GetMinSize() );
 
     wxSpinCtrl* spin1 = new MySpinCtrl(panel, PREF_MAX_PATTERNS, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
 
     wxSpinCtrl* spin2 = new MySpinCtrl(panel, PREF_MAX_SCRIPTS, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
 
     wxBoxSizer* hpbox = new wxBoxSizer(wxHORIZONTAL);
     hpbox->Add(maxbox, 0, wxALIGN_CENTER_VERTICAL, 0);
@@ -3429,7 +3429,7 @@
     hbox1->Add(new wxStaticText(panel, wxID_STATIC, _("Random fill percentage:")),
                0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin1 = new MySpinCtrl(panel, PREF_RANDOM_FILL, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
     hbox1->Add(spin1, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
 
     // can_change_rule
@@ -3546,7 +3546,7 @@
     wxBoxSizer* hbox1 = new wxBoxSizer(wxHORIZONTAL);
     hbox1->Add(membox, 0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin1 = new MySpinCtrl(panel, PREF_MAX_MEM, wxEmptyString,
-                                       wxDefaultPosition, wxSize(80, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(190, wxDefaultCoord));
     hbox1->Add(spin1, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
 
     wxString memnote = algoinfo[algopos1]->canhash ? HASH_MEM_NOTE : NONHASH_MEM_NOTE;
@@ -3556,7 +3556,7 @@
     wxBoxSizer* hbox2 = new wxBoxSizer(wxHORIZONTAL);
     hbox2->Add(basebox, 0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin2 = new MySpinCtrl(panel, PREF_BASE_STEP, wxEmptyString,
-                                       wxDefaultPosition, wxSize(80, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(190, wxDefaultCoord));
     hbox2->Add(spin2, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
 
     wxString stepnote = algoinfo[algopos1]->canhash ? HASH_STEP_NOTE : NONHASH_STEP_NOTE;
@@ -3577,7 +3577,7 @@
     wxBoxSizer* hbox3 = new wxBoxSizer(wxHORIZONTAL);
     hbox3->Add(minbox, 0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin3 = new MySpinCtrl(panel, PREF_MIN_DELAY, wxEmptyString,
-                                       wxDefaultPosition, wxSize(80, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(150, wxDefaultCoord));
     hbox3->Add(spin3, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
     hbox3->Add(new wxStaticText(panel, wxID_STATIC, _("millisecs")),
                0, wxALIGN_CENTER_VERTICAL, 0);
@@ -3585,7 +3585,7 @@
     wxBoxSizer* hbox4 = new wxBoxSizer(wxHORIZONTAL);
     hbox4->Add(maxbox, 0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin4 = new MySpinCtrl(panel, PREF_MAX_DELAY, wxEmptyString,
-                                       wxDefaultPosition, wxSize(80, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(150, wxDefaultCoord));
     hbox4->Add(spin4, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
     hbox4->Add(new wxStaticText(panel, wxID_STATIC, _("millisecs")),
                0, wxALIGN_CENTER_VERTICAL, 0);
@@ -3680,7 +3680,7 @@
     wxCheckBox* check2 = new wxCheckBox(panel, PREF_SHOW_BOLD, _("Show bold grid lines every"));
 
     wxSpinCtrl* spin2 = new MySpinCtrl(panel, PREF_BOLD_SPACING, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
 
     hbox2->Add(check2, 0, wxALIGN_CENTER_VERTICAL, 0);
     hbox2->Add(spin2, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
@@ -3737,7 +3737,7 @@
     wxBoxSizer* hbox7 = new wxBoxSizer(wxHORIZONTAL);
     hbox7->Add(senslabel, 0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin4 = new MySpinCtrl(panel, PREF_SENSITIVITY, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
     hbox7->Add(spin4, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
 
     // thumb_range
@@ -3751,7 +3751,7 @@
     wxBoxSizer* hbox5 = new wxBoxSizer(wxHORIZONTAL);
     hbox5->Add(thumblabel, 0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin5 = new MySpinCtrl(panel, PREF_THUMB_RANGE, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
     hbox5->Add(spin5, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
     hbox5->Add(new wxStaticText(panel, wxID_STATIC, _("times view size")),
                0, wxALIGN_CENTER_VERTICAL, 0);
@@ -3849,7 +3849,7 @@
                                      _("Opacity percentage when drawing stacked layers:")),
                     0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin1 = new MySpinCtrl(panel, PREF_OPACITY, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
     opacitybox->Add(spin1, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
 
     // tile_border
@@ -3859,7 +3859,7 @@
                                     _("Border thickness for tiled layers:")),
                    0, wxALIGN_CENTER_VERTICAL, 0);
     wxSpinCtrl* spin2 = new MySpinCtrl(panel, PREF_TILE_BORDER, wxEmptyString,
-                                       wxDefaultPosition, wxSize(70, wxDefaultCoord));
+                                       wxDefaultPosition, wxSize(140, wxDefaultCoord));
     borderbox->Add(spin2, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, SPINGAP);
 
     // ask_on_new, ask_on_load, ask_on_delete, ask_on_quit, warn_on_save

Post Reply