mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 15:10:54 +00:00
Compare commits
8 Commits
35f9b6be94
...
v0.7.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef9ca57295 | ||
|
|
8e1fb60692 | ||
|
|
d6ddb5da3d | ||
|
|
d26e93dd47 | ||
| 97d2970727 | |||
| 6885a82be7 | |||
| 5d587db227 | |||
| 424f4f6929 |
335
.github/workflows/release.yml
vendored
335
.github/workflows/release.yml
vendored
@@ -21,6 +21,10 @@ on:
|
||||
description: "Update AUR packages (dcr & dcr-bin)"
|
||||
type: boolean
|
||||
default: false
|
||||
run_aur_dev:
|
||||
description: "Update Dev AUR packages (dcr-dev, dcr-dev-bin)"
|
||||
type: boolean
|
||||
default: false
|
||||
run_bsd:
|
||||
description: "Build BSD"
|
||||
type: boolean
|
||||
@@ -56,6 +60,7 @@ jobs:
|
||||
outputs:
|
||||
tag: ${{ steps.tag.outputs.value }}
|
||||
version: ${{ steps.tag.outputs.version }}
|
||||
clean_version: ${{ steps.tag.outputs.clean_version }}
|
||||
prerelease: ${{ steps.tag.outputs.prerelease }}
|
||||
steps:
|
||||
- name: Resolve tag
|
||||
@@ -67,9 +72,11 @@ jobs:
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
fi
|
||||
VERSION="${TAG#v}"
|
||||
CLEAN_VERSION="${VERSION%-dev}"
|
||||
[[ "$TAG" == *"-"* ]] && PRERELEASE="true" || PRERELEASE="false"
|
||||
echo "value=${TAG}" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "clean_version=${CLEAN_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "prerelease=${PRERELEASE}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# ── Release Notes ──────────────────────────────────────────────────────────
|
||||
@@ -135,6 +142,12 @@ jobs:
|
||||
- target: aarch64-unknown-linux-gnu
|
||||
- target: x86_64-unknown-linux-musl
|
||||
- target: aarch64-unknown-linux-musl
|
||||
- target: i686-unknown-linux-gnu
|
||||
- target: i686-unknown-linux-musl
|
||||
- target: armv7-unknown-linux-gnueabihf
|
||||
- target: armv7-unknown-linux-musleabihf
|
||||
- target: riscv64gc-unknown-linux-gnu
|
||||
- target: riscv64gc-unknown-linux-musl
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -452,8 +465,6 @@ jobs:
|
||||
cp target/release/dcr "$ASSET"
|
||||
echo "BSD_ASSET=${ASSET}" >> "$GITHUB_ENV"
|
||||
|
||||
|
||||
|
||||
# --- UPLOAD TARGET ---
|
||||
- name: Upload BSD Asset to Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
@@ -474,7 +485,9 @@ jobs:
|
||||
include:
|
||||
- target: x86_64-pc-windows-msvc
|
||||
- target: aarch64-pc-windows-msvc
|
||||
- target: i686-pc-windows-msvc
|
||||
- target: x86_64-pc-windows-gnu
|
||||
- target: i686-pc-windows-gnu
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -645,10 +658,22 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
BIN_URL="https://github.com/dexoron/dcr/releases/download/${{ needs.setup.outputs.tag }}/dcr-x86_64-unknown-linux-musl-${{ needs.setup.outputs.version }}"
|
||||
SHA256="$(curl -fsSL "$BIN_URL" | sha256sum | awk '{print $1}')"
|
||||
echo "bin_url=$BIN_URL" >> "$GITHUB_OUTPUT"
|
||||
echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
|
||||
TAG="${{ needs.setup.outputs.tag }}"
|
||||
VER="${{ needs.setup.outputs.version }}"
|
||||
BASE_URL="https://github.com/dexoron/dcr/releases/download/${TAG}"
|
||||
for arch in x86_64 aarch64 i686 armv7h riscv64; do
|
||||
case "$arch" in
|
||||
x86_64) triple="x86_64-unknown-linux-musl" ;;
|
||||
aarch64) triple="aarch64-unknown-linux-musl" ;;
|
||||
i686) triple="i686-unknown-linux-musl" ;;
|
||||
armv7h) triple="armv7-unknown-linux-musleabihf" ;;
|
||||
riscv64) triple="riscv64gc-unknown-linux-musl" ;;
|
||||
esac
|
||||
url="${BASE_URL}/dcr-${triple}-${VER}"
|
||||
sha256="$(curl -fsSL "$url" | sha256sum | awk '{print $1}')"
|
||||
echo "${arch}_url=${url}" >> "$GITHUB_OUTPUT"
|
||||
echo "${arch}_sha256=${sha256}" >> "$GITHUB_OUTPUT"
|
||||
done
|
||||
|
||||
- name: Render AUR Metadata
|
||||
shell: bash
|
||||
@@ -656,16 +681,13 @@ jobs:
|
||||
set -euo pipefail
|
||||
PKGVER_ORIG='${{ needs.setup.outputs.version }}'
|
||||
PKGVER_CLEAN="${PKGVER_ORIG//-/.}"
|
||||
BIN_URL='${{ steps.meta.outputs.bin_url }}'
|
||||
SHA256='${{ steps.meta.outputs.sha256 }}'
|
||||
|
||||
mkdir -p packages/aur/dcr-bin
|
||||
cat > packages/aur/dcr-bin/PKGBUILD <<PKG
|
||||
pkgname=dcr-bin
|
||||
pkgver=${PKGVER_CLEAN}
|
||||
pkgrel=1
|
||||
pkgdesc="Cargo-like utility to manage C/C++ projects (pre-compiled musl binary)"
|
||||
arch=('x86_64')
|
||||
arch=('x86_64' 'aarch64' 'i686' 'armv7h' 'riscv64')
|
||||
url="https://github.com/dexoron/dcr"
|
||||
license=('GPL-3.0-or-later')
|
||||
provides=('dcr')
|
||||
@@ -674,8 +696,16 @@ jobs:
|
||||
'gcc: build C/C++ projects with GCC'
|
||||
'clang: build C/C++ projects with Clang'
|
||||
)
|
||||
source_x86_64=("dcr-\$pkgver::${BIN_URL}")
|
||||
sha256sums_x86_64=('${SHA256}')
|
||||
source_x86_64=("dcr-\$pkgver::${{ steps.meta.outputs.x86_64_url }}")
|
||||
sha256sums_x86_64=('${{ steps.meta.outputs.x86_64_sha256 }}')
|
||||
source_aarch64=("dcr-\$pkgver::${{ steps.meta.outputs.aarch64_url }}")
|
||||
sha256sums_aarch64=('${{ steps.meta.outputs.aarch64_sha256 }}')
|
||||
source_i686=("dcr-\$pkgver::${{ steps.meta.outputs.i686_url }}")
|
||||
sha256sums_i686=('${{ steps.meta.outputs.i686_sha256 }}')
|
||||
source_armv7h=("dcr-\$pkgver::${{ steps.meta.outputs.armv7h_url }}")
|
||||
sha256sums_armv7h=('${{ steps.meta.outputs.armv7h_sha256 }}')
|
||||
source_riscv64=("dcr-\$pkgver::${{ steps.meta.outputs.riscv64_url }}")
|
||||
sha256sums_riscv64=('${{ steps.meta.outputs.riscv64_sha256 }}')
|
||||
|
||||
package() {
|
||||
install -Dm755 "\$srcdir/dcr-\$pkgver" "\$pkgdir/usr/bin/dcr"
|
||||
@@ -689,13 +719,25 @@ jobs:
|
||||
pkgrel = 1
|
||||
url = https://github.com/dexoron/dcr
|
||||
arch = x86_64
|
||||
arch = aarch64
|
||||
arch = i686
|
||||
arch = armv7h
|
||||
arch = riscv64
|
||||
license = GPL-3.0-or-later
|
||||
provides = dcr
|
||||
conflicts = dcr
|
||||
optdepends = gcc: build C/C++ projects with GCC
|
||||
optdepends = clang: build C/C++ projects with Clang
|
||||
source_x86_64 = dcr-${PKGVER_CLEAN}::${BIN_URL}
|
||||
sha256sums_x86_64 = ${SHA256}
|
||||
source_x86_64 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.x86_64_url }}
|
||||
sha256sums_x86_64 = ${{ steps.meta.outputs.x86_64_sha256 }}
|
||||
source_aarch64 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.aarch64_url }}
|
||||
sha256sums_aarch64 = ${{ steps.meta.outputs.aarch64_sha256 }}
|
||||
source_i686 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.i686_url }}
|
||||
sha256sums_i686 = ${{ steps.meta.outputs.i686_sha256 }}
|
||||
source_armv7h = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.armv7h_url }}
|
||||
sha256sums_armv7h = ${{ steps.meta.outputs.armv7h_sha256 }}
|
||||
source_riscv64 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.riscv64_url }}
|
||||
sha256sums_riscv64 = ${{ steps.meta.outputs.riscv64_sha256 }}
|
||||
|
||||
pkgname = dcr-bin
|
||||
SRC
|
||||
@@ -739,6 +781,271 @@ jobs:
|
||||
git commit -m "dcr-bin ${{ needs.setup.outputs.version }}"
|
||||
git push -u origin master
|
||||
|
||||
|
||||
# ── Arch User Repository (dcr-dev) ────────────────────────────────
|
||||
publish-aur-dev:
|
||||
if: ${{ (github.event_name == 'push' && needs.setup.outputs.prerelease == 'true') || github.event.inputs.run_aur_dev == 'true' }}
|
||||
needs: [setup]
|
||||
runs-on: ubuntu-latest
|
||||
environment: aur
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Derive checksum
|
||||
id: meta
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
SRC_URL="https://github.com/dexoron/dcr/archive/refs/tags/${{ needs.setup.outputs.tag }}.tar.gz"
|
||||
SHA256="$(curl -fsSL "$SRC_URL" | sha256sum | awk '{print $1}')"
|
||||
echo "source_url=$SRC_URL" >> "$GITHUB_OUTPUT"
|
||||
echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Render AUR metadata
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
PKGVER_ORIG='${{ needs.setup.outputs.version }}'
|
||||
PKGVER_CLEAN='${{ needs.setup.outputs.clean_version }}'
|
||||
SRC_URL='${{ steps.meta.outputs.source_url }}'
|
||||
SHA256='${{ steps.meta.outputs.sha256 }}'
|
||||
|
||||
mkdir -p packages/aur/dcr-dev
|
||||
cat > packages/aur/dcr-dev/PKGBUILD <<PKG
|
||||
pkgname=dcr-dev
|
||||
pkgver=${PKGVER_CLEAN}
|
||||
pkgrel=1
|
||||
pkgdesc="Cargo-like utility to manage C/C++ projects (development release)"
|
||||
arch=('x86_64' 'aarch64')
|
||||
url="https://github.com/dexoron/dcr"
|
||||
license=('GPL-3.0-or-later')
|
||||
depends=('gcc-libs')
|
||||
makedepends=('cargo')
|
||||
options=('!lto')
|
||||
provides=('dcr')
|
||||
conflicts=('dcr')
|
||||
optdepends=(
|
||||
'gcc: build C/C++ projects with GCC'
|
||||
'clang: build C/C++ projects with Clang'
|
||||
)
|
||||
source=("\$pkgname-\$pkgver.tar.gz::${SRC_URL}")
|
||||
sha256sums=('${SHA256}')
|
||||
|
||||
build() {
|
||||
cd "\$srcdir/dcr-${PKGVER_ORIG}"
|
||||
unset CFLAGS CXXFLAGS LDFLAGS
|
||||
export RUSTFLAGS="-C linker=cc"
|
||||
cargo build --release --locked
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "\$srcdir/dcr-${PKGVER_ORIG}"
|
||||
install -Dm755 "target/release/dcr" "\$pkgdir/usr/bin/dcr"
|
||||
install -Dm644 LICENSE "\$pkgdir/usr/share/licenses/\$pkgname/LICENSE"
|
||||
}
|
||||
PKG
|
||||
|
||||
cat > packages/aur/dcr-dev/.SRCINFO <<SRC
|
||||
pkgbase = dcr-dev
|
||||
pkgdesc = Cargo-like utility to manage C/C++ projects (development release)
|
||||
pkgver = ${PKGVER_CLEAN}
|
||||
pkgrel = 1
|
||||
url = https://github.com/dexoron/dcr
|
||||
arch = x86_64
|
||||
arch = aarch64
|
||||
license = GPL-3.0-or-later
|
||||
makedepends = cargo
|
||||
depends = gcc-libs
|
||||
provides = dcr
|
||||
conflicts = dcr
|
||||
optdepends = gcc: build C/C++ projects with GCC
|
||||
optdepends = clang: build C/C++ projects with Clang
|
||||
options = !lto
|
||||
source = dcr-${PKGVER_CLEAN}.tar.gz::${SRC_URL}
|
||||
sha256sums = ${SHA256}
|
||||
|
||||
pkgname = dcr-dev
|
||||
SRC
|
||||
|
||||
- name: Push to AUR
|
||||
env:
|
||||
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
AUR_PACKAGE: dcr-dev
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
install -d -m 700 ~/.ssh
|
||||
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur
|
||||
chmod 600 ~/.ssh/aur
|
||||
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
||||
|
||||
export GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes'
|
||||
|
||||
mkdir -p aur-repo
|
||||
cd aur-repo
|
||||
git init
|
||||
git remote add origin "ssh://aur@aur.archlinux.org/${AUR_PACKAGE}.git"
|
||||
|
||||
git fetch origin master || true
|
||||
git checkout master || git checkout -b master
|
||||
|
||||
cp ../packages/aur/dcr-dev/PKGBUILD .
|
||||
cp ../packages/aur/dcr-dev/.SRCINFO .
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
if git rev-parse --verify HEAD >/dev/null 2>&1; then
|
||||
if git diff --quiet; then
|
||||
echo "No AUR changes"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m "dcr-dev ${{ needs.setup.outputs.version }}"
|
||||
git push -u origin master
|
||||
|
||||
# ── Arch User Repository (dcr-dev-bin) ────────────────────────────
|
||||
publish-aur-dev-bin:
|
||||
if: ${{ (github.event_name == 'push' && needs.setup.outputs.prerelease == 'true') || github.event.inputs.run_aur_dev == 'true' }}
|
||||
needs: [setup, build-linux]
|
||||
runs-on: ubuntu-latest
|
||||
environment: aur
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Derive checksum
|
||||
id: meta
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG="${{ needs.setup.outputs.tag }}"
|
||||
VER="${{ needs.setup.outputs.version }}"
|
||||
BASE_URL="https://github.com/dexoron/dcr/releases/download/${TAG}"
|
||||
for arch in x86_64 aarch64 i686 armv7h riscv64; do
|
||||
case "$arch" in
|
||||
x86_64) triple="x86_64-unknown-linux-musl" ;;
|
||||
aarch64) triple="aarch64-unknown-linux-musl" ;;
|
||||
i686) triple="i686-unknown-linux-musl" ;;
|
||||
armv7h) triple="armv7-unknown-linux-musleabihf" ;;
|
||||
riscv64) triple="riscv64gc-unknown-linux-musl" ;;
|
||||
esac
|
||||
url="${BASE_URL}/dcr-${triple}-${VER}"
|
||||
sha256="$(curl -fsSL "$url" | sha256sum | awk '{print $1}')"
|
||||
echo "${arch}_url=${url}" >> "$GITHUB_OUTPUT"
|
||||
echo "${arch}_sha256=${sha256}" >> "$GITHUB_OUTPUT"
|
||||
done
|
||||
|
||||
- name: Render AUR Metadata
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
PKGVER_ORIG='${{ needs.setup.outputs.version }}'
|
||||
PKGVER_CLEAN='${{ needs.setup.outputs.clean_version }}'
|
||||
mkdir -p packages/aur/dcr-dev-bin
|
||||
cat > packages/aur/dcr-dev-bin/PKGBUILD <<PKG
|
||||
pkgname=dcr-dev-bin
|
||||
pkgver=${PKGVER_CLEAN}
|
||||
pkgrel=1
|
||||
pkgdesc="Cargo-like utility to manage C/C++ projects (pre-compiled musl binary dev release)"
|
||||
arch=('x86_64' 'aarch64' 'i686' 'armv7h' 'riscv64')
|
||||
url="https://github.com/dexoron/dcr"
|
||||
license=('GPL-3.0-or-later')
|
||||
provides=('dcr')
|
||||
conflicts=('dcr')
|
||||
optdepends=(
|
||||
'gcc: build C/C++ projects with GCC'
|
||||
'clang: build C/C++ projects with Clang'
|
||||
)
|
||||
source_x86_64=("dcr-\$pkgver::${{ steps.meta.outputs.x86_64_url }}")
|
||||
sha256sums_x86_64=('${{ steps.meta.outputs.x86_64_sha256 }}')
|
||||
source_aarch64=("dcr-\$pkgver::${{ steps.meta.outputs.aarch64_url }}")
|
||||
sha256sums_aarch64=('${{ steps.meta.outputs.aarch64_sha256 }}')
|
||||
source_i686=("dcr-\$pkgver::${{ steps.meta.outputs.i686_url }}")
|
||||
sha256sums_i686=('${{ steps.meta.outputs.i686_sha256 }}')
|
||||
source_armv7h=("dcr-\$pkgver::${{ steps.meta.outputs.armv7h_url }}")
|
||||
sha256sums_armv7h=('${{ steps.meta.outputs.armv7h_sha256 }}')
|
||||
source_riscv64=("dcr-\$pkgver::${{ steps.meta.outputs.riscv64_url }}")
|
||||
sha256sums_riscv64=('${{ steps.meta.outputs.riscv64_sha256 }}')
|
||||
|
||||
package() {
|
||||
install -Dm755 "\$srcdir/dcr-\$pkgver" "\$pkgdir/usr/bin/dcr"
|
||||
}
|
||||
PKG
|
||||
|
||||
cat > packages/aur/dcr-dev-bin/.SRCINFO <<SRC
|
||||
pkgbase = dcr-dev-bin
|
||||
pkgdesc = Cargo-like utility to manage C/C++ projects (pre-compiled musl binary dev release)
|
||||
pkgver = ${PKGVER_CLEAN}
|
||||
pkgrel = 1
|
||||
url = https://github.com/dexoron/dcr
|
||||
arch = x86_64
|
||||
arch = aarch64
|
||||
arch = i686
|
||||
arch = armv7h
|
||||
arch = riscv64
|
||||
license = GPL-3.0-or-later
|
||||
provides = dcr
|
||||
conflicts = dcr
|
||||
optdepends = gcc: build C/C++ projects with GCC
|
||||
optdepends = clang: build C/C++ projects with Clang
|
||||
source_x86_64 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.x86_64_url }}
|
||||
sha256sums_x86_64 = ${{ steps.meta.outputs.x86_64_sha256 }}
|
||||
source_aarch64 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.aarch64_url }}
|
||||
sha256sums_aarch64 = ${{ steps.meta.outputs.aarch64_sha256 }}
|
||||
source_i686 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.i686_url }}
|
||||
sha256sums_i686 = ${{ steps.meta.outputs.i686_sha256 }}
|
||||
source_armv7h = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.armv7h_url }}
|
||||
sha256sums_armv7h = ${{ steps.meta.outputs.armv7h_sha256 }}
|
||||
source_riscv64 = dcr-${PKGVER_CLEAN}::${{ steps.meta.outputs.riscv64_url }}
|
||||
sha256sums_riscv64 = ${{ steps.meta.outputs.riscv64_sha256 }}
|
||||
|
||||
pkgname = dcr-dev-bin
|
||||
SRC
|
||||
|
||||
- name: Push to AUR
|
||||
env:
|
||||
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
AUR_PACKAGE: dcr-dev-bin
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
install -d -m 700 ~/.ssh
|
||||
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur
|
||||
chmod 600 ~/.ssh/aur
|
||||
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
||||
|
||||
export GIT_SSH_COMMAND='ssh -i ~/.ssh/aur -o IdentitiesOnly=yes'
|
||||
|
||||
mkdir -p aur-repo
|
||||
cd aur-repo
|
||||
git init
|
||||
git remote add origin "ssh://aur@aur.archlinux.org/${AUR_PACKAGE}.git"
|
||||
|
||||
git fetch origin master || true
|
||||
git checkout master || git checkout -b master
|
||||
|
||||
cp ../packages/aur/dcr-dev-bin/PKGBUILD .
|
||||
cp ../packages/aur/dcr-dev-bin/.SRCINFO .
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
if git rev-parse --verify HEAD >/dev/null 2>&1; then
|
||||
if git diff --quiet; then
|
||||
echo "No AUR changes"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m "dcr-dev-bin ${{ needs.setup.outputs.version }}"
|
||||
git push -u origin master
|
||||
|
||||
|
||||
# ── crates.io ──────────────────────────────────────────────────────────────
|
||||
publish-crates:
|
||||
if: |
|
||||
|
||||
@@ -48,4 +48,11 @@ git2 = { version = "0.20.4", features = ["vendored-libgit2", "vendored-openssl"]
|
||||
openssl = { version = "0.10", features = ["vendored"] }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
git2 = { version = "0.20.4", features = ["vendored-libgit2"] }
|
||||
git2 = { version = "0.20.4", features = ["vendored-libgit2"] }
|
||||
|
||||
[profile.release]
|
||||
opt-level = "z"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
strip = true
|
||||
12
install.ps1
12
install.ps1
@@ -47,10 +47,16 @@ function Select-Mode {
|
||||
}
|
||||
|
||||
function Get-Target {
|
||||
if ($env:PROCESSOR_ARCHITECTURE -ne 'AMD64') {
|
||||
Fail "Only x86_64 Windows is supported, current architecture: $env:PROCESSOR_ARCHITECTURE"
|
||||
$arch = $env:PROCESSOR_ARCHITECTURE
|
||||
if ($env:PROCESSOR_ARCHITEW6432) {
|
||||
$arch = $env:PROCESSOR_ARCHITEW6432
|
||||
}
|
||||
switch ($arch) {
|
||||
'AMD64' { return 'x86_64-pc-windows-msvc' }
|
||||
'ARM64' { return 'aarch64-pc-windows-msvc' }
|
||||
'x86' { return 'i686-pc-windows-msvc' }
|
||||
default { Fail "Unsupported Windows architecture: $arch" }
|
||||
}
|
||||
return 'x86_64-pc-windows-msvc'
|
||||
}
|
||||
|
||||
function Fetch-ReleaseJson($channel) {
|
||||
|
||||
@@ -43,11 +43,20 @@ detect_target() {
|
||||
case "$os:$arch" in
|
||||
Linux:x86_64) TARGET_TRIPLE="x86_64-unknown-linux-gnu" ;;
|
||||
Linux:aarch64|Linux:arm64) TARGET_TRIPLE="aarch64-unknown-linux-gnu" ;;
|
||||
Linux:i686|Linux:i386) TARGET_TRIPLE="i686-unknown-linux-gnu" ;;
|
||||
Linux:armv7l|Linux:armv7) TARGET_TRIPLE="armv7-unknown-linux-gnueabihf" ;;
|
||||
Linux:riscv64) TARGET_TRIPLE="riscv64gc-unknown-linux-gnu" ;;
|
||||
Darwin:x86_64) TARGET_TRIPLE="x86_64-apple-darwin" ;;
|
||||
Darwin:arm64|Darwin:aarch64) TARGET_TRIPLE="aarch64-apple-darwin" ;;
|
||||
FreeBSD:x86_64|FreeBSD:amd64) TARGET_TRIPLE="x86_64-unknown-freebsd" ;;
|
||||
FreeBSD:aarch64|FreeBSD:arm64) TARGET_TRIPLE="aarch64-unknown-freebsd" ;;
|
||||
FreeBSD:i686|FreeBSD:i386) TARGET_TRIPLE="i686-unknown-freebsd" ;;
|
||||
OpenBSD:x86_64|OpenBSD:amd64) TARGET_TRIPLE="x86_64-unknown-openbsd" ;;
|
||||
OpenBSD:aarch64|OpenBSD:arm64) TARGET_TRIPLE="aarch64-unknown-openbsd" ;;
|
||||
OpenBSD:i686|OpenBSD:i386) TARGET_TRIPLE="i686-unknown-openbsd" ;;
|
||||
NetBSD:x86_64|NetBSD:amd64) TARGET_TRIPLE="x86_64-unknown-netbsd" ;;
|
||||
NetBSD:aarch64|NetBSD:arm64) TARGET_TRIPLE="aarch64-unknown-netbsd" ;;
|
||||
NetBSD:i686|NetBSD:i386) TARGET_TRIPLE="i686-unknown-netbsd" ;;
|
||||
|
||||
*) error "Unsupported platform: $os/$arch"; exit 1 ;;
|
||||
esac
|
||||
|
||||
@@ -39,8 +39,14 @@ detect_target() {
|
||||
|
||||
case "$os:$arch" in
|
||||
FreeBSD:x86_64|FreeBSD:amd64) TARGET_TRIPLE="x86_64-unknown-freebsd" ;;
|
||||
FreeBSD:aarch64|FreeBSD:arm64) TARGET_TRIPLE="aarch64-unknown-freebsd" ;;
|
||||
FreeBSD:i686|FreeBSD:i386) TARGET_TRIPLE="i686-unknown-freebsd" ;;
|
||||
OpenBSD:x86_64|OpenBSD:amd64) TARGET_TRIPLE="x86_64-unknown-openbsd" ;;
|
||||
OpenBSD:aarch64|OpenBSD:arm64) TARGET_TRIPLE="aarch64-unknown-openbsd" ;;
|
||||
OpenBSD:i686|OpenBSD:i386) TARGET_TRIPLE="i686-unknown-openbsd" ;;
|
||||
NetBSD:x86_64|NetBSD:amd64) TARGET_TRIPLE="x86_64-unknown-netbsd" ;;
|
||||
NetBSD:aarch64|NetBSD:arm64) TARGET_TRIPLE="aarch64-unknown-netbsd" ;;
|
||||
NetBSD:i686|NetBSD:i386) TARGET_TRIPLE="i686-unknown-netbsd" ;;
|
||||
DragonFly:x86_64|DragonFly:amd64) TARGET_TRIPLE="x86_64-unknown-dragonfly" ;;
|
||||
*) error "Unsupported BSD platform: $os/$arch"; exit 1 ;;
|
||||
esac
|
||||
|
||||
1
packaging/aur/dcr-dev-git
Submodule
1
packaging/aur/dcr-dev-git
Submodule
Submodule packaging/aur/dcr-dev-git added at 93bdce858b
Submodule packaging/aur/dcr-git updated: 12038a613e...2c5743a456
@@ -16,7 +16,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::config::FILE_MAIN_C;
|
||||
use crate::core::config::Config;
|
||||
use crate::core::config::{validate_package_name, Config};
|
||||
use crate::utils::fs::check_dir;
|
||||
use crate::utils::log::{error, warn};
|
||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||
@@ -41,6 +41,15 @@ pub fn init(args: &[String]) -> i32 {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if let Err(e) = validate_package_name(&project_name) {
|
||||
error(&format!(
|
||||
"Invalid project name `{}`: {}",
|
||||
colored(&project_name, BOLD_CYAN),
|
||||
e
|
||||
));
|
||||
return 1;
|
||||
}
|
||||
|
||||
let cwd = std::env::current_dir()
|
||||
.map(|v| v.to_string_lossy().to_string())
|
||||
.unwrap_or_else(|_| ".".to_string());
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::config::FILE_MAIN_C;
|
||||
use crate::core::config::Config;
|
||||
use crate::core::config::{validate_package_name, Config};
|
||||
use crate::utils::fs::check_dir;
|
||||
use crate::utils::log::{error, warn};
|
||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||
@@ -42,6 +42,15 @@ pub fn new(args: &[String]) -> i32 {
|
||||
colored(project_name, BOLD_CYAN)
|
||||
);
|
||||
|
||||
if let Err(e) = validate_package_name(project_name) {
|
||||
error(&format!(
|
||||
"Invalid project name `{}`: {}",
|
||||
colored(project_name, BOLD_CYAN),
|
||||
e
|
||||
));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if items.contains(project_name) {
|
||||
error(&format!(
|
||||
"Directory `{}` already exists\n",
|
||||
|
||||
@@ -329,17 +329,16 @@ pub fn needs_link(objects: &[String], output_path: &str) -> bool {
|
||||
|
||||
fn parse_d_file(content: &str) -> Vec<String> {
|
||||
let mut deps = Vec::new();
|
||||
let text = content.replace("\\\n", " ").replace("\\\r\n", " ");
|
||||
let mut target_end = 0;
|
||||
let chars: Vec<char> = text.chars().collect();
|
||||
for i in 0..chars.len() {
|
||||
if chars[i] == ':' {
|
||||
let bytes = content.as_bytes();
|
||||
for (i, &b) in bytes.iter().enumerate() {
|
||||
if b == b':' {
|
||||
if i == 1
|
||||
&& chars[0].is_ascii_alphabetic()
|
||||
&& i + 1 < chars.len()
|
||||
&& (chars[i + 1] == '\\' || chars[i + 1] == '/')
|
||||
&& bytes[0].is_ascii_alphabetic()
|
||||
&& i + 1 < bytes.len()
|
||||
&& (bytes[i + 1] == b'\\' || bytes[i + 1] == b'/')
|
||||
{
|
||||
continue; // Windows drive letter
|
||||
continue;
|
||||
}
|
||||
target_end = i + 1;
|
||||
break;
|
||||
@@ -347,17 +346,23 @@ fn parse_d_file(content: &str) -> Vec<String> {
|
||||
}
|
||||
|
||||
let deps_str = if target_end > 0 {
|
||||
&text[target_end..]
|
||||
&content[target_end..]
|
||||
} else {
|
||||
&text
|
||||
content
|
||||
};
|
||||
|
||||
let mut current_path = String::new();
|
||||
let mut in_escape = false;
|
||||
let mut chars = deps_str.chars().peekable();
|
||||
|
||||
for c in deps_str.chars() {
|
||||
while let Some(c) = chars.next() {
|
||||
if in_escape {
|
||||
if c != '\n' && c != '\r' {
|
||||
if c == '\n' {
|
||||
} else if c == '\r' {
|
||||
if chars.peek() == Some(&'\n') {
|
||||
chars.next();
|
||||
}
|
||||
} else {
|
||||
current_path.push(c);
|
||||
}
|
||||
in_escape = false;
|
||||
|
||||
@@ -447,7 +447,7 @@ fn parse_typed_config(value: &Value) -> Result<DcrConfig, ConfigError> {
|
||||
value.clone().try_into().map_err(ConfigError::TomlDe)
|
||||
}
|
||||
|
||||
fn validate_package_name(name: &str) -> Result<(), ConfigError> {
|
||||
pub fn validate_package_name(name: &str) -> Result<(), ConfigError> {
|
||||
let trimmed = name.trim();
|
||||
if trimmed != name {
|
||||
return Err(ConfigError::Invalid(
|
||||
|
||||
Reference in New Issue
Block a user