mirror of
https://abf.rosa.ru/djam/vscodium.git
synced 2025-02-23 14:22:52 +00:00
125 lines
3.1 KiB
RPMSpec
125 lines
3.1 KiB
RPMSpec
%define _optdir /opt
|
|
%define debug %nil
|
|
%define debug_package %nil
|
|
%define msver 1.75.1
|
|
%define subrel 23040
|
|
|
|
Name: vscodium
|
|
Version: %{msver}.%{subrel}
|
|
Release: 1
|
|
Summary: VS Code without MS branding/telemetry/licensing
|
|
Group: Development/Tools
|
|
License: MIT
|
|
URL: https://vscodium.com
|
|
Source0: https://github.com/VSCodium/vscodium/archive/%{version}/%{name}-%{version}.tar.gz
|
|
Source1: https://github.com/microsoft/vscode/archive/%{msver}/vscode-%{msver}.tar.gz
|
|
Source1000: %{name}.rpmlintrc
|
|
ExclusiveArch: x86_64
|
|
BuildRequires: nodejs-bootstrap-bin >= 16
|
|
BuildRequires: yarn
|
|
BuildRequires: jq
|
|
BuildRequires: pkgconfig(x11)
|
|
BuildRequires: pkgconfig(libsecret-1)
|
|
BuildRequires: pkgconfig(xkbfile)
|
|
BuildRequires: imagemagick
|
|
BuildRequires: git-core
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: sqlite-tools
|
|
BuildRequires: python38-devel
|
|
|
|
%description
|
|
Visual Studio Code is a new choice of tool that
|
|
combines the simplicity of a code editor with
|
|
what developers need for the core edit-build-debug cycle.
|
|
|
|
%prep
|
|
%setup -q
|
|
tar -xf %{SOURCE1}
|
|
mv vscode-%{msver} vscode
|
|
|
|
%build
|
|
export PATH=$PATH:/opt/nodejs/16.*/bin
|
|
export PYTHONPATH=%{python38_sitelib}
|
|
export PYTHON3=/usr/libexec/python3.8
|
|
export PYTHON=/usr/libexec/python3.8
|
|
|
|
yarn config set --home enableTelemetry 0
|
|
|
|
sed -i -e '/get_repo.sh/d' -e '/vscode\*/d' build/build.sh
|
|
|
|
git init
|
|
|
|
pushd vscode
|
|
git init
|
|
popd
|
|
|
|
export MS_TAG=%{msver} MS_COMMIT="" RELEASE_VERSION=%{version} BUILD_SOURCEVERSION=""
|
|
|
|
./build/build.sh
|
|
|
|
%install
|
|
install -d %{buildroot}%{_bindir} \
|
|
%{buildroot}%{_optdir}/%{name} \
|
|
%{buildroot}%{_datadir}/applications \
|
|
%{buildroot}%{_datadir}/pixmaps \
|
|
%{buildroot}%{_datadir}/bash-completion/completions \
|
|
%{buildroot}%{_iconsdir}
|
|
|
|
cp -a VSCode-linux-*/* %{buildroot}%{_optdir}/%{name}
|
|
|
|
# start script
|
|
cat > %{buildroot}%{_bindir}/%{name} << EOF
|
|
#!/bin/bash
|
|
cd /opt/%{name}/bin
|
|
./codium
|
|
EOF
|
|
|
|
chmod +x %{buildroot}%{_bindir}/%{name}
|
|
|
|
# menu-entry
|
|
cat >> %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
|
|
[Desktop Entry]
|
|
Name=%{name}
|
|
Comment=Code Editing. Redefined.
|
|
GenericName=%{name}
|
|
Exec=%{name} --no-sandbox \% F
|
|
Icon=%{name}
|
|
Type=Application
|
|
StartupNotify=false
|
|
StartupWMClass=%{name}
|
|
Categories=Utility;TextEditor;Development;IDE;
|
|
MimeType=text/plain;inode/directory;
|
|
Actions=new-empty-window;
|
|
Keywords=vscode;
|
|
|
|
[Desktop Action new-empty-window]
|
|
Name=New Empty Window
|
|
Exec=%{name} --no-sandbox --new-window \% F
|
|
Icon=%{name}
|
|
EOF
|
|
|
|
# icons
|
|
pushd icons/stable
|
|
for x in 16 24 32 48 64 96 128 256 512; do
|
|
install -d %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/
|
|
convert -resize ${x}x${x} codium_only.svg %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/%{name}.png
|
|
done
|
|
popd
|
|
|
|
# remove suid
|
|
chmod -s %{buildroot}/%{_optdir}/%{name}/chrome-sandbox
|
|
|
|
# fix permissions
|
|
find %{buildroot}%{_optdir} -perm 0666 -type f -exec chmod 0644 {} \;
|
|
|
|
# add completion
|
|
install -Dm0644 ./VSCode-linux-*/resources/completions/bash/codium %{buildroot}%{_datadir}/bash-completion/completions/codium
|
|
|
|
%files
|
|
%doc README.md LICENSE DOCS.md docs
|
|
%{_bindir}/%{name}
|
|
%{_optdir}/%{name}
|
|
%{_datadir}/applications/%{name}.desktop
|
|
%{_iconsdir}/hicolor/*/apps/%{name}.png
|
|
%{_datadir}/bash-completion/completions/codium
|
|
|