You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2024/10/28 19:09:31 UTC

(couchdb-pkg) branch feat/snapcraft/couchdb_and_couchdb-nouveau updated (9b5f373 -> 785eae0)

This is an automated email from the ASF dual-hosted git repository.

ronny pushed a change to branch feat/snapcraft/couchdb_and_couchdb-nouveau
in repository https://gitbox.apache.org/repos/asf/couchdb-pkg.git


 discard 9b5f373  Reorganize Snapcraft
     new 785eae0  Reorganize Snapcraft

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (9b5f373)
            \
             N -- N -- N   refs/heads/feat/snapcraft/couchdb_and_couchdb-nouveau (785eae0)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 snapcraft/couchdb-nouveau/snap/hooks/install        | 2 +-
 snapcraft/couchdb-nouveau/snap/local/bin/nouveau.sh | 4 +++-
 snapcraft/couchdb-nouveau/snap/snapcraft.yaml       | 1 -
 3 files changed, 4 insertions(+), 3 deletions(-)


(couchdb-pkg) 01/01: Reorganize Snapcraft

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch feat/snapcraft/couchdb_and_couchdb-nouveau
in repository https://gitbox.apache.org/repos/asf/couchdb-pkg.git

commit 785eae0aca74768192f57c057e3433ab6f8c7479
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Mon Oct 28 20:04:14 2024 +0100

    Reorganize Snapcraft
    
    - "vanilla" CouchDB snap in snapcraft/couchdb
    - CouchDB with Nouveau snap in snapcraft/couchdb-nouveau
---
 .../couchdb-nouveau/snap}/hooks/configure          |  2 +-
 .../couchdb-nouveau/snap}/hooks/install            |  7 +++--
 .../couchdb-nouveau/snap}/hooks/post-refresh       |  4 +++
 .../couchdb-nouveau/snap/local/bin/nouveau.sh      | 23 ++++++++++++++
 .../couchdb-nouveau/snap}/snapcraft.yaml           | 35 ++++++++++++++++++----
 {snap => snapcraft/couchdb/snap}/hooks/configure   |  2 +-
 {snap => snapcraft/couchdb/snap}/hooks/install     |  0
 .../couchdb/snap}/hooks/post-refresh               |  0
 {snap => snapcraft/couchdb/snap}/snapcraft.yaml    |  0
 9 files changed, 62 insertions(+), 11 deletions(-)

diff --git a/snap/hooks/configure b/snapcraft/couchdb-nouveau/snap/hooks/configure
similarity index 98%
copy from snap/hooks/configure
copy to snapcraft/couchdb-nouveau/snap/hooks/configure
index a63d4cf..deb0847 100755
--- a/snap/hooks/configure
+++ b/snapcraft/couchdb-nouveau/snap/hooks/configure
@@ -44,7 +44,7 @@ _modify_ini_args() {
 }
 
 # The vm_args file can only be changed from the filesystem
-# configutaion vm.args file
+# configuration vm.args file
 
 VM_ARGS_OPTIONS="name setcookie"
 for key in $VM_ARGS_OPTIONS
diff --git a/snap/hooks/install b/snapcraft/couchdb-nouveau/snap/hooks/install
similarity index 89%
copy from snap/hooks/install
copy to snapcraft/couchdb-nouveau/snap/hooks/install
index 1ba782c..0d53916 100755
--- a/snap/hooks/install
+++ b/snapcraft/couchdb-nouveau/snap/hooks/install
@@ -51,6 +51,7 @@ if ! $(grep -q "^database_dir" ${LOCAL_INI}); then
     sed --in-place "/^\[couchdb\].*$/a ${database_line}" ${LOCAL_INI} 
 fi
 
