Port of the elm programming language. https://elm-lang.org The patch applied before compiling elm comes from the following discussion: https://github.com/elm/compiler/issues/1892
Created attachment 203163 [details] Port shar file
bin/elm would conflict with mail/elm.
And for one file you need no pkg-plist. You can put it under PLIST_FILES in the Makefile.
This fails to build for me, I think because it tries to fetch during the build.
COMMENT needs the leading indefinite article ("A ") removed, and port needs confirmation of QA passing (portlint, poudriere)
Created attachment 204689 [details] elm.shar
Comment on attachment 204689 [details] elm.shar Removes the plist file and fixes COMMENT.
Created attachment 204835 [details] elm-lang.shar -- fixed to build under Poudriere with network, but still doesn't build by default I made small changes to the port, so that it at least builds under Poudriere with ALLOW_NETWORKING_PACKAGES="elm-lang" (previously it did not, as cabal was trying to write to a non-existent directory). This way it can at least be built, and afterwards the packaged binary works as expected. Me and Evilham (subscribed) spent quite a bit of effort trying to make this build without network, but we were not successful. The reason is that the Haskell bits are throwing logs under our feet: cabal does not actually really resolve dependencies until it tries to build things. Therefore, moving fetching of dependencies into the fetch part without also moving the build itself there doesn't work. The workaround used in other Haskell packages is to manually figure out the right dependencies and use the substantial machinery in Mk/Uses/cabal.mk. This is, unfortunately, also not quite usable, because cabal.mk assumes that the package in question is on Hackage, which Elm is not (well it is, but it is very much out of date). Evilham might be able to provide more details on this. I believe that the best way to make a "proper" port out of this would be to update the Elm package on Hackage, and do it the cabal.mk way. Would the elm people be willing to add up-to-date Elm to Hackage? If yes, we could ask the FreeBSD Haskell folks for help and hopefully make this work and get it committed.
Created attachment 205773 [details] lang/elm - 0.19 - poudriere no network needed Managed to do the job to make this build under poudriere without a need for network; thanks to arrowd for all the useful pointers. (Build log for quick reference, URL valid for 30 days: https://termbin.com/0d73) As I mentioned over at #haskell-freebsd, there is an interesting question about the language versions, e.g. right now it would be useful (though not necessary) to have both elm 0.18 and elm 0.19, in a few months/years though, when there is a new version of elm, we will likely want to be able to install the new one and 0.19 side-by-side, which can prove tricky if the port is just "elm" with version 0.19.0. An option would be to do something like what python does: elm018 (old, but used), elm019 (current), elm${VERSION} (future). That raises the question of the name for the executables, I'd incline right now towards having elm for the current version and elm018 for the old one. If provided guidance I'd be willing to help make that happen in a way that works out long-term, giving priority to getting the elm019 in shape to be added. Then, with so many people having touched this port, there is also the implicit question of the maintainer metadata, I left it at haskell@FreeBSD.org and subscribed to the ML as I guess that'd be mostly non controversial. Thank you in advance for any input you may have!
(In reply to Evilham from comment #9) Good job on making the port! From a quick glance, I have one nitpick - you probably don't need to have EXECUTABLES= elm in the Makefile, as it defaults to ${PORTNAME}. Hvae you tried actually compiling something using elm? Some Haskell packages require data files to be installed too, so it's better to try running it. I will try to compile your port in poudriere soon.
(In reply to Gleb Popov from comment #10) Indeed it works without EXECUTABLES as well, it was a left over from having named the port elm-lang at first. I probably should have mentioned that I built the elm-lang.org website with the binary package that was produced on poudriere as well as other sources and it worked just fine. Meanwhile I was taking a look at elm-0.18, it looks like that was a bit of a mess with multiple binaries from multiple repositories and an awkward build chain, so it may not be worth the time investment right now. arrowd mentioned that switching in the future to a master port / slave ports for the different versions wouldn't be too problematic, so maybe it'd be OK if we left lang/elm as the one and only elm port until a new version is released (which apparently can take anything from some months to some years) or someone (could be future me in some months) does the work to get 0.18 to compile properly.
Created attachment 205779 [details] lang/elm - 0.19 - poudriere no network needed Removed unnecessary EXECUTABLES in Makefile.
A commit references this bug: Author: arrowd Date: Mon Jul 15 18:58:10 UTC 2019 New revision: 506703 URL: https://svnweb.freebsd.org/changeset/ports/506703 Log: lang/elm: new port. A functional language for web development. PR: 236805 Submitted by: Evilham <contact@evilham.com> Changes: head/lang/Makefile head/lang/elm/ head/lang/elm/Makefile head/lang/elm/distinfo head/lang/elm/files/ head/lang/elm/files/patch-elm.cabal head/lang/elm/files/patch-ui_terminal_src_Develop_StaticFiles.hs head/lang/elm/pkg-descr
Thanks everyone involved in creating a port.