%global debug_package %{nil} #%%global source_date_epoch_from_changelog 0 #%%global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$ #%%global crate gram %global app_id app.liten.Gram %global version 3.2.0 %global release 1 Name: gram Version: %{version} Release: %{release}%{?dist} Summary: The Gram Code Editor License: AGPL-3.0-or-later AND Apache-2.0 AND GPL-3.0-or-later URL: https://codeberg.org/GramEditor/gram Source0: https://codeberg.org/GramEditor/gram/archive/%{version}.tar.gz # https://codeberg.org/GramEditor/gram/src/branch/main/script/linux BuildRequires: cargo-rpm-macros BuildRequires: clang BuildRequires: cmake BuildRequires: make BuildRequires: git-core BuildRequires: jq BuildRequires: fontconfig-devel BuildRequires: libxcb-devel BuildRequires: libxkbcommon-x11-devel BuildRequires: libzstd-devel BuildRequires: openssl-devel BuildRequires: perl-FindBin BuildRequires: perl-IPC-Cmd BuildRequires: perl-File-Compare BuildRequires: perl-File-Copy BuildRequires: perl-Time-Piece BuildRequires: perl-lib BuildRequires: sqlite-devel BuildRequires: tar BuildRequires: vulkan-loader BuildRequires: wayland-devel BuildRequires: zlib-ng-compat-static # for the desktop file BuildRequires: desktop-file-utils %description Gram is a powerful and modern code editor. It features solid performance and is highly configurable, yet comes with batteries included out of the box. Gram supports many popular programming languages and file formats, and can use gram extensions to support additional languages. Other features include built-in documentation, debugger support via the DAP protocol, source control using git and more. Gram started as a fork of the gram Editor. %prep %autosetup -p1 -n %{name} export DO_STARTUP_NOTIFY="true" export APP_ID="%app_id" export APP_ICON="%app_id" export APP_NAME="Gram Editor" export APP_CLI="gram" export APP_ARGS="%U" envsubst < "crates/gram/resources/gram.desktop.in" > $APP_ID.desktop envsubst < "crates/gram/resources/flatpak/gram.metainfo.xml.in" > $APP_ID.metainfo.xml %build export CC=$(which clang) export CARGO_HOME=/builddir/.cargo mkdir -p ${CARGO_HOME}/bin export PATH=$PATH:/builddir/.cargo/bin export GRAM_RELEASE_CHANNEL=stable export GRAM_UPDATE_EXPLANATION="Please use the package manager to update Gram." # this installs dependency cargo-about script/generate-licenses ARCH="$(uname -m)" WILD_VERSION=0.10.0 WILD_REPO="https://github.com/wild-linker/wild" WILD_PACKAGE="wild-linker-${WILD_VERSION}-${ARCH}-unknown-linux-gnu" WILD_URL="${WILD_REPO}/releases/download/${WILD_VERSION}/${WILD_PACKAGE}.tar.gz" DEST_DIR=/builddir/.cargo/bin echo "Downloading from ${WILD_URL}" curl -fsSL --output - "${WILD_URL}" | tar -C ${DEST_DIR} --strip-components=1 --no-overwrite-dir -xvzf - "${WILD_PACKAGE}/wild" cat >> /builddir/.cargo/config.toml < - initial release