-
-#snap set ${SNAP_INSTANCE_NAME} setcookie=`echo $RANDOM | md5sum | head -c 20; echo;`
-
+# If nouveau yaml file is there, copy to cfg directory (without overwriting)
+if [ -s ${SNAP}/etc/nouveau.yaml ] && [ ! -s ${COUCHDB_NOUVEAU_CFG} ]; then
+   cat ${SNAP}/etc/nouveau.yaml > ${COUCHDB_NOUVEAU_CFG}
+fi
diff --git a/snap/hooks/post-refresh b/snapcraft/couchdb-nouveau/snap/hooks/post-refresh
similarity index 89%
copy from snap/hooks/post-refresh
copy to snapcraft/couchdb-nouveau/snap/hooks/post-refresh
index ee1b707..0d53916 100755
--- a/snap/hooks/post-refresh
+++ b/snapcraft/couchdb-nouveau/snap/hooks/post-refresh
@@ -51,3 +51,7 @@ if ! $(grep -q "^database_dir" ${LOCAL_INI}); then
     sed --in-place "/^\[couchdb\].*$/a ${database_line}" ${LOCAL_INI} 
 fi
 
+# If nouveau yaml file is there, copy to cfg directory (without overwriting)
+if [ -s ${SNAP}/etc/nouveau.yaml ] && [ ! -s ${COUCHDB_NOUVEAU_CFG} ]; then
+   cat ${SNAP}/etc/nouveau.yaml > ${COUCHDB_NOUVEAU_CFG}
+fi
diff --git a/snapcraft/couchdb-nouveau/snap/local/bin/nouveau.sh b/snapcraft/couchdb-nouveau/snap/local/bin/nouveau.sh
new file mode 100755
index 0000000..fb1cd6c
--- /dev/null
+++ b/snapcraft/couchdb-nouveau/snap/local/bin/nouveau.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+echo "Starting nouveau (java)"
+echo "java path : ${JAVA_PATH}"
+echo "java opts : ${_JAVA_OPTS}"
+echo "jar       : ${COUCHDB_NOUVEAU_JAR}"
+echo "cfg       : ${COUCHDB_NOUVEAU_CFG}"
+
+export JAVA_OPTS=-server -Djava.awt.headless=true -Xmx2g
+
+exec ${JAVA_PATH} ${JAVA_OPTS} -jar ${COUCHDB_NOUVEAU_JAR} server ${COUCHDB_NOUVEAU_CFG}
diff --git a/snap/snapcraft.yaml b/snapcraft/couchdb-nouveau/snap/snapcraft.yaml
similarity index 75%
copy from snap/snapcraft.yaml
copy to snapcraft/couchdb-nouveau/snap/snapcraft.yaml
index 60f52f4..a78d079 100755
--- a/snap/snapcraft.yaml
+++ b/snapcraft/couchdb-nouveau/snap/snapcraft.yaml
@@ -15,7 +15,7 @@
 #   specific language governing permissions and limitations
 #   under the License.
 ---
-name: couchdb
+name: couchdb-nouveau
 version: 3.4.2
 type: app
 base: core22
@@ -38,11 +38,12 @@ architectures:
   - build-on: [ppc64el]
 
 parts:
-  erl-iex:
+  erlang-elixir-gradle:
     plugin: dump
     build-environment:
       - ASDF_ERLANG_VERSION: "25.3.2.15"
       - ASDF_ELIXIR_VERSION: "1.15.8-otp-25"
+      - ASDF_GRADLE_VERSION: "8.10"
     source: https://github.com/asdf-vm/asdf.git
     source-branch: v0.14.1
     source-type: git
@@ -62,19 +63,24 @@ parts:
       asdf plugin add elixir
       asdf install elixir "$ASDF_ELIXIR_VERSION"
       asdf global elixir "$ASDF_ELIXIR_VERSION"
+
+      # Install Gradle
+      asdf plugin-add gradle https://github.com/rfrancis/asdf-gradle.git
+      asdf install gradle "$ASDF_GRADLE_VERSION"
+      asdf global gradle "$ASDF_GRADLE_VERSION"
   couchdb:
