File windsurf.spec of Package windsurf

#
# spec file for package windsurf
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%global _buildshell /bin/bash

Name:           windsurf
Release:        1
Summary:        Windsurf Editor
License:        SUSE-NonFree
URL:            https://windsurf.com/editor
# ----
Version:        1.10.4
%define hash    eea5d835019c6f5415c7a7f14edfabff648b0012
Source0:        https://windsurf-stable.codeiumdata.com/linux-x64/stable/%{hash}/Windsurf-linux-x64-%{version}.tar.gz
Source1:        windsurf
Source2:        windsurf.desktop
# ----
BuildRequires:  desktop-file-utils
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
# ----
Requires:       libatomic1

%description
Windsurf is an AI-integrated development environment designed
as a collaborative platform for developers and AI systems.

%prep
%setup -q -n Windsurf

%build
:

%install
cd %{_builddir}/Windsurf
install -Dm644 resources/app/resources/linux/code.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/%{name}.png

desktop-file-install \
  --dir=%{buildroot}%{_datadir}/applications \
  --set-key=Exec \
  --set-value=%{_bindir}/%{name} \
  --set-icon %{_datadir}/icons/hicolor/1024x1024/apps/%{name}.png \
  %{SOURCE2}

install -Dm755 chrome-sandbox %{buildroot}%{_libdir}/%{name}/chrome-sandbox
install -Dm755 libffmpeg.so %{buildroot}%{_libdir}/%{name}/libffmpeg.so
install -Dm755 libEGL.so %{buildroot}%{_libdir}/%{name}/libEGL.so
install -Dm755 libGLESv2.so %{buildroot}%{_libdir}/%{name}/libGLESv2.so
install -Dm755 libvk_swiftshader.so %{buildroot}%{_libdir}/%{name}/libvk_swiftshader.so
install -Dm755 libvulkan.so.1 %{buildroot}%{_libdir}/%{name}/libvulkan.so.1

mkdir -p %{buildroot}%{_libdir}/%{name}
shopt -s extglob
cp -r !(*.so*) %{buildroot}%{_libdir}/%{name}
shopt -u extglob

mkdir -p %{buildroot}%{_bindir}
install -v -m 755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}

%post
%if 0%{?suse_version} < 1500
%desktop_database_post
%endif
chmod 0755 %{_libdir}/%{name}/windsurf

%if 0%{?suse_version} < 1500
%postun
%desktop_database_postun
%endif

%files
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/1024x1024/apps/%{name}.png
%{_libdir}/%{name}

%changelog
openSUSE Build Service is sponsored by