diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.devcontainer/Dockerfile /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.devcontainer/Dockerfile --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.devcontainer/Dockerfile 2024-11-08 15:33:36.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.devcontainer/Dockerfile 2024-10-07 14:39:32.000000000 +0000 @@ -6,23 +6,10 @@ # Install the necessary packages -RUN dnf copr enable -y atim/starship && dnf copr enable elxreno/zsync -y - -RUN dnf up -y --allowerasing - -RUN dnf install -y golang gtk4-devel gobject-introspection-devel git @development-tools @development-libs @c-development @rpm-development-tools flatpak-builder python3-pip sudo starship fedora-packager upx patchelf fuse clang go-rpm-macros yq wget mesa* dbus-launch - -RUN wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) -RUN chmod +x appimagetool-*.AppImage -RUN mv appimagetool-* appimagetool -RUN mv appimagetool /usr/local/bin -RUN wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "mkappimage-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) -RUN chmod +x mkappimage-*.AppImage -RUN mv mkappimage-* mkappimage -RUN mv mkappimage /usr/local/bin +RUN dnf install -y golang gtk4-devel gobject-introspection-devel git @development-tools @development-libs flatpak-builder apt-get python3-pip && dnf clean all -y # AppImage Builder dependencies -RUN dnf install -y binutils coreutils desktop-file-utils fakeroot fuse patchelf python3-pip python3-setuptools squashfs-tools strace util-linux zsync nano micro +RUN sudo dnf install -y binutils coreutils desktop-file-utils fakeroot fuse patchelf python3-pip python3-setuptools squashfs-tools strace util-linux zsync -RUN pip3 install appimage-builder --break-system-packages +RUN sudo pip3 install appimage-builder --break-system-packages # Set the working directory @@ -32,21 +19,8 @@ # add them to the wheel and sudo groups RUN usermod -aG wheel dev -RUN groupadd -f sudo && usermod -aG sudo dev - -# THE ULTIMATE BASHRC FROM MY NORMAL COMPUTER'S DEV ENVIRONMENT -RUN wget -O /home/dev/.bashrc https://sourceforge.net/projects/ultimate-bashrc/files/_bashrc/download +RUN usermod -aG sudo dev USER dev -# Fixes installing Rokon flatpak in dev environment -ENV FLATPAK_SYSTEM_HELPER_ON_SESSION=foo -ENV CC=clang -ENV CXX=clang++ - - -# Flatpak dependencies -RUN flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo -RUN flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo - WORKDIR /app diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.devcontainer/devcontainer.json /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.devcontainer/devcontainer.json --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.devcontainer/devcontainer.json 2024-11-08 15:33:36.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.devcontainer/devcontainer.json 2024-10-07 14:39:32.000000000 +0000 @@ -2,41 +2,8 @@ { "name": "Rokon Development", - "build": { - "dockerfile": "Dockerfile" - }, - "containerUser": "dev", - "runArgs": [ - "--privileged", // Adds SYS_ADMIN capability for FUSE - "--device=/dev/fuse", // Grants access to FUSE device - "--security-opt", - "seccomp=unconfined", // Disables seccomp (optional) - "--security-opt", - "apparmor=unconfined", // Disable AppArmor (unconfined profile) - "--security-opt", - "label=disable" // Disable SELinux enforcing - ], - "mounts": [ - "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached", - "source=/dev/dri,target=/dev/dri,type=bind", - "source=/dev/snd,target=/dev/snd,type=bind", - "source=/etc/asound.conf,target=/etc/asound.conf,type=bind" - ], - "containerEnv": { - "XDG_RUNTIME_DIR": "/tmp", - "WAYLAND_DISPLAY": "wayland-0", - "DISPLAY": ":0", - "XDG_SESSION_TYPE": "wayland" - }, + "build": { "dockerfile": "Dockerfile" }, "customizations": { "vscode": { - "extensions": [ - "golang.Go", - "davidanson.vscode-markdownlint", - "ms-azuretools.vscode-docker", - "vivaxy.vscode-conventional-commits", - "rangav.vscode-thunder-client", - "rangav.code-thunder-client", - "ms-vscode.makefile-tools" - ] + "extensions": ["golang.Go", "davidanson.vscode-markdownlint", "ms-azuretools.vscode-docker", "vivaxy.vscode-conventional-commits", "rangav.vscode-thunder-client", "rangav.code-thunder-client", "ms-vscode.makefile-tools"] } } diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.github/workflows/build-on-other-arches.yml /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.github/workflows/build-on-other-arches.yml --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.github/workflows/build-on-other-arches.yml 2024-11-08 15:33:36.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.github/workflows/build-on-other-arches.yml 2024-11-02 20:24:48.000000000 +0000 @@ -92,9 +92,13 @@ CC: "clang" CXX: "clang++" + setup: | + mkdir -p "${PWD}/artifacts" + git config --global --add safe.directory '*' + rm -rf /root/go/pkg/mod/cache/vcs || true githubToken: ${{ secrets.GITHUB_TOKEN }} install: | - dnf install -y clang gtk4-devel gobject-introspection-devel go wget shc - dnf remove -y git + dnf install -y clang git gtk4-devel gobject-introspection-devel go wget shc run: | + git config --global --add safe.directory '*' make run make tarball @@ -172,20 +176,24 @@ swap_size: 4 swap_location: '/mnt/swapfile' - - name: Build armhf on Latest Ubuntu Release + - name: Build armhf on Mageia Cauldron uses: uraimo/run-on-arch-action@v2 with: - arch: armv7 - distro: ubuntu_latest + arch: none + distro: none + dockerRunArgs: --platform linux/arm + base_image: docker.io/mageia:cauldron env: | CC: "clang" CXX: "clang++" - githubToken: ${{ secrets.GITHUB_TOKEN }} + setup: | + mkdir -p "${PWD}/artifacts" + git config --global --add safe.directory '*' + rm -rf /root/go/pkg/mod/cache/vcs || true + #githubToken: ${{ secrets.GITHUB_TOKEN }} install: | - apt update - apt full-upgrade -y - apt install -y libgtk-4-dev libgirepository1.0-dev software-properties-common make clang - add-apt-repository ppa:longsleep/golang-backports - apt install -y golang-go + dnf in -y dnf5 + dnf5 install -y clang git gtk4-devel gobject-introspection-devel go wget shc run: | + git config --global --add safe.directory '*' make run make tarball @@ -273,4 +281,5 @@ CXX: "clang++" setup: | + mkdir -p "${PWD}/artifacts" git config --global --add safe.directory /home/runner/work/Rokon/Rokon rm -rf /root/go/pkg/mod/cache/vcs || true diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.github/workflows/copr.yml /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.github/workflows/copr.yml --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.github/workflows/copr.yml 2024-11-08 15:33:36.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.github/workflows/copr.yml 2024-10-25 19:27:04.000000000 +0000 @@ -29,3 +29,5 @@ COPR_LOGIN: ${{ secrets.COPR_LOGIN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: go run -v . + run: | + go get + go run -v . diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.github/workflows/publish.yml /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.github/workflows/publish.yml --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.github/workflows/publish.yml 2024-11-08 17:28:12.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.github/workflows/publish.yml 2024-11-04 17:19:14.000000000 +0000 @@ -449,52 +449,4 @@ # GH_URL: 'https://api.github.com/' # HUSKY: 0 - test-artifacts: - # runs-on: [self-hosted, docker] - runs-on: ubuntu-24.04 - needs: [archlinux, fedora] - strategy: - fail-fast: false - matrix: - os: - - ubuntu:22.04 - - mageia:latest - - redhat/ubi9 - - opensuse/leap:latest - - debian:latest - - archlinux:latest - - fedora:38 - container: - image: ${{ matrix.os }} - options: >- - --privileged - --cap-add=SYS_ADMIN - --cap-add=SYS_PTRACE - - steps: - - uses: actions/download-artifact@v4 - with: - merge-multiple: true - - - name: Run binary tests - run: | - chmod +x *.run || true - chmod +x *.AppImage || true - - # Check if there are any .run or .AppImage files - if ls ./*.run &>/dev/null; then - # Loop through all .run files - for BINARY in *.run; do - echo "Running binary: $BINARY" - ./$BINARY --version - done - fi - - if ls ./*.AppImage &>/dev/null; then - # Loop through all .AppImage files - for BINARY in *.AppImage; do - echo "Running binary: $BINARY" - ./$BINARY --version - done - fi windows: runs-on: windows-latest diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.gitpod.yml /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.gitpod.yml --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/.gitpod.yml 2024-11-08 15:33:36.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/.gitpod.yml 2024-10-07 14:39:32.000000000 +0000 @@ -31,6 +31,6 @@ - ms-vscode.makefile-tools tasks: - - init: sudo apt update && && sudo apt install -y libgtk-4-dev libgirepository1.0-dev golang-go && make - command: make dev + - init: sudo apt update && sudo apt install -y libgtk-4-dev libgirepository1.0-dev && go get && go build ./... && go test ./... && make + command: go run . diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/Makefile /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/Makefile --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/Makefile 2024-11-08 17:28:10.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/Makefile 2024-11-04 17:19:12.000000000 +0000 @@ -231,5 +231,5 @@ @echo "This process requires the following command line utils to work properly: awk, ldd, tar" @echo "SHELL: $(SHELL) ARCH: $(ARCH)" - rm -rf $(TARBALLDIR) + rm -rf $(TARBALLDIR) || sudo rm -v -rf $(TARBALLDIR) mkdir -p $(TARBALLDIR) mkdir -p $(TBLIBSDIR) diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/PKGBUILD /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/PKGBUILD --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/PKGBUILD 2024-11-08 17:28:36.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/PKGBUILD 2024-11-04 17:19:38.000000000 +0000 @@ -2,5 +2,5 @@ pkgname=rokon -pkgver=1.0.0+470f4f6 +pkgver=1.0.0+d7b37be pkgrel=1 epoch=0 diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/main.go /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/main.go --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/main.go 2024-11-08 17:28:10.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/main.go 2024-11-04 17:19:12.000000000 +0000 @@ -5,5 +5,4 @@ "encoding/xml" "fmt" - "io" "log" "net" @@ -111,39 +110,13 @@ commit = "unknown" branch = "unknown" - logFilePath = filepath.Join(xdg.DataHome, "rokon", "logs", "latest.log") + logFilePath = filepath.Join(xdg.DataHome, "rokon", "latest.log") tempDir = filepath.Join(xdg.CacheHome, "rokon") ) func main() { - err := os.MkdirAll(filepath.Dir(logFilePath), 0755) - if err != nil { - fmt.Println("Error creating directory:", err) - return - } - // Open a log file (in append mode). - logFile, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666) - if err != nil { - fmt.Println("Error opening rokon log file:", err) - return - } - defer logFile.Close() - multiWriter := io.MultiWriter(os.Stdout, logFile) - - // Set the logger to output to the file - log.SetOutput(multiWriter) - - // You can also customize the logger with a prefix and timestamp - log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile) - // Create a new logger that writes to the file. - customLogger := log.New(logFile, "SSDP: ", log.Ldate|log.Ltime|log.Lshortfile) - - // Assign the custom logger to the SSDP.Logger field. - ssdp.Logger = customLogger - telemetryLogger := log.New(logFile, "TELEMETRY: ", log.Ldate|log.Ltime|log.Lshortfile) - log.Printf("Log file: %s", logFilePath) fmt.Println("Starting Rokon. Now with more telemetry!") switch runtime.GOOS { case "windows", "darwin": - telemetryLogger.Println("Running on Windows or macOS.") + fmt.Println("Running on Windows or macOS.") // Use GLib to set the GTK_CSD environment variable for Client-Side Decorations glib.Setenv("GTK_CSD", "0", true) @@ -156,5 +129,5 @@ app.SetVersion(version) } - log.Printf("Version %s commit %s branch %s\n", version, commit, branch) + fmt.Printf("Version %s commit %s branch %s\n", version, commit, branch) switch runtime.GOOS { case "linux": @@ -169,5 +142,5 @@ } - telemetryLogger.Printf("Running on Linux. Specifically: %s %s with %s %s %s and %s\n", + log.Printf("Running on Linux. Specifically: %s %s with %s %s %s and %s\n", release, arch, desktop, os.Getenv("DESKTOP_SESSION"), kdeSessionVersion, sessionType) @@ -182,5 +155,5 @@ container := os.Getenv("container") if container != "" && container == "flatpak" { - telemetryLogger.Println("Running from a Flatpak") + log.Println("Running from a Flatpak") createEvent("flatpak_run", map[string]interface{}{ "flatpak": container, @@ -188,5 +161,5 @@ }) } else if snap := os.Getenv("SNAP"); snap != "" { - telemetryLogger.Println("Running from a Snap") + log.Println("Running from a Snap") createEvent("snap_run", map[string]interface{}{ "snap": snap, @@ -194,9 +167,9 @@ }) } else if appImage := os.Getenv("APPIMAGE"); appImage != "" { - telemetryLogger.Println("Running from an AppImage") + log.Println("Running from an AppImage") firejail := isRunningWithFirejail() if firejail { - telemetryLogger.Println("Running from an AppImage with firejail") + log.Println("Running from an AppImage with firejail") // Adjust telemetry or other settings as needed. } @@ -211,5 +184,5 @@ }) } else if isPackaged == "true" { - telemetryLogger.Println("Running from a native package") + log.Println("Running from a native package") createEvent("native_run", map[string]interface{}{ "nativeVersion": version, // Replace with your app version logic @@ -221,9 +194,9 @@ release := getOSRelease() arch := runtime.GOARCH - telemetryLogger.Printf("Running on Windows. Specifically: %s %s\n", + log.Printf("Running on Windows. Specifically: %s %s\n", release, arch) if packageFormat == "portable" { - telemetryLogger.Println("Running from a portable executable") + log.Println("Running from a portable executable") } @@ -236,5 +209,5 @@ release := getOSRelease() arch := runtime.GOARCH - telemetryLogger.Printf("Running on macOS. Specifically: %s %s\n", + log.Printf("Running on macOS. Specifically: %s %s\n", release, arch) @@ -247,5 +220,5 @@ }) default: - telemetryLogger.Printf("Unsupported telemetry platform: %s %s %s. However, the application will continue.\n", + log.Printf("Unsupported telemetry platform: %s %s %s. However, the application will continue.\n", runtime.GOOS, getOSRelease(), runtime.GOARCH) createEvent("unsupported_platform", map[string]interface{}{ @@ -515,5 +488,5 @@ } imagePath := filepath.Join(tempDir, "device-image.png") - log.Println(imagePath) + println(imagePath) // image := gtk.NewImageFromFile(imagePath) diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/scripts/copr/main.go /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/scripts/copr/main.go --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/scripts/copr/main.go 2024-11-08 17:28:10.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/scripts/copr/main.go 2024-11-04 17:19:12.000000000 +0000 @@ -5,5 +5,4 @@ "encoding/json" "fmt" - "io" "io/ioutil" "log" @@ -157,5 +156,5 @@ defer resp.Body.Close() - body, err := io.ReadAll(resp.Body) + body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatalf("Error reading response: %v", err) diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/scripts/md2rtf/main.go /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/scripts/md2rtf/main.go --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/scripts/md2rtf/main.go 2024-11-08 17:28:10.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/scripts/md2rtf/main.go 2024-11-04 17:19:12.000000000 +0000 @@ -63,5 +63,5 @@ } defer resp.Body.Close() - return io.ReadAll(body) + return ioutil.ReadAll(body) } else { // Handle local image paths @@ -79,5 +79,5 @@ defer reader.Close() - return io.ReadAll(reader) + return ioutil.ReadAll(reader) } diff -U2 -r /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/scripts/rtf2plaintext/main.go /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/scripts/rtf2plaintext/main.go --- /var/lib/copr-rpmbuild/results/rokon/upstream-unpacked/Source0/scripts/rtf2plaintext/main.go 2024-11-08 17:28:10.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/rokon/srpm-unpacked/rokon-vendored-source.zip-extract/scripts/rtf2plaintext/main.go 2024-11-04 17:19:12.000000000 +0000 @@ -2,4 +2,5 @@ import ( + "io/ioutil" "log" "os" @@ -46,5 +47,5 @@ // Write the plain text to the new .txt file - if err := os.WriteFile(txtFilePath, []byte(output), 0o644); err != nil { + if err := ioutil.WriteFile(txtFilePath, []byte(output), 0o644); err != nil { log.Printf("Failed to write to file %s: %v", txtFilePath, err) continue