The package rpms/msgpack-d.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/msgpack-d.git/commit/?id=4ec248c54b7....
Change: +ExclusiveArch: %{ldc_arches}
Thanks.
Full change: ============
commit 4ec248c54b7e64aa438061891402ceb77eee78ef Author: Jonathan MERCIER bioinfornatics@gmail.com Date: Thu Oct 11 09:10:32 2018 +0200
Initial import (#1613570)
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28cd494 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/msgpack-d-1.0.0-beta.7.tar.gz diff --git a/0001-Add-Meson-build-definition.patch b/0001-Add-Meson-build-definition.patch new file mode 100644 index 0000000..324d526 --- /dev/null +++ b/0001-Add-Meson-build-definition.patch @@ -0,0 +1,89 @@ +From 7e8f9c962ea321ae02122af9c5d8a04d06d39914 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= zebob.m@gmail.com +Date: Tue, 28 Aug 2018 16:56:55 +0200 +Subject: [PATCH] Add Meson build definition + +--- + meson.build | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 73 insertions(+) + create mode 100644 meson.build + +diff --git a/meson.build b/meson.build +new file mode 100644 +index 0000000..282d52f +--- /dev/null ++++ b/meson.build +@@ -0,0 +1,73 @@ ++ project('msgpack-d', 'd', ++ meson_version: '>=0.47', ++ license: 'BSL-1.0', ++ version: '1.0.0' ++) ++ ++project_soversion = '1' ++ ++pkgc = import('pkgconfig') ++ ++# ++# Sources ++# ++msgpack_src = [ ++ 'src/msgpack/attribute.d', ++ 'src/msgpack/buffer.d', ++ 'src/msgpack/common.d', ++ 'src/msgpack/exception.d', ++ 'src/msgpack/package.d', ++ 'src/msgpack/packer.d', ++ 'src/msgpack/register.d', ++ 'src/msgpack/streaming_unpacker.d', ++ 'src/msgpack/unpacker.d', ++ 'src/msgpack/value.d', ++] ++ ++src_dir = include_directories('src/') ++ ++# ++# Targets ++# ++msgpack_lib = library('msgpack-d', ++ [msgpack_src], ++ include_directories: [src_dir], ++ install: true, ++ version: meson.project_version(), ++ soversion: project_soversion, ++) ++ ++pkgc.generate(name: 'msgpack-d', ++ libraries: [msgpack_lib], ++ subdirs: 'd/msgpack', ++ version: meson.project_version(), ++ description: 'Library for lexing and parsing D source code.' ++) ++ ++# for use by others which embed this as subproject ++msgpack_dep = declare_dependency( ++ link_with: [msgpack_lib], ++ include_directories: [src_dir] ++) ++ ++# ++# Tests ++# ++if meson.get_compiler('d').get_id() == 'llvm' ++ extra_args = ['-main', '-link-defaultlib-shared'] ++else ++ extra_args = ['-main'] ++endif ++ ++msgpack_test_exe = executable('test_msgpack', ++ [msgpack_src], ++ include_directories: [src_dir], ++ d_unittest: true, ++ link_args: extra_args, ++) ++test('test_msgpack', msgpack_test_exe) ++ ++# ++# Install ++# ++install_subdir('src/msgpack/', install_dir: 'include/d/msgpack/') diff --git a/0002-Fix-line-endings.patch b/0002-Fix-line-endings.patch new file mode 100644 index 0000000..2dacce0 --- /dev/null +++ b/0002-Fix-line-endings.patch @@ -0,0 +1,1125 @@ +From 886b9108e04cb825adf0884a3a6b0d33c03f21b7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= zebob.m@gmail.com +Date: Tue, 28 Aug 2018 16:43:09 +0200 +Subject: [PATCH] Fix line endings. Fixes #105 + +--- + example/array_test.d | 78 ++-- + example/map_test.d | 78 ++-- + html/candydoc/candy.ddoc | 104 +++--- + html/candydoc/modules.ddoc | 16 +- + html/candydoc/tree.js | 742 ++++++++++++++++++------------------- + html/candydoc/util.js | 46 +-- + 6 files changed, 532 insertions(+), 532 deletions(-) + +diff --git a/example/array_test.d b/example/array_test.d +index ece0bf4..b2d19ac 100644 +--- a/example/array_test.d ++++ b/example/array_test.d +@@ -1,39 +1,39 @@ +-import std.conv; +-import std.stdio; +-import std.datetime; +-import msgpack; +- +-struct A { +- int x; +-} +- +-struct Foo +-{ +- A[] a; +-} +- +-void main() +-{ +- Foo foo; +- foreach (a; 'a' .. 'z') +- foreach (b; 'a' .. 'z') +- foreach (c; 'a' .. 'z') +- foo.a ~= A(); +- +- auto sw = StopWatch(AutoStart.yes); +- ubyte[] data = msgpack.pack(foo); +- writeln(sw.peek.usecs); +- +- auto sw2 = StopWatch(AutoStart.yes); +- Foo foo1 = msgpack.unpack(data).as!(typeof(foo)); +- writeln(sw2.peek.usecs); +- +- assert(foo == foo1); +- +- Foo foo2; +- auto sw3 = StopWatch(AutoStart.yes); +- msgpack.unpack(data, foo2); +- writeln(sw3.peek.usecs); +- +- assert(foo == foo2); +-} ++import std.conv; ++import std.stdio; ++import std.datetime; ++import msgpack; ++ ++struct A { ++ int x; ++} ++ ++struct Foo ++{ ++ A[] a; ++} ++ ++void main() ++{ ++ Foo foo; ++ foreach (a; 'a' .. 'z') ++ foreach (b; 'a' .. 'z') ++ foreach (c; 'a' .. 'z') ++ foo.a ~= A(); ++ ++ auto sw = StopWatch(AutoStart.yes); ++ ubyte[] data = msgpack.pack(foo); ++ writeln(sw.peek.usecs); ++ ++ auto sw2 = StopWatch(AutoStart.yes); ++ Foo foo1 = msgpack.unpack(data).as!(typeof(foo)); ++ writeln(sw2.peek.usecs); ++ ++ assert(foo == foo1); ++ ++ Foo foo2; ++ auto sw3 = StopWatch(AutoStart.yes); ++ msgpack.unpack(data, foo2); ++ writeln(sw3.peek.usecs); ++ ++ assert(foo == foo2); ++} +diff --git a/example/map_test.d b/example/map_test.d +index 807a89a..6107cf6 100644 +--- a/example/map_test.d ++++ b/example/map_test.d +@@ -1,39 +1,39 @@ +-import std.conv; +-import std.stdio; +-import std.datetime; +-import msgpack; +- +-struct A { +- int x; +-} +- +-struct Foo +-{ +- A[string] a; +-} +- +-void main() +-{ +- Foo foo; +- foreach (a; 'a' .. 'z') +- foreach (b; 'a' .. 'z') +- foreach (c; 'a' .. 'z') +- foo.a[to!string(a) ~ to!string(b) ~ to!string(c)] = A(); +- +- auto sw = StopWatch(AutoStart.yes); +- ubyte[] data = msgpack.pack(foo); +- writeln(sw.peek.usecs); +- +- auto sw2 = StopWatch(AutoStart.yes); +- Foo foo1 = msgpack.unpack(data).as!(typeof(foo)); +- writeln(sw2.peek.usecs); +- +- assert(foo == foo1); +- +- Foo foo2; +- auto sw3 = StopWatch(AutoStart.yes); +- msgpack.unpack(data, foo2); +- writeln(sw3.peek.usecs); +- +- assert(foo == foo2); +-} ++import std.conv; ++import std.stdio; ++import std.datetime; ++import msgpack; ++ ++struct A { ++ int x; ++} ++ ++struct Foo ++{ ++ A[string] a; ++} ++ ++void main() ++{ ++ Foo foo; ++ foreach (a; 'a' .. 'z') ++ foreach (b; 'a' .. 'z') ++ foreach (c; 'a' .. 'z') ++ foo.a[to!string(a) ~ to!string(b) ~ to!string(c)] = A(); ++ ++ auto sw = StopWatch(AutoStart.yes); ++ ubyte[] data = msgpack.pack(foo); ++ writeln(sw.peek.usecs); ++ ++ auto sw2 = StopWatch(AutoStart.yes); ++ Foo foo1 = msgpack.unpack(data).as!(typeof(foo)); ++ writeln(sw2.peek.usecs); ++ ++ assert(foo == foo1); ++ ++ Foo foo2; ++ auto sw3 = StopWatch(AutoStart.yes); ++ msgpack.unpack(data, foo2); ++ writeln(sw3.peek.usecs); ++ ++ assert(foo == foo2); ++} +diff --git a/html/candydoc/candy.ddoc b/html/candydoc/candy.ddoc +index c438b2e..a40ba4c 100644 +--- a/html/candydoc/candy.ddoc ++++ b/html/candydoc/candy.ddoc +@@ -1,52 +1,52 @@ +-D = $(B $0) +- +-DDOC = +-<html><head> +-<meta http-equiv="content-type" content="text/html; charset=utf-8"> +-<meta content="text/javascript" http-equiv="content-script-type"> +-<title>$(TITLE)</title> +-<link rel="stylesheet" type="text/css" href="candydoc/style.css"> +-<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="candydoc/ie56hack.css"><![endif]--> +-<script language="JavaScript" src="candydoc/util.js" type="text/javascript"></script> +-<script language="JavaScript" src="candydoc/tree.js" type="text/javascript"></script> +-<script language="JavaScript" src="candydoc/explorer.js" type="text/javascript"></script> +-</head><body> +-<div id="tabarea"></div><div id="explorerclient"></div> +-<div id="content"><script>explorer.initialize("$(TITLE)");</script> +- <table class="content"> +- <tr><td id="docbody"><h1>$(TITLE)</h1>$(BODY)</td></tr> +- <tr><td id="docfooter"> +- Page was generated with +- <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> +- on $(DATETIME) +- </td></tr> +- </table> +-</div> +-$(ADD_MODULES) +-</body></html> +- +- +-DDOC_DECL = +-<script>explorer.outline.writeEnabled = true;</script> +-$(DT <span class="decl">$0</span>) +-<script>explorer.outline.writeEnabled = false;</script> +- +- +-DDOC_PSYMBOL = +-<span class="currsymbol">$0</span> +-<script>explorer.outline.addDecl('$0');</script> +- +- +-DDOC_MEMBERS = +-<script>explorer.outline.incSymbolLevel();</script> +-$(DL $0) +-<script>explorer.outline.decSymbolLevel();</script> +- +- +-DDOC_PARAM_ID = +-<td nowrap valign="top" style="padding-right: 8px">$0</td> +- +- +-DDOC_PARAM =<span class="funcparam">$0</span> +-ADD_MODULES =<script>$(MODULES)</script> +-MODULE =explorer.packageExplorer.addModule("$0"); ++D = $(B $0) ++ ++DDOC = ++<html><head> ++<meta http-equiv="content-type" content="text/html; charset=utf-8"> ++<meta content="text/javascript" http-equiv="content-script-type"> ++<title>$(TITLE)</title> ++<link rel="stylesheet" type="text/css" href="candydoc/style.css"> ++<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="candydoc/ie56hack.css"><![endif]--> ++<script language="JavaScript" src="candydoc/util.js" type="text/javascript"></script> ++<script language="JavaScript" src="candydoc/tree.js" type="text/javascript"></script> ++<script language="JavaScript" src="candydoc/explorer.js" type="text/javascript"></script> ++</head><body> ++<div id="tabarea"></div><div id="explorerclient"></div> ++<div id="content"><script>explorer.initialize("$(TITLE)");</script> ++ <table class="content"> ++ <tr><td id="docbody"><h1>$(TITLE)</h1>$(BODY)</td></tr> ++ <tr><td id="docfooter"> ++ Page was generated with ++ <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> ++ on $(DATETIME) ++ </td></tr> ++ </table> ++</div> ++$(ADD_MODULES) ++</body></html> ++ ++ ++DDOC_DECL = ++<script>explorer.outline.writeEnabled = true;</script> ++$(DT <span class="decl">$0</span>) ++<script>explorer.outline.writeEnabled = false;</script> ++ ++ ++DDOC_PSYMBOL = ++<span class="currsymbol">$0</span> ++<script>explorer.outline.addDecl('$0');</script> ++ ++ ++DDOC_MEMBERS = ++<script>explorer.outline.incSymbolLevel();</script> ++$(DL $0) ++<script>explorer.outline.decSymbolLevel();</script> ++ ++ ++DDOC_PARAM_ID = ++<td nowrap valign="top" style="padding-right: 8px">$0</td> ++ ++ ++DDOC_PARAM =<span class="funcparam">$0</span> ++ADD_MODULES =<script>$(MODULES)</script> ++MODULE =explorer.packageExplorer.addModule("$0"); +diff --git a/html/candydoc/modules.ddoc b/html/candydoc/modules.ddoc +index 18a293d..f36692a 100644 +--- a/html/candydoc/modules.ddoc ++++ b/html/candydoc/modules.ddoc +@@ -1,8 +1,8 @@ +-MODULES = +-$(MODULE msgpack.buffer) +-$(MODULE msgpack.common) +-$(MODULE msgpack.msgpack) +-$(MODULE msgpack.object) +-$(MODULE msgpack.packer) +-$(MODULE msgpack.unpacker) +-$(MODULE msgpack.util) ++MODULES = ++$(MODULE msgpack.buffer) ++$(MODULE msgpack.common) ++$(MODULE msgpack.msgpack) ++$(MODULE msgpack.object) ++$(MODULE msgpack.packer) ++$(MODULE msgpack.unpacker) ++$(MODULE msgpack.util) +diff --git a/html/candydoc/tree.js b/html/candydoc/tree.js +index 793250a..97996c0 100644 +--- a/html/candydoc/tree.js ++++ b/html/candydoc/tree.js +@@ -1,374 +1,374 @@ + /* This file is a part of CanDyDOC fileset. + File is written by Victor Nakoryakov and placed into the public domain. + +- This file is javascript with classes that represents native style tree control. */ +- +-var pmNone = 0; +-var pmPlus = 1; +-var pmMinus = 2; +- +-var hlNone = 0; +-var hlGrey = 1; +-var hlSelected = 2; +- +-function TreeView(hrefMode) +-{ +- this.domEntry = document.createElement("div"); +- this.children = new Array(); +- this.selection = null; +- this.hrefMode = hrefMode; +- +- this.createBranch = function(text, iconSrc) +- { +- var root = new TreeNode(text, iconSrc, this.hrefMode); +- root.owner = this; +- this.children[ this.children.length ] = root; +- this.domEntry.appendChild( root.domEntry ); +- return root; +- } +- +- this.branch = function(text) +- { +- var ret = null; +- for (var i = 0; i < this.children.length; ++i) +- if (this.children[i].textElement.data == text) +- { +- ret = this.children[i]; +- break; +- } +- +- return ret; +- } +- +- this.domEntry.style.fontSize = "10px"; +- this.domEntry.style.cursor = "default"; +- this.domEntry.style.whiteSpace = "nowrap"; +-} +- +-var idCounter = 0; +-function TreeNode(text, iconSrc, hrefMode) +-{ +- this.id = idCounter++; +- this.parentNode = null; +- this.children = new Array(); +- this.domEntry = document.createElement("div"); +- this.icon = document.createElement("img"); +- this.textElement = document.createTextNode(text); +- this.textSpan = document.createElement("span"); +- this.lineDiv = document.createElement("div"); +- this.hierarchyImgs = new Array(); +- this.onclick = null; +- +- function createIcon() +- { +- var img = document.createElement("img"); +- img.style.verticalAlign = "middle"; +- img.style.position = "relative"; +- img.style.top = "-1px"; +- img.width = 16; +- img.height = 16; +- return img; +- } +- +- function createHierarchyImage() +- { +- var img = createIcon(); +- img.pointsTop = false; +- img.pointsBottom = false; +- img.pointsRight = false; +- img.pmState = pmNone; +- return img; +- } +- +- function genHierarchyImageSrc(hierarchyImg) +- { +- var name = ""; +- if (hierarchyImg.pointsTop) +- name += "t"; +- +- if (hierarchyImg.pointsBottom) +- name += "b"; +- +- if (hierarchyImg.pointsRight) +- name += "r"; +- +- if (hierarchyImg.pmState == pmPlus) +- name += "p"; +- else if (hierarchyImg.pmState == pmMinus) +- name += "m"; +- +- if (name == "") +- name = "shim"; +- +- return "candydoc/img/tree/" + name + ".gif"; +- } +- +- function setSrc(icon, src) +- { +- icon.src = src; +- // After src change width and height are reseted in IE. +- // Bug workaround: +- icon.width = 16; +- icon.height = 16; +- } +- +- this.createChild = function(text, iconSrc) +- { +- var child = new TreeNode(text, iconSrc, this.owner.hrefMode); +- this.children[ this.children.length ] = child; +- this.domEntry.appendChild( child.domEntry ); +- child.parentNode = this; +- child.owner = this.owner; +- +- // insert hierarchy images according to deepness level +- // of created child. +- +- if (this.children.length > 1) +- { +- // there were already added child before. So copy `level-1` +- // hierarchy images from it. +- +- var prevAddedChild = this.children[ this.children.length - 2 ]; +- +- for (var i = 0; i < prevAddedChild.hierarchyImgs.length - 1; ++i) +- { +- var prevAddedChildImg = prevAddedChild.hierarchyImgs[i]; +- var img = createHierarchyImage(); +- setSrc(img, prevAddedChildImg.src); +- img.pointsTop = prevAddedChildImg.pointsTop; +- img.pointsBottom = prevAddedChildImg.pointsBottom; +- img.pointsRight = prevAddedChildImg.pointsRight; +- img.pmState = prevAddedChildImg.pmState; +- +- child.hierarchyImgs[ child.hierarchyImgs.length ] = img; +- child.lineDiv.insertBefore(img, child.icon); +- } +- +- // change last hierarchy image of prevAddedChild from |_ to |- +- var lastHierarchyImg = prevAddedChild.hierarchyImgs[ prevAddedChild.hierarchyImgs.length - 1 ]; +- lastHierarchyImg.pointsBottom = true; +- setSrc(lastHierarchyImg, genHierarchyImageSrc(lastHierarchyImg)); +- +- // change hierarchy images of prevAddedChild's children on it's last +- // level to | +- prevAddedChild.addHierarchyTBLine(prevAddedChild.hierarchyImgs.length - 1); +- } +- else +- { +- // this is a first child. So copy `level-2` +- // hierarchy images from parent, i.e. this. +- +- for (var i = 0; i < this.hierarchyImgs.length - 1; ++i) +- { +- var parentImg = this.hierarchyImgs[i]; +- var img = createHierarchyImage(); +- setSrc(img, parentImg.src); +- img.pointsTop = parentImg.pointsTop; +- img.pointsBottom = parentImg.pointsBottom; +- img.pointsRight = parentImg.pointsRight; +- img.pmState = parentImg.pmState; +- +- child.hierarchyImgs[ child.hierarchyImgs.length ] = img; +- child.lineDiv.insertBefore(img, child.icon); +- } +- +- if (this.hierarchyImgs.length > 0) // we are not root +- { +- // change last hierarchy image of parent (i.e. this): add minus to it +- var lastHierarchyImg = this.hierarchyImgs[ this.hierarchyImgs.length - 1]; +- lastHierarchyImg.pmState = pmMinus; +- setSrc(lastHierarchyImg, genHierarchyImageSrc(lastHierarchyImg)); +- lastHierarchyImg.owner = this; +- lastHierarchyImg.onclick = new Function("e", "this.owner.processPMClick(e);"); +- +- // make decision on image on `level-1`. It depends on parent's (ie this) +- // image on same level. +- var parentL1HierarchyImg = lastHierarchyImg; +- var l1HierarchyImg = createHierarchyImage(); +- if (parentL1HierarchyImg.pointsBottom) +- { +- l1HierarchyImg.pointsTop = true; +- l1HierarchyImg.pointsBottom = true; +- } +- setSrc(l1HierarchyImg, genHierarchyImageSrc(l1HierarchyImg)); +- child.hierarchyImgs[ child.hierarchyImgs.length ] = l1HierarchyImg; +- child.lineDiv.insertBefore(l1HierarchyImg, child.icon); +- } +- } +- +- // in any case on last level our child will have icon |_ +- var img = createHierarchyImage(); +- img.pointsTop = true; +- img.pointsRight = true; +- setSrc(img, genHierarchyImageSrc(img)); +- +- child.hierarchyImgs[ child.hierarchyImgs.length ] = img; +- child.lineDiv.insertBefore(img, child.icon); +- +- return child; +- } +- +- this.lastChild = function() +- { +- return this.children[ this.children.length - 1 ]; +- } +- +- this.child = function(text) +- { +- var ret = null; +- for (var i = 0; i < this.children.length; ++i) +- if (this.children[i].textElement.data == text) +- { +- ret = this.children[i]; +- break; +- } +- +- return ret; +- } +- +- this.addHierarchyTBLine = function(level) +- { +- for (var i = 0; i < this.children.length; ++i) +- { +- var img = this.children[i].hierarchyImgs[level]; +- img.pointsTop = true; +- img.pointsBottom = true; +- setSrc(img, genHierarchyImageSrc(img)); +- this.children[i].addHierarchyTBLine(level); +- } +- } +- +- this.expand = function() +- { +- var img = this.hierarchyImgs[ this.hierarchyImgs.length - 1 ]; +- +- if (img.pmState == pmPlus) +- { +- img.pmState = pmMinus; +- setSrc(img, genHierarchyImageSrc(img)); +- +- for (var i = 0; i < this.children.length; ++i) +- this.children[i].domEntry.style.display = ""; +- } +- } +- +- this.collapse = function() +- { +- var img = this.hierarchyImgs[ this.hierarchyImgs.length - 1 ]; +- +- if (img.pmState == pmMinus) +- { +- img.pmState = pmPlus; +- setSrc(img, genHierarchyImageSrc(img)); +- +- for (var i = 0; i < this.children.length; ++i) +- this.children[i].domEntry.style.display = "none"; +- } +- } +- +- this.toggle = function() +- { +- var img = this.hierarchyImgs[ this.hierarchyImgs.length - 1 ]; +- if (img.pmState == pmMinus) +- this.collapse(); +- else +- this.expand(); +- } +- +- this.select = function() +- { +- if (this.owner.selection != this) +- { +- if (this.owner.selection) +- this.owner.selection.setHighlight(hlNone); +- +- this.owner.selection = this; +- this.setHighlight(hlSelected); +- } +- } +- +- this.setHighlight = function(mode) +- { +- if (mode == hlNone) +- { +- this.textSpan.style.backgroundColor = ""; +- this.textSpan.style.color = ""; +- this.textSpan.style.border = ""; +- } +- else if (mode == hlGrey) +- { +- this.textSpan.style.backgroundColor = "#aaaaaa"; +- this.textSpan.style.color = ""; +- this.textSpan.style.border = ""; +- } +- else if (mode == hlSelected) +- { +- this.textSpan.style.backgroundColor = "3399cc"; +- this.textSpan.style.color = "white"; +- this.textSpan.style.border = "dotted 1px red"; +- } +- } +- +- this.setOnclick = function(proc) +- { +- this.onclick = proc; +- } +- +- this.setRef = function(url) +- { +- if (this.anchor) +- this.anchor.href = url; +- } +- +- this.processPMClick = function(e) +- { +- this.toggle(); +- +- // prevent this line selection, stop bubbling +- if (e) +- e.stopPropagation(); // Mozilla way +- if (window.event) +- window.event.cancelBubble = true; // IE way +- } +- +- this.processOnclick = function() +- { +- this.select(); +- if (this.onclick instanceof Function) +- this.onclick(); +- } +- +- /////////////////////////////////////////////////////////////////////////// +- if (iconSrc) +- this.icon.src = iconSrc; +- else +- { +- this.icon.width = 0; +- this.icon.height = 0; +- } +- +- this.icon.style.verticalAlign = "middle"; +- this.icon.style.position = "relative"; +- this.icon.style.top = "-1px"; +- this.icon.style.paddingRight = "2px"; +- +- if (!hrefMode) +- { +- this.textSpan.appendChild( this.textElement ); +- } +- else +- { +- this.anchor = document.createElement("a"); +- this.anchor.appendChild( this.textElement ); +- this.textSpan.appendChild( this.anchor ); +- } +- +- this.lineDiv.appendChild( this.icon ); +- this.lineDiv.appendChild( this.textSpan ); +- this.domEntry.appendChild( this.lineDiv ); +- +- this.lineDiv.owner = this; +- +- if (!hrefMode) +- this.lineDiv.onclick = new Function("this.owner.processOnclick();"); +-} ++ This file is javascript with classes that represents native style tree control. */ ++ ++var pmNone = 0; ++var pmPlus = 1; ++var pmMinus = 2; ++ ++var hlNone = 0; ++var hlGrey = 1; ++var hlSelected = 2; ++ ++function TreeView(hrefMode) ++{ ++ this.domEntry = document.createElement("div"); ++ this.children = new Array(); ++ this.selection = null; ++ this.hrefMode = hrefMode; ++ ++ this.createBranch = function(text, iconSrc) ++ { ++ var root = new TreeNode(text, iconSrc, this.hrefMode); ++ root.owner = this; ++ this.children[ this.children.length ] = root; ++ this.domEntry.appendChild( root.domEntry ); ++ return root; ++ } ++ ++ this.branch = function(text) ++ { ++ var ret = null; ++ for (var i = 0; i < this.children.length; ++i) ++ if (this.children[i].textElement.data == text) ++ { ++ ret = this.children[i]; ++ break; ++ } ++ ++ return ret; ++ } ++ ++ this.domEntry.style.fontSize = "10px"; ++ this.domEntry.style.cursor = "default"; ++ this.domEntry.style.whiteSpace = "nowrap"; ++} ++ ++var idCounter = 0; ++function TreeNode(text, iconSrc, hrefMode) ++{ ++ this.id = idCounter++; ++ this.parentNode = null; ++ this.children = new Array(); ++ this.domEntry = document.createElement("div"); ++ this.icon = document.createElement("img"); ++ this.textElement = document.createTextNode(text); ++ this.textSpan = document.createElement("span"); ++ this.lineDiv = document.createElement("div"); ++ this.hierarchyImgs = new Array(); ++ this.onclick = null; ++ ++ function createIcon() ++ { ++ var img = document.createElement("img"); ++ img.style.verticalAlign = "middle"; ++ img.style.position = "relative"; ++ img.style.top = "-1px"; ++ img.width = 16; ++ img.height = 16; ++ return img; ++ } ++ ++ function createHierarchyImage() ++ { ++ var img = createIcon(); ++ img.pointsTop = false; ++ img.pointsBottom = false; ++ img.pointsRight = false; ++ img.pmState = pmNone; ++ return img; ++ } ++ ++ function genHierarchyImageSrc(hierarchyImg) ++ { ++ var name = ""; ++ if (hierarchyImg.pointsTop) ++ name += "t"; ++ ++ if (hierarchyImg.pointsBottom) ++ name += "b"; ++ ++ if (hierarchyImg.pointsRight) ++ name += "r"; ++ ++ if (hierarchyImg.pmState == pmPlus) ++ name += "p"; ++ else if (hierarchyImg.pmState == pmMinus) ++ name += "m"; ++ ++ if (name == "") ++ name = "shim"; ++ ++ return "candydoc/img/tree/" + name + ".gif"; ++ } ++ ++ function setSrc(icon, src) ++ { ++ icon.src = src; ++ // After src change width and height are reseted in IE. ++ // Bug workaround: ++ icon.width = 16; ++ icon.height = 16; ++ } ++ ++ this.createChild = function(text, iconSrc) ++ { ++ var child = new TreeNode(text, iconSrc, this.owner.hrefMode); ++ this.children[ this.children.length ] = child; ++ this.domEntry.appendChild( child.domEntry ); ++ child.parentNode = this; ++ child.owner = this.owner; ++ ++ // insert hierarchy images according to deepness level ++ // of created child. ++ ++ if (this.children.length > 1) ++ { ++ // there were already added child before. So copy `level-1` ++ // hierarchy images from it. ++ ++ var prevAddedChild = this.children[ this.children.length - 2 ]; ++ ++ for (var i = 0; i < prevAddedChild.hierarchyImgs.length - 1; ++i) ++ { ++ var prevAddedChildImg = prevAddedChild.hierarchyImgs[i]; ++ var img = createHierarchyImage(); ++ setSrc(img, prevAddedChildImg.src); ++ img.pointsTop = prevAddedChildImg.pointsTop; ++ img.pointsBottom = prevAddedChildImg.pointsBottom; ++ img.pointsRight = prevAddedChildImg.pointsRight; ++ img.pmState = prevAddedChildImg.pmState; ++ ++ child.hierarchyImgs[ child.hierarchyImgs.length ] = img; ++ child.lineDiv.insertBefore(img, child.icon); ++ } ++ ++ // change last hierarchy image of prevAddedChild from |_ to |- ++ var lastHierarchyImg = prevAddedChild.hierarchyImgs[ prevAddedChild.hierarchyImgs.length - 1 ]; ++ lastHierarchyImg.pointsBottom = true; ++ setSrc(lastHierarchyImg, genHierarchyImageSrc(lastHierarchyImg)); ++ ++ // change hierarchy images of prevAddedChild's children on it's last ++ // level to | ++ prevAddedChild.addHierarchyTBLine(prevAddedChild.hierarchyImgs.length - 1); ++ } ++ else ++ { ++ // this is a first child. So copy `level-2` ++ // hierarchy images from parent, i.e. this. ++ ++ for (var i = 0; i < this.hierarchyImgs.length - 1; ++i) ++ { ++ var parentImg = this.hierarchyImgs[i]; ++ var img = createHierarchyImage(); ++ setSrc(img, parentImg.src); ++ img.pointsTop = parentImg.pointsTop; ++ img.pointsBottom = parentImg.pointsBottom; ++ img.pointsRight = parentImg.pointsRight; ++ img.pmState = parentImg.pmState; ++ ++ child.hierarchyImgs[ child.hierarchyImgs.length ] = img; ++ child.lineDiv.insertBefore(img, child.icon); ++ } ++ ++ if (this.hierarchyImgs.length > 0) // we are not root ++ { ++ // change last hierarchy image of parent (i.e. this): add minus to it ++ var lastHierarchyImg = this.hierarchyImgs[ this.hierarchyImgs.length - 1]; ++ lastHierarchyImg.pmState = pmMinus; ++ setSrc(lastHierarchyImg, genHierarchyImageSrc(lastHierarchyImg)); ++ lastHierarchyImg.owner = this; ++ lastHierarchyImg.onclick = new Function("e", "this.owner.processPMClick(e);"); ++ ++ // make decision on image on `level-1`. It depends on parent's (ie this) ++ // image on same level. ++ var parentL1HierarchyImg = lastHierarchyImg; ++ var l1HierarchyImg = createHierarchyImage(); ++ if (parentL1HierarchyImg.pointsBottom) ++ { ++ l1HierarchyImg.pointsTop = true; ++ l1HierarchyImg.pointsBottom = true; ++ } ++ setSrc(l1HierarchyImg, genHierarchyImageSrc(l1HierarchyImg)); ++ child.hierarchyImgs[ child.hierarchyImgs.length ] = l1HierarchyImg; ++ child.lineDiv.insertBefore(l1HierarchyImg, child.icon); ++ } ++ } ++ ++ // in any case on last level our child will have icon |_ ++ var img = createHierarchyImage(); ++ img.pointsTop = true; ++ img.pointsRight = true; ++ setSrc(img, genHierarchyImageSrc(img)); ++ ++ child.hierarchyImgs[ child.hierarchyImgs.length ] = img; ++ child.lineDiv.insertBefore(img, child.icon); ++ ++ return child; ++ } ++ ++ this.lastChild = function() ++ { ++ return this.children[ this.children.length - 1 ]; ++ } ++ ++ this.child = function(text) ++ { ++ var ret = null; ++ for (var i = 0; i < this.children.length; ++i) ++ if (this.children[i].textElement.data == text) ++ { ++ ret = this.children[i]; ++ break; ++ } ++ ++ return ret; ++ } ++ ++ this.addHierarchyTBLine = function(level) ++ { ++ for (var i = 0; i < this.children.length; ++i) ++ { ++ var img = this.children[i].hierarchyImgs[level]; ++ img.pointsTop = true; ++ img.pointsBottom = true; ++ setSrc(img, genHierarchyImageSrc(img)); ++ this.children[i].addHierarchyTBLine(level); ++ } ++ } ++ ++ this.expand = function() ++ { ++ var img = this.hierarchyImgs[ this.hierarchyImgs.length - 1 ]; ++ ++ if (img.pmState == pmPlus) ++ { ++ img.pmState = pmMinus; ++ setSrc(img, genHierarchyImageSrc(img)); ++ ++ for (var i = 0; i < this.children.length; ++i) ++ this.children[i].domEntry.style.display = ""; ++ } ++ } ++ ++ this.collapse = function() ++ { ++ var img = this.hierarchyImgs[ this.hierarchyImgs.length - 1 ]; ++ ++ if (img.pmState == pmMinus) ++ { ++ img.pmState = pmPlus; ++ setSrc(img, genHierarchyImageSrc(img)); ++ ++ for (var i = 0; i < this.children.length; ++i) ++ this.children[i].domEntry.style.display = "none"; ++ } ++ } ++ ++ this.toggle = function() ++ { ++ var img = this.hierarchyImgs[ this.hierarchyImgs.length - 1 ]; ++ if (img.pmState == pmMinus) ++ this.collapse(); ++ else ++ this.expand(); ++ } ++ ++ this.select = function() ++ { ++ if (this.owner.selection != this) ++ { ++ if (this.owner.selection) ++ this.owner.selection.setHighlight(hlNone); ++ ++ this.owner.selection = this; ++ this.setHighlight(hlSelected); ++ } ++ } ++ ++ this.setHighlight = function(mode) ++ { ++ if (mode == hlNone) ++ { ++ this.textSpan.style.backgroundColor = ""; ++ this.textSpan.style.color = ""; ++ this.textSpan.style.border = ""; ++ } ++ else if (mode == hlGrey) ++ { ++ this.textSpan.style.backgroundColor = "#aaaaaa"; ++ this.textSpan.style.color = ""; ++ this.textSpan.style.border = ""; ++ } ++ else if (mode == hlSelected) ++ { ++ this.textSpan.style.backgroundColor = "3399cc"; ++ this.textSpan.style.color = "white"; ++ this.textSpan.style.border = "dotted 1px red"; ++ } ++ } ++ ++ this.setOnclick = function(proc) ++ { ++ this.onclick = proc; ++ } ++ ++ this.setRef = function(url) ++ { ++ if (this.anchor) ++ this.anchor.href = url; ++ } ++ ++ this.processPMClick = function(e) ++ { ++ this.toggle(); ++ ++ // prevent this line selection, stop bubbling ++ if (e) ++ e.stopPropagation(); // Mozilla way ++ if (window.event) ++ window.event.cancelBubble = true; // IE way ++ } ++ ++ this.processOnclick = function() ++ { ++ this.select(); ++ if (this.onclick instanceof Function) ++ this.onclick(); ++ } ++ ++ /////////////////////////////////////////////////////////////////////////// ++ if (iconSrc) ++ this.icon.src = iconSrc; ++ else ++ { ++ this.icon.width = 0; ++ this.icon.height = 0; ++ } ++ ++ this.icon.style.verticalAlign = "middle"; ++ this.icon.style.position = "relative"; ++ this.icon.style.top = "-1px"; ++ this.icon.style.paddingRight = "2px"; ++ ++ if (!hrefMode) ++ { ++ this.textSpan.appendChild( this.textElement ); ++ } ++ else ++ { ++ this.anchor = document.createElement("a"); ++ this.anchor.appendChild( this.textElement ); ++ this.textSpan.appendChild( this.anchor ); ++ } ++ ++ this.lineDiv.appendChild( this.icon ); ++ this.lineDiv.appendChild( this.textSpan ); ++ this.domEntry.appendChild( this.lineDiv ); ++ ++ this.lineDiv.owner = this; ++ ++ if (!hrefMode) ++ this.lineDiv.onclick = new Function("this.owner.processOnclick();"); ++} +diff --git a/html/candydoc/util.js b/html/candydoc/util.js +index 5cff63e..edb7165 100644 +--- a/html/candydoc/util.js ++++ b/html/candydoc/util.js +@@ -5,37 +5,37 @@ + + function getLeft(elem) + { +- var ret = 0; +- while (elem.offsetParent) +- { +- ret += elem.offsetLeft; +- elem = elem.offsetParent; +- } ++ var ret = 0; ++ while (elem.offsetParent) ++ { ++ ret += elem.offsetLeft; ++ elem = elem.offsetParent; ++ } + + return ret; + } + + function getTop(elem) + { +- var ret = 0; +- while (elem.offsetParent) +- { +- ret += elem.offsetTop; +- elem = elem.offsetParent; +- } ++ var ret = 0; ++ while (elem.offsetParent) ++ { ++ ret += elem.offsetTop; ++ elem = elem.offsetParent; ++ } + + return ret; + } + +-function getWindowHeight() +-{ +- var ret = 0; +- if (typeof(window.innerHeight) == "number") +- ret = window.innerHeight; +- else if (document.documentElement && document.documentElement.clientHeight) +- ret = document.documentElement.clientHeight; +- else if (document.body && document.body.clientHeight) +- ret = document.body.clientHeight; +- +- return ret; ++function getWindowHeight() ++{ ++ var ret = 0; ++ if (typeof(window.innerHeight) == "number") ++ ret = window.innerHeight; ++ else if (document.documentElement && document.documentElement.clientHeight) ++ ret = document.documentElement.clientHeight; ++ else if (document.body && document.body.clientHeight) ++ ret = document.body.clientHeight; ++ ++ return ret; + } diff --git a/msgpack-d.spec b/msgpack-d.spec new file mode 100644 index 0000000..ccbe710 --- /dev/null +++ b/msgpack-d.spec @@ -0,0 +1,114 @@ +# debug info seem not works with D compiler +%global debug_package %{nil} + +%global major_version 1 +%global minor_version 0 +%global patch_version 0 +%global pre beta.7 + +Name: msgpack-d +Version: %{major_version}.%{minor_version}.%{patch_version} +Release: 0.1%{?pre:.%{pre}}%{?dist} +Summary: MessagePack for D is a pure D implementation of MessagePack +Summary(fr): MessagePack pour D est une implmentation en D de MessagePack + +License: Boost +URL: https://github.com/msgpack/msgpack-d + +Source0: %url/archive/v%{version}%{?pre:-%{pre}}/%{name}-%{version}%{?pre:-%{pre}}.tar.gz +# Pull request #107 accepted (https://github.com/msgpack/msgpack-d/pull/107) +Patch0: https://patch-diff.githubusercontent.com/raw/msgpack/msgpack-d/pull/107.patc... +Patch1: https://patch-diff.githubusercontent.com/raw/msgpack/msgpack-d/pull/106.patc... + +ExclusiveArch: %{ldc_arches} + +BuildRequires: ldc meson +Requires: ldc-phobos ldc-druntime + +%description +MessagePack is a binary-based JSON-like serialization library. + +%description -l fr +MessagePack est une bibliothque de srialisation ressemblant un format +JSON en binaire. + +%package devel +Summary: Development files for %{name} +Summary(fr): Fichiers de dveloppement pour %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +msgpack-d-devel package contains header files for developing D applications +that use msgpack-d. + +%description devel -l fr +Le paquet msgpack-d-devel contient les fichiers d'enttes pour dvelopper +des applications en D utilisant msgpack-d. + + +%package geany-tags +Summary: Support for enable autocompletion in geany +Summary(fr): Support pour activer l'auto-compltion dans geany +Requires: %{name} = %{version}-%{release} +BuildArch: noarch +BuildRequires: geany +Requires: geany + +%description geany-tags +Enable autocompletion for msgpack-d library in geany (IDE) + +%description -l fr geany-tags +Active l'autocompletion pour pour la bibliothque msgpack-d dans geany (IDE) + +%prep +%autosetup -p1 -n %{name}-%{version}%{?pre:-%{pre}} +# temp geany config directory for allow geany to generate tags +mkdir geany_config + +%build +LDFLAGS='-Wl,-z,relro -Wl,-z,now' %meson +%meson_build + +# generate doc +src_dir='src' +for f in ${sources[@]}; do + d_path=$(dirname ${f}); + d_file=$(basename ${f}); + doc_file=html/${d_path/${src_dir}}/${d_file/.d/.html}; + ldc2 -I "${src_dir}" -o- -c $f -Df $"{doc_file}" html/candydoc/candy.ddoc html/candydoc/modules.ddoc; +done + +# generate geany tags +sources=$(find "${src_dir}" -name '*.d') +geany -c geany_config -g %{name}.d.tags ${sources[@]} + +%install +%meson_install + +# geany tags +mkdir -p %{buildroot}%{_datadir}/geany/tags/ +install -pm0644 %{name}.d.tags %{buildroot}/%{_datadir}/geany/tags/ + +%check +%meson_test + +%ldconfig_scriptlets + +%files +%license LICENSE_1_0.txt +%doc README.markdown +%{_libdir}/lib%{name}.so.%{version} +%{_libdir}/lib%{name}.so.%{major_version} + +%files devel +%doc html example +%{_includedir}/d/msgpack +%{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/lib%{name}.so + +%files geany-tags +%{_datadir}/geany/tags/%{name}.d.tags + +%changelog +* Wed Aug 1 2018 MERCIER Jonathan <bioinfornatics at gmail.com> - 1.0.0-0.1.beta.7 +- Initial release diff --git a/sources b/sources new file mode 100644 index 0000000..0a52d98 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (msgpack-d-1.0.0-beta.7.tar.gz) = b5f13b73232b09f7155e57e8ab0c237aec4d58e35a30b1ebdb3d5139c630efc6515c93c4db3b729489c2bf61bcb152cfdcb58ad3e5dc5f7a2425fee61a93f66b
arch-excludes@lists.fedoraproject.org