-    after: [erl-iex]
+    after: [erlang-elixir-gradle]
     plugin: make
     build-environment:
       - SPIDERMONKEY_VERSION: "91"
     source: https://dlcdn.apache.org/couchdb/source/3.4.2/apache-couchdb-3.4.2.tar.gz
     source-type: tar
     override-build: |
-      # Use the version of erlang/elixir we configured before
-      source "$(pwd)/../../erl-iex/build/asdf.sh"
+      # Use the version of erlang/elixir/gradle we configured before
+      source "$(pwd)/../../erlang-elixir-gradle/build/asdf.sh"
       
       # Configure, build and release CouchDB binaries
-      ./configure --spidermonkey-version "$SPIDERMONKEY_VERSION" && make release && cp -r rel/couchdb/* $SNAPCRAFT_PART_INSTALL
+      ./configure --with-nouveau --spidermonkey-version "$SPIDERMONKEY_VERSION" && GRADLE=$(which gradle) make release && cp -r rel/couchdb/* $SNAPCRAFT_PART_INSTALL
       
       # Verifying that all is working
       #make check
@@ -86,14 +92,23 @@ parts:
       - libssl-dev
       # Mozilla JS engine
       - libmozjs-91-dev
+      - openjdk-21-jdk-headless
     stage-packages:
       - libicu70
       - libssl3
       - libmozjs-91-0
+      - libgraphite2-3
+      - libharfbuzz0b
+      - libasound2
+      - openjdk-21-jre-headless
     stage:
       - -usr/share/doc
       - -usr/share/man
       - -var
+  nouveau-launcher:
+    source: snap/local
+    source-type: local
+    plugin: dump
 
 environment:
   COUCHDB_ARGS_FILE: ${SNAP_DATA}/etc/vm.args
@@ -110,6 +125,14 @@ apps:
     daemon: simple
     command: bin/couchdb
     plugs: [network, network-bind, mount-observe]
+  nouveau:
+    environment:
+      JAVA_PATH: ${SNAP}/usr/lib/jvm/java-1.21.0-openjdk-${SNAP_ARCH}/bin/java
+      COUCHDB_NOUVEAU_JAR: ${SNAP}/nouveau/lib/nouveau-1.0-SNAPSHOT.jar
+      COUCHDB_NOUVEAU_CFG: ${SNAP_DATA}/etc/nouveau.yaml
+    daemon: simple
+    command: bin/nouveau.sh
+    plugs: [network, network-bind, mount-observe]
   remsh:
     command: bin/remsh
     plugs: [network, network-bind]
diff --git a/snap/hooks/configure b/snapcraft/couchdb/snap/hooks/configure
similarity index 98%
rename from snap/hooks/configure
rename to snapcraft/couchdb/snap/hooks/configure
index a63d4cf..deb0847 100755
--- a/snap/hooks/configure
+++ b/snapcraft/couchdb/snap/hooks/configure
@@ -44,7 +44,7 @@ _modify_ini_args() {
 }
 
 # The vm_args file can only be changed from the filesystem
-# configutaion vm.args file
+# configuration vm.args file
 
 VM_ARGS_OPTIONS="name setcookie"
 for key in $VM_ARGS_OPTIONS
diff --git a/snap/hooks/install b/snapcraft/couchdb/snap/hooks/install
similarity index 100%
rename from snap/hooks/install
rename to snapcraft/couchdb/snap/hooks/install
diff --git a/snap/hooks/post-refresh b/snapcraft/couchdb/snap/hooks/post-refresh
similarity index 100%
rename from snap/hooks/post-refresh
rename to snapcraft/couchdb/snap/hooks/post-refresh
diff --git a/snap/snapcraft.yaml b/snapcraft/couchdb/snap/snapcraft.yaml
similarity index 100%
rename from snap/snapcraft.yaml
rename to snapcraft/couchdb/snap/snapcraft.yaml