pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/elm-lang



Module Name:    pkgsrc
Committed By:   pho
Date:           Sun Mar  9 07:35:56 UTC 2025

Added Files:
        pkgsrc/lang/elm-lang: DESCR Makefile PLIST distinfo
        pkgsrc/lang/elm-lang/patches: patch-compiler_src_Data_Name.hs
            patch-compiler_src_Data_Utf8.hs
            patch-compiler_src_Parse_Variable.hs
            patch-compiler_src_Reporting_Doc.hs

Log Message:
lang/elm-lang: rename from lang/elm to avoid conflicting with mail/elm

Elm is a functional language that compiles to JavaScript. It helps you make
websites and web apps. It has a strong emphasis on simplicity and quality
tooling.

This package includes commands like `elm make`, `elm repl`, and many others
for helping make Elm developers happy and productive.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/elm-lang/DESCR \
    pkgsrc/lang/elm-lang/Makefile pkgsrc/lang/elm-lang/PLIST \
    pkgsrc/lang/elm-lang/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Name.hs \
    pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Utf8.hs \
    pkgsrc/lang/elm-lang/patches/patch-compiler_src_Parse_Variable.hs \
    pkgsrc/lang/elm-lang/patches/patch-compiler_src_Reporting_Doc.hs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/lang/elm-lang/DESCR
diff -u /dev/null pkgsrc/lang/elm-lang/DESCR:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/DESCR  Sun Mar  9 07:35:55 2025
@@ -0,0 +1,6 @@
+Elm is a functional language that compiles to JavaScript. It helps you make
+websites and web apps. It has a strong emphasis on simplicity and quality
+tooling.
+
+This package includes commands like `elm make`, `elm repl`, and many others
+for helping make Elm developers happy and productive.
Index: pkgsrc/lang/elm-lang/Makefile
diff -u /dev/null pkgsrc/lang/elm-lang/Makefile:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/Makefile       Sun Mar  9 07:35:55 2025
@@ -0,0 +1,61 @@
+# $NetBSD: Makefile,v 1.1 2025/03/09 07:35:55 pho Exp $
+
+DISTNAME=      elm-0.19.1
+PKGNAME=       ${DISTNAME:S/elm/elm-lang/}
+CATEGORIES=    lang
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=elm/}
+GITHUB_PROJECT=        compiler
+GITHUB_TAG=    refs/tags/${PKGVERSION_NOREV}
+DIST_SUBDIR=   elm-lang        # To avoid conflicting with mail/elm
+WRKSRC=                ${WRKDIR}/${GITHUB_PROJECT}-${PKGVERSION_NOREV}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://elm-lang.org/
+COMMENT=       Functional language that compiles to JavaScript
+LICENSE=       modified-bsd
+
+CONFLICTS=     elm-[0-9]*      # mail/elm
+
+HASKELL_UNRESTRICT_DEPENDENCIES+=      \
+       HTTP    \
+       ansi-terminal   \
+       ansi-wl-pprint  \
+       bytestring      \
+       containers      \
+       http-client     \
+       network
+
+# Elm really needs to fetch files during build, because a part of it is
+# implemented in Elm itself, and Elm requires Internet access to fetch
+# dependencies. It has no offline modes.
+ALLOW_NETWORK_ACCESS=  YES
+
+# Fix build with ansi-wl-pprint >= 1.0.
+SUBST_CLASSES+=                awp
+SUBST_STAGE.awp=       post-extract
+SUBST_MESSAGE.awp=     Adding a dependency on prettyprinter
+SUBST_FILES.awp=       elm.cabal
+SUBST_SED.awp=         -e 's/zip-archive/zip-archive, prettyprinter, text/'
+
+.include "../../devel/hs-ansi-terminal/buildlink3.mk"
+.include "../../textproc/hs-ansi-wl-pprint/buildlink3.mk"
+.include "../../textproc/hs-edit-distance/buildlink3.mk"
+.include "../../devel/hs-file-embed/buildlink3.mk"
+.include "../../sysutils/hs-filelock/buildlink3.mk"
+.include "../../www/hs-HTTP/buildlink3.mk"
+.include "../../www/hs-http-client/buildlink3.mk"
+.include "../../www/hs-http-client-tls/buildlink3.mk"
+.include "../../www/hs-http-types/buildlink3.mk"
+.include "../../lang/hs-language-glsl/buildlink3.mk"
+.include "../../net/hs-network/buildlink3.mk"
+.include "../../devel/hs-raw-strings-qq/buildlink3.mk"
+.include "../../math/hs-scientific/buildlink3.mk"
+.include "../../security/hs-SHA/buildlink3.mk"
+.include "../../www/hs-snap-core/buildlink3.mk"
+.include "../../www/hs-snap-server/buildlink3.mk"
+.include "../../devel/hs-unordered-containers/buildlink3.mk"
+.include "../../devel/hs-utf8-string/buildlink3.mk"
+.include "../../devel/hs-vector/buildlink3.mk"
+.include "../../archivers/hs-zip-archive/buildlink3.mk"
+.include "../../mk/haskell.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/lang/elm-lang/PLIST
diff -u /dev/null pkgsrc/lang/elm-lang/PLIST:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/PLIST  Sun Mar  9 07:35:55 2025
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2025/03/09 07:35:55 pho Exp $
+bin/elm
+share/doc/${HS_PLATFORM}/elm-${PKGVERSION}/LICENSE
Index: pkgsrc/lang/elm-lang/distinfo
diff -u /dev/null pkgsrc/lang/elm-lang/distinfo:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/distinfo       Sun Mar  9 07:35:55 2025
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2025/03/09 07:35:55 pho Exp $
+
+BLAKE2s (elm-0.19.1.tar.gz) = d4c754cf63e99fc4c440af83572e0dee8540819e1137241c4fb868b5aa1b937c
+SHA512 (elm-0.19.1.tar.gz) = 3d961a0aab0afe742c730f0a9058ad0457437d2665e729fc88106d4a6377c7b79058419c8658931b711719447f6afe37421abcc605d0113672baaee683383ac6
+Size (elm-0.19.1.tar.gz) = 490990 bytes
+SHA1 (patch-compiler_src_Data_Name.hs) = cfc63c7d0e0838d9ef083efbab5e8d67f954103e
+SHA1 (patch-compiler_src_Data_Utf8.hs) = 0babce9f193b40c5137ff1ed12c2262ccbddb090
+SHA1 (patch-compiler_src_Parse_Variable.hs) = ff0e2110ba492d5636efd1895772bb9ad28b806d
+SHA1 (patch-compiler_src_Reporting_Doc.hs) = 3209a6abb420c32563da894c284bf8c6c5e3bbd6

