HaxeFoundation / HaxeFoundation/neko
[Feature request] a FreeBSD port
- Dominant language
- C
- Stars
- 587
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
As discussed, I would like to add Neko to a FreeBSD's Ports Collection. I can find some [traces of a Neko port](http://www.freebsdsoftware.org/lang/neko.html) and it also seems like it was
taken down.
I apologize in advance if that is too straightforward to someone, I want to explain what I am trying to do to those not very familiar with the process. Also, feedback is welcome and appreciated!
Information on how Ports Collection works can be found in [Porter's
Handbook](https://www.freebsd.org/doc/en/books/porters-handbook/). There is a straight-forward [walkthrough](https://www.freebsd.org/doc/en/books/porters-handbook/) of a simple port at the
beginning.
A binary install package is created automatically for every port (not right away though).
## Port files
To do get a port we need four files:
```
Makefile
distinfo
pkg-descr
pkg-plist
```
pkg-plist and distinfo can be (and should be) autogenerated, more on that below.
pkg-descr:
```
The Neko Programming Language
Neko is a high-level dynamically typed programming language which can
also be used as an embedded scripting language. It has been designed to
provide a common runtime for several different languages.
WWW: http://nekovm.org/
```
Makefile (with my comments):
```
# $FreeBSD$
# Port identification information. Version is made up, since the port is not
# pointing to any release yet.
PORTNAME= neko
PORTVERSION= 2.0p
CATEGORIES= lang
# This can be me, though can put any other email address instead
MAINTAINER= petr@somewhere.com
# A short version of what this port is about
COMMENT= Neko programming languages and virtual machine
# Self explanatory: license and GC library
LICENSE= MIT
LIB_DEPENDS= libgc-threaded.so:${PORTSDIR}/devel/boehm-gc-threaded
# Disable make -j
MAKE_JOBS_UNSAFE=yes
# Where to get the code from. This points to my own github repo, since I
# needed to make some changes to the code. Will need to use
# official Neko repository. Also, GH_TAGNAME can be a release name.
USE_GITHUB= yes
GH_ACCOUNT= ppenzin
# GH_PROJECT is the same as port name
GH_TAGNAME= 6138f0808895e54cf998cb644d1f4b255dbf83f4
# Build and install setting. Pointing INSTALL_PREFIX to where FreeBSD expects,
# setting a target that would produce stripped binaries.
USES= gmake
MAKE_ARGS= os=freebsd INSTALL_PREFIX=${STAGEDIR}${PREFIX}
# Use default build and install targets ("all" and "install" respectively)
# Run a smoke test after installing
post-install:
cd ${WRKSRC} && ${MAKE_CMD} ${MAKE_ARGS} test
.include
```
I would really appreciate any feedback on this. Also, if you are curious or
want to test my work read below for instructions.
## Port generation and testing
For the curious, to generate the rest of the port on a FreeBSD machine first
generate checksum (as root, connected to the internet):
```
# make makesum
```
This will download a tarball into distfile directory and create distinfo with a
checksum. Then get a list of files to add to pkg-plist (root not required):
```
$ make makeplist
...
/you/have/to/check/what/makeplist/gives/you
bin/neko
bin/nekoc
bin/nekoml
bin/nekoml.std
bin/nekotools
include/neko.h
include/neko_mod.h
include/neko_vm.h
lib/libneko.so
lib/neko/mysql5.ndll
lib/neko/regexp.ndll
lib/neko/sqlite.ndll
lib/neko/std.ndll
lib/neko/zlib.ndll
```
Copy the list of paths at the end of the output to pkg-plist file in the same directory. After that you can proceed to [test it](https://www.freebsd.org/doc/en/books/porters-handbook/porting-testing.html) as described in Porter's Handbook.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.