[arch-commits] Commit in crystal/repos/community-x86_64 (3 files)

Evangelos Foutras foutrelis at archlinux.org
Mon Aug 12 15:39:16 UTC 2019


    Date: Monday, August 12, 2019 @ 15:39:16
  Author: foutrelis
Revision: 499026

archrelease: copy trunk to community-x86_64

Added:
  crystal/repos/community-x86_64/PKGBUILD
    (from rev 499025, crystal/trunk/PKGBUILD)
  crystal/repos/community-x86_64/libevent-2.1.11.patch
    (from rev 499025, crystal/trunk/libevent-2.1.11.patch)
Deleted:
  crystal/repos/community-x86_64/PKGBUILD

-----------------------+
 PKGBUILD              |  147 ++++++++++++++++++++++++------------------------
 libevent-2.1.11.patch |   61 +++++++++++++++++++
 2 files changed, 137 insertions(+), 71 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2019-08-12 15:39:11 UTC (rev 499025)
+++ PKGBUILD	2019-08-12 15:39:16 UTC (rev 499026)
@@ -1,71 +0,0 @@
-# Maintainer: Anatol Pomozov <anatol.pomozov at gmail.com>
-# Contributor: Jonne Haß <me at jhass.eu>
-
-pkgname=crystal
-pkgver=0.30.0
-pkgrel=3
-pkgdesc='The Crystal Programming Language'
-arch=(x86_64)
-url='https://crystal-lang.org'
-license=(Apache)
-depends=(gc libatomic_ops pcre libevent llvm-libs)
-makedepends=(libxml2 llvm crystal) # to compile version N we need crystal compiler of N-1 version
-checkdepends=(libyaml libxml2 gmp inetutils git)
-optdepends=('shards: crystal language package manager'
-            'libyaml: For YAML support'
-            'gmp: For BigInt support'
-            'libxml2: For XML support')
-source=(crystal-$pkgver.tar.gz::https://github.com/crystal-lang/crystal/archive/$pkgver.tar.gz)
-sha256sums=('fc884970089e382344540676a9c5aa4f369c9a0f45d1858e079b4ce26878164a')
-
-prepare() {
-  cd $pkgname-$pkgver
-  sed -i 's|Please install shards: https://github.com/ysbaddaden/shards|Please install shards: pacman -S shards|' src/compiler/crystal/command.cr
-}
-
-build() {
-  cd $pkgname-$pkgver
-
-  make release=1 \
-       FLAGS="--release --no-debug" \
-       CRYSTAL_PATH="$srcdir/$pkgname-$pkgver/src" \
-       CRYSTAL_CONFIG_VERSION="$pkgver" \
-       CRYSTAL_CONFIG_PATH="lib:/usr/lib/crystal" \
-       CRYSTAL_CACHE_DIR="/tmp/crystal"
-  make docs CRYSTAL_CACHE_DIR="/tmp/crystal"
-}
-
-check() {
-  cd $pkgname-$pkgver
-  return # tests require too much RAM, disable it temporary
-
-  make spec CRYSTAL_PATH="$srcdir/$pkgname-$pkgver/src" \
-            CRYSTAL_CONFIG_VERSION="$pkgver" \
-            CRYSTAL_CACHE_DIR="/tmp/crystal" \
-            PATH=".build:$PATH"
-}
-
-package() {
-  cd $pkgname-$pkgver
-
-  # /usr/bin/crystal                compiled executable
-  # /usr/lib/crystal/               compiler src & core libs
-  # /usr/share/doc/crystal/api      api docs
-  # /usr/share/doc/crystal/samples/ samples
-
-  install -Dm755 ".build/crystal" "$pkgdir/usr/bin/crystal"
-
-  install -dm755 "$pkgdir/usr/lib" "$pkgdir/usr/share/man/man1"
-  cp -r src "$pkgdir/usr/lib/crystal"
-
-  install -dm755 "$pkgdir/usr/share/doc/crystal"
-  cp -r docs "$pkgdir/usr/share/doc/crystal/api"
-  cp -r samples "$pkgdir/usr/share/doc/crystal/"
-
-  install -Dm644 man/crystal.1 "$pkgdir/usr/share/man/man1/"
-
-  install -Dm644 etc/completion.bash "$pkgdir/usr/share/bash-completion/completions/crystal"
-  install -Dm644 etc/completion.zsh "$pkgdir/usr/share/zsh/site-functions/_crystal"
-
-  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}

Copied: crystal/repos/community-x86_64/PKGBUILD (from rev 499025, crystal/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2019-08-12 15:39:16 UTC (rev 499026)
@@ -0,0 +1,76 @@
+# Maintainer: Anatol Pomozov <anatol.pomozov at gmail.com>
+# Contributor: Jonne Haß <me at jhass.eu>
+
+pkgname=crystal
+pkgver=0.30.0
+pkgrel=4
+pkgdesc='The Crystal Programming Language'
+arch=(x86_64)
+url='https://crystal-lang.org'
+license=(Apache)
+depends=(gc libatomic_ops pcre libevent llvm-libs)
+makedepends=(libxml2 llvm crystal) # to compile version N we need crystal compiler of N-1 version
+checkdepends=(libyaml libxml2 gmp inetutils git)
+optdepends=('shards: crystal language package manager'
+            'libyaml: For YAML support'
+            'gmp: For BigInt support'
+            'libxml2: For XML support')
+source=(crystal-$pkgver.tar.gz::https://github.com/crystal-lang/crystal/archive/$pkgver.tar.gz
+        libevent-2.1.11.patch)
+sha256sums=('fc884970089e382344540676a9c5aa4f369c9a0f45d1858e079b4ce26878164a'
+            '3917a15399078079b6b8d78f418f4dbc8dcfd94b8a39f7b083d6075b441a5adc')
+
+prepare() {
+  cd $pkgname-$pkgver
+  sed -i 's|Please install shards: https://github.com/ysbaddaden/shards|Please install shards: pacman -S shards|' src/compiler/crystal/command.cr
+
+  # https://github.com/crystal-lang/crystal/issues/8044
+  patch -Np1 -i ../libevent-2.1.11.patch
+}
+
+build() {
+  cd $pkgname-$pkgver
+
+  make release=1 \
+       FLAGS="--release --no-debug" \
+       CRYSTAL_PATH="$srcdir/$pkgname-$pkgver/src" \
+       CRYSTAL_CONFIG_VERSION="$pkgver" \
+       CRYSTAL_CONFIG_PATH="lib:/usr/lib/crystal" \
+       CRYSTAL_CACHE_DIR="/tmp/crystal"
+  make docs CRYSTAL_CACHE_DIR="/tmp/crystal"
+}
+
+check() {
+  cd $pkgname-$pkgver
+  return # tests require too much RAM, disable it temporary
+
+  make spec CRYSTAL_PATH="$srcdir/$pkgname-$pkgver/src" \
+            CRYSTAL_CONFIG_VERSION="$pkgver" \
+            CRYSTAL_CACHE_DIR="/tmp/crystal" \
+            PATH=".build:$PATH"
+}
+
+package() {
+  cd $pkgname-$pkgver
+
+  # /usr/bin/crystal                compiled executable
+  # /usr/lib/crystal/               compiler src & core libs
+  # /usr/share/doc/crystal/api      api docs
+  # /usr/share/doc/crystal/samples/ samples
+
+  install -Dm755 ".build/crystal" "$pkgdir/usr/bin/crystal"
+
+  install -dm755 "$pkgdir/usr/lib" "$pkgdir/usr/share/man/man1"
+  cp -r src "$pkgdir/usr/lib/crystal"
+
+  install -dm755 "$pkgdir/usr/share/doc/crystal"
+  cp -r docs "$pkgdir/usr/share/doc/crystal/api"
+  cp -r samples "$pkgdir/usr/share/doc/crystal/"
+
+  install -Dm644 man/crystal.1 "$pkgdir/usr/share/man/man1/"
+
+  install -Dm644 etc/completion.bash "$pkgdir/usr/share/bash-completion/completions/crystal"
+  install -Dm644 etc/completion.zsh "$pkgdir/usr/share/zsh/site-functions/_crystal"
+
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}

Copied: crystal/repos/community-x86_64/libevent-2.1.11.patch (from rev 499025, crystal/trunk/libevent-2.1.11.patch)
===================================================================
--- libevent-2.1.11.patch	                        (rev 0)
+++ libevent-2.1.11.patch	2019-08-12 15:39:16 UTC (rev 499026)
@@ -0,0 +1,61 @@
+From 284fb1e35abce2ecbebe41b3d6a78bf757145b9b Mon Sep 17 00:00:00 2001
+From: Juan Wajnerman <jwajnerman at manas.com.ar>
+Date: Thu, 8 Aug 2019 08:23:26 -0300
+Subject: [PATCH] Don't resume fibers directly from event loop callbacks (fixes
+ #8044). (#8058)
+
+This is required to enable compatibility with libevent 2.1.11, because
+a warning is now raised if a `fork` is executed from within the event loop (https://github.com/libevent/libevent/commit/497ef904d544ac51de43934549dbeccce8e6e8f8).
+Since most Crystal code actually runs from within the event loop (from libevent point of view)
+the solution is enqueue the fibers and resume them outside the call to `event_base_loop`.
+---
+ src/crystal/event_loop.cr | 9 +++++++--
+ src/io/evented.cr         | 4 ++--
+ 2 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/src/crystal/event_loop.cr b/src/crystal/event_loop.cr
+index 9d8cc2812a..a4726b16d4 100644
+--- a/src/crystal/event_loop.cr
++++ b/src/crystal/event_loop.cr
+@@ -13,12 +13,17 @@ module Crystal::EventLoop
+   end
+ 
+   private def self.loop_fiber
+-    @@loop_fiber ||= Fiber.new { @@eb.run_loop }
++    @@loop_fiber ||= Fiber.new do
++      loop do
++        @@eb.run_once
++        Crystal::Scheduler.reschedule
++      end
++    end
+   end
+ 
+   def self.create_resume_event(fiber)
+     @@eb.new_event(-1, LibEvent2::EventFlags::None, fiber) do |s, flags, data|
+-      data.as(Fiber).resume
++      Crystal::Scheduler.enqueue data.as(Fiber)
+     end
+   end
+ 
+diff --git a/src/io/evented.cr b/src/io/evented.cr
+index ae2895c571..deca61cd87 100644
+--- a/src/io/evented.cr
++++ b/src/io/evented.cr
+@@ -99,7 +99,7 @@ module IO::Evented
+     @read_timed_out = timed_out
+ 
+     if reader = @readers.try &.shift?
+-      reader.resume
++      Crystal::Scheduler.enqueue reader
+     end
+   end
+ 
+@@ -108,7 +108,7 @@ module IO::Evented
+     @write_timed_out = timed_out
+ 
+     if writer = @writers.try &.shift?
+-      writer.resume
++      Crystal::Scheduler.enqueue writer
+     end
+   end
+ 


More information about the arch-commits mailing list