[new package] edit 1.0.0 (#24309)

that terminal editor from MS. probably package should has a better name
This commit is contained in:
Maksim Bondarenkov
2025-05-24 14:55:39 +03:00
committed by GitHub
parent 5f23f587cb
commit fbc4d54a3e
2 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
From d74c330f2b74134a7fd5f97f78933472049129d3 Mon Sep 17 00:00:00 2001
From: Maksim Bondarenkov <119937608+ognevny@users.noreply.github.com>
Date: Tue, 20 May 2025 18:47:24 +0300
Subject: [PATCH] Don't apply MSVC compile flags for non-MSVC toolchains (#98)
MinGW toolchains just don't support these flags
---
.cargo/release.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.cargo/release.toml b/.cargo/release.toml
index 790fde9..5d665c6 100644
--- a/.cargo/release.toml
+++ b/.cargo/release.toml
@@ -7,7 +7,7 @@
# Avoid linking with vcruntime140.dll by statically linking everything,
# and then explicitly linking with ucrtbase.dll dynamically.
# We do this, because vcruntime140.dll is an optional Windows component.
-[target.'cfg(target_os = "windows")']
+[target.'cfg(all(target_os = "windows", target_env = "msvc"))']
rustflags = [
"-Ctarget-feature=+crt-static",
"-Clink-args=/DEFAULTLIB:ucrt.lib",

55
mingw-w64-edit/PKGBUILD Normal file
View File

@@ -0,0 +1,55 @@
# Maintainer: Maksim Bondarenkov <maksapple2306@gmail.com>
_realname=edit
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.0.0
pkgrel=1
pkgdesc="Terminal text editor from Microsoft (mingw-w64)"
arch=('any')
mingw_arch=('ucrt64' 'clang64' 'clangarm64')
url='https://github.com/microsoft/edit'
license=('spdx:MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-rust"
"${MINGW_PACKAGE_PREFIX}-rust-src")
source=("${url}/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz"
"001-dont-apply-msvc-flags.patch")
sha256sums=('6718d9a96aa9dd2117d9d4afa83b0278ef007bcd42bdb1e8c4e2ad34144246c0'
'1a70087f6a978c53a5e57e72347b524a7813ed6a48abd852a1c77ac8621c876f')
prepare() {
cd "${_realname}-${pkgver}"
# don't apply msvc specific cflags so .cargo/release.toml can be used
patch -Np1 -i ../001-dont-apply-msvc-flags.patch
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "${_realname}-${pkgver}"
# FIXME: split debuginfo is not supported for mingw host anyway
# https://github.com/rust-lang/rust/blob/60dabef95a3de3ec974dcb50926e4bfe743f078f/compiler/rustc_target/src/spec/base/windows_gnu.rs#L111
export CARGO_PROFILE_RELEASE_DEBUG=0
RUSTC_BOOTSTRAP=1 \
cargo build \
--config .cargo/release.toml \
--release \
--locked
}
package() {
cd "${_realname}-${pkgver}"
RUSTC_BOOTSTRAP=1 \
cargo install \
--config .cargo/release.toml \
--offline \
--no-track \
--frozen \
--path . \
--root "${pkgdir}${MINGW_PREFIX}"
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}