Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,21 @@ jobs:
dist/*.zip

build_linux:
name: Build for Linux
runs-on: ubuntu-22.04
name: Build for Linux (${{ matrix.variant }})
runs-on: ${{ matrix.runs_on }}
strategy:
matrix:
include:
- variant: webkit40
runs_on: ubuntu-22.04
build_target: build
output_suffix: linux-amd64
webkit_package: libwebkit2gtk-4.0-dev
- variant: webkit41
runs_on: ubuntu-24.04
build_target: build_webkit41
output_suffix: linux-amd64-webkit41
webkit_package: libwebkit2gtk-4.1-dev

steps:
- name: Checkout
Expand Down Expand Up @@ -215,7 +228,7 @@ jobs:

# Install Linux Wails deps
- name: Install Linux Wails deps
run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev gcc-aarch64-linux-gnu
run: sudo apt-get update && sudo apt-get install libgtk-3-0 ${{ matrix.webkit_package }} gcc-aarch64-linux-gnu
shell: bash

# Build
Expand All @@ -226,25 +239,25 @@ jobs:

- name: Build App
run: |
make cp_assets
wails build -ldflags "-X github.com/scanoss/scanoss.cc/backend/entities.AppVersion=${{ env.APP_VERSION }}" --platform linux/amd64 -o "${{ env.ARTIFACT_NAME_PREFIX }}-linux"
make ${{ matrix.build_target }}
mv build/bin/${{ env.ARTIFACT_NAME_PREFIX }} build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}
shell: bash

- name: Make binary executable
run: chmod +x "./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-linux"
run: chmod +x "./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}"
shell: bash

- name: Create ZIP file
run: |
cd ./build/bin
zip -r "${{ env.ARTIFACT_NAME_PREFIX }}-linux.zip" "${{ env.ARTIFACT_NAME_PREFIX }}-linux"
zip -r "${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}.zip" "${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}"
shell: bash

- name: Upload build assets
uses: actions/upload-artifact@v4
with:
name: artifact_l
path: ./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-linux.zip
name: artifact_l_${{ matrix.variant }}
path: ./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}.zip

build_w:
name: Build for Windows
Expand Down Expand Up @@ -358,10 +371,15 @@ jobs:
with:
name: artifact_m

- name: Download artifact L
- name: Download artifact L (webkit 4.0)
uses: actions/download-artifact@v4
with:
name: artifact_l_webkit40

- name: Download artifact L (webkit 4.1)
uses: actions/download-artifact@v4
with:
name: artifact_l
name: artifact_l_webkit41

- name: Generate SHA256 Checksums
run: |
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.9.3] 2025-11-05
### Added
- Add `build_webkit41` Makefile target for Ubuntu 24.04+ and Debian 13+ support
- Add Linux matrix builds for webkit 4.0 and 4.1 support in CI

### Fixed
- Fix Linux startup crash by making EditMenu macOS-only

### Changed
- Update README and INSTALLATION documentation for webkit 4.0/4.1 support

## [0.9.2] 2025-11-04
### Added
- Add uninstall instructions to `INSTALLATION.md`
Expand Down Expand Up @@ -175,3 +186,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.9.0]: https://github.com/scanoss/scanoss.cc/compare/v0.8.1...v0.9.0
[0.9.1]: https://github.com/scanoss/scanoss.cc/compare/v0.9.0...v0.9.1
[0.9.2]: https://github.com/scanoss/scanoss.cc/compare/v0.9.1...v0.9.2
[0.9.3]: https://github.com/scanoss/scanoss.cc/compare/v0.9.2...v0.9.3
41 changes: 32 additions & 9 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,41 @@ The script automatically:

### Manual Installation

#### All Distributions
#### Choosing the Right Binary

SCANOSS Code Compare provides two Linux binaries to support different WebKit versions:

- **Ubuntu 24.04+ / Debian 13+**: Download `scanoss-cc-linux-amd64-webkit41.zip`
- **All other systems**: Download `scanoss-cc-linux-amd64.zip`

#### Installation Steps

1. Download the appropriate binary for your system from [releases](https://github.com/scanoss/scanoss.cc/releases)

1. Download `scanoss-cc-linux.zip` from [releases](https://github.com/scanoss/scanoss.cc/releases)
2. Extract and install:

**For Ubuntu 22.04 and older / Debian 12 and older:**
```bash
unzip scanoss-cc-linux-amd64.zip
sudo mv scanoss-cc-linux-amd64 /usr/local/bin/scanoss-cc
```

**For Ubuntu 24.04+ / Debian 13+:**
```bash
unzip scanoss-cc-linux.zip
chmod +x scanoss-cc-linux
sudo mv scanoss-cc-linux /usr/local/bin/scanoss-cc
unzip scanoss-cc-linux-amd64-webkit41.zip
sudo mv scanoss-cc-linux-amd64-webkit41 /usr/local/bin/scanoss-cc
```

3. Install dependencies based on your distribution:

**Debian/Ubuntu:**
**Debian/Ubuntu (22.04 and older):**
```bash
sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37
sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0
```

**Debian/Ubuntu (24.04+ / Debian 13+):**
```bash
sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0
```

**Fedora/RHEL:**
Expand Down Expand Up @@ -422,11 +441,15 @@ $env:Path -split ';' | Select-String SCANOSS

**Issue:** Missing GTK/WebKit dependencies

**Solution:** Install required libraries:
**Solution:** Install required libraries based on your OS version:

```bash
# Debian/Ubuntu
# Ubuntu 22.04 and older / Debian 12 and older
sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37

# Ubuntu 24.04+ / Debian 13+
sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0

# Fedora
sudo dnf install gtk3 webkit2gtk4.0

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export GOTOOLCHAIN=go1.23.0
.DEFAULT_GOAL := help

help: ## Show available commands
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

clean: ## Clean all build data
@echo "Removing build data..."
Expand Down Expand Up @@ -72,3 +72,7 @@ build_macos: clean cp_assets ## Build the application image for macOS
@echo "Building application image for macOS..."
@wails build -ldflags "-X github.com/scanoss/scanoss.cc/backend/entities.AppVersion=$(VERSION)" -platform darwin/universal -o "$(APP_NAME)"
@echo "Build completed. Result: $(APP_BUNDLE)"

build_webkit41: clean cp_assets ## Build the application image for Ubuntu 24.04+/Debian 13+ (webkit 4.1)
@echo "Building application image with webkit2_41 tags..."
@wails build -ldflags "-X github.com/scanoss/scanoss.cc/backend/entities.AppVersion=$(VERSION)" -tags webkit2_41
61 changes: 42 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@ See [INSTALLATION.md](INSTALLATION.md) for PATH setup and installation to Progra
<details>
<summary><b>Linux</b></summary>

1. Download `scanoss-cc-linux.zip` from the [releases page](https://github.com/scanoss/scanoss.cc/releases)
2. Extract and run:
Choose the appropriate binary for your system from the [releases page](https://github.com/scanoss/scanoss.cc/releases):
- **Ubuntu 22.04 and older / Debian 12 and older**: [scanoss-cc-linux-amd64.zip](https://github.com/scanoss/scanoss.cc/releases/latest/download/scanoss-cc-linux-amd64.zip)
- **Ubuntu 24.04+ / Debian 13+**: [scanoss-cc-linux-amd64-webkit41.zip](https://github.com/scanoss/scanoss.cc/releases/latest/download/scanoss-cc-linux-amd64-webkit41.zip)

Extract and run:
```bash
unzip scanoss-cc-linux.zip
chmod +x scanoss-cc-linux
sudo mv scanoss-cc-linux /usr/local/bin/scanoss-cc
# For Ubuntu 22.04 and older
unzip scanoss-cc-linux-amd64.zip
sudo mv scanoss-cc-linux-amd64 /usr/local/bin/scanoss-cc

# For Ubuntu 24.04+ (webkit 4.1)
unzip scanoss-cc-linux-amd64-webkit41.zip
sudo mv scanoss-cc-linux-amd64-webkit41 /usr/local/bin/scanoss-cc
```

See [INSTALLATION.md](INSTALLATION.md) for detailed instructions.
Expand Down Expand Up @@ -143,6 +150,32 @@ scanoss-cc scan . --key $SCANOSS_API_KEY --apiurl $SCANOSS_API_URL --debug

## Development

### Dependencies

Before setting up the development environment, ensure you have the following dependencies installed:

**Prerequisites:**
- Go 1.23+
- Node.js and npm

**System Dependencies (Debian/Ubuntu):**

For Ubuntu 22.04 and older:
```bash
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.0-dev
```

For Ubuntu 24.04+ / Debian 13+:
```bash
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev
```

**Install Wails CLI:**
```bash
go install github.com/wailsapp/wails/v2/cmd/wails@latest
```
### Setting Up the Development Environment

1. Clone the repository:
Expand Down Expand Up @@ -182,22 +215,12 @@ wails dev -appargs "--input <resultPath>"
make build
```

### Known Issues

#### Ubuntu 24.04 WebKit Issue
### Building for Different Linux Versions

Ubuntu 24.04 includes webkit 4.1 while Wails expects webkit 4.0. To resolve:
SCANOSS Code Compare provides two Linux build variants to support different WebKit versions:

For production:
```bash
sudo ln -sf /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37 &&
sudo ln -sf /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18
```

For development:
```bash
wails dev -tags webkit2_41
```
- Use `make build` for Ubuntu 22.04 and older (WebKit 4.0)
- Use `make build_webkit41` for Ubuntu 24.04+/Debian 13+ (WebKit 4.1)

## Contributing

Expand Down
6 changes: 4 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ func (a *App) initializeMenu() {
globalShortcuts := groupedShortcuts[entities.GroupGlobal]
viewShortcuts := groupedShortcuts[entities.GroupView]

AppMenu.Append(menu.EditMenu())

// Add custom global shortcuts to File menu
FileMenu := AppMenu.AddSubmenu("File")
for _, shortcut := range globalShortcuts {
Expand Down Expand Up @@ -168,6 +166,10 @@ func (a *App) initializeMenu() {
runtime.EventsEmit(a.ctx, string(entities.ActionShowKeyboardShortcutsModal))
})

if env := runtime.Environment(a.ctx); env.Platform == "darwin" {
AppMenu.Append(menu.EditMenu())
}

runtime.MenuSetApplicationMenu(a.ctx, AppMenu)
}

Expand Down
Loading