Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions snapcraft/couchdb-nouveau/snap/hooks/install
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ mkdir -p ${SNAP_INSTANCE_COMMON}/data/nouveau

## If nouveau yaml file is there, copy to cfg directory (without overwriting)
NOUVEAU_CFG=${SNAP_INSTANCE_DATA}/etc/nouveau.yaml
if [ -s ${SNAP}/etc/nouveau.yaml ] && [ ! -s ${NOUVEAU_CFG} ]; then
cat ${SNAP}/etc/nouveau.yaml > ${NOUVEAU_CFG}
if [ -s ${SNAP}/nouveau/etc/nouveau.yaml ] && [ ! -s ${NOUVEAU_CFG} ]; then
cat ${SNAP}/nouveau/etc/nouveau.yaml > ${NOUVEAU_CFG}
index_line=$(echo "${SNAP_INSTANCE_COMMON}/data/nouveau" | sed 's/\//\\\//g')
sed --in-place "s/{{nouveau_index_dir}}/${index_line}/" ${NOUVEAU_CFG}
sed --in-place "s/{{nouveau_port}}/${COUCHDB_NOUVEAU_PORT}/" ${NOUVEAU_CFG}
Expand Down
11 changes: 11 additions & 0 deletions snapcraft/couchdb-nouveau/snap/local/bin/nouveau.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
if [ -z ${SNAP_INSTANCE_KEY} ]
then
SNAP_INSTANCE_DATA=${SNAP_DATA}
else
SNAP_INSTANCE_DATA=$(echo ${SNAP_DATA} | sed -e s/${SNAP_NAME}/${SNAP_INSTANCE_NAME}/)
fi

export JAVA_PATH="${SNAP}/usr/lib/jvm/java-1.21.0-openjdk-${SNAP_ARCH}/bin/java"
export JAVA_OPTS="-server -Djava.awt.headless=true -Xmx2g"

COUCHDB_NOUVEAU_JAR=${SNAP}/nouveau/lib/nouveau-1.0-SNAPSHOT.jar
COUCHDB_NOUVEAU_CFG=${SNAP_INSTANCE_DATA}/etc/nouveau.yaml

echo "Starting nouveau (java)"
echo "java path : ${JAVA_PATH}"
echo "java opts : ${JAVA_OPTS}"
Expand Down
73 changes: 6 additions & 67 deletions snapcraft/couchdb-nouveau/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,6 @@ architectures:
#- build-on: [ppc64el]

parts:
# 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
# build-packages:
# - libncurses-dev
# - unzip
# - curl
# override-build: |
# source "./asdf.sh"
#
# # Install Erlang
# asdf plugin add erlang
# asdf install erlang "$ASDF_ERLANG_VERSION"
# asdf global erlang "$ASDF_ERLANG_VERSION"
#
# # Install Erlang
# asdf plugin add elixir
# asdf install elixir "$ASDF_ELIXIR_VERSION"
# asdf global elixir "$ASDF_ELIXIR_VERSION"

nouveau:
#after: [erlang-elixir-gradle]
plugin: make
Expand All @@ -77,32 +51,19 @@ parts:

# set-up gradle to use launchpad proxy settings (for snapcraft remote-build)
source "$(pwd)/../../nouveau-launcher/src/setup_gradle_launchpad.sh"

# Configure, build and release CouchDB binaries
# ./configure --with-nouveau --spidermonkey-version "$SPIDERMONKEY_VERSION" && make nouveau
make -f "$(pwd)/../../nouveau-launcher/src/Makefile" release && cp -r rel/couchdb/* $SNAPCRAFT_PART_INSTALL

build-packages:
#- gcc
#- g++
#- libc6-dev
#- libicu-dev
#- 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
stage:
- -usr/share/doc
- -usr/share/man
- -var
nouveau-launcher:
source: snap/local
source-type: local
Expand All @@ -112,33 +73,11 @@ parts:
- -Makefile

environment:
#COUCHDB_ARGS_FILE: ${SNAP_DATA}/etc/vm.args
#COUCHDB_FAUXTON_DOCROOT: ${SNAP}/share/www
#COUCHDB_QUERY_SERVER_JAVASCRIPT: ${SNAP}/bin/couchjs ${COUCHJS_ARGS} ${SNAP}/share/server/main.js
#COUCHDB_QUERY_SERVER_COFFEESCRIPT: ${SNAP}/bin/couchjs ${COUCHJS_ARGS} ${SNAP}/share/server/main-coffee.js
#COUCHDB_INI_FILES: ${SNAP}/etc/default.ini ${SNAP}/etc/default.d ${SNAP_DATA}/etc/local.ini ${SNAP_DATA}/etc/local.d
COUCHDB_NOUVEAU_JAR: ${SNAP}/nouveau/lib/nouveau-1.0-SNAPSHOT.jar
COUCHDB_NOUVEAU_CFG: ${SNAP_DATA}/etc/nouveau.yaml
COUCHDB_NOUVEAU_PORT: 5987
COUCHDB_NOUVEAU_ADMIN_PORT: 5988

apps:
#couchdb:
# command: bin/couchdb
# plugs: [network, network-bind, mount-observe]
#server:
# 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
daemon: simple
command: bin/nouveau.sh
plugs: [network, network-bind, mount-observe]
#remsh:
# command: bin/remsh
# plugs: [network, network-bind]
#couchjs:
# command: bin/couchjs
# plugs: [network, network-bind]