Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flox #5883

Closed
wants to merge 9 commits into from
Closed
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
12 changes: 12 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "flox/flox",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/flox/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
Expand Down
125 changes: 125 additions & 0 deletions tools/flox/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#syntax=docker/dockerfile:1.8.1

FROM ghcr.io/uniget-org/tools/rust:latest AS rust

FROM ghcr.io/uniget-org/images/build-essential:24.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
COPY --link --from=rust / /usr/local/
RUN <<EOF
apt-get update
apt-get -y install --no-install-recommends \
libssl-dev
EOF
WORKDIR /tmp/github.com/flox/flox
ARG name
ARG version

###############################################################################
#
# Use distribution package from release
#
#RUN --mount=type=cache,target=/var/cache/uniget/download <<EOF
#url="https://downloads.flox.dev/by-env/stable/deb/flox-${version}.${arch}-linux.deb"
#filename="$( basename "${url}" )"
#
#check-download "${url}"
#curl --silent --show-error --location --fail --output "${uniget_cache_download}/${filename}" \
# "${url}"
#
#dpkg -c "${uniget_cache_download}/${filename}"
#dpkg -i "${uniget_cache_download}/${filename}"
#EOF

###############################################################################
#
# Clone for installation methods below
#
RUN <<EOF
git clone -q --config advice.detachedHead=false --depth 1 --branch "v${version}" https://github.com/flox/flox .
EOF
RUN <<EOF
version=2.25.2
arch=x86_64
curl -sSLf "https://releases.nixos.org/nix/nix-${version}/nix-${version}-${arch}-linux.tar.xz" \
| tar -xJC /tmp
"/tmp/nix-${version}-x86_64-linux/install-multi-user"
EOF

###############################################################################
# CONTRIBUTING.md:
# Use nix to call just to build flox
#
#RUN <<EOF
#apt-get -y install \
# sudo
#nix develop -L --no-update-lock-file \
# --extra-experimental-features nix-command \
# --extra-experimental-features flakes \
# --command \
# just \
# build-pkgdb \
# build-cli
#EOF

###############################################################################
#
# Use nix without repo
#
#RUN <<EOF
#nix profile install \
# --experimental-features "nix-command flakes" \
# --accept-flake-config \
# github:flox/flox/v${version}
#EOF

###############################################################################
#
# Build ourself
#
RUN --mount=type=cache,target=/var/cache/apt <<EOF
apt-get install -y \
nlohmann-json3-dev \
libargparse-dev \
libsqlite3-dev

EOF
WORKDIR /tmp/sqlite3pp
RUN <<EOF
git clone https://github.com/aakropotkin/sqlite3pp /tmp/sqlite3pp
cp -r /tmp/sqlite3pp/include/ /usr/
cp /tmp/sqlite3pp/lib/pkgconfig/sqlite3pp.pc.in /usr/share/pkgconfig/sqlite3pp.pc
sed -E 's|@PREFIX@|/usr|' /usr/share/pkgconfig/sqlite3pp.pc
EOF
WORKDIR /tmp/github.com/flox/flox
RUN <<EOF
cd pkgdb
export CXX=gcc
make
EOF
RUN <<EOF
cd cli
export CARGO_HOME=/usr/local/cargo
export RUSTUP_HOME=/usr/local/rustup
#export RUSTFLAGS='-C target-feature=+crt-static'

NIX_BIN="${nix}/bin/nix"
BUILDENV_NIX="${flox-buildenv}/lib/buildenv.nix"
PKGDB_BIN="${flox-pkgdb}/bin/pkgdb"
FLOX_BIN="${flox-cli}/bin/flox"
WATCHDOG_BIN="${flox-watchdog}/libexec/flox-watchdog"
PROCESS_COMPOSE_BIN="${process-compose}/bin/process-compose"
FLOX_VERSION="${version}"

cargo build --release --target "${arch}-unknown-linux-gnu"
cp "target/${arch}-unknown-linux-gnu/release/foo" "${prefix}/bin/"
EOF

# completion
#RUN <<EOF
#"${prefix}/bin/foo" completion bash >"${prefix}/share/bash-completion/completions/foo"
#"${prefix}/bin/foo" completion fish >"${prefix}/share/fish/vendor_completions.d/foo.fish"
#"${prefix}/bin/foo" completion zsh >"${prefix}/share/zsh/vendor-completions/_foo"
#EOF
20 changes: 20 additions & 0 deletions tools/flox/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# yaml-language-server: $schema=https://tools.uniget.dev/schema.yaml
$schema: https://tools.uniget.dev/schema.yaml
name: flox
version: "1.3.8"
check: ${binary} --version | cut -d- -f1
platforms:
- linux/amd64
#- linux/arm64
tags:
- category/development
- lang/rust
- type/cli
homepage: https://flox.dev/
repository: https://github.com/flox/flox
description: Developer environments you can take with you
renovate:
datasource: github-releases
package: flox/flox
extractVersion: ^v(?<version>.+)$
priority: low
Loading