On Mon, Jan 15, 2024 at 03:33:56PM +0100, izder456 wrote:
> On 2024-01-15 00:08, izder456 wrote:
> > Hey,
> > 
> > I would like to import Bugdom (https://github.com/jorio/Bugdom),
> > which is an old Mac game that has a source port for modern systems.
> > 
> > Its just a simple old Nostalgic game for me, the port can be found here:
> > (https://github.com/izder456/myports)
> > 
> > Comments or OK to import?
> > --
> > -iz
> 
> Hey sorry,
> 
> Attached in the tarball.
> 
> new to port maintenance.
> 
> hopefully i packaged this up as i should have.
> 
> --
> -iz

Thanks, I think that's a pretty good start. I built it and can run it
with some modifications (see my attached Makefile). There are some
things to clarify, here the most important parts:

1. The game is licensed CC-BY-NC-SA. CC license is generally *not*
   recommended for software (see [1]). It looks like a couple of our
   ports are marked with a CC license. It would be good to hear some
   other sides on this. The main issue is that it doesn't address
   redistribution and modification of source code. (This is of course
   an upstream issue, but affects if we can PERMIT_PACKAGE. Also, the
   license doesn't seem to be applied to the source code files though
   that is a common omission on hobbyist GitHub projects.)

2. Ports are generally lower case, unless there is a strong reason to
   avoid that. I don't see that being the case here, so the directory
   should be changed from games/Bugdom to games/bugdom, and the PKGNAME
   accordingly.

The rest of my comments are more nits/style things. I recommend to
start with a copy of Makefile.template (in
/usr/ports/infrasturcture/templates) which helps keep a certain
structure that's close to a common style. Here my notes:

- Tabs seem to be generally preferred over spaces in ports Makefiles.
- FULLPKGNAME shouldn't be needed; and by default PKGNAME is set to
  DISTNAME, so some of that is superfluous.
- You did the legacy way of managing GitHub submodules - I changed it
  to using DIST_TUPLE in the attached Makefile which simplifies things
  a lot.
- Not sure how libsamplerate is used - as it's listed as both build
  and run dependency, check if it's statically linked?
- Don't put sdl2 in all 3 *_DEPENDS. Having it as LIB_DEPENDS in this
  case automatically turns it into build and run dependency (see
  bsd.port.mk(5)).
- I've simplified do-install with some globs and removing one
  unnecessary INSTALL_DATA_DIR.
- Regarding the script files/bugdom:
  `cd /usr/local/lib/Bugdom` means that it won't be able to save any
  core files if run with a normal user (which it should!). Not sure if
  there is a better way; might have to check with upstream if they can
  set things up to run the game from a separate location.
- Is ONLY_FOR_ARCHS=amd64 i386 really needed?
- portcheck(1) shows: `executable file: files/bugdom`. This should best
  not be executable inside the ports tree and only after installation.
- Lastly, I don't find the COMMENT and pkg/DESCR very useful. Taking a
  look at [2] and HOMEPAGE, I suggest for COMMENT one of:

    family-friendly 3D action adventure
        OR
    source port of the 3D action adventure Bugdom

- DESCR could take some cues from [2], for example the text under "The
  story".

[1] https://creativecommons.org/faq/
[2] https://jorio.itch.io/bugdom
ONLY_FOR_ARCHS = amd64 i386

COMMENT =       source port of the 3D action adventure Bugdom

V =             1.3.4
PKGNAME =       bugdom-${V}
DIST_TUPLE +=   github jorio Bugdom ${V} .
DIST_TUPLE +=   github jorio Pomme ef94150e2dcec522e3099f4d03a4e8f2639f7232 \
                extern/Pomme

CATEGORIES =    games

HOMEPAGE =      https://pangeasoft.net/bug

MAINTAINER =    izzy Meyer <izder...@disroot.org>

# CC-BY-NC SA 4.0
PERMIT_PACKAGE = Yes

WANTLIB +=      ${COMPILER_LIBCXX} GL SDL2 c m

# C++20
COMPILER =      base-clang ports-gcc

MODULES =       devel/cmake

BUILD_DEPENDS = audio/libsamplerate
LIB_DEPENDS =   devel/sdl2
RUN_DEPENDS =   audio/libsamplerate \
                devel/desktop-file-utils \
                x11/gtk+4,-guic

NO_TEST =       Yes

CFLAGS +=       -I${X11BASE}/include
CXXFLAGS +=     -I${X11BASE}/include

CONFIGURE_ARGS +=       -DCMAKE_BUILD_TYPE=Release \
                        -DCMAKE_INSTALL_PREFIX=${LOCALBASE}

do-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/Bugdom/
        ${INSTALL_DATA} ${WRKSRC}/*.md ${PREFIX}/share/doc/Bugdom/
        ${INSTALL_DATA_DIR} ${PREFIX}/lib/Bugdom/Data
        ${INSTALL_PROGRAM} ${WRKBUILD}/Bugdom ${PREFIX}/lib/Bugdom/
        ${INSTALL_SCRIPT} ${FILESDIR}/bugdom ${PREFIX}/bin/
        cp -Rv ${WRKBUILD}/Data/* ${PREFIX}/lib/Bugdom/Data/
        ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/512x512/apps/ \
                ${PREFIX}/share/applications/
        ${INSTALL_DATA} ${FILESDIR}/io.jor.bugdom.png \
                ${PREFIX}/share/icons/hicolor/512x512/apps/
        ${SUBST_CMD} -c -m ${SHAREMODE} -o ${SHAREOWN} -g ${SHAREGRP} \
                ${FILESDIR}/io.jor.bugdom.desktop \
                ${PREFIX}/share/applications/io.jor.bugdom.desktop

.include <bsd.port.mk>

Reply via email to