Commit 103708216d

103708216d407238d80734ff6a60e7e471a1b6ec

parent: ab92766619

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-26 16:21 UTC

Add: It is a build system baby :0

Layout: unified · split

Build/CurdInstaller.exe deleted

Binary file not shown.

Build/build → Build/buildlinux renamed
Build/buildwindows +1 −4
@@ -1,4 +1 @@
1@echo off 1GOOS=windows GOARCH=amd64 go build -o curd.exe -ldflags="-s -w" cmd/curd/main.go\ No newline at end of file
2set GOOS=windows
3set GOARCH=amd64
4go build -o curd.exe -ldflags="-s -w" -trimpath cmd\curd\main.go\ No newline at end of file
Build/curd-windows-build.iss +25
@@ -0,0 +1,25 @@
1[Setup]
2AppName=Curd Installer
3AppVersion=0.0.3
4DefaultDirName={pf}\Curd
5DefaultGroupName=Curd
6AllowNoIcons=yes
7OutputBaseFilename=CurdInstaller
8UsePreviousAppDir=yes
9Compression=lzma2
10SolidCompression=yes
11
12[Tasks]
13; Define a task for creating a desktop shortcut
14Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional Options";
15
16[Files]
17; Copy the Curd executable to the install directory
18Source: "Z:releases/curd-0.0.3/windows/curd.exe"; DestDir: "{app}"; Flags: ignoreversion
19Source: "Z:\home/wraient/Projects/curd/Build/mpv.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
20
21[Icons]
22; Create the application icon in the Start Menu
23Name: "{group}\Curd"; Filename: "{app}\curd.exe"
24; Create a desktop shortcut if the user checked the option
25Name: "{userdesktop}\Curd"; Filename: "{app}\curd.exe"; Tasks: desktopicon
Build/curd-windows-build_original.iss deleted −25
@@ -1,25 +0,0 @@
1[Setup]
2AppName=Curd Installer
3AppVersion=1.0
4DefaultDirName={pf}\Curd
5DefaultGroupName=Curd
6AllowNoIcons=yes
7OutputBaseFilename=CurdInstaller
8UsePreviousAppDir=yes
9Compression=lzma2
10SolidCompression=yes
11
12[Tasks]
13; Define a task for creating a desktop shortcut
14Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional Options";
15
16[Files]
17; Copy the Curd executable to the install directory
18Source: "C:\Users\Rushikesh\Documents\Projects\curd\curd.exe"; DestDir: "{app}"; Flags: ignoreversion
19Source: "C:\Users\Rushikesh\Documents\Projects\curd\bin\mpv.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
20
21[Icons]
22; Create the application icon in the Start Menu
23Name: "{group}\Curd"; Filename: "{app}\curd.exe"
24; Create a desktop shortcut if the user checked the option
25Name: "{userdesktop}\Curd"; Filename: "{app}\curd.exe"; Tasks: desktopicon
Build/curd.exe deleted

Binary file not shown.

Build/release added +90
@@ -0,0 +1,90 @@
1#!/bin/bash
2
3# Function to comment/uncomment lines in internal/player.go
4function toggle_winio_import() {
5 local action="$1"
6 local file="internal/player.go"
7
8 if [ "$action" == "comment" ]; then
9 # Comment out the go-winio import line
10 sed -i 's|^\(\s*"github.com/Microsoft/go-winio"\)|// \1|' "$file"
11 # Comment out the usage of winio.DialPipe
12 sed -i 's|^\(.*conn, err = winio.DialPipe.*\)|// \1|' "$file"
13 elif [ "$action" == "uncomment" ]; then
14 # Uncomment the go-winio import line
15 sed -i 's|// \(\s*"github.com/Microsoft/go-winio"\)|\1|' "$file"
16 # Uncomment the usage of winio.DialPipe
17 sed -i 's|^// \(.*conn, err = winio.DialPipe.*\)|\1|' "$file"
18 fi
19}
20
21
22# Ask for version number
23read -p "Enter the version number: " version
24release_folder="releases/curd-$version"
25windows_folder="$release_folder/windows"
26linux_folder="$release_folder/linux"
27installer_script="Build/curd-windows-build.iss"
28
29# Ensure required directories exist
30mkdir -p "$windows_folder" "$linux_folder"
31
32# Update version in the installer script
33sed -i "s/^AppVersion=.*/AppVersion=$version/" "$installer_script"
34
35# Update Source paths in the installer script
36sed -i "s|Source: \".*curd.exe\"|Source: \"Z:$windows_folder/curd.exe\"|" "$installer_script"
37# sed -i "s|Source: \".*mpv.exe\"|Source: \"Z:$windows_folder/mpv.exe\"|" "$installer_script"
38
39# Comment out winio-related lines for Linux build
40echo "Commenting out go-winio lines for Linux build..."
41toggle_winio_import "comment"
42
43# Build Linux binary
44echo "Building Linux binary..."
45bash Build/buildlinux
46
47# Move the Linux binary to the release folder
48if [ -f "curd" ]; then
49 mv curd "$linux_folder/"
50else
51 echo "Linux build failed. Please check Build/buildlinux."
52 exit 1
53fi
54
55# Uncomment winio-related lines after Linux build
56echo "Uncommenting go-winio lines..."
57toggle_winio_import "uncomment"
58
59# Build Windows binary
60echo "Building Windows binary..."
61bash Build/buildwindows
62
63# Move the Windows binary to the release folder
64if [ -f "curd.exe" ]; then
65 mv curd.exe "$windows_folder/"
66else
67 echo "Windows build failed. Please check Build/buildwindows."
68 exit 1
69fi
70
71# # Copy mpv.exe to the Windows release folder
72# if [ -f "Build/mpv.exe" ]; then
73# cp "Build/mpv.exe" "$windows_folder/"
74# else
75# echo "mpv.exe not found. Skipping copy."
76# fi
77
78# Create Windows installer with Inno Setup
79echo "Creating Windows installer..."
80wine "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "$installer_script"
81
82# Move installer to the release folder
83installer_output="Build/Output/CurdInstaller.exe" # Replace with actual output location if different
84if [ -f "$installer_output" ]; then
85 mv "$installer_output" "$windows_folder/CurdInstaller-v$version.exe"
86else
87 echo "Installer creation failed. Please check Inno Setup script output."
88fi
89
90echo "Release build completed in $release_folder."