Index: pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Name.hs
diff -u /dev/null pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Name.hs:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Name.hs        Sun Mar  9 07:35:56 2025
@@ -0,0 +1,31 @@
+$NetBSD: patch-compiler_src_Data_Name.hs,v 1.1 2025/03/09 07:35:56 pho Exp $
+
+Fix build with GHC >= 9.4:
+https://github.com/elm/compiler/commit/0421dfbe48e53d880a401e201890eac0b3de5f06
+
+--- compiler/src/Data/Name.hs.orig     2019-10-20 14:31:43.000000000 +0000
++++ compiler/src/Data/Name.hs
+@@ -241,7 +241,7 @@ fromTypeVariable name@(Utf8.Utf8 ba#) in
+   else
+     let
+       len# = sizeofByteArray# ba#
+-      end# = indexWord8Array# ba# (len# -# 1#)
++      end# = word8ToWord# (indexWord8Array# ba# (len# -# 1#))
+     in
+     if isTrue# (leWord# 0x30## end#) && isTrue# (leWord# end# 0x39##) then
+       runST
+@@ -316,11 +316,11 @@ fromManyNames names =
+         ST $ \s ->
+           case newByteArray# (len# +# 3#) s of
+             (# s, mba# #) ->
+-              case writeWord8Array# mba# 0# 0x5F## {-_-} s of
++              case writeWord8Array# mba# 0# (wordToWord8# 0x5F##) {-_-} s of
+                 s ->
+-                  case writeWord8Array# mba# 1# 0x4D## {-M-} s of
++                  case writeWord8Array# mba# 1# (wordToWord8# 0x4D##) {-M-} s of
+                     s ->
+-                      case writeWord8Array# mba# 2# 0x24## {-$-} s of
++                      case writeWord8Array# mba# 2# (wordToWord8# 0x24##) {-$-} s of
+                         s ->
+                           case copyByteArray# ba# 0# mba# 3# len# s of
+                             s ->
Index: pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Utf8.hs
diff -u /dev/null pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Utf8.hs:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/patches/patch-compiler_src_Data_Utf8.hs        Sun Mar  9 07:35:56 2025
@@ -0,0 +1,103 @@
+$NetBSD: patch-compiler_src_Data_Utf8.hs,v 1.1 2025/03/09 07:35:56 pho Exp $
+
+Fix build with GHC >= 9.4:
+https://github.com/elm/compiler/commit/0421dfbe48e53d880a401e201890eac0b3de5f06
+
+--- compiler/src/Data/Utf8.hs.orig     2019-10-20 14:31:43.000000000 +0000
++++ compiler/src/Data/Utf8.hs
+@@ -109,10 +109,10 @@ contains (W8# word#) (Utf8 ba#) =
+   containsHelp word# ba# 0# (sizeofByteArray# ba#)
+ 
+ 
+-containsHelp :: Word# -> ByteArray# -> Int# -> Int# -> Bool
++containsHelp :: Word8# -> ByteArray# -> Int# -> Int# -> Bool
+ containsHelp word# ba# !offset# len# =
+   if isTrue# (offset# <# len#) then
+-    if isTrue# (eqWord# word# (indexWord8Array# ba# offset#))
++    if isTrue# (eqWord8# word# (indexWord8Array# ba# offset#))
+       then True
+       else containsHelp word# ba# (offset# +# 1#) len#
+   else
+@@ -145,7 +145,7 @@ startsWithChar isGood bytes@(Utf8 ba#) =
+     False
+   else
+     let
+-      !w# = indexWord8Array# ba# 0#
++      !w# = word8ToWord# (indexWord8Array# ba# 0#)
+       !char
+         | isTrue# (ltWord# w# 0xC0##) = C# (chr# (word2Int# w#))
+         | isTrue# (ltWord# w# 0xE0##) = chr2 ba# 0# w#
+@@ -164,7 +164,7 @@ endsWithWord8 (W8# w#) (Utf8 ba#) =
+   let len# = sizeofByteArray# ba# in
+   isTrue# (len# ># 0#)
+   &&
+-  isTrue# (eqWord# w# (indexWord8Array# ba# (len# -# 1#)))
++  isTrue# (eqWord8# w# (indexWord8Array# ba# (len# -# 1#)))
+ 
+ 
+ 
+@@ -186,11 +186,11 @@ splitHelp str start offsets =
+       unsafeSlice str start offset : splitHelp str (offset + 1) offsets
+ 
+ 
+-findDividers :: Word# -> ByteArray# -> Int# -> Int# -> [Int] -> [Int]
++findDividers :: Word8# -> ByteArray# -> Int# -> Int# -> [Int] -> [Int]
+ findDividers divider# ba# !offset# len# revOffsets =
+   if isTrue# (offset# <# len#) then
+     findDividers divider# ba# (offset# +# 1#) len# $
+-      if isTrue# (eqWord# divider# (indexWord8Array# ba# offset#))
++      if isTrue# (eqWord8# divider# (indexWord8Array# ba# offset#))
+       then I# offset# : revOffsets
+       else revOffsets
+   else
+@@ -351,7 +351,7 @@ toCharsHelp ba# offset# len# =
+     []
+   else
+     let
+-      !w# = indexWord8Array# ba# offset#
++      !w# = word8ToWord# (indexWord8Array# ba# offset#)
+       !(# char, width# #)
+         | isTrue# (ltWord# w# 0xC0##) = (# C# (chr# (word2Int# w#)), 1# #)
+         | isTrue# (ltWord# w# 0xE0##) = (# chr2 ba# offset# w#, 2# #)
+@@ -368,7 +368,7 @@ chr2 :: ByteArray# -> Int# -> Word# -> C
+ chr2 ba# offset# firstWord# =
+   let
+     !i1# = word2Int# firstWord#
+-    !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
++    !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
+     !c1# = uncheckedIShiftL# (i1# -# 0xC0#) 6#
+     !c2# = i2# -# 0x80#
+   in
+@@ -380,8 +380,8 @@ chr3 :: ByteArray# -> Int# -> Word# -> C
+ chr3 ba# offset# firstWord# =
+   let
+     !i1# = word2Int# firstWord#
+-    !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
+-    !i3# = word2Int# (indexWord8Array# ba# (offset# +# 2#))
++    !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
++    !i3# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 2#)))
+     !c1# = uncheckedIShiftL# (i1# -# 0xE0#) 12#
+     !c2# = uncheckedIShiftL# (i2# -# 0x80#) 6#
+     !c3# = i3# -# 0x80#
+@@ -394,9 +394,9 @@ chr4 :: ByteArray# -> Int# -> Word# -> C
+ chr4 ba# offset# firstWord# =
+   let
+     !i1# = word2Int# firstWord#
+-    !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
+-    !i3# = word2Int# (indexWord8Array# ba# (offset# +# 2#))
+-    !i4# = word2Int# (indexWord8Array# ba# (offset# +# 3#))
++    !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
++    !i3# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 2#)))
++    !i4# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 3#)))
+     !c1# = uncheckedIShiftL# (i1# -# 0xF0#) 18#
+     !c2# = uncheckedIShiftL# (i2# -# 0x80#) 12#
+     !c3# = uncheckedIShiftL# (i3# -# 0x80#) 6#
+@@ -471,7 +471,7 @@ toEscapedBuilderHelp before after !name@
+ escape :: Word8 -> Word8 -> Ptr a -> Utf8 t -> Int -> Int -> Int -> IO ()
+ escape before@(W8# before#) after ptr name@(Utf8 ba#) offset@(I# offset#) len@(I# len#) i@(I# i#) =
+   if isTrue# (i# <# len#) then
+-    if isTrue# (eqWord# before# (indexWord8Array# ba# (offset# +# i#)))
++    if isTrue# (eqWord8# before# (indexWord8Array# ba# (offset# +# i#)))
+     then
+       do  writeWordToPtr ptr i after
+           escape before after ptr name offset len (i + 1)
Index: pkgsrc/lang/elm-lang/patches/patch-compiler_src_Parse_Variable.hs
diff -u /dev/null pkgsrc/lang/elm-lang/patches/patch-compiler_src_Parse_Variable.hs:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/patches/patch-compiler_src_Parse_Variable.hs   Sun Mar  9 07:35:56 2025
@@ -0,0 +1,22 @@
+$NetBSD: patch-compiler_src_Parse_Variable.hs,v 1.1 2025/03/09 07:35:56 pho Exp $
+
+Fix build with GHC >= 9.4:
+https://github.com/elm/compiler/commit/0421dfbe48e53d880a401e201890eac0b3de5f06
+
+--- compiler/src/Parse/Variable.hs.orig        2019-10-20 14:31:43.000000000 +0000
++++ compiler/src/Parse/Variable.hs
+@@ -21,7 +21,7 @@ import qualified Data.Name as Name
+ import qualified Data.Set as Set
+ import Data.Word (Word8)
+ import Foreign.Ptr (Ptr, plusPtr)
+-import GHC.Exts (Char(C#), Int#, (+#), (-#), chr#, uncheckedIShiftL#, word2Int#)
++import GHC.Exts (Char(C#), Int#, (+#), (-#), chr#, uncheckedIShiftL#, word2Int#, word8ToWord#)
+ import GHC.Word (Word8(W8#))
+ 
+ import qualified AST.Source as Src
+@@ -384,4 +384,4 @@ chr4 pos firstWord =
+ 
+ unpack :: Word8 -> Int#
+ unpack (W8# word#) =
+-  word2Int# word#
++  word2Int# (word8ToWord# word#)
Index: pkgsrc/lang/elm-lang/patches/patch-compiler_src_Reporting_Doc.hs
diff -u /dev/null pkgsrc/lang/elm-lang/patches/patch-compiler_src_Reporting_Doc.hs:1.1
--- /dev/null   Sun Mar  9 07:35:56 2025
+++ pkgsrc/lang/elm-lang/patches/patch-compiler_src_Reporting_Doc.hs    Sun Mar  9 07:35:56 2025
@@ -0,0 +1,58 @@
+$NetBSD: patch-compiler_src_Reporting_Doc.hs,v 1.1 2025/03/09 07:35:56 pho Exp $
+
+Fix build with ansi-wl-pprint >= 1.0. This isn't a proper fix, because it
+just discards ANSI SGRs. But let's just hope that (seemingly half-dead)
+upstream fixes this in the future.
+
+--- compiler/src/Reporting/Doc.hs.orig 2025-03-08 03:42:32.184407808 +0000
++++ compiler/src/Reporting/Doc.hs
+@@ -48,10 +48,12 @@ import Prelude hiding (cycle)
+ import qualified Data.List as List
+ import Data.Monoid ((<>))
+ import qualified Data.Name as Name
++import qualified Data.Text as T
+ import qualified System.Console.ANSI.Types as Ansi
+ import qualified System.Info as Info
+ import System.IO (Handle)
+ import qualified Text.PrettyPrint.ANSI.Leijen as P
++import qualified Prettyprinter as PP
+ 
+ import qualified Data.Index as Index
+ import qualified Elm.Package as Pkg
+@@ -309,26 +311,28 @@ data Color
+ toJsonHelp :: Style -> [String] -> P.SimpleDoc -> [E.Value]
+ toJsonHelp style revChunks simpleDoc =
+   case simpleDoc of
+-    P.SFail ->
++    PP.SFail ->
+       error $
+         "according to the main implementation, @SFail@ can not\
+         \ appear uncaught in a rendered @SimpleDoc@"
+ 
+-    P.SEmpty ->
++    PP.SEmpty ->
+       [ encodeChunks style revChunks ]
+ 
+-    P.SChar char rest ->
++    PP.SChar char rest ->
+       toJsonHelp style ([char] : revChunks) rest
+ 
+-    P.SText _ string rest ->
+-      toJsonHelp style (string : revChunks) rest
++    PP.SText _ string rest ->
++      toJsonHelp style (T.unpack string : revChunks) rest
+ 
+-    P.SLine indent rest ->
++    PP.SLine indent rest ->
+       toJsonHelp style (replicate indent ' ' : "\n" : revChunks) rest
+ 
+-    P.SSGR sgrs rest ->
+-      encodeChunks style revChunks : toJsonHelp (sgrToStyle sgrs style) [] rest
++    PP.SAnnPush _ rest ->
++      encodeChunks style revChunks : toJsonHelp style [] rest
+ 
++    PP.SAnnPop rest ->
++      encodeChunks style revChunks : toJsonHelp style [] rest
+ 
+ sgrToStyle :: [Ansi.SGR] -> Style -> Style
+ sgrToStyle sgrs style@(Style bold underline color) =



Home | Main Index | Thread Index | Old Index