From 4286f13856c2575108ef98fb4429700f1f62498f Mon Sep 17 00:00:00 2001 From: Toyam Cox Date: Wed, 23 Nov 2022 21:13:44 -0500 Subject: [PATCH] New package: d2-0.1.0 --- srcpkgs/d2/patches/64bit-int.patch | 81 ++++++++++++++++++++++++++++++ srcpkgs/d2/template | 13 +++++ 2 files changed, 94 insertions(+) create mode 100644 srcpkgs/d2/patches/64bit-int.patch create mode 100644 srcpkgs/d2/template diff --git a/srcpkgs/d2/patches/64bit-int.patch b/srcpkgs/d2/patches/64bit-int.patch new file mode 100644 index 000000000000..cbbf390532c2 --- /dev/null +++ b/srcpkgs/d2/patches/64bit-int.patch @@ -0,0 +1,81 @@ +diff --git a/d2layouts/d2sequence/sequence_diagram.go b/d2layouts/d2sequence/sequence_diagram.go +index 03abf99..bc8daa9 100644 +--- a/d2layouts/d2sequence/sequence_diagram.go ++++ b/d2layouts/d2sequence/sequence_diagram.go +@@ -43,7 +43,7 @@ type sequenceDiagram struct { + } + + func getObjEarliestLineNum(o *d2graph.Object) int { +- min := int(math.MaxInt64) ++ min := int(math.MaxInt32) + for _, ref := range o.References { + if ref.MapKey == nil { + continue +@@ -54,7 +54,7 @@ func getObjEarliestLineNum(o *d2graph.Object) int { + } + + func getEdgeEarliestLineNum(e *d2graph.Edge) int { +- min := int(math.MaxInt64) ++ min := int(math.MaxInt32) + for _, ref := range e.References { + if ref.MapKey == nil { + continue +@@ -294,10 +294,11 @@ func (sd *sequenceDiagram) placeActors() { + // ┌──────────────┐ + // │ actor │ + // └──────┬───────┘ +-// │ +-// │ lifeline +-// │ +-// │ ++// ++// │ ++// │ lifeline ++// │ ++// │ + func (sd *sequenceDiagram) addLifelineEdges() { + lastRoute := sd.messages[len(sd.messages)-1].Route + endY := 0. +@@ -365,14 +366,15 @@ func (sd *sequenceDiagram) placeNotes() { + // ┌──────────┐ + // │ actor │ + // └────┬─────┘ +-// ┌─┴──┐ +-// │ │ +-// |span| +-// │ │ +-// └─┬──┘ +-// │ +-// lifeline +-// │ ++// ++// ┌─┴──┐ ++// │ │ ++// |span| ++// │ │ ++// └─┬──┘ ++// │ ++// lifeline ++// │ + func (sd *sequenceDiagram) placeSpans() { + // quickly find the span center X + rankToX := make(map[int]float64) +diff --git a/d2target/d2target.go b/d2target/d2target.go +index bc312ca..b3ff970 100644 +--- a/d2target/d2target.go ++++ b/d2target/d2target.go +@@ -44,10 +44,10 @@ func (diagram Diagram) HashID() (string, error) { + } + + func (diagram Diagram) BoundingBox() (topLeft, bottomRight Point) { +- x1 := int(math.MaxInt64) +- y1 := int(math.MaxInt64) +- x2 := int(-math.MaxInt64) +- y2 := int(-math.MaxInt64) ++ x1 := int(math.MaxInt32) ++ y1 := int(math.MaxInt32) ++ x2 := int(-math.MaxInt32) ++ y2 := int(-math.MaxInt32) + + for _, targetShape := range diagram.Shapes { + x1 = go2.Min(x1, targetShape.Pos.X) diff --git a/srcpkgs/d2/template b/srcpkgs/d2/template new file mode 100644 index 000000000000..284ef3b0f2ae --- /dev/null +++ b/srcpkgs/d2/template @@ -0,0 +1,13 @@ +# Template file for 'd2' +pkgname=d2 +version=0.1.0 +revision=1 +build_style=go +go_import_path="oss.terrastruct.com/d2" +go_package="oss.terrastruct.com/d2 oss.terrastruct.com/d2/cmd/d2plugin-dagre" +short_desc="Modern diagram scripting language that turns text to diagrams" +maintainer="Toyam Cox " +license="MPL-2.0" +homepage="https://d2lang.com/" +distfiles="https://github.com/terrastruct/d2/archive/refs/tags/v${version}.tar.gz" +checksum=78fac0235fd583e28d961b0fd066994095a9cec4d5a834747833bbab042ab